Advertisement IC Markets

How to trade High-Net-Worth (HNW) account?

Master exponential money management, position sizing calculators, strict daily stop-loss limits, and overcoming FOMO on micro-timeframes.
PTScalper
Site Admin
Posts: 5838
Joined: Mon Jul 20, 2026 1:28 pm

How to trade High-Net-Worth (HNW) account?

Post by PTScalper »

Hi traders, scalpers,

Scaling a spot forex strategy to a High-Net-Worth (HNW) account ($100,000 to $1,000,000+) requires solving a structural problem that smaller accounts never face: order-book liquidity and slippage.

On a $10,000 account, risking 1% ($100) on a 4-pip stop loss requires 2.5 standard lots—an order size that clears instantly at top-of-book on any ECN broker. On a $250,000 to $500,000+ account, attempting that same 4-pip stop loss with 1% to 2% risk requires 60 to 250 standard lots ($6M to $25M notional). Firing 100+ lots at market sweeps multiple tiers of Level 2 liquidity, creating 1.5 to 3.0 pips of entry and stop-loss slippage that erodes the edge of ultra-tight M1 scalping.

To trade larger capital with zero indicator lag, minimal market impact, and strict capital protection, the optimal architecture combines H4/D1 Institutional Support & Resistance Mapping, M15 Price-Action Execution, 20%/80% Capital Segregation, and Series-Based Profit-Buffer Scaling.
Preserve your own money. Scale with the market's money. Exponential growth is the ultimate key.
Recommended broker for automated trading & scalping IC Markets
PTScalper
Site Admin
Posts: 5838
Joined: Mon Jul 20, 2026 1:28 pm

Re: How to trade High-Net-Worth (HNW) account?

Post by PTScalper »

1. Structural Architecture: H4/D1 Liquidity Zones + M15 Execution

Instead of relying on lagging oscillators or moving-average crossovers, large-account execution focuses purely on where institutional order flow rests and how price reacts on the 15-minute chart.

Core Asset Universe: EURUSD, USDJPY, GBPUSD, AUDUSD (plus XAUUSD during NY overlap)+ Deepest Tier-1 interbank order books; absorbs 10 to 30 standard lots within 0.1 to 0.3 pips of top-of-book spread.

Structural Mapping (D1 & H4): Multi-touch horizontal Support/Resistance zones, major swing highs/lows, and institutional impulse origins + Identifies deep liquidity pools where institutional limit orders sit, allowing larger lot sizes to be filled against opposing flow.

Execution Trigger (M15): Liquidity sweep (false break / stop-hunt wick through H4/D1 level) followed by an M15 close back inside the zone + Widens the structural stop loss to 15 to 30 pips, keeping lot sizes in the 6 to 25 lot sweet spot with negligible slippage while eliminating overnight/multi-week swap drag.

Active Execution Windows: Frankfurt/London Open (08:00–11:00 CET) and London/NY Overlap (14:00–17:00 CET) + Peak daily interbank volume ensures tightest raw spreads and instant limit/market fills.
Preserve your own money. Scale with the market's money. Exponential growth is the ultimate key.
PTScalper
Site Admin
Posts: 5838
Joined: Mon Jul 20, 2026 1:28 pm

Re: How to trade High-Net-Worth (HNW) account?

Post by PTScalper »

The 3-Step M15 Entry Protocol

Zone Qualification (H4/D1): Mark horizontal price zones where price previously reversed sharply on H4 or D1 (minimum 40 to 80 pips of open air to the next opposing barrier). Ignore mid-range chop completely.

The Stop-Hunt Sweep (M15): Wait for price to push into the H4/D1 zone during London or New York hours. Rather than placing blind limit orders at the first touch, allow price to pierce the level by 3 to 10 pips (sweeping retail breakout traders and resting stops) and close back inside the zone on the M15 candle.

Order-Split Entry & Structural Stop:

Tranche A (50% of position): Enter on the close of the M15 rejection candle.

Tranche B (50% of position): Place a limit order at a 30% to 50% micro-retracement of the M15 rejection wick to improve average fill price and reduce single-ticket slippage.

Stop Loss: Placed 3 to 5 pips beyond the extreme high/low of the M15 sweep wick (typical total stop distance: 15 to 30 pips).
Preserve your own money. Scale with the market's money. Exponential growth is the ultimate key.
PTScalper
Site Admin
Posts: 5838
Joined: Mon Jul 20, 2026 1:28 pm

