Statistical Arb/Pairs trading strategy!

Nop, I’m not using it, I think it doesn’t work very well, just like others.

I think one needs to do very good analysis on how the MT4 calculates the pixels on the charts to being able to do an indicator that exactly reproduces what Kelton recommends.

Hi,I think the problem is if there is a wery tight range on both pair(or maybe just one?) it will seem that the ‘visual’ pip size is wrong, and that it could be 20 when viewing the GU, but since the range of EU is much shorter? its to small to make a profit because of the spread or something?

Hi again, does anybody know of a way one could close all open positions at once on MT4?

Heja Norge, [B]Richard87[/B]!

Hi,
What you are doing is a bit like comparing apples with pears. You are initially comparing the relative strength of the Euro and sterling against the dollar, and then saying that the EURGBP should move as a result.

If the Euro strengthens against the dollar and sterling weakens against the dollar by the same amount (relatively speaking, we are not talking about actual pips here), the relationship between EUR and GBP has to stay the same, otherwise you would have an imbalance in the market.

If the EURUSD goes up and the GBPUSD goes down, but it doesn’t quite go down by the same amount, then we would see a move in the EURGBP as that is where the slack would be taken up.

Here is a chart from this morning that I have “assembled” (I hope you can see it ok). The fainter candles shows the EU, the bright candles are the GU and the blue line is the EG (closing price). Ignore the red line and horizontal blue line, they were just on my GU chart when I took the screen shot.


At line 1 the EU starts to rise and the GU starts to fall and 3 mins later at line 2 they have stopped. However the EG (blue line) has hardly moved at all.

After line 2, the EURUSD stays roughly where it is, but the GU recovers a little. As a result we see a slight rise in the EG by line 3.

Hope that helps.

Hi Jedster,

Thanks for the screenshot! It was illuminating to say the least. Did you get the overlay by using Vitrite as Kelton has done? What about the line chart of the EG? Is that using a customised indicator?

I would love to have a solution using only one instance of MT4 open like what medisoft did but my programming skills are rudimentary and I’ve only just been exposed to MQL4.

senelis, you could try one of these depending on if you want to close all open positions for a single symbol or for multiple symbols, trades in profit or trades in loss. There is also a tutorial that walks through how to write your own close all routine. MT4 Scripts

Hi,

No this isn’t produced using vitrite or anything that has been posted on the forum, it was using a a custom indicator that I wrote, to do exactly that sort of thing.

The indicators make it a little easier, however just by having two charts next to each other these correlation conditions can be seen. The more important question I think is how to determine when there is a genuine divergence in the price as opposed to a temporary/tradable change in the correlation.

Looking at the history of any correlated pairs shows instances where the prices diverge and it lasts for several days/weeks and in some cases, months! Whilst in principle since there are two trades overall we are market neutral, but it means the positions could widen and go against you for some considerable time before they eventually close.

Thank you, FXEZ, that’s perfect!

I found a curious problem with this technique. It is a problem with the way MT4 resize the screen to be able to display the whole chart.

I entered a trade on EU and GU based on the 20, 40 and 60 pip spread. But I notice that the “pips per pixel” on EU was a lot smaller than on GU, about 0.05 on EU to 0.11 on GU.

That means that for EU, one GU pixel is about 2 EU pixels.

So I think it is important that when you see a spread of 20 pips look to see if the pixel size on both charts are similar. If not, then better use the bigger pixel size instead of smaller one.

And this triggers a question to [B]Kelton[/B].

May I ask you if you look for the 20/40/60 pip spread on EU, on GU or in both charts, to decide entering a trade?

I see you place EU in front of GU, so if you measure there, you are measuring EU pips. If you invert the order, the you will be measuring GU pips, and if you try both, you are measuring on EU and GU. If both of them have similar spread, then I think they are valid, but I don’t know if I’m right :slight_smile:


By the way, I think this technique will not be a problem if you are using very high screen resolution, maybe about 1600 pixels width or more. But with 1280 / 2 that I use, the resizing is more frequent.

But if the pair is uncorrelated for long time, more minutes than your screen resolution, the similarity of the pixel size on both pairs is going to change also.

This is probably due to the scale differences of the EU and the GU. The price of the EU being 1.30 and the price pof the GU being 1.60. If they were identical prices, your pixels per pip would be the same. The bigger the difference between the 2 instruments, the biger the “error”.

For example, if you were looking at the S&P500 and the dow, the S&P being about 1400 and the dow being about 13000, the difference would be huge, perhaps even unusable…

I think it is another issue. Let say that one pair is trading at 0.50000 while the other is at 500.00.

