Parabolic SAR

A trailing stop level that follows the trend and flips side when price crosses it.

Wilder's parabolic stop-and-reverse. On the second candle the trend starts up when the close rose (SAR = the first low, extreme = high), else down. Each candle SAR += acceleration × (extreme − SAR); a candle crossing the SAR reverses the trend (SAR = the extreme, acceleration = start). A new extreme adds increment to the acceleration, up to max. The SAR never enters the previous two candles' range. Ready from the second candle.

Settings

SettingDefaultRangeWhat it does
start0.020.001 to 1Starting acceleration.
increment0.020.001 to 1Acceleration added per new extreme.
max0.20.001 to 1Maximum acceleration.

What it gives

OutputWhat it is
SARThe stop-and-reverse level, in price.
Direction+1 while the SAR is below the price (up trend), −1 above.

What it reads

It reads the whole candle (open, high, low, close and volume).

Warm-up

With its default settings, Parabolic SAR needs 100 closed candles before its first value. A backtest loads them before its start date, so the first trade can already use it.

Test it

Copy this sentence into the Algonney chat to backtest it:

Backtest a strategy on BTC that uses Parabolic SAR with its default settings