Supertrend is an ATR-based line that plots below price as a green support level in an uptrend and above price as a red resistance level in a downtrend — flipping automatically when price breaks through it, giving you clear entry and exit signals with a built-in stop level.
Section 1: Core Mechanics
Supertrend builds a dynamic band around price using ATR (Average True Range) — a volatility measure. When price is trending up, the lower band acts as a trailing stop/support. When price breaks below the lower band, Supertrend flips to the upper band and the signal turns bearish. The flip is immediate and clear — no ambiguity about trend direction.
Formula
Final Supertrend value (applying the flip logic):
Flip condition:
- If price closes below current Supertrend support → switch to resistance mode (bearish)
- If price closes above current Supertrend resistance → switch to support mode (bullish)
Where uses Wilder smoothing over the specified number of bars.
Inputs
- High, Low, Close for each bar
- ATR Period: Number of bars for ATR calculation. Default: 10.
- Multiplier: Scale factor for the ATR band width. Default: 3.0.
Parameters
| Parameter | Default | Range | Impact |
|---|---|---|---|
| ATR Period | 10 | 7–20 | Shorter = more volatile ATR bands, more flips |
| Multiplier | 3.0 | 1.5–5.0 | Lower = tighter band, more signals. Higher = wider band, fewer flips |
Output
Single line on the price chart. Green below price = uptrend / support. Red above price = downtrend / resistance. Color flip = signal.
Visual Behavior
- Long stretches of green below price = sustained uptrend
- Red line above price = downtrend, price capped below
- Flip from green to red on a bar = bearish signal
- Flip from red to green = bullish signal
- ATR expansion (volatile market) = wider bands, fewer flips; ATR contraction = tighter bands, more flips
Section 2: Interpretation & Signals
Primary Signals
| Event | Signal | Action |
|---|---|---|
| Green Supertrend flips to red | Bearish — downtrend starting | Close long, consider short |
| Red Supertrend flips to green | Bullish — uptrend starting | Close short, enter long |
| Price pulls back to green Supertrend | Trend continuation — support hold | Add to position or re-enter |
| Price fails to break red Supertrend | Downtrend intact | Hold short or wait |
Using Supertrend as a Trailing Stop
After entering a long position on a green flip, use the Supertrend value as a trailing stop. As price rises, the Supertrend line rises with it (because ATR re-calculates each bar). Your stop automatically moves up without manual adjustment.
Supertrend Flip — Bullish Signal and Trailing Stop
Multiplier Sensitivity
The multiplier is the most important parameter in Supertrend:
- Multiplier 1.5–2.0: Very tight bands — many flips, suitable for scalping
- Multiplier 2.5–3.5: Standard range — balances signal frequency with accuracy
- Multiplier 4.0–5.0: Wide bands — few signals, only the strongest trend changes
False Signals in Choppy Markets
Supertrend generates rapid flips — sometimes multiple per day — in sideways markets. ATR expands during chop but the bands still sit close enough to price that minor moves trigger flips.
Section 3: Pass vs. Live — Real-Time Reliability
The live-bar repaint is the most important feature to understand. While a bar is open, Supertrend calculates based on the current high, low, and close of the incomplete bar. As price moves within the bar, the ATR and band values update continuously. A flip visible on the live bar may disappear when price reverses before bar close.
Rule: Never enter or exit based on Supertrend until the bar closes. Set your alert condition on close (bar close), not on a tick or intrabar value.
Section 4: Practical Use Cases
Setup: Supertrend(10, 2.0) on 15m with ADX(14) filter Signal: Supertrend flips green on 15m closed bar, ADX > 20 Entry: Open of next bar after confirmed green flip Exit: Supertrend flips red on any bar close — automatic stop Key rule: Use multiplier 2.0 for scalping (tighter band), not the default 3.0
Setup: Supertrend(10, 3.0) on daily chart Signal: Daily close flips Supertrend from red to green, ADX(14) > 25 Entry: Next daily open after the flip — or same bar close if using end-of-day data Stop: Supertrend value itself — let it trail automatically Target: Hold while daily Supertrend stays green; exit on flip to red
Setup: Supertrend(10, 3.0) on weekly chart Signal: Weekly bar closes and Supertrend flips green Entry: Following Monday's open Stop: Weekly Supertrend level — update weekly Target: None fixed — trail with weekly Supertrend until flip
Real example: Nifty 50 daily throughout 2023 — Supertrend(10, 3.0) flipped green in early January 2023 near 17,800 and remained green throughout the year, with the trailing stop rising progressively. The system avoided all the noise, exiting automatically on the December 2023 consolidation without human judgment required.
Section 5: Pseudo Code
INPUT: high[], low[], close[], period=10, multiplier=3.0
PROCESS:
Step 1: Compute True Range for each bar i:
tr[i] = max(high[i]-low[i], abs(high[i]-close[i-1]), abs(low[i]-close[i-1]))
Step 2: Wilder-smooth TR to get ATR (same formula as ADX):
Seed: atr[period] = average(tr[1:period+1])
For i > period: atr[i] = (atr[i-1] * (period-1) + tr[i]) / period
Step 3: Compute basic bands for each bar i:
hl2[i] = (high[i] + low[i]) / 2
basic_upper[i] = hl2[i] + multiplier * atr[i]
basic_lower[i] = hl2[i] - multiplier * atr[i]
Step 4: Apply band continuation logic (bands only move against trend):
final_upper[i] = basic_upper[i] if basic_upper[i] < final_upper[i-1] \
or close[i-1] > final_upper[i-1] \
else final_upper[i-1]
final_lower[i] = basic_lower[i] if basic_lower[i] > final_lower[i-1] \
or close[i-1] < final_lower[i-1] \
else final_lower[i-1]
Step 5: Determine trend direction:
if close[i] > final_upper[i-1]: trend[i] = 1 # bullish
elif close[i] < final_lower[i-1]: trend[i] = -1 # bearish
else: trend[i] = trend[i-1] # unchanged
Step 6: Set Supertrend value:
supertrend[i] = final_lower[i] if trend[i] == 1 else final_upper[i]
OUTPUT: supertrend[], trend[] (trend: 1=bullish, -1=bearish)
EDGE CASES:
- Need at least period+1 bars before first valid output
- Seed trend direction from first comparison: default to 1 (bullish)
- If close equals supertrend exactly: maintain previous trend
Section 6: Parameters & Optimization
Standard Conventions
| Setting | Common Use | Notes |
|---|---|---|
| 10 / 3.0 | Daily equities and crypto — default | Most widely tested; good starting point |
| 7 / 2.0 | Intraday scalping | More flips, tighter stops |
| 14 / 3.5 | Swing trading | Fewer signals, wider stops |
| 20 / 4.0 | Position trading | Very few signals, major trend changes only |
Parameter Impact
| Change | Effect | When to Apply |
|---|---|---|
| Decrease ATR period | Faster ATR, tighter bands, more flips | High-volatility conditions |
| Increase ATR period | Slower ATR, wider bands, fewer flips | Low-volatility trends, weekly charts |
| Decrease multiplier | Bands tighter — price flips indicator easily | Scalping, fast-moving stocks |
| Increase multiplier | Bands wider — only major moves trigger flip | Long-term position trading |
How to find the optimal Supertrend parameters for a specific asset?
Plot Supertrend with (7, 2.0), (10, 3.0), and (14, 4.0) on 200 bars of the asset. Count flips for each setting. An optimal parameter set produces 5-10 flips per 100 bars on the daily chart — enough to capture major moves without excessive trading. If you see 30+ flips per 100 bars, increase the multiplier. If you see fewer than 3 flips per 100 bars, the multiplier is too wide.
Why does Supertrend sometimes repaint in my backtest?
This happens when your backtesting platform calculates Supertrend on the live bar and records the intrabar value when the bar later closes differently. True Supertrend only locks on bar close. Use platforms that calculate indicators on closed bars only (bar confirmation = true). Pine Script's default is on-bar-close — this is correct behavior.
Market-Specific Adjustments
- Crypto (24/7): Standard (10, 3.0) on daily works; on 4H use (7, 2.5)
- Equities (US stocks): Default (10, 3.0) on daily — well-tested
- Forex: (7, 3.0) on 1H — forex is more volatile intraday, faster ATR helps
- Commodities: Increase multiplier to 3.5–4.0 — commodity trends run longer and pullbacks are deeper
Section 7: Synergies & Conflicts
| Works Well With | Avoid Combining With | |
|---|---|---|
| ADX | ADX > 25 validates Supertrend signals — essential filter to eliminate ranging-market flips | — |
| EMA(21/50) | Supertrend flip in direction of EMA trend = highest-confidence entry | — |
| Volume | Volume spike on Supertrend flip confirms the reversal has institutional backing | — |
| MACD | MACD histogram positive on Supertrend green flip = momentum and trend aligned | — |
| Multiple Supertrend lines | — | Running (7,2) and (14,4) simultaneously creates contradictory signals — pick one |
| RSI overbought signals | — | Supertrend says hold trend; RSI says sell at 70+ — opposing logic in strong trends |
| Bollinger Band mean-reversion | — | Bollinger bands pulling price to mean conflicts with Supertrend trailing stop |
Section 8: Common Mistakes
| Mistake | Root Cause | Solution |
|---|---|---|
| Acting on a live-bar Supertrend flip | Supertrend repaints until bar closes | Always wait for bar close before recording or acting on a flip |
| Using Supertrend in ranging markets | ATR bands still flip frequently without trend | Filter with ADX(14) — only trade Supertrend when ADX > 20 |
| Moving the stop below Supertrend | Removes the trailing stop benefit | Use Supertrend value as the hard stop — do not create buffer below it |
| Applying one parameter to all assets | Different assets have different volatility profiles | Optimize ATR period and multiplier per asset using 200-bar visual check |
| Confusing repaint with a strategy flaw | Seeing smooth equity curves in backtests that use intrabar values | Verify backtesting platform uses bar-close-only Supertrend values |
Section 9: Cheat Sheet
USE WHEN: ADX > 20, clear trend direction, want automatic trailing stop without manual adjustment
AVOID WHEN: ADX < 20 (ranging), major news event pending, thin liquidity sessions
ENTRY SIGNAL: Bar closes and Supertrend flips green (bullish) — enter next bar open
EXIT SIGNAL: Bar closes and Supertrend flips red — exit immediately at next bar open
PARAMETERS: Default: ATR(10) / 3.0 | Scalp: 7/2.0 | Swing: 14/3.5 | Position: 20/4.0
CONFLUENCE: ADX (filter) + EMA(21) direction bias + Volume on flip bar
RISK: Repaints on current bar — never enter on live flip; false signals in choppy conditions
BEST TIMEFRAME: Daily for swing trades — most reliable where intraday noise is filtered out