Statistical Arb/Pairs trading strategy!

Thanks Guandi for the suggestion. I will playing with the numbers and see how they go.

Cheers

Pat

Agreed!! Jedster you have really helped I am setting up everything the way you are even though I had to follow you for awhile to catch on to the changes, I appreciate you explaining the BB that really helps like you say with PT and entry points, I can set up entry points and exit points and not have to watch so closely and miss out on trades in middle of night, I think that waiting at least 4 SD when you are trading against the trend is a good idea, and maybe 1 SD when you are trading with the trendā€¦

The approach is identical for Inverse correlated pairs, well nearly. We work out which way the trade is going so and then we want to make sure we are market neutral.

Taking the EURUSD and USDCHF as an example:

Because USD is the base in one and the quote in the other, if we buy EURUSD and Sell USDCHF, then yes, we have doubled our exposure to the USD. so, instead, we would be buying (or selling depending on our trade) both currencies.
So:
buy 1 EURUSD
buy 1 USDCHF

We are short USD from the 1st trade and long USD from the 2nd trade, so they net off and we are market neutral. That is, our position will be unaffected by the USD. This leaves us with a synthetic long EURCHF position.

Yep, pretty much just look at the BB. However, I do want to make sure is that we are not trading a genuine divergence in the EURGBP. That is, if there was some news or announcement that strengthened Sterling across the board, then EURGBP would fall. I donā€™t want to trade this. To determine that, I have a squawk service so that I can make sure about news, speeches and anything else that could affect the pricesā€¦ However, other than that, for this strategy, yes I now just have the EG with bollinger bands

Itā€™s just what people feel comfortable with. Once I proved to myself that they were the same thing, that was all I needed. There is nothing wrong with doing it with a synthetic, and as previously mentioned, with everything other than forex you have to. Forex uniquely gives us this ability.

It is worth noting that Iā€™ve been meaning to look into trading the correlation between the dow and the S&P or maybe the dow and FTSE. There you would have to buy one and sell the otherā€¦

I have to say, I am a little nervous about trading against the trend myself. However, the market does trend with pullbacks and that is what I keep telling myself. We only need to look back in the chart history to see 2 large peaks against the trend within the last 2 weeks, so, anything really can happenā€¦

For the bollinger bands, I just chose a number that gave me a long enough period so that a few bars wonā€™t unduly change the bands. But, you donā€™t want it so long that it never moves at all.

I think 240 for 1H is good, because that is 2 weeks of data :slight_smile:

Iā€™m testing this method and comparing with the synthetic version.

Iā€™m going to post the results here also.

Jedster, I have a doubt.

Let suppose that you are going to trade E/G. It is right now in a daily and weekly downtrend.

It is clear that you will entry sell if the price start to retrace from the standard deviations from +1 to +3 (maybe also +4 and +5), with targets on at least 3 SD below

But do you enter if it touches the mean, the -1SD or -2SD and start retracing? if yes, do you think 1SD of profit is good enough or you prefer target of 2 SDs?

Also, do you think a reversal candlestick could be a good signal of price starting to retrace? maybe a fractal?

Thanks

EDIT

I think a picture speaks better hehehe. This is a demo account. I placed a sell on E/G at -2SD with target on -4SD and stop at -1SD.

Do your strategy has information about this type of trade? or only if the price is on +1 to +5 SD?

Hello medisoft,

i am confused why do you sell here? shouldnt you buy as we expect it to revert back to mean?
is it because EURGBY is in a downtrend and you are expecting the downtrend to continue so you sell when it retrace back to -1SD?

I thought the original strategy was directionless?

Thank you and best regards.

  • guandi

Hello Jedster,

i have a question, why should we care that there is News that affect EUR or GBY, we are expecting mean reversion and correlation to hold right? Like on monday when EURGBY gapped down to at least -3SD and one can buy for it to revert back to at least -2SD which is what happen.

Best regards.

  • guandi

Guandi, first remember this is a demo account, Iā€™m testing what happens hehehehe.

Second, Iā€™m using a correlated pair E/G. And Jedster said that sometimes the pair doesnā€™t return to the mean for a long time, as you can see on my chart. Last time it touched the mean was 7 days ago. Jedster also said that he donā€™t like to trade counter trend trades, so E/G should be only shorted.

What Iā€™m testing here is not to short on the positive standard deviations, but on the negative, thinking that the pair is going to diverge more. I donā€™t know if it is going to work, but illustrated the question Iā€™m making to Jedster :slight_smile:

Letā€™s get back to the reason why GBP and EUR correlate in the first place. Sure European economies are tied together but if you recall Soros made a killing shorting sterling culminating in ā€œBlack Wednesday.ā€ History plays into the current situation. An abbreviated history follows:

