Hello,
is there any more information on how to use the CArrayDouble for example or is the exampe given in the CArrayObj
https://www.mql5.com/en/docs/standardlibrary/datastructures/carrayobj the only explaination on the topic? I am not getting it.
If I declare an object of CArrayDouble
that doesn't seem to be possible with CHighBuffer though which should be an inheritant of CDoubleBuffer which is an inheritant of CArrayDouble. Does certain inheritance get lost after a few generations?
Then I am trying to fill the array with values, so I am doing some
here, unfortunately I get an overloads compilytion error with GetData because it needs an array of the form high[] but this means that each element of the [] array is an object of the CiHigh class and then high[0,1,...,n].Resize() doesn't make any sense, so I can only work with
In case you asked yourself: I am trying to imagine the standard functions built back to the classes because I was thinking that it has to become conclusive at some point, but now I am more riddled than before. So is there an article about this?
If not I will help myself with this article https://www.mql5.com/en/articles/351
Still I am not convinced that these ends don't meet.
As far as I know the documentation is not very clear on these classes, it's better to look at the source code. For the CiHigh GetData has the following signatures:
double GetData(const int index) const { return(CPriceSeries::GetData(index)); } int GetData(const int start_pos,const int count,double &buffer[]) const; int GetData(const datetime start_time,const int count,double &buffer[]) const; int GetData(const datetime start_time,const datetime stop_time,double &buffer[]) const;
The first one allows you to get a single value at a time.
The second one you are trying to use, is to get multiple values into a "double x[]" array, not the CiHigh object.
So you don't pass high again like you did, you are confusing "arrays declared with []" with the "class array".
An alternative instead of using this class is to use the function CopyHigh which is what it uses in its implementation
and it is a lot simpler.
- www.mql5.com
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello,
is there any more information on how to use the CArrayDouble for example or is the exampe given in the CArrayObj
https://www.mql5.com/en/docs/standardlibrary/datastructures/carrayobj the only explaination on the topic? I am not getting it.
If I declare an object of CArrayDouble
that doesn't seem to be possible with CHighBuffer though which should be an inheritant of CDoubleBuffer which is an inheritant of CArrayDouble. Does certain inheritance get lost after a few generations?
Then I am trying to fill the array with values, so I am doing some
here, unfortunately I get an overloads compilytion error with GetData because it needs an array of the form high[] but this means that each element of the [] array is an object of the CiHigh class and then high[0,1,...,n].Resize() doesn't make any sense, so I can only work with
In case you asked yourself: I am trying to imagine the standard functions built back to the classes because I was thinking that it has to become conclusive at some point, but now I am more riddled than before. So is there an article about this?
If not I will help myself with this article https://www.mql5.com/en/articles/351
Still I am not convinced that these ends don't meet.