CheckLoadHistory examples in Indicator MQL5
Just by way of further explanation:
- I have looked at multiple MTF indicators on here and have not found one that uses LoadCheckHistory(). They appear to use CopyRates() and CopyBuffer() directly. However everything that I have read is telling me that it is critical to assemble the HTF data first!
- I contemplated calling the CheckLoadHistory() script from the indicator, but this appears to be well beyond my self-taught programming skills.
cheers
- www.mql5.com
Hey everyone. Greetings from Down Under.
I have been trying to implement an indicator that downloads higher timeframe price data in MQL5. I have used various versions of the CheckLoadHistory() functions, including this one https://www.mql5.com/en/docs/series/timeseries_access and this one https://www.mql5.com/en/code/1251.
The first one is written as a script and works perfectly, when used as a script. I have tried it as both a function and embedded within the indicator but it only works AFTER recompiling of the Indicator.
The second one is written as a function and I have the same problem. When the indicator is first attached to the chart, it returns zero bars. If after attachment I compile the indicator again, it then downloads the HTF bars.
Incidentally, they seem to work fine from EA's.
I fully expect that I am missing something obvious here. Nonetheless I am wondering if:
1) has anyone experienced this same problem?
2) and does anyone have an example of a working CheckLoadHistory() function implemented in an Indicator?
Hopefully my amateur description is not too cryptic and someone out there has had this issue before me and figured out how to make it work.