Systemicalpha

Parabolic Stop And Reverse

systemic:core-psarIndicatorsfunction1 cr

Inputs

NameTypeDescription
StepfloatThe starting value and increment for the Acceleration Factor.
Max StepfloatThe maximum value the Acceleration Factor can reach.
Price HighfloatarrayThe highest price reached during each period (candle).
Price LowfloatarrayThe lowest price reached during each period (candle).
Price ClosefloatarrayThe closing price for each period.

Outputs

NameTypeDescription
Down IndicatorfloatarrayA binary flag indicating whether the current trend is down.
PSARfloatarrayThe primary SAR (Stop and Reverse) value — your dynamic trailing stop level.
UpfloatarrayThe SAR value during uptrends only (0 during downtrends).
DownfloatarrayThe SAR value during downtrends only (0 during uptrends).

The Trailing Stop Problem

Every trader faces a dilemma: how do you protect profits without exiting too early?

Set your stop too tight, and you get shaken out by normal volatility. Set it too loose, and you give back too much profit when the trend finally ends. J. Welles Wilder (creator of RSI, ATR, and ADX) solved this with an elegant insight in 1978:

What if the stop automatically tightened as the trend matured?

Early in a trend, you need room to breathe — the move hasn't proven itself yet. But as the trend extends and you accumulate profits, your tolerance for giving them back should decrease. The stop should accelerate toward price, eventually catching up and signaling an exit.

This is the "parabolic" in Parabolic SAR — the stop follows a parabolic curve that gradually steepens, chasing price with increasing urgency.


How It Works

flowchart LR
    subgraph Uptrend["Uptrend Phase"]
        direction TB
        U1["Dots BELOW price"]
        U2["SAR rises toward price"]
    end
    
    subgraph Flip["Trend Reversal"]
        F["Price crosses SAR"]
    end
    
    subgraph Downtrend["Downtrend Phase"]
        direction TB
        D1["Dots ABOVE price"]
        D2["SAR falls toward price"]
    end
    
    Uptrend --> Flip --> Downtrend

The SAR value represents your trailing stop:

  • Dots below price → You're in an uptrend, SAR is your support/stop-loss
  • Dots above price → You're in a downtrend, SAR is your resistance/stop-loss
  • Price crosses SAR → Trend has reversed, flip your position

The Mathematics

Uptrend SAR Calculation

SARt+1=SARt+AF×(EP−SARt)\text{SAR}_{t+1} = \text{SAR}_t + AF \times (EP - \text{SAR}_t)

Downtrend SAR Calculation

SARt+1=SARt−AF×(SARt−EP)\text{SAR}_{t+1} = \text{SAR}_t - AF \times (\text{SAR}_t - EP)

Where:

  • SAR — Current Stop and Reverse point
  • AF — Acceleration Factor (starts at step, increases by step each new extreme, caps at max_step)
  • EP — Extreme Point (highest high in uptrend, lowest low in downtrend)

The Acceleration Factor: Why "Parabolic"?

The AF is the secret sauce. Each time price makes a new extreme (new high in uptrend, new low in downtrend), AF increases by the step value:

EventAFSAR Behavior
Trend starts0.02SAR moves slowly, giving room
New high/low0.04SAR accelerates
Another new high/low0.06Faster still
.........
Maximum reached0.20Maximum acceleration

This creates a parabolic curve — starting flat, then steepening dramatically. The longer the trend persists, the more aggressive the stop becomes. Eventually, SAR catches up to price and triggers a reversal signal.

The intuition: Profitable trends deserve tight stops. Young trends deserve loose stops. The AF encodes this wisdom mathematically.


Trading Signals

flowchart TD
    Price["Current Price"] --> Compare{"Price vs SAR"}
    
    Compare -->|"Price > SAR"| Uptrend["UPTREND<br/>SAR = Support"]
    Compare -->|"Price < SAR"| Downtrend["DOWNTREND<br/>SAR = Resistance"]
    
    Uptrend --> Cross1{"Price crosses<br/>below SAR?"}
    Cross1 -->|Yes| Sell["SELL Signal<br/>Dots flip above"]
    
    Downtrend --> Cross2{"Price crosses<br/>above SAR?"}
    Cross2 -->|Yes| Buy["BUY Signal<br/>Dots flip below"]
SignalConditionAction
BuyPrice crosses above SAR (dots flip below)Enter long / Exit short
SellPrice crosses below SAR (dots flip above)Enter short / Exit long

The Outputs

This module produces four outputs:

OutputDescription
PSARThe SAR value (trailing stop level)
UpSAR value when in uptrend (0 otherwise)
DownSAR value when in downtrend (0 otherwise)
Down IndicatorBinary: 1 if in downtrend, 0 if in uptrend

