Multi currency EA ideas

 

For quite some time I have been working on a multi currency EA. It is a trend following architecture  that buys dips in an uptrend and sells peaks in a downtrend.

A lot of work has gone into the code. It si built so as to run optimzation one pair at the time and then when running in "multi" reading the parameters for all pairs

from a file.  Most of this is straight forward. Just a lot of work and testing.

Learned a few things on the way

In order to reduce the risk of curve fitting I do the optimization in 2 steps for each pair. First the entry parameters. Then "filters" and som adjustment of SL and TP with regard to volatility

Since the system is designed to only run one trade at the time for each pair it is also clever to utilize the multi currency logic to actually have 2 entries for each pair. One for long trades

and one for short trades. Test shows that the parameters differ quite a bit between long and short trades. (I run tests for 15 month back). So it takes 4 backtest runs for each pair.

There is more work to do but the preliminary test show very good result using this approach.

Just dont ask me how many hours I have spent on this project. It actually started a couple of years back on MT4.

I just thought I should share some basic ideas. There is also other possibillities to use the multi currency architecture and that is to have a couple of "variations" of the same EA for varying market conditions

ruinning concurrently.

 

how is your entry signal generated?

what is your exit?

TP and SL is can also be a filter if you are trading one deal at a time only 

 

I think the best idea for Multi Currencies EA should depend on pairs correlation

 

Next Q is Where : Where can one find information about current currency correlations? 

 Here is Exampels :

http://www.forexticket.us/en/tools/01-01-correlation

 

Next  Q is : How to build My own Correlation and programe it in EA.

Then Build your Own strategy dependign on Correlation and fine tunning with In-Out indicators ..etc.

Forex Correlation
Forex Correlation
  • Forexticket
  • www.forexticket.us
The following tables represents the correlation between the various parities of the foreign exchange market. The correlation coefficient highlights the similarity of the movements between two parities. If the correlation is high (above 80) and positive then the currencies move in the same way. If the correlation is high (above 80) and...
 

N.B:

In addition to the above , the correltion depends at begenning on Currency  INDEX , hence you should update the currency INDEX , don't depend the readymade one which updated on Yearly bases and not accurated .

 

Multi currency EA may be based on some other systems. The only thing to do (except the system itself) is 'account protection feature'. Because those kind of EAs may be risky, and this risk is for whole the account (just my opinion sorry). But it also depends on how it will be coded for example.

============

As to correlation so I found the following

Video

MT5 CodeBase

MT5 CodeBase on HowTo :

Forum on trading, automated trading systems and testing trading strategies

Indicators: MFCS Currency Correlation Chart

newdigital, 2013.10.26 09:29

Currency Pairs Correlation in Forex Market: Cross Currency Pairs

As a forex trader, if you check several different currency pairs to find the trade setups, you should be aware of the currency pairs correlation, because of two main reasons:

1- You avoid taking the same position with several correlated currency pairs at the same time and so you do not multiply your risk. Additionally, you avoid taking the positions with the currency pairs that move against each other, at the same time. 2- If you know the currency pairs correlations, it may help you to predict the direction and movement of a currency pair, through the signals that you see on the other correlated currency pairs.

Now I explain how currency pairs correlation helps. Lets start with the 4 major currency pairs: EURUSD ; GBPUSD ; USDJPY and USDCHF.

In both of the first two currency pairs (EURUSD and GBPUSD), USD works as the money. As you know, the first currency in currency pairs is known as the commodity and the second one is the money. So when you buy EURUSD, it means you pay USD to buy Euro. In EURUSD and GBPUSD, the currency that works as the money is the same (USD). The commodity of these pairs are both related to two big European economies. These two currencies are highly connected and related to each other and in 99% of the cases they move on the same direction and form the same buy/sell signals. Just recently, because of the economy crisis, they moved a little differently but their main bias is still the same.

