Forex Factory (https://www.forexfactory.com/forum.php)
-   Trading Discussion (https://www.forexfactory.com/forumdisplay.php?f=11)
-   -   Mathematical Relationship between Forex pairs (https://www.forexfactory.com/showthread.php?t=565244)

GoldTheHun Nov 12, 2015 2:49am | Post# 21

Mathematician, 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...
Very interesting. I guess this clause means residual of the predicted values?

5) Calculate the spread. For 2 pairs, spread = X - Coef * Y

Is that right?

mathematician Nov 13, 2015 2:03am | Post# 22

Mathematician, 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...
No. I haven't done anything like that. I don't know much about time series. I'm not an applied mathematician. I studied pure math, where the whole approach is very different.

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:

  1. A1: Well, we know that ultimately, prices move because of people buying and selling. That almost rules out time series analysis right away. Haha. I mean, people have always been particularly tricky when it comes to modelling. Imagine trying to use time series to try and predict what someone is going to wear tomorrow or what he'll have for lunch. lol
  2. A2: However, we do know that, in general, buyers want to buy more when something is cheap, and less when it's expensive. And sellers want to sell more when something is expensive and less when it's cheap. (There's the spring effect... )

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.

Well, from A2 (the spring effect), we know that price will reach extremes and turn. Therefore, there will be some lows and highs. But also, from A1 (the predicting lunch dilemma), we also assume that a very high-tech approach might not be the most effective.

In some markets, the thing that's being traded is a very common staple commodity, like wheat or corn. Their prices move and behave very similar to any other financial market. Imagine a place without contact with modern society, just a bunch of primitive tribes. The staple of their diet is a simple grain, and different tribes trade with each other for this grain. I bet if I lived with these tribes for a few months, that I could figure out what a good price for this grain. Well, price may be the wrong word. They will barter all sorts of different goods and services for grain. But in certain situations, I bet I could learn the difference between a good deal and a ripoff. It can't be that hard, right? In other words could get a sense of "low" and "high". Then I could really make good trades.

Well now, is trading wheat or corn very different in our society? And since all price charts looks pretty much the same, then perhaps it's just as straightforward to trade in any market. Think about the people whose job it is to buy and sell physical stock for a wharehouse. They seem to do well. They are probably profitable every year, starting on their first year. And I'm sure they're not using rocket science. haha. They just know what a fair price is, what's too expensive, and what a bargain is.

Sorry, I'm having too much fun with these emojis. haha


ezcurrency Nov 14, 2015 10:02pm | Post# 23

1 Attachment(s)
{quote} Very interesting. I guess this clause means residual of the predicted values? 5) Calculate the spread. For 2 pairs, spread = X - Coef * Y Is that right?
No ... residuals is observed value - predicted value. This is calculating the 'spread' between the two currency pairs. An example is shown here (attached).

Horizontal black line is the mean, green and red are +/- 1 and 2 stdev.

Regards,
EZ
Name:  Rplot.png
Views: 2547
Size:  6 KB

sidhujag Nov 15, 2015 11:15am | Post# 24

cointegration is random, not worth.
Triangulat arbritrage? dont bother as banks will last look you to death.

vasily Nov 15, 2015 11:25am | Post# 25

{quote} No ... residuals is observed value - predicted value. This is calculating the 'spread' between the two currency pairs. An example is shown here (attached). Horizontal black line is the mean, green and red are +/- 1 and 2 stdev. Regards, EZ {image}
called statistical arbitrage

san99 May 23, 2016 11:02pm | Post# 26

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)?

ezcurrency May 24, 2016 3:05am | Post# 27

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.

EZ

mathematician Jun 14, 2016 10:05pm | Post# 28

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...
I haven't really noticed a difference, but then again, I haven't really been paying close attention to it. It should be basically the same, either way, as a ratio or product. I mean, arbitrage should make it all work out pretty much the same.

pattaya1 Jun 14, 2016 11:06pm | Post# 29

is it possible to calculate out of the chart a ratio to verify what pair has more volatility than the others?

bralgo Jan 26, 2018 10:34am | Post# 30

{quote} All of these relationships are interesting, but I'm afraid they won't really give you an edge in trading.
Using the values privided by davelansing in the Ms Excel sheet, you get the following values for each currency
Inserted Code
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....

scalprobot Apr 5, 2018 6:41am | Post# 31

{quote} Using the values privided by davelansing in the Ms Excel sheet, you get the following values for each currency 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...

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

scalprobot Nov 5, 2019 12:22pm | Post# 32

{quote} 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
Anyone?

Okpala1988 Nov 5, 2019 1:55pm | Post# 33

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.

Tim01 Nov 7, 2019 4:57am | Post# 34

A lot of mathematics going in here. Is it really that easy to use all this while trading?


© Forex Factory