Re: How to trade High-Net-Worth (HNW) account?

Post by PTScalper »

2. Capital Segregation & Series-Based Money Management

High-net-worth accounts should never expose 100% of liquid capital to broker counterparty risk or continuous year-round market exposure.

The 80/20 Capital Segregation Model ($250,000 Worked Scenario)
Total Strategy Capital: $250,000

Segregated Core Reserve (80% = $200,000): Held in an external bank/custody account or short-term treasury reserve (~4.0% annual yield = $8,000/year risk-free baseline).

Active ECN Trading Tranche (20% = $50,000): Deposited with a Tier-1 ECN Raw Spread broker featuring Negative Balance Protection (ensuring that even an extreme geopolitical weekend gap cannot touch the $200,000 core reserve).

Effective Buying Power: At 1:30 to 1:100 leverage on the $50,000 active tranche, margin capacity easily supports 15 to 35 standard lots on major pairs while keeping true portfolio exposure strictly bounded.
Preserve your own money. Scale with the market's money. Exponential growth is the ultimate key.
PTScalper
Site Admin
Posts: 5838
Joined: Mon Jul 20, 2026 1:28 pm

Re: How to trade High-Net-Worth (HNW) account?

Post by PTScalper »

The 2-to-6 Week Trading Series & Profit-Buffer Scaling

Rather than trading endlessly every week of the year, structure execution into discrete 2-to-6 week trading series followed by a 2-to-4 week flat recovery pause. Within each series, position sizing operates in two mathematical phases:

Phase 1 — Base Capital Defense (Building the Cushion):

Risk per Trade: 0.50% of Total Portfolio (2.50% of the $50,000 active tranche = $1,250 per trade).

Series Hard Stop: 4 consecutive base losses (-$5,000, or -2.0% of total $250,000 capital). If hit, halt trading for 2 weeks and review market regime.
Preserve your own money. Scale with the market's money. Exponential growth is the ultimate key.
PTScalper
Site Admin
Posts: 5838
Joined: Mon Jul 20, 2026 1:28 pm

Re: How to trade High-Net-Worth (HNW) account?

Post by PTScalper »

Phase 2 — Exponential Profit-Cushion Scaling (Risking House Money Only):

Once Phase 1 builds a +$5,000 to +$7,500 profit cushion (+2% to +3% on total capital / +10% to +15% on the active tranche), lock the $250,000 starting equity.

On subsequent A+ H4/D1 confluence setups, risk 30% to 40% of the accrued profit buffer while risking $0 of base principal.

Worked Scaling Math: With a $7,500 profit buffer, risking 35% of the buffer gives a $2,625 trade risk (13.12 standard lots across a 20-pip stop, split into two 6.56-lot clips).

Series Completion: When the series reaches its target (+5% to +8% on total equity, or +$12,500 to +$20,000 within 2 to 6 weeks), close all positions, sweep 50% to 100% of profits to the Core Reserve, and take a 2-to-4 week break before starting the next series.
Preserve your own money. Scale with the market's money. Exponential growth is the ultimate key.
PTScalper
Site Admin
Posts: 5838
Joined: Mon Jul 20, 2026 1:28 pm

Re: How to trade High-Net-Worth (HNW) account?

Post by PTScalper »

3. Numbered Implementation Plan

Segregate Capital into an 80/20 Structure: Keep 80% of your total FX allocation ($200,000 per $250,000 portfolio) in an interest-bearing reserve account and fund 20% ($50,000) into your active ECN Raw Spread account with Negative Balance Protection before launching your next series.

Establish the Series Risk Floor & Lot Cap: Set Phase 1 base risk at 0.50% of total capital ($1,250 per trade) with a hard series drawdown limit of -2.0% (-$5,000), keeping initial M15 order sizes between 4 and 8 standard lots to guarantee zero-slippage ECN fills.

Map Weekly D1/H4 Liquidity Zones Every Sunday: Mark the nearest 2 to 3 major horizontal H4/D1 Support and Resistance zones across EURUSD, GBPUSD, USDJPY, AUDUSD, and XAUUSD, setting server-side price alerts 5 pips ahead of each zone so you only engage during London or NY sessions when price reaches institutional levels.

Activate Profit-Buffer Scaling at +2% Portfolio Gain: Once a series accumulates +$5,000 in closed profits, lock your starting equity and allocate 30% to 40% of the profit cushion onto high-conviction M15 sweep setups—splitting any order larger than 12 standard lots into two clips across the M15 rejection candle.

