• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 2:49am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 2:49am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Trading correlation pairs by using the other pairs 736 replies

MT4 MTF Correlation table and Correlation oscillator indicators 155 replies

Alternative Trade Management/Money Management Methods 1 reply

Money Management / Risk Management 24 replies

Money Management applied to cross currency pairs 2 replies

  • Trading Discussion
  • /
  • Reply to Thread
  • Subscribe
  • 10
Attachments: Pairs correlation and Money Management
Exit Attachments

Pairs correlation and Money Management

  • Last Post
  •  
  • Page 1 2
  • Page 1 2
  •  
  • Post #1
  • Quote
  • First Post: Jun 26, 2013 11:20am Jun 26, 2013 11:20am
  •  PipMeUp
  • Joined Aug 2011 | Status: Member | 1,305 Posts
If I trade two pairs which are 100% correlated I double the risk. Therefore, if I want to trade both, I have to halve the bet size.
If I trade two pairs which are 0% correlated (and supposed independent), the outcome only depends on my system and I can bet the full size for both.
If I trade two pairs with a correlation somewhere between these two extremes I can linearize between 50% and 100% of the bet size.

How does it generalize to three pairs or more?
No greed. No fear. Just maths.
  • Post #2
  • Quote
  • Jun 26, 2013 3:57pm Jun 26, 2013 3:57pm
  •  tarrini65
  • | Joined May 2011 | Status: Member | 147 Posts
chance are always 50 and 50 % , goes in profit or goes in loss , 1 or more pairs together
 
 
  • Post #3
  • Quote
  • Jun 27, 2013 3:20am Jun 27, 2013 3:20am
  •  PipMeUp
  • Joined Aug 2011 | Status: Member | 1,305 Posts
Quoting tarrini65
Disliked
chance are always 50 and 50 % , goes in profit or goes in loss , 1 or more pairs together
Ignored
You don't understand the question, do you?
No greed. No fear. Just maths.
 
 
  • Post #4
  • Quote
  • Jun 29, 2013 4:54am Jun 29, 2013 4:54am
  •  ~bull.bear~
  • Joined Sep 2012 | Status: Aim Consistent Income | 791 Posts
Divide by 3 to balance the distribution.
In fact, you don't know both the pair would correlate in future, those data is passed and based on past movement. You might assume that is correlated as long as fundamental is not changed.
 
1
  • Post #5
  • Quote
  • Jun 29, 2013 8:42am Jun 29, 2013 8:42am
  •  Red Herring
  • | Joined Mar 2013 | Status: Member | 267 Posts
Quoting PipMeUp
Disliked
If I trade two pairs which are 100% correlated I double the risk. Therefore, if I want to trade both, I have to halve the bet size. If I trade two pairs which are 0% correlated (and supposed independent), the outcome only depends on my system and I can bet the full size for both. If I trade two pairs with a correlation somewhere between these two extremes I can linearize between 50% and 100% of the bet size. How does it generalize to three pairs or more?
Ignored
What do you mean by bet size? You mean % of risk?
 
 
  • Post #6
  • Quote
  • Jun 29, 2013 9:59am Jun 29, 2013 9:59am
  •  PipMeUp
  • Joined Aug 2011 | Status: Member | 1,305 Posts
I choose E/U, G/U and U/J. I take the return in pips over the last 50 periods from H4. I plot the return of one (Xi) against the return of another (Yi) for all the bars (i=1...50), I get these X/Y scatter plots.
Attached Image (click to enlarge)
Click to Enlarge

Name: EG.png
Size: 35 KB
Attached Image (click to enlarge)
Click to Enlarge

Name: EJ.png
Size: 37 KB

Clearly a signal given on the Cable has a good chance of appearing on Fiber as well at the same time. If I tell you the result on GBP you can guess the result of the trade on EUR with a good accuracy. But the dispersion of the dots on the 2nd plot for U/J vs E/U makes the result less obvious. I mesure this dispersion as a coefficient (0-100%). For E/U vs G/U I find 90.9%, for E/U vs U/J I find 60%. For E/G vs U/J the value drops to 8.7%

