Отсутствие контроля валидности хэндла
And now we should tell about a huge danger of using handle caching: nowhere there is no control of handle existence in the user cache. That is, the situation when the indicator handle is deleted is not handled in any way.
This problem does not exist, because MQL4-style does not provide for the deletion of handles - there is no such concept there. But in the general case, deletion always goes through the caching wrapper.
Conclusion
The results of testing different ways of accessing indicators have shown that the MQL5-style of accessing indicators is head and shoulders ahead of any MQL4-style (both without and with caching of handles).
MQL5-style assumes that the user knows in advance what indicators (and their input parameters) he will use. These are the most primitive TSs!
In general, the TS calls indicators with calculated (not rigidly defined) input parameters. And here you can't do without MQL4-style+cache.
I think it is not difficult to find an MT4-advisor of this level in KB. It will be impossible to convert it into what is called in the article MQL5-style.
Therefore, the conclusions in the article are suitable only for the most primitive TSs, which make sense to write only for educational purposes.
S
Forum on trading, automated trading systems and testing trading strategies.
fxsaber, 2018.03.05 18:03
I don't understand articles that can fit into one post of any forum thread without water.
Such an article will be written
| 69 | "How to transfer the calculation part of any indicator into Expert Advisor code" NEW #957 | Dmitriy Gizlyk |
То есть если два эксперта на одинаковых графиках (одинаковые символ и таймфрейм) создают индикаторы с одинаковыми входными параметрами — MQL5 в своём внутреннем учёте будет идентифицировать их как два разных хэндла.
The handle is the same and this is confirmed by the fact that the id is the same.
The first true result indicates only that the handle reference count has decreased.
This is a completely wrong conclusion. the handle is the same and it is confirmed by the fact that the id matches.
The first true result indicates only that the handle reference count has decreased.
A different interpretation was meant
MQL5 in its internal accounting will identify them as two different handles.
A different interpretation was meant
that's the interpretation I'm talking about
"Internal accounting" interpreted as a counter. Frankly speaking, I don't understand why the first part of the article is about handles? It seems that everything has been chewed up more than once before and presented in more convenient formulations. Up to the reasons for the possibility of executing indicators in the Terminal, where there are no open charts.
This is a completely wrong conclusion. the handle is the same and it is confirmed by the fact that the id matches.
The first true result indicates only that the handle reference count has decreased.
Yes, it's an error in the article.
In general, you should quit inventing and writing "in MQL4 style". MQL5 is faster and more correct. It was the understanding of crutches and limitations of MQL4 that led us to create a new language and refuse compatibility in order not to pull a bad data access scheme.
In general, it is necessary to invent and write "in MQL4 style". MQL5 is faster and more correct. It was the understanding of crutches and limitations of MQL4 that led us to create a new language and refuse compatibility, so as not to pull a bad data access scheme.
Go!
Forum on trading, automated trading systems and testing trading strategies
Discussion of the article "Comparing the speed of self-caching indicators"
fxsaber, 2018.03.07 08:17 pm.
In general, the TS calls indicators with calculated (rather than hard-coded) input parameters. And here you can't do without MQL4-style+cache.
I think it is not difficult to find an MT4-advisor of this level in KB. It will be impossible to convert it into what is called in the article MQL5-style.
Let's go!
That's a stretch.
No argumentIt's a stretch.
No argument.Continue to advocate for primitive TCs.
- 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 Comparing speeds of self-caching indicators has been published:
The article compares the classic MQL5 access to indicators with alternative MQL4-style methods. Several varieties of MQL4-style access to indicators are considered: with and without the indicator handles caching. Considering the indicator handles inside the MQL5 core is analyzed as well.
Results of comparing access styles to the nine indicators (settings are provided in Fig. 1):
Fig. 4. Time spent for accessing the nine indicators
When comparing the results, please note that the test EA has considerably complicated the task:
Author: Vladimir Karputov