What does it mean? It means if EURUSD shows a buy signal, GBPUSD should also show a buy signal with minor differences in the strength and shape of the signal. If you analyze the market and you come to this conclusion that you should go short with EURUSD and at the same time you decided to go long with GBPUSD, it means something is wrong with your analysis and one of your analysis is wrong. So you should not take any position until you see the same signal in both of these pairs. Of course, when these pairs really show two different direction (which rarely happens), it will be a signal to trade EUR-GBP. I will tell you how.

Accordingly, USD-CHF and USDJPY behave so similar but not as similar as EURUSD and GBPUSD, because in USD-CHF and USDJPY, money is different. Swiss Franc and Japanese Yen have some similarities because both of them belong to oil consumer countries but the volume of industrial trades in Japan, makes JPY different.

Generally, when you analyze the four major currency pairs, if you see buy signals in EURUSD and GBPUSD, you should see sell signals in USDJPY. If you also see a sell signal in USD-CHF, then your analysis is more reliable. Otherwise, you have to revise and redo your analysis.

EURUSD, GBPUSD, AUDUSD, NZDUSD, GBPJPY, EURJPY, AUDJPY and NZDJPY usually have the same direction. Just their movement pattern sometimes becomes more similar to each other and sometimes less.

What do I prefer?

If I find a sell signal with EURUSD and GBPUSD and a buy signal with USDJPY, I prefer to take the short position with one of the EURUSD or GBPUSD because downward movements are usually stronger. I will not take the short position with EURUSD or GBPUSD and the long position with USDJPY at the same time, because if any of these positions goes against me, the other one will do the same. So I don’t double my risk by taking two opposite positions with two currency pairs that move against each other.

How to use the currency pairs correlation to predict the direction of the market?

When I have a signal with a pair, but I need confirmation to take the position, I refer to the correlated currency pairs or cross currency pairs and look for the confirmation. For example I see a MACD Divergence in USDCAD four hours chart but there is no close support breakout in USDCAD four hours or one hour chart. I want to take a short position but I just need a confirmation. If I wait for the confirmation, it can become too late and I may miss the chance. I check a correlated currency pair like USDSGD and if I see a support breakout in it, I take the short position with USDCAD. Now the question is why I don’t take the short position with USDSGD and I use its support breakout to go short with USDCAD? I do it because USDCAD movements are stronger and more profitable. I use USDSGD just as an indicator to trade USCAD.

It happens that you take a position with a currency pair, but it doesn’t work properly and you don’t know if it was a good decision or not. On the other hand, you don’t see any sharp signal on that currency pair to help you decide if you want to keep the position or close it. In such cases, you can check a correlated currency pair and look for a continuation or reversal signal. It helps you to decide about the position you have.

Sometimes, some correlated currency pairs don’t move in the way that they are supposed to move. For example EURUSD and USDJPY go up at the same time, whereas they usually move against each other. It can happen when Euro value goes up and USD value doesn’t have a significant change, but at the same time JPY value goes down, because of some reason. In these cases, you can use the below table to find and trade the currency pair that its movement is intensified by an unusual movement in two other currency pairs. In this example, if EURUSD and USDJPY go up at the same time, EURJPY will go up much stronger (see the below chart).

Or if EURUSD goes up and AUDUSD goes down at the same time, EUR-AUD goes up strongly.

Another important example: If EURUSD goes up and GBPUSD goes down at the same time, EURGBP goes up strongly. Maybe this is the most important case that we can trade based on this rule. It happens many times that EURUSD and GBPUSD move against each other and that is the best time to trade EURGBP. Now you know why EURGBP doesn’t move strongly most of the time. It is because EURUSD and GBPUSD move in the same direction most of the time. For example they go up at the same time and so EURGBP doesn’t show any significant movement because when both of the currencies of a currency pair go up or down at the same time, that currency pair doesn’t show any strong movement and direction (I hope you know why a currency pair goes up or down. It goes up when the first currency value goes up OR the second currency value goes down. For example EURUSD goes up, if Euro value goes up or USD value goes down. If this happens at the same time, then EURUSD goes up much stronger).

The below chart includes almost all of these unusual movements and their results on the third currency pair.

