Home / Coding / Expert Advisors / DRF Trade Copier

Used by the author

DRF Trade Copier

Copy the trades of one MetaTrader 5 account onto another, with the lot size in your hands, a burst of orders merged into one, and live trend, news, volatility and anomaly filters read from the tools on this site.

DRF_Trade_Copier_EA · version 4.10 · Trade copier · MetaTrader 5

€30   Buy DRF Trade Copier →

One of the four I use myself. Get all four in the Author's Kit for €90, or every Expert Advisor for €150: see the bundle.

Risk. Trading carries a high level of risk and you can lose more than you expected. No result is promised. Read the Risk Disclosure.

Test it on a demo account first. When everything works as you expect, use it on a real account.

It works on any symbol: point-based inputs scale to the symbol you attach it to.

How it is used

I built it for myself. I keep a small cent account in one MetaTrader 5 that gathers the trades of several sources at the same time. If a trade goes wrong, it costs me very little. A second account receives only what passes my rules.

How the DRF Trade Copier is used Several sources feed a small source account that runs the Sender. The Sender passes the trades to the Receiver on a second account. The Receiver merges bursts, scales the lot and checks the trend, news and volatility filters before it opens a copy. Source ASource BSource C Often 5 orders of 0.03 at once MetaTrader 5, account 1 small cent account Sender (publishes) all the copied trades land here file on thesame computer MetaTrader 5, account 2 Receiver (all your rules) 1. Merge the burst into one 2. Lot: 0.3 x (0.03 becomes 0.01) 3. Trend, news, volatility, anomaly 4. Loss limits, hedge block, hours opens one order, or waits and says why DRF filters on donaldsonrf.com Trend filter: 1 minute to monthly News filter: medium and high impact Volatility and anomaly: market too fast or odd? Example: a provider opens a grid of five orders of 0.03. Account 2 opens ONE order of 0.01. Three minutes later, the next grid becomes the next single order, unless a high-impact release is close: then it waits.

Both accounts run on the same computer or VPS. The Sender is deliberately simple; every restriction is on the Receiver, where your money is.

The DRF filters: one tool for each filter and each instrument

Each filter is a live tool on this site that you can open and watch, one page per instrument. The Receiver reads exactly the same readings. Switch on the ones you want, and every new copy has to pass them.

More filters are added over time as tools, and every one of them appears here and in the Receiver. Lifetime key holders get them all.

Who it suits

You already copy trades between your own accounts, but you want smaller or filtered copies. A plain copier opens five orders at once, in a grid, in the middle of news, against the trend, on a lot size that is far too large for a small account.

What it does

Two Expert Advisors that work together as one product. The Sender runs on the source account and publishes its open positions. The Receiver runs on the receiving account and mirrors them: openings, closings, partial closings and stop-loss or target changes.

All the control is in the Receiver. You choose the lot (a fixed lot, a multiplier such as 0.3, or proportional to the balance), merge a burst of orders into one copy, limit what is copied by symbol, time window, spread, slippage and open positions, and protect the account with loss limits.

On top of that, the DRF filters read the Trend, News, Volatility and Anomaly tools of this site for each instrument and hold back copies that fail the rules you set. The Anomaly filter stands aside in disasters: violent spikes, price gaps, a runaway move, a spread that blows out, or prices that make no sense. Only new copies are ever held back: nothing that is already open is touched.

How it works

  1. Open two MetaTrader 5 terminals on the same computer or VPS: the source account and the receiving account.
  2. On the source account attach DRF_Trade_Copier_Sender_EA to any chart. It writes the list of open positions to a shared file several times a second.
  3. On the receiving account attach DRF_Trade_Copier_Receiver_EA. Use the same channel name in both.
  4. Set the lot, the merge window and the filters in the Receiver. Every new order of the source is checked against your rules: it opens, or it waits, and the panel on the chart says why.
  5. When the source closes a position, changes its stop or target, or closes part of it, the Receiver does the same.

