Update HST File

 

Hello,

How can I update the H4 HST File via code?


Update HST

As you can see the file sometimes doens't get updated even for days. Even after many candles have closed in MT4 and History center reflects new candle data.

Cheers,
Eashan

 
eashanm: How can I update the H4 HST File via code?

Updates automatically when you reference that timeframe.

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)

 
William Roeder #:

Updates automatically when you reference that timeframe.

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)


What do you mean by "reference that timeframe" ?

I've tried accessing the close value of h4 candle but it doesn't update the H4 file. As you can see the file is from 2 days old.

 double CurrentH4ClosePrice = iClose(_Symbol, PERIOD_H4, 1);



Reason: