Trailing_Profit - MetaTrader 5 Expert | MT5 EA Download - MetaTrader 5 Resources
The author of the idea — Vitaly , the author of the MQL5 code — Balabashka Kon .
The Expert Advisor manages all open positions in the terminal (all symbols and all magic numbers). If the total profit does not reach the " minimum profit ", the EA waits.
If the total profit reaches " Minimum Profit " , the EA sets the profit retracement percentage and enables tracking.
The " Profit Percent " parameter is specified as a percentage. For example, " Minimum Profit " = 1000 and " Profit Percent " 20. The total profit of all open positions has reached 1000. If the profit falls to 800 (1000 - 20%), the position will be closed. If profits continue to grow, for example reaching 2000, the allowed drawdown will be equal to 400 (2000 - 20%). That is, all positions will be closed with a total profit of 1600. There is no fixed drawdown limit as I don't think using absolute values is useful.
In theory, it is possible to set percentage = 0. It will act as a total take profit. You can set percentage = 100 and it will act as breakeven (don't forget that because some orders are closing, other orders may lose money).
attention! Expert Advisor with 3 second interval:
Blank check () { //--- Allow to work on a static datetime every three seconds Previous time = 0 ; Date time current time = time current (); if (current time - previous time < 3 ) return ; Previous time = current time; //---
Attachment download
📎 trailing_profit.mq5 (12.41 KB)
Source: MQL5 #18709
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •