edit:Files are deleted since they are revised below.
Sample EA for multi-symbolize from the EA generated by the wizard, revised tradeATC class and some related classes.
- www.earnforex.com
Thanks! Will look closely into it later. Just wanted to note that using OnTick() in multi-symbol EAs isn't a good thing to do. You can read more about it here.
Mahalo for ya advise, but I don't know why just mod like below didn't work on tester.....
void OnTimer() { ExtExpert0.OnTimer(); ExtExpert1.OnTimer(); ExtExpert2.OnTimer(); ExtExpert3.OnTimer(); ExtExpert4.OnTimer(); ExtExpert5.OnTimer(); ExtExpert6.OnTimer(); ExtExpert7.OnTimer(); ExtExpert8.OnTimer(); ExtExpert9.OnTimer(); ExtExpert10.OnTimer(); ExtExpert11.OnTimer(); }
Thanks! Will look closely into it later. Just wanted to note that using OnTick() in multi-symbol EAs isn't a good thing to do. You can read more about it here.
Revised as your advise!
I don't understand but the OnTimer handler was doing nothing like below. Indeed it didn't work.
//+------------------------------------------------------------------+ //| OnTimer handler | //| INPUT: no. | //| OUTPUT: no. | //| REMARK: no. | //+------------------------------------------------------------------+ void CExpert::OnTimer() { //--- check process flag if(!m_on_timer_process) return; }
Revised as your advise!
I don't understand but the OnTimer handler was doing nothing like below. Indeed it didn't work.
Sorry, I've accidentally inserted a wrong link. Now it's corrected. The idea is to use OnChartEvent instead of OnTimer() or OnTick(). Nevertheless, the test results will still differ if you run the EA on different currency pairs, though in theory they shouldn't.
The EA is set the timer for 100 sec. for testing purpose, we can set it for 1 sec. then maybe it's enough...?
Hey guys,
We need check this out first!
I knew they do this better than me....
- championship.mql5.com
I'm disappointed. Their work is not finished yet about the new class ExpertTradeForATC2011.mqh.
CheckVolumes(...) should return max volume which is the symbol can have currently, instead just say NO. (bool false)
If we have 12.0 lots already and some how try to get 5.0 more to same direction, it should say "you can get only 3.0 more".
And also some other classes include the EA generated by wizard are still using
double maxvol=SymbolInfoDouble(symbol,SYMBOL_VOLUME_MAX);
instead
double maxvol=SymbolInfoDouble(symbol,SYMBOL_VOLUME_LIMIT);
so, we'll get error like " CExpert::ValidationSettings: error money parameters " when my EA try to open 5.01 lots or more.
Problem is there is no "divided volume" order implemented. If the EA wants to close 11.0 lots all together, my TradeATC class will make
multiple orders like 5.0, 5.0, 1.0. Same thing to Open.
We have to wait for a bit for them to get it finish.
But a good news is we can see they also making it for multi-symbol from a code in the article.
//--- Initializing expert if(!Expert[i].Init(Symbol(),Period(),Expert_EveryTick,Expert_MagicNumber+i))
Expert[i] means the "i" should be int number for each symbol!
Wow, I'm looking forward to see them and I'll take a rest.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Just a little modification Trade.mqh to make it easier to comply with the ATC rules.
Since it's not checked and I'm not very good coder, will someone please help to check it out for it works or not.
Those lines I added are marked with "/////////////////////////////" or between "/////////////////////**********"s.
Thanks.