Discussion of article "Cross-Platform Expert Advisor: Custom Stops, Breakeven and Trailing" - page 2
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
Your first code activates breakeven, not trailingstop. If there would be any further modification of SL, it would be takeprofit. But if your TP is 500 points, the trailing would not activate at all at 500 points, since the trade has already left the market at that point.
Your second code uses trailingstop, but not breakeven. Because even before the breakeven can be applied, the SL has already moved above the breakeven price.
Hi Enrico,
I didn't get your point.
This is breakeven:
This is trailing:
Breakeven activates at 250 points, trailing activates at 500 point. As you see trailing is not activated earlier than breakeven.
SL was not moved above (or below) the breakeven price. Stop loss was the same initial SL below the open price. The trailing stop moved SL first time above the open price (and breakeven price).
Trailing works fine. Breakeven don't work (trail_be object). If I don't use the trailing stop breakeven works fine.
The problem seems to be only for sell order.
Problem in this place
I guess it should be changed to:
Thank you for explaining the issue further, and sorry that I misunderstood earlier. Regarding this change:
Normally, I just put the breakeven CTrail as the last index so it is evaluated last, but the code above is a more permanent solution for trailing the stoploss of sell trades.
How do I bind a specific stop to a specific signal? Due to my strategy logic every entry signal has its own stop.
Same with exit signal.
hello i have aproblem with the expert can you help me?