Equity-based Position Closure
This EA monitors account equity and automatically closes all open positions when equity reaches a user-defined profit target or loss threshold. It acts as a portfolio-level equity monitor and does not open any trades itself, functioning purely as a risk management utility.
Open the interactive view (equity curve, symbol switch)Key facts
Backtest results (H1, about 1 year)
Not backtested yet — this EA could not be converted automatically.
Strategy analysis
The strategy concept of this EA is based on account equity monitoring rather than market signals, and it does not involve any entry conditions because it does not open trades. The exit condition is triggered when account equity reaches a user-defined profit target or loss limit, at which point all open positions are closed automatically. Position sizing is not applicable since this EA does not manage position sizes. For money management, it protects overall account capital through equity thresholds, serving as a global capital protection mechanism. The EA continuously monitors the deviation between current equity and set targets in OnTick, and once a threshold is triggered, it iterates through all positions and closes them one by one. This tool is suitable for traders running multiple strategies simultaneously, providing account-level profit and loss control.
Strengths
- Provides account-level risk control, ideal for scenarios with multiple strategies running simultaneously
- Simple and clear logic without introducing additional trading risk
- Supports both profit target and loss limit, providing dual-direction account capital protection
Weaknesses
- Cannot distinguish positions from different strategies or symbols, closing all positions indiscriminately
- Lacks granular control, cannot selectively close by symbol, magic number, or direction
- Unreasonable thresholds (e.g., very tight stop) may trigger frequently during normal volatility causing unnecessary closures
Possible improvements
- Add filtering capability to close positions by symbol, magic number, or direction instead of all-at-once
- Add equity tracking statistics and logging to help users optimize threshold settings
Risk assessment
Overall risk: Safe
- Slippage during position closure may cause actual equity to differ from expected
- Batch closing during extreme market conditions may face insufficient liquidity
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
EquityProfitTarget | 0 | Equity profit target; closes all positions when reached |
EquityLossLimit | 0 | Equity loss limit; closes all positions when reached |
CloseAllOnTarget | true | Close all positions when profit target is reached |
CloseAllOnLoss | true | Close all positions when loss limit is reached |
CheckInterval | 1000 | Check interval in milliseconds |
EnableAlerts | true | Enable alert notifications |
Similar Utility EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.