Discussion of article "Implementing indicator calculations into an Expert Advisor code" - page 4
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I didn't understand from the article, does the class-indicator have protection against missing bars? For example, there was a connection break for 5 bars, and then the history was loaded, will the class-indicator refill only the last value in the buffer or make a full recalculation?
If you look in the standard indicator class, it uses the CopyBuffer function when updating data. I.e. it fills the whole buffer from the terminal history, not some part of it.
If you look in the standard indicator class, it uses the CopyBuffer function when updating data. I.e. it fills the whole buffer from the terminal history, not some part of it.
And recalculation of the whole history at each new bar?
Isn't it too costly then? Why not determine the date of the last calculation and copy the data for this particular piece of time?
And recalculating the whole story on every new bar?
Isn't that too costly then? Why not determine the date of the last calculation and copy the data for this particular slice of time?
I apologise, the previous post was not about the article, but about the standard library.
In the article, the indicator is calculated in the Calculate method. Here we first determine the number of bars from the last recalculation and only then recalculate the remaining part.
I apologise, the previous post was not about the article, but about the standard library.
In the article, the indicator is calculated in the Calculate method. Here we first determine the number of bars from the last recalculation and only then recalculate the remaining part.
Thanks for the clarification!
thanks alot
Very nice concept , but if I want to write a price action indicator with multiple prices (high,low,close,open)which calculates indicator value based on i.e difference of high and low there is a problem of having only one array of data (m_source_data in CIndicator class),is there a way to work around this or do you suggest to modify the CIndicator class and make the m_source_data an array of (mqlRates or CArrayBuffer ,...)?
thanks alot
Very nice concept , but if I want to write a price action indicator with multiple prices (high,low,close,open)which calculates indicator value based on i.e difference of high and low there is a problem of having only one array of data (m_source_data in CIndicator class),is there a way to work around this or do you suggest to modify the CIndicator class and make the m_source_data an array of (mqlRates or CArrayBuffer ,...)?
Yes, you can modify CIndicator to create m_source_data as array of MqlRates. I recommend MqlRates because other ways you will need some actions to synchronize data in different arrays.