Trend
Supertrend Buy Sell Signals: Direction Signs and Confirmed Flips
Read Supertrend direction correctly: negative is bullish, positive is bearish. Includes confirmed flip alerts, ATR input limits and Pine Script v6 code.
Supertrend Signal Interpretation
Quick-reference guide to 4 signal types you will see on the chart.
| Signal Type | Indicator Condition | Market Meaning | Interpretation limits |
|---|---|---|---|
| Bullish flip | The ta.supertrend direction crosses below zero on a confirmed bar. | The built-in direction changes from positive (bearish) to negative (bullish). | A bullish model state does not prove that a market downtrend has ended. |
| Bearish flip | The direction crosses above zero on a confirmed bar. | The built-in direction changes from negative (bullish) to positive (bearish). | A later bar can reverse the state again. |
| Bullish state | Direction is negative; the green lower Supertrend line is active. | Shows the retained lower band used by the trend calculation. | The line is a reference level. This indicator does not submit a stop order. |
| Bearish state | Direction is positive; the red upper Supertrend line is active. | Shows the retained upper band used by the trend calculation. | The distance from close to the active line is not necessarily ATR times the multiplier. |
Supertrend 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("Supertrend Confirmed Flip Signals", overlay=true)
atrPeriod = input.int(10, "ATR Period", minval=1)
factor = input.float(3.0, "ATR Multiplier", minval=0.1, step=0.1)
[supertrend, direction] = ta.supertrend(factor, atrPeriod)
// TradingView uses negative direction for the bullish state.
bullRaw = ta.crossunder(direction, 0)
bearRaw = ta.crossover(direction, 0)
ready = barstate.isconfirmed and not na(supertrend[1])
bullFlip = ready and bullRaw
bearFlip = ready and bearRaw
plot(direction < 0 ? supertrend : na, "Bullish Lower Line", color.green, 2, plot.style_linebr)
plot(direction > 0 ? supertrend : na, "Bearish Upper Line", color.red, 2, plot.style_linebr)
plotshape(bullFlip, "Bullish Flip", shape.triangleup, location.belowbar, color.green, text="BULL")
plotshape(bearFlip, "Bearish Flip", shape.triangledown, location.abovebar, color.red, text="BEAR")
alertcondition(bullFlip, "Supertrend Bullish Flip", "Confirmed Supertrend direction changed from positive to negative")
alertcondition(bearFlip, "Supertrend Bearish Flip", "Confirmed Supertrend direction changed from negative to positive")Example settings for Supertrend
Record the inputs used by the example. These settings are not an optimized trading recommendation.
| Parameter | Default | Description |
|---|---|---|
| ATR Period | 10 | Bars used by the built-in ATR calculation. It measures true range with Wilder smoothing, including gaps relative to the previous close. |
| ATR Multiplier | 3.0 | Scales ATR around the high-low midpoint to form basic bands. The final bands also retain previous values under the Supertrend rules; this is not a fixed stop distance from the close. |
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
Supertrend Signals FAQ
Which direction value means a Supertrend buy signal?
For ta.supertrend, negative direction is bullish and positive direction is bearish. A bullish flip therefore uses ta.crossunder(direction, 0); a bearish flip uses ta.crossover(direction, 0). For hypothetical direction values of +1 then -1, this code plots BULL at the second bar close, assuming the previous Supertrend value is available.
How are the Supertrend bands calculated?
The starting bands are the high-low midpoint plus or minus the multiplier times ATR. The algorithm then carries forward qualifying previous upper and lower bands, and chooses the active band according to its prior direction and price crossing rules. The example calls ta.supertrend rather than approximating it with two fresh ATR bands.
Is ATR times the multiplier my exact stop distance?
No. If hypothetical ATR is 2 and the multiplier is 3, the basic offset is 6 from the high-low midpoint. The active line may retain an earlier band, and the close can be elsewhere. An actual stop would need a price, position size and execution rule; gaps and slippage can make the fill differ from that price.
Does Supertrend repaint while the bar is open?
The developing bar can change ATR, the line and the direction. This code waits for the bar close before marking or alerting on a flip. Its line plot still reflects developing values on the open bar. Historical data revisions and input changes can also change results. The example makes no higher-timeframe requests.
Does the script include line rejection or multi-timeframe alignment?
No. It displays two states and detects two direction changes on the chart timeframe. A wick-touch rejection needs a precise touch and recovery rule. Multi-timeframe alignment needs explicit requested periods and a decision about using developing or completed higher-timeframe bars. Neither is represented by these alerts.
Which settings avoid false flips?
No ATR length or multiplier eliminates reversals after a signal. The defaults illustrate the calculation and have no verified win-rate claim. Adding a trend or volatility filter changes the rule set and may omit both losing and winning opportunities. Evaluate complete entries and exits with costs before comparing performance.
Is entering at the next open an additional bar of confirmation?
No. An entry at the next bar open does not wait for that next bar to close. Requiring a second confirmed bar is a separate delay that must be coded and tested. This example detects the flip at its own bar close and does not schedule entries.