Statistical Arb/Pairs trading strategy!

Thanks. The difficulty remains even with history. I will keep trying to find some other tools. Other than BB, I know some traders use Stoch (100,1,1) on both correlated pairs. They enter when there is a minimal gap between the Stoch.

Hi Senelis,

How do I adjust the scale. When I kept the same pip range on the both the charts for example:

at GU: Fixed Maximum = 1.60410 and Fixed Minimum = 1.33070, keeping same size for EU. The change made, GU looked completely a flat line. The reason is obvious that GU ranges between 1.5963 and 1.6040, so it was obvious to see a straight line on that scale.

I am sure I am doing it wrong for some reasons :slight_smile:

Could you please help to correct me.

Hi Jedster,

Here are my Entry price for both the currencies

EU = 1.3267 (buy)
GU = 1.5888 (sell)

The time I entered both the trade:

29/03/2012 @ 22:52 Singapore Time.

Please note both the trades are still opened and showing the loss of about 61 pips.

Regards,

Do you mean you are designing a strategy to trade the imbalance between a brokers prices on a triangle of currencies, such as the GU/EU/EG ?

Nop, I mean using the Statistical arb/pairs trading strategy. As you say, to do real arbitration you need a broker with very low spreads and lots of money to see something interesting, and also a very fast internet connection.

The ATR is a measure of volatility, why is it relevent in determining how far two correlated instruments have diverged? All it is telling you is that one instrument is more or less volatile than another, it is not an indication of how they are correlated.

You give me the reason here. I use ATR to measure the volatility. In your example with S&P and DJ, you are assuming that if DJ move 1 % up, then S&P will be up also 1 %. But on EU and GU Iā€™m looking for pip move not percent move.

What I think is that if the ATR of EU is 130 pips a day, and GU is 160 pips a day, that means if I buy EU and sell GU, and they move as usual, if the pairs go UP, at the end of the day, GU will be up 160 pips, but EU will only had moved 130 pips. If the lot size is equal, and let say that I placed 1 lot on each one, I will be end with 160 pips for GU=10160 = 1600, but it was a sell, so it is $-1600, and on EU it will be 10130, that means $1300, so the net result will be $1300 of EU and $-1600 of GU, a net loss of $-300.

If I had assigned a lot size based on the ATR, the lot size for GU would be 0.89 lots, and for EU 1.11.

So 130 pips for EU would be 13011.1=$1443 and on GU 1608.9=$1424, with a net profit of $19.

I hope I had been clear :slight_smile:

What about trying this:

Look for a correlation indicator, and place on both charts. When you see that the correlation is more than 80 or 90 % on both, then you take your bid price, let say on EU it is 1.3000 and on GU it is 1.6000. Then add 200 pips on EU to define the max and substract 200 pips to define the min. The same for GU.

Then set that values on the settings of each chart. At the end you will have the price chart of EU at the center of the chart, with a range from 1.2800 to 1.3200 on EU and 1.5800 and 1.6200 on GU, with scale fixed. After that you wait until the prices diverged for 20 pips or so, and trade like Kelton indicates :slight_smile:

After you taked your profits, you could re-adjust the center of your chart with the same process.

Just to clarify the situation using the complete triangular arb setup and using the three prices Jedster provided, it is possible to show that you can create a completely hedged position using the math I showed in the prior post. After you finish reading this post Iā€™m sure youā€™ll agree. With the same example in mind but now with a complete hedge of all positions in mind as per triangular arbitrage, and assuming the triangular arb starts with 10,000 GBP/USD purchased, the results are as follows: (Long GU, Short EU, Long EG)

GU 1.5901 GBP 10,000 long USD 15,901 short

Now since we know USD, we infer the amount of EUR needed to be sold as:

EU 1.3297 USD 15,901 long (offsetting the above position) EUR (15,901/1.3297) = 11,958 EUR short

Now we know the EUR amount short, and the GBP long, so we can infer the GBP amount on the final position EG:

EG 0.8362 11,958 EUR long (offset the above position) and by calculation for the GBP:
11,958 * 0.8362 gives 9,999.56 GBP short