if EURUSD and USDJPY  then EURJPY  means if EURUSD and USDJPY go up at the same time, then EURJPY goes up much stronger.



Forum on trading, automated trading systems and testing trading strategies

Indicators: MFCS Currency Correlation Chart

newdigital, 2014.02.04 08:27

Trade Gold Using Currency Correlations (based on dailyfx article)

Talking Points:

  • Correlations are useful to find direction for a variety of markets.
  • Gold and the AUDUSD have a positive correlation.
  • Once direction is found, plan your trading strategy for another asset.
Understanding correlations is a great way for traders to form opinions on markets that they may previously not follow. The idea of a correlation is to take two seemingly different markets or assets and see how market price moves relative to each other. Today we will review using the AUDUSD currency pair to determine the direction of gold through the use of a correlation.
Let’s get started!

Golds Correlation

When someone mentions Gold, the AUDUSD should immediately come to mind as a correlating asset. These assets are positively correlated, meaning they can be seen generally moving in the same direction. First this correlation works because both assets are priced in US Dollars. The AUD/USD pair represents Aussie Dollars priced in US Dollars. While gold is XAU/USD or gold priced in US Dollars per oz. When the US dollar gains strength, both assets tend to depreciate in value.

Secondly, the AUD has a high correlation to gold due to Australia’s extensive gold mining operations. As gold prices fluctuate, this increases or decreases the amount of funds transferred into AUD to make purchases of the metal. These transfers essentially change demand for the currency and can directly cause changes in the AUDUSD currency pair as well.


Trading the Correlation

The key to trading positively correlated assets, is finding a direction from one of the underlying assets before making a trading decision. If traders are seeing the AUDUSD push to lower lows, this could easily be the catalyst for a bearish bias on Gold. Conversely if gold is trending upwards, this can also be a signal of a new uptrend on the AUDUSD.




As you can see, this information is very useful to traders that have a general fundamental view of the market. If you have an opinion on Gold or the US Dollar this can be relayed into a trade idea. Often traders that are bullish on Gold choose to trade the AUDUSD instead of the metal itself. The Aussie Dollar carries a 2.50% banking rate, meaning traders can earn additional interest while executing a buy order on a positively correlated opinion of Gold. If a trader is bearish on the AUDUSD currency pair, traders can in turn sell gold to avoid accumulating interest on their trading balance.


Forum on trading, automated trading systems and testing trading strategies

Indicators: MFCS Currency Correlation Chart

newdigital, 2014.02.04 09:27

Australian Dollar Strongly Correlated to Gold, Silver, Steel Prices (based on this article)

View forex correlations to the SPDR Gold ETF Trust (GLD), United States Oil Fund ETF (USO), SPDR Dow Jones Industrial Average ETF Trust (DIA), UK FTSE 100 Index, and IShares Silver Trust ETF (SLV) prices:


XAUUSD/AUDUSD :



XAGUSD/EURUSD :



XAGUSD/USDCAD :





 

Well, this seems to have stirred up some discussion. None of them not really related to the ideas I decided to share :-)

Personally I believe that Multi currency techniques is a good way to spread risk. What has to be done is of course to track the total

"system" performance. A simple method is to have a  "System StopLoss", checking the total drawdown. My backtesting results running

12 pairs rather indicates that the total drawdown in percentage are lower than for a single participating pair. 

The interesting question in relation to a "system SL" is wether or not have  a "system TP". Something like:

When total current open profit is 7% of  capital close all and take profit. I have had that diskussion in another forum on trading but the majority did not like the idea.

I do.

Someone asked about my entry. That is a long story and is really the heart of the system. As for TP and SL I run them at 300 and 200 with

some adjustment up and down (within limits) with the help of 5 ADR

A comment on using the multi currency approch to have different parameters for long and short trades. When splitting it like that the profit increased 90% for the EURUSD pair.

Almost doubled with no increase in drawdown for the period 2012-12-01 to 2014-02-25

 
Elliott_Trader:

I think the best idea for Multi Currencies EA should depend on pairs correlation

