Statistical Arb/Pairs trading strategy!

Cheers that worked as you said :slight_smile:

Ok, so iPad idea stops working when pair moves too far apart, like when EU fell hard…will look for more reliable means…did close at BE

Hi all

This is an updated screen shot of different settings of this strategy (Check the thread to find out what does every test means)

So far, the best profit was obtained with equal lot sizes, but also the drawdown is the biggest. I’m focusing on a lower drawdown and increasing lot size to obtain better profits with low drawdown and lower risk.

No mater what balance method is used, this strategy seems to be a winner! You can look at the charts, all of them are in positive. Last week a bug on the code generated a loss, but after I fixed that bug, the EA continued generating positive results.

Medisoft, on the no beta Alfa, how many lots are put in one trade?

It is variable. It depends on the pair and the max divergence detected. I posted in the thread the max divergence I detected on all the pairs I trade on 5m.

EU/GU has the biggest divergence of all of them, about 175 pips. I use that and double it, to be 350 pip divergence on 5m. That is my max risk that is equal to a percent of the account, 20 %, considering 3 trades at most.

So the lot size is calculated to support 3 trades of 350 pips divergence and that all the drawdown be less than 20 % of the account.

The same rule applies to all of them, but on the others I don’t assign equal lot sizes, but the resulting sum of risk is the same, 20 %.

This is an screen shot of the last moves of the account. You can see the pairs I trade, and the size of the positions.

This are the results for this week. As you can see, the NOBETA alpha is still ahead of other methods, but not for too much. On the drawdown side, it has the largest drawdown, that is not nice. The alpha 5 is having almost the same profit but with half drawdown.

I think a month more of testing will show a definite winner on this contest hehehehe. Right now I’m using on my live accounts what Jedster said (I think he was, forgive me if not) about using the price of the pairs as a beta. So for EU/GU I’m assigning more lots to EU than GU to have the same dollar amount of profit/loss with the same percent change, so if EU is up 1 %, that 1 % must be the same value of the 1 % loss on GU.

I think that method is working good and is good for a very large move. I’m mixing it 80 % of the size decision and the 20 % remaining is with the ATR. But looking at the moves on the testing accounts, I think I will choose method of alpha 5 in the near future, because it shows very good profits with the smallest drawdown. If I wish more profits, I can increase the risk knowing that the drawdown will be low.

Loving your work so far on this Medisoft. Thanks for sharing your results so far!

Without saying too much, since anybody could read this, I have found a way to watch daily fx charts, superimposed using Vitrite while at the usual 9-5 job, if you catch my drift…anyway, I used the same exact method as described by Kelton, 1 minute charts zoomed all the way out, showing 999 bars at a time…in the last three days have made $10 on a $100 live account. Just yesterday alone there were 4 tradable openings where the price came 20+ pips apart on EU/GU within a 6 hour window, the last time it opened up to 45 pips, I traded the last 3 “gaps”…my strategy is still open a basket for every 20 pips that the pair “comes apart” on these last three trades, I had 0.01 lot per side, so about $1 profit when 20 pip gap came pretty close together, then on last trade, had total of 0.06 lots in trade, with $5 profit…very nice! Never saw the gap increase more than 45 pips on this TF…will continue this strategy next week and report my trades, now live!..no losses of course, by the way!

I’m starting trading demo this strategy with Oanda with 50:1 leverage. The other demo accounts are with Liteforex with 100:1 leverage.

Oanda has VERY SMALL spreads comparing versus Liteforex, but lower leverage and also they don’t offer prepaid card to withdrawal, but I think is a good option for US people and for people that has large sums of money (not me hehehehehe), but the test is to verify that the strategy works with other brokers and with lower leverage.

congratz! Is this strategy a winner or not? :slight_smile:

To be honest, I almost can’t believe:

  1. How easy this is.

  2. You really can have no loss!

  3. The rules are easy on the psychological level.

  4. Profit levels make it worth doing this strategy.

  5. The simplest easiest way works the best and makes the most $$$!

hi medisoft

when you refer to an EA, has that been released yet or is it only in your personal possession?

there is an overlay positive hedging EA which references this thread on forexfactory, it contains an EA at the bottom of the first post

Overlay Positive Hedging EA @ Forex Factory

can you confirm if this is the EA you are using? many thanks

The minimum trade size on Oanda MT4 makes it unfavorable for a multi-lot system (like this) unless you have a large account. The risk is you run out of marginable funds before your trades are able to resolve. Oanda’s MT4 account is a standard account, so with $1000 deposit you’re trading 1 lot at 1x leverage. Pairs trading takes 2 positions at once so double the margin is used up. Best to trade live on account that allows smaller trade sizing with small $$$ starting out to prevent margin call.

medisoft, I’m impressed by how you’ve turned this basic strategy into your own automated strategy in a relatively short period of time. You must be an accomplished coder. You may have mentioned it before, but what are the differences between the alpha versions? Thanks!

Yeah! I think the trick here is the money management.

Bad money management will make this to hit a margin call

Good money management will make this strategy a steady income generator. Maybe the profits are not spectacular, I mean, 0.1 % daily is not spectacular, but it is pretty good and above almost all the risk-free interest on all countries.

