Set up position exits
Position exits close one position at a time: Take profit and Stop loss are set from the strip's Exits key, Max hold and Reinvest delay under a screener's Selection rules.
Steps
- Open the Exits key. On the strategy's Settings, select Exits in the strip — or + Exits, which adds them, when your strategy type leaves exits optional. The Position exits panel opens. In Step by step the same controls are the Exits page of Risk and exits, titled "When should positions be exited?".
- Switch on Take profit or Stop loss and set its level. Take profit closes a position once it has gained a target percentage; Stop loss closes it once it has lost one. Both are off by default; switched on, Take profit starts at 150% and Stop loss at −30%. A rule switched off is not evaluated.
- Check the footer. It names the level a position closes at, starting "Positions close at"; with no exit on it reads "No exit rules active — positions only close at the next rebalance."
- Set Max hold or Reinvest delay, if a screener picks the holdings. On the Asset selection card in Compose, with a screener under Qualify, switch on Max hold or Reinvest delay under Selection rules and enter a number of months: each starts at your rebalance interval and must be a whole multiple of it. On Screen, Max hold reads "Same as the rebalance" and is not edited.
- Save and run a new backtest — see Save, run and copy a strategy.
Done. The Exits key shows the active levels — Stop loss in the negative colour, Take profit in the positive one, for example "−20% / +50%", or only the side that is on; with both off it reads "none". In Step by step, the Position exits card's header counts the active exits, or reads "Not set up".
What are the limits and validation messages?
Every exit has a fixed range, and a value outside it turns that side's figure in the Exits key red until you correct it:
- Take profit — 5% to 1000%. Out of range: "Take profit must be between 5% and 1000%."
- Stop loss — −100% to −5%. Out of range: "Stop loss must be between −100% and −5%."
- Max hold and Reinvest delay — 1 to 120 whole months, each a multiple of your rebalance interval. Out of range: "Enter 1–120 months."; a decimal: "Enter a whole number."; not a multiple: "Must be a multiple of 3 months", where the figure is your own interval.
Any exit switched on with its field empty shows "Enter a value." under it.
What do Max hold and Reinvest delay do?
Max hold — "Sell a position after holding it this long" — closes a position once it has been held for the months you set. It acts at the strategy's scheduled rebalances only: a rebalance forced off schedule by a risk condition closes nothing for max hold. See max hold.
Reinvest delay — "Wait this long before re-entering an instrument after its position closes" — keeps an instrument out of the strategy's choices for the months you set after its position closes, so it cannot be bought straight back. It holds back the instrument, not the cash the close freed. See reinvest delay.
Both are off by default, and switching one on fills the field with your own rebalance interval — always a valid multiple. They need a screener choosing the holdings; with no screener under Qualify their controls stay unavailable.
How does the rebalance frequency pace exits?
It paces two of the four. Max hold and Reinvest delay count in whole rebalance periods, which is why each must be a multiple of your rebalance frequency: a strategy that rebalances every 3 months accepts a Max hold of 3, 6, 9 or 12 months, but not 4 or 5.
Take profit and Stop loss run on another clock. Each position's gain or loss is checked on that position's own price bars, measured from the price it was opened at, so either exit can close a position between two rebalances — on the bar that reached the threshold, not at the next rebalance. The price such a close books at: execution time.
What happens after a stop loss or take profit closes a position?
The position's slot stays in cash until the next rebalance: the exit is checked every day, but new positions are bought only at a rebalance. What the rebalance then buys depends on how the strategy chooses its instruments.
- No entry screener and no Reinvest delay — it buys the same instrument again. The Exits card says so with the grey note "After a stop the capital stays in cash".
- An entry screener, no Reinvest delay — if the title still passes the screener, it is bought again; the Exits card raises the strategy alert to review "After a stop the title can come straight back": "If at the next rebalance the title still passes the screener, the engine buys it again: set «Reinvest delay» to keep it out."
- A Reinvest delay — the title stays out until the delay has passed. The delay counts calendar months and is checked only at rebalances, so a delay equal to the rebalance interval can let a title stopped out in the month of the last rebalance back at the very next one; the alert "The wait after a stop is shorter than it looks" says so, and twice the interval always skips at least one rebalance — see how the wait is counted.
UPDATED 2026-10-07REVIEWED 2026-10-07