Trade management

Breakeven, partial closes, trailing stops and exits.

Management is written under the order it belongs to, as an indented block after the order line.

AlgoBarsX
when liquidity_grab.completed from 08:00 to 11:00 Europe/London:
buy risk: 1%, stop: liquidity_grab.sweep.low - 3 points, target: 2R + 5 pips, tag: "breakout":
breakeven at: 1R, offset: 2 pips
partial 30% at: 1.5R
partial 30% at: 2.5R
trail by: atr(14), after: 2R
exit after: 48 bars
exit when: crosses_below(close, ema(close, 20))
LineWhat it doesRule
breakevenMoves the stop to the entry price, plus an optional offset, once a level is reached.E13
partialCloses part of the original size at a level. Each partial fires once.E15
trailFollows the best price reached by a distance, after a level. It only ever tightens.E14
exitCloses after a number of bars, a length of time, or when a condition is true.E16

You can also manage trades from anywhere with a loop over trades.open(...), using close and modify. Example: Active Trade Manager.

Rules about a trade that is still open

An open trade knows how long it has been open and where it stands. trades.last() is the trade being held when there is one, bars_open counts its bars, and r is its result so far measured against its own risk.

AlgoBarsX
when close > open:
buy risk: 1%, stop: 50 pips, target: 4R
when trades.last().bars_open > 3:
close_all

Try this in the Terminal. AlgoBars is free: $0 a month, no card needed.

Create my free account