Every trend trader asks two questions again and again: “Is the trend still alive?” and “Where should my stop-loss be right now?” Most indicators answer only one of them. The Supertrend answers both with a single line on your price chart.
When the line is green and below price, the trend is up. When it is red and above price, the trend is down. And the line itself is a ready-made trailing stop that moves with volatility.
In this guide you will learn exactly how the Supertrend is calculated, including the “ratchet” rule that most guides skip, how to read and tune it, three rule-based strategies, which indicators pair well with it, and where it fails.
Supertrend Quick Facts
| Feature | Detail |
|---|---|
| Creator | Olivier Seban (commonly attributed) |
| Year introduced | Not reliably documented |
| Indicator type | Trend-following overlay / volatility-based trailing stop |
| Built on | ATR (Average True Range) |
| Default settings | ATR Length 10, Factor 3 (TradingView) |
| Best markets | Liquid, trending markets: index futures, large-cap stocks, major crypto pairs, major forex pairs |
| Best timeframes | 15-minute to daily; cleaner on 1-hour and above |
Origin and History
The Supertrend is commonly credited to Olivier Seban, a French trader and author. TradingView’s help documentation names him as its creator, and the open-source TA-Lib library lists his French-language book Tout le monde mérite d’être riche as a reference.
What is not clear is the exact year. Different sources give different dates, and some of those dates contradict each other. Because we could not confirm it from a primary source, we have left the year out rather than guess.
There is also no single original English paper that defines the indicator. Over time, platforms such as MetaTrader, AmiBroker and TradingView each published their own code. That is why you will find small differences between versions, which we cover in the formula section below.
Today, the Supertrend is one of the most popular trend overlays on TradingView, and it is especially well known among traders in the Indian index and F&O (futures and options) markets.
The Supertrend Formula, Step by Step
The Supertrend uses only two inputs:
- ATR Length (n): how many bars are used to measure volatility. Default 10.
- Factor (multiplier): how many ATRs away from price the line sits. Default 3.
The calculation has five steps.
Step 1: Calculate the ATR
True Range (TR) is the largest of these three values:
TR = max( High − Low, |High − Previous Close|, |Low − Previous Close| )
The ATR is a smoothed average of TR. TradingView’s built-in Supertrend uses Wilder’s smoothing (called RMA in Pine Script):
ATR(today) = ( ATR(yesterday) × (n − 1) + TR(today) ) ÷ n
(Our ATR Indicator guide explains this in full.)
Step 2: Find the bar’s midpoint
hl2 = (High + Low) ÷ 2
Step 3: Calculate the basic bands
Basic Upper Band = hl2 + (Factor × ATR)
Basic Lower Band = hl2 − (Factor × ATR)
Step 4: Apply the ratchet to get the final bands
This step is what turns two simple bands into a trailing stop. The rule is:
- Final Lower Band: use the new basic lower band only if it is higher than the previous final lower band, or if the previous close was below the previous final lower band. Otherwise, keep the previous value.
- Final Upper Band: use the new basic upper band only if it is lower than the previous final upper band, or if the previous close was above the previous final upper band. Otherwise, keep the previous value.
In plain words: in an uptrend the line can move up or stay flat, but it cannot move down. In a downtrend it can move down or stay flat, but not up. This is why the Supertrend line often looks like a staircase.
Step 5: Decide the trend and plot the line
- If the line was on the upper band last bar, the trend flips up when the close moves above the final upper band. Otherwise it stays down.
- If the line was on the lower band last bar, the trend flips down when the close moves below the final lower band. Otherwise it stays up.
Supertrend = Final Lower Band (when trend is up)
Supertrend = Final Upper Band (when trend is down)
Worked example (Factor 3, ATR Length 10)
Starting state (before Bar 1): trend is up, previous close = 249.00, previous ATR = 2.00, previous final lower band = 241.50, previous final upper band = 256.00.
| Bar | High | Low | Close | TR | ATR | hl2 | Basic Upper | Basic Lower | Final Upper | Final Lower | Trend | Supertrend |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | 251.0 | 247.0 | 250.0 | 4.00 | 2.20 | 249.00 | 255.60 | 242.40 | 255.60 | 242.40 | Up | 242.40 |
| 2 | 253.0 | 249.4 | 252.6 | 3.60 | 2.34 | 251.20 | 258.22 | 244.18 | 255.60 | 244.18 | Up | 244.18 |
| 3 | 254.2 | 250.6 | 251.2 | 3.60 | 2.47 | 252.40 | 259.80 | 245.00 | 255.60 | 245.00 | Up | 245.00 |
| 4 | 252.0 | 247.6 | 248.0 | 4.40 | 2.66 | 249.80 | 257.78 | 241.82 | 255.60 | 245.00 | Up | 245.00 |
| 5 | 249.0 | 243.0 | 243.6 | 6.00 | 2.99 | 246.00 | 254.98 | 237.02 | 254.98 | 245.00 | Down | 254.98 |
| 6 | 244.6 | 240.4 | 241.0 | 4.20 | 3.11 | 242.50 | 251.84 | 233.16 | 251.84 | 233.16 | Down | 251.84 |
(Bands are calculated with the unrounded ATR, so a hand calculation with the rounded ATR may differ by 0.01.)

