All indicators

Market Structure Trailing Stop

By LuxAlgoApr 17, 2023103 chart adds

Market Structure Trailing Stop is an indicator on Vela, our next-generation charting platform, written in Pine Script®.

Static chart image

The Market Structure Trailing Stop hands exit management to the market's own skeleton. Within the wider family of trailing methods, it is a structure-driven design: whenever a change of character (CHoCH) or, optionally, any break of structure (BOS) is detected from pivot-based swing points, the stop resets to the prior trend's high or low, then converges toward price at a pace you control. Structure lines can be drawn alongside, keeping the logic visible on the chart.

How to Trade the Market Structure Trailing Stop?

  • Ride trends on structure: in uptrends the stop rises by the Increment Factor % of each new trailing-maximum extension; downtrends mirror the logic on trailing minimums.
  • Secondary exits and S/R: if structure times your entries, the trailing level doubles as an exit trigger or a support/resistance reference.
  • Cut premature stop-outs: lower the Increment Factor % so the stop converges more slowly and gives volatile pullbacks room to breathe.
  • Read the lines: CHoCH lines are dashed and BOS lines dotted, so you always know which event reset the stop.

Market Structure Trailing Stop Settings

  • Pivot Lookback: length used to detect the swing points the structure (and therefore the stop) is built from.
  • Increment Factor %: convergence speed toward price; smaller values trail looser, larger values tighten faster.
  • Reset Stop On: reset on CHoCH only, or on both CHoCH and BOS occurrences.
  • Show Structures: toggles the market structure lines on the chart.

Frequently Asked Questions

Free to use

Run it on Vela. Go further with a paid plan.

  • Up to 500 Custom Alerts, with webhook automation
  • Up to 10× the chart history of Free
  • Orderflow lookback up to full history
  • More Quant usage to customize it, plus extra usage when you need it
  • Futures data alongside crypto, stocks, forex and commodities
See plans

Also works on

TradingView
NinjaTrader
MetaTrader 4/5
Original indicatorBuilt in-house by LuxAlgo

Run it on Vela. Make it yours with Quant.

Open this indicator free on Vela, our next-generation charting platform. Then ask Quant, our coding agent built into Vela, to retune it or turn it into a backtested strategy of your own.