Discussion of article "Step-by-Step Guide to Writing an Expert Advisor in MQL5 for Beginners" - page 8

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
thank you for this article.
I felt lost when I start looking the MQL5 examples... after looking at your article, everithing is much easier to understand.
Ottima spiegazione :-) Grazie :-)
Excellent article Tank You :-)
Great Article,
It helps me to save more than 3 months, Thank you, I am going to your next related article (OOP)
hoping to see money marking expert and sharing with you, I looking forward to such article,
Thank you again,
Dear Sam,
I have already download your; " my_first_ea" and I have tried, it's enjoy. thank you very much!
because of your EA, I'm interest to make EA by my logic reason, it can't trade by self. sorry I'm beginer n don't know what code in mql basic.
FYI; this EA is not error and warning when I've compile, but it can't execute trading.
could you please to help me?
thank you very much for your helping
An amazing "approach" is used by respected and experienced programmers to "solve the problem" of 5-digits. And now this "approach" is also cultivated among beginners, in educational, we may say, literature.
The "approach" given by the author completely nullifies the whole advantage of 5-digit. Instead of explaining to a beginner that the introduction of a 5-digit quote makes it possible to set, for example, take profit not 10 pips, but 10.5. And also to explain that when using an Expert Advisor with a 5-digit quote it is necessary to specify take profit not 10 pips but 100. Instead of such explanations, lines are introduced into the programme code, which programmatically do not make it possible to use the advantages of 5-digit quotes.
"We must be sure that our EA will work correctly with all brokers". Well, we are sure and then what? How can we use the advantage of 5-digit quotes now, if programmatically the Expert Advisor has "sentenced to serve correctly".
And if
_Digits==3
then what, it's all the same ?
STP = STP*10;
TKP = TKP*10;
And what do we get? Isn't it more correct to write?
STP = STP/10;
TKP = TKP/10;
Why is the same code repeated twice in the OnTick function?
and a little further away
And for optimisation it would be nice to use ArrayResize to dynamic arrays: https://www.mql5.com/en/docs/array/arrayresize
And I read another interesting thing in the documentation:
if copying of timeseries and indicator values should be done frequently, for example, at each call of OnTick() in Expert Advisors or at each call of OnCalculate() in indicators, then in this case it is better to use statically distributed arrays, because memory allocation operations for dynamic arrays require additional time and it will affect testing and optimisation of Expert Advisors.
https://www.mql5.com/en/docs/series