Multi-Target Take-Profit and Stop-Loss

Split one trading position across multiple take-profit and stop-loss levels, define the volume closed at each level, and understand platform behavior.

Last updated: 2026-10-08

A multi-target ladder lets you scale out of a position in steps instead of closing it all at once. Each take-profit level closes part of the position when price reaches it, and each stop-loss level does the same on the losing side. You can set up to ten levels on each side, and you define the whole ladder in the alert that opens the trade.

Write a ladder#

The shortest form puts every take-profit level into one tp_pips value. Each pips:percent pair closes that share of the original position, and a final number on its own closes whatever is left:

LICENSE,buy,EURUSD,size_lots=0.3,tp_pips=30:50;60:30;100,sl_pips=25

This closes 50% at 30 pips, 30% at 60 pips and the remaining 20% at 100 pips, while sl_pips=25 protects the whole position. The shorthand works in tp_pips and sl_pips only, and it always reads the numbers after each colon as percentages.

To close fixed volumes instead, or to set levels by price or percentage, write each level as its own parameter:

LICENSE,buy,EURUSD,size_lots=0.3,tp1_pips=30,tp1_lots=0.1,tp2_pips=60,tp2_lots=0.1,tp3_pips=100,tp3_lots=0.1,sl_pips=25

Each level takes one distance (tpN_pips, tpN_price or tpN_pct) and one close amount (tpN_close for a percentage or tpN_lots for a volume), and stop levels use slN_ in the same way. In JSON, you can send the levels as an array:

{
  "license": "LIC",
  "action": "buy",
  "symbol": "EURUSD",
  "size_lots": 0.3,
  "tp_targets": [
    {"pips": 30, "close_pct": 50},
    {"pips": 60, "close_pct": 30},
    {"pips": 100, "close_pct": 20}
  ],
  "sl_pips": 25
}

Number the levels from 1 without gaps, and pick one kind of close amount for each side. Percentages must add up to 100, while fixed lots can add up to less than the position, in which case the rest stays open with the broker's stop and target. A single tp_pips or sl_pips can't be combined with a ladder on the same side, but a single stop with a take-profit ladder, as in the examples above, works fine.

Don't put lots in the shorthand

tp_pips=30:0.1;60:0.1;100 doesn't close 0.1 lots at each level. The shorthand reads 0.1 as 0.1%, so almost the whole position would close at the last level. Use the per-level parameters or the JSON array for fixed lots.

Percentages or fixed lots#

With percentages, PineHook works out the lots for each level from the position size and rounds them to the broker's volume step. The last level takes whatever rounding leaves over, so the ladder always adds up to the full position. On instruments that trade in whole contracts, such as index futures, small percentages can round to zero, so PineHook lifts them to one contract where the position allows it. A level that still rounds to zero is skipped, and the EA logs a warning naming it.

With fixed lots, each level closes exactly the volume you set, rounded to the broker's volume step. The total is capped at the position size, so later levels close less, or nothing, once the position runs out. This is the more predictable choice for whole-contract instruments.

How the ladder runs#

The EA watches the price on every tick and closes the configured part of the position when a level is reached, then marks that level as done so it never fires twice. The broker also holds a stop and a target at your furthest levels as a safety net, in case the EA stops responding. That broker target is only set when the ladder covers the whole position, since a fixed-lot ladder that leaves a runner would otherwise close the runner too.

Price often reaches the broker's stop or target at the furthest level before the EA can act, in which case the broker closes everything left in one order. The result is the same, although the close is recorded with the broker as the reason.

The EA draws each level on the chart it runs on, green for take profits and red for stops, and removes a line when its level fires or the position closes. After a restart, it reloads the ladder from local storage and redraws the lines.

When the position changes#

On a netting account, a percentage ladder follows the position when it changes size. If you add to it, close part of it by hand, or it changed while the EA was offline, the EA spreads the levels that haven't fired yet across the new size and leaves the fired ones alone. Fixed-lot levels keep their exact volumes and are only capped to the new size.

A second entry with its own ladder on the same netting symbol replaces the first ladder, which then applies to the whole combined position. A netting account holds one position per symbol, so it can only carry one ladder. On a hedging account, each entry is a separate position with its own ladder, and the ladders run independently.

A ladder on a pending order starts when the order fills, using the actual fill price and volume. Until then, the order has no managed stop, which is expected.

Trailing stops, breakeven and modify#

When a trailing stop or breakeven takes over the stop, any stop-loss levels that haven't fired are released so the two can never close the same volume, while the take-profit levels keep running as normal. You can move a level that hasn't fired yet with modify, as described in Commands.

Before you rely on it#

  • Every level must clear the broker's minimum stop distance. If one is too close to the market, the EA refuses to open the trade, rather than open a position its broker can't protect. The message appears in the MetaTrader Experts tab, so check the symbol's minimum stop distance in MetaTrader and move the levels further out.
  • Levels must be on the correct side of the entry. A buy's take profits go above the entry and its stops below, and a sell is the reverse.
  • Losing local storage means losing the ladder. The EA keeps ladders on the terminal, so if that storage is gone after a restart, resend the ladder.
  • A ladder ends with its position. It doesn't carry over to the next trade, even on the same symbol.

Alert error messages lists every ladder-related message and how to fix it.