Expert Advisors: Multicurrency OnTick (string symbol) event handler - page 2

 
2011.08.24 12:40

1. Copy
   indicators\spy_control_panel_mcm.ex5 ok
   indicators\ds.ex5 ok
   include\ontick(string_symbol).mqh ok
   include\ctrade.mqh ok
   experts\atcrollback.ex5 ok

2. Compile

3. Configuration
   atcrollback on EURUSD:M12 every tick 2011.01.01-2011.08.01


4. Start
   finished in 0 min 9 sec


5. Statistics
loading of Spy Control panel MCM EURUSD,M12 failed
2011.01.01 00:00:00   expert removed because custom indicator 'Spy Control panel MCM' cannot load [4802]
tester stopped because OnInit critical error
   5 kb of log files
   there are no trading operations


4 errors

У меня все работает, выложил на проверку на чемп. вот такие дела:(
я так понял шпион не запустился, в чем может быть причина? там обязательно mq5 выкладывать, или ex5 достаточно?

 
Olegts:


It's hard to understand without log and code why the indicator can't be created, especially if you have everything working. Double-check the path to the spy, maybe the path to the spy is wrong or something similar.
 
Olegts:


Check the name of the indicator - it tries to load "Spy Control panel MCM" with spaces, and uploaded "spy_control_panel_mcm" with underscores.

 
Lizar:
It's hard to understand without log and code why the indicator can't be created, especially if you have everything working. Double-check the path to the spy, maybe the path to the spy is wrong or something like that.
Thanks for your help, Renat is right, during the process of uploading to the mql5.com server the file got underscores instead of spaces, I removed spaces in the name, corrected the name in OnTick(string symbol).mqh, sent it for checking, waiting for the result....
 
Olegts:
Thanks for your help, Renat is right, during uploading to the server mql5.com the file got underscores instead of spaces, I removed spaces in the name, in OnTick(string symbol).mqh I corrected the name, sent it for checking, waiting for the result....
Got it.
 
Lizar:
Got it.
No errors! Thank you very much for the multicurrency mode, because I was struggling with OnTimer(). I don't know where the problem with spaces appeared, either in my Opera or on the server, but Renat has an excellent eye - he found the difference!
 
Olegts:
No errors! Thank you very much for the multicurrency mode, because I was struggling with OnTimer(). I don't know where the problem with spaces appeared, either in my Opera or on the server, but Renat has an excellent eye - he found the difference!
You're welcome. I like this scheme of work too.
 
Lizar:
You're welcome. I like this scheme of work too.
Konstantin, hello. If you have some free time, please visit this thread - Results of testing multicurrency Expert Advisors. Your word would be very useful. Thank you for your labours.
 
tol64:
Konstantin, hello. If you have some free time, please visit this topic - Results of testing of multicurrency Expert Advisors. Your word would be very useful. Thank you for your labours.
Okay. I'll take a look.
 

The code from the article is out of date. Lost half a day fighting windmills. In particular:

void EventCustom(ENUM_CHART_EVENT_SYMBOL event,double price)
  {
   if(!testing) EventChartCustom(chart_id,custom_event_id,(long)event,price,_Symbol);
   else
     {
      if(GlobalVariableSet(_Symbol+"_custom_id",custom_event_id)==0) return;
      if(GlobalVariableSet(_Symbol+"_event",event)==0) return;
      if(GlobalVariableSet(_Symbol+"_price",price)==0) return;
      GlobalVariableSet(_Symbol+"_flag",2);
     }
   return;
  }



void OnTick()
  {
   if(_testing_)
     {
      for(int i=0;i<_symbols_total_;i++)
        {
         string __symbol__=_symbol_[i];
         if(MathAbs(GlobalVariableGet(__symbol__+"_flag")-2)<0.1)
           {
            GlobalVariableSet(__symbol__+"_flag",1);
            OnTick(__symbol__);
           }
        }   
     }   
  }



all this "shamanism" with global variables is unnecessary. OnCalculate is called perfectly well inside the tester.