
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
There are errors, so the code will not work as the author intended. You have to figure it out. You have the code, you have the cards to hand.
From what you have shown, I see that either the candles are less than 60, or the handle of one of the indicators is INVALID, which means that the parameters are sent to it incorrectly. Or there is an error in another part of the code that I do not see.
Regards, Vladimir.
Oops, Alexey;)
I managed to find out where the problem lies myself, but the question was about something else: what can be affected by these errors and what should I change in the code to eliminate them?
Sincerely, Vladimir.
If an error occurs, the Expert Advisor will not be attached to the chart.
You do not have to do anything. What has already been done - in case of an error, the Expert Advisor is detached from the chart
and informs the user.
This error does not practically occur, except when the computer is in a mess.
==
However, if it always happens during the development process...
It means that indicator is not called correctly - fix indicator parameters.
If the error happens, the EA will not attach to the chart.
You do not need to do anything. What has already been done - in the event of an error, the Expert Advisor detaches from the chart
and informs the user.
This error does not practically occur, except when the computer is in a mess.
==
However, if it always happens during the development process...
It means that the indicator is called incorrectly - fix the indicator parameters.
Thank you, Dmitry for your comprehensive and understandable answer!
Regards, Vladimir.
here it works - maybe you're not setting the period correctly
Thanks for the tip!!! Indeed, the problem was that I couldn't set the periods for both indicators from "zero" and above in the tester settings. I should have set them at least from "one" and above.
Thank you all for your participation!
Regards, Vladimir.
P.S. You should remove the EA's code "spoils", because these "spoils" annoy a lot of people. I've already removed mine.
Those who are very annoying let them go woods periodically taking motherwort or tincture of fly agaric.
I don't like those shoelaces either, but I just don't watch them.
I've decided to learn the language but not many people have started learning it. What for?
Vladimir, it's very simple. I have learned what I needed to learn. Now I take different EAs and make them for myself. The most important thing is that now I no longer look at MQL5 as the Chinese characters, but as a normal piece of software. Many thanks to all professionals who helped me in my self-study!
Regards, Vladimir.
I'd rather have a spoiler than download a file and stick it in my sandbox. )
Good morning everyone and good mood!
Continuing self-study of MQL5 programming language. The time came when I had to deal with arrays. I have decided to calculate the lot size depending on the risk specified in the input parameters. I have no errors or warnings after compilation, but the function code does not work. Can you please tell me please, where is the error?
Sincerely, Vladimir.
Sincerely, Vladimir.
I very much hope that you did not write it...
Here's a working function
All you need to do is to enter the amount of risk, so that it doesn't count from the full free margin...