Copy Cat Trade Copier Part 2

Copy Cat Trade Copier Part 2

30 July 2025, 07:01
Dilwyn Tng
0
358

From Part 1:  https://www.mql5.com/en/blogs/post/762472





Section 40: Delay to Copy

Adds a randomized time delay before copying a trade from Master to Slave, to reduce detectability across accounts.

  • Enable Delay Logic (DelayToCopy = true/false)
    Enables or disables randomized trade delay.
  • Minimum Delay (MDelayMin = 10)
    Minimum number of seconds to delay before copying.
  • Maximum Delay (MDelayMax = 100)
    Maximum delay window. Actual delay is randomized between min and max.
    Example: With MDelayMin = 10 and MDelayMax = 300, trade could copy anytime between 10–300 seconds.

Section 41 — Better Price

Delay copying until the entry becomes more favorable (per-trade or account-wide).

Core

  • Better Price Mode (BetterPriceMode) — BetterPriceOff · BetterPriceByTrade · BetterPriceByAccount
  • Better Price Type (BetterPriceType) — BetterPricePosition
  • Master-Slave Offset (BetterPriceOffset = 0) — Offset in points; negative = wait for extra discount on BUY / premium on SELL. New
  • Timeout (BetterPriceDelayTolerance = 60000) — Max wait in seconds before skipping.

Better Price by Account

  • Account Mode (BetterPriceAccount) — BetterPriceAccountByTotalPoint · BetterPriceAccountByTotalMoney · BetterPriceAccountByAveragePoint · BetterPriceAccountByAverageMoney
  • Better Price By Total Point (BetterPriceAccountByTotalPointValue = 500)
  • Better Price By Total Money (BetterPriceAccountByTotalMoneyValue = 500.00)
  • Better Price By Average Point (BetterPriceAccountByAveragePointValue = 50)
  • Better Price By Average Money (BetterPriceAccountByAverageMoneyValue = 50.00)

Better Price by Trade

  • Trade Mode (BetterPrice) — BetterPriceByPoint · BetterPriceByMoney · BetterPriceByATR · BetterPricebyADR
  • Better Price By Point (BetterPriceByPointValue = 1000)
  • Better Price By Money (BetterPriceByMoneyValue = 10.50)
  • Better Price By ATR (%) (BetterPriceByATRValue = 0.1)
  • Better Price By ADR (%) (BetterPricebyADRValue = 5.5)