So as you can see, this is the complete or impeccable hedge, where only 0.34 GBP are left unhedged.

And going back to my earlier point, the hedge is achieved without trading equal sizes in GU and EU, thus showing that equal sizing of GU and EU leaves a small though substantial residual position in USD due to the necessary borrowing / lending of the underlying currency (USD in this case) that occurs whenever a pair is traded. Hopefully now the light bulbs will start turning on as this whole concept of triangular arbitrage makes complete mathematical and logical sense.

And as an epilogue, it is possible to create a synthetic EG out of EU and GU, however the sizes of EU and GU must be made so that the USD portion cancels out, leaving an unbalanced EUR and GBP position, as per the example above it would be long 10,000 GBP and short 11,958 EUR by buying 10,000 GU and selling 11,958 EU at the prices listed in the example. If prices change then the underlying sizes must also be altered to hedge the USD position. For quick reference the sizing for EU vs GU to recreate EG would be the size of the EU position * the price of EG or in this case 11,958 * 0.8362 = 9999.28 GU or nearly 10,000 (rounding).

I wrote an article on Triangular Arbitrage 101 but unfortunately it does not delve into position sizing, but after these past two posts, maybe Iā€™ll have to write that article! :wink:

Interesting ideas! Howeverā€¦ If we go back to basic algebra for a fraction like EUR/USD, EUR is the numerator, and USD is the denominator. It is easy to see which is the denominating currency. Both GU and EU share USD as the denominator (or denominating currency). This is why they have equal dollar pip amounts. A 10 pip move in EU is the same dollar wise as a 10 pip move in GU assuming the sizes are identical.

Try the pip calculator out on this site to verify that 10,000 EURUSD has the same pip value as 10,000 GBPUSD

Hi,

the difference between your minimum and maximum is just too big, some 200pips should be enough for seeing the whole chart most of the time I guess. So if you set Maximum at 1.6041, set a minimum at 1.5861. Or just fix the scale as it is when you enter the trade, without changing any values and leave it like that until you close the trade. Only that way you will always be in profit when the two charts touch, but they might not touch in days, or weeks, or ever.
I now think that chart rescaling is a part of this strategy, the reason you see the overlayed 1min charts touch so much is [B]because[/B] of the charts rescaling themselves. It is likely that the prices will move a bit towards one another after they have diverged a little, but they will not necessarily move enough to close the whole gap, though the rescaled charts will show that they have touched. So in my opinion you should not fix the scale, but accept that sometimes you have to take a loss when the charts touch, because i think that waiting for the charts to close the real gap (as it was when you entered the trade) may incur much bigger losses. Or you can fix the scale and not necessarily wait for a touchdown, but grab what you can when the price moves for some pips in your favor.
Thatā€™s all just my thoughts on this strategy and the ways it might work, I will be trying all this next week, so please rethink everything before using :slight_smile:

So if this is true, shouldnā€™t we just trade EG, using the divergence between EU and GU as an indicator? If the prices diverge, and EUR is above, short EG and if the GBP is above, long EG?

Yes, that looks about right from my reckoning. I took a similar position about 3 hours later. Price has not yet come back since then.

Looking at the history of this pair, they often appear to diverge considerably more than 20 pips, 40 or 50 is not uncommon, which is why I entered a little later when they had diverged further.

Yes, good explanation, very clear. :slight_smile:

MY take on this is, ATR is a measure of volatility. It tells you how much potentially an instrument could move. Your calculations are based upon you trading when they are right at the bottom/top of their range and are then assuming it is going to move its full range from that point on. So, yes I can see why that might make sense to trade more or less of one.

However, what this strategy is supposed to be doing is picking up a temporary imbalance in the correlation. You need to maintain a 1:1 ratio between your buy and sell. This is because, you donā€™t know which instrument has caused the imbalance. Is it the GU that has suddenly moved too much, or is it the EU that hasnā€™t moved enough. If you trade less in one and more in the other, it is as if you know which one has caused the imbalance because you are expecting one to move more than the other, based on the ATR. But the ATR is only a measure of general volatilityā€¦

