Appearance
Are you an LLM? You can read better optimized documentation at /core-concepts/order-management-system.md for this page in Markdown format
Order Management System
This document provides a complete technical reference for how TTMT manages every aspect of a trade — from the initial volume calculation to the final position close. It covers the 12-order layered structure, volume distribution, TP assignment, adaptive redistribution, liquidation ordering, and how these are emulated in the Trade Preview.
1. Trade Lifecycle Overview
Every trade passes through the following stages:
| Stage | What Happens |
|---|---|
| Signal Received | AI parses the Telegram signal (symbol, direction, SL, TP1–TP6) |
| Volume Calculation | Total lot size determined from risk settings |
| 12-Order Allocation | Volume split across 4 layers × 3 sub-orders, each assigned a TP target |
| Entry Zone | Limit order prices calculated within the entry zone |
| Parallel Execution | All 12 orders submitted simultaneously (decoupled mode) |
| Position Monitoring | Real-time streaming tracks fills, partial fills, and price action |
| TP Redistribution | When deeper layers fill, TP targets compress adaptively |
| Position Close | Positions hit their assigned TP and close automatically |
2. Volume Calculation
Before any orders are placed, the system determines how large the total position should be. Three modes are available.
2.1 Fixed Lot Size
The simplest mode. You specify a static lot size (e.g., 0.10 lots) and every trade uses that volume regardless of stop-loss distance or account balance.
| Advantage | Disadvantage |
|---|---|
| Predictable, easy to understand | Risk varies wildly between trades — a 100-pip SL risks 10× more than a 10-pip SL |
2.2 Percentage Risk (Recommended)
You specify a percentage of your account balance to risk per trade (e.g., 1%). The system calculates the lot size so that if the trade hits the stop loss, you lose exactly that percentage.
Formula:
Total Volume = Risk Amount / (Weighted SL Distance × Contract Size)
Where:
Risk Amount = Account Balance × (Risk Percent / 100)
Contract Size = From broker symbol specification (e.g., 100,000 for forex, 100 for gold)Why "Weighted" SL Distance?
Because the 12-order system enters at different prices within an entry zone, each layer has a different distance to the stop loss. The system computes a weighted average that reflects the true aggregate risk:
Layer 1: Market price → Full SL distance
Layer 2: 33% into entry zone → Reduced SL distance
Layer 3: 66% into entry zone → Further reduced
Layer 4: Entry zone edge → Minimal SL distance
Weighted SL = Σ (Layer Distribution % × Layer SL Distance)This means the system can afford slightly more volume than a naive single-order calculation, because the average entry price is better when layers fill.
Example
Account: $5,000 | Risk: 2% | SL: 600 pips on XAUUSD
Risk Amount = $5,000 × 2% = $100
Contract Size = 100 (Gold)
Simple SL = 6.00 price units
Weighted SL ≈ 5.47 (accounting for layered entries)
Total Volume = $100 / (5.47 × 100) = 0.18 lots2.3 Fixed USD Risk
You specify a fixed dollar amount to risk per trade (e.g., $50). The system calculates lot size so that your maximum loss on SL hit is exactly that amount.
Total Volume = Fixed USD Amount / (SL Distance × Contract Size)2.4 Per-Asset Overrides
You can configure different risk parameters for different asset classes. For example:
- Forex: 2% of balance
- Gold: $75 fixed USD
- Indices: 0.05 fixed lots
Each asset class can independently use any of the three volume modes, plus an optional max volume cap to prevent over-leverage on volatile instruments.
2.5 Risk Multipliers
Each trade can optionally apply a risk multiplier:
| Level | Multiplier | Use Case |
|---|---|---|
| Normal | 1.0× | Standard risk allocation |
| Mid | 1.5× | Moderate confidence boost |
| High | 2.0× | High-conviction setups |
The multiplier scales the calculated volume. A maximum position size cap still applies.
3. The 12-Order Structure
Once total volume is known, it is split into 4 layers of 3 sub-orders each, for 12 orders total.
3.1 Layer Architecture
| Layer | Type | Zone Position | Base Volume | Sub-Orders |
|---|---|---|---|---|
| 1 | Market | Entry Price (100%) | 30% | 14%, 8%, 8% |
| 2 | Limit | 66% of Zone | 20% | 10%, 5%, 5% |
| 3 | Limit | 33% of Zone | 20% | 10%, 5%, 5% |
| 4 | Limit | Zone Edge (0%) | 30% | 14%, 8%, 8% |
| Total | 100% | 12 orders |
Key properties:
- Outer layers (1, 4) each carry 30% of total volume, split as 14/8/8.
- Inner layers (2, 3) each carry 20% of total volume, split as 10/5/5.
- Sub-order "a" is always the largest within its layer.
- All 12 percentages sum to exactly 100%.
3.2 Entry Strategies (Layer Volume Distribution)
The Entry Strategy controls how total volume is distributed across the 4 layers. It modifies the base 30/20/20/30 distribution while preserving each sub-order's TP assignment.
| Strategy | Layer 1 | Layer 2 | Layer 3 | Layer 4 | Character |
|---|---|---|---|---|---|
| Even | 25% | 25% | 25% | 25% | Balanced, no bias |
| Front-Loaded | 31% | 23% | 23% | 23% | Catch the move |
| Martingale | 10% | 20% | 30% | 40% | Bet on retracement |
| Single | 100% | 0% | 0% | 0% | Classic copy-trade |
How it works: Each sub-order's volume is scaled proportionally. For example, with the Martingale strategy:
Layer 1 base = 30% → Target = 10%
Scale factor = 10 / 30 = 0.333
L1a: 14% × 0.333 = 4.67%
L1b: 8% × 0.333 = 2.67%
L1c: 8% × 0.333 = 2.67%
Layer 1 total = 10% ✓
Layer 4 base = 30% → Target = 40%
Scale factor = 40 / 30 = 1.333
L4a: 14% × 1.333 = 18.67%
L4b: 8% × 1.333 = 10.67%
L4c: 8% × 1.333 = 10.67%
Layer 4 total = 40% ✓The TP targets assigned to each sub-order (e.g., L1a → TP1) are not affected by the entry strategy. Only the volume changes.
3.3 Volume Rounding and Minimum Lots
Brokers enforce a minimum lot size (typically 0.01) and a lot step (typically 0.01). After calculating each sub-order's volume, the system rounds to the nearest step.
Remainder-based allocation prevents cumulative rounding loss:
- Process all sub-orders except the last with standard rounding.
- Track how much volume has been allocated.
- Assign the exact remainder to the last sub-order.
- If any sub-order falls below the broker minimum, it is set to 0 (skipped) rather than forced to the minimum — this prevents accidental over-leverage.
Minimum viable volume = the smallest sub-order percentage determines how much total volume you need for all 12 orders to execute. With the default allocation (smallest sub-order = 5%), the minimum is:
Min Total = 0.01 / 0.05 = 0.20 lotsBelow this, some orders will be skipped. The system continues with whatever orders are viable.
4. The Entry Zone
The entry zone defines the price range across which limit orders (Layers 2–4) are spread.
4.1 Zone Calculation
Two modes are available:
Auto Mode (Default):
Entry Zone Size = SL Distance × (Entry Zone % / 100)
Default: 80% of SL distanceFixed Pips Mode:
Entry Zone Size = User-specified pips × Pip Value4.2 Layer Entry Prices
For a BUY trade:
Layer 1: Market price (immediate execution)
Layer 2: Entry Price − (Zone Size × 34%) [66% from bottom]
Layer 3: Entry Price − (Zone Size × 67%) [33% from bottom]
Layer 4: Entry Price − Zone Size [Zone bottom — best price]For a SELL trade, the logic is mirrored above entry.
Example — Buy EURUSD
Entry: 1.1000 | SL: 1.0980 (20 pips) | Zone: 16 pips (80%)
| Layer | Entry Price | Distance from Market |
|---|---|---|
| L1 | 1.1000 | 0 pips (Market) |
| L2 | 1.0989 | 11 pips |
| L3 | 1.0995 | 5 pips |
| L4 | 1.0984 | 16 pips |
5. Take Profit Assignment
Each of the 12 sub-orders is assigned to a Take Profit level (TP1–TP6) based on the selected TP Strategy. This determines where each piece of your position will close.
5.1 TP Strategies
TTMT supports up to 6 TP levels. The TP Strategy controls what percentage of total volume exits at each level.
| TP Count | Progressive | Balanced | Extended |
|---|---|---|---|
| 1 TP | 100% | 100% | 100% |
| 2 TPs | 60 / 40 | 50 / 50 | 40 / 60 |
| 3 TPs | 50 / 30 / 20 | 34 / 33 / 33 | 20 / 30 / 50 |
| 4 TPs | 40 / 25 / 20 / 15 | 25 / 25 / 25 / 25 | 15 / 20 / 25 / 40 |
| 5 TPs | 35 / 25 / 18 / 13 / 9 | 20 / 20 / 20 / 20 / 20 | 9 / 13 / 18 / 25 / 35 |
| 6 TPs | 30 / 23 / 18 / 13 / 10 / 6 | 17 / 17 / 17 / 17 / 16 / 16 | 6 / 10 / 13 / 18 / 23 / 30 |
Progressive front-loads exits — most volume closes at the earliest TPs, locking in profits quickly.
Balanced distributes volume roughly equally across all TPs.
Extended back-loads exits — most volume is held for the furthest TPs, maximizing gains on strong trends.
5.2 Greedy Assignment Algorithm
The system uses a greedy algorithm to assign each of the 12 sub-orders to the TP level that needs volume most to match the target distribution:
- Sort orders by volume (strategy-dependent ordering).
- For each order, find the TP level with the largest remaining deficit.
- Assign the order to that TP.
- Update the allocated total for that TP.
Strategy-specific tie-breaking:
- Progressive: Prefers earlier TPs when scores are close (secure profit).
- Extended: Prefers later TPs when scores are close (chase trends).
- Balanced: Processes orders in natural layer order (L1a, L1b, ... L4c).
5.3 Resulting Allocation (6-TP Progressive Example)
| Order | Volume | Target TP | Layer | Position |
|---|---|---|---|---|
| L1a | 14% | TP1 | 1 (Market) | a |
| L1b | 8% | TP2 | 1 (Market) | b |
| L1c | 8% | TP3 | 1 (Market) | c |
| L2a | 10% | TP2 | 2 (Limit) | a |
| L2b | 5% | TP3 | 2 (Limit) | b |
| L2c | 5% | TP4 | 2 (Limit) | c |
| L3a | 10% | TP4 | 3 (Limit) | a |
| L3b | 5% | TP5 | 3 (Limit) | b |
| L3c | 5% | TP6 | 3 (Limit) | c |
| L4a | 14% | TP5 | 4 (Limit) | a |
| L4b | 8% | TP6 | 4 (Limit) | b |
| L4c | 8% | TP1 | 4 (Limit) | c |
Observation: Layer 1 orders target the earliest TPs (TP1–TP3). Layer 4 orders target the latest TPs (TP5–TP6) plus one safety order at TP1. This means Layer 1 positions close first in favorable conditions — a natural liquidation priority.
5.4 Dynamic TP Count
If a signal provides fewer than 6 TPs (e.g., only TP1–TP3), the greedy algorithm adapts automatically, distributing all 12 orders across the available TPs only. The target percentages scale accordingly.
6. Order Execution
6.1 Decoupled Parallel Mode
All 12 orders are submitted simultaneously using Promise.allSettled(). This is the decoupled execution model:
- Each order is an independent async operation.
- Orders do not wait for each other.
- If some orders fail, the rest still execute.
- Retry logic wraps each individual order.
6.2 Market Orders (Layer 1)
Layer 1 executes immediately at market price. The system:
- Generates a unique client ID (
TT_{tradeId}_{layer}{position}). - Checks for idempotency (prevents duplicate orders on retry).
- Submits the market order via the MetaAPI SDK.
- Confirms entry price from the broker response.
- Creates a position record in the database.
6.3 Limit Orders (Layers 2–4)
Layers 2–4 place limit orders at their calculated entry prices. These remain pending on the broker until:
- Price reaches their level and they fill.
- The trade is closed (all orders and positions are cancelled/closed).
- The user manually cancels them.
When a limit order fills, the system detects it via the streaming position monitor and creates a position record.
6.4 Partial Execution
If some orders fail (network issues, broker rejects), the trade continues with whatever succeeded. The only hard failure condition is if no market orders succeed — in that case, the trade is aborted.
6.5 Atomic Finalization
After all promises settle, the system performs an atomic database write via RPC — inserting all orders, positions, and the trade record in a single transaction. This prevents orphaned records.
7. Position Monitoring & Layer Fill Detection
Once the trade is live, a real-time streaming listener monitors all positions:
- Deal Events: Detects when limit orders fill (
DEAL_ENTRY_IN). - Layer Tracking: Maintains a count of unique layers with open positions.
- TP Hit Detection: Detects when positions close at their TP.
- SL Hit Detection: Detects full stop-loss closure.
When a new layer fills, the system increments the filled layers count and triggers TP Redistribution.
8. Adaptive TP Redistribution (V2)
This is the core intelligence that differentiates TTMT. When deeper layers fill, the system dynamically re-targets Take Profit levels to secure profits faster given the increased exposure.
8.1 Why Redistribute?
When only Layer 1 fills (30% of volume), waiting for TP5 or TP6 is reasonable — you have limited exposure and the trade is already in profit.
When all 4 layers fill (100% of volume), the situation is different:
- You have maximum exposure and maximum drawdown.
- Price retraced significantly before bouncing.
- Waiting for the original far-out TPs is risky.
Redistribution compresses the TP targets so that earlier layers close sooner, reducing risk while letting deeper layers aim for the original targets.
8.2 The Proportional Compression Algorithm
The V2 algorithm uses proportional compression instead of absolute shifts:
compressionFactor = (layerNumber - 1) / (filledLayers - 1)
newTP = max(1, round(1 + (originalTP - 1) × compressionFactor))Interpretation:
compressionFactor = 0→ Fully compressed to TP1 (safety net)compressionFactor = 1→ No compression (keep original TP)- Between 0 and 1 → Proportional shift toward TP1
Special rules:
- Layer 1 Lock: When any deeper layer fills, all Layer 1 positions move to TP1 regardless of their original assignment. This secures profit on the earliest entry as a safety net.
- Deepest Layer: The most recently filled (deepest) layer always keeps its original TP targets (compression factor = 1).
8.3 Compression Factor Table
| 2 Layers Filled | 3 Layers Filled | 4 Layers Filled | |
|---|---|---|---|
| Layer 1 | 0 (→ TP1) | 0 (→ TP1) | 0 (→ TP1) |
| Layer 2 | 1.0 (original) | 0.50 | 0.33 |
| Layer 3 | — | 1.0 (original) | 0.67 |
| Layer 4 | — | — | 1.0 (original) |
8.4 Scenario Walkthroughs
Scenario 1: Only Layer 1 Fills (30% Exposure)
Price moved in the trade direction immediately. No retracement.
- Action: No redistribution needed.
- All orders keep their original TP assignments.
Layer 1: L1a→TP1, L1b→TP2, L1c→TP3 (Original, no change)Scenario 2: Layers 1 + 2 Fill (50% Exposure)
Light retracement. Price dipped into the entry zone and filled Layer 2 before resuming.
| Order | Original TP | Compression | New TP |
|---|---|---|---|
| L1a | TP1 | cf = 0 → Locked | TP1 |
| L1b | TP2 | cf = 0 → Locked | TP1 |
| L1c | TP3 | cf = 0 → Locked | TP1 |
| L2a | TP2 | cf = 1.0 | TP2 |
| L2b | TP3 | cf = 1.0 | TP3 |
| L2c | TP4 | cf = 1.0 | TP4 |
Result: Layer 1 locks to TP1 (secure profit quickly). Layer 2 keeps original targets (it's the deepest active layer).
Scenario 3: Layers 1 + 2 + 3 Fill (70% Exposure)
Moderate retracement. Significant exposure.
| Order | Original TP | cf | New TP |
|---|---|---|---|
| L1a | TP1 | 0 | TP1 |
| L1b | TP2 | 0 | TP1 |
| L1c | TP3 | 0 | TP1 |
| L2a | TP2 | 0.50 | TP1 |
| L2b | TP3 | 0.50 | TP2 |
| L2c | TP4 | 0.50 | TP3 |
| L3a | TP4 | 1.0 | TP4 |
| L3b | TP5 | 1.0 | TP5 |
| L3c | TP6 | 1.0 | TP6 |
Result: Layer 1 fully locked to TP1. Layer 2 partially compressed (TP2→TP1, TP3→TP2, TP4→TP3). Layer 3 keeps originals.
Scenario 4: All 4 Layers Fill (100% Exposure)
Deep retracement. Full position filled. Priority shifts to recovery and profit-securing.
| Order | Original TP | cf | New TP |
|---|---|---|---|
| L1a | TP1 | 0 | TP1 |
| L1b | TP2 | 0 | TP1 |
| L1c | TP3 | 0 | TP1 |
| L2a | TP2 | 0.33 | TP1 |
| L2b | TP3 | 0.33 | TP2 |
| L2c | TP4 | 0.33 | TP2 |
| L3a | TP4 | 0.67 | TP3 |
| L3b | TP5 | 0.67 | TP4 |
| L3c | TP6 | 0.67 | TP4 |
| L4a | TP5 | 1.0 | TP5 |
| L4b | TP6 | 1.0 | TP6 |
| L4c | TP1 | 1.0 | TP1 |
Result: Layers 1–3 are compressed progressively toward TP1. Layer 4 (deepest entry, best price) keeps its original targets and acts as the "runner" — positioned to capture the full move if the trend extends.
8.5 Liquidation Order
A natural consequence of the redistribution algorithm is a built-in liquidation priority:
- Layer 1 positions close first — they are locked to TP1, the nearest target.
- Layer 2 positions close next — compressed toward earlier TPs.
- Layer 3 positions close after — moderately compressed.
- Layer 4 positions close last — original targets preserved.
This is by design: earlier entries are liquidated first (securing profit quickly), while deeper entries are preserved for maximum extension. The deeper layers entered at better prices, so they have the most favorable risk/reward to remain open.
8.6 Redistribution Triggers
| Trigger | When | Behavior |
|---|---|---|
layer_fill | A new limit order fills | Full adaptive compression |
timeout | Execution timeout expires | Initial redistribution |
all_filled | All layers confirm filled | Full compression |
followup | Signal provider updates TP prices | Price-only mode — updates TP prices without changing assignments |
manual | Admin action | Full compression |
8.7 Safety Mechanisms
Race Condition Prevention: When multiple layers fill in rapid succession, the system uses a trade-level mutex lock and verifies filled-layer count inside the critical section to prevent stale state.
Failure Handling: If TP modifications fail on the broker:
- < 25% failure rate: Record partial success, continue.
- >= 25% failure rate: Mark trade for automatic retry.
- Retry service: Runs every 60 seconds, re-attempts failed modifications with exponential backoff (1 min → 2 min → 4 min, max 3 retries).
9. How the Trade Preview Emulates This
The Trade Preview panel in the dashboard provides a real-time simulation of the entire system before any orders are placed. It mirrors the backend logic exactly.
9.1 What the Preview Calculates
| Calculation | Method |
|---|---|
| Total volume | Same formula as backend (fixed, percentage, or fixed USD) |
| Layer volumes | Same remainder-based allocation with broker lot step |
| Entry prices | Same entry zone and layer price formulas |
| TP assignments | Same greedy assignment algorithm |
| Risk metrics | Max loss in dollars, risk/reward ratio, average entry price |
| Viability | Checks if volume is sufficient for all 12 orders |
9.2 Preview Tabs
Summary: Key metrics at a glance — total volume, risk amount, layer breakdown, TP distribution.
Visual: A price ladder showing the entry zone, TP levels, SL, and where each order sits.
Detailed: Full 12-order table with individual prices, volumes, and TP assignments. Includes risk calculations and volume-by-layer breakdown.
Scenarios: Simulates partial fills (1–4 layers) and shows:
- How TP redistribution changes assignments (before/after comparison).
- Which orders change targets and by how much.
- Breakeven simulation — what happens when a TP triggers the breakeven automation.
9.3 Scenario Simulation
The preview uses the same proportional compression formula as the live system:
compressionFactor = (layerNumber - 1) / (filledLayers - 1)
newTP = max(1, round(1 + (originalTP - 1) × compressionFactor))For each scenario (1–4 layers filled), the preview shows:
- Filled volume and actual dollar risk.
- Average entry price across all filled layers.
- Redistributed TP assignments with highlighted changes.
9.4 Breakeven Simulation
The preview also simulates the automatic breakeven feature:
- Select which TP triggers the breakeven (e.g., TP1).
- Set a buffer in pips (e.g., +2 pips above entry).
- View: remaining volume, new stop-loss price, locked profit amount.
10. Numerical Example — Full Walkthrough
This section traces a complete trade from signal to TP redistribution using concrete numbers.
Setup
| Parameter | Value |
|---|---|
| Account Balance | $10,000 |
| Risk Per Trade | 2% |
| Symbol | XAUUSD (Gold) |
| Direction | BUY |
| Entry Price | 2,850.00 |
| Stop Loss | 2,844.00 (600 pips / $6.00) |
| TP1 | 2,853.00 |
| TP2 | 2,856.00 |
| TP3 | 2,860.00 |
| Entry Strategy | Even (25/25/25/25) |
| TP Strategy | Progressive |
| Entry Zone | 80% of SL = 480 pips = $4.80 |
Step 1: Volume Calculation
Risk Amount = $10,000 × 2% = $200
Contract Size = 100
SL Distance = $6.00
Weighted SL Distance (Even strategy):
Layer 1: 25% × $6.00 = $1.50
Layer 2: 25% × ($6.00 - $4.80 × 0.33) = 25% × $4.42 = $1.10
Layer 3: 25% × ($6.00 - $4.80 × 0.66) = 25% × $2.83 = $0.71
Layer 4: 25% × ($6.00 - $4.80 × 1.00) = 25% × $1.20 = $0.30
Weighted Total = $3.61
Total Volume = $200 / ($3.61 × 100) = 0.55 lotsStep 2: Entry Zone Prices
Zone Size = $4.80
Layer 1: 2,850.00 (Market)
Layer 2: 2,850.00 - ($4.80 × 0.34) = 2,848.37
Layer 3: 2,850.00 - ($4.80 × 0.67) = 2,846.78
Layer 4: 2,850.00 - $4.80 = 2,845.20Step 3: Volume Distribution (Even Strategy)
Each layer gets 25% = 0.14 lots (rounded).
| Order | Volume | TP Target | Entry Price |
|---|---|---|---|
| L1a | 0.08 | TP1 | 2,850.00 |
| L1b | 0.04 | TP2 | 2,850.00 |
| L1c | 0.04 | TP3 | 2,850.00 |
| L2a | 0.05 | TP2 | 2,848.37 |
| L2b | 0.03 | TP3 | 2,848.37 |
| L2c | 0.03 | TP1 | 2,848.37 |
| L3a | 0.05 | TP1 | 2,846.78 |
| L3b | 0.03 | TP2 | 2,846.78 |
| L3c | 0.03 | TP3 | 2,846.78 |
| L4a | 0.08 | TP2 | 2,845.20 |
| L4b | 0.04 | TP3 | 2,845.20 |
| L4c | 0.05 | TP1 | 2,845.20 |
| Total | 0.55 |
Step 4: Scenario — All 4 Layers Fill
Price drops to 2,845.20, filling all layers. Total exposure: 0.55 lots.
TP Redistribution (Proportional Compression, 3 TPs):
| Order | Orig TP | cf | New TP | TP Price |
|---|---|---|---|---|
| L1a | TP1 | 0 | TP1 | 2,853.00 |
| L1b | TP2 | 0 | TP1 | 2,853.00 |
| L1c | TP3 | 0 | TP1 | 2,853.00 |
| L2a | TP2 | 0.33 | TP1 | 2,853.00 |
| L2b | TP3 | 0.33 | TP2 | 2,856.00 |
| L2c | TP1 | 0.33 | TP1 | 2,853.00 |
| L3a | TP1 | 0.67 | TP1 | 2,853.00 |
| L3b | TP2 | 0.67 | TP2 | 2,856.00 |
| L3c | TP3 | 0.67 | TP2 | 2,856.00 |
| L4a | TP2 | 1.0 | TP2 | 2,856.00 |
| L4b | TP3 | 1.0 | TP3 | 2,860.00 |
| L4c | TP1 | 1.0 | TP1 | 2,853.00 |
Resulting volume at each TP after redistribution:
| TP Level | Price | Volume | % of Total | Orders |
|---|---|---|---|---|
| TP1 | 2,853.00 | 0.30 | 55% | L1a, L1b, L1c, L2a, L2c, L3a, L4c |
| TP2 | 2,856.00 | 0.18 | 33% | L2b, L3b, L3c, L4a |
| TP3 | 2,860.00 | 0.04 | 7% | L4b |
Liquidation sequence:
- Price hits TP1 (2,853.00): 0.30 lots close — primarily Layer 1 and Layer 2 orders.
- Price hits TP2 (2,856.00): 0.18 lots close — Layer 2, 3, and 4 orders.
- Price hits TP3 (2,860.00): 0.04 lots close — Layer 4 runner.
Average entry price: ~2,847.59 (weighted by volume across all 4 layers). Since Layer 4 entered at the best price (2,845.20), the average entry is significantly better than the signal's 2,850.00.
11. Low Balance Mode
For accounts under $500, the system automatically switches to a simplified 3-layer structure (7 orders instead of 12) to prevent excessive margin usage:
| Layer | Type | Volume |
|---|---|---|
| 1 | Market | 42% (14 + 14 + 14) |
| 2 | Limit @ 66% | 28% (14 + 14) |
| 3 | Limit @ 33% | 28% (14 + 14) |
All orders target TP1 or TP2 only (Progressive-like for safety).
12. Key Design Principles
| Principle | Implementation |
|---|---|
| Never trust signal volume | All volumes are calculated from user settings, never from the signal |
| Parallel independence | All 12 orders execute independently — no cascading failures |
| Proportional compression | TP redistribution scales correctly for any TP count (1–6) |
| Earlier entries close first | Layer 1 locks to TP1, securing profit before deeper layers |
| Deeper entries run furthest | Layer 4 keeps original targets — best price deserves best reward |
| Graceful degradation | If volume is too small, orders are skipped rather than forced to minimum |
| Atomic state | Trade records are written in a single atomic transaction |
| Fault tolerance | Failed TP modifications are retried with exponential backoff |
Related Pages
- Order Execution Strategy — Overview of the 12-order structure
- TP Redistribution — Redistribution concepts and proportional scaling
- Risk Management — Position sizing and safety guards
- Breakeven Management — Automatic stop-loss adjustment
- Trading Settings — Configure strategies and risk parameters