Let’s walk through the key bars.
Bar 1:
– TR = max(251.0 − 247.0, |251.0 − 249.0|, |247.0 − 249.0|) = max(4.00, 2.00, 2.00) = 4.00
– ATR = (2.00 × 9 + 4.00) ÷ 10 = 22.00 ÷ 10 = 2.20
– hl2 = (251.0 + 247.0) ÷ 2 = 249.00
– Basic Lower = 249.00 − (3 × 2.20) = 249.00 − 6.60 = 242.40
– 242.40 is higher than the previous 241.50, so the lower band moves up to 242.40.
– Close (250.0) is above 242.40, so the trend stays up. Supertrend = 242.40.
Bars 2 and 3: price makes higher highs, and the lower band keeps rising (244.18, then 245.00). The trailing stop is following price up.
Bar 4 (the ratchet in action):
– ATR rises to 2.66, and hl2 drops to 249.80.
– Basic Lower = 249.80 − (3 × 2.66) = 241.82
– 241.82 is lower than the previous final lower band (245.00), and the previous close (251.2) was above 245.00. So the rule says: keep 245.00.
– Without the ratchet, the stop would have dropped by more than 3 points just because volatility rose. With it, the stop holds.
Bar 5 (the flip):
– Close = 243.6, which is below the final lower band of 245.00.
– The trend flips to down. The Supertrend line jumps to the final upper band: 246.00 + (3 × 2.99) = 254.98.
– The line now sits above price and turns red.
Bar 6: the trend is down, so the upper band now ratchets. 251.84 is lower than 254.98, so the line moves down to 251.84. (The lower band resets to its basic value, 233.16, because the previous close broke below it.)
Platform differences you should know
Not every “Supertrend” uses the same math. If your values don’t match another platform, check these four things:
| Difference | TradingView built-in | Common variations |
|---|---|---|
| ATR smoothing | Wilder’s RMA | SMA or EMA of True Range in some MT4/MT5 and community scripts |
| Price source | hl2 (High + Low) ÷ 2 | Close, hlc3 or ohlc4 in some custom scripts |
| Flip logic | Both bands are tracked every bar | An AmiBroker version attributed to Seban tracks only the active band; it agrees on most bars but can give different values right at a flip |
| Direction output | ta.supertrend() returns direction −1 for uptrend and +1 for downtrend | Many custom scripts use +1 for up; check before writing alerts |
In Pine Script, the built-in function looks like this:
[supertrend, direction] = ta.supertrend(3.0, 10) // factor, ATR length
How to Read the Supertrend
- Green line below price: uptrend. The line is your potential trailing stop for long trades.
- Red line above price: downtrend. The line is your potential trailing stop for short trades.
- A flip (colour change): price closed through the line, so the trend has changed. This is the main signal.
- A flat line during a trend: the ratchet is holding because volatility rose or price paused. It does not mean the trend is weak, only that the stop is not moving.
- Distance between price and line: a very large gap (several ATRs) means price is stretched. Entering late here gives you a wide stop and poor risk-to-reward.
Important: the line only “locks” at the close of the bar. During a live candle, a flip can appear and then disappear. Always judge flips on closed bars.

