Exp_ToCloseLoss - MetaTrader 5 Expert | MT5 EA Download - MetaTrader 5 Resources
Expert Advisor that executes global stop loss on all open positions. If the loss of the current position increases by the maximum fixed level in the MaxLoss input parameter of the Expert Advisor, it will simply close all positions.
When all open positions exceed losses, the Expert Advisor saves information about this fact to terminal global variables and exits all open positions only on the basis of this information.
Why this instead of directly on the signal? The problem is that the closing process takes multiple times, which is why in real life the closing process can be interrupted for any reason. In this case, the Expert Advisor will in any case close the position for more than the loss. Since all positions have been closed, the terminal global variables will be deleted!
Attachment download
📎 exp_tocloseloss.mq5 (4.38 KB)
📎 tradealgorithms.mqh (67.74 KB)
Source: MQL5 #1543
Exp_ToCloseLoss - MetaTrader 5 Expert | MT5 EA Download - MetaTrader 5 resource usage and screening suggestions
This content can be used as a data entry for foreign exchange EA, indicators, trading systems or quantitative strategies. When reading, it is recommended to make a judgment based on the platform version, trading type, time period, risk control method and historical discussion background. Do not use it directly based on the title or a single point of view.
If the content involves MT4/MT5, ForexFactory, MQL source code, TradingView indicators or strategy discussions, you can give priority to the parameter logic, backtest environment, market stage, execution cost and failure conditions, and then decide whether to continue downloading, reviewing or secondary development.
Risk warning
For any EA, indicator or automatic trading strategy, it is recommended to first conduct historical backtesting, simulation account verification and small capital testing. Grid, Martin, high frequency, recovery and examination strategies especially require setting the account risk upper limit, single variety risk upper limit and manual deactivation conditions.
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •