Mathematical Relationship between Forex pairs
I posted this in my Journal, but thought it would be useful for a broader audience. Attached is an Excel spreadsheet that shows the calculated price relationships between the 7 majors and 22 crosses....a snapshot of the spreadsheet is shown below. Basically, the spreadsheet shows how the rate for any given currency pair can be calculated from many different pair sets, i.e. the mathematical dependency between all pairs. The exchange rate data is from late October, but you can input current exchange rate data if you wish.. I posted this because when reading through the forums, it seems that some traders are under the impression that exchange rates are completely independent of one another...not true...
Please note that in several calculations, you need to take the reciprocal of the rate data. For example, to calculate the following rate data for:
EURJPY x CHFJPY = EURCHF
You need to take the reciprocal of CHFJPY:
EURJPY = 133.53
CHFJPY = 122.95 = 1/122.95 = 0.0081
133.53 x 0.0081 = 1.0861 = EURCHF
At the time of the above calculation, the bid on EURCHF = 1.0860
Hope that some folks find this useful....
Mathematical Relationship between Forex pairs.xlsx
I personally could not agree more ,the intertwined relationships within a selected basket are far more revealing than the correlations show.they for the best part beat as one.
One such example would be early indications of break outs,establishing range can be determined along with volatilityand momentum to name a few
Yep! In fact, if you write the symbols in the "standard" notation, i.e. using a slash (like this EUR/USD), then actually the math works out exactly as it would in algebra. Then, the times when you need to take the reciprocal are obvious. In fact, you just divide instead of multiply.
In basic algebra, if you have A/B times B/C, then the Bs cancel out and you get A/C.
Similarly: (EUR/USD)*(USD/JPY) = EUR/JPY
Also, in basic algebra, if you have A/B divided by C/B, then the Bs cancel again to give you A/C. You could also think of (A/B)/(C/B) as (A/B)*(B/C), the normal rule of dividing fractions as multiplying by the reciprocal.
Similarly: (EUR/JPY)/(CHF/JPY) = EUR/CHF or rather (EUR/JPY)*(JPY/CHF) = EUR/CHF ... note the reciprocal in the second version.
Here are the basic rules in a more mathematically-friendly notation:
In fact, it is because of these rules that currency pairs are written as little fractions, like GBP/USD.
Something cool on this topic!
That is interesting, alphaomega.
I don't see why he's plotting some things in the negative quadrants because all the exchange rates are positive, whether you take the reciprocal or not. But I do see why those points all have the same slope (when he drew the line throgh those three points). When the x-value is the exchange rate with respect to the USD and the y-value is the exchange rate with respect to the EUR, then the slope between any two points will equal the EUR/USD exchange rate. Here's a proof for the slope between the CHF point and the JPY point. (You could do the same for the slope between the CAD point and the CHF point or any two distinct points and you'd get the same thing.)
Remember from high school math that the slope between two points is the change in y-vaules over the change in x-values. Also, to go from step two to step three, I just multiplied the numerator and the denominator by CHF and by JPY, (in other words, by CHF*JPY). Then I just factored out the EUR from the numerator and factored out the USD from the denominator. Finally, I cancelled the CHF - JPY.
So, for example, if EUR/JPY makes a breakout on some small scale, and USD/JPY remains basically unchanged, that is not an early signal that EUR/USD will not make a breakout. In fact, EUR/USD would have made its breakout at the same time as the EUR/JPY did. Furthermore, even if EUR/JPY does shoot up before EUR/USD (again, assuming that USD/JPY is unchanged), does that mean that EUR/USD will have to shoot up soon to stay in line, or does that mean that EUR/JPY will have to drop back down to stay in line?
So unless you want to get into the arbitrage game (and you'll need lots of money, expensive equipment, and a zero-lag connection to the market), then I'm afraid these relationships won't help you much. I could be wrong, though. And if there's a relationship anyone would like to explore, I'd be happy to provide some mathematical insight, if I can.
Thanks for the clearer algebraic expressions...by convention I just leave out the "/ " sign, but nonetheless you are right that the relationships themselves don't give you an edge (other than stat arb). But for hedging purposes, it's useful to know what those relationships are in order to minimize swap costs..plus, as diceman555 pointed out, you can set up some interesting basket trades...
Dave and Diceman,
Yeah, that's true: It's good to know the cheapest (lowest overall spread) way to trade the pairs you ultimately want to trade. For example, maybe some brokers have a higher spred on, say, AUD/CAD then the spread on AUD/USD and USD/CAD combined, so then it would be cheaper to "factor out" AUD/CAD and trade your position across AUD/USD and USD/CAD.
That's true, D-man, you could get some intersting baskets going. Personally I find that it's helpful to look at basic correlations just so that you don't have too much redundancy the list of markets you watch. I don't even bother with doing an exact, numerical calculation of the correlation between all pairs. I just zoom out on a daily or weekly chart and compare the basic flow of price. If I see one pair making a huge uptrend across that time, another pair making a big 'V', and another just range bouncing all over the place, then I know these pairs move rather independently of each other, so I know I'm not over-exposed in one currency or another if I happen to have trades in all of them going at the same time.
Another thing I considered for a while was to only focus on one currency triangle, i.e. say you're interested in GBP, USD, and JPY: Trade the GBP/USD, the USD/JPY, and the GBP/JPY. What I like about that idea is that because of the relationship GBP/JPY = GBP/USD*USD/JPY, it's very likely that I will see some good volatility in at least one of those markets on any given day, week, etc. Basically the only way to get no volatility is if all three were not moving much.
You could even have two isolated triangles, like GBP/USD/JPY and AUD/NZD/CAD, shown here:
Or you could take 4 currencies and make your watchlist the 6 possible combinations between them, shown here as a square with both diagonals:
... or shown here in 3D as a tetrahedron:
These nodes connected in every possible combination are called "complete graphs" in graph theory. By representing every pair of two currencies, you could completely cover the entire interaction between your basket of currencies so that a substantial move is almost guaranteed in at least one of these pairs every day.
for example (not actual value, some segment trend on the candle chart, with certain inclination : sometimes) ;
usd/chf = ((dollar index(eur/usd)) x height) / sin(theta) + y
where y is a constant.
Likewise, some crosses like EUR/CHF (as long as SNB is not intervening!!), AUD/CAD and to a slightly lesser extent AUD/NZD are highly ranging unless one or both of the underlying USD counterparts are moving strongly.
Are you familiar with calculus at all? Even just high school or first-year-university calculus will do. It's all related to the product rule and quotient rule for derivatives.
The Product Rule for Derivatives
Let's start with the product rule, which is the rule we have to use when one pair is composed of a multiple of two other pairs. For example, EUR/JPY = (EUR/USD)*(USD/JPY). In general, we can just write it like this: C = A*B. So some currency pair, C, is the product of currency pair A times currency pair B.
Now we will take the derivative with respect to time. (Remember that a derivative is basically a measure of how one variable changes with respect to another. So when you do a derivative with respect to time, you're looking at how that variable changes through time.) Below, I've first shown the derivative using the product rule for general currencies A, B, and C in calculus notation. Then I write a simplified version just using "Delta" to represent the change in some value. Finally, I wrote it out for the example of EUR/JPY = (EUR/USD)*(USD/JPY).
What this means is this: The change in EUR/JPY (say the change between the open and close for a particular day) is equal to the closing price of EUR/USD on that day times the change in the USD/JPY over that day, plus the closing price of USD/JPY on that day times the change in the EUR/USD over that day. Remember that the change should be calculated as final price minus initial price, so Close - Open.
For example, if we look at EUR/JPY, EUR/USD, and USD/JPY for November 9th, here's what I get:
EUR/JPY: open 132.87 close 132.38 ∆EUR/JPY -0.49 EUR/USD: open 1.0769 close 1.0743 ∆EUR/USD -0.0026 USD/JPY: open 123.38 close 123.22 ∆USD/JPY -0.16 ∆EUR/JPY based on the product rule ∆EUR/JPY = (EUR/USD)*(∆USD/JPY) + (USD/JPY)(∆EUR/USD) = (1.0743)*(-0.16) + (123.22)(-0.0026) = -0.49226
As you can see, ∆EUR/JPY as calculated from the derivative is very close to the actual change between the high and low that happened over that day. There will be a slight discrepancy because we're looking at a large change over a long period of time (one day), but derivatives are supposed to represent instantaneous changes, therefore this is just an approximation. Normally to make your approximation more accurate, you could look at the change over a smaller period of time, so you could try looking at the change over just one minute. However, that will not really work with the market data we get because we don't really get a precise measurement of the change. The smallest unit we can get is usually one pip. In fact, calculus is designed to work with continuous values, but prices are actually discrete since they move in whole-number multiples of pips (pipettes at best). We don't have the full richness of the real numbers. Nevertheless, it's pretty interesting to see how this approximation is pretty good.
The Quotient Rule for Derivatives
Now we have enough background to talk about GBP/NZD and why it seems to be affected more by changes in NZD/USD than by changes in GBP/USD. The key lies in the fact that GBP/NZD = GBP/USD divided by NZD/USD. It's not a product of the other two pairs; it's quotient, so we have to use the quotient rule for derivatives. In general, we can just write it like this: C = A/B. So some currency pair, C, is currency pair A divided by currency pair B.
Again, we will take the derivative with respect to time, but the derivative of a quotient is quite different than the derivative of a product. As before, I've first shown the derivative using the quotient rule for general currencies A, B, and C in calculus notation. Then I write a simplified version just using "Delta" to represent the change in some value. Finally, I wrote it out for the example of GBP/NZD = (GBP/USD)(NZD/USD).
I'm too lazy to find prices and write out a numerical example for this one, but notice how this formula is different from the product rule: In this case, the denominator of the whole fraction is the price of NZD/USD, and not only that, but it's squared in the denominator! So changes in the NZD/USD will have a bigger impact than changes in GBP/USD.
Excellent posts Mathematician!!! As I said previously, we should be able to use this information to develop a balanced basket such that it earns a consistently modest profit with "mitigated" risk due to multiple-pair hedging...and we can make the basket so that swap is in our favor, or at least that a net negative swap is minimized. A new project!
The problem is no exposure: equity won't change.
I don't think I understand what you mean by "swap" in this context.
I find these relationships interesting, but I don't really use them because I don't think they can give me any sort of edge. In fact, this sort of over-analysis tends to get in the way. I think it was said best by Brian Monieson.
A quote from Alexander Elder's Come Into My Trading Room:
The few baskets I've been testing are not "net zero" exposure, albeit the number of units in each triangular hedge is volatility-adjusted (relative to the most volatile pair in the hedge) such that the high low equity swings of each triangular hedge is very minor. But I believe that's the advantage... you pool enough of these triangular baskets together and let them run (EURAUD(s)+AUDCAD(s)+EURCAD(b)), (GBPNZD(b) + GBPAUD(s) + AUDNZD(b)), (USDJPY(b)+USDCAD(s)+CADJPY(s)), etc...the equity sum of the total basket is generally net positive, with very low drawdown. Use 1% equity to open each pair and close the entire basket once the %gain is equal to ~0.5-1% of your equity. Not a "get rich quick" by any stretch of the imagination, but profitable nonetheless...
So in the case of EUR/AUD -- when AUD/USD was .9, that meant a square component in the denominator of .81 yielding a 1.23x multiplier effect from it. Now that we have AUD/USD at .7, the .49 square gives a 2.04x multiplier effect Similarly NZD/USD when it was .85 was giving 1.39x versus 2.37x at 0.65. Both currencies affecting twice as much now!
Have you ever looked at co-integrated pairs and triplets? I did some work on it a while back, and will revisit after my current projects are finished and trading.
Basically I did this:
1) Download 1 year of hourly closing data on 25 currency pairs. This is done daily.
2) Use R (an open source statistical analysis program) to merge all by Date / Hour
3) Remove missing data fields
(4) and below are for 2 pairs X and Y, but if you do 3 pairs X, Y, and Z its similar ... just a bit more complicated
4) Run a linear regression of each pair against all other pairs to calculate the trading coefficient. Side note: For 2 pairs, I run principal component analysis so the coefficients are reciprocals of each other. So if I run linear regression of X on Y, when I do Y on X the coef. are inverse. For 3 pairs, I do X vs. Y and Z to get 2 coef.
5) Calculate the spread. For 2 pairs, spread = X - Coef * Y
6) Run the Augmented Dickey Fuller test to see if the spread is mean reverting (P-value < 0.05)
7) Calculate mean value of spread for past 1 year, and +/- 1 and 2 stdev lines
8) Save all of this to output (only mean reverting spreads), so I can sort in Excel
9) Look for cointegrated pairs below -2 stdev to buy, exit at mean. Vice-versa for shorts.
Ex: If I have AUDCAD - 0.3EURCHF as the spread, and its at -2.1 stdev, I would buy AUDCAD and short 0.3 units of EURCHF (for every unit of AUDCAD).
10) Exit at the mean value of spread
I want to improve this more by looking at short term trends on 5, 15 min charts to enter long AUDCAD, and short 0.3 units of EURCHF. My EA can do that.
Anyway, just a project I have on the back burner. Have you ever done anything like this?
5) Calculate the spread. For 2 pairs, spread = X - Coef * Y
Is that right?
It seems to me, that in applied math, physics, and engineering, the approach is often to try and build a model of what appears to be happening. Now the model won't be perfect, of course, but it's built upon evidence. Then you can test the model, adjust it, and measure again, and continuing this way to make it more and more precise. Now obviously this is a very powerful approach, but it seems very complicated to me, coming from a pure math background.
This is because in pure math, we alway take a very minimalist approach. We try to limit the number of assumptions we make as much as possible; often, you might only be dealing with less than 10 assumptions. So when I think of something like financial models, I get overwhelmed by all the assunmptions that are flying around. I would start wondering all kinds of things:
Are 3 pairs better than 2? Is one year enough data? Is hourly data too long-term? Is it too noisy? Is linear regression the right model? Maybe all the peaks, valleys, and waves of a price series are better captured in quadratic regression... Is 2 standard deviations too extreme or not enough? What's the mean deviation of most major turning points?
Mean reversion. I don't know. Don't most things revert to their mean? Especially if the mean we're using is a moving average. Perhaps in a complicated way, it comes back to the mean, but it would be messy. I'd have to say the purest example of mean reversion I can think of is a spring. Haha. Stick a weight on a spring and no matter how fast or slow it's moving, it'll always be on its way towards the mean pretty soon. Is price like a ball on a spring? There are some similarities: Both seem to have extreme points at which they abruptly turn around. But prices also drift/trend, and they can also turn and accelerate near the middle, far from the extremes. So maybe a spring isn't such a good model after all. Now I'm getting back into that overwhelmed by choice feeling again.
Let's try to limit our assumptions as much as possible. Since we don't have many, we have to make sure we know they're true:
You see, some people might go on and list several more assumptions. But let's not do that yet. Let's already see what implications we can dervive just from these two axioms.
Horizontal black line is the mean, green and red are +/- 1 and 2 stdev.
cointegration is random, not worth.
Triangulat arbritrage? dont bother as banks will last look you to death.
Want to come back to this thread. Does anyone else observe that it seems "easier" to trade crosses based on a division of the underlying USD major rates rather than the multiplication thereof?
For example, EUR/AUD = (EUR/USD) / (AUD/USD) vs. EUR/JPY or AUD/JPY = (xxx/USD) * (USD/JPY).
The former is based on a direct relationship between the underlying USD majors while the latter on an inverse relationship between them. In the last year or so of trading I've felt as if trading the "division" crosses SEEM "easier" in that there's more "leniency" given to the resultant rate. For example with EUR/AUD, you're *not* playing EUR and AUD off of each other -- both tend to go up or down at the same time, not necessarily at the same rate. Yes, sometimes EUR moves a bit faster, other times AUD might, but some "erring" is possible. But with something like EUR/JPY or AUD/JPY you *are* playing each of the currencies against the JPY. With USD being the funding currency, if it's strengthening then it's tricky to have the base currencies move against each other as well. Sometimes EUR/JPY is less volatile for this fact though, since if USD/JPY is moving a lot, EUR/USD is very likely also moving a lot in the opposite direction to try and "counteract" the other's move, and vice-versa (this isn't usually observed with the other JPY crosses). Anyone else have similar experience(s)?
I've been trading "baskets" with an EA I created. Ex: AUD basket (long) is L AUDCAD, L AUDCAD, L AUDCHF, L AUDUSD, L AUDJPY, S GBPAUD, S EURAUD. Similar for other currencies (the baskets I trade are AUD, CAD, CHF, EUR, GBP, JPY, NZD, USD ... each currency against the others which compose the pairs).
I think trading a basket is easier than a pair if you look at fundamental news, and how the basket as a whole trades in multiple TF's.
If you pick a pair (EU for example), if EUR is strong, and USD is strong, EU will be flat ... but if USD is strong, it may be trending against other pairs. Hence best to trade the basket, IMO.
is it possible to calculate out of the chart a ratio to verify what pair has more volatility than the others?
JPY = 0.013634646434 NZD = 1.116199342 EUR = 1.820593234 GBP = 2.528542042 CHF = 1.6764157 CAD = 1.25116823 AUD = 1.193440337 USD = 1.647033311 So for example CAD/JPY = 1.25116823/0.013634646434 = 91.76... The provided Excel sheet value for CAD/JPY = 91.77 Another example EUR/USD = 1.820593234/1.647033311 = 1.1053773... The provided Excel sheet value for EUR/USD = 1.1054
You may verify other majors and crosses... If only interesting calculus gave the profitable edge....
Does anybody know how to calculate the values for the currencies?
JPY = 0.013634646434
NZD = 1.116199342
EUR = 1.820593234
GBP = 2.528542042
CHF = 1.6764157
CAD = 1.25116823
AUD = 1.193440337
USD = 1.647033311
very close to the grail.... just think outside the box. remember your job as a spot trader is to balance price. if you can do that you will win until you get tired of winning.
A lot of mathematics going in here. Is it really that easy to use all this while trading?
© Forex Factory