I'm tryng to design an Object Oriented EA for quantitative analysis and I'm in trouble with Timeseries.
I'll try to explain:
-I want to store in an object the history of a symbol for a timeframe from a certain date in the past (startdate) to date of initialization of object (initdate) to an MqlRates struct (m_data); object class definition:
code of Init function:
how can i append new bars to m_data[] in ordered mode so i can get the history of symbol to make my calculation with metod Refresh()? Any idea or suggestion of implemantation?
I tried to find some example on documentation and forum, but no result...
N.B. I have to admit that MQL5 is a very powerfull language and with OOP is possible to do almost everything, but I found that implementing a quantitative analysis framework it's very hard due to timesaries access and managing. I would suggest to developers and article writers that an article on subject like "Time series accessing and managing" with explanations of use of price series classes will be very useful
An idea:
On a new bar:
MqlRates buf[1];
if( CopyRates( m_param.symbol, m_param.timeframe, 0, 1, buf) > 0) {
int arraySize = ArraySize( m_data);
ArrayResize( m_data, arraySize + 1);
ArrayCopy( (void) m_data, (void) buf, arraySize, 0);
}
It's an idea, i didn't try it....
Thanks, I'm trying your idea.. it seems promising..
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I'm tryng to design an Object Oriented EA for quantitative analysis and I'm in trouble with Timeseries.
I'll try to explain:
-I want to store in an object the history of a symbol for a timeframe from a certain date in the past (startdate) to date of initialization of object (initdate) to an MqlRates struct (m_data); object class definition:
code of Init function:
how can i append new bars to m_data[] in ordered mode so i can get the history of symbol to make my calculation with metod Refresh()? Any idea or suggestion of implemantation?
I tried to find some example on documentation and forum, but no result...
N.B. I have to admit that MQL5 is a very powerfull language and with OOP is possible to do almost everything, but I found that implementing a quantitative analysis framework it's very hard due to timesaries access and managing. I would suggest to developers and article writers that an article on subject like "Time series accessing and managing" with explanations of use of price series classes will be very usefull.