What is included

What is not included

What you need

How to try it

  1. A cent account follows three sources at the same time. Provider A opens five orders of 0.03 within two seconds. The Receiver, set to a multiplier of 0.3 and a merge window of 60 seconds, opens one order of 0.01. Three minutes later the provider opens another grid: the Receiver opens the next single order, unless the news filter shows a high-impact release in 20 minutes, in which case it waits.

Results

No results are published for this product, and none are implied. A copier repeats someone else's decisions: it can only be as good or as bad as the account it copies, and the filters reduce some risks, they do not remove them. Test on a demo account first.

Buy once, keep it for life

€30   Buy DRF Trade Copier →

Manual: every setting in plain language

Enter your DRF Key in the key input. The group "Any-asset scaling" controls how point inputs follow the symbol.

Sender: Channel

InpChannel (default: DRF_COPIER)
Channel name (the receivers must use the same)

Sender: Timing

InpPublishMs (default: 250)
Check for changes every N milliseconds
InpHeartbeatSec (default: 2)
Rewrite the file at least every N seconds (receivers treat older data as stale)

Sender: What to publish

InpSymbols
Symbols to publish (comma separated, empty = all)
InpMagics
Magic numbers to publish (comma separated, empty = all, 0 = trades opened by hand)
InpExcludeMagics
Magic numbers NOT to publish (comma separated, empty = none). Keeps orders that another copier made on this account from being sent on

Receiver: Channel

