Thanks, well done.
bool CIndicator::LoadHistory(void) { datetime cur_date=(datetime)SeriesInfoInteger(m_Symbol,m_Timeframe,SERIES_LASTBAR_DATE); if(m_last_load>=cur_date && ArraySize(m_source_data)>=m_history_len) return true;
From this code it turns out that there will be no recalculation on ticks. Only on the appearance of new bars. Or did I not understand the implementation well?
Thank you, well done.
From this code it turns out that there will be no recalculation on ticks. Only on the appearance of new bars. Or did I not understand the implementation well?
Yes, the article says right away that the calculation is based on closed candlesticks. To calculate on each tick, it is necessary to remove the new bar opening check from the code and copy the history from "0" bar, not from "1", as it is now.
It's a pity they didn't make comparison in tick mode.
As an addition, in this mode we cannot do without CopyTicks in the implementation to make the "indicators" work properly.
Too bad they didn't do the comparison in potic.
As an addition, in this mode you can't do without CopyTicks in the implementation to make the "indicators" work properly.
I don't know which indicator we are talking about. But usually indicators work by bar prices and redraw the last bar. In this case, you can not load CopyTicks, but use the same loading of historical data. However, in this case you will need to add recalculation of the last value in the class.
I don't know which indicator we are talking about. But usually indicators work on bar prices and redraw the last bar. In this case, you can not load CopyTicks, but use the same loading of historical data. However, in this case you will need to add the recalculation of the last value in the class.
The indicator built into the Expert Advisor will skip ticks. To prevent this from happening, we need CopyTicks to get ticks between neighbouring calls OnTick, OnTimer, etc.
Otherwise, you can seriously lose information
trade orders (several times per minute) and 100 ms ping in standard mode of operation loses ~5% of ticks.
The indicator built into the EA will skip ticks. To prevent this from happening, we need CopyTicks to get ticks between neighbouring calls OnTick, OnTimer, etc.
Otherwise, you can seriously lose information
Yes, there is a big risk of losing tick information. But the whole question is about the value of this information for the strategy. After all, a usual indicator (like the one presented in the article) calculates bars, not ticks. And in the end, only the final candlestick data is used, intermediate ticks are simply "overwritten". Another question is if you save and use tick information in your indicator, i.e. build the indicator not by bars, but by ticks.
Hello! Thank you for your article.
You write: "At the beginning of the indicator code, arrays-buffers for data exchange with other programmes are declared. These arrays are timeseries, and their elements have a connection with price bars. This connection is supported directly by the terminal. The indicator saves the results of calculations in these arrays, not caring about changing their size and transferring data when a new candle appears. There are no such arrays in the Expert Advisor, which means that when transferring the indicator code into the Expert Advisor, you will have to create them. In addition to the calculation part itself, it is necessary to organise the connection between the array elements and bars on the chart ".
Unfortunately, in the test examples it is the organisation of the connection between array elements and bars on the chart that is not clear and not visible, everything else is clear. How exactly to arrange and see the necessary points (or symbols) on the chart? I would like to clarify this point. Thanks again!!!
Hello, thank you for your article.
You write: "At the beginning of the indicator code, arrays-buffers for data exchange with other programmes are declared. These arrays are timeseries, and their elements have a connection with price bars. This connection is supported directly by the terminal. The indicator saves the results of calculations in these arrays, not caring about changing their size and transferring data when a new candle appears. There are no such arrays in the Expert Advisor, which means that when transferring the indicator code into the Expert Advisor, you will have to create them. In addition to the calculation part itself, it is necessary to organise the connection between the array elements and bars on the chart.
Unfortunately, in the test examples it is the organisation of the connection between array elements and bars on the chart that is not clear and not visible, everything else is clear. How exactly to arrange and see the necessary points (or symbols) on the chart? I would like to clarify this point. Thanks again!!!
Good day, Yuri.
First of all, I apologise for the delay in replying. In MQL, when accessing timeseries, it is customary to consider the current bar with the index "0", and historical data goes with increasing index. You can read more about it in the documentation at the link. A similar approach was organised when accessing the calculated data of the indicator. I.e. at any moment when accessing the data of the last closed candle you specify the index "1".
Hi, first congrats for your article.
I have a simple question.
In an article, an indicator with a single buffer was used. How to do for indicators with more than 1 buffer? Do we need to create a CArrayBuffer class for each indicator?
Do you have any examples?
Thank you
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
New article Implementing indicator calculations into an Expert Advisor code has been published:
The reasons for moving an indicator code to an Expert Advisor may vary. How to assess the pros and cons of this approach? The article describes implementing an indicator code into an EA. Several experiments are conducted to assess the speed of the EA's operation.
Below is what we are going to do to relocate the indicator calculations to an EA.
All the work can be visually summarized as follows.
Author: Dmitriy Gizlyk