Discussion of article "Implementing indicator calculations into an Expert Advisor code" - page 3
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 decided to share Indicator.mqh, which was modified for myself, maybe it will save time for someone when translating the indicator into a class.
New article Implementing indicator calculations into an Expert Advisor code has been published:
Author: Dmitriy Gizlyk
Blast from the past here.
Very interesting article indeed! Sound and nice concept... but I fear there is a mistake in the distributed software, and it is not good to leave errors around.
Method GetData. Distributed code is:
Corrected code should be:
Array index starts from 0 and last element has index (m_data_len - 1) instead of m_data_len, isn't it?
rf, section Working with custom indicators of https://www.mql5.com/en/articles/261
Thanks for the article! I am studying it to get away from unstable conventional indicators.
But it is important for me to be able to visualise indicators on a chart. Has anyone implemented it?
The article How to transfer the calculation part of any indicator into the Expert Advisor code has been published:
Author: Dmitriy Gizlyk
Why do you need to transfer calculations from an indicator to an Expert Advisor at all?
Many people use indicators without EA at all.
You can simply break the calculations into stages.
For example, like this:
Why do I need to transfer calculations from an indicator to an Expert Advisor?
Many people use indicators without an Expert Advisor at all.
You can simply divide the calculations into stages.
For example, like this:
Due to the fact that the regular mechanism of indicators works through a stump, for example: https://www.mql5.com/ru/forum/372612 and this is due to their implementation.
With the increasing complexity of indicators, my Expert Advisor "bogged down". In the tester I caught many other bugs in the work of indicators, but I did not describe them, because it is useless.
I did not understand your idea.
Due to the fact that the regular indicator mechanism works through the stump , e.g.: https://www.mql5.com/ru/forum/372612 and this is due to their implementation.
With the increasing complexity of indicators, my Expert Advisor "got bogged down". In the tester, I caught many other bugs in the work of indicators, but I did not describe them, because it is useless.
I did not understand your idea.
To begin with, your code is not quite correct.
I would write it like this:
Further, since the functions in indicators should be executed with minimal delays, complex processes (history loading, complex calculations, etc.)
are broken into several parts, returning to
OnCalculatezero value (return(0) ), i.e. the indicator is in the initial stage until we perform all the necessary actions with minimal delays in each stage.
В архитектуре MetaTrader 5 организован асинхронный доступ к значениям индикаторов. Иными словами, при получении хэндла индикатора он прикрепляется к графику. Далее этот индикатор производит свои расчеты вне потока советника. Они взаимодействуют лишь на этапе передачи данных, аналогично получению данных тайм-серий. Поэтому и время на выполнение этих операций сопоставимо.So you're saying it's gonna be faster in real life?! -Because in reality it will be so. Expert in one track, indicator in another (and maybe even on different cores). This is only if you put it into serial processing, it turns out slower - but this is only an artificial limitation due to the strategy tester.