Enforce the Post-Series Withdrawal & Cooldown: Upon hitting your +5% to +8% series target (or completing 6 weeks of active trading), withdraw the accrued profit from the broker to your reserve account and step away from live execution for 2 to 4 weeks to protect your annual equity curve.
Preserve your own money. Scale with the market's money. Exponential growth is the ultimate key.
PTScalper
Site Admin
Posts: 5838
Joined: Mon Jul 20, 2026 1:28 pm

Re: How to trade High-Net-Worth (HNW) account?

Post by PTScalper »

To execute 15+ standard lot positions without sweeping multiple tiers of the ECN order book—and without needing to manually enter multiple tickets—the cleanest architecture is an automated Tranche Splitter that supports both direct desktop execution and a Mobile Pilot-Order Interceptor running on a low-latency VPS.

In Pilot-Order Interceptor mode, you simply open a 0.01 lot trade from your phone and drag the Stop Loss to your desired M15/H4 structural level (or leave SL blank to auto-snap to the M15 sweep wick). Within milliseconds, the VPS helper reads your pilot ticket, calculates the exact total lot size for your dollar risk, slices the Market Tranche into slippage-protected clips, and places the Limit Tranche at the M15 candle retracement with an automatic expiry timer.
Preserve your own money. Scale with the market's money. Exponential growth is the ultimate key.
PTScalper
Site Admin
Posts: 5838
Joined: Mon Jul 20, 2026 1:28 pm

Re: How to trade High-Net-Worth (HNW) account?

Post by PTScalper »

MQL5 Implementation (MetaTrader 5 EA)

Compile this in MetaEditor 5 and run it on a VPS chart. When you open a 0.01 lot position from mobile (or desktop), the EA immediately expands it into your full risk-sized Market + Limit tranches.

Code: Select all

//+------------------------------------------------------------------+
//|                                          HNW_TrancheExecutor.mq5 |
//|                     Institutional Market + Limit Tranche Helper  |
//+------------------------------------------------------------------+
#property copyright "HNW Execution Helper"
#property version   "1.00"
#property strict

#include <Trade\Trade.mqh>

//--- Input Parameters
input group "=== Risk & Sizing Parameters ==="
input double   InpRiskCashUSD          = 1250.0;  // Risk per Setup in Account Currency ($)
input double   InpRewardRatio          = 2.0;     // Target R:R Ratio (e.g., 2.0 for 1:2, 0.333 for 3:1)
input double   InpMarketTranchePct     = 50.0;    // Market Tranche Allocation (%)
input double   InpMaxLotsPerClip       = 8.0;     // Max Standard Lots per Single Market Clip

input group "=== M15 Structural & Limit Settings ==="
input double   InpSlBufferPips         = 4.0;     // Auto-SL Buffer Beyond M15 Sweep Wick (Pips)
input double   InpLimitRetracePct      = 40.0;    // Limit Entry Retracement of M15 Candle (%)
input int      InpLimitExpiryMinutes   = 45;      // Auto-Cancel Unfilled Limit Order After (Mins)
input ulong    InpMaxSlippagePoints    = 3;       // Max Allowed Market Slippage (Points, 3 = 0.3 pips)

input group "=== Trigger & Identification ==="
input double   InpPilotLotTrigger      = 0.01;    // Pilot Lot Size from Mobile to Trigger Split
input ulong    InpExecutionMagic       = 880015;  // Magic Number for Expanded Tranches

CTrade         ExtTrade;

//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
{
   ExtTrade.SetExpertMagicNumber(InpExecutionMagic);
   ExtTrade.SetDeviationInPoints(InpMaxSlippagePoints);
   ExtTrade.SetTypeFillingBySymbol(_Symbol);
   ExtTrade.SetAsyncMode(false);
   
   Print("[INIT] HNW Tranche Executor armed on ", _Symbol, 
         ". Waiting for ", DoubleToString(InpPilotLotTrigger, 2), " lot pilot order.");
   return(INIT_SUCCEEDED);
}

