True Range Node
Per-Bar Volatility Without Smoothing
Overview
The True Range Node calculates the True Range for every bar directly from the connected stock source. True Range is the foundation of many volatility indicators (ATR, Keltner Channels) and represents the actual price range for a period, accounting for overnight gaps by including the previous close.
Unlike ATR, no smoothing is applied. Each bar's output is the raw True Range value, making this node useful when you need un-smoothed range data or want to build a custom averaging scheme on top.
Formula
The three components capture: the intrabar range (High − Low), a gap-up scenario (|High − prevClose|), and a gap-down scenario (|Low − prevClose|). The largest of the three is used so that gaps are never understated.
Parameters
No parameters. True Range is a per-bar calculation that requires no configurable period or multiplier. Connect a stock source and the node outputs a value for every bar.
Inputs & Outputs
| Slot | Direction | Type | Description |
|---|---|---|---|
| source | Input | Stock Source (OHLCV) | Root stock node providing High, Low, and Close arrays |
| values | Output | (number | null)[] | True Range for each bar; null only when H, L, or C data is missing |
| timestamps | Output | number[] | Unix timestamps matching the source data |
Use Cases
Custom Smoothing
Pipe TR into a custom MA node to create your own averaged-range indicator with any smoothing algorithm.
Gap Detection
Compare TR to High − Low; a large difference signals a significant overnight gap.
Volatility Filtering
Use raw TR to filter out low-range bars before entering a breakout strategy.
Tips & Best Practices
📈 No Warm-Up
Every bar produces a value (first bar uses H − L), so there is no leading null period.
⚡ Noisy Signal
Raw TR is highly variable bar to bar. For trading signals, apply ATR (Wilder's smoothing) instead.
🔗 Building Blocks
True Range is the building block for ATR, Keltner Channels, and many stop-loss models.