Copy Cat Trade Copier Part 2

30 July 2025, 07:01
Dilwyn Tng
0
35

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


Section 40: Delay to Copy    More

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 = 100, trade could copy anytime between 10–100 seconds.

 

Section 41: Better Price Logic    More

Delays execution until a more favorable price is reached, based on defined metrics.

  • Better Price Mode (BetterPrice)
    Method used to define a "better price":
    • Off (BetterPriceOff)
    • Point-based (BetterPriceByPoint)
    • Money-based (BetterPriceByMoney)
    • ATR-based (BetterPriceByATR)
    • ADR-based (BetterPricebyADR)
      Example: Set to BetterPriceByPoint to wait for a 100-point price improvement before copying.
  • Trade Type Filter (BetterPriceType)
    Specifies which trades the better price logic applies to:
    • Positions and Orders (BetterPricePositionAndOrder)
    • Positions Only (BetterPricePosition)
    • Orders Only (BetterPriceOrder)
      Example: Use BetterPricePosition to apply logic only to market orders.
  • Point Threshold (BetterPriceByPointValue = 100)
    Minimum price improvement in points before trade is copied.
  • Money Threshold (BetterPriceByMoneyValue = 10.50)
    Required potential profit improvement in USD before triggering the copy.
  • ATR Percentage (BetterPriceByATRValue = 0.1)
    Defines how much of ATR must be covered before executing.
    Example: ATR = 20 points → trade waits for 2 points if value = 0.1.
  • ADR Percentage (BetterPricebyADRValue = 5.5)
    Uses ADR percentage as the price improvement filter.
  • Timeout (BetterPriceDelayTolerance = 600)
    Max time (in seconds) to wait for price improvement.
    Example: If no improvement in 10 minutes, trade is skipped.
  • Adjust SL/TP by Delta (AdjustTPSLDelta = true/false)
    If true, SL and TP will shift by the same amount the entry improved.
    Example: If entry is 10 points better, both SL and TP are shifted accordingly to preserve RR.

 


Section 42: Day and Time Session Filters    More

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)    More

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

  • 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.

 

Section 44: Slice Volume   More

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     More

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    More

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   More

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   More

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   More

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   More

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   More

Provides hard filters to reject trades outside your defined lot size range—works after lot calculation and rounding.

Lot Size Parameters

  • MaxLotSize (true/false) – Enables filtering of oversized trades.
  • MaxLotSizeSet – Upper bound for lot size.
    Example: Set 1.00 to reject anything above 1 lot.
  • MinLotSize (true/false) – Enables minimum size enforcement.
  • MinLotSizeSet – Minimum lot to accept.
    Example: Set 0.10 to block micro trades.

Use Case

  • Prevent too-small trades on large accounts.
  • Avoid regulatory or prop firm violations.
  • Maintain consistent position sizing.

 

Section 64: Trade Position Filter    More

Allows you to copy only selected layers of trades in grid/martingale systems by filtering by sequence count.

Parameters

  • MinTradeCount (true/false) – Enables minimum-layer filtering.
  • MinTradeCountSet – Minimum nth trade to allow.
    Example: Set 3 to skip the first 2 trades.
  • MaxTradeCount (true/false) – Enables max-layer filtering.
  • MaxTradeCountSet – Maximum nth trade allowed.
    Example: Set 5 to ignore the 6th+ trades.

Trade Type Filter (TradeCountTrade)

  • Position and Orders (TradeCountPositonAndOrder)
  • Position Only (TradeCountPositionOnly)
  • Order Only (TradeCountOrderOnly)

Symbol Scope (TradeCountFilterType)

  • Current Chart Symbol (TradeCounterFilterChartSymbol)
  • Only Listed Symbols (TradeCounterFilterListedSymbol)
  • All Symbols (TradeCounterFilterAll)
  • TradeCountSymbolList – Used with listed filter to define which symbols to evaluate.
    Example: XAUUSD.i, GBPUSD

Use Case

  • Ideal for grid/martingale strategies to only copy higher layers with better reversal potential.
  • Filter out noisy early entries in layered trade sequences.

 


 

Section 70: Magic Number Settings   Free More

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   Free More

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   Free More

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   Free More

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.

 

Support and Contact Information

If you need help, have questions, or want to join the user community, please use the following resources: