We use cookies to understand how the site is used and improve it. We only load analytics after you accept. Privacy Policy
Calculates SuperTrend using ATR-based dynamic support/resistance
The Pine Script tab is the author's original, unchanged. The NexaScript, MQL5 and cTrader tabs were converted automatically by AlgoNexta from that original, are marked unverified and have not been run on the native platforms. Check them yourself before using them.
Real-time chart analysis needs deterministic updates per bar and explicit handling of warm-up periods. SUPER addresses this by implementing `Calculates SuperTrend using ATR-based dynamic support/resistance` with parameterized inputs and direct state progression.
This implementation favors streaming execution over batch recomputation. The trade-off is more attention to state initialization, but latency stays predictable when charts scale.
Streaming logic keeps incremental cost stable, but initialization and edge-case handling become first-class concerns. That is a deliberate choice: predictable execution beats opaque recalculation spikes in live charts.
1. Open the script in TradingView and confirm it compiles under Pine Script v6. 2. Validate warm-up behavior on sparse data and short histories. 3. Compare output against a trusted reference implementation for the same parameters. 4. Confirm parameter bounds reject invalid values without silent fallback.
Drawn by AlgoNexta's NexaScript engine from the converted version. It can differ slightly from the original at the start of the chart.
Running the NexaScript on recent candles…
community-super.nxs · 17 lines · 457 B
Not yet verified on the native platform — test it before relying on it.
Converted automatically from the original Pine Script by AlgoNexta. Mapped to a built-in indicator; the numbers were not independently checked. Conversion notes: parameter i_atr_period: default 10 used; parameter i_multiplier: default 3.0 used; parameter i_source: default close used; hand-written implementation replaced by the NexaScript builtin supertrend; warm-up values may differ slightly; plot line color, linewidth, plot style, and signal label text are
skill "SuperTrend" {
id SUPER
use XAUUSD M5
warmup 10
let st_line = supertrend(3, 10).value
let st_direction = supertrend(3, 10).trend
when direction_changed = st_direction != st_direction[1]
when buy_signal = direction_changed and st_direction == 1
when sell_signal = direction_changed and st_direction == 0 - 1
plot st_line on price
mark BUY_SIGNAL arrow_up below_bar color bull
mark SELL_SIGNAL arrow_down above_bar color bear
}
Educational and research tool. No investment advice. Generated code requires review and native-platform verification before use.