Closeprofitendofweek
This EA is a utility that automatically closes all profitable positions for the current symbol on Friday after a user-specified end time. It operates via a timer and skips crypto symbols. It does not open any trades itself, functioning purely as an end-of-week profit-taking manager.
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 to automatically close all profitable positions at the end of Friday's trading session to avoid weekend holding risk. Regarding entry conditions, this EA does not execute any entries; it only manages exits. The exit condition is: the current day is Friday, the server time has passed the user-defined Endtrade time, and the position has a floating profit greater than zero. In terms of position sizing, this EA does not handle opening positions; it only selectively closes existing profitable ones. For money management, there is no money management logic at all—no adjustments based on account balance or risk ratios. Additionally, the EA filters out crypto symbols via SYMBOL_CATEGORY, operates only on the current chart symbol, and uses a timer trigger instead of the OnTick event, which means it may miss positions if the timer interval is not configured properly.
Strengths
- Simple and clear logic focused on weekend risk management, reducing exposure to weekend gap risk
- Only closes profitable positions, leaving losing positions for the trader to decide, avoiding locked-in losses
- Filters out crypto symbols via category check, acknowledging that crypto trades 24/7
- Uses standard CTrade library for closing operations, ensuring reliable andstandardized execution
Weaknesses
- Only runs in OnTimer, meaning it may miss closing opportunities if the timer interval is not properly configured
- Only closes profitable positions while leaving losing ones open, which still exposes the account to weekend gap risk
- No retry mechanism—if closing fails, it only prints a log without attempting again
- The Starttrade parameter is declared but never used, making it a dead parameter
- Iterates positions by index from front to back; closing positions during iteration may cause index shifting issues
Possible improvements
- Iterate positions from back to front (PositionsTotal()-1 down to 0) to avoid index shifting when positions are closed during iteration
- Remove the unused Starttrade parameter or implement its functionality, and add EventSetTimer initialization in OnInit
- Add a retry mechanism for failed close attempts, and consider providing an option to also close losing positions for comprehensive weekend risk avoidance
Risk assessment
Overall risk: Low
- Iterating positions from front to back while closing may cause index shifting, potentially skipping some positions
- OnTimer is not initialized in OnInit; if the timer is not manually set, the EA will not execute any operations
Evaluation scores
Parameters
| Parameter | Default | Description |
|---|---|---|
Starttrade | "00:00" | Trading start time, format HH:mm |
Endtrade | "20:00" | Trading end time, format HH:mm |
Closetradeatendtime | true | Close all profitable positions at end time and weekends |
Similar Session Trading EAs
Backtests are historical simulations and do not guarantee future results. Not financial advice.