Discussion of article "Step-by-Step Guide to Writing an Expert Advisor in MQL5 for Beginners" - 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
After some difficulties, the tester worked completely and produced results that coincide with the stated results in the article.
About the difficulties. History downloading took a very long time (55 minutes at 8 Mbps), with several interruptions, I had to restart the tester 2 times. In the end the tester froze. I closed MT 5, but could not open it again. I had to completely reboot the system. After that MT5 booted up quietly, and surprisingly, the tester worked completely (about 2 minutes) and gave all the results stated in the article (I specified the testing parameters exactly as stated in the article). And further testing on different timeframes went on without any problems.
Summary. The article is cool. The Expert Advisor is workable. I will dig further.
Why not say in this place what is the handle of technical indicators?
What is it? An indicator identifier?
Why not say in this place what is the handle of technical indicators?
What is it? An indicator identifier?
Indicator handle is the identifier of the thread in which the indicator is calculated, calling the handle you address the data stream.
And the function that returns the handle creates (starts) this very thread. That's why developers do not recommend to access the stream immediately after its creation, as it may be still in the process of data calculation.
Greal article! Clearly structured and easily understood.
I doubt the return expression in the first "if" condition of the "OnInit()". Perhaps the parameter should be -1, whatever but not 0, or the if condition is redundant.
I tried to implement the expert from the article https://www.mql5.com/en/articles/100 on classes of the standard library.
I am posting what I got.
Unfortunately, the identical trade did not work, because the code from the article has errors.
The ExpertADX-MA.mq5 file should be placed in Experts\Advisors. -this is the Expert Advisor
TheSignalADX-MA.mqhfile should be placed in Include\Expert\Signal. - this is the class of trading signals.
The TrailingFixedPips.mqh file should be placed into Include\Expert\Trailing(with replacement). - it is a file from the standard delivery with some minor changes.
Expert.mqh file should be placed intoInclude\Expert (with replacement). -file from the std. file from the standard delivery with minor changes
The changes of the standard delivery will be made in the next build.
PS: Trawl is "screwed" in Expert (by request of workers).
To "unscrew" it, you need to comment the line:
if(!ExtExpert.InitTrailing(new CTrailingFixedPips)) return(-3);
in the file ExpertADX-MA.mq5.
Errors in the EA code in the article Step-by-Step Guide to Writing MQL5 Expert Advisors for Beginners have been corrected.
Please download the updated version of the Expert Advisor code.In the above EA code.
Thedynamic array double maVal[] is declared in the global scope.
and not in the void OnTick() function area.
Suppose the Expert Advisor has been running for 24 hours.
Question: What will happen to the memory allocated for the dynamic array? How quickly will it be clogged with rubbish?
Or in other words, I will formulate the question: Does memory leakage occur in this case?
Thank you for you article !