Also, if you google pairs trading, every article that you find will tell you that you buy and sell the same amount (in dollar value). Forex trades using lot sizes that are identical (in the majority of cases), so the volume for each trade should be the same. If the lot sizes were different, you would certainly need to adjust your volumes.

On a related note, I had started to look at the ATR last week to see if rises or drops in volatility are related to when the pair starts to diverge. I only looked into it briefly and there wasā€™t anything obvious, but I might take another lookā€¦

You know, Iā€™ve been going over this in my head as to why we canā€™t do this. And, the answer is, I think, that there is no answer. In fact I think that this is exactly what we should be doing.

Normally this strategy is done with stocks, so you can only buy and sell them. However, with forex, it is a triangle of instruments. So, in fact, this is exactly what we should be doing and I shall explain whyā€¦

I just checked out a previous trade and of course, had I traded the EG instead, I would have made the same profit. In fact, I would have made about 1.5 pip more because with the long GU short EU trade, there are 2 sets of spreads to deal with. Obviously by trading the EG we only have one set of spreads, so the cost of execution is slightly cheaper.

So, well done for pointing out the obvious. Unless anyone can point out a reason for not doing this, I think from now on I shall be testing this strategy by trading the EG, or what ever the third currency isā€¦

[B]Finally! [/B]

good for you :smiley:

Yes, well qualifiedā€¦

Thanks, Iā€™ll go check out the articleā€¦

After I posted that I was thinking, of course, the USD IS the common denominator. So what you said makes perfect sense about the 10 pip move (dollar wise)ā€¦

Hi Jedster,

I donā€™t get it. So now itā€™s equivalent to trading the EUR/GBP? But you had shown with your charts in a previous post (Post #104, page 11 of this thread) that this isnā€™t true. Iā€™m a little confused.

Well, the posts are not really saying the same thing.

Post 104 (301 Moved Permanently) basically said:

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.

That is absolutely true and there was a chart showing that exact circumstance. That particular movement in the currencies caused the EG to stay flat, but as a result, something had become unbalanced, and that is why we entered the trade. So we sold the stronger instrument and bought the weaker instrument, in this case we sold EU, and bought GU. As explained in previous posts, that means we are net short EG, so we might as well have just shorted the EG.

We can do this in forex because there are always 3 currencies involved, so rather than selling the stronger and buying the weaker, we can instead just buy/sell (as appropriate) the cross.

Note that this is not something that can be done if you were trading the correlation with stocks or commodities, so if Pepsi goes up and coca cola goes down, you have to sell pepsi and buy coca cola as you have no other choice. Or, Brent goes up, WTI goes down, so you have to sell brent and buy WTI. However, currencies presents you with the third option. EU goes up, GU goes down, so sell EU and buy GU, or, just sell EG.

I want to ask about weekends. With this technique, does it is important to close the trades before weekend or it is not important because it is a neutral trade?

I ask this because I let a trade open on Friday on AJ/CJ and today it closed because at the opening the target was met and exceeded for a total 5 % of the account.

But that could be at the inverse, and it could be a greater gap contrary to the tradeā€¦

It is an interesting situation. Not sure there is a right or wrong answer. Perhaps it just relates to your risk aversion. If the instruments gap, then theoretically they should both gap by the same amount, so leaving them open would be the right thing to do. However if you are uncomfortable leaving the trades open, then you should close them at the end of the day/week.

I have (demo) trades running from the 29th. The Sunday night gap made not the slightest difference to the PnL.

Equally, because the trades are being entered off the lower timeframes, this is supposed to be a relatively short term strategy, so if the trades are open for days at a time, then something isnā€™t quite rightā€¦ For example, I am questioning whether these trades should be open at allā€¦ I am thinking of closing them and taking the loss as it stands, and waiting for another opportunityā€¦

Hi, okay, so I have changed my aproch , and am trading EG with the EU/GU diversion as an indicator, but does anyone have a tips on how to find an appropriate Stop Loss(I really dislike trading without a stop loss), and a TP level if possibleā€¦

Any idea on how I can make an EA to close a trade if price touches?

Btw, my window looks like this now :slight_smile: