Trend
Parabolic SAR Buy Sell Signals - TradingView Guide
Check Parabolic SAR close-side flips, optional EMA filtering and repeated reversals. Read a closed-bar Pine Script example with 0.02/0.02/0.20 inputs.
Parabolic SAR Signal Interpretation
Quick-reference guide to 5 signal types you will see on the chart.
| Signal Type | Indicator Condition | Market Meaning | Interpretation limits |
|---|---|---|---|
| Close crosses above SAR | Previous close <= previous SAR; current close > current SAR, with both SAR values available. | The closed-bar price/SAR relationship changed upward. | Not a guaranteed entry or stop fill. |
| Close crosses below SAR | Previous close >= previous SAR; current close < current SAR. | The closed-bar relationship changed downward. | An intrabar reversal can be missed by a close-only event rule. |
| Filtered upward flip | Upward crossing, plus close above the configured EMA when the filter is enabled. | Adds a separate price-position condition. | No measured whipsaw reduction is claimed. |
| Filtered downward flip | Downward crossing, plus close below the configured EMA when enabled. | The two conditions agree at bar close. | Does not establish trend strength. |
| Repeated-flip flag | A new close-side crossing occurs within three bars of the preceding crossing. | Recent signals changed direction close together. | Descriptive count, not proof of losses or a range. |
Parabolic SAR Pine Script Signal Code
Educational indicator example. Review its exact rules and compare its plots with your intended calculation in TradingView. It does not place orders or establish profitability.
Pine Script v6
//@version=6
indicator("Parabolic SAR Close-Side Flips", overlay=true)
start = input.float(0.02, "Start Factor", minval=0.001)
increment = input.float(0.02, "Increment", minval=0.001)
maximum = input.float(0.20, "Maximum Factor", minval=0.001)
useEmaFilter = input.bool(true, "Use EMA Filter")
emaLength = input.int(50, "EMA Length", minval=1)
if start > maximum
runtime.error("Start Factor must not exceed Maximum Factor")
sar = ta.sar(start, increment, maximum)
emaValue = ta.ema(close, emaLength)
crossUpRaw = ta.crossover(close, sar)
crossDownRaw = ta.crossunder(close, sar)
ready = not na(sar) and not na(sar[1])
flipUp = barstate.isconfirmed and ready and crossUpRaw
flipDown = barstate.isconfirmed and ready and crossDownRaw
filteredUp = flipUp and (not useEmaFilter or close > emaValue)
filteredDown = flipDown and (not useEmaFilter or close < emaValue)
anyFlip = flipUp or flipDown
barsFromPriorFlip = ta.barssince(anyFlip[1]) + 1
repeatedFlip = anyFlip and not na(barsFromPriorFlip) and barsFromPriorFlip <= 3
plot(sar, "SAR", color=close > sar ? color.green : color.red, style=plot.style_cross)
plot(useEmaFilter ? emaValue : na, "Filter EMA", color=color.blue)
plotshape(filteredUp, "Filtered up flip", shape.triangleup, location.belowbar, color=color.green, size=size.tiny)
plotshape(filteredDown, "Filtered down flip", shape.triangledown, location.abovebar, color=color.red, size=size.tiny)
plotshape(repeatedFlip, "Repeated flip", shape.circle, location.abovebar, color=color.orange, size=size.tiny)
alertcondition(flipUp, "Raw SAR up flip", "Close crossed above SAR at bar close")
alertcondition(flipDown, "Raw SAR down flip", "Close crossed below SAR at bar close")
alertcondition(filteredUp, "Filtered SAR up flip", "Up flip passed the configured EMA filter; disabled filter passes every up flip")
alertcondition(filteredDown, "Filtered SAR down flip", "Down flip passed the configured EMA filter; disabled filter passes every down flip")
alertcondition(repeatedFlip, "Repeated SAR flip", "A new close-side crossing occurred within three bars of the prior crossing")Example settings for Parabolic SAR
Record the inputs used by the example. These settings are not an optimized trading recommendation.
| Parameter | Default | Description |
|---|---|---|
| Start Factor | 0.02 | Initial acceleration factor. It must not exceed the maximum in this example. |
| Increment | 0.02 | Added when a new trend extreme is established, up to the maximum; it is not added merely because another bar elapsed. |
| Maximum Factor | 0.20 | Caps acceleration. Reaching this cap does not itself identify exhaustion, and ta.sar does not expose its internal factor here. |
| Use EMA Filter | true | Affects filtered markers and filtered alerts. Raw flip alerts remain available independently. |
| EMA Length | 50 | Length of the separate price-position filter. Its value is an example, not a tested optimum. |
Turn the condition into an explicit rule
Specify the calculation, confirmation time, entry and exit rules before asking Pineify to draft or revise Pine Script. Review the code and simulate realistic costs before evaluating a strategy.
Explore Pine Script codingRelated Resources
Official calculation and usage references
FAQ
Parabolic SAR Signals FAQ
What exactly triggers the example signals?
The script compares close with SAR on two consecutive bars and waits for the current bar to close. It requires a valid previous SAR so initialization alone does not create a flip. This event rule should be distinguished from the internal high/low-based reversal logic used to calculate SAR.
How does the acceleration factor change?
SAR advances using the prior SAR, extreme point and acceleration factor, with reversal and prior-range constraints. Acceleration increases when the trend establishes a new extreme and is capped by the maximum. It does not increase on every bar, and the cap is not a separate buy or sell condition.
Can I use the dot as a guaranteed stop price?
No. The plotted level is a calculation, not an executed order. A stop strategy must specify when the level becomes known, when the order is placed and how gaps, slippage and commissions are handled. A market can trade through the level without filling at that exact price.
Does the EMA filter remove false signals?
It rejects up flips below the EMA and down flips above it when enabled. That changes the sample but does not establish improved returns or fewer losses. Test the same entry and exit rules with and without the filter on separate data; raw alerts and filtered alerts are intentionally different.
How is a repeated flip counted?
If a prior crossing occurred at bar 100 and another at bar 103, the distance is three bars and the flag is true. At bar 104 it would be false unless a newer crossing intervened. This hypothetical count says nothing about whether a trade was entered or profitable.
Which timeframe and settings are best?
No universal optimum or backtest is provided. Match start, increment, maximum, chart type and available history before comparing plots. Evaluate an explicitly defined strategy with realistic costs and a held-out period, especially where repeated reversals occur.
How should I configure TradingView alerts?
Choose either a raw or filtered condition and use Once Per Bar Close. Disable the EMA filter only if all close-side flips are intended to pass. Existing alerts keep saved scripts and inputs, so recreate them after relevant changes. The example is an indicator and submits no orders.