[MQL5] Event (or something similar] to check, if the chart is loaded

 

Hello,

as the title say. I need a function/event to check, if a chart (means a defined count of candles) is completely loaded and my calculations are valid. The CheckLoadHistory-Function, as described here: https://www.mql5.com/en/docs/series/timeseries_access is not usable, because indicators doesn't care about the sleep-command in that function.

I have already searched a lot, but have not found an answer. Is there one and would anyone like to share it? Thanks in advance for this.

Documentation on MQL5: Timeseries and Indicators Access / Organizing Data Access
Documentation on MQL5: Timeseries and Indicators Access / Organizing Data Access
  • www.mql5.com
Organizing Data Access - Timeseries and Indicators Access - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Carsten Pflug:

Hello,

as the title say. I need a function/event to check, if a chart (means a defined count of candles) is completely loaded and my calculations are valid. The CheckLoadHistory-Function, as described here: https://www.mql5.com/en/docs/series/timeseries_access is not usable, because indicators doesn't care about the sleep-command in that function.

I have already searched a lot, but have not found an answer. Is there one and would anyone like to share it? Thanks in advance for this.

Maybe it helps:

https://www.mql5.com/en/docs/series/barscalculated

Documentation on MQL5: Timeseries and Indicators Access / BarsCalculated
Documentation on MQL5: Timeseries and Indicators Access / BarsCalculated
  • www.mql5.com
BarsCalculated - Timeseries and Indicators Access - MQL5 Reference - Reference on algorithmic/automated trading language for MetaTrader 5
 
Yashar Seyyedin #:

Maybe it helps:

https://www.mql5.com/en/docs/series/barscalculated

Unfortunately, this does not help.

Sleep(50);


is used there as well.

I wonder if there is an official solution for this. Surely not only I can have this problem.

 
Carsten Pflug: Hello, as the title say. I need a function/event to check, if a chart (means a defined count of candles) is completely loaded and my calculations are valid. The CheckLoadHistory-Function, as described here: https://www.mql5.com/en/docs/series/timeseries_access is not usable, because indicators doesn't care about the sleep-command in that function. I have already searched a lot, but have not found an answer. Is there one and would anyone like to share it? Thanks in advance for this.

Adapt that code so that it does not dependant on "sleep", but is instead driven by the events.

For example, rely on the fact that OnCalculate is called on every tick, and use that as a asynchronous delay and use a state machine to keep track of things.

 
Fernando Carreiro #:

Adapt that code so that it does not dependant on "sleep", but is instead driven by the events.

For example, rely on the fact that OnCalculate is called on every tick, and use that as a asynchronous delay and use a state machine to keep track of things.

Hmm. Thank you.