InpChannel (default: DRF_COPIER)
Channel name (must match the sender's channel name)
InpStaleSec (default: 15)
Treat the sender as offline after N seconds without a write
InpPollMs (default: 250)
Read the channel every N milliseconds

Receiver: Lot size

InpLotMode (default: DRF_LOT_MULTIPLIER)
How to size each copied order
InpFixedLot (default: 0.01)
Fixed lot (used by "Fixed lot")
InpLotMultiplier (default: 1.0)
Multiplier (used by the other two modes)
InpUseMaxLot (default: true)
Limit the lot size of each copied order
InpMaxLot (default: 1.0)
Largest lot allowed per order (used only when the switch above is on)
InpCentMode (default: DRF_CENT_AS_REAL)
If the source is a cent account: read it as real or as cent

Receiver: Limits on new copies

InpUseMaxOpenPositions (default: true)
Limit how many positions this copier keeps open
InpMaxOpenPositions (default: 10)
Most positions open at the same time (used only when the switch above is on)
InpUseSpreadRatio (default: true)
Wait while the spread is abnormally wide (relative to its usual size)
InpMaxSpreadRatio (default: 4.0)
Wait while the spread is wider than this many times its usual size (used only when the switch above is on)
InpUseDeviationAtr (default: true)
Skip a copy when the price already moved away from the source's entry (in candle ranges)
InpMaxDeviationAtr (default: 0.5)
Skip if the price is worse than the source's entry by more than this many average candle ranges (used only when the switch above is on)
InpUseSpreadPoints (default: false)
Wait while the spread is above a fixed number of points
InpMaxSpreadPoints (default: 50)
Wait while the spread is above this many points (used only when the switch above is on)
InpUseDeviationPoints (default: false)
Skip a copy when the price is worse than the source's entry by a fixed number of points
InpMaxDeviationPoints (default: 50)
Skip if the price is worse than the source's entry by more than this many points (used only when the switch above is on)
InpUseMaxOpenDelay (default: true)
Ignore a trade that opened a long time ago (do not copy late)
InpMaxOpenDelaySec (default: 120)
Do not copy a trade that opened more than this many seconds ago (used only when the switch above is on)
InpSlippagePoints (default: 0)
Fixed slippage allowed on copied orders, in points (0 = automatic by symbol)
InpCopySLTP (default: true)
Copy the source's stop loss and target
InpCopyExistingOnStart (default: false)
Also copy trades that are already open when the EA starts

Receiver: Symbols

InpSymbolFilter
Only copy these symbols (comma separated, empty = all)
InpSymbolSuffix
Symbol suffix used by your provider, for example .m or pro (empty = none)
InpSymbolMap
Rename symbols: SOURCE=LOCAL, for example EURUSD=EURUSD.m (checked before the suffix)

Receiver: Time window

InpSessionFilter (default: false)
Only open copies inside a time window (provider time)
InpSessionStartHour (default: 1)
Window starts at (hour, 0 to 23)
InpSessionEndHour (default: 23)
Window ends at (hour, 0 to 23)

Receiver: Order identification

InpMagic (default: DRF_DEFAULT_MAGIC)
Magic number of the copied orders
InpOrderComment (default: donaldsonrf.com)
Comment written on the copied orders

Receiver: Merge bursts (many orders at once become one copy)

InpSafetyMergeEnabled (default: true)
Merge same-direction orders opened close together into one copy
InpMergeOrdersWithinSeconds (default: 60)
Merge same-direction orders of the same symbol opened within this many seconds into ONE copy
InpMergeCloseMode (default: DRF_MERGE_CLOSE_LAST)
When to close a merged copy

Receiver: Protection of new copies (an open position is never closed by these)

InpSafetyHedgeBlock (default: true)
Refuse a new copy that opposes a position already open on the same symbol
InpSafetyMarketHoursPause (default: true)
Pause new copies while the symbol's market is closed
InpSafetyLossLimitEnabled (default: false)
Stop new copies after a daily or total loss (this copier's own positions)
InpSafetyMaxDailyLossPct (default: 0.0)
Daily loss limit, percent of today's highest point (0 = not set)
InpSafetyMaxTotalLossPct (default: 0.0)
Total loss limit, percent of the highest point since the EA started (0 = not set)

Receiver: DRF filters (live readings from the donaldsonrf.com tools)

InpDrfOnlyFiltered (default: false)
Copy only symbols that have DRF filters (gold, 7 major pairs, Dow Jones, S&P 500, Bitcoin)
InpTrendFilter (default: false)
TREND filter: hold back copies that go against the trend (tool: Trend Filter)
InpTrendM1 (default: false)
count the 1-minute trend
InpTrendM5 (default: false)
count the 5-minute trend
InpTrendM15 (default: true)
count the 15-minute trend
InpTrendM30 (default: false)
count the 30-minute trend
InpTrendH1 (default: true)
count the 1-hour trend
InpTrendH4 (default: true)
count the 4-hour trend
InpTrendD1 (default: true)
count the daily trend
InpTrendW1 (default: false)
count the weekly trend
InpTrendMN1 (default: false)
count the monthly trend
InpTrendRule (default: DRF_TR_MAJOR)
How the chosen timeframes decide
InpNewsFilter (default: false)
NEWS filter: no new copy around releases (tool: News Filter)
InpNewsImpact (default: DRF_NI_MEDHIGH)
which releases count
InpNewsMinBefore (default: 30)
do not copy from this many minutes before a release
InpNewsMinAfter (default: 30)
... until this many minutes after it
InpVolFilter (default: false)
VOLATILITY filter: wait while the market is racing (tool: Volatility Filter)
InpVolMaxRatio (default: 2.5)
wait while the 5-minute candle is more than this many times its normal range
InpAnomFilter (default: false)
ANOMALY filter: stand aside in disasters and strange markets (tool: Anomaly Filter)
InpAnomM1Max (default: 6.0)
1-minute candle limit, times its normal range
InpAnomM5Max (default: 4.0)
5-minute candle limit, times its normal range
InpAnomGapMax (default: 3.0)
gap from the previous candle limit, in ATRs
InpAnomRunMax (default: 6.0)
move of the last 6 five-minute candles limit, in ATRs
InpAnomSpreadMax (default: 0.25)
spread limit, as a share of the 15-minute ATR
InpFilterFail (default: DRF_FF_HOLD)
If a reading is unavailable or old (site unreachable, feed off)

Receiver: Loss limit protection (this copier's trades only)

InpLossMode (default: DRF_CP_LOSS_PERCENT)
Loss limits are set as
InpEnableDailyLimit (default: false)
Daily loss limit: close the copies and stop copying until tomorrow
InpMaxDailyLoss (default: 5.0)
Max daily loss (drop from today's peak; cash or %)
InpEnableSessionLimit (default: false)
Session loss limit: close the copies when their open loss reaches
InpMaxSessionLoss (default: 2.0)
Max open (floating) loss (cash or %)

Receiver: Trailing lock and cash target (this copier's trades only)

InpTrailingMode (default: DRF_CP_PROFIT_PERCENT)
Levels are set as
InpEnableTrailing (default: false)
Gain trailing lock on the copies' open gain
InpTrailingStart (default: 1.0)
Trailing lock starts when the open gain reaches
InpTrailingLock (default: 0.5)
Gain it secures once started (must be below the start level)
InpEnableHardTarget (default: false)
Hard cash target
InpTargetProfit (default: 2.0)
Close every copy when the open gain reaches

Frequently Asked Questions

Why two Expert Advisors?
MetaTrader runs one Expert Advisor per chart and each terminal holds one account. The Sender reads the source account, the Receiver writes to the receiving account, and the two talk through a file on the same computer. They are one product with one price and one key.
Do I need to be on the same computer?
Yes: both terminals must run on the same computer or VPS. A cheap Windows VPS is enough, and it keeps the copier online all day.
How does it handle five orders opened at once?
The merge setting turns same-direction orders on the same symbol opened within your window (60 seconds by default) into one copy. Combined with a lot multiplier, five 0.03 orders can become one 0.01 order. When the source opens a new burst later, the next copy opens.
What do the DRF filters need?
A running DRF Market Feed on my side and the sync address in your WebRequest list. The filters are the same readings you can watch live in the Trend, News, Volatility and Anomaly tools on this site, one page per instrument.
What happens if the site is unreachable?
By default the Receiver waits and does not open new copies without a reading. You can switch it to copy anyway. Positions that are already open are never touched.
Can I copy several providers into one account?
Yes. Put all the providers on the source account (a small cent account works well) and attach the Sender there. You can limit the Sender to some symbols or magic numbers.
What does the anomaly filter do?
It watches each instrument for strange behaviour: a candle many times wider than normal, a gap from the previous candle, a move that does not stop, a spread that suddenly widens, or prices that are internally impossible (usually a bad data feed). If any limit you set is crossed, the Receiver opens no new copies until the market settles. Every limit has a live tool for each instrument on this site.
Which symbols does it work on?
Any symbol your provider offers. Inputs that are measured in points scale automatically to the symbol's usual daily range, so the same preset behaves sensibly on a forex pair, an index or Bitcoin. Always test on a demo account first.
Do I need a key to run it?
Yes. After you buy, you receive a DRF Key. It works for life and on up to 5 internet addresses at the same time.
Is there a subscription?
No. You pay once and keep it for life, with free updates.
Does it promise a result?
No. Read the Risk Disclosure. Test on a demo account first; when everything works as you expect, use it on a real account.

Get Expert Advisor and coding news

New Expert Advisors, updates, price changes and videos, by e-mail. A short e-mail only when something is really new. One click to unsubscribe.

You get one e-mail to confirm first. By subscribing you agree that I use your address to send this newsletter. See the Privacy Policy.

Protected by Google reCAPTCHA. The Google Privacy Policy and Terms of Service apply.

Running into a technical issue or something that doesn't work right on this page? Please let us know straight away via our Contact page. That is how we find out what is broken and get it fixed.