//+------------------------------------------------------------------+
//| TradeTransaction event: intercepts 0.01 pilot order immediately  |
//+------------------------------------------------------------------+
void OnTradeTransaction(const MqlTradeTransaction &trans,
                        const MqlTradeRequest &request,
                        const MqlTradeResult &result)
{
   if(trans.type != TRADE_TRANSACTION_DEAL_ADD)
      return;

   if(!HistoryDealSelect(trans.deal))
      return;

   string dealSymbol = HistoryDealGetString(trans.deal, DEAL_SYMBOL);
   long   dealEntry  = HistoryDealGetInteger(trans.deal, DEAL_ENTRY);
   long   dealMagic  = HistoryDealGetInteger(trans.deal, DEAL_MAGIC);
   double dealVolume = HistoryDealGetDouble(trans.deal, DEAL_VOLUME);
   long   dealType   = HistoryDealGetInteger(trans.deal, DEAL_TYPE);
   ulong  posId      = (ulong)HistoryDealGetInteger(trans.deal, DEAL_POSITION_ID);

   // Verify this is a newly opened manual pilot order on the current symbol
   if(dealSymbol == _Symbol && dealEntry == DEAL_ENTRY_IN && dealMagic == 0)
   {
      if(MathAbs(dealVolume - InpPilotLotTrigger) < 0.0001)
      {
         Print("[TRIGGER] Detected 0.01 pilot position #", posId, ". Executing HNW Tranche Split...");
         ExecuteTrancheSplit(posId, (ENUM_DEAL_TYPE)dealType);
      }
   }
}

//+------------------------------------------------------------------+
//| Core Tranche Calculation & Order Slicing                         |
//+------------------------------------------------------------------+
void ExecuteTrancheSplit(ulong pilotPositionTicket, ENUM_DEAL_TYPE dealType)
{
   if(!PositionSelectByTicket(pilotPositionTicket))
      return;

   bool   isBuy      = (dealType == DEAL_TYPE_BUY);
   double entryPrice = PositionGetDouble(POSITION_PRICE_OPEN);
   double pilotSl    = PositionGetDouble(POSITION_SL);
   double pipSize    = GetPipSize();

   // 1. Resolve Structural Stop Loss (use Pilot SL if set, otherwise M15 candle extreme + buffer)
   double m15High    = iHigh(_Symbol, PERIOD_M15, 1);
   double m15Low     = iLow(_Symbol, PERIOD_M15, 1);
   double slPrice    = pilotSl;

   if(slPrice <= 0.0)
   {
      slPrice = isBuy ? (m15Low - InpSlBufferPips * pipSize)
                      : (m15High + InpSlBufferPips * pipSize);
      slPrice = NormalizeDouble(slPrice, _Digits);
   }

   double slDistancePrice = MathAbs(entryPrice - slPrice);
   if(slDistancePrice <= SymbolInfoInteger(_Symbol, SYMBOL_TRADE_STOPS_LEVEL) * _Point)
   {
      Print("[ERROR] Stop Loss distance is too tight or invalid. Aborting split.");
      return;
   }

   // 2. Calculate Take Profit Price
   double tpDistancePrice = slDistancePrice * InpRewardRatio;
   double tpPrice = isBuy ? NormalizeDouble(entryPrice + tpDistancePrice, _Digits)
                          : NormalizeDouble(entryPrice - tpDistancePrice, _Digits);

   // 3. Calculate Exact Total Volume for InpRiskCashUSD using OrderCalcProfit
   double lossPerOneLot = 0.0;
   ENUM_ORDER_TYPE calcType = isBuy ? ORDER_TYPE_BUY : ORDER_TYPE_SELL;
   if(!OrderCalcProfit(calcType, _Symbol, 1.0, entryPrice, slPrice, lossPerOneLot) || MathAbs(lossPerOneLot) <= 0.0)
   {
      Print("[ERROR] OrderCalcProfit failed to compute lot value.");
      return;
   }

   double totalLots  = InpRiskCashUSD / MathAbs(lossPerOneLot);
   // Subtract the 0.01 pilot lot and update the pilot's SL/TP first
   ExtTrade.PositionModify(pilotPositionTicket, slPrice, tpPrice);
   double remainingLots = MathMax(0.0, totalLots - InpPilotLotTrigger);

   double marketLots = NormalizeLot(remainingLots * (InpMarketTranchePct / 100.0));
   double limitLots  = NormalizeLot(remainingLots - marketLots);

   PrintFormat("[SIZING] Risk: $%.2f | SL Dist: %.1f pips | Total Lots: %.2f (Market: %.2f, Limit: %.2f)",
               InpRiskCashUSD, slDistancePrice / pipSize, totalLots, marketLots, limitLots);

   // 4. Fire Sliced Market Tranches (capped at InpMaxLotsPerClip per ticket)
   double lotsLeftToFire = marketLots;
   int    clipIndex      = 1;
   while(lotsLeftToFire > 0.0)
   {
      double clipLots = NormalizeLot(MathMin(lotsLeftToFire, InpMaxLotsPerClip));
      if(clipLots <= 0.0) break;

      double execPrice = isBuy ? SymbolInfoDouble(_Symbol, SYMBOL_ASK) : SymbolInfoDouble(_Symbol, SYMBOL_BID);
      bool   sent      = isBuy ? ExtTrade.Buy(clipLots, _Symbol, execPrice, slPrice, tpPrice, "HNW_Mkt_Clip_" + IntegerToString(clipIndex))
                               : ExtTrade.Sell(clipLots, _Symbol, execPrice, slPrice, tpPrice, "HNW_Mkt_Clip_" + IntegerToString(clipIndex));

      if(sent)
         PrintFormat("[MARKET CLIP #%d] Executed %.2f lots at %.5f", clipIndex, clipLots, execPrice);
      else
         PrintFormat("[WARNING] Market clip #%d rejected. Retcode: %u", clipIndex, ExtTrade.ResultRetcode());

      lotsLeftToFire = NormalizeLot(lotsLeftToFire - clipLots);
      clipIndex++;
      if(lotsLeftToFire > 0.0) Sleep(150); // 150ms pacing for ECN liquidity replenishment
   }

   // 5. Place Limit Tranche at M15 Rejection Candle Retracement
   if(limitLots > 0.0)
   {
      double m15Range   = MathMax(m15High - m15Low, 5.0 * pipSize);
      double retraceOffset = m15Range * (InpLimitRetracePct / 100.0);
      double limitPrice = isBuy ? NormalizeDouble(entryPrice - retraceOffset, _Digits)
                                : NormalizeDouble(entryPrice + retraceOffset, _Digits);

      // Ensure Limit Price remains strictly on the valid side of Stop Loss
      if((isBuy && limitPrice > slPrice) || (!isBuy && limitPrice < slPrice))
      {
         datetime expiryTime = TimeCurrent() + (InpLimitExpiryMinutes * 60);
         bool limitPlaced = isBuy ? ExtTrade.BuyLimit(limitLots, limitPrice, _Symbol, slPrice, tpPrice, ORDER_TIME_SPECIFIED, expiryTime, "HNW_Lmt_Tranche")
                                  : ExtTrade.SellLimit(limitLots, limitPrice, _Symbol, slPrice, tpPrice, ORDER_TIME_SPECIFIED, expiryTime, "HNW_Lmt_Tranche");

         if(limitPlaced)
            PrintFormat("[LIMIT TRANCHE] Placed %.2f lots at %.5f (Expires in %d mins)", limitLots, limitPrice, InpLimitExpiryMinutes);
      }
   }
}

