Loading…

Intent Level Copier

The usual copier design publishes a lot size. That number is meaningless the moment the receiving account has different equity, a different broker's tick value, or a different symbol suffix - the classic failure mode of a copier that "worked in testing" and then either wildly over-risks or under-risks the moment it runs on a second account. This EA never publishes a lot size at all. It watches this account's own open orders (optionally filtered to one magic number), and for each one it computes the money risked from that order's own stop distance and this symbol's live tick value and tick size - never a hardcoded contract size or pip value. It then expresses that risk as a multiple of "1R", defined here as a configured percentage of this account's own current equity. A receiving system on any other account defines its own 1R the same way, independently, and can size the trade correctly for itself without ever needing to know this account's balance, broker, or lot conventions. Each ticket is published exactly twice: once as an OPEN intent the first time it is seen in the open-order pool, and once as a CLOSE intent the first scan after it has left that pool (via `OrderSelect` against trade history, which works uniformly whether the order closed in full or was only ever partially closed - MQL4 assigns the surviving remainder a brand-new ticket, which this EA picks up as its own separate OPEN event). This project publishes intents only - it deliberately does not include a receiving/slave EA, since a generic intent format is only useful if the consuming side is free to size it however it needs to. Notes and limitations This is a publisher only. There is no bundled receiving EA that reads the intent file and opens trades from it - building that consumer, and deciding how it converts a received R-multiple back into a lot size for its own account, is deliberately left to whoever integrates this output, since that is exactly the step a fixed-format receiver would otherwise force into a one-size-fits-all shape. If an order carries no stop-loss, its risk cannot be measured from the order itself and the published RiskR is 0.000 - this is NOT the same as "genuinely zero risk," it means "unsized, no stop to measure against." A consumer must treat a 0.000R intent as information-free on sizing, not as an instruction to open nothing. The tracking table is a fixed-size array capped at 200 simultaneously open tracked tickets (InpMaxTrackedTrades cannot exceed this). If the account already has more open orders than the cap when a new one appears, that new ticket's OPEN event is skipped (and logged) until a tracked slot frees up on a later scan - it is not queued. Only the ENTRY stop distance is captured, at the moment a ticket is first seen open. If the order's stop is later trailed, moved to breakeven, or removed, the published RiskR for its eventual CLOSE event still reflects the risk as first measured, not the risk that was actually in place when the trade closed - MQL4 keeps no per-order modification history to recover the true final stop from.

Expert advisor · MT5 · v1.0 · Free

About Intent Level Copier

Intent Level Copier is a script for MetaTrader 5. It has 5 settings, such as Intent file name, Magic filter and One r account pct. MQL source code included.

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

Settings

SettingDefaultWhat it does
Intent file nameintent_level_copier_intents.csvFile in MQL5\Files\ this EA appends published intents to
Magic filter00 = publish intents for every own-account trade; otherwise only this magic
One r account pct1.0% of equity that defines "1.0R" for this account's own intents
Poll interval sec2Seconds between scans for new/closed trades
Max tracked trades200Cap on simultaneously tracked open tickets (fixed-size, see .txt)

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: Risk & Lot Size · Trade Copier · MT5 Expert Advisor · MQL5 Source Code

Expert advisors (EA) for MT4 & MT5 · PolyMaria