MQL4 - automated forex trading   /  

Forum

Pairs Trading (statistical arbitrage)

Back to topics list To post a new topic, please log in or register

avatar
706
c0d3 2006.10.12 04:52 
Hello,

I'm trying to perform pairs trading strategy on (eurusd) and (usdchf). One requirment of pairs trading is to look at the pairs as ONE.
That is done by diving eurusd by usdchf (the ratio).

Question:
How would i go about making a new chart in metatrader that will give me a ratio between the eurusd and usdchf (eurusd/usdchf).

I was thinking of making an indicator, but my hope is have a real time chart. Is it possible to have a real time ratio chart on which i can perform technical analysis(ATR, RSI, Bollinger)?

Refences:
http://www.traderslog.com/trading-pairs.htm
Contest of Expert Advisors inside an Expert Advisor

Contest of Expert Advisors inside an Expert Advisor

Using virtual trading, you can create an adaptive Expert Advisor, which will turn on and off trades at the real market. Combine several strategies in a single Expert Advisor! Your multisystem Expert Advisor will automatically choose a trade strategy, which is the best to trade with at the real market, on the basis of profitability of virtual trades. This kind of approach allows decreasing drawdown and increasing profitability of your work at the market. Experiment and share your results with others! I think many people will be interested to know about your portfolio of strategies.


avatar
313
TheEconomist 2006.10.13 10:13 
Even if they have the greatest correlation, think that 1 pip on USDCHF ~ 0.8 pips on EURUSD. One of the methods I am trying now, is based on the charts from http://www.fxstreet.com/rates-charts/currency-charts/ I put the pairs one over another (GBPUSD and EURUSD, at least they have the same pipsize) and I saw where it is crossing. My ea choses a couple of pairs (like this), a timeframe, and looks up last (100) bars , by putting the GBPUSD chart over EURUSD. Calculates the average difference between these two, then trades them. Lot sizes are correlated. For example on the given period EURUSD moves 850 pips, while GBPUSD moves 630, and now EURUSD is above GBPUSD on chart, with a difference between them greater than average. The EA would enter SHORT EURUSD 0.06 , LONG GBPUSD 0.09 (850 pips rounds to 900). As long as these trades are open, the system reminds how the chart looked at the beginning and recalculates their position based on current values and the chart at that time. When the equivalent GBPUSD value on EURUSD chart touches EURUSD, trades are closed in profit. The EA is not ready now, I just told you what's in my mind. P.S. This is statistical arbitrage. Arbitrage is simple. See the difference, buy that, seell the other. If you can't take decision based on current data in the front of your eyes and need sophisticated indicator, it's no longer arbitrage, it's the old speculation.

avatar
706
c0d3 2006.10.13 11:05 
TheEconomist wrote:
Even if they have the greatest correlation, think that 1 pip on USDCHF ~ 0.8 pips on EURUSD. One of the methods I am trying now, is based on the charts from http://www.fxstreet.com/rates-charts/currency-charts/ I put the pairs one over another (GBPUSD and EURUSD, at least they have the same pipsize) and I saw where it is crossing. My ea choses a couple of pairs (like this), a timeframe, and looks up last (100) bars , by putting the GBPUSD chart over EURUSD. Calculates the average difference between these two, then trades them. Lot sizes are correlated. For example on the given period EURUSD moves 850 pips, while GBPUSD moves 630, and now EURUSD is above GBPUSD on chart, with a difference between them greater than average. The EA would enter SHORT EURUSD 0.06 , LONG GBPUSD 0.09 (850 pips rounds to 900). As long as these trades are open, the system reminds how the chart looked at the beginning and recalculates their position based on current values and the chart at that time. When the equivalent GBPUSD value on EURUSD chart touches EURUSD, trades are closed in profit. The EA is not ready now, I just told you what's in my mind. P.S. This is statistical arbitrage. Arbitrage is simple. See the difference, buy that, seell the other. If you can't take decision based on current data in the front of your eyes and need sophisticated indicator, it's no longer arbitrage, it's the old speculation.
For metatrader, can i make a custom chart where I chart the eurusd/usdchf ratio?
In metatrader how do I overlay two pairs together.

avatar
313
TheEconomist 2006.10.13 11:40 
I programmed the EA to reposition the GBPUSD over EURUSD. Didn't make it graphical. You could do an overlay as an indicator, which reads GBPUSD instead of current window symbol. Look up this indicator. However, it starts overlaying from 2001 (as common point for EURUSD, GBPUSD and USDCHF). USDCHF here has reversed correlation (shows up as positive). This indicator's overlaying is NOT the one I referred in my post, but you can look over just to see how...
Attached files:
  Correlations.mq4 (3.16 KB)

avatar
313
TheEconomist 2006.10.13 11:57 
P.S. for that indicator to work, need to have daily data on all 3 contracts up to 2001. If you choose other allign moment, the graph will change, and the conclusion may vanish...

avatar
134
MrH 2008.02.09 19:33 
c0d3 wrote:
Hello,

I'm trying to perform pairs trading strategy on (eurusd) and (usdchf). One requirment of pairs trading is to look at the pairs as ONE.
That is done by diving eurusd by usdchf (the ratio).

Question:
How would i go about making a new chart in metatrader that will give me a ratio between the eurusd and usdchf (eurusd/usdchf).

I was thinking of making an indicator, but my hope is have a real time chart. Is it possible to have a real time ratio chart on which i can perform technical analysis(ATR, RSI, Bollinger)?

Refences:
http://www.traderslog.com/trading-pairs.htm


Hi,

Pairs trading is absolutely not about correlation. It's about cointegration: two elements come together, search wikipedia for it. If you've done the right statistical procedure to find a cointegrating pair, bollinger bands can work well, if used in the correct way.


avatar
12
shulic 2008.08.16 01:24 
MrH:


Hi,

Pairs trading is absolutely not about correlation. It's about cointegration: two elements come together, search wikipedia for it. If you've done the right statistical procedure to find a cointegrating pair, bollinger bands can work well, if used in the correct way.

Do better tools exist out there that will help visualize the difference in price between the two pairs?


MT4 seems to have many issues when pulling prices off of a pair that is NOT in the current window.


avatar
1
cmphil 2010.06.02 19:44 
Hey guys,

Just wanted to let you know that I offer a free proprietary Pair Trading Tool that anyone can use. It was developed in Excel and converted to be available on the web. I think this is a tool that could be extremely helpful.

Here's an example:



Click here to use the tool

Let me know if you have any questions.

Phil
phil@charter-management.com

avatar
716
1005phillip 2010.06.03 02:30 
I offer a free proprietary Pair Trading Tool

Really!? You thread-necro a 2+ yr old thread in a coder's developer forum (where we probably like to develop our own codes versus using black box) to advertise your own proprietary product? Really!?
Back to topics list  

To add comments, please log in or register