Statistical Arb/Pairs trading strategy!

Interesting chart :slight_smile:

To calculate your stop, you could either do it mathematically, or visually. The maths should just be a matter of calculating out how much the EG moves in relation to EU or GU moves, I think FXEZ just posted something that you should be able to use to work it out.

If you want to do it visually, I would say you need to look at the divergence size. Take a look on your EG chart historically and find where there is an EU/GU divergence that then closes. Any size divergence will do, lets say you see one at 20 pips. You need to measure the move in the EG from the start of the divergence to the end of the divergence. Then you know, if the EU/GU diverge by 20 pips, the EG will have moved by x pips.

You can then use that as the basis to decide how big to set your stop. So lets say you often get a divergence of 40 pips, and you are happy to enter then, but if it gets to 80 pips, then you would close your trade. You know that each divergence of 20 pips equates to x pips move in the EG, so you know where to set your stop (and profit point aswell).

Iā€™m testing this strategy. Right now there is a divergence greater than 60 pips that Iā€™m trading on a demo account. Today I expect to measure the max divergence on M1 view for all the data that I have on EU/GU and AJ/CJ, to know what we can expect to be the max no realized loss the account must support, to define the lot size :slight_smile:

If you are trading a single pair, I think you should place the stop on the point where you donā€™t want more loss. You should define what are you willing to loss, that is the risk you must accept. Then place a stop in the point where the trade will reach that loss. The profit should be at least the same amount, better if double or more.

Medisoft, what are you using thos xxxUSDX lines for? are those a kind of reference points?

Yes, they are something like a reference points, instead of overlaying the charts, I calculated that lines to be the same as overlaying :slight_smile:

Iā€™m running the analysis right now on EU/GU to see the max divergence of the pairs from a correlated point (entry point).

How to make combination of 2 pairs in one charts?

there are some pretty good explanations earlier in the thread, but there is 2 ways, the author uses 2 Metatraders application running, and using [I]VITRITE[/I] to make one of the windows transparent.

My version is using a OverlayChart MA indicator(posted earlier) that shows the correlation in the indicator window.

[EDIT]
Wery annoying that whenever I look back at a trade, I cant find out why I took it :confused: I should start saving screenshots :open_mouth:

Ok, this are the stats

for EU/GU, in 1M view

The max divergence is 369 pips, and using the standard entry of 20 pips you can get about 1 trade daily

for AJ/CADJPY, in 1M view

The max divergence is 58 pips, and using the standard entry of 20 pips you can get about 2 trades daily

The center for each divergence is placed when the correlation on M1 is bigger than 80 %

As you can see, AJ/CJ has more trades with less risk than EU/GU

How far back did you go medisoft?

So you are saying if you go in after 20 pips divergence you could still have it move against you 349 pips?

Did the two ever converge for a profit?

If so how long did it take?

Thatā€™s interesting. Yes, I am not surprised, they do appear to diverge quite a bit. I also found that by changing the timeframe to hourly or daily, you can quickly get a feel for how much a pair diverge. I did this initially with a number of pairs to see which were more likely to diverge.

When you say a standard entry of 20 pips gives you one entry per day, do you mean once it has diverged 20 pips from 0 (i.e. no divergence at all), or just diverged 20 pips relatively from where it was (say moving from 40 pip divergence to 60 pips)?

I had limited bars on M1. On EU/GU I went up to 5 Feb (about 40 trading days), on AJ/CJ I went only 10 days back because CJ is limiting me to go more in history.

All the test finished when they converged. The methodology was this:

First, find the center. I do this when the correlation on M1 is above 80 %. After I got the max correlation, I set the center of both pairs.
Then, I wait until they diverge for 20 pips. At that point I mark an entry as ā€œonTradeā€.
Then, while the ā€œonTradeā€ is active, I measure the divergence, setting the max, min and average.
Then, when the divergence is zero or it inverts sign, I mark an exit and cancel the ā€œonTradeā€ signal.
then I go to step 1, to look for a new center and then another entry

The MAX are the max risk the program found on all the history. The average is lower, but I think to think on max risk is safer.

As you can sell, with this algorithm all the trades must finish with profit.

EDIT

I didnā€™t measure the time it took for a trade to finish, but I never placed two trades at same time, so if you can get 1 trade per day for EU/GU and 2 for AJ/CJ, that means that for EU/GU the trade lasts 1 day on average and 12 hours on AJ/CJ on average.

The first, 20 pips from 0.

Average one trade per day
guaranteed profitable seems like you just up your lot size on both pairs equally to make sure that it is worth it.
Am I missing something?

Thatā€™s not right. What you need to do is to size your lot size thinking that you are going to sustain a loss of 350 pips.

If your account is 1000 dollars, and with this pretty good win/loss ratio, you could risk 10 percent of your account, that is 100 USD. And 100 USD must be enough to fit 350 pips of loss. That is about 0.028 full lots for EU/GU, then you could assign that 0.028 to each one. That is small risk reward, but is safe.

On AJ/CJ the risk reward is better, you need to support only 60 pips of loss, so you can have a bigger volume, and your risk reward could be 1:3

EDIT

Oh, and remember: trading is about probabilities. There is always a probability to exceed this limits, so you need to know when to stop the trade and look for another one.

Iā€™m going to repeat the tests, but this time Iā€™m going to check how many times the divergence exceeded 100 pips, to make that my own risk limit. If on 50 trades, only one exceeds 100 pips, that is a wonderful system, if half of them exceeds that number, maybe it is not too good.

EDIT2

Well, that was fast. 7 of 57 trades exceeded 100 pips on EU/GU. Zero on AJ/CJ. This is a winner system :slight_smile:

350 pip loss only if you close out there, but history shows if you hold it becomes profitable
that was why I was wondering how long that one took to come back from 350 pips divergence
if only one day and then profitable, then no problem if it took a week then that becomes a problem.
Thanks for the back testing you are doing.

I was wondering how often it diverged 50 pips? I know that would mean less trades but wouldnā€™t that mean more profits on the trades you make?

Kelton how are your trades going?
How much % are you up now?

Yes, it is looking like quite a high strike rate. Some trades might be open for a few days but clearly trading the ā€œthirdā€ currency pair makes this strategy much simpler, and safer as you can have actual TP and SL set (as opposed to trading both the correlated pairs where that isnā€™t really possible).

Medisoftā€¦are you still trading eu gu at the same time? or are you trading the third currency pair?

I was getting stopped out on my trades before and the chart was showing the price came no where near my stop
mostly after US trading hours, so I am using the hedge strategy to avoid this from happening, I am also taking profits sometimes before they cross because they are close and they may not cross but open up in the same direction for another opportunity. I am having more trading opportunities this way, that is also why I was thinking going 50 pips might be more profitable since they dont have to cross to take profits, but if they dont spread 50 pips that often I will be ok with taking 10 pips or so off every trade if I can get 4 or 5 trades a day. Sorry for all the questions just seems like a great strategy to get away from the stop issues I was having and wanted to make sure we where talking same strategy.

hey all,

iā€™m using a similar approach, but my timeframe is more like a few hours to a few days and not just a few hours max. yahoo finance can give you relative deviations of the two pairs you wanna look at which is kind of handy!