Statistical Arb/Pairs trading strategy!

Thanks medisoft

Thanks Kelton for the strategy. I looked over this thread some yesterday and I tried the strategy this morning. I entered 2 sets and then exited once the eur/usd and gbp/usd lines came back together on the 1m chart. I made 16.6 pips! God bless!

Hi! forget what I said here. The correlation is only useful to find pairs that you wish to trade. You should make the centering visually, with the vitrite technique. When you see that the pairs are moving in synchronicity, then do what I said to center the pairs, but donā€™t rely on the correlation indicator for this, because the signal is very lagged.

Another technique Iā€™m testing is using a reference point. My reference point is an SMA for both. If one of the pairs is above itā€™s SMA and the other is below, then one of them is ā€œwrongā€, because they both should be on the same side of the SMA, because they are correlated.

Good that you are using demo!

If you lose all your demo account in so small time, then you are over sizing your positions! If you are, then you should read (and understand!) at least the money management topic on the baby pips school before trying anything else. I tell you by experience. I started trading forex about 8 months, and I loss a REAL account of 500 USD in about 10 days because I didnā€™t knew anything, I started thinking that forex is very easy, but it is not, specially if you donā€™t read and do your homework.

I finished the code for calculate the Beta with covariance/variance.

Iā€™m comparing the two pairs in this way

Beta=covariance(GU,EU)/variance(EU)

For 1H and 10 days, the Beta is 0.54

Now I donā€™t know how to use it hehehehhe.

If I use GU as the ā€œportfolio returnā€ on the beta calculations, I obtain 0.97

Beta=covariance(EU,GU)/variance(GU)

Should I compare GU and EU with another thing, like S&P500 or risk free rate?

Completely loss here hehehe, I think Iā€™m going to continue using volatility (ATR) until I understand how can I use the beta.

This is myfxbook (demo) link for this technique.

You can look there the information about how long the trades lasts, the max drawdown and the pairs Iā€™m trading :slight_smile:

And also the effectiveness of the system. Right now it is very effective, with pretty small drawdown (2 %) with my money management.

I have a doubt. Do you consider this technique as a fundamental or a technical one?

I think it is fundamental because it has nothing to do with support/resistance, trend lines and oscillators, but with correlation and beta.

I downloaded price data for EU and GU into excel and put them both on a graph. On this graph they are correctly positioned and at the same scale so it is a view of reality unlike the overlay charts. The distance between them is increasing and seems to be doing so at a fairly uniform linear rate. EU is declining more than GU is. This means that a sell on EUR/GBP or a sell on EU and buy on GU combination trade is the higher probability trade at this time. By zooming out on EG you can clearly see that it has been in a downtrend for some time.

Check this link. It explain the theory of Statarb. [Statistical arbitrage - Wikipedia

I](Statistical arbitrage - Wikipedia) deducted the system with SMA from there, because statarb is a system that involve short term mean reversion, I need to calculate the ā€œmeanā€, and that is the SMA

Today was a great day for this strategy! I made more than 2 % of my account, with a very small deviation. My max draw down today was about 0.7 %.

patforex,

Did you see this indicator Stat Arb Pairs Trading Indicator for MT4? It shows the spread difference between two symbols with the ability to input custom multipliers (beta) to weight one more heavily that the other to better normalize the spread (for instance EURUSD-GBPUSD).

Using the indicator might help to get proper perspective of the true spread when your windows redraw or rescale.

medisoft,

You might find the article (pdf) Market-Neutral Pairs Trading useful with regards to what to do with the Beta calculation. Specifically, I think youā€™ll enjoy the section: Creating a Market-Neutral Position.

It basically says to calculate beta for both symbols, sum up the two betas then take beta1/(total beta) and beta2/(total beta) and use that as a percentage for each symbol to size them in a market neutral manner. HTH!

I downloaded price data for EU and GU into excel and put them both on a graph. On this graph they are correctly positioned and at the same scale so it is a view of reality unlike the overlay charts. The distance between them is increasing and seems to be doing so at a fairly uniform linear rate. EU is declining more than GU is. This means that a sell on EUR/GBP or a sell on EU and buy on GU combination trade is the higher probability trade at this time. By zooming out on EG you can clearly see that it has been in a downtrend for some time.

TalonD,

What you are seeing explains the reason why it is irrational to equal weight pairs in an attempt to cancel out exposure. The goal should be to size the positions properly so that the resulting spread behaves in a mean-reverting manner so that simple mean reversion strategies can take advantage of the back and forth movement of the spread without too much exposure to outright directional risk. The pdf that I linked in the last post talks about one way to do that.

Another method of defining a long-term relationship is by using cointegration to determine the proper sizes of the pairs or basket being analyzed.

The volatility method may also be used to this effect. Simply by weighting the more volatile pair less and the less volatile pair more, risk can be reduced as evidenced by medisoftā€™s demo results.

Over time these values change: volatility, correlation, and even cointegration (which is supposed to be a long-term relationship) may drift over time.

Thanks Medisoft.

Point noted. Make Sense.

Cheers

FXEZ

In one of your posts you refer to Tradestation, Are you using TradeStation for Forex tradingā€¦

BTW Thanks for sharing your research.

daveM

No I havenā€™t.

Let me try and I will come back.

Thanks for sharing.

Great!

I was thinkingā€¦ in the article they are using S&P500 as the Rp or benchmark. In EU/GU I should use something more related to both of them, like ftse or dax? And on AJ/CJ maybe the ASX or NIKKEI could be useful? some brokers offer a currency index, so I can use the ā€œdollar indexā€ as a benchmark for EU/GU, the yen index for AJ/CJ and EJ/GJ?

What do you think about this?

I have a doubt. Let say that Iā€™m in a beta-neutral position on EU/GU. But the time pass and then, after 8 hours on the trade, the beta is changed.

Do I need to rebalance the position to be beta-neutral again? How to rebalance? buying and selling the right amount to get a new beta-neutral position?

What time frame did you use to take the trade? On the smaller time frames it should be no longer than over night. On the bigger ones like 4h it can take a few days to a week. Let me know what time frame you used and I will take a look at it. Also just a tip, if you miss / dont exit when they touch again it throws the system out of order. which means on the smaller time frame you do have to kinda stay glued to the screen. i think that is what may have happened here but without knowing what time you used i canā€™t tell you .

Did a 3 set trade yesterday afternoon and it did not work out so good. Maybe I did something wrong. I did trade one set this morning and it was profitable. What if we buy the eur/usd and sell the gbp/usd when the lines come together?