I want to risk 3% --just a random value--
Clearly 1% on each of E/U, G/U and U/J isn't good. E/U and G/U are so much the same, it is like I traded E/U and U/J with 2% on E/U alone and 1% on U/J. => overleverage on E/U+G/U
But If I trade U/J and E/G then 1.5% on each isn't good either. I should trade almost 3% on each. Because they are almost independent. => underleverage
(if you don't understand why, please follow the link in the first post to an excellent post by Hanover)
No greed. No fear. Just maths.
 
1
  • Post #7
  • Quote
  • Jun 29, 2013 11:29am Jun 29, 2013 11:29am
  •  ~bull.bear~
  • Joined Sep 2012 | Status: Aim Consistent Income | 791 Posts
Em...finally i can find someone discuss this thing in FF. This is belong to CFA financial level.

It is regarding portfolio management, by measuring and compare both pairs return over time x. Then you will know about the risk, correlation, and coefficient value. So that you could alter your risk and lot size allocation in order to get what kind of return, with the help of efficient frontier.

I have read the theory, but i am not able to figure out how to use it. Please check in chapter 7 to 9, i think the rest of chapter is not useful so far.
Attached File
File Type: pdf Investment_Analysis___Portfolio_Management.pdf   9.4 MB | 7,070 downloads
 
 
  • Post #8
  • Quote
  • Jun 29, 2013 3:18pm Jun 29, 2013 3:18pm
  •  Vitez
  • | Joined Nov 2012 | Status: Member | 547 Posts
PipMeUp great thread I just wanted to create the same topic

To keep it simple what usually happens is EUR GBP and AUD would go down while JPY CHF and CAD would go up. This actually happened a few weeks ago.

So if we trade with the trend we would go short EUR GBP AUD and long JPY CHF CAD. So we would have nice 6 positions but really we would only have 1 huge position!

So would it make sense to trade 1 pair only??
 
 
  • Post #9
  • Quote
  • Jun 30, 2013 5:38am Jun 30, 2013 5:38am
  •  PipMeUp
  • Joined Aug 2011 | Status: Member | 1,305 Posts
You are correct. Depending on RORO is On or Off you end up very heavy short or long on USD. That's exactly what I try to avoid.


To get rid of this USD issue I try to select a cross. The strongest currency against the weakest one. After I remove these two currencies and do it again for the next pair, taking the current short term correlation (cointegration actually) into account to not select the "same". I end up with 3 pairs to trade. But they are not independent. This is why I'd like to know how to distribute the risk efficiently in this basket.
No greed. No fear. Just maths.
 
1
  • Post #10
  • Quote
  • Jun 30, 2013 4:20pm Jun 30, 2013 4:20pm
  •  Vitez
  • | Joined Nov 2012 | Status: Member | 547 Posts
I assume your system wouldn't work if you were to only trade E/U and E/G which are almost uncorrelated?
 
 
  • Post #11
  • Quote
  • Jun 30, 2013 4:33pm Jun 30, 2013 4:33pm
  •  maxss280
  • | Joined Oct 2008 | Status: PIP Slayer...Wish I could keep em' | 275 Posts
7bit did some awesome work in this area with linear regression (shout out 7bit) the point I think on that post was to make money with the spread in the pairs. But for it to work you would need some correlated pairs.

http://www.forexfactory.com/showthread.php?t=262827

May not be exactly what you are looking for but is quite interesting.
 
 
  • Post #12
  • Quote
  • Jun 30, 2013 5:27pm Jun 30, 2013 5:27pm
  •  PipMeUp
  • Joined Aug 2011 | Status: Member | 1,305 Posts
Quoting maxss280
Disliked
7bit did some awesome work in this area with linear regression (shout out 7bit) the point I think on that post was to make money with the spread in the pairs. But for it to work you would need some correlated pairs. http://www.forexfactory.com/showthread.php?t=262827 May not be exactly what you are looking for but is quite interesting.
Ignored
No, the purpose isn't to trade a basket as one composite instrument. What 7bit and old dog (http://www.forexfactory.com/showthread.php?t=265350) were doing is building up a basket of pairs in such a way it is highly probable that this virtual pair is mean reverting.

Here I'm just trying to run any same system over 3 pairs in parallel. I'm trying to distribute the risk optimally. If I want to risk $500, how much shall I risk on each?

(I had no time to read bull.bear's doc yet.)
No greed. No fear. Just maths.
 
 
  • Post #13
  • Quote
  • Jun 30, 2013 5:55pm Jun 30, 2013 5:55pm
  •  maxss280
  • | Joined Oct 2008 | Status: PIP Slayer...Wish I could keep em' | 275 Posts
Ah okay,

What about how they determined the lotsize in arbomat.mq4.

base_units * coef

Something similar to that possibly?

​

Inserted Code
// convert the coefficients to usable hege ratios by multiplying
   // usd/xxx pairs with their quote. The results can then be
   // conveniently interpreted as multiples of needed Lots or Units.
   // also take care of the special case when fitting a spread 
   // instead a trend
   for (i=0; i<pairs; i++){
      // if we fit a spread then all pairs except this one are on the other 
      // side (negative) and this one (the regressand) is 1 by definition
      if (i == this){
         coef = 1;
      }else{
         coef = -coef;
      }
      
      // convert to units
      if (StringSubstr(symb, 0, 3) == "USD"){ 
         coef = coef * iClose(symb, 0, 0);
      }
      
      
      // The following makes sure that if the first pair is an USD/XXX pair
      // it is normalized to 1 again and the lot sizes of the other ones 
      // instead made smaller by the same factor.
      if (StringSubstr(Symbol(), 0, 3) == "USD"){
         coef = coef / Close[0];
      }

   }
   
   // format a string that presents the hedge ratios
   // to the user and that will be displayed in the plot
   // it will also multiply them with base_units so you
   // have some reasonable numbers for your oanda account 
   ratios = formatBool("diff", use_diff) + ", " + formatBool("intercept", allow_intercept) + "n";
   ratios = ratios + "hedge ratios [multiples of Lots]n";
   for (i=0; i<pairs; i++){
      ratios = ratios + symb 
      + " " + DoubleToStr(MathRound(base_units * coef), 0) 
      + " (" +  DoubleToStr(GlobalVariableGet(GLOBALNAME+Symbol()+Period()+"_"+symb),0) + ")n";
   }
   Comment(ratios);

   plot();
 
 
  • Post #14
  • Quote
  • Jul 1, 2013 6:03am Jul 1, 2013 6:03am
  •  PipMeUp
  • Joined Aug 2011 | Status: Member | 1,305 Posts
Let me give an example. Say you trade G/U and E/U. You regress cable on fiber and get G/U = alpha * E/U + beta + epsilon.

7bit uses alpha to balance the basket. 1 lot E/U and -alpha lots G/U. When the long E/U goes up, the short G/U goes down the same $$ value. They neutralize. The profit is generated by epsilon, the imbalance of the basket.

I don't care alpha and beta. I focus on epsilon. The variance of epsilon tells me how good the regression is. They search a set of pairs that minimizes epsilon to get a safe basket.
Here I have the exact opposite goal. I'm looking for the biggest variance of epsilon to get the most independent basket so I can trade both pairs in parallel. But I know I'll never get a totally independent basket...

If epsilon has a very low variance, the correlation is almost perfect (the dots lay on the regression line) and you will almost always get the same signal on both pair. With the same result. You shall halve the risk.
Give each trade $250 to risk $500. (or just trade one single pair with $500). Say that when you get this simultaneous signal you wish to set your SL below the previous low. Naturally, in this case, the SL on G/U will
be alpha times the one on E/U (the swing is alpha times bigger). Accordingly, the lot size will be divided by alpha. The lot sizes and the SL will differ but the risk (SL x lots) is $250 for both.

Now what is beautiful is that if epsilon has a huge variance, the pairs have their own life and you can risk $500 on both of them! You trade twice faster as you double the opportunities.
No greed. No fear. Just maths.
 
 
  • Post #15
  • Quote
  • Aug 21, 2013 5:08pm Aug 21, 2013 5:08pm
  •  PipMeUp
  • Joined Aug 2011 | Status: Member | 1,305 Posts
I think I found a solution for N pairs. It's more an approximation. Here is the explanation and formula for N=3. Say you want to trade 3 pairs with one system. Let's say A, B and C. You compute the correlations. There are 3 correlations:

A with B, A with C and B with C. Let's call them ab, ac and bc and let's write the set of correlation indexes as the vector (ab, ac, bc).
Attached Image

I'm not interested in knowning if we have positive or negative correlation but only in their strengths. My correlation index is between 0 and 1. If the index is 0 the two pairs are uncorrelated. If the index is 1 the two pairs are merely the same.

We need to find three values a, b, c which represent the multiplicative factors to apply on our MM for the pairs A, B and C. So if your MM is to trade 2% per position, you will trade 2a% for A, 2b% for B and 2c% for C.

Let's see what happens when we set all the 3 variables ab,ac and bc to either 0 or 1. We get 8 combinations.

- The first is (0,0,0): no correlation at all. We go for the full risk on each trade (we play 3 roulette tables in parallel). a=b=c=1.

- The opposite extreme is (1,1,1): the three pairs are as one. We risk 1/3 on each since it is like we were opening three times the same position on the same pair, three tiers make my full risk.

- If one of the elements of the vector is 1 and the two others are 0 then we have two pairs which are "the same" and another one. Let's make two groups. We will risk one unit on each group. For example (0,0,1) gives a=1, b=1/2, c=1/2.

- Interestingly it is impossible to have exactly two elements at 1. If we had say (1,1,0) it would mean that A and B are the same (A=B) and that A and C are the same (A=C) while at the same time B and C should be completely different (B!=C). If B is A and C is A, B and C are the same. The results of the computations may lead to this kind of situation because we use small samples. For safety we will consider this case is the same as (1,1,1), where the cumulative risk is the lesser.

So we have a function {0,1}^3 => {0,1}^3.

(ab,ac,bc) => (a,b,c)
(0, 0, 0) => (1, 1, 1)
(0, 0, 1) => (1, 1/2, 1/2)
(0, 1, 0) => (1/2, 1, 1/2)
(0, 1, 1) => (1/3, 1/3, 1/3) X
(1, 0, 0) => (1/2, 1/2, 1)
(1, 0, 1) => (1/3, 1/3, 1/3) X
(1, 1, 0) => (1/3, 1/3, 1/3) X
(1, 1, 1) => (1/3, 1/3, 1/3)
(X=normally impossible cases)

Attached Image

We need to find a, b and c for all the possible values of the vector (ab, ac, bc). The values of this vector are inside a cube one side 1. Each corner is associated to a vector value. We can perform a trilinear interpolation. And find the formula:


a = (1-ab) * (1-bc) * (1-ac) + (1-ab) * bc * (1-ac) + (ab * (1-bc) * (1-ac) + (1-ab) * (1-bc) * ac) / 2 + (ab * (1-bc) * ac + (1-ab) * bc * ac + ab * bc) / 3
b = (1-ab) * (1-bc) * (1-ac) + (1-ab) * (1-bc) * ac + (ab * (1-bc) * (1-ac) + (1-ab) * bc * (1-ac)) / 2 + (ab * (1-bc) * ac + (1-ab) * bc * ac + ab * bc) / 3
c = (1-ab) * (1-bc) * (1-ac) + ab * (1-bc) * (1-ac) + ((1-ab) * bc * (1-ac) + (1-ab) * (1-bc) * ac) / 2 + (ab * (1-bc) * ac + (1-ab) * bc * ac + ab * bc) / 3

For example say you want to trade E/U, G/J and A/CAD and you find
E/U and G/J are correlated with a coefficient 0.0011,
E/U and A/CAD with a coefficient 0.297,
G/J and A/CAD with a coefficient 0.451
(all are pure random values!!)
You will trade E/U with 75% of you usual risk, G/J with 83% and A/CAD with 67%. For a total risk of 2.25 times you usual risk per trade instead of 3 times.

For N pairs you need to evaluate each value of the corner of a N(N-1)/2 dimensions hypercube and perform a multilinear interpolation.
No greed. No fear. Just maths.
 
 
  • Post #16
  • Quote
  • Aug 23, 2013 2:30am Aug 23, 2013 2:30am
  •  tarrini65
  • | Joined May 2011 | Status: Member | 147 Posts
yes right , but the correlation between pairs is not a fixed value , pairs decorrelates often ( , so it cannot be matematically fixed .
 
 
  • Post #17
  • Quote
  • Aug 23, 2013 3:40am Aug 23, 2013 3:40am
  •  PipMeUp
  • Joined Aug 2011 | Status: Member | 1,305 Posts
The formula gives a multiplicative factor to apply onto your MM given the values ab,ac and bc. Of course these values have to be updated as they indeed change over time.

I'm talking of correlation but it is a abuse of language. It is more about co-integration. But I expect few people will make the distinction; so I use both terms interchangeably. That's bad, I know, but hey I'm computer guy not a maths guy.

For instance you can have two pairs doing this: A moves up a few, B moves up a lot. A move down a lot, b moves down a few. Repeat. One pair is trending up and the other is trending down yet their movements are in sync and in the same direction. They are negatively correlated. The positive co-integration may no show up (the relation is not linear) but they are still not independent.

Today I wanted to post about the sampling frequency (timeframe) and the frequencies of the price movements (the length of the little waves). I think I won't have time. If you're interested think about the correlation and the co-integration between the blue and the red curves depending on the sampling frenquency.
Attached Image
No greed. No fear. Just maths.
 
 
  • Post #18
  • Quote
  • Aug 23, 2013 11:30pm Aug 23, 2013 11:30pm
  •  ronald_fsm
  • | Joined Jun 2009 | Status: Member | 365 Posts
Do you use indicator for this strategy? thanks
Quoting PipMeUp
Disliked
If I trade two pairs which are 100% correlated I double the risk. Therefore, if I want to trade both, I have to halve the bet size. If I trade two pairs which are 0% correlated (and supposed independent), the outcome only depends on my system and I can bet the full size for both. If I trade two pairs with a correlation somewhere between these two extremes I can linearize between 50% and 100% of the bet size. How does it generalize to three pairs or more?
Ignored
 
 
  • Post #19
  • Quote
  • Aug 24, 2013 6:42am Aug 24, 2013 6:42am
  •  PipMeUp
  • Joined Aug 2011 | Status: Member | 1,305 Posts
Hi Ronald. There is no strategy discussed in this thread. I'm only trying to distribute the risk over a set of pairs I would like to trade. Let me quote bull.bear who perfectly summarized it: "It is regarding portfolio management, by measuring and compare both pairs return over time x. Then you will know about the risk, correlation, and coefficient value. So that you could alter your risk and lot size allocation in order to get what kind of return"

How do I select the pairs I would like to trade is quickly described here http://www.forexfactory.com/showthread.php?t=435706
This is an indicator I'm developing but not for MT4 as I can't code MQL (and don't want to learn).

Regarding the strategies I target strategies which stay in the market a few days to a couple weeks rather than intraday.
No greed. No fear. Just maths.
 
 
  • Post #20
  • Quote
  • Edited at 9:50am Aug 24, 2013 9:48am | Edited at 9:50am
  •  PipMeUp
  • Joined Aug 2011 | Status: Member | 1,305 Posts
Sampling frequency (the timeframe) is of importance. If you thought about the blue and the red curves, you certainly have noticed that if you sample at a low frequency you see two same trends with noise. You get a perfect positive correlation, +1. If you sample at high frequency you see two curves in phase opposition (with a little drift). You get a perfect negative correlation, -1. The mesure of the correlation depends on the time horizon on the trading.
Attached Image (click to enlarge)
Click to Enlarge

Name: sineWaves.png
Size: 15 KB
No greed. No fear. Just maths.
 
1
  • Trading Discussion
  • /
  • Pairs correlation and Money Management
  • Reply to Thread
    • Page 1 2
    • Page 1 2
0 traders viewing now
  • More
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2022