Pending Order Guard News and Weekend
- Utilità
- Versione: 1.0
- Attivazioni: 10
Pending Order Guard: News and Weekend takes your pending orders off the broker before high-impact news, the nightly rollover and the weekend gap, and puts every one back afterwards with the same price, stop loss, take profit, volume, expiry, magic number and comment. One chart, no DLL, every setting in the panel.
Who it is for
- Prop-firm traders. Many prop firms do not allow a trade to open or close in a short window around high-impact news, and some count a pending order that fills in that window as a trade. The guard takes your pending orders off before the window and puts them back after it. Check your firm's own rules and set the minutes before and after to cover its window.
- Traders who leave pending orders overnight. Around the daily rollover spreads widen for a few minutes, and a stop or limit can fill on the spread alone.
- Traders who leave pending orders over the weekend. On Monday the market can open far from Friday's close, and an order can fill at the gap.
- Traders who run EAs without a news filter of their own. The guard can take listed EAs off their charts around the news and bring them back with all their inputs.
What it does
- Parks pending orders before red news (optionally orange news), only on the symbols the event's currency moves, or on all symbols.
- Parks pending orders over the nightly rollover, on the nights you choose.
- Parks pending orders over the weekend, from the time you set on Friday until the time you set on Monday.
- Puts each order back exactly: same symbol, type, volume, price, stop-limit price, stop loss, take profit, expiry, magic number and comment.
- Guards every pending order of the account by default, manual or from any EA. You can narrow it to listed magic numbers, to some symbols, or leave some out.
- Optionally pauses listed EAs and brings them back with their inputs.
- One panel on the chart shows the status, the next event, what is parked and when it comes back.
How it works
- Attach the EA to one chart. It guards every symbol you choose, not only the chart's symbol.
- Every second it checks three sources: news windows, the rollover window and the weekend window.
- When a window starts, each pending order in scope is first written to a file on your computer and only then deleted at the broker. While it is parked, it cannot fill on a spike, a spread blow-out or a gap.
- When every window is over, each order is placed again. After news, the guard waits 30 seconds (you can change it). After the rollover and the weekend, orders go back at the exact time you set.
- An order leaves the parked file only when the broker confirms it. Before every send the guard checks that the same order is not already there, so a lost answer from the broker never creates a second order.
Times on the clock you think in
Every park and restore time has its own clock: Sydney, Tokyo, Frankfurt, London, New York, Broker (server time) or My PC. Summer time for each city is built in, so you never need your broker's GMT offset.
Example, the default weekend: park Friday at 2 pm New York, restore Monday at 10 am Tokyo. You type 14:00 with the clock on New York and 10:00 with the clock on Tokyo. Under each time the panel shows the same moment on your broker's clock, for example "= Fri 21:00 broker time" and "= Mon 03:00 broker time" for a broker on GMT+2.
With "Wait for the broker's first prices" on, orders stay parked after the Monday restore time until the chart symbol has a fresh price, for example on a holiday Monday (at most 72 hours).
Settings overview
All settings are in the panel and are saved for each trading account. The EA has no input parameters.
- News tab: park around news (on); red news minutes before and after (10 and 10); orange news (off; 2 and 2); symbols affected (the event's currency, or all symbols); only these currencies; if news is unknown (park all and warn, or warn only); news source (Forex Factory, then the MetaTrader 5 calendar; or the MetaTrader 5 calendar only).
- Orders tab: guard on; orders to guard (all pending orders, or listed magic numbers only); never touch magics; only these symbols; never touch symbols; price on the wrong side (keep parked and alert, skip and report, place at minimum distance, convert stop and limit); wait after news (30 seconds); pop-up alert on problems.
- EA pause tab: pause EAs (off); EA names; their magic numbers; their pending orders (delete, or park and restore).
- Overnight / Weekend tab: park over the rollover (on); park at 16:45 New York; restore at 17:20 New York; nights Monday to Thursday; park over the weekend (on); park Friday 14:00 New York; restore Monday 10:00 Tokyo; wait for the broker's first prices (on). Each time with its own clock. The Check row warns about a window of 0 minutes, an overnight window over 12 hours or a weekend window over 4 days. Example of a longer quiet-hours park: park at 20:00 on the London clock, restore at 10:00 on the Tokyo clock, nights Monday to Thursday. Orders stay off from the London evening to the Tokyo morning, about 5 hours (20:00 to 01:00 UTC in winter, 19:00 to 01:00 UTC in London summer time), and the rollover lies inside.
- Buttons: Park now, Restore now, Test settings (shows what would be parked now, without touching anything).
Safety
- Never lost: the order is saved to the parked file before it is deleted. The file is written in one step, so a crash while writing leaves the previous file intact.
- Never doubled: an order leaves the parked file only after the broker confirms it, and the guard checks for the same order at the broker before every send.
- Restart-safe: after a terminal restart, VPS reboot, recompile or chart change, the guard reads the parked file. If the window is still on, the orders stay parked. If it has ended, they come back.
- Never fails open on news: if the calendar cannot be read, the status says "News unknown", never "Clear", and the guard follows your choice (by default it parks every order in scope and warns).
- No doubles from EAs: an order placed during a window is parked too. If an EA has already placed its order again (same magic number, symbol and type), the parked one is not restored. The panel warns when one EA keeps placing orders during a window. Orders of paused EAs are deleted, not restored, so the EA places them again itself.
- A restore the broker refuses (market closed, requote, busy, no connection) is retried with longer pauses and shown in the panel. It is never dropped silently.
What it does not do
- It does not open, close or change positions. It handles pending orders only.
- It does not move or remove the stop loss and take profit of open positions. A stop loss or take profit that is hit during news is not prevented.
- It does not trade for you and gives no signals.
- It cannot act while the terminal is closed. Keep the terminal running at the start and the end of each window (a VPS is the usual answer).
Setup
- Attach Pending Order Guard to one chart, for example EURUSD (the weekend "first prices" check watches this chart's symbol). Allow Algo Trading.
- Tools, Options, Expert Advisors: tick "Allow WebRequest for listed URL" and add the calendar address shown in the panel's News tab. Without it the guard uses the MetaTrader 5 calendar. The overnight and weekend parts need no address.
- Check the status line: "Clear" means the news data is in and nothing is parked now. Press Test settings once.
Use one copy per account. A second copy stays idle and says so.
Try it in the Strategy Tester
The free demo runs in the Strategy Tester and shows the guard at work. The tester has no web access, so a showcase mode takes over there: it places four sample pending orders, uses a sample news schedule (red news on weekdays at 13:30 and 15:00 UTC), and parks and restores the samples through news, the rollover and the weekend, with a note on the chart. It also opens and closes one minimum-lot sample trade once. Nothing of this happens on a live chart. In the tester, the server clock counts as UTC.
Frequently asked questions
Do I need to know my broker's GMT offset?
No. Pick the clock you think in; the line under each time shows the broker time.
Does summer time break the windows?
No. The summer-time rules of Sydney, Frankfurt, London and New York are built in (Tokyo has none). Broker and My PC are read live.
Which orders are parked?
By default every pending order on the symbols you choose, manual or from any EA. "Listed magic numbers only" narrows it.
What happens if the price passes my order while it is parked?
You choose: keep it parked and get an alert (default), skip it and report it, place it at the minimum allowed distance, or convert a stop into a limit and the other way round.
What happens to an order's expiry?
It is restored with the same expiry. If the expiry passed while the order was parked, it is reported and not placed.
What if my terminal restarts while orders are parked?
The guard reads the parked file when it starts and restores the orders when the window is over.
Can I park only over the weekend?
Yes. Switch off news and the rollover.
Does it work with my EA?
It parks any EA's pending orders and restores them without doubles. For an EA that trades through news, list it in the EA pause tab: it is taken off its chart for the window and comes back with its inputs.
Can I move it to the MQL5 VPS while orders are parked?
Migrate when nothing is parked. The parked file stays with the terminal that wrote it.
I trade crypto at the weekend. Does the weekend park cover it?
The weekend window parks every symbol in scope. Add weekend-trading symbols to "Never touch symbols" if you want them left alone.
Questions and support: through the comments on this page or private messages on MQL5.