//+------------------------------------------------------------------+
//| Helper: Normalize volume to broker step and bounds               |
//+------------------------------------------------------------------+
double NormalizeLot(double rawLots)
{
   double step   = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_STEP);
   double minLot = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MIN);
   double maxLot = SymbolInfoDouble(_Symbol, SYMBOL_VOLUME_MAX);

   double stepped = MathFloor(rawLots / step) * step;
   if(stepped < minLot) return 0.0;
   if(stepped > maxLot) stepped = maxLot;
   return NormalizeDouble(stepped, 2);
}

//+------------------------------------------------------------------+
//| Helper: Standard Pip Size across 5-digit FX and XAUUSD           |
//+------------------------------------------------------------------+
double GetPipSize()
{
   if(_Digits == 5 || _Digits == 3) return(_Point * 10.0);
   if(_Digits == 2)                 return(_Point * 10.0); // XAUUSD standard 0.10 pip
   return(_Point);
}
Preserve your own money. Scale with the market's money. Exponential growth is the ultimate key.
PTScalper
Site Admin
Posts: 5838
Joined: Mon Jul 20, 2026 1:28 pm

Re: How to trade High-Net-Worth (HNW) account?

Post by PTScalper »

C# Implementation (cTrader Automate cBot)

If you execute via cTrader, its native ExecuteMarketRangeOrder API provides server-side Market-With-Slippage-Control fills (converting the order into a limit or cancelling any unfilled remainder if the order book thins beyond your tolerance).

