Download MetaTrader 5

A function within an Indicator

To add comments, please log in or register
Yochanan Gerbi
608
Yochanan Gerbi  

Hello freinds,

I have a MQL4 indicator that I "translated" it to MQL5.

I still have one small problem, that I do not know what to do with it.

It's called: IndicatorCounted() - a known function in MQL4 but not within MQL5.

 According to the artical, dealing with transformation between MQL4 to MQL5, it "trasnlate" it as:

int IndicatorCounted()
{
   if(prev_calculated>0) return(prev_calculated-1);
   if(prev_calculated==0) return(0);
   return(0);
}

My problem is that I do not know how to defind: prev_calculated.

 

Can somebody help?

Thanks. 

Andriy Moraru
1261
Andriy Moraru  

prev_calculated is a parameter of the indicator function OnCalculate(). See help on it.
Yochanan Gerbi
608
Yochanan Gerbi  
enivid:

prev_calculated is a parameter of the indicator function OnCalculate(). See help on it.

 

Thanks, I will study it.

To add comments, please log in or register