Indicators/probuilder · probacktest · proorder · proscreener

SAR

SAR in ProBuilder returns the Parabolic Stop And Reverse indicator, a trailing dot that flips sides when price crosses it. Syntax, parameters, examples.

Syntax

probuilder
SAR[Af, St, Lim]

Parameters

NameTypeDefaultDescription
Afdecimal0.02Initial acceleration factor applied when a new trend starts.
Stdecimal0.02Step added to the acceleration factor each time price makes a new extreme in the trend direction.
Limdecimal0.2Upper cap on the acceleration factor.

Formula

code
SAR(next) = SAR(current) + AF * (EP - SAR(current))

EP (extreme point) is the highest high recorded during the current uptrend, or the lowest low during the current downtrend. AF starts at Af, increases by St each bar that sets a new extreme, and never exceeds Lim. When price touches the SAR level, the indicator reverses: it restarts on the opposite side of price at the previous extreme point, with AF reset to Af.

How it works

The SAR behaves like an automatic trailing stop. While a trend runs, the level chases price at an accelerating pace: every new extreme increments the acceleration factor, pulling the SAR closer to price and producing the characteristic parabolic curve of dots. The longer and cleaner the trend, the tighter the trail.

The indicator is always on exactly one side of price. Dots below the bars mean the calculation is in its uptrend state; dots above mean downtrend state. There is no neutral condition, so a cross of price through the SAR level is simultaneously an exit for the old direction and the start of the opposite state, hence "stop and reverse".

The three parameters control sensitivity. Raising St or Lim makes the trail tighten faster, catching reversals earlier but flipping more often. Lowering them gives trends more room at the cost of later exits. The defaults of 0.02, 0.02 and 0.2 come from Wilder's original specification.

Examples

Example 1, Bullish crossover signal (Indicator)

probuilder
// Signal is 1 on the bar where the close crosses above the SAR level
i1 = SAR[0.02,0.02,0.2]
if (close[1] < i1[1] AND close > i1) THEN
  signal = 1
ELSE
  signal = 0
ENDIF
RETURN signal

Preserved from the source page. The signal fires only on the transition bar: the previous close was below the previous SAR and the current close is above the current SAR, marking a flip to the uptrend state.

Example 2, Always-in stop and reverse system (ProOrder)

probuilder
// Reverse position each time price crosses the parabolic SAR
DEFPARAM CumulateOrders = false
psar = SAR[0.02,0.02,0.2]

IF close CROSSES OVER psar THEN
  BUY 1 CONTRACT AT MARKET
ELSIF close CROSSES UNDER psar THEN
  SELLSHORT 1 CONTRACT AT MARKET
ENDIF

The strategy is always in the market, long above the SAR and short below it, which is the indicator's original intended use. Expect frequent reversals whenever the instrument stops trending.

Example 3, Fresh bullish SAR flips (ProScreener)

probuilder
// Instruments whose close crossed above the SAR level this bar
psar = SAR[0.02,0.02,0.2]
bullFlip = close CROSSES OVER psar
SCREENER[bullFlip]((close - psar) AS "Dist to SAR")

Returns instruments that flipped to the uptrend state on the current bar, sorted by how far price already sits above the new SAR level.

Interpretation

StatePosition of dotsReading
UptrendBelow priceThe SAR acts as a rising trailing stop. Distance to price shrinks as the trend matures.
DowntrendAbove priceThe SAR acts as a falling trailing stop.
FlipSide changesPrice crossed the level; the prior trend is stopped and the opposite state begins.

SAR is a trend-following tool. In sustained moves it provides a mechanical, progressively tightening exit level. In sideways markets it flips repeatedly, and each flip is a losing round trip for a stop-and-reverse system, which is why it is commonly paired with a trend-strength filter such as ADX.

Common errors and gotchas

  • Square brackets, three decimals. SAR(0.02,0.02,0.2) raises a syntax error, and the instruction takes no price argument. All three parameters go in square brackets: SAR[0.02,0.02,0.2].
  • Whipsaw in ranges. The indicator has no flat state, so a ranging market generates a stream of alternating flips. Filter signals with a trend measure before acting on them.
  • Parameter sensitivity. Small changes to St and Lim materially change flip frequency. Settings tuned on one instrument or timeframe rarely transfer; re-examine them per market.
  • Intrabar touches. The reversal is defined by price reaching the SAR level, but bar-close logic such as close CROSSES OVER psar triggers only at the close. A high or low may pierce the level without the close confirming, so signal timing differs from the plotted dots.
  • SARatdmf, smoothed SAR variant with acceleration driven by directional movement.
  • Supertrend, an ATR-based trailing level with similar flip behaviour.
  • AverageTrueRange, volatility measure often used for alternative trailing stops.
  • ADX, trend-strength filter commonly paired with SAR signals.
  • DIplus, positive directional indicator for confirming direction.
  • DIminus, negative directional indicator for confirming direction.
  • ChandeKrollStopUp, volatility-based long stop level.
  • ChandeKrollStopDown, volatility-based short stop level.