If the range from the displayed price is 0.49500 to 0.50500 for first pair and 495.00 to 505.00 you are going to have a 100 Pip range. If the vertical resolution is 1000 pixels then you are going to have 0.1 pips per pixel on both pairs and they are similar, no mater the very big difference in price.

Yes, that is true, but it is very rare that you’ll get pairs that match up exactly like that. I was just trying to explain why you were seeing issues with the EU and GU…

You are right. I’m using a range from +/- 25 % difference on pips per pixel.

I mean if pair 1 let say EU is the base, and have 0.92 pips per pixel while GU has 1.03 pips per pixel, then that is about 12 % more pips per pixel on GU than EU, and it is valid for me.

And that seems to work pretty good.

I think this strategy is wonderful! Because this could be done only with the correlation indicator, but that indicator is lagging while this one is not lagging, you are effectively in the trade at the first moment the price lose the correlation, and when the correlation indicator notices about that, you are probably starting to correlate again :slight_smile:

Kelton, do you leave trades open on weekends? how do the opening on Sunday affects this technique?

:slight_smile:

There may be a solution to the pip per pixel ratio if I understand the issue correctly.

If you right click on each of the two chars you are overlaying and go to Properties > Common tab then click Scale fix.

You then need to change the figures so that the [B]difference [/B] between the fixed maximum and fixed minimum on both charts is the same. This will make sure both overlaid charts are showing at the same scale which should result in pips per pixel being the same across both charts!

Hope this makes sense!

Friends,

When I entered the trade (EUR/USD and GBP/USD) it was about 20 pips away on visual distance. I let the trade run entire night, to see, if next morning they come in contact , would I gain 15 pips (i.e. 20pips - 5 pips (trading cost)) or not, was the testing strategy. However, when they came in contact I was in loss of about 37 pips. The trade is still running and I am watching the end result.

I have been testing the strategy for a while after Kelton has published it, so far done about 10 trades. 8 trades were successful using the strategy but there were two trades where I lost, above example is included in the said two lost trades.

Initially when I lost the first trade, I thought the overlaying of the charts were incorrect and then on every trade I ensured my charting overlaying is right before I entered the trade. Even with overlaying being correct, I noticed the loss as explained above.

What could be the reason, any guesses?

From the said losing trade, I can notice that GBP/USD is absolutely in losses (in bull position) while EUR/USD is in gains in bull. Of course, I was short on GBP/USD and Long on EUR/USD. Could the difference between values of the currencies being one of the reason for being in losses? That’s just a wild guess.

Before trading with real money, I want to absolutely master the technique and testing it, so I can also apply money management techniques on top.

Its a lovely strategy but there are still unknowns that we got to unveil.

patforex, i think the above post explains what was wrong in your trade. The scale on both charts must be fixed at least for the time you are in position, otherwise the charts rescales themselves differently as the gap widens and visually they touch again, but because of the different scale your trade is in a loss.
It’s best to have the same pip range fixed on both pairs, then you can measure the pips more accurately, but the main point is that the scale must not change from opening a trade until closing. Or if you must, you can change it manually adding the same number of pips to both charts.

There’s just one problem that with a fixed scale they might never touch again :slight_smile:

What time did you enter the trades and what was your entry price for both currencies?

Kelton this is what happened to my trade today

The platforms screen automatically adjusts according to the current price and the previous waves within that time frame. So the positioning of the screen is automatically adjusted to fit the new waves. But my charts are not rescaling in pip size. They are just adjusting the screen. I checked using a grid in the background and both EU and GU matched up before and after the trade.
So visually it looks like the charts have touched when they really haven’t.
I took the trade with around a 55 pip distance between the 2 pairs EURUSD and GBPUSD
The pairs visually touched but it was no where near the profit I thought I’d be so I waited and waited to see if the prices would make a substantial cross, and after more than 12 hours I closed with a profit of 17 pips


So I don’t know how to fix the screen to not adjust, but can you even do that???
What should I do Kelton?

I guess if you trade and your lucky enough that the prices touch straight away and you don’t have to wait long, it will mean the screens wont adjust much.

Hi, as far as I have understood the market, while the EU and GU moves wery similar, while GU and EU share the same Tops and bottoms, the range of GU is statistically much higher than EU(I cant remember any reference for this thou), so I dont know when the smartest time is to close the trade, because, it could go for a long time before the prize closes again, I think it could be smarter to [B]DONT[/B] use the same lot size, but use the same ratio as for excample the average daily range for each, and then have a smaller lot size for GU and bigger for EU…

The biggest problem I think is to find the right ‘sample’ size for the charts, like original suggested, zooming all the way out and use 1min charts, can I ask how many minutes that is on your charts? On my chart that is 1171 minutes(bars).