Code: Select all

using System;
using cAlgo.API;
using cAlgo.API.Internals;

namespace cAlgo.Robots
{
    [Robot(TimeZone = TimeZones.CentralEuropeanStandardTime, AccessRights = AccessRights.None)]
    public class HnwTrancheExecutorBot : Robot
    {
        [Parameter("Risk Cash ($)", Group = "Risk & Sizing", DefaultValue = 1250.0, MinValue = 50.0)]
        public double RiskCashUsd { get; set; }

        [Parameter("Reward:Risk Ratio", Group = "Risk & Sizing", DefaultValue = 2.0, MinValue = 0.2)]
        public double RewardRatio { get; set; }

        [Parameter("Market Tranche (%)", Group = "Risk & Sizing", DefaultValue = 50.0, MinValue = 10.0, MaxValue = 100.0)]
        public double MarketTranchePct { get; set; }

        [Parameter("Max Lots Per Market Clip", Group = "Risk & Sizing", DefaultValue = 8.0, MinValue = 1.0)]
        public double MaxLotsPerClip { get; set; }

        [Parameter("Auto-SL Buffer (Pips)", Group = "M15 Structure & Limit", DefaultValue = 4.0, MinValue = 0.5)]
        public double SlBufferPips { get; set; }

        [Parameter("Limit Retracement (%)", Group = "M15 Structure & Limit", DefaultValue = 40.0, MinValue = 10.0, MaxValue = 80.0)]
        public double LimitRetracePct { get; set; }

        [Parameter("Limit Expiry (Minutes)", Group = "M15 Structure & Limit", DefaultValue = 45, MinValue = 5)]
        public int LimitExpiryMinutes { get; set; }

        [Parameter("Max Market Slippage (Pips)", Group = "M15 Structure & Limit", DefaultValue = 0.3, MinValue = 0.1)]
        public double MaxSlippagePips { get; set; }

        [Parameter("Pilot Lot Trigger", Group = "Trigger", DefaultValue = 0.01)]
        public double PilotLotTrigger { get; set; }

        private const string TrancheLabel = "HNW_Tranche_Exec";
        private Bars _m15Bars;

        protected override void OnStart()
        {
            _m15Bars = MarketData.GetBars(TimeFrame.Minute15, SymbolName);
            Positions.Opened += OnPositionOpened;
            Print("[INIT] HNW Tranche Executor active on {0}. Listening for {1:F2} lot pilot order.", SymbolName, PilotLotTrigger);
        }

        private void OnPositionOpened(PositionOpenedEventArgs args)
        {
            Position pos = args.Position;

            // Ignore positions opened by this cBot or on other symbols
            if (pos.SymbolName != SymbolName || pos.Label == TrancheLabel)
                return;

            double pilotVolumeUnits = Symbol.QuantityToVolumeInUnits(PilotLotTrigger);
            if (Math.Abs(pos.VolumeInUnits - pilotVolumeUnits) > 1.0)
                return;

            Print("[TRIGGER] Intercepted {0:F2} lot pilot position #{1}. Calculating HNW Tranches...", PilotLotTrigger, pos.Id);
            ExecuteTrancheSplit(pos);
        }

