Broker Quirk Knowledge Base
No API tells a program "this broker requires manual confirmation on stop moves" or "this broker's reported freeze level understates the real one" - facts like that come only from traders hitting them and writing them down. Hardcoding a handful of known brokers into the source means every user has to wait for a new CodeBase version before benefiting from a quirk someone else already discovered on a broker the original author never used. This header instead treats broker quirks as DATA, not code. CBrokerQuirkKnowledgeBase holds rows of (server name pattern, flag name, flag value), matched against the account's real server name with exact match or a single trailing-'*' wildcard (e.g. "ICMarkets-*"). Rows can come from LoadBuiltinStarterSet() - a small, explicitly illustrative set shipped with the library to demonstrate the shape of a real entry, not a verified claim about any specific broker's current behaviour - and/or from LoadFromFile(), which reads a CSV file the trader (or the wider community, via a shared file) maintains and extends over time. Rows loaded later win a tie, so a user's own file loaded after the builtin set naturally overrides the illustrative defaults; an exact server match always beats a wildcard match regardless of load order, so a broker- specific row is never shadowed by a broader fallback rule. GetFlagBool/GetFlagDouble/GetFlagString turn a matched row into a typed value with an explicit fallback for "no row matched this server and flag" - the honest and common case for any server not yet documented by anyone. Notes and limitations - The bundled LoadBuiltinStarterSet() rows are ILLUSTRATIVE EXAMPLES of the kind of quirk this mechanism stores - they are not a verified survey of any real broker's current behaviour, and broker behaviour changes over time in ways this library has no way to re-check. Treat them as a template, not a source of truth. - Wildcard matching supports only a single TRAILING '*' (prefix match) - there is no leading-wildcard, mid-string-wildcard, or full regex support, kept deliberately simple for a config-style lookup. - Capped at 200 total rows (BROKER_QUIRK_MAX_ROWS) across all loaded sources combined; rows past the cap are rejected and logged, not silently dropped. - CSV parsing uses MQL4's native FILE_CSV field reader - a row is expected to have exactly three columns per line; malformed rows are best avoided rather than specifically detected and reported. - This library only stores and looks up flags - it does not itself change how any other code trades or draws; the calling program decides what to do with a matched (or unmatched) flag.
Script · MT5 · v1.0 · Free
About Broker Quirk Knowledge Base
Broker Quirk Knowledge Base is a script for MetaTrader 5. It has 1 setting, such as Quirk file name. MQL source code included.
Files in the download: BrokerQuirkKnowledgeBase.mq5.mqh, BrokerQuirkKnowledgeBase.txt, BrokerQuirkKnowledgeBaseDemo.ex5, BrokerQuirkKnowledgeBaseDemo.mq5.
Settings
| Setting | Default | What it does |
|---|---|---|
| Quirk file name | Murodillo\\BrokerQuirks.csv | Community quirk file, under MQL5\Files\ |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 5 open File → Open Data Folder, then go to MQL5 → Scripts.
- Copy the .mq5 file(s) there. Put any .mqh files in MQL5 → Include.
- Open the .mq5 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the script onto a chart to run it once.
Tags: MT5 Script · MQL5 Source Code