All indicators

Cypher

By LuxAlgoJul 23, 2026

Cypher is an indicator on Vela, our next-generation charting platform, written in Pine Script®.

Static chart image

Cypher is the first faithful implementation of the Cypher pattern in the Library, honoring the rule most versions get wrong: D is measured from the full XC swing, not from XA. A zigzag of confirmed swings supplies the X, A, B, and C points; when the B retracement and C extension both qualify, the legs are drawn with their measured ratios printed for audit, and the projected D level extends forward at the 0.786 retracement of XC with a dashed stop at X.

How to Trade the Cypher?

  • Completion touch: price trades into the D level. Wait for a response back toward C rather than entering blind.
  • Reaction close: a close back beyond D in the C direction is the build's confirmation that the level held.
  • Staged targets: dotted lines at the 0.382 and 0.618 retracements of the CD leg, with the C extreme as the final objective.
  • X stop: a decisive close beyond the X origin fades the drawings and ends the trade frame.

Projections that never complete are removed automatically once price runs beyond the C extreme without touching the level.

Cypher Settings

  • Swing Length (default 8): pivot length for the swing points; larger values find larger, rarer structures.
  • B / XA Retracement (defaults 0.382–0.618): accepted B range, the bounds rule sets disagree on most.
  • C / XA Extension (defaults 1.272–1.414): required push of C beyond the A extreme, measured from X.
  • D / XC Retracement (default 0.786): the completion level's defining ratio.
  • Target 1 (CD Retracement) (default 0.382) and Target 2 (CD Retracement) (default 0.618): the staged profit levels.
  • Display toggles: Point Labels, Ratio Labels, Target Lines, X Stop Line, and Show Swings (all default on), plus pattern colors.

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.