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 continue learning the MQL5 programming language. Previously I published the code of the loop that starts the enumeration of open positions. Now, after the loop has been started, we start working with the symbol on the current chart:
I will periodically post the written code with my own comments for providing a prompt feedback. I am asking the participants of this topic to correct me, if there are any inaccuracies in my codes and comments.
Sincerely, Vladimir.
Comments containing data are more practical.
Comments containing data are more practical.
Thank you, Valery! Your version of the message is more informative. I will change the code at once.
Regards, Vladimir.
Dear programming experts!
Please explain two questions:
Maybe I have a wrong understanding of Magic Number application in programming at all.
Regards, Vladimir.
Although there is an explanation in Artem Trishkin's article https://www.mql5.com/ru/articles/7394#node02, but I still don't understand it, because he makes it too complicated.
Sincerely, Vladimir.
Dear programming experts!
Please explain two questions:
Perhaps I have a wrong understanding of Magic Number application in programming at all.
Sincerely, Vladimir.
Why do you need Magic Number now? Really, what's the point of bothering with it now? The trailing stop will obviously be used as an element of semi-automatic trading: someone has placed an order, and the EA starts trawling through it. Who cares who placed the order? If another robot has placed it, and you open a trawl, your Expert Advisor will also trawl his or her order. If you do not set the trawl, it will not. This is exactly the case when you do not need a magik. If you suddenly need it later, you can write it later.
Although there is an explanation in Artem Trishkin's article https://www.mql5.com/ru/articles/7394#node02, but I still don't understand it, because he makes it too complicated.
Sincerely, Vladimir.
You definitely don't need to read this.
Continuing to learn the MQL5 programming language. Previously I published the code of the loop that starts the enumeration of open positions. Now, after the loop has been started, we start working with the symbol on the current chart:
I will periodically post the written code with my own comments for providing a prompt feedback. I ask the participants of this topic to correct me, if there are any inaccuracies in my code or comments.
Sincerely, Vladimir.
Again you are starting with a wrong idea and the code contains an error. Start with the functions. Write a framework of the algorithm using only your own functions. Then we will think how to implement them. Start with the standard template that is opened when creating a new EA in metaeditor.
The trailing stop is better to be made for the net account to begin with. This way it will be easier to work with the position, because there will only be one position for a symbol. In the second version, it will be possible to change it into a hybrid.
Why do you need Magic now? Really, what is the point of bothering with it now? The trailing stop will obviously be used as an element of semi-automatic trading: someone places an order, and the EA starts trawling through it. Who cares who placed the order? If another robot has placed it, and you open a trawl, your Expert Advisor will also trawl his or her order. If you do not trigger a trawl, it will not. This is exactly the case when you do not need a magik. If you suddenly need it, please, write it down later.
Hello Vasily! I understand everything about the Magic Number, but the problem is that it was strongly recommended to me by Andrey Novichkov here.
Regards, Vladimir.
You definitely don't need to read this one.
I see.
Respectfully, Vladimir.
You are starting from the wrong place again, and the code contains an error. Start with the functions. Write the algorithm framework using only your own functions. Then we will think how to implement them. Start with the standard template that is opened when creating a new EA in metaeditor.
The trailing stop is better to be made for the net account to begin with. This way it will be easier to work with the position, because there will only be one position for a symbol. In the second version, it will be possible to convert it into a hybrid.
The standard template was created. I started writing the code in it and will post those fragments that have already been written here. I hadn't guessed about the algorithm framework with my own functions, thanks for the tip! Also thanks for the tip about the netting account!
If it's no secret, what's the error in the code?
If it's here:
I've already corrected it to:
Sincerely, Vladimir.