Hong Ling Mu:
double price = iHigh(NULL, 5, 0);
double price = iHigh(NULL, 5, 0);
PERIOD_M5
You can always check documentation for more examples and clarification.
Thanks.
I will test again.
I have just tested
Print(iHigh(NULL,PERIOD_M5,1));
When I backtest in TF H1 and price out the result.
always zero....
Do you know why ?
When requesting data from other than current chart you need to check several error codes to ensure you have received valid data. One of them is 4066:
ERR_HISTORY_WILL_UPDATED | 4066 | Requested history data in updating state. |
ResetLastError(); double h = iHigh(NULL,PERIOD_M5,1); if(GetLastError()!=0) Print(h); else Print("Could not load data!");
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 - MQL4 programming forum - Page 3 #26.4 (2019)

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I want to get candle price data with iHigh and iLow.
When I backtest EA in TF H1 and try to read TFM5 price data, but I can not.
If I run this code in TFH1, why I can not get data?