In Back Test with using TickData, iMA() returns Zero value for X Bars

 

Below is my sample code:

extern ENUM_TIMEFRAMES tf = PERIOD_M15; 
iMA(symbol(), tf, 169, 0, MODE_SMA, PRICE_CLOSE, 1);

I was using TickData for Back Test. (without using it, there is no problem)
1. How can I get iMA() value since 00:00 but not time like 17:00?
2. How can I preload some bars?

Thanks.

 

Hardworking Pig:

1. How can I get iMA() value since 00:00 but not time like 17:00?

2. How can I preload some bars?

  1. Don't mix apples and oranges.
  2. On MT4: Unless the chart is that specific symbol(s)/TF(s) referenced, you must handle 4066/4073 errors before accessing candle/indicator values.
              Download history in MQL4 EA - Forex Calendar - MQL4 programming forum - Page 3 #26.4 2019.05.20

 

Hardworking Pig:

1. How can I get iMA() value since 00:00 but not time like 17:00?

2. How can I preload some bars?

  1. Update the chart (#1.2)

  2. Find the correct index iBarShift( _Symbol,tf, date() ) for the iMA.
              Find bar of the same time one day ago - MQL4 programming forum 2017.10.06

  3. You mentioned TickData in the title. Have you downloaded history for all TFs you are using?
Reason: