Weekend and Session Closer
- Утилиты
-
Fernando Altair Kuhn
Trader and MQL5 developer from Brazil. I build MetaTrader 5 tools for risk control and trade execution: lot calculators, loss limits, stop managers, a trade copier and strategy builders. Every product shows its limits and its tester results with real costs. No profit promises. Support through MQL5 - Версия: 1.1
- Обновлено: 6 ноября 2026
Weekend and Session Closer closes positions and deletes pending orders at the times you choose: before the weekend, at a daily time, a few minutes before each symbol's trading session ends, or when a position gets too old. It works with trades opened by hand or by other Expert Advisors and never opens trades on your account.
Four rules, each with its own action
- Weekend close - N minutes before each symbol's last session of the week (default 30 minutes; the real weekly close is learned from recent price bars, so daylight saving time shifts that the broker's session table does not show are handled), so gold, indices and forex each close before their own market closes, or a fixed day and time in server time.
- Daily close - one time of day with the days of the week you pick.
- Session end - N minutes before the current trading session of each symbol ends.
- Time limit - positions older than N hours.
For each rule you choose what it does: close positions, delete pending orders, or both.
Which positions
- All symbols, the chart symbol, or a list.
- All magic numbers, manual trades only, or one magic number.
- All positions, profitable only, or losing only.
Safe execution
- Everything runs on server time.
- When a market is already closed, it waits and acts as soon as the session opens.
- Rejected requests are retried with a pause; the journal is not flooded.
- Pending work is kept if the terminal restarts, and a scheduled time that was missed is still executed up to N minutes later.
- Optional no new trading window: after the weekend close, new positions are closed and new orders deleted until a day and time you set, for example Monday 01:00.
Panel
- Next action with a countdown and how many positions it will close.
- The rules and filters in use.
- A table of the matched positions with the rule and time that will close each one.
- The last actions.
- Buttons: close matched now (two clicks), skip the next event once, pause and resume.
Warnings
A pop-up or push notification a few minutes before acting, when a batch is done, and when an item could not be closed after several tries.
Strategy Tester
In the tester the utility opens small demo positions and a pending order now and then (no strategy), only so you can watch the rules close them in visual mode. Their profit or loss means nothing. On a live or demo account it never opens trades.
Notes
The terminal must be running with Algo Trading enabled at the time of the close. Prices can gap when markets reopen; closing before the weekend avoids holding positions through that gap, it does not avoid losses during the week.
Inputs
- Filters: symbols, symbol list, magic number filter, magic number, position type
- Weekend close: on or off, fixed time or minutes before the last session, day, time, minutes, action
- Daily close: on or off, time, days of the week, action
- Session end: on or off, minutes before, short breaks to ignore, action
- Time limit: on or off, hours, action
- No new trading window: on or off, start, end by day and time or by minutes
- Warnings: minutes before, pop-up, push
- Execution: minutes to still act after a missed time, retry interval, maximum slippage
- Display: panel corner and offsets; Strategy Tester only: open demo positions
