pros and cons of this method....

 

I have a fx system that works on daily charts(checking the previous day candlestick pattern and couple of MAs).This system can be applied to any currency. Wrote an EA for this.

logic
=====
I am intializing a string array with all the currencies I plan to execute the EA against..
string currency[13]={"EURJPY","GBPJPY","USDJPY","GBPUSD","EURUSD", "USDCHF","AUDUSD","USDCAD","EURGBP","EURCHF", "GBPCHF","EURAUD","NZDUSD"};
Then use a for loop to check the rules/conditions are satisfied for each pair. if satisfied, the trade is entered.
I attach this EA to one currency chart like USDCHF. When a tick comes in, the code will be executed..

The question I have is whether this logic is good or not? Is there a pros and cons in writing a code like this.
I see all most all of the codes here, work with only one pair at a time.
I though it is cumbersome to open 13 charts and attach the EA to each chart....I have other EAs to run too.

 
Hi Tom,
The logic is ok.
I didn't kown about the way you are initializing the string array (I am using a loop to load the value of each occurence) but if it is working like that it is much smarter.
You will find information and even exemple on this site, search for 'multicurrencies'.
 
Tom23824 wrote >>

I have a fx system that works on daily charts(checking the previous day candlestick pattern and couple of MAs).This system can be applied to any currency. Wrote an EA for this.

logic
=====
I am intializing a string array with all the currencies I plan to execute the EA against..
string currency[13]={"EURJPY","GBPJPY","USDJPY","GBPUSD","EURUSD", "USDCHF","AUDUSD","USDCAD","EURGBP","EURCHF", "GBPCHF","EURAUD","NZDUSD"};
Then use a for loop to check the rules/conditions are satisfied for each pair. if satisfied, the trade is entered.
I attach this EA to one currency chart like USDCHF. When a tick comes in, the code will be executed..

The question I have is whether this logic is good or not? Is there a pros and cons in writing a code like this.
I see all most all of the codes here, work with only one pair at a time.
I though it is cumbersome to open 13 charts and attach the EA to each chart....I have other EAs to run too.

Hi,

in my opinion is a good way, as long you was finding a strategy which is working for all this pairs.

Pro is you need to attach only in one chart

Con is for shure that maybe some pairs need different settings, for Example for some indicators

 

Tom, you doing the ok thing.

You are in effect working on Virtual Charts

Is totally the best way. Why use xx charts with xx EAs... pointless.

Since you working on D1, I'd guess you are using MarketInfo(currency[<currently'Mapped'VirtualChart],...) ?

I use series arrays. It is tedious in MQL4 as no way to have pointers or templates or.... '5' will, I understand, overcome having xx functions doing job for 'each' unique Virtual Chart...

I actually do a 'remapping' of total EA internals/context to the Virtual Chart environment... just like 'asif' was the default chart EA originally attached too. Mainly it is all about the series arrays mappings and the eleven predefined variables which Terminal automatically maintains for the EA. So I do similar: use _Symbol(), _Period(),_Ask(), ..., _Digits, _Point,... etc. Requires function for each...

Basically, the code uses the "_..."() analogues to the eleven predefines. + any others want to use...

When I want to work on another sympair I remap all eleven EA predefines, starting first with the value _Symbol() returns, then _Period() and so on.

Result = is multi currency AND multi period framework...!

hey... it even works - lol

.

Nevertheless, hurrah to you!

yes, no point looking at code here and even if find a some that have a few pairs - the way they do it is not flexible or maintainable or at all easy/possible to upgrade/enhance.

===

go for it Dude!

 
Tom23824 wrote >>

I have a fx system that works on daily charts(checking the previous day candlestick pattern and couple of MAs).This system can be applied to any currency. Wrote an EA for this.

logic
=====
I am intializing a string array with all the currencies I plan to execute the EA against..
string currency[13]={"EURJPY","GBPJPY","USDJPY","GBPUSD","EURUSD", "USDCHF","AUDUSD","USDCAD","EURGBP","EURCHF", "GBPCHF","EURAUD","NZDUSD"};
Then use a for loop to check the rules/conditions are satisfied for each pair. if satisfied, the trade is entered.
I attach this EA to one currency chart like USDCHF. When a tick comes in, the code will be executed..

The question I have is whether this logic is good or not? Is there a pros and cons in writing a code like this.
I see all most all of the codes here, work with only one pair at a time.
I though it is cumbersome to open 13 charts and attach the EA to each chart....I have other EAs to run too.

Hey Tom

You're a brave man Charlie Brown! The impulse is correct, the implementation daunting.

I've written a simple multicurrency EA, here is what I've learned. In no particular order.

1) I used Switch/case... largely because arrays give me indigestion and migraine headaches.

2)Big con.. you cannot test muti-curency ea's on tester so, as early as possible start testing on live demo.

3) Test on smaller time frame it will give you faster results. May have to tweak parameters to ge it to run. Test on two or three currencies at first..easier to debug.

4) If you use mm to calculate lot size, then each currency will need a unique variable name for "lots" else the latest version calculated will be used to close positions.

5)The point made in 4 may and likely does apply elsewhere, I did not go to far with this ea as it quickly got very complicated.

6)You can get an approximation of results by testing one currency at a time, the more "dynamic" the ea the less reliable this testing will be.

7)As always expect testing results to be better than real results.

8)As you mention muti-currency ea's saves having many charts open, still I found that I was still opening charts anyway to "see" what was happening.

I hope that this helps.

I have set aside my multi currency ea for the time being since my coding ability in mql4 is not up to the task but I do intend to return to it.

So if you proceed please keep us posted.

good luck

Keith

 

The EA is running...going very good so far.

Used for loop to traverse each currency in the currency[] array....each time using marketinfo to get values like point and digits... Kept the main start function simple with just the checks for the trigger conditions and put all other actions into functions.

 
Tom23824 wrote >>

The EA is running...going very good so far.

Used for loop to traverse each currency in the currency[] array....each time using marketinfo to get values like point and digits... Kept the main start function simple with just the checks for the trigger conditions and put all other actions into functions.

Hey Tom

Congratulations. Quick question: How did you handle lot size? Or do you use the same lot size for all currencies?

Thanks

Keith

 
kminler wrote >>

Hey Tom

Congratulations. Quick question: How did you handle lot size? Or do you use the same lot size for all currencies?

Thanks

Keith

I am using fixed lot size.

 
Tom23824 wrote >>

I am using fixed lot size.

Thanks ...if you ever work out an elegant solution for different lotsizes please let me know.

I'm trying to get my head around a unique naming system such as JPY1234, where the 1234 is uniquely generated and added to the currency name to create a new lotsize variable name for each order for each currency.

Not too sure how to do that but I think it is doable.

Keith