Parabolic Stop And Reverse
systemic:core-psarIndicatorsfunction1 crInputs
| Name | Type | Description |
|---|---|---|
| Step | float | The starting value and increment for the Acceleration Factor. |
| Max Step | float | The maximum value the Acceleration Factor can reach. |
| Price High | floatarray | The highest price reached during each period (candle). |
| Price Low | floatarray | The lowest price reached during each period (candle). |
| Price Close | floatarray | The closing price for each period. |
Outputs
| Name | Type | Description |
|---|---|---|
| Down Indicator | floatarray | A binary flag indicating whether the current trend is down. |
| PSAR | floatarray | The primary SAR (Stop and Reverse) value — your dynamic trailing stop level. |
| Up | floatarray | The SAR value during uptrends only (0 during downtrends). |
| Down | floatarray | The 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
Downtrend SAR Calculation
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:
| Event | AF | SAR Behavior |
|---|---|---|
| Trend starts | 0.02 | SAR moves slowly, giving room |
| New high/low | 0.04 | SAR accelerates |
| Another new high/low | 0.06 | Faster still |
| ... | ... | ... |
| Maximum reached | 0.20 | Maximum 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"]
| Signal | Condition | Action |
|---|---|---|
| Buy | Price crosses above SAR (dots flip below) | Enter long / Exit short |
| Sell | Price crosses below SAR (dots flip above) | Enter short / Exit long |
The Outputs
This module produces four outputs:
| Output | Description |
|---|---|
| PSAR | The SAR value (trailing stop level) |
| Up | SAR value when in uptrend (0 otherwise) |
| Down | SAR value when in downtrend (0 otherwise) |
| Down Indicator | Binary: 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
nullon 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/Downread exactly 0 while the trend is on the other side —nullis the only "no value" signal. - Live execution returns exactly one datapoint per output — the newest bar's value, or
nullwhen that bar itself is missing or still in warm-up.
Parameter Tuning
| Parameter | Default | Purpose |
|---|---|---|
| Step | 0.02 | AF starting value and increment |
| Max Step | 0.20 | Maximum AF cap |
Effect of Parameters
| Setting | Effect |
|---|---|
| Higher Step | Faster acceleration, tighter stops, more signals |
| Lower Step | Slower acceleration, looser stops, fewer signals |
| Higher Max Step | Eventually very tight stops |
| Lower Max Step | Stops never get too aggressive |
Recommended Configurations
| Market Type | Step | Max Step |
|---|---|---|
| Strong trends | 0.025 | 0.25 |
| Normal markets | 0.02 | 0.20 |
| Choppy/Volatile | 0.01 | 0.10 |
| Crypto | 0.01 | 0.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):
| ADX | PSAR Signal | Recommendation |
|---|---|---|
| > 25 | Any | Take the signal — strong trend |
| < 25 | Any | Ignore — market is ranging |
Creative Applications
Trend-Phase Position Sizing
Use the AF as a proxy for trend maturity:
| AF Range | Interpretation | Position |
|---|---|---|
| 0.02–0.06 | Young trend | Full position |
| 0.08–0.12 | Mature trend | Reduce position |
| 0.14–0.20 | Extended trend | Minimum 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 PSAR | Daily PSAR | Action |
|---|---|---|
| Uptrend | Buy signal | Strong long entry |
| Uptrend | Sell signal | Ignore or reduce |
| Downtrend | Sell signal | Strong 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
| Aspect | Key Point |
|---|---|
| Core insight | Stops should tighten as trends mature |
| What it measures | Dynamic trailing stop with parabolic acceleration |
| SAR below price | Uptrend — SAR is support |
| SAR above price | Downtrend — SAR is resistance |
| Best for | Trailing stops, trend-following, exit management |
| Worst for | Ranging markets (use ADX filter) |
Further Reading
- Parabolic SAR - Investopedia
- Wilder, J.W. (1978). New Concepts in Technical Trading Systems
- Combining PSAR with ADX - Investopedia
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]
| Dimension | Stocks | Crypto | Notes |
|---|---|---|---|
| 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.