Complete Suite: all 12 tools. 6 Premium desks inside.All 12 tools $606.98 one by one

$606.98 one by one $97 once Save $509.98Get the SuiteGet it
ProEA Lab · MT5, TradingView and trading research · Evidence standards
Indicators

SuperTrend Indicator Settings (10,3 vs 7,2, RMA vs SMA & Wicks), Read from Code

Every input in TradingView's top SuperTrend scripts read from the code: how 10 × 3.0 compares against 7 × 2.0, 14 × 2.0, and 22 × 3.0, what Change ATR Calculation Method (RMA vs SMA) and Take Wicks into Account actually alter, an interactive 15-minute candle drill, and a confirmed-bar Pine Script v6 build.

PL · 11 min read
Explainer cover titled SuperTrend settings, read from the code: two simulated 15-minute candle charts side by side comparing 10 x 3.0, RMA, Close (2 flips) against 7 x 2.0, RMA, Close (4 flips and 3 vanished mid-candle breaches).
Links to TradingView in this article are partner links: if you open a new TradingView account through one and buy a plan, TradingView may pay ProEA a commission, at no cost to you.

TradingView's built-in SuperTrend and <TvScript id="r6dAP7yi">SuperTrend</TvScript> by KivancOzbilgic (85,482 boosts on 12 November 2026) both start at ATR Period = 10 and ATR Multiplier = 3.0 around the candle midpoint (hl2), using Wilder's RMA smoothing and a close-based flip. Tightening to 7 × 2.0 pulls the stop a full 1.0 × ATR closer to price—doubling flips from 2 to 4 (plus 3 vanished mid-candle breaches) on our 96-candle (24-hour) 15-minute drill below—while enabling everget's wick trigger (13,661 boosts) turns every intrabar liquidity sweep into a permanent flip.

If you want the step-by-step math of Olivier Seban's formula and how it compares with two months of real gold candles, start with our SuperTrend indicator formula & flip guide, or see how 10 community variants rank in best SuperTrend indicators on TradingView, code-read. This guide opens the settings panel itself—input by input—across our 12 November 2026 TradingView script census (50 scripts in total—50 open source, 0 protected, and 0 invite-only).

Every SuperTrend input, read from the two reference scripts

Across the 50 SuperTrend scripts returned by TradingView's search on 12 November 2026, two open-source implementations define almost every setting traders ask about: KivancOzbilgic's 37-line Pine v4 classic (r6dAP7yi, 85,482 boosts) and everget's Pine v6 <TvScript id="VLWVV7tH">SuperTrend</TvScript> (VLWVV7tH, 13,661 boosts, GPL-3.0). Here is what each input actually changes inside the code:

Input in Settings UIDefault (KivancOzbilgic / everget)Exact Code Line & Formula EffectMechanical Trade-Off
ATR Period / ATR Length10 (KivancOzbilgic) / 22 (everget)Lookback N passed into atr(N) or ta.atr(N)Shorter (7) expands and contracts band width rapidly after a single wide bar; longer (14 or 22) keeps stop distance steadier across quiet pullbacks
Sourcehl2 ((high + low) / 2)Centre line from which ± Multiplier × ATR is measuredSwitching hl2 to close or hlc3 shifts the band toward the candle's settlement price (closer to UT Bot Alerts settings)
ATR Multiplier3.0 in bothDistance scalar Multiplier * atr subtracted from or added to SourceControls flip frequency far more than ATR Period: 2.0 hugs swings closely with frequent flips; 3.0–4.0 sits outside normal pullbacks with wider give-back
Change ATR Calculation Method ?true (KivancOzbilgic L7, L9)atr2 = sma(tr, Periods) vs atr = changeATR ? atr(Periods) : atr2Checked (true) = Wilder's RMA (α = 1 / N); unchecked (false) = equal-weighted SMA(TR, N), which jumps when a 10-bar-old news spike exits the window
Take Wicks into Account ?true (everget L14, L17–18)Replaces close with high and low in both ratchet and flip checks (and freezes stops on 4-price dojis)Checked (true) flips mid-bar the moment a wick touches the prior band—even if the candle closes all the way back inside
Bar-Close ConfirmationOff in both (true in <TvScript id="31up9Ozt">SuperTrend + Relative Volume</TvScript>, 12,442 boosts)Gates signals and alerts on barstate.isconfirmedPrevents Buy/Sell tags from flashing 5 or 10 minutes into a bar and vanishing before the close

