OPEN-SOURCE SCRIPT
업데이트됨 Supertrend Dashboard

Overview
This dashboard is a multi-timeframe technical indicator dashboard based on Supertrend. It combines:
Trend detection via Supertrend
Momentum via RSI and OBV (volume)
Volatility via a basic candle-based metric (bs)
Trend strength via ADX
Multi-timeframe analysis to see whether the trend is bullish across different timeframes
It then displays this info in a table on the chart with colors for quick visual interpretation.
2️⃣ Inputs
Dashboard settings:
enableDashboard: Toggle the dashboard on/off
locationDashboard: Where the table appears (Top right, Bottom left, etc.)
sizeDashboard: Text size in the table
strategyName: Custom name for the strategy
Indicator settings:
factor (Supertrend factor): Controls how far the Supertrend lines are from price
atrLength: ATR period for Supertrend calculation
rsiLength: Period for RSI calculation
Visual settings:
colorBackground, colorFrame, colorBorder: Control dashboard style
3️⃣ Core Calculations
a) Supertrend
Supertrend is a trend-following indicator that generates bullish or bearish signals.
Logic:
Compute ATR (atr = ta.atr(atrLength))
Compute preliminary bands:
upperBand = src + factor * atr
lowerBand = src - factor * atr
Smooth bands to avoid false flips:
lowerBand := lowerBand > prevLower or close[1] < prevLower ? lowerBand : prevLower
upperBand := upperBand < prevUpper or close[1] > prevUpper ? upperBand : prevUpper
Determine direction (bullish / bearish):
dir = 1 → bullish
dir = -1 → bearish
Supertrend line = lowerBand if bullish, upperBand if bearish
Output: [st, bull]
st → line to plot
bull → boolean (true = bullish)
b) Buy / Sell Trigger
Logic:
bull = ta.crossover(close, supertrend) → close crosses above Supertrend → buy signal
bear = ta.crossunder(close, supertrend) → close crosses below Supertrend → sell signal
trigger → checks which signal was most recent:
trigger = ta.barssince(bull) < ta.barssince(bear) ? 1 : 0
1 → Buy
0 → Sell
c) RSI (Momentum)
rsi = ta.rsi(close, rsiLength)
Logic:
RSI > 50 → bullish
RSI < 50 → bearish
d) OBV / Volume Trend (vosc)
OBV tracks whether volume is pushing price up or down.
Manual calculation (safe for all Pine versions):
obv = ta.cum( math.sign( nz(ta.change(close), 0) ) * volume )
vosc = obv - ta.ema(obv, 20)
Logic:
vosc > 0 → bullish
vosc < 0 → bearish
e) Volatility (bs)
Measures how “volatile” the current candle is:
bs = ta.ema(math.abs((open - close) / math.max(high - low, syminfo.mintick) * 100), 3)
Higher % → stronger candle moves
Displayed on dashboard as a number
f) ADX (Trend Strength)
[_, _, adx] = ta.dmi(14, 14)
Logic:
adx > 20 → Trending
adx < 20 → Ranging
g) Multi-Timeframe Supertrend
Timeframes: 1m, 3m, 5m, 10m, 15m, 30m, 1H, 2H, 4H, 12H, 1D
Logic:
for tf in timeframes
[_, bull_tf] = request.security(syminfo.tickerid, tf, f_supertrend(ohlc4, factor, atrLength))
array.push(tf_bulls, bull_tf ? 1.0 : 0.0)
bull_tf ? 1.0 : 0.0 → converts boolean to number
Then we calculate user rating:
userRating = (sum of bullish timeframes / total timeframes) * 10
0 → Strong Sell, 10 → Strong Buy
4️⃣ Dashboard Table Layout
Row Column 0 (Label) Column 1 (Value)
0 Strategy strategyName
1 Technical Rating textFromRating(userRating) (color-coded)
2 Current Signal Buy / Sell (based on last Supertrend crossover)
3 Current Trend Bullish / Bearish (based on Supertrend)
4 Trend Strength bs %
5 Volume vosc → Bullish/Bearish
6 Volatility adx → Trending/Ranging
7 Momentum RSI → Bullish/Bearish
8 Timeframe Trends 📶 Merged cell
9-19 1m → Daily Bullish/Bearish for each timeframe (green/red)
5️⃣ Color Logic
Green shades → bullish / trending / buy
Red / orange → bearish / weak / sell
Yellow → neutral / ranging
Example:
dashboard_cell_bg(1, 1, colorFromRating(userRating))
dashboard_cell_bg(1, 2, trigger ? color.green : color.red)
dashboard_cell_bg(1, 3, superBull ? color.green : color.red)
Makes the dashboard visually intuitive
6️⃣ Key Logic Flow
Calculate Supertrend on current timeframe
Detect buy/sell triggers based on crossover
Calculate RSI, OBV, Volatility, ADX
Request Supertrend on multiple timeframes → convert to 1/0
Compute user rating (percentage of bullish timeframes)
Populate dashboard table with colors and values
✅ The result: You get a compact, fast, multi-timeframe trend dashboard that shows:
Current signal (Buy/Sell)
Current trend (Bullish/Bearish)
Momentum, volatility, and volume cues
Trend across multiple timeframes
Overall technical rating
It’s essentially a full trend-strength scanner directly on your chart.
This dashboard is a multi-timeframe technical indicator dashboard based on Supertrend. It combines:
Trend detection via Supertrend
Momentum via RSI and OBV (volume)
Volatility via a basic candle-based metric (bs)
Trend strength via ADX
Multi-timeframe analysis to see whether the trend is bullish across different timeframes
It then displays this info in a table on the chart with colors for quick visual interpretation.
2️⃣ Inputs
Dashboard settings:
enableDashboard: Toggle the dashboard on/off
locationDashboard: Where the table appears (Top right, Bottom left, etc.)
sizeDashboard: Text size in the table
strategyName: Custom name for the strategy
Indicator settings:
factor (Supertrend factor): Controls how far the Supertrend lines are from price
atrLength: ATR period for Supertrend calculation
rsiLength: Period for RSI calculation
Visual settings:
colorBackground, colorFrame, colorBorder: Control dashboard style
3️⃣ Core Calculations
a) Supertrend
Supertrend is a trend-following indicator that generates bullish or bearish signals.
Logic:
Compute ATR (atr = ta.atr(atrLength))
Compute preliminary bands:
upperBand = src + factor * atr
lowerBand = src - factor * atr
Smooth bands to avoid false flips:
lowerBand := lowerBand > prevLower or close[1] < prevLower ? lowerBand : prevLower
upperBand := upperBand < prevUpper or close[1] > prevUpper ? upperBand : prevUpper
Determine direction (bullish / bearish):
dir = 1 → bullish
dir = -1 → bearish
Supertrend line = lowerBand if bullish, upperBand if bearish
Output: [st, bull]
st → line to plot
bull → boolean (true = bullish)
b) Buy / Sell Trigger
Logic:
bull = ta.crossover(close, supertrend) → close crosses above Supertrend → buy signal
bear = ta.crossunder(close, supertrend) → close crosses below Supertrend → sell signal
trigger → checks which signal was most recent:
trigger = ta.barssince(bull) < ta.barssince(bear) ? 1 : 0
1 → Buy
0 → Sell
c) RSI (Momentum)
rsi = ta.rsi(close, rsiLength)
Logic:
RSI > 50 → bullish
RSI < 50 → bearish
d) OBV / Volume Trend (vosc)
OBV tracks whether volume is pushing price up or down.
Manual calculation (safe for all Pine versions):
obv = ta.cum( math.sign( nz(ta.change(close), 0) ) * volume )
vosc = obv - ta.ema(obv, 20)
Logic:
vosc > 0 → bullish
vosc < 0 → bearish
e) Volatility (bs)
Measures how “volatile” the current candle is:
bs = ta.ema(math.abs((open - close) / math.max(high - low, syminfo.mintick) * 100), 3)
Higher % → stronger candle moves
Displayed on dashboard as a number
f) ADX (Trend Strength)
[_, _, adx] = ta.dmi(14, 14)
Logic:
adx > 20 → Trending
adx < 20 → Ranging
g) Multi-Timeframe Supertrend
Timeframes: 1m, 3m, 5m, 10m, 15m, 30m, 1H, 2H, 4H, 12H, 1D
Logic:
for tf in timeframes
[_, bull_tf] = request.security(syminfo.tickerid, tf, f_supertrend(ohlc4, factor, atrLength))
array.push(tf_bulls, bull_tf ? 1.0 : 0.0)
bull_tf ? 1.0 : 0.0 → converts boolean to number
Then we calculate user rating:
userRating = (sum of bullish timeframes / total timeframes) * 10
0 → Strong Sell, 10 → Strong Buy
4️⃣ Dashboard Table Layout
Row Column 0 (Label) Column 1 (Value)
0 Strategy strategyName
1 Technical Rating textFromRating(userRating) (color-coded)
2 Current Signal Buy / Sell (based on last Supertrend crossover)
3 Current Trend Bullish / Bearish (based on Supertrend)
4 Trend Strength bs %
5 Volume vosc → Bullish/Bearish
6 Volatility adx → Trending/Ranging
7 Momentum RSI → Bullish/Bearish
8 Timeframe Trends 📶 Merged cell
9-19 1m → Daily Bullish/Bearish for each timeframe (green/red)
5️⃣ Color Logic
Green shades → bullish / trending / buy
Red / orange → bearish / weak / sell
Yellow → neutral / ranging
Example:
dashboard_cell_bg(1, 1, colorFromRating(userRating))
dashboard_cell_bg(1, 2, trigger ? color.green : color.red)
dashboard_cell_bg(1, 3, superBull ? color.green : color.red)
Makes the dashboard visually intuitive
6️⃣ Key Logic Flow
Calculate Supertrend on current timeframe
Detect buy/sell triggers based on crossover
Calculate RSI, OBV, Volatility, ADX
Request Supertrend on multiple timeframes → convert to 1/0
Compute user rating (percentage of bullish timeframes)
Populate dashboard table with colors and values
✅ The result: You get a compact, fast, multi-timeframe trend dashboard that shows:
Current signal (Buy/Sell)
Current trend (Bullish/Bearish)
Momentum, volatility, and volume cues
Trend across multiple timeframes
Overall technical rating
It’s essentially a full trend-strength scanner directly on your chart.
릴리즈 노트
fix barstate.islast오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.
오픈 소스 스크립트
진정한 트레이딩뷰 정신에 따라 이 스크립트 작성자는 트레이더가 기능을 검토하고 검증할 수 있도록 오픈소스로 공개했습니다. 작성자에게 찬사를 보냅니다! 무료로 사용할 수 있지만 코드를 다시 게시할 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
이 정보와 게시물은 TradingView에서 제공하거나 보증하는 금융, 투자, 거래 또는 기타 유형의 조언이나 권고 사항을 의미하거나 구성하지 않습니다. 자세한 내용은 이용 약관을 참고하세요.