yes, the problem with Oanda is that the MT4 accounts are standard with 1 lot = 100,000 :frowning: to bad for small account like mine. I found that this strategy needs about 5000 USD to work with oanda and MT4.

The differences are in the way they balance or distribute the positions. The 0, 2 and 4 don’t rebalance positions, the 1,3,5 rebalance the positions if the “beta” gets out of balance while they are open.

The method for calculation of “beta” on 0 and 1 is calculated using ATR of 10 periods of 1 hour each one.
For 2 and 3 the “beta” is based on the price of both, on EU the beta is 1-1.3xxx/(1.3xxx+1.6xxx) when using with GU
for 4 and 5 the “beta” is a real beta, based on covariance/variance, but I use one of the pairs as the portfolios return and the other is compared with the first one.
The no beta places equal lot size for both trades.

About coding time, the difficult part for coding an EA is to know how to trade. I one knows how to trade and can write a very specific set of rules, the EA is the easy part :slight_smile: On this method, Kelton did the hard work of telling us that correlation works and how it works. The only difficult part I was forced to solve is to find the center from which the pairs diverge. That was solved by Jedster who explain here about trading EUR/GBP instead of the synthetic, with bollinger bands.

I only joined that information in a set of rules, added the “beta” ideas and that’s all. Because this method does not require interpretation nor trader’s discretion it is best suited to be automated :). Other methods that involve interpretation of charts to say that something is in up/down trend are more difficult, because someone can see a downtrend while other can see range.

Thanks for the explanation. Your results from the tests of the different class of alpha 0,2,4 vs 1,3,5 confirms what I’m finding as well from my testing. Rebalancing seems to improve consistency / reduce drawdown and was one piece that I was missing so thanks for that idea. It seems to provide an adaptive way to adjust risk exposure to the current correlation and volatility. I’m also liking the real beta calculation in my tests, so that would be equivalent to your #5.

When tested over a longer period, the no beta no balancing gets out of line during some periods and has some epic drawdown when the pairs uncorrelate or when the volatility of one of the symbols in a pair trade has a large increase in volatility not matched by the other pair. Adding more when the pairs uncorrelate or after a single pair volatility shift just tends to make the problem worse - rebalancing allows a chance for a comeback or at least to reduce a loss.

Happy 5th of May! :wink:

Hi medisoft

Is my understanding of this system correct, that if you have a 20 pip divergence between two pairs and that you sell the stronger pair and buy the weaker pair, that when price of both pairs converge and touch again, it will result in a 20 pip profit (less spreads x 2)?

I ask, because I had a couple of trades this week that had to converge, touch and diverge the other side until 25 pips apart, and that only resulted in a breakeven position, let alone a profit.

If your answer is yes, that my understanding is correct, then I clearly did something stupid with those two trades and I’m sorry for wasting your time!

Kind regards, Stephen.

hey guys,

I’ve read a real big junk of this thread, but not all to be honest. can someone tell me where to find the mt4 overlays/indicators used by you guys? and now after all what timeframe did most of you agree upon? read 1m quite often, but not sure if it is the “best”.

Cheers

Here is what I’ve experienced…

  1. Can’t use mt4 at the only real computer I have access to, so I open 2 separate Internet explorers with daily fx charts, then I activate Vitrite which I downloaded, to where I can put one window over the other, and line them up perfectly…i make sure the same amount of bars are showing in each window, which will make the time scales on the bottom line up perfectly. as far as trying this with MT4, you have to open that program twice, and have the window fully expanded, and the other window with the other pair the exact same size, with one of the windows partially transparent, so it looks just like kelton’s screenshot…the TF is your preference, but so far, I have seen the most trading opportunities and the smallest maximum “spread” between the two pairs on the 1 minute TF…This is what kelton said he used, and I believe him when he said he has tried everything else. It has worked the best for me, which leads me to answering the next post question…

  2. I decide the EU/GU pairs are 20 pips apart using the EU pricing scale on the right side of the screen, seeing the difference between the current price in the EU, and where the other pair, GU, price pointer falls on the EU scale, so say the EU price is 1.31000, and the GU price that I can see through the semi-transparent window, looks like it is right over the 1.30800, then that’s what I consider 20 pips…now here is how it actually happens: at this point I sell 0.01 lot do EU, and Buy 0.01 lot do GU, and wait until they are pretty much touching…on my micro account, the combined spread for this is typically 8 pips, maybe 10 at most…my profit when these touch is $1.00 to $1.10…so you can see there is a slight actual difference on the math, but I just close this kind of trade at $1 and I am very happy! Sometimes the price diverges further, so I add another trade to each side at 40 pips, now this combined nets me about $4 total profit when they touch again since the total lots in trade would be 0.04 lots…and while there are plenty of different methods discussed on this thread on how to decide on trade entry time and TP, I personally think kelton’s original idea is the best for me, and I will keep you guys up to date using this method, so you can see!

thx for the reply. one more question: what do you do, if you opened a position, because there was a gap of about 20 pips, but after that EU and GU both crash down, the chart refreshes and both pairs are now at the bottom of the chart, meaning the gap has “closed”. you could have a negative unrealized return at that moment, but the gap that you were able to see, is now not existing anymore. do you just leave the trades open and wait? or do you close with a possible loss?