Interactive drill: 10 × 3.0 vs 7 × 2.0, RMA vs SMA, and Close vs Wick

Click between the four ATR × Multiplier pairs (7 × 2.0, 10 × 3.0, 14 × 2.0, 22 × 3.0), toggle RMA (Wilder) against SMA (Simple), and switch Close vs High/Low Wick on 96 simulated 15-minute candles (24 hours after a 200-bar warm-up):

Compare ATR × Multiplier, RMA vs SMA, and Close vs Wick flips24 hours of simulated 15-minute candles with a ratcheted SuperTrend trail around (high + low) / 2. Switch the pair, ATR smoothing, and flip trigger to count closed-bar flips and mid-candle breaches.
SIMULATED · 15-MIN CANDLES, UTC · 10 × 3.0 · RMA · CLOSE2 FLIPS112.50113.00113.50114.00114.50115.0003:0006:0009:0012:0015:0018:0021:0000:00▲ bull flip▼ bear flip△ dashed: crossed 5 or 10 min into bar, closed back inside
ATR × Multiplier
ATR Method
Flip Trigger

10 × 3.0 is Olivier Seban's and TradingView's standard default across 35 of the 50 scripts in our census.

10 × 3.0, RMA, Close: 2 trail flips in 24 simulated hours.

First flip on the 10:15 candle (up). No mid-candle breach vanished before the close at these settings. Other pairs with RMA + Close — 7 × 2.0: 4, 14 × 2.0: 4, 22 × 3.0: 2.

Simulated 15-minute candles, not live market prices: the same seeded 296-candle window (200 warm-up, 96 shown) used in our Hull settings drill. The SuperTrend band is computed by our own code from Olivier Seban's published midpoint ± multiplier × ATR formula, with switches for Wilder's RMA vs simple-average ATR and close vs high/low wick triggers. Partial readings are sampled 5 and 10 minutes into each bar; flip counts illustrate stop mechanics, not profitability.

Read preset comparison as table
  • Flip up on the 10:15 candle (close vs prior stop 113.081; new stop 112.435).
  • Flip down on the 14:00 candle (close vs prior stop 113.672; new stop 114.851).

Three things the 96-candle drill exposes immediately

  1. 10 × 3.0 vs 7 × 2.0 (RMA, Close): At the classic 10 × 3.0 default, the ratcheted trail flips 2 times in 24 simulated hours with 0 vanished mid-candle breaches. Dropping to 7 × 2.0 doubles closed-bar flips to 4 and produces 3 dashed orange ghost breaches—moments 5 or 10 minutes into a 15-minute bar where live price crossed the opposite band and then closed back inside.
  2. Why Take Wicks into Account (Wick) changes the ratchet and the flip: At 14 × 2.0 (RMA), switching from Close to Wick increases flips from 4 to 6; at 22 × 3.0 (RMA), flips double from 2 to 4. Because a candle's final high is at least as high as any intrabar spike (and its final low at least as low), a wick trigger never un-flips before the close—instead, every stop-hunt wick that sweeps the band and reverses locks you into the opposite trend immediately.
  3. RMA vs SMA true range (changeATR): At 14 × 2.0 (Close), both RMA and SMA end with 4 closed-bar flips, yet SMA suffers 3 mid-candle ghost breaches vs 1 on RMA because old wide bars drop abruptly out of the 14-bar simple average, narrowing the band faster during post-impulse consolidation.