Missing Data

A closed-market or missing-data bar is skipped when advancing the SAR state machine — the state (trend, Extreme Point, Acceleration Factor) carries across the gap and resumes on the next observed bar, never resetting or fabricating a bar in between.

  • Gaps are bridged, not broken: a Friday-to-Monday transition is evaluated as adjacent bars; the closed weekend itself reports null on all four outputs, never a repeated or interpolated value.
  • A reversal that occurs during a gap surfaces one bar late: if the trend would have flipped over the weekend, the flip is only detected once trading resumes (the next observed bar) — a known, accepted lag, not a bug.
  • Warm-up (first 2 observed bars) is null on all four outputs, not an echoed close or a fabricated trend flag — there is no real SAR value until the state machine has enough history to establish a trend.
  • 0 means genuine opposite-trend, never missing: Up/Down read exactly 0 while the trend is on the other side — null is the only "no value" signal.
  • Live execution returns exactly one datapoint per output — the newest bar's value, or null when that bar itself is missing or still in warm-up.

Parameter Tuning

ParameterDefaultPurpose
Step0.02AF starting value and increment
Max Step0.20Maximum AF cap

Effect of Parameters

SettingEffect
Higher StepFaster acceleration, tighter stops, more signals
Lower StepSlower acceleration, looser stops, fewer signals
Higher Max StepEventually very tight stops
Lower Max StepStops never get too aggressive
Market TypeStepMax Step
Strong trends0.0250.25
Normal markets0.020.20
Choppy/Volatile0.010.10
Crypto0.010.10–0.15

When It Works, When It Struggles

Excels In:

  • Strong, directional trends — The classic use case
  • Trailing stop management — Automatic, systematic exit
  • Trend identification — Instant visual of current trend
  • Momentum continuation — Riding winners

Struggles In:

  • Ranging/sideways markets — Whipsaws repeatedly as price oscillates
  • Gap environments — Gaps can trigger false reversals
  • Choppy trends — Frequent small reversals generate excessive signals

The ADX Filter

Wilder himself recommended combining PSAR with ADX (which he also invented):

ADXPSAR SignalRecommendation
> 25AnyTake the signal — strong trend
< 25AnyIgnore — market is ranging

Creative Applications

Trend-Phase Position Sizing

Use the AF as a proxy for trend maturity:

AF RangeInterpretationPosition
0.02–0.06Young trendFull position
0.08–0.12Mature trendReduce position
0.14–0.20Extended trendMinimum position

As AF approaches the max, the trend is "old" and more likely to reverse.

Multi-Timeframe Trend Alignment

Check PSAR on higher timeframes to establish bias:

Weekly PSARDaily PSARAction
UptrendBuy signalStrong long entry
UptrendSell signalIgnore or reduce
DowntrendSell signalStrong short entry

Volatility-Adjusted Parameters

Adjust Step based on ATR:

  • High ATR → Lower Step (wider stops for volatile markets)
  • Low ATR → Higher Step (tighter stops for calm markets)

Summary

AspectKey Point
Core insightStops should tighten as trends mature
What it measuresDynamic trailing stop with parabolic acceleration
SAR below priceUptrend — SAR is support
SAR above priceDowntrend — SAR is resistance
Best forTrailing stops, trend-following, exit management
Worst forRanging markets (use ADX filter)

Further Reading


Indicator Assessment

%%{init: {"quadrantChart": {"titleFontSize": 14}, "themeVariables": {"quadrant1Fill": "#e8f5e9", "quadrant2Fill": "#fff3e0", "quadrant3Fill": "#ffebee", "quadrant4Fill": "#e3f2fd"}}}%%
quadrantChart
    title Parabolic SAR Assessment
    x-axis Low Popularity --> High Popularity
    y-axis Low Reliability --> High Reliability
    quadrant-1 High potential  
    quadrant-2 Established
    quadrant-3 Niche
    quadrant-4 Widely used
    Stocks: [0.70, 0.65]
    Crypto: [0.55, 0.45]
DimensionStocksCryptoNotes
Popularity●●●●○●●●○○Classic Wilder indicator, widely available
Reliability●●●◐○●●◐○○Excellent in trends, poor in ranges
Complexity●●●○○●●●○○AF acceleration logic requires understanding
Versatility●●●○○●●○○○Primarily trailing stop; struggles in choppy crypto markets
Recent Interest●●●○○●●◐○○Stable classic; crypto interest lower due to volatility

Why lower crypto reliability: PSAR generates many whipsaws in crypto's frequent consolidation phases. The ADX filter is especially important when using PSAR for digital assets.

Rendering diagrams...
© 2026 WanoLabs. All rights reservedAlpha build v0.1.5