- Strategy
- Does not open trades. At the set daily time and at the Friday cutoff, it closes the selected positions and deletes pending orders.
- Risk model
- Opens no trades; removes overnight and weekend exposure on a schedule
What it does
Session Close EA flattens your positions on a schedule. Use it to avoid holding trades over the weekend, to make sure intraday trades are closed before the daily rollover, or simply to enforce a personal rule about when trading stops. It shows the schedule and its status on the chart and never opens a trade.
How it works
The EA checks the estimated server time every five seconds and on every tick:
- Daily close (optional): from the set time, Monday to Friday, it closes matching positions and deletes matching pending orders, and keeps doing so for the "keep closing" period, so positions opened just after the cutoff are caught too.
- Friday cutoff (on by default): from 20:00 server time on Friday, the same actions run. With "block rest of Friday" on, they continue until the end of Friday, so no trade is carried into the weekend.
Positions are looped from last to first and closed by ticket; each failure is printed with the broker's reply and retried on the next check, at most every five seconds. Filters choose the symbols (chart only or all) and the positions (all, manual only, one magic number, or manual plus one magic number).
How to use it
Attach it to any chart; one instance with "All symbols" covers the account. Set times in server time, which is the time shown in Market Watch. Many forex brokers stop quoting some instruments earlier than others on Friday, so choose a cutoff comfortably before the earliest close of anything you trade. Our Forex Market Hours tool helps you compare sessions.
Settings
| Input | Default | What it changes |
|---|---|---|
| Use daily close | false | Turns the daily close on |
| Daily close time | 22:45 | Server time for the daily close |
| Use Friday cutoff | true | Turns the weekend close on |
| Friday cutoff time | 20:00 | Server time on Friday |
| Block rest of Friday | true | Keeps Friday flat after the cutoff |
| Keep closing (minutes) | 30 | Length of each closing window |
| Close positions | true | Closes positions |
| Delete pending orders | true | Removes pending orders |
| Show status | true | Chart status text |
| Symbols / Positions | All / All | Scope |
Limitations
The EA only acts while the terminal is running and connected. If a market is already closed at your cutoff, the close fails and the position stays open until trading resumes. Closing at a fixed time ignores where price is, so it can exit a trade at a poor moment. Spreads are often wider near the daily rollover, which raises the cost of closing then.
Before you run it live
Run it on a demo account through at least one Friday and check the log. Compare your broker's trading hours for each symbol with the cutoff you choose. Read about swap costs if you are deciding whether to hold positions overnight. Trading carries a substantial risk of loss.

