Appearance
Personalize your experience
Mode
Accent Color
Layout
Direction
SuperTrend
Admin's ChoiceFreeATR-based trend indicator with buy/sell signals
4.8(312)
8.9k installs 1.2k 2 commentsQ
42 listings12400 followers
Official QuaTick team — building advanced charting & trading tools for the Indian market.
View Profiletrendatrsignalsoverlay
Free
Open in QuaTick IDE Edit in IDE Version2.3.0
Updated2025-11-01
Compatiblecandlestick, heiken-ashi, hollow-candle
Rating Distribution
5
2
4
0
3
0
2
0
1
0
Live Preview — BTC/USDT
About
**SuperTrend** is a trend-following indicator using ATR to determine direction. Identifies trend with clear buy/sell signals.
Features
• Configurable ATR period and multiplier
• Auto buy/sell signals on trend change
• Colour-coded trend line (green = up, red = down)
• Works on all timeframes and instruments
Outputs & Parameters
Outputs
SuperTrend Lineline
Buy/Sell Signalsdots
Parameters
ATR Period10
ATR Multiplier3
Show Signalstrue
Source Code
Edit in IDEtypescript
| 1 | // SuperTrend Indicator — Quatick IDE |
| 2 | // SDK math globals available: sma, ema, atr, rsi, macd, bollingerBands, vwap, etc. |
| 3 | |
| 4 | const metadata = { id: 'supertrend', name: 'SuperTrend', version: '1.0.0', category: 'volatility' }; |
| 5 | |
| 6 | interface BarData { |
| 7 | time: number; |
| 8 | open: number; |
| 9 | high: number; |
| 10 | low: number; |
| 11 | close: number; |
| 12 | volume?: number; |
| 13 | } |
| 14 | |
| 15 | const defaultParams = { atrPeriod: 10, multiplier: 3 }; |
| 16 | |
| 17 | function calculate(bars: BarData[], params = defaultParams): { time: number; value: number }[] { |
| 18 | const highs = bars.map(b => b.high); |
| 19 | const lows = bars.map(b => b.low); |
| 20 | const closes = bars.map(b => b.close); |
| 21 | |
| 22 | // atr() is an SDK global: atr(high[], low[], close[], period) -> number[] |
| 23 | const atrValues = atr(highs, lows, closes, params.atrPeriod); |
| 24 | |
| 25 | const result: { time: number; value: number }[] = []; |
| 26 | let trend = 1; |
| 27 | let upperBand = 0; |
| 28 | let lowerBand = 0; |
| 29 | |
| 30 | for (let i = 0; i < bars.length; i++) { |
| 31 | if (isNaN(atrValues[i])) continue; |
| 32 | const hl2 = (bars[i].high + bars[i].low) / 2; |
| 33 | const basicUpper = hl2 + params.multiplier * atrValues[i]; |
| 34 | const basicLower = hl2 - params.multiplier * atrValues[i]; |
| 35 | |
| 36 | const prevUpper = upperBand; |
| 37 | const prevLower = lowerBand; |
| 38 | upperBand = (i === 0 || basicUpper < prevUpper || (i > 0 && bars[i - 1].close > prevUpper)) ? basicUpper : prevUpper; |
| 39 | lowerBand = (i === 0 || basicLower > prevLower || (i > 0 && bars[i - 1].close < prevLower)) ? basicLower : prevLower; |
| 40 | |
| 41 | if (i > 0) { |
| 42 | if (bars[i].close > upperBand) trend = 1; |
| 43 | else if (bars[i].close < lowerBand) trend = -1; |
| 44 | } |
| 45 | |
| 46 | result.push({ time: bars[i].time, value: trend === 1 ? lowerBand : upperBand }); |
| 47 | } |
| 48 | |
| 49 | return result; |
| 50 | } |
Read-only preview. Open in the QuaTick IDE to edit and deploy.
Reviews
No reviews yet. Be the first to review this listing.
Discussion
Sign in to join the discussion.
Changelog
v2.3.0
Improved signal accuracy and added trend colour configuration.
2025-11-01
v2.0.0
Full rewrite with proper ATR smoothing.
2025-06-15