iclose() not working for multiple timeframes

 

I'm trying to print iclose value from multiple timeframes, but strategy tester only prints the value of timeframe that is being tested with. How can i get values from multiple timeframes in strategy tester?

iClose("USDCHF",PERIOD_M1,0);
iClose("USDCHF",PERIOD_M5,0);

First iclose works if the TF in strategy tester is M1 and second iclose fails

 
kiran1808:

I'm trying to print iclose value from multiple timeframes, but strategy tester only prints the value of timeframe that is being tested with. How can i get values from multiple timeframes in strategy tester?

iClose("USDCHF",PERIOD_M1,0);
iClose("USDCHF",PERIOD_M5,0);

First iclose works if the TF in strategy tester is M1 and second iclose fails

The close price for M1 and the close price for M5 on the current bar will be exactly the same so why do you think that the second iClose fails?

 
kiran1808: First iclose works if the TF in strategy tester is M1 and second iclose fails

On MT4: Unless the current 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)

On MT5: Unless the current chart is that specific pair/TF, you must synchronize the terminal Data from the Server before accessing candle/indicator values.
          Error 4806 while using CopyBuffer() - Expert Advisors and Automated Trading - MQL5 programming forum #10 (2020.12.15)
          Is it mystical?! It is! - Withdraw - Technical Indicators - MQL5 programming forum (2019)
          Timeseries and Indicators Access / Data Access - Reference on algorithmic/automated trading language for MetaTrader 5
          Synchronize Server Data with Terminal Data - Symbols - General - MQL5 programming forum #2 (2018)
          SymbolInfoInteger doesn't work - Symbols - General - MQL5 programming forum (2019)

Reason: