Loading…

Watchlist Trading Readiness Preflight

A symbol that looks completely normal on the chart can still be unready to trade. History can be thin after a broker migrates a feed. The spread can be wide because the session has not opened yet. The server can have trading switched off for one specific instrument while everything else works. None of that is visible from glancing at a candle. The naive version of this check is "does the symbol have a current price." That test passes on all three of the problems above. This script instead checks four things that actually matter before a basket or a multi-symbol expert starts sending orders: enough bars loaded on the timeframe that matters, a spread inside a stated ceiling, a quote that arrived recently rather than one frozen from a closed session, and - when asked - whether the server currently allows trading on that symbol at all. Each symbol gets a plain PASS or FAIL and, on a FAIL, the specific reason or reasons, not just a single opaque flag. A symbol failing on stale quotes needs a different fix from one failing on spread, and printing both in one run means you find out once instead of after the fact. Notes and limitations - This is a one-off preflight check, not a monitor. Run it again close to the moment you intend to start trading, since spread and quote age both change by the minute. - The trade-allowed check reflects the server's current setting for that symbol and account, not a permanent property - it can flip during news embargoes or maintenance windows. - History depth is read from bars already loaded in the terminal. A symbol added to Market Watch moments ago may need a chart opened on it, or a short wait, before the full count is available. - Grading is independent per symbol; there is no cross-symbol correlation or portfolio-level check here.

Script · MT4 · v1.0 · Free

About Watchlist Trading Readiness Preflight

Watchlist Trading Readiness Preflight is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 8 settings, such as Symbol list, Timeframe and Min history bars. MQL source code included.

Files in the download: WatchlistReadinessPreflight.ex4, WatchlistReadinessPreflight.mq4, WatchlistReadinessPreflight.txt.

Settings

SettingDefaultWhat it does
Symbol listSymbols, comma separated (blank = every Market Watch symbol)
TimeframePERIOD_CURRENTTimeframe the history depth is measured on
Min history bars1000Minimum bars of history required to pass
Max spread pips3.0Maximum current spread, in pips, to pass
Max quote age seconds120Quote older than this is graded as a dead/closed session
Require trade allowedtrueFail a symbol if the server has trading disabled on it
Write csvtrueAlso write the graded table to a CSV file
DelimiterDelimiterCommaCSV column separator

How to install

  1. Download the ZIP from your PolyMaria library and unzip it.
  2. In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Scripts.
  3. Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
  4. Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
  5. Drag the script onto a chart to run it once.

Download the PDF guide

Tags: Trading Sessions · Multi-Currency · Alerts · MT4 Script · MQL4 Source Code

MQL4 & MQL5 scripts · PolyMaria