Notes

  • Works with reverse copying: if CopyReverse = true, “better” flips accordingly.
  • If Adjust TP and SL Delta (AdjustTPSLDelta) is enabled (Section 20), SL/TP shift by the same improvement delta to preserve R:R. New

 


      Section 42: Day and Time Session Filters 

      Controls whether trade copying is permitted during specific days and time intervals. Two independent sessions can be configured.

      Session 1 Settings

      • Session Type (TimeSession1)
        Options:
        • Allow All (AllowAll)
        • Allow Open Position and Order (AllowOpenPositionandOrder)
        • Allow Open Position Only (AllowOpenPositionOnly)
        • Allow Open Order Only (AllowOpenOrderOnly)
        • Disallow All (DisallowAll)
          Example: Set to AllowOpenPositionOnly to allow only market entries and block pending orders.
      • Allowed Days (TradeMonday1 to TradeSunday1)
        Enable/disable copying on specific weekdays.
        Example: Set TradeSaturday1 = false and TradeSunday1 = false to block weekend trading.
      • Start Time (From_Hour1 / From_Min1)
        Start of session 1 in 24-hour format.
        Example: 09:30 = From_Hour1 = 9, From_Min1 = 30
      • End Time (To_Hour1 / To_Min1)
        End of session 1 in 24-hour format.
        Example: 15:00 = To_Hour1 = 15, To_Min1 = 0

      Session 2 Settings

      Same structure as Session 1.

      • Session Type (TimeSession2)
      • Allowed Days (TradeMonday2 to TradeSunday2)
      • Start Time (From_Hour2 / From_Min2)
      • End Time (To_Hour2 / To_Min2)

      Example: Use Session 1 for the Asian session, Session 2 for the US session.




      Section 43: Initial Sync (Copy Existing Trades)

      Controls whether existing master trades (active before the EA starts) are copied when the EA is launched on the slave with the following options.

      • Sync Behavior (InitialSync)
        Options:
        • Sync All (InitialSyncAll)
        • Sync Profit Only (InitialSyncProfit)
        • Sync Loss Only (InitialSyncLoss)
        • Sync Off (InitialSyncOff)
          Example: Set InitialSyncProfit to only copy trades that are already in profit.
      • Trade Types to Sync (InitialSyncType)
        Options:
        • Positions and Orders (InitialSyncTypeAll)
        • Positions Only (InitialSyncTypePosition)
        • Orders Only (InitialSyncTypeOrder)
          Example: Set InitialSyncTypePosition to skip pending orders.
      Note: Initial Sync or Sync Existing Trades copy trades copies trades at the moment when the copier is first load at the MT4 or MT5 terminal.

      Section 44: Slice Volume 

      Allows large trades to be broken into smaller pieces for flexibility or risk management.

      • Slicing Method (SliceBy)
        Options:
        • Off (SliceOff)
        • By Lot Size (SliceByLotSize)
        • By Number of Trades (SliceByNumberofTrade)
          Example: SliceByLotSize with SliceSize = 1.0 turns a 3-lot trade into three 1.0 trades.
      • Number of Trades (SliceNumber)
        Used with SliceByNumberofTrade.
        Example: Set SliceNumber = 3 to divide 0.9 into three 0.3-lot trades.
      • Slice Size (SliceSize)
        Used with SliceByLotSize.
        Example: With SliceSize = 0.5 and total = 1.2 → EA will slice: 0.5 + 0.5 + 0.2.
      • Slice Mode (SliceMode)
        Controls how to treat the leftover volume:
        • Allow Overflow (SliceWithOverflow)
        • Enforce Limit (SliceWithinLimit)
        • Add Extra Trade (SliceWithExtraRemainder)
          *Example: With 1.3 lots and SliceSize = 0.5:
        • SliceWithOverflow: 0.5 + 0.5 + 0.3
        • SliceWithinLimit: 0.5 + 0.5 (0.3 ignored)
        • SliceWithExtraRemainder: 0.5 + 0.5 + 0.3*




      Section 50: Daily Drawdown Management 

      Prevents excessive daily loss by monitoring balance or equity and responding when limits are hit.

      • Protection Mode (HitDD)
        Options:
        • Off (DDOff)
        • Close Managed Trades Only (DDCloseManaged)
        • Close All Trades (DDCloseAll)
          Example: Use DDCloseManaged to avoid affecting manual trades.
      • Reference Value (DDType)
        Options:
        • Daily Balance (DailyAccountBalance)
        • Daily Equity (DailyAccountEquity)
        • Current Balance (CurrentAccountBalance)
        • Initial Deposit (InitialAccountBalance)
          Example: Use DailyAccountEquity to monitor from today's start.
      • Drawdown Type (DDAmountType)
        Options:
        • By Percentage (DDAmountPC)
        • By Fixed Dollar Value (DDAmountDollar)
      • Limit Amounts (DDAmountPCSet / DDAmountDollarSet)
        Example: DDAmountPCSet = 3 = 3% daily loss protection.
      • Lock After Trigger (DDLock = true/false)
        If true, all trade copying is paused for the day once the limit is hit.
        Example: Use DDLock = true to freeze until next day reset.



      Section 51: Overall Drawdown Management

      Monitors cumulative loss based on various reference balances, providing protection beyond the daily scope.

      • Drawdown Trigger Mode (HitODD)
        • Off (ODDOff) – No action taken
        • Close Copied Trades (ODDCloseManaged) – Only closes trades copied by the EA
        • Close All (ODDCloseAll) – Closes all trades in the account
          Example: Use ODDCloseManaged to avoid interrupting manual trading.
      • Reference Type (ODDType)
        • Today’s Starting Balance (ODDDailyAccountBalance)
        • Today’s Starting Equity (ODDDailyAccountEquity)
        • Current Account Balance (ODDCurrentAccountBalance)
        • Initial Account Balance (ODDInitialAccountBalance)
          Example: Use ODDInitialAccountBalance for long-term protection from the first deposit.
      • Measurement Type (ODDAmountType)
        • Percentage (ODDAmountPC)
        • Dollar Value (ODDAmountDollar)
      • Drawdown Threshold (ODDAmountPCSet / ODDAmountDollarSet)
        Example: Set ODDAmountPCSet = 8 to trigger protection at 8% loss.
      • Lock Trading (ODDLock = true/false)
        When true, trade copying will pause until the next day or manual reset.
        Example: Use ODDLock = true to enforce a full-day protection once triggered.


       


      Section 52: Equity Protection

      Blocks new trades or cancels orders when equity drops below a set threshold. Ideal for automated risk control.

      • Protection Mode (EquityProtection)
        • Off (EPOff)
        • Block New Positions & Orders (EPNoNewPositionNoNewOrder)
        • Block & Cancel All Orders (EPNoNewPositionCancelAllOrders)
          Example: Use EPNoNewPositionCancelAllOrders for a complete halt when equity protection is needed.
      • Reference Type (EquityProtectionType)
        • Today’s Opening Balance (EPDailyAccountBalance)
        • Today’s Opening Equity (EPDDailyAccountEquity)
        • Current Balance (EPDCurrentAccountBalance)
        • Initial Account Balance (EPInitialAccountBalance)
          Example: Use EPDDailyAccountEquity to monitor today’s performance.
      • Measurement Type (EPAmount)
        • Percentage (EPAmountPC)
        • Fixed Dollar (EPAmountDollar)
      • Threshold Values (EPAmountPCSet / EPAmountDollarSet)
        Example: Set EPAmountPCSet = 5.0 or EPAmountDollarSet = 100.0 to trigger equity protection.
      • Lock After Trigger (EquityLock = true/false)
        When true, protection remains active until the next trading day or manual reset.
        Example: EquityLock = true prevents accidental re-entry after equity loss.




      Section 60: Advanced SL, TP, and Trailing Stops

      Combines multiple trade management mechanisms for dynamic stop loss, take profit, breakeven, and trailing logic.

      • Trailing Mode (TSType)
        Choose one of the following configurations:
        • None (TSTYPE_Off)
        • TP + SL + TS + BE (TSTYPE_TPSLTSBE)
        • TP + SL + TS only (TSTYPE_TPSLTS)
        • SL + TS + BE only (TSTYPE_SLTSBE)
        • SL + TS only (TSTYPE_SLTS)
        • TP + SL only (TSTYPE_TPSL)
        • TS + BE only (TSTYPE_TSBE)
        • TP only (TSTYPE_TP)
        • SL only (TSTYPE_SL)
        • TS only (TSTYPE_TS)
        • BE only (TSTYPE_BE)
          Example: Use TSTYPE_TSBE to apply trailing stop and breakeven only, without TP or SL.
      • Trailing Method (TSMethod)
        • Fixed Points (TSMethod_Point)
        • ATR-Based (TSMethod_ATR)
        • ADR-Based (TSMethod_ADTR)
      • Trailing Parameters
        • Initial SL (TS_SLSet) – Static SL in points.
          Example: TS_SLSet = 500 for a 500-point stop.
        • ATR/ADR Multipliers (TS_ATRSet / TS_ADTRSet)
          Example: ATR = 40, TS_ATRSet = 0.5 → Trail distance = 20 points.
        • TP Factor (TS_TPSet) – Optional TP multiplier.
          Example: SL = 100, TP = SL × 2.5 → 250-point target.
        • Trailing Distance (TS_TSSet) – % of SL used for trail.
          Example: SL = 100, TS_TSSet = 0.5 → Trailing kicks in at 50 points.
        • Trailing Step (TS_StepSet) – Step size for adjusting SL.
          Example: 25-point trail with 5-point step = SL updates every 5 points.
        • Breakeven Trigger (TS_BreakEvenaboveSet) – Minimum profit required to move SL to breakeven.
          Example: Trail = 50, BE above = 0.1 → SL moves to entry after 5 points profit.
        • Managed Only (TS_ManagedTrade = true/false)
          If true, only applies to EA-managed trades. Useful when mixing manual and auto trading.

       


      Section 61: Basket Close Method

      Manages trades collectively based on basket-level profit/loss targets, rather than on individual trade SL/TP.

      BasketType (BasketOff / BasketTPSLTSBE / ...)

      Controls which basket functions are enabled:

      • Off (BasketOff) – Basket logic disabled
      • TP, SL, TS, BE (BasketTPSLTSBE)
      • TP, SL, TS only (BasketTPSLTS)
      • SL, TS, BE only (BasketSLTSBE)
      • SL and TS only (BasketSLTS)
      • TP and SL only (BasketTPSL)
      • TS and BE only (BasketTSBE)
      • TP only (BasketTP)
      • SL only (BasketSL)
      • TS only (BasketTS)
      • BE only (BasketBE)
        Example: Use BasketTPSLTSBE to activate all protections.

      Basket Logic Parameters

      • BasketStopLossSet – Total dollar loss threshold for closing the basket.
        Example: 100 closes basket if floating loss exceeds $100.
      • BasketTakeProfitSet – Multiplier of Basket SL to set TP.
        Example: SL = $100, Set = 2.5 → Basket TP = $250.
      • BasketTSSet – Trailing start as fraction of SL.
        Example: SL = $100, TS = 0.5 → trail activates at $50 profit.
      • BasketTStepSet – Profit step size to update trailing stop.
        Example: TS = $50, Step = 0.25 → updates every $12.50.
      • BasketBreakEvenaboveSet – Profit required to trigger breakeven.
        Example: TS = $50, BE = 0.1 → breakeven after $5 profit.
      • ConsiderCommission / ConsiderSwapFee (true/false) – Includes cost in profit evaluation.
      • BasketManagedTrade (true/false) – Applies logic to copied trades only.
      • BasketCancelOrders (true/false) – Cancel pending orders when basket closes.
      • BasketEvalInterval – Interval (in seconds) to check basket state.
      • BasketHighestProfit – Internal tracking of peak floating profit.


      Section 62: Max/Min SL and TP Settings

      Applies fixed boundaries to SL/TP regardless of source (Master, ATR, or Manual), to meet strategy or broker rules.

      SL/TP Enforcement Parameters

      • ForcedMaxTP (true/false) – Enables TP upper limit.
      • ForcedMaxTPSet – Maximum TP in points.
        Example: Set 1000 to cap TP at 1000 points.
      • ForcedMinTP (true/false) – Enables TP minimum limit.
      • ForcedMinTPSet – Minimum TP in points.
        Example: Reject TP smaller than 200 points.
      • ForcedMaxSL (true/false) – Enables SL upper limit.
      • ForcedMaxSLSet – Maximum SL in points.
        Example: Max SL = 3000 points.
      • ForcedMinSL (true/false) – Enables SL minimum limit.
      • ForcedMinSLSet – Minimum SL in points.
        Example: Must use SL ≥ 300 points.

      Use Case

      • Preventing overly tight stops on volatile assets.
      • Meeting broker-mandated SL/TP constraints.
      • Keeping risk exposure within predefined range.



      Section 63: Lot Size Filter

      Filters trades after your lot calculation/rounding. You can either allow only a range or allow only outside a range (i.e., block the middle band). Boundaries are unordered: the EA will auto-resolve small and big from LotSizeBoundary1/2 .

      Inputs

      • LotSizeFilterType (LOTSIZEFILTERTYPE)

        • LotSizeFilterOff – No filtering.

        • LotSizeFilterBoundary – Allow only inside the inclusive range [small … big] .

        • LotSizeFilterOffBoundary – Allow only outside the range (i.e., x ≤ small or x ≥ big ).

      • LotSizeBoundary1 (double) – Range boundary (unordered).

      • LotSizeBoundary2 (double) – Range boundary (unordered).

      Notes
      • The filter is inclusive on the edges in both modes.
      • “Unordered” means you can set 2 & 0.5 or 0.5 & 2 — the EA resolves them to [0.5 … 2] .
      • If you only care about a minimum, set the upper boundary very large.

      Examples (Quick Recipes)

      • Copy only lot size ≥ 3.0

        • LotSizeFilterType = LotSizeFilterBoundary

        • LotSizeBoundary1 = 3.0

        • LotSizeBoundary2 = 999999.0

      • Copy only 0.10–1.00 lots

        • LotSizeFilterType = LotSizeFilterBoundary

        • LotSizeBoundary1 = 0.10

        • LotSizeBoundary2 = 1.00

      • Block the middle band 0.50–2.00 (copy only ≤0.50 or ≥2.00)

        • LotSizeFilterType = LotSizeFilterOffBoundary

        • LotSizeBoundary1 = 0.50

        • LotSizeBoundary2 = 2.00

      • Disable lot size filtering

        • LotSizeFilterType = LotSizeFilterOff

      Typical Uses

      • Enforce minimum/maximum size for prop-firm rules.

      • Ignore small lot size trades which are the first few trades in a Martingale system, copy only bigger lot size at later layers for better chance of reversal.

      • Only copy “large conviction” trades (e.g., martingale step ≥ 3.0 lots).

      • Block tiny dust trades on large accounts.

      • Keep lot sizing consistent across different brokers.




      Section 64: Trade (Count) Position Filter

      Filters by the Nth trade, letting you include/exclude specific layers in grid/martingale sequences. Counting is 1-based: N=1 is the first trade.

      This filter respects:

      • Trade type scope ( TradeCountFilterTrade ) — positions only / orders only / both.

      • Symbol scope ( TradeCountFilterPerSymbol ) — chart symbol / listed symbols / all symbols.

      • Partial symbol matching in listed mode (e.g., "USD" matches "EURUSD" ).

      Inputs

      • TradeCountFilterType (TRADECOUNTFILTERTYPE)

        • TradeCountFilterOff – No Nth-position filtering.

        • TradeCountFilterBoundary – Allow only N in [small … big] (inclusive, 1-based).

        • TradeCountFilterOffBoundary – Allow only N outside [small … big] (i.e., N ≤ small or N ≥ big ).

      • TradeCountBoundary1 (int) – Nth boundary (unordered, 1-based).

      • TradeCountBoundary2 (int) – Nth boundary (unordered, 1-based).

      • TradeCountFilterTrade (TRADECOUNTFILTERTRADE)

        • TradeCountPositionAndOrder – Count both positions and pending orders.

        • TradeCountPositionOnly – Count positions only (BUY/SELL).

        • TradeCountOrderOnly – Count pending orders only (BuyLimit/SellLimit/BuyStop/SellStop).

      • TradeCountFilterPerSymbol (TRADECOUNTFILTERSYMBOL)

        • TradeCounterFilterChartSymbol – Only trades of the current chart symbol ( _Symbol ).

        • TradeCounterFilterListedSymbol – Only trades whose symbol matches (exact or partial) any in TradeCountSymbolList .

        • TradeCounterFilterAll – Trades across all symbols.

      • TradeCountSymbolList (string) – Comma/space-tolerant list; partial match supported.

        • Example: "XAUUSD.i, GBPUSD, USD" → matches XAUUSD.i , GBPUSD , and any pair containing USD (e.g., EURUSD ).

      Notes
      • The Nth index is computed after applying trade type & symbol filters to the running list up to the current trade.
      • Boundaries are inclusive and unordered (the EA resolves [small … big] ).
      • Set a very large upper bound (e.g., 999999 ) when you care only about a minimum N.

      Examples (Quick Recipes)

      • Copy only the 1st trade (the very first layer)

        • TradeCountFilterType = TradeCountFilterBoundary

        • TradeCountBoundary1 = 1

        • TradeCountBoundary2 = 1

      • Skip first 2 layers; copy from the 3rd onward

        • TradeCountFilterType = TradeCountFilterBoundary

        • TradeCountBoundary1 = 3

        • TradeCountBoundary2 = 999999

      • Copy only layers 3–7 (inclusive)

        • TradeCountFilterType = TradeCountFilterBoundary

        • TradeCountBoundary1 = 3

        • TradeCountBoundary2 = 7

      • Block middle layers 2–4; copy only ≤1 or ≥5

        • TradeCountFilterType = TradeCountFilterOffBoundary

        • TradeCountBoundary1 = 2

        • TradeCountBoundary2 = 4

      • Positions only, listed symbols that contain “USD”

        • TradeCountFilterTrade = TradeCountPositionOnly

        • TradeCountFilterPerSymbol = TradeCounterFilterListedSymbol

        • TradeCountSymbolList = "USD"

      • Across all symbols, positions and orders, no N filter

        • TradeCountFilterPerSymbol = TradeCounterFilterAll

        • TradeCountFilterTrade = TradeCountPositionAndOrder

        • TradeCountFilterType = TradeCountFilterOff

      Typical Uses

      • Copy only deeper grid/martingale layers (higher reversal probability).

      • Ignore early “probing” entries; follow only scaled-in positions.

      • Apply symbol-scoped layering (e.g., only XAU-related symbols, or anything containing “USD”).

      • Separate strategies by order type (positions vs. pending orders).

         


        Section 70: Magic Number Settings

        Magic Numbers are unique identifiers attached to each trade to distinguish between strategies, EAs, or trade sources. This section controls how magic numbers are handled on the slave terminal.

        • Magic Number Type (MNType)
          Selects the magic number handling method:
          • Leave Blank (MNBlank) – Slave-side trades will not have any magic number.
          • Copy from Master (MNMaster) – Replicates the magic number used on the master.
          • Manual Entry (MNInput) – Uses a user-defined magic number.

        Example: Use MNMaster if you want to track which EA triggered a trade. Use MNInput to group all copied trades under a single ID.

        • MagicNumber (e.g. 2025)
          The actual value used when MNType = MNInput.
          Example: Set to 2025 if you want all copied trades to carry this identifier.

        Section 71: Comment Settings

        The Comment field provides trade labels (e.g., strategy name or purpose). This section controls how comments are assigned on the slave terminal.

        • Comment Type (CommentType)
          Defines how the comment is applied:
          • Leave Blank (CommentBlank) – No comment is applied.
          • Copy from Master (CommentMaster) – Duplicates the master’s comment.
          • Manual Entry (CommentInput) – Applies a static comment.

        Example: Use CommentMaster for traceability or CommentInput to consistently label all trades as "CopyCat".

        • Comment ("CopyCat")
          The text used when CommentType = CommentInput.


        Section 80: Copy Retry Settings 

        Controls how the copier responds when trade commands fail due to issues like requotes or server delay.

        • NumberOfAttempt (e.g. 3)
          How many times to retry a failed trade operation.
          Example: 3 = maximum of 3 retries before skipping.
        • WaitMilliSec (e.g. 250)
          Milliseconds to wait between retry attempts.
          Example: 250 = wait 0.25 seconds between each retry.
        • FastExec (true/false)
          If true, uses fast execution logic before fallback.
          Set to true to prioritize speed.
          Set to false, if your brokers has invalid price and stops error

        Section 81: Display Settings

        Configures on-screen display elements for role indication and clarity.

        • SlaveChartColor (e.g. C'48,48,48')
          Sets chart background color for slave terminals.
          Example: Use C'48,48,48' (dark gray) for slave and a different color for master for easy distinction.



        Section 83:  Notification Log  New

        Enable notification log for add on Notification Module for Mobile MT4/5 and Telegram Module

        •  Notification Log = true to enable log if you want to send trade message via Notification Module.





         

        Support and Contact Information

        If you need help, have questions you can contact me at: