using iCustom in EA (ontick event) gives me "cannot set timer(1)"

 

Howdy folks.

I am newbie for MQL language so excuse for that kind of question.


I created expert advisor and tried using custom indicator in code.
Indicator was bought trough market.


void OnTick()
  {
   string ind_name = "Market/My Custom Indicator";
   int up_buf = 0;
   int down_buf = 1;
   int shift = 0;
   
   double arr_up_get;
   double arr_down_get;

   string symbol = Symbol();
   string per = IntegerToString( Period());   

   arr_up_get     = iCustom(Symbol(),PERIOD_CURRENT,ind_name,up_buf,       shift);
   arr_down_get   = iCustom(Symbol(),PERIOD_CURRENT,ind_name,down_buf,     shift);

 ...

}


when i executed this code it gives me error "cannot set timer(1)".

What am I doing wrong? When I tried using this code with  "CCI" indicator from examples (not from market) everything went alright.

Any idea?


 

Hi,

Please check this : https://www.mql5.com/en/forum/219097

"Cannot set timer" ???? in ontime function
"Cannot set timer" ???? in ontime function
  • 2017.11.08
  • www.mql5.com
Hello, I faced a strange error. I'm using ontime function based EAs and recently some EAs stopped with message "cannot set timer (xxx...
 
Mounir Cheikh:

Hi,

Please check this : https://www.mql5.com/en/forum/219097


Hi, so where do I put this code?


I need to read information from custom indicator on every tick, and when specific indicator value changes, I would execute my action.

Is it problem because indicator is from market? When I tried to execute this identical code from example indicator ("CCI") if went without problem.

 
  1. Why did you post your MT4 question in the Root / MT5 EA section instead of the MQL4 section, (bottom of the Root page?)
              General rules and best pratices of the Forum. - General - MQL5 programming forum
    Next time post in the correct place. The moderators will likely move this thread there soon.

  2. CCI has no timer. As I said in 219097, Set Timer fails in indicators loaded via iCustom. Ask the creator whether indicator can still be used.