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
Generally speaking, there are two motivations with opposite effects. Closer SL reduces the loss and makes the probability of closing on the SL higher. If the SL will be close in relation to volatility, then of course your option is better, if at a normal level and pulling up the SL will not affect the frequency of triggering, then mine.
You have already run into the realm of strategy ;) teach me tofirst set 1 bu and then move it
You have already run into the realm of strategy;) teach me how tofirst set 1 boo and then move it
Hello! On the one hand you are right - you can just stop at one breakeven and write a code only for it. But, in my opinion, if you initially have no idea how a trailing stop should work in general, it is not the best option. In addition, almost all Expert Advisors are written based on a clearly defined strategy. As they say in such cases, "we must come to an agreement on the coast".
I feel that I am "awakening" the programmer again.
Regards, Vladimir.
That's my understanding. You have two functions of re-positioning trailing stops. The first one moves trailing stop-loss to Breakeven, guided by parameter "Trailing level", the second function pulls stop-loss further behind the price, guided by parameter "Trailing step". Imho, I would call the first parameter "Stop Loss Breakeven Level" - because it is not a trailing stop loss but rather a stop loss transfer.
Yes, Vasily, that's right! You have correctly understood and formulated my idea of a trailing stop. The parameter should have had the same name from the beginning: " Trailing Stop Loss Level to Breakeven". My terminology is still not perfect. Thank you!
Sincerely, Vladimir.
Hello! On the one hand you are right - you can just stop at one breakeven and write a code only for it. But, in my opinion, if you initially have no idea how a trailing stop should work in general, this is also not the best option. In addition, almost all Expert Advisors are written based on a clearly defined strategy. As they say in such cases, "we must come to an agreement on the coast".
I feel that I am "awakening" the programmer again.
Regards, Vladimir.
Hello! If you learn to move the Stop Loss step by step once, you can move it 100 times later, if necessary, if you have enough room for it ;)
The Expert Advisor is adjusted to the strategy, not vice versa
Yes, Vasily, absolutely right! You have correctly understood and formulated my idea of a trailing stop. The parameter was originally intended to be called that: " Trailing Stop Loss Level to Breakeven". My terminology is still not perfect. Thank you!
Sincerely, Vladimir.
Hello Alexey! Sorry for not reacting to your post immediately. This link is very interesting. I have looked through all 11 trailing codes and function libraries. It is all very interesting, even though it is written in MQL4. To be honest, I have never imagined that there are so many types of trailing stops. Thank you very much for your support!
Sincerely, Vladimir.
Good morning everyone and good mood!
I continue learning the MQL5 programming language. Taking into account Vasily Sokolov's corrections, the algorithm of trailing Stop Loss at open positions now
looks as follows:You should then follow the pattern:
Part 1. Breakeven:This variant of the algorithm of the Trailing Stop Loss of the open position is final
, and I continue writing program code by following it.Regards, Vladimir.
Hello! If you learn to move the stop loss step by step once, then you can move it 100 times if necessary, just as long as there is room for it ;)
The Expert Advisor is adjusted to the strategy, not vice versa
Hello! I already mentioned in my post earlier that you are right in your judgement. The thing is that with the help of Vasily Sokolov I relatively quickly formed an algorithm for trailing Stop Loss in an open position, so I will follow it.
Regards, Vladimir.
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 ask the participants of this topic to correct me, if there are any inaccuracies in my code or comments.
Regards, Vladimir.