All indicators

Half-Retracement Reversal Detector

By LuxAlgoJun 20, 2026

Half-Retracement Reversal Detector is an indicator on Vela, our next-generation charting platform, written in Pine Script®.

Static chart image

Half-Retracement Reversal Detector finds the harmonic structure known as the 5-0®, whose reversal zone sits at a 0.50 retracement of its last leg. Confirmed swings assemble the 0-X-A-B-C sequence: an initial swing into X, an AB leg reaching 1.13–1.618 of XA beyond X, a BC leg stretching 1.618–2.24 of AB, then a D zone projected at BC's 0.50 retracement, the number the pattern is named for. Each structure draws its legs, points and ratios, and boxes the D zone.

How to Trade with the Half-Retracement Reversal Detector?

  • Completion: price trading into the D zone completes the pattern, the risk-defined entry area.
  • Reaction: a close back in the BC direction while the zone holds, the confirmation read.
  • Invalidation / target: a decisive close through the Invalidation Retracement voids the setup; the dotted line at the C extreme marks the objective.

Completions inside the pivot confirmation lag are back-filled; a projection is dropped as stale once price runs beyond C without touching the zone. Like the rest of the harmonics family, it is a reversion structure: trade the measured zone, not a prediction.

Half-Retracement Reversal Detector Settings

  • Swing Length (default 8): pivot length for the swings forming 0 through C; larger finds larger, rarer structures.
  • AB / XA Range (default 1.13 to 1.618): AB's allowed extension of XA; AB must travel beyond X.
  • BC / AB Range (default 1.618 to 2.24): BC's allowed extension of AB.
  • Invalidation Retracement (default 0.618): the BC retracement whose decisive close invalidates the D zone.
  • Reciprocal AB=CD Check (default on) with Reciprocal Tolerance % (default 15): requires the projected CD leg to roughly equal AB.
  • Require C Beyond Point 0 (default off): demands BC break the pattern origin before the zone is trusted.
  • Display toggles: Point Labels, Ratio Labels, Target Line and Show Swings (all on by default).

Frequently Asked Questions

Bat®, Crab®, Shark®, AB=CD® and 5-0® are registered trademarks of their owner, used here only to identify the patterns. LuxAlgo's tools are independent implementations and are not affiliated with or endorsed by the trademark owner.

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
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.