Move StopLoss to BreakEven
- Utilities
- Christian Schwirtz
- Version: 1.1
- Updated: 26 September 2024
This tool for the MetaTrader 5 trading platform allows setting the stop loss of open positions to breakeven (entry price) plus an adjustable distance in points. The stop loss is only adjusted if the position is already in profit.
Main functions:
- Button:
- A button is displayed on the chart with the text "StopLoss to BreakEven".
- The color of the button can be customized, by default it is red.
- User interaction:
- When you click the button, for all open positions that are in profit, the stop loss is set to the entry price plus an adjustable distance (10 points by default).
- Stop loss adjustment:
- For buy positions, the stop loss is set to the entry price plus the distance if the current price is above the entry price.
- For sell positions, the stop loss is set to the entry price minus the distance if the current price is below the entry price.
Error handling:
- If there are no open positions, an information message is displayed.
- If an error occurs when adjusting the stop loss, an error message is also displayed.
- distanceInPoints: The distance (in points) between the current price and the new stop loss (default: 10 points).
- buttonColor: The color of the button can be customized (default: red).
In summary:
This tool allows you to easily set stop loss to break-even plus a defined distance for all open positions that are already in profit by clicking on the chart button.
Disclaimer:
Trading carries significant risk and may not be suitable for all investors. Past performance is not indicative of future results. Use this EA at your own risk and ensure it fits your overall trading strategy.
If you like the program, please leave a 5-star rating and a short comment :)