Appearance
Are you an LLM? You can read better optimized documentation at /core-concepts/tp-redistribution.md for this page in Markdown format
Dynamic TP Redistribution
The Layered Entry Strategy gets you better average prices through retracement, but it creates a new challenge: when multiple layers fill, your exposure increases significantly. Should you still wait for the original TP5 or TP6?
TP Redistribution solves this by automatically compressing your TP targets when deeper layers fill. Earlier entries close sooner to secure profits, while deeper entries keep their original targets as "runners."
Why Redistribute?
Consider the difference between these two situations:
| Scenario | Filled Volume | Exposure | Risk Level |
|---|---|---|---|
| Only Layer 1 fills | 30% | Low | Original TP targets are fine |
| All 4 layers fill | 100% | Maximum | Price retraced significantly -- compress targets |
When only Layer 1 fills, the trade moved in your favor immediately. Waiting for TP5 or TP6 is reasonable -- you have limited exposure and the trade is already profitable.
When all 4 layers fill, the situation is different. You have maximum exposure, maximum drawdown, and price retraced significantly before bouncing. Waiting for the original far-out TPs is risky. Redistribution compresses the targets so that earlier layers close sooner, reducing risk while letting deeper layers aim for the original targets.
How Compression Works
The redistribution engine uses proportional compression to calculate new TP assignments. The formula uses a compression factor that ranges from 0 (fully compressed to TP1) to 1 (keep original TP).
The Formula
compressionFactor = (layerNumber - 1) / (filledLayers - 1)
newTP = max(1, round(1 + (originalTP - 1) x compressionFactor))How to read the compression factor:
| compressionFactor | Meaning |
|---|---|
| 0 | Fully compressed -- move to TP1 (safety net) |
| 0.33 | Strong compression -- shift most of the way toward TP1 |
| 0.5 | Moderate compression -- shift halfway toward TP1 |
| 0.67 | Light compression -- small shift toward TP1 |
| 1.0 | No compression -- keep original TP target |
Core 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 Keeps Originals: The most recently filled (deepest) layer always keeps its original TP targets (compression factor = 1.0). Deeper entries got better prices and have the most favorable risk/reward to remain open.
Middle Layers Compress Proportionally: Layers between L1 and the deepest layer are compressed proportionally -- closer to L1 means more compression.
Compression Factor Table
| Layer | 2 Layers Filled | 3 Layers Filled | 4 Layers Filled |
|---|---|---|---|
| Layer 1 | 0 (locked to TP1) | 0 (locked to TP1) | 0 (locked to TP1) |
| Layer 2 | 1.0 (original) | 0.50 | 0.33 |
| Layer 3 | -- | 1.0 (original) | 0.67 |
| Layer 4 | -- | -- | 1.0 (original) |
Scenario Walkthroughs
The following examples use a 6-TP Progressive setup to demonstrate how redistribution works at each exposure level.
Scenario 1: Only Layer 1 Fills (30% Exposure)
Price moved in the trade direction immediately. No retracement occurred.
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 | cf | New TP | Change |
|---|---|---|---|---|
| L1a | TP1 | 0 | TP1 | Locked |
| L1b | TP2 | 0 | TP1 | Locked |
| L1c | TP3 | 0 | TP1 | Locked |
| L2a | TP2 | 1.0 | TP2 | -- |
| L2b | TP3 | 1.0 | TP3 | -- |
| L2c | TP4 | 1.0 | TP4 | -- |
Result: Layer 1 locks to TP1 (secure profit quickly). Layer 2 keeps original targets because it is the deepest active layer.
Scenario 3: Layers 1 + 2 + 3 Fill (70% Exposure)
Moderate retracement. Significant exposure across three layers.
| Order | Original TP | cf | Calculation | New TP |
|---|---|---|---|---|
| L1a | TP1 | 0 | Locked | TP1 |
| L1b | TP2 | 0 | Locked | TP1 |
| L1c | TP3 | 0 | Locked | TP1 |
| L2a | TP2 | 0.50 | 1 + (2-1) x 0.50 = 1.5 -> round = 2 | TP2 |
| L2b | TP3 | 0.50 | 1 + (3-1) x 0.50 = 2.0 -> round = 2 | TP2 |
| L2c | TP4 | 0.50 | 1 + (4-1) x 0.50 = 2.5 -> round = 3 | TP3 |
| L3a | TP4 | 1.0 | Original | TP4 |
| L3b | TP5 | 1.0 | Original | TP5 |
| L3c | TP6 | 1.0 | Original | TP6 |
Result: Layer 1 fully locked to TP1. Layer 2 partially compressed (one step closer to TP1). Layer 3 keeps originals as the deepest active layer.
Scenario 4: All 4 Layers Fill (100% Exposure)
Deep retracement. Full position filled. Priority shifts to recovery and profit-securing.
| Order | Original TP | cf | Calculation | New TP |
|---|---|---|---|---|
| L1a | TP1 | 0 | Locked | TP1 |
| L1b | TP2 | 0 | Locked | TP1 |
| L1c | TP3 | 0 | Locked | TP1 |
| L2a | TP2 | 0.33 | 1 + (2-1) x 0.33 = 1.33 -> round = 1 | TP1 |
| L2b | TP3 | 0.33 | 1 + (3-1) x 0.33 = 1.67 -> round = 2 | TP2 |
| L2c | TP4 | 0.33 | 1 + (4-1) x 0.33 = 2.0 -> round = 2 | TP2 |
| L3a | TP4 | 0.67 | 1 + (4-1) x 0.67 = 3.0 -> round = 3 | TP3 |
| L3b | TP5 | 0.67 | 1 + (5-1) x 0.67 = 3.67 -> round = 4 | TP4 |
| L3c | TP6 | 0.67 | 1 + (6-1) x 0.67 = 4.33 -> round = 4 | TP4 |
| L4a | TP5 | 1.0 | Original | TP5 |
| L4b | TP6 | 1.0 | Original | TP6 |
| L4c | TP1 | 1.0 | Original | 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.
Liquidation Order
A natural consequence of the compression 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.
Trigger Conditions
Redistribution runs when any of these events occur:
| Trigger | When | Behavior |
|---|---|---|
| Layer Fill | A new limit order fills | Full adaptive compression based on newly filled layer count |
| TP Count Change | A followup signal changes the number of TP levels | Re-runs allocation with updated TP count, then compresses |
| Timeout | Execution timeout expires | Initial redistribution based on whatever layers are filled |
| All Layers Filled | All layers confirm filled | Full compression with maximum layer count |
| Followup Signal | Signal provider updates TP prices | Price-only mode -- updates TP prices without changing assignments |
| Manual (Admin) | Admin action | Full compression |
TP Strategy Impact on Redistribution
The selected TP Strategy affects how dramatically redistribution changes the trade profile:
| Strategy | Redistribution Effect |
|---|---|
| Progressive | Most orders are already assigned to early TPs (TP1-TP2). Compression is moderate -- the trade is already front-loaded. |
| Balanced | Even compression across all TP levels. Redistribution shifts the distribution from balanced to front-loaded. |
| Extended | Most dramatic effect. Back-loaded orders (TP5-TP6) shift significantly forward. Redistribution fundamentally changes the trade profile from trend-chasing to profit-securing. |
Proportional Scaling for Missing TPs
When a followup signal provides fewer TP levels than your trade requires (e.g., the signal sends TP1-TP3 but you have orders targeting TP4-TP6), the system extrapolates the missing levels:
- Calculate the average step between provided TPs.
- Extend the pattern to fill missing levels.
Example
Signal provides: TP1 = 4588, TP2 = 4590, TP3 = 4592
Average step = (4592 - 4588) / 2 = 2
Extrapolated:
- TP4 = 4592 + (2 x 1) = 4594
- TP5 = 4592 + (2 x 2) = 4596
- TP6 = 4592 + (2 x 3) = 4598
WARNING
This assumes TP intervals are approximately linear. If the provider uses non-linear spacing, extrapolated values may not match their intent. When only one TP level is provided, the system uses a "fill forward" approach (copying the single value).
Safeguards
The redistribution system includes several protections against edge cases and failures:
Position-Count-Aware Skip
The system remembers how many positions were open during the last redistribution. If nothing has changed, it skips the redistribution to avoid unnecessary broker modifications.
TP-Match Skip
If a position already has the correct TP target, TTMT skips the modification -- no unnecessary broker requests.
Failure Threshold
If too many modifications fail during a redistribution cycle, the system stops and retries the entire batch automatically.
Reliability by Layer
Layer 4 gets extra retry attention since it holds the deepest positions. Layers 2 and 3 are retried briefly, then corrected automatically the next time a layer fills.
Race Condition Prevention
When multiple layers fill in rapid succession, When multiple layers fill at nearly the same time, TTMT processes them one at a time to ensure each redistribution uses the latest data. This prevents outdated adjustments.
Retry Service
If a modification fails, TTMT automatically retries it in the background with increasing wait times between attempts.
Related Pages
- Order Execution -- The 12-order layered entry system
- Order Management -- Complete technical reference with numerical examples
- Breakeven Management -- Auto-breakeven after TP hits
- Limit Order Conversion -- Converting limits to market on followup

