Exp_ClosePositionsByTime
This EA is a utility tool that automatically closes all open positions at a specified time of day. It does not open any trades itself but acts as a time-based position manager to ensure no positions are left open past the user-defined closing time.
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 core strategy concept of this EA is time-based position management with no trade signal generation or entry logic involved. Entry conditions: None; this EA does not execute any entry operations. Exit conditions: When server time reaches the user-defined closing time, it iterates through all open positions and closes them one by one. Position sizing: No dynamic position adjustment; it only executes a full close-all operation at the configured time. Money management: No money management logic is present; it does not involve risk control or lot size calculation. The EA is essentially a scheduled position liquidation tool suitable for traders who need to clear all positions at a specific time, such as before market close or before major news releases.
Strengths
- Simple and intuitive operation — just set a closing time and it executes automatically
- Effectively avoids overnight risk or position risk during specific time periods
- Can be used alongside other trading strategies as a risk managementauxiliary tool
Weaknesses
- Single-function utility that only supports scheduled closing, lacking more flexible conditional logic
- Does not account for market liquidity and slippage, potentially resulting in unfavorable fills during low-liquidity periods
- No logging or notification functionality, making it impossible for users to confirm execution status
Possible improvements
- Add partial close functionality and a pre-close alert/notification mechanism
- Include liquidity detection and slippage protection to avoid closing positions during low-liquidity periods
Risk assessment
Overall risk: Safe
- Scheduled closing may result in actual fill prices deviating from expected due to slippage during extreme market conditions
- If the closing time is set incorrectly, execution may fail during market-off hours
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
CloseTime | 23:59 | Daily auto-close time |
CloseOnlyProfit | false | Close only profitable positions |
CloseOnlyLoss | false | Close only losing positions |
MagicNumber | 0 | Magic number for closing, 0 for all positions |
Similar Session Trading EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.