I think different, as most of traders are looking for pairs correlation, maybe the best idea is to do the opposite way.

For instance, create containers with pairs without any correlation.

And better, compare the performance of the two approaches in the real world.

By the way, this is one reason that I think the modern quantitative finance theory is obsolete, because what the academy teaches and quants are learning are absolutely the same paradigms, of the same teachers.

The consequence is that they are fighting themselves, instead of create their proper ideas.

And because that, in my opinion, quantitative systems are the future of quantitative finance. 

 

I do not see the relevance of either using correlated pairs or not. Practical experience with my multi currency EA shows that:

1. The equity curve, the drawdown and the total profit is excellent running 12 pairs with the same system with pairs optimized individually

2. Splitting the individual pairs further by having different parameter settings for long and short trades improves the result substantially

Why bother with correlated or uncorrelated pairs? That is theoretical speculation that really has to be substantiated by practical results.

Taking this idea of splitting parameters for long and short trades and treating them as separate pairs just gave me the idea that this kind of splitting a pair

could be taken one step further and split the pair to "sub pairs" for different market conditions. That is an approach that I will not take at this time

since I want to finalize the current architecture that seems to work exceptionally well and start making money.

 
ingvar_e:

I do not see the relevance of either using correlated pairs or not. Practical experience with my multi currency EA shows that:

1. The equity curve, the drawdown and the total profit is excellent running 12 pairs with the same system with pairs optimized individually

2. Splitting the individual pairs further by having different parameter settings for long and short trades improves the result substantially

Why bother with correlated or uncorrelated pairs? That is theoretical speculation that really has to be substantiated by practical results.

Taking this idea of splitting parameters for long and short trades and treating them as separate pairs just gave me the idea that this kind of splitting a pair

could be taken one step further and split the pair to "sub pairs" for different market conditions. That is an approach that I will not take at this time

since I want to finalize the current architecture that seems to work exceptionally well and start making money.

Is there any advantage to create a multi-currency EA, if this EA trade symbols independently ? It's a big overload of work. It's a lot easier to create an EA who trade 1 symbol and the place this EA on 12 charts.
 
angevoyageur:
Is there any advantage to create a multi-currency EA, if this EA trade symbols independently ? It's a big overload of work. It's a lot easier to create an EA who trade 1 symbol and the place this EA on 12 charts.

  angevoyageur:

  The "overload" is not really that big. An array of input parameters and a loop handling it. Read input parameters to array from a file, Read file evey hour and you dont even have to restart the EA when changin paramaeters

 Advantages: Not so much.

Unless:

 - you are getting into a competion with your EA. Which I am not 

 - Want to have better control of total system performance. Which I do. Like possibly having a "Total system" TP and SL. Like closing all positions total profit has reached 7% of capital and stopping when total loss is 3%

   This of course also can be done with an separate EA running keeping an eye on system performance.

 - When it is all up and running maintenance is easier

 - Single interface to the broker server. No "context busy" message from the server (I think that is the message)

In my case its also a question of numbers. Running 12 pairs and 2 for each pair (long and short)  means 24 EA:s running. And the number of pairs might increase.

And the possibillity to do a backward test on the total system.

 
figurelli:

I think different, as most of traders are looking for pairs correlation, maybe the best idea is to do the opposite way.

For instance, create containers with pairs without any correlation.

And better, compare the performance of the two approaches in the real world.

By the way, this is one reason that I think the modern quantitative finance theory is obsolete, because what the academy teaches and quants are learning are absolutely the same paradigms, of the same teachers.

The consequence is that they are fighting themselves, instead of create their proper ideas.

And because that, in my opinion, quantitative systems are the future of quantitative finance. 

Yes Quantitative Trading System will be high performance than only correlation , but it need high qualified staff to build an Quantitative Trading System , hence instead of Quantitative to be Algorithmic .

Therefore if we use correlation + Tech. Momentus + Good Portoflio + Perfect Algorithmic coding = Good Strategy for Multi - Currency EA

Reason: