Time series as a committed resource

 

We all know that MQL5 does not guarantee the availability of time series data hence our indicator/experts because more complicated with extra codes to cater for cases that the data may be available now but may not be in the next tick.  This is especially painful when we have expert/indicator for multi-currencies or multi-timeframes.  For example, I often encounter for 1 currency, data is available for M5, H4 but not for M30, so I have to keep polling for the availability and sometimes it takes more than 10minutes (very strange, I was told data is assembled from the lowest timeframe, but this always happen to me).

I request a feature whereby, like indicator resource, make time series data a resource which we can create in our indicator/expert and only release when we finished with it.  In this way, we will have a better control over the execution of the program by creating the time series resources we need at OnInit and release them as and when we dont need them.  This will make our coding much simpler knowing that once it is created successfully, we will have the data available to the program.

 
williamwong:

We all know that MQL5 does not guarantee the availability of time series data hence our indicator/experts because more complicated with extra codes to cater for cases that the data may be available now but may not be in the next tick.  This is especially painful when we have expert/indicator for multi-currencies or multi-timeframes.  For example, I often encounter for 1 currency, data is available for M5, H4 but not for M30, so I have to keep polling for the availability and sometimes it takes more than 10minutes (very strange, I was told data is assembled from the lowest timeframe, but this always happen to me).

I request a feature whereby, like indicator resource, make time series data a resource which we can create in our indicator/expert and only release when we finished with it.  In this way, we will have a better control over the execution of the program by creating the time series resources we need at OnInit and release them as and when we dont need them.  This will make our coding much simpler knowing that once it is created successfully, we will have the data available to the program.

 

Do I have anyone from Metaquote to answer this feature request?
 
williamwong:
Do I have anyone from Metaquote to answer this feature request?

It is frustrating that MT5 supports multi-currency EA but it does not support price as a committed resource. 

I have a simple script that runs through all available crosses for PERIOD_M1 for 1 day to output a calculation of my indicator for every minute bar of every cross.  It took me more than 1 hour because sometimes the price is unloaded from the memory and my script has to wait for mt5 to reload into memory. 

I tried loading all the crosses using an arbitrary indicator (like iVolumes) and kept the created indicator handle in memory, it seemed to work, my script ran smoothly without pausing for the loading of prices into memory.  This time it only took 8 minutes.

Can someone from metaquotes respond on this feature request?  Give us a function which we can call to commit the price of a cross in memory rather than mt5 trying to manage the memory by unloading resources of which we know we going to need later.

Also can someone tell me in the absence of such feature, is my workaround ok?  i.e., by creating an indicator for a cross, mt5 guarantees the availability of the prices of this cross in memory?  In this way, I can pre-create an indicator for all the crosses I need before running my calculation for all the crosses.

Documentation on MQL5: Standard Constants, Enumerations and Structures / Indicator Constants / Indicator Types
  • www.mql5.com
Standard Constants, Enumerations and Structures / Indicator Constants / Indicator Types - Documentation on MQL5