Discussion of article "LifeHack for traders: Fast food made of indicators" - page 12
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
Standard indicators (they are the only ones discussed in the article) are cached in an elementary way! Because all input parameters are known.
It is difficult only to write a universal hash function. But it was not required in the article. It deals with the simplest case. And even for it there is no hash function.
MACD Sample 4 to 5 MQL4 style.mq5
Without caching
With stupid caching
25% faster if you don't make any wisecracks (head-on). Criticism of "inefficiency" of the presented approach is justified.
Can you show the code?
In IndicatorsMQL4.mqh add the above code and make the following changes
I would like an approach of this type - we take OnCalculate out of the indicator, modify it slightly under a new name, add it to the indicator code and now we can pull this function as a bibilio function, passing parameters from the Expert Advisor to it. Right?
I think we can make the source code of any indicator to be connected to the Expert Advisor via an enclode. And then work with them as with a function.
We need to make a little fiddling with macros and other peculiarities. This solution will not cover all indicators. But it should cover most of them.
Attempted recovery:
I am posting my version of the measurement. MACD Sample One value at a 5 was taken as the basic version of the Expert Advisor. Small changes were made in it. Since all indicator values are collected in one place, it was not difficult to make a simple macro substitution: I think the conclusions are obvious: when calling indicators in MQL4 mode, the speed is lower by 40%.
look at /results/... open - stop is set, then the trawl pulls it over.
here is a section of the chart. and the report on this place. how can it set a stop of 150 pips for almost all lots with ATR * 0.5 (ATR = 80pp)? with such a setup, the stop should NEVER be further than about 40 pips from the opening price of the lot.... and only when it gets above this level, it will be traded on it already.Recovery attempt:
I am posting my version of the measurement. MACD Sample One value at a 5 was taken as the basic version of the Expert Advisor. Small changes were made in it. Since all indicator values are collected in one place, it was not difficult to make a simple macro substitution: I think the conclusions are obvious: when calling indicators in MQL4 mode, the speed is lower by 40%.
You can restore (edit) your post:
calling indicators in MQL4 mode, the speed is 40% slower.
- You had a beautiful code and description of the measurement results.