I have a custom indicator that works fine on a chart and in an EA when accessing the same timeframe it is being used on.
However when I try to access a PERIOD_W1 or PERIOD_MN1 value for this indicator it returns EMPTY_VALUE from the start of the backtest despite there being W1 data for that symbol that extends beyond the start of the backtest period.
The code is verbatim the MQL4 code here (http://codebase.mql4.com/source/1184) but with the array average on line 67 changed to be MODE_EMA.
I am assuming that the ATR code is correct as it's MetaQuotes's own code. I am calling it using the iCustom() method.
Is there any explanation for why this is returning EMPTY_VALUE when there is enough data for an average?
Regards
However when I try to access a PERIOD_W1 or PERIOD_MN1 value for this indicator it returns EMPTY_VALUE from the start of the backtest despite there being W1 data for that symbol that extends beyond the start of the backtest period.
The code is verbatim the MQL4 code here (http://codebase.mql4.com/source/1184) but with the array average on line 67 changed to be MODE_EMA.
I am assuming that the ATR code is correct as it's MetaQuotes's own code. I am calling it using the iCustom() method.
Is there any explanation for why this is returning EMPTY_VALUE when there is enough data for an average?
Regards