Skip to content
StatePath
Tool Atlasmarket.parabolic_sar

Tool

Parabolic SAR

market.parabolic_sar

MarketTrend

Inputs

No typed inputs.

Outputs

Bundle (untagged)

A bundle: sar (the stop-and-reverse level for the bar) and direction (+1 up, -1 down).

Parabolic SAR (Stop And Reverse) trails a dotted stop level that accelerates toward price the longer a trend runs. When price touches the dots, the trend is declared over and the dots flip to the other side.

Parabolic SAR overview diagram

How it works

In an uptrend the SAR sits below price and each bar moves up by an acceleration factor times the distance to the extreme point (the highest high of the trend so far). Every new extreme raises the factor by step, up to max_step, so the stop tightens as the trend matures. It may never enter the prior two bars' range; a touch flips the trend, and the process restarts mirrored on the other side.

Configuration

stepscalar

How much the acceleration factor grows on each new extreme (Wilder 0.02). Bigger = the stop hugs price sooner.

max_stepscalar

The acceleration cap (Wilder 0.2). Limits how aggressively the stop can converge on price.

Connects to

Feeds into

Examples

  • Trailing exit: wire sar (via math.last) into an ORDER_EXIT stop-loss that tightens as the trend ages.
  • Direction gate: combine direction with a trend filter so entries only fire with the SAR side.

Common mistakes

  • SAR assumes a trend is always in progress - in ranges it whipsaws; gate it with a regime filter.
  • Raising step makes it exit sooner but also get shaken out by normal pullbacks; tune step and max_step together.

See also