Supertrend Settings Deep Dive
| Parameter | Default | Raise it | Lower it |
|---|---|---|---|
| ATR Length | 10 | Smoother ATR, line reacts more slowly to volatility spikes | ATR reacts faster; the line jumps more after big candles |
| Factor | 3 | Line sits further from price, fewer flips, bigger stop-loss, later exits | Line hugs price, more flips, smaller stop-loss, more whipsaws |
The Factor has much more effect on signals than the ATR Length. Changing the factor from 3 to 2 noticeably increases the number of flips on most charts.
Starting points to test (not “best” values; every market behaves differently):
| Trading style | Typical timeframe | ATR Length | Factor |
|---|---|---|---|
| Scalping | 1–5 min | 7–10 | 1.5–2 |
| Intraday | 5–15 min | 10 | 2–3 |
| Swing | 1H–Daily | 10–14 | 3 |
| Positional | Daily–Weekly | 14–21 | 3–4 |
Higher-volatility markets such as crypto often need a higher factor to avoid being stopped out by wicks. We cover settings per timeframe and market in detail in our guide to the best Supertrend settings.
Supertrend Trading Strategies
The strategies below are educational examples, not recommendations. Test any rule on your own market and timeframe before using real money.
Strategy 1: Supertrend flip with a 200 EMA filter
The most common mistake is taking every flip in both directions. Adding a long-term trend filter removes many counter-trend trades.
- Setup: Supertrend (10, 3) and a 200-period EMA (Exponential Moving Average).
- Long entry: price closes above the 200 EMA and the Supertrend flips to green. Enter at the close of the flip bar.
- Short entry: price closes below the 200 EMA and the Supertrend flips to red.
- Stop-loss: the Supertrend line at entry.
- Exit: when the Supertrend flips the opposite way, or when price closes on the other side of the 200 EMA.
- Works best: in markets with long, steady trends.
- Fails: when price moves sideways around the 200 EMA; you will get several small losses in a row.
Strategy 2: Pullback to the Supertrend line
Instead of buying the flip (which is often late), wait for the first pullback inside an established trend.
- Setup: Supertrend (10, 3) has been green for at least several bars.
- Long entry: price pulls back close to the Supertrend line (for example, within 0.5 ATR of it) without closing below it, then a candle closes back up in the trend direction.
- Stop-loss: a close below the Supertrend line.
- Exit: partial profit at a recent swing high or a 2R target (two times your risk), and trail the rest with the Supertrend line.
- Works best: in strong trends with regular, shallow pullbacks.
- Fails: when the “pullback” is really the start of a reversal; the stop keeps the loss small but you will be stopped out.
Strategy 3: Supertrend as an exit tool only
Many experienced traders don’t use the Supertrend for entries at all. They use another signal to enter and let the Supertrend manage the exit.
- Entry: any setup you already trust, for example a breakout from a range, or a momentum signal from the RSI indicator such as RSI crossing back above 50 in an uptrend.
- Stop-loss and exit: place the initial stop at the Supertrend line and trail it bar by bar. Exit when price closes through the line.
- Works best: for trend trades you want to “let run” without deciding the exit by feel.
- Fails: in fast reversals, where the exit comes after much of the profit is already gone. That is the cost of any trailing stop.
Confluence: What to Pair With the Supertrend
| Pair with | Why it helps |
|---|---|
| ADX (Average Directional Index) | The Supertrend’s biggest weakness is sideways markets. ADX measures trend strength. Many traders skip Supertrend signals when ADX is low (often below 20–25) because that suggests a range. |
| 200 EMA | Gives the higher-level direction so you trade flips only with the bigger trend. |
| Volume or relative volume | A flip on rising volume shows real participation. A flip on very low volume is easier to reverse. |
| RSI | Adds momentum information. Useful for timing pullback entries (Strategy 2) and spotting stretched moves. |
Redundant pairings to avoid: Parabolic SAR, Chandelier Exit and ATR trailing stops all do the same job as the Supertrend: they are price-following stops. Putting two of them on the same chart mostly gives you the same signal twice, and when they disagree it adds confusion rather than information. The popular UT Bot Alerts indicator is another ATR trailing stop.
Limitations and Common Mistakes
- Whipsaws in ranges. In sideways markets the Supertrend flips back and forth, and each flip can be a small loss. This is its biggest weakness.
- Lag at turning points. The line is built on past volatility and needs a close beyond the band. By the time it flips, part of the new move has already happened.
- Acting on live-bar flips. A flip during an open candle can disappear before the close. Wait for the bar to close.
- Over-optimising the factor. Finding the “perfect” factor on past data usually means fitting noise. A setting that looks perfect on last year’s chart often performs worse going forward.
- Ignoring gaps. In stocks and F&O, price can gap through the Supertrend line overnight. Your real exit can be far worse than the line’s value.
- Using it alone. The Supertrend tells you direction and a stop level. It does not tell you whether the market is trending at all. Add a trend or range filter.
Frequently Asked Questions
Is Supertrend good for intraday trading?
It can be, especially on 5–15 minute charts during trending sessions. But intraday charts have more noise, so expect more false flips. Many intraday traders add a filter such as VWAP or ADX and avoid trading flips in the first few minutes after the open.
What is the best setting for Supertrend?
There is no single best setting. ATR Length 10 and Factor 3 is the standard starting point. Faster charts often use a lower factor (2–2.5) and higher timeframes or volatile assets often use a higher one (3–4). Test on your own market. See our best Supertrend settings guide.
Does Supertrend repaint?
The standard Supertrend does not repaint closed bars. Once a bar closes, its value and colour stay fixed. However, on the current open bar, the line and colour can change as price moves. If you use it on a higher timeframe from a lower-timeframe chart, be careful with how the script requests that data. For a similar trend tool tested in Bar Replay, see our HalfTrend repaint test.
Which is better, Supertrend or a moving average?
They do different jobs. A moving average shows the average price and works well as a trend filter. The Supertrend adapts to volatility and gives a clear stop level. Many traders use both: a moving average for direction and the Supertrend for entries and exits.
Can I use Supertrend for options trading?
Traders often apply the Supertrend to the chart of the underlying (for example, the index) to judge direction, then choose an options position separately. Remember that option prices are also affected by time decay and volatility, so a correct direction call can still lose money. This is not a recommendation to trade options.
Keep Learning
- Supertrend Pullback Strategy: a step-by-step way to trade it
- Triple Supertrend Strategy Check: why more Supertrends add little
- Trend Indicators: Supertrend compared with the EMA and ADX
- Position Size Calculator: size any trade from your Supertrend stop
Get new guides first: free Repaint Checklist and newsletter.
How we checked this guide
- Method: Formula and worked example verified in code
- Chart: Real TradingView data, EUR/USD daily, at least 30 days old
- Repainting: Does not repaint on closed bars (the live bar can still flip)
Risk disclaimer: This article is for educational purposes only and is not investment advice. Trading in stocks, derivatives, forex and crypto involves a substantial risk of loss and is not suitable for everyone. Past behaviour of any indicator does not guarantee future results. Do your own research and consider speaking to a SEBI-registered investment adviser (or a licensed adviser in your country) before making trading decisions. See our full Disclaimer.