        private void ExecuteTrancheSplit(Position pilotPos)
        {
            bool isBuy = pilotPos.TradeType == TradeType.Buy;
            double entryPrice = pilotPos.EntryPrice;

            // 1. Resolve Structural Stop Loss (use Pilot SL if set, else previous M15 candle extreme + buffer)
            int prevBarIdx = _m15Bars.Count - 2;
            double m15High = _m15Bars.HighPrices[prevBarIdx];
            double m15Low = _m15Bars.LowPrices[prevBarIdx];

            double slPrice = pilotPos.StopLoss ?? (isBuy
                ? Math.Round(m15Low - (SlBufferPips * Symbol.PipSize), Symbol.Digits)
                : Math.Round(m15High + (SlBufferPips * Symbol.PipSize), Symbol.Digits));

            double slPips = Math.Round(Math.Abs(entryPrice - slPrice) / Symbol.PipSize, 1);
            if (slPips < 2.0)
            {
                Print("[ERROR] Stop Loss distance ({0} pips) is too small. Aborting split.", slPips);
                return;
            }

            double tpPips = Math.Round(slPips * RewardRatio, 1);
            double tpPrice = isBuy
                ? Math.Round(entryPrice + (tpPips * Symbol.PipSize), Symbol.Digits)
                : Math.Round(entryPrice - (tpPips * Symbol.PipSize), Symbol.Digits);

            // Modify the 0.01 pilot position so its SL/TP match the structural setup
            ModifyPosition(pilotPos, slPrice, tpPrice);

            // 2. Calculate Exact Total Volume in Units & Lots
            double rawTotalUnits = RiskCashUsd / (slPips * Symbol.PipValue);
            double totalUnits = Symbol.NormalizeVolumeInUnits(rawTotalUnits, RoundingMode.Down);
            double remainingUnits = Math.Max(0, totalUnits - pilotPos.VolumeInUnits);

            double marketUnits = Symbol.NormalizeVolumeInUnits(remainingUnits * (MarketTranchePct / 100.0), RoundingMode.Down);
            double limitUnits = Symbol.NormalizeVolumeInUnits(remainingUnits - marketUnits, RoundingMode.Down);

            Print("[SIZING] Risk: ${0:F2} | SL: {1:F1} pips | Total Lots: {2:F2} (Market: {3:F2}, Limit: {4:F2})",
                RiskCashUsd, slPips, Symbol.VolumeInUnitsToQuantity(totalUnits),
                Symbol.VolumeInUnitsToQuantity(marketUnits), Symbol.VolumeInUnitsToQuantity(limitUnits));

            // 3. Fire Market Tranche Clips using MarketRange Order (strictly bounds slippage)
            double maxClipUnits = Symbol.QuantityToVolumeInUnits(MaxLotsPerClip);
            double unitsLeft = marketUnits;
            int clipCount = 1;

            while (unitsLeft >= Symbol.VolumeInUnitsMin)
            {
                double clipUnits = Symbol.NormalizeVolumeInUnits(Math.Min(unitsLeft, maxClipUnits), RoundingMode.Down);
                double basePrice = isBuy ? Symbol.Ask : Symbol.Bid;

                TradeResult mktResult = ExecuteMarketRangeOrder(
                    pilotPos.TradeType,
                    SymbolName,
                    clipUnits,
                    basePrice,
                    MaxSlippagePips,
                    TrancheLabel,
                    slPips,
                    tpPips
                );

                if (mktResult.IsSuccessful)
                    Print("[MARKET CLIP #{0}] Filled {1:F2} lots at {2}", clipCount, Symbol.VolumeInUnitsToQuantity(clipUnits), mktResult.Position.EntryPrice);
                else
                    Print("[WARNING] Market clip #{0} failed: {1}", clipCount, mktResult.Error);

                unitsLeft -= clipUnits;
                clipCount++;
            }

            // 4. Place Limit Tranche at M15 Rejection Candle Retracement
            if (limitUnits >= Symbol.VolumeInUnitsMin)
            {
                double m15Range = Math.Max(m15High - m15Low, 5.0 * Symbol.PipSize);
                double retraceOffset = m15Range * (LimitRetracePct / 100.0);
                double limitPrice = isBuy
                    ? Math.Round(entryPrice - retraceOffset, Symbol.Digits)
                    : Math.Round(entryPrice + retraceOffset, Symbol.Digits);

                // Recalculate relative SL/TP in pips from the improved Limit entry price
                double limitSlPips = Math.Round(Math.Abs(limitPrice - slPrice) / Symbol.PipSize, 1);
                double limitTpPips = Math.Round(Math.Abs(tpPrice - limitPrice) / Symbol.PipSize, 1);
                DateTime expiry = Server.Time.AddMinutes(LimitExpiryMinutes);

                TradeResult lmtResult = PlaceLimitOrder(
                    pilotPos.TradeType,
                    SymbolName,
                    limitUnits,
                    limitPrice,
                    TrancheLabel,
                    limitSlPips,
                    limitTpPips,
                    expiry
                );

                if (lmtResult.IsSuccessful)
                    Print("[LIMIT TRANCHE] Placed {0:F2} lots at {1} (SL: {2:F1}p, TP: {3:F1}p, Expires: {4:HH:mm})",
                        Symbol.VolumeInUnitsToQuantity(limitUnits), limitPrice, limitSlPips, limitTpPips, expiry);
            }
        }

        protected override void OnStop()
        {
            Positions.Opened -= OnPositionOpened;
        }
    }
}
Preserve your own money. Scale with the market's money. Exponential growth is the ultimate key.
Post Reply