One subtle difference between KivancOzbilgic and TradingView's ta.supertrend()

In KivancOzbilgic's r6dAP7yi (lines 12–17), the trend flips when close > dn1 or close < up1—comparing the current close against the previous bar's ratcheted band (dn[1] / up[1]). TradingView's built-in ta.supertrend(factor, atrPeriod) compares close against the current bar's ratcheted band (upperBand / lowerBand). When a violent reversal bar expands ATR sharply on the breakout bar itself, those two comparisons can land 1 bar apart.

Starting SuperTrend pairs by chart role (untested)

We haven't tested any row of this table on live markets; treat each pair as a place to start counting flips against your own instrument's spread, tick value, and commission rather than as a proven parameter set.

Chart Role / TimeframeStarting Pair (ATR × Mult)Tighter AlternativeWider AlternativeMechanics to Watch Before Testing
Fast Intraday (1m–5m)10 × 3.07 × 2.014 × 3.5Untested. On 1m–5m bars, broker spread is a large fraction of 1 × ATR; count flips and check best scalping indicators code read
Session Trend (15m–1h)10 × 3.014 × 2.014 × 3.0Untested. Compare close-confirmed flips against Chandelier Exit 22 × 3.0 settings on the same session
Swing / Crypto (4h)10 × 3.010 × 2.010 × 4.0On two months of real 4h gold candles in our SuperTrend formula guide, 10 × 2 flipped 13 times vs 3 times at 10 × 3 and 10 × 4
Daily Position (1D)22 × 3.010 × 2.522 × 3.5Untested. 22 bars spans roughly 1 trading month of weekday daily candles (everget's default lookback)

Clean-Room Pine Script v6 SuperTrend (RMA/SMA + Close/Wick + Confirmed Alerts)

Instead of juggling three separate Pine v4 and v6 scripts, this standalone, clean-room //@version=6 indicator puts all four mechanical choices (ATR Length, Multiplier, RMA vs SMA, and Close vs Wick trigger) in one clean input panel and locks Buy/Sell markers and alertcondition() calls strictly to barstate.isconfirmed by default:

//@version=6
// This Pine Script® code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © ProEA Lab (https://proea.app)
indicator("ProEA SuperTrend v6 (RMA/SMA + Close/Wick + Confirmed)", shorttitle = "ST Settings v6", overlay = true)

string GRP_ST   = "SuperTrend Parameters"
int    atrLen   = input.int(10, "ATR Length", minval = 1, group = GRP_ST)
float  factor   = input.float(3.0, "ATR Multiplier", minval = 0.25, step = 0.25, group = GRP_ST)
float  centreIn = input.source(hl2, "Band Centre Source", group = GRP_ST)
string atrMode  = input.string("RMA (Wilder)", "ATR Smoothing", options = ["RMA (Wilder)", "SMA (Simple)"], group = GRP_ST)
string trigMode = input.string("Close", "Flip & Ratchet Trigger", options = ["Close", "High/Low Wick"], group = GRP_ST)
bool   waitBar  = input.bool(true, "Confirm Flip Signals on Bar Close", group = GRP_ST)

float rawTr  = ta.tr(true)
float atrVal = atrMode == "RMA (Wilder)" ? ta.rma(rawTr, atrLen) : ta.sma(rawTr, atrLen)

float rawFloor = centreIn - factor * atrVal
float rawCap   = centreIn + factor * atrVal

bool useWick  = trigMode == "High/Low Wick"
float upHold  = useWick ? low[1]  : close[1]
float dnHold  = useWick ? high[1] : close[1]
float upBreak = useWick ? high    : close
float dnBreak = useWick ? low     : close

var float floorBand = na
var float capBand   = na
var int   trendDir  = 1

if na(atrVal)
    floorBand := na
    capBand   := na
else if na(floorBand[1]) or na(capBand[1])
    floorBand := rawFloor
    capBand   := rawCap
    trendDir  := 1
else
    bool flatBar = useWick and open == close and close == low and close == high
    floorBand := flatBar ? floorBand[1] : (rawFloor > floorBand[1] or upHold < floorBand[1] ? rawFloor : floorBand[1])
    capBand   := flatBar ? capBand[1]   : (rawCap < capBand[1]     or dnHold > capBand[1]   ? rawCap   : capBand[1])

    int prevDir = nz(trendDir[1], 1)
    if prevDir == -1 and upBreak > capBand[1]
        trendDir := 1
    else if prevDir == 1 and dnBreak < floorBand[1]
        trendDir := -1
    else
        trendDir := prevDir

bool gate   = not waitBar or barstate.isconfirmed
bool flipUp = trendDir == 1  and trendDir[1] == -1 and gate
bool flipDn = trendDir == -1 and trendDir[1] == 1  and gate

float bullLine = trendDir == 1  ? floorBand : na
float bearLine = trendDir == -1 ? capBand   : na

pMid  = plot(hl2, "Midpoint Anchor", display = display.none)
pBull = plot(bullLine, "Bullish Trail", color = #089981, linewidth = 2, style = plot.style_linebr)
pBear = plot(bearLine, "Bearish Trail", color = #f23645, linewidth = 2, style = plot.style_linebr)

fill(pMid, pBull, color = color.new(#089981, 88), title = "Uptrend Fill")
fill(pMid, pBear, color = color.new(#f23645, 88), title = "Downtrend Fill")

plotshape(flipUp, "Confirmed Flip Up",   shape.labelup,   location.belowbar, #089981, text = "UP",   textcolor = color.white, size = size.tiny)
plotshape(flipDn, "Confirmed Flip Down", shape.labeldown, location.abovebar, #f23645, text = "DOWN", textcolor = color.white, size = size.tiny)

alertcondition(flipUp, "SuperTrend Bullish Flip", "SuperTrend flipped bullish")
alertcondition(flipDn, "SuperTrend Bearish Flip", "SuperTrend flipped bearish")

When you want pullback entries, fee-adjusted sizing, and 20-symbol alerts

A raw SuperTrend flip tells you a candle crossed an ATR band—sometimes right at the exhaustion tip of a wide breakout bar where the stop back to the newly flipped band is 3 × ATR away.

  • Drift Desk (full readable Pine v6 source in Pine Pro Library) builds on the 2.0 × ATR(14) closed-bar family around a hlc3 centre shifted by candle-body pressure, turning only verified closed-bar flips into structured 2R plans.
  • Drift Desk Premium adds the workflow around every flip: higher-timeframe alignment, an automated wait of up to 10 bars for price to pull back toward the trail before entry, lot-step position sizing with round-turn fees expressed in R, 1R partial/breakeven management, and a 20-symbol multi-asset scanner. Treat it as an execution toolset—its signals are not proven to earn more, and our out-of-sample 20-coin backtest is published openly in Drift Desk: what we measured.

Use this animation on your site.

Frequently asked questions

What are the default SuperTrend indicator settings on TradingView?

Both TradingView's built-in SuperTrend and KivancOzbilgic's community SuperTrend (85,482 boosts on 12 November 2026) default to an ATR Period of 10, a Source of hl2 (candle midpoint), and an ATR Multiplier of 3.0 using Wilder's RMA smoothing on candle closes. everget's SuperTrend (13,661 boosts) widens the default ATR Period to 22 with a 3.0 multiplier and turns wick-based flips on by default.

What is the difference between SuperTrend 10, 3 and 7, 2?

Lowering the ATR Period from 10 to 7 and the Multiplier from 3.0 to 2.0 moves the trailing band one full ATR closer to the candle midpoint and makes its width react faster to recent bars. On the 96 simulated 15-minute candles in our drill (24 hours), 10 x 3.0 with RMA and Close flipped 2 times with 0 vanished mid-candle breaches, whereas 7 x 2.0 flipped 4 times and flashed 3 extra mid-candle breaches that disappeared by the close.

What does Change ATR Calculation Method do in KivancOzbilgic's SuperTrend?

In KivancOzbilgic's 37-line Pine v4 script, Change ATR Calculation Method defaults to true, which computes Wilder's exponentially smoothed RMA via atr(Periods). Unchecking that box switches the width to sma(tr, Periods), an equal-weighted simple average of true range where an outlier spike drops out abruptly after 10 bars instead of decaying smoothly.

Should SuperTrend flip on candle closes or high and low wicks?

Flipping on closes waits for the bar's closing price (or live last price until the bar closes) to cross the prior ratcheted stop, whereas everget's Take Wicks into Account option flips the instant a candle's high or low pierces the stop. On our 96 simulated 15-minute candles at 14 x 2.0 (RMA), switching from Close to Wick raised closed-bar flips from 4 to 6, and at 22 x 3.0 (RMA) from 2 to 4, because intrabar stop sweeps that closed back inside still locked in a trend reversal.

How do you stop SuperTrend Buy and Sell labels from disappearing mid-candle?

Most community SuperTrend scripts, including KivancOzbilgic's 85,482-boost classic, evaluate close > dn1 and close < up1 on the live unconfirmed bar, so a signal can appear 5 minutes into a 15-minute bar and vanish before the close. Either gate flip signals with barstate.isconfirmed, as Flux Charts' SuperTrend (12,442 boosts) and our Pine Script v6 build below do, or set TradingView alerts to Once Per Bar Close.

Are there proven best SuperTrend settings for scalping or swing trading?

No single ATR Length and Multiplier pair is proven best across markets, and we have not backtested timeframe-specific pairs as standalone strategies. Tighter pairs such as 7 x 2.0 or 10 x 2.0 reduce stop give-back when a trend reverses at the cost of more whipsaw flips in range chop, while wider pairs such as 10 x 3.0 or 22 x 3.0 sit through deeper pullbacks and give back more open profit when the trend finally turns.

Continue reading

Best MACD Indicators on TradingView (2026), 10 Scripts Code-Read

We read the source code of the 10 most-boosted open-source MACD indicators on TradingView: why an 82,869-boost script uses SMA for its signal line, why a 20,650-boost 4-color script discards the histogram completely, LazyBear's flat-zero Impulse MACD chop filter, and a clean Pine Script v6 build.

Nov 12 · ProEA Lab

Scorecard cover titled Best MACD indicators, code-read: comparison across popular open-source TradingView MACD scripts checking true EMA or Impulse math, closed-bar alerts, and absence of tuple or live MTF bugs.

Best Scalping Indicators on TradingView (2026), 7 Scripts Code-Read

We read seven popular open-source TradingView scalping scripts line by line, and list one invite-only script whose code we couldn't see: hidden Heikin Ashi triggers, unused stopLoss variables, unshifted higher-timeframe security() leaks, linear regression dressed up as AI, and a clean Pine Script v6 pullback scalper.

Nov 11 · ProEA Lab

Scorecard cover titled Best scalping indicators, code-read. Comparison table across six popular TradingView scalping scripts checking real OHLC candle math, barstate.isconfirmed locking, and real ATR risk levels.

Pine Script to MQL4: Converting a TradingView Indicator or Strategy to MT4 (.mq4)

Free in-browser Pine Script to MQL4 converter and MT4 guide: draft a #property strict .mq4 indicator or EA, map shift=1 iMA/iATR calls, gate Time[0], and audit OrderSend tickets.

Nov 11 · ProEA Lab

Explainer cover titled Pine Script to MQL4, shift by shift: side-by-side mapping comparing TradingView Pine v6 series calls against MetaTrader 4 #property strict iMA/iATR shift 1 calls and OrderClose + OrderSend ticket management.