Loading…

Symbol Trading Permission Probe

A strategy that trades twenty symbols usually gets tested on the two or three the developer happens to watch. The other seventeen are assumed tradeable and never actually checked - until one of them turns out to be close only, or disabled outright, and the first sign is a failed OrderSend in live trading rather than a warning beforehand. This script checks every symbol in scope against SYMBOL_TRADE_MODE, the field the server actually uses to decide whether an order is accepted: full, close only, long only, short only, or disabled. The older MarketInfo(MODE_TRADEALLOWED) boolean is printed alongside it rather than instead of it, because some brokers keep that legacy field current and others do not; where the two disagree, that disagreement is exactly the kind of thing worth seeing rather than having one silently overridden by the other. Results are sorted with every non-full symbol first, so the symbols that need attention are on screen without scrolling past a long list of ordinary ones. Account-level trading permission - the master switch, not a per-symbol one - is checked and reported separately at the top, since a symbol showing "full" is still moot if automated trading is off for the whole terminal. Notes and limitations - SYMBOL_TRADE_MODE reflects the server's current setting and can change without notice - around rollover, low liquidity windows, or a broker policy change. Treat a "full" result as true at the moment the script ran, not as a permanent guarantee. - All available scope can be slow on a broker with a very large symbol universe; InpMaxSymbols exists to bound that, at the cost of not covering the whole list in one run. - This reports whether the server will accept an order type, not whether the symbol has a usable spread, sufficient history, or an open session right now - those are separate checks. - A symbol not visible in Market Watch can still report a trade mode under All available scope; visibility and tradeability are independent fields and are both shown.

Script · MT5 · v1.0 · Free

About Symbol Trading Permission Probe

Symbol Trading Permission Probe is a script for MetaTrader 5. It can alert you with a pop-up, sound, email or push message. It has 4 settings, such as Scope, Max symbols and Export csv. MQL source code included.

Files in the download: SymbolTradingPermissionProbe.ex5, SymbolTradingPermissionProbe.mq5, SymbolTradingPermissionProbe.txt.

Settings

SettingDefaultWhat it does
ScopeScopeMarketWatchWhich symbols to probe
Max symbols500Cap on symbols probed
Export csvfalseAlso write the 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 5 open File → Open Data Folder, then go to MQL5 → Scripts.
  3. Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
  4. Open the .mq5 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: Alerts · MT5 Script · MQL5 Source Code

MQL4 & MQL5 scripts · PolyMaria