Starting in 1988 Thatcherā€™s Chancellor of the Exchequer Nigel Lawson decided the pound should ā€œshadowā€ the Deutsche Mark. Two years later Britain entered the European Exchange Rate Mechanism (ERM), which required that the pound sterling maintain a (tight) 6% band around the Deutsche Mark. During this time the British economy had high inflation and was weak while the German economy was strong with low inflation. The band was too tight and the Bank of England couldnā€™t keep the currencies together and the hedge funds made a killing when Britain withdrew from the ERM.

Since then there is still a trading band that must be maintained if Britain is ever to adopt the EMU (EUR). This band must be maintained for 2 years prior to joining, and it seems the politicians in Britain have thought it important to have the currency shadow the EUR in case popular sentiment changes in favor of joining the sinking ship (EUR).

Firstly, it is fair to say that, like others here, I am still trying to refine this, to find what works and what doesnā€™t. With that in mind, I think all I am trying to say is that, and taking the EG as it stands right now (in its current down trend) it is less likely to hit areas like +1SD or +2SD. When it does, and assuming the trend/downward pressure is still in place, then a big move down is likely and my target will be relatively speaking, quite big - probably at least 3 SD, and maybe more. That is because I would be expecting it to pass back through the mean and keep on going.

However, when the price rises, yes I think we should only be targetting 1SD, or perhaps 2SD of profit because I know it is in a down trend, so at any point it is likely to stop and reverse on me. Price at the moment is rolling down the -2SD mark, and hasnā€™t risen by more than about 0.5SD all week (as volatility has increased, the BB have widened).

A good examplke that backs this is up is, I have been in a long position since Sunday night that I entered around the -4SD level. Had I just targetd 2SD then I would have closed the trade after half a day for a quite healthy 2SD of profit, which in this case would have been just over 30 pips. As it was, I hung on thinking price was going to climb higher - it didnā€™t, and I am still in that position (at a loss!)ā€¦

Have a read of this earlier post which explains what entry conditions I am looking for:
http://forums.babypips.com/free-forex-trading-systems/43659-statistical-arb-pairs-trading-strategy-43.html#post343559

and then this post which describes an exact situation that I didnā€™t trade, for the reasons mentioned in the above post:
http://forums.babypips.com/free-forex-trading-systems/43659-statistical-arb-pairs-trading-strategy-37.html#post342299

Iā€™VE been scalping a little using EG, with overlaid charts as indicator and picked up 4% in last 30 hoursā€¦to fantasize beyond reality, it would be nice if, say, 0.8023 was considered correlated, and you could just buy when lower than that and sell when higher, sighā€¦itā€™s ok, still making pips!

I keep meaning to watch ā€œThe Iron Ladyā€, Iā€™m sure it will be a good film for people who can remember the actual situations, and Iā€™m almost old enough to rememberā€¦ :o

Good time to buy EG, jesterā€¦it is fascinating how, when watching the pairs, they go almost exactly 20 pips apart, then match each otherā€™s moves for a while with that 20 pip gap staying the same for a while before changing! Same when they come 10 pips apart!

Hello Jedster,

many thanks for your thoughts and suggestions. But i think your way is a bit different from the original method if i am understanding it correctly, the original method by Kelton is directionless but your method is a bit discretionary as you are
mindful about the trend and the news.

did i miss out something?

thank you and best regards.

  • guandi

Hi!

This is the first version of the promised EA, that helps trade with Keltonā€™s method :slight_smile:

You need to open the EA on the Primary pair, this case is EU, and do all the trades on that MT4

You can configure the lot size, the take profit in pips and the MagicBase.

It supports unlimited number of pair trades, each pair is identified by itā€™s own ID or Magic number.

When the pairs reach a TakeProfitPIPS profit in PIPS, the EA will close the trade

You launch the trades using the Scripts KeltonBuyPair and KeltonSellPair.

If you want to Buy the primary (EU) and sell the other (GU), you run KeltonBuyPair, if want to sell the primary and buy the secondary, then you need to run KeltonSellPair.

You can link each script to a specific keyboard shortcut on MT4, so you can assign Alt+B to buy and Alt+S to sell or whatever combination of keys with alt or control plus a letter.

Note this is the FIRST version, and can be improved a lot hehehe

I draw two pairs of horizontal lines, one dotted and other dot-dashed, the dotted lines are +/- 10 pips from Bid price, the dot-dashed are +/- 20 pips from Bid price on primary pair (EU), this to make easy to identify with vitrite when the pairs diverged more than 10 or 20 pips.

I think the code is clear, so you can take a look on it and make the changes you wish.

Please try it first on demo account, and once you test that it really close the trades when it should, you can continue testing on real.

Note that the scripts have the parameter to define lotsize and magic base, in future releases that information will be configured only on the EA, and maybe it could be calculated based on a percent of risk or something like that.

kelton.zip (28.8 KB)

Hi guandi,

I personally consider the two to be different systems but both based on the same idea of trading divergence.