iCustom values over time

 

Is it possible to use iCustom values over time?


double val=iCustom(NULL, 0, "Moving Average Rate of Change",5000,9,33,13,5,2,2,0);


This works fine, but if I change it to...


double val=iCustom(NULL, 5, "Moving Average Rate of Change",5000,9,33,13,5,2,2,0);


All I get is zeros... Is this a limitation with MQL4?

 
littlebear:

Is it possible to use iCustom values over time?


double val=iCustom(NULL, 0, "Moving Average Rate of Change",5000,9,33,13,5,2,2,0);


This works fine, but if I change it to...


double val=iCustom(NULL, 5, "Moving Average Rate of Change",5000,9,33,13,5,2,2,0);


All I get is zeros... Is this a limitation with MQL4?


Opps.... I've answered my own question...


https://docs.mql4.com/indicators/iCustom shows that the second value (NULL, 0...) indicates the timeframe on which the custom indicator is running not the time of a particular point on the chart. Using zero means use the same timeframe as the chart, then the very last value is the shift (...2,2,0) and 0 means current, 5 means five ago, etc... (I'm guessing five x timeframe rather than just 5 x ticks)