Intent Reconciliation Daemon
Any process that decides what should be held - a spreadsheet, a signal service, a separate strategy engine, a human's own trading plan - can drift out of sync with what is actually open on the account, and nothing in MetaTrader compares the two automatically. By the time a mismatch is noticed by eye, it may have been wrong for hours. This daemon reads a simple CSV of intent - Symbol, Direction, Lots per line - and on a timer, nets the account's live orders per symbol and compares the two. Three kinds of drift are distinguished: a symbol the intent file expects but the account does not carry, a symbol carrying the wrong size beyond a configurable tolerance, and a symbol open on the account with no corresponding intent row at all. An alert fires once on the transition into drift, not on every scan, so it does not spam once you are aware of a mismatch. The intent file is read-only from this tool's side - it never writes to it, only re-reads it whenever its modify timestamp changes, so updating intent is just editing the file. No restart is needed to pick up a change. Notes and limitations - Reconciliation is per symbol, net of direction - it cannot distinguish two opposing tickets on the same symbol that happen to net to the intended total from one ticket at the correct size. - Up to 50 intent rows are read per file; extra rows beyond that are ignored. - A malformed row (unknown direction) is skipped and logged, not fatal to the rest of the file. - This tool only alerts - it never opens, closes, or resizes a position itself, so acting on a reported drift is entirely up to the trader or whatever process publishes the intent file.
Expert advisor · MT4 · v1.0 · Free
About Intent Reconciliation Daemon
Intent Reconciliation Daemon is a script for MetaTrader 4. It can alert you with a pop-up, sound, email or push message. It has 5 settings, such as Intent file name, Magic filter and Lots tolerance. MQL source code included.
Files in the download: IntentReconciliationDaemon.ex4, IntentReconciliationDaemon.mq4, IntentReconciliationDaemon.txt.
Settings
| Setting | Default | What it does |
|---|---|---|
| Intent file name | IntentReconciliationDaemon_intent.csv | Symbol,Direction,Lots per line |
| Magic filter | -1 | Only reconcile orders with this magic; -1 = any magic |
| Lots tolerance | 0.01 | Lots difference under this is not treated as drift |
| Poll interval sec | 20 | How often positions are reconciled against intent |
| Re alert on each scan | false | true = alert every scan while drift persists, not just on the transition |
How to install
- Download the ZIP from your PolyMaria library and unzip it.
- In MetaTrader 4 open File → Open Data Folder, then go to MQL4 → Scripts.
- Copy the .mq4 file(s) there. Put any .mqh files in MQL4 → Include.
- Open the .mq4 file in MetaEditor and press Compile (F7) if MetaTrader does not show it.
- Drag the script onto a chart to run it once.
Tags: Buy/Sell Arrows · Alerts · MT4 Expert Advisor · MQL4 Source Code