OPEN-SOURCE SCRIPT
Diupdate

RalisLine Spread

558
RalisLine Spread is a companion histogram for the RalisLine overlay. It measures the percentage gap between the fastest and slowest smoothed moving averages in a 4-SMMA ribbon, rendering that spread as a color-coded histogram below the chart. Gold bars above zero mean the ribbon is fanned out bullish — all four SMAs aligned with the fast line leading upward. Blue bars below zero mean bearish alignment. Gray bars appear when the ribbon is tangled — the inner lines disagree with the outer lines, indicating a regime transition is in progress.

The indicator uses a 3-state regime classification that goes beyond simple spread direction. It's not enough for the fast SMMA to be above the slow one — the two inner lines must also confirm the alignment. This "inconclusive" detection prevents false regime calls during crossover periods when the ribbon is tangled and direction is genuinely uncertain.

A 9-period EMA signal line (magenta) overlays the histogram. When the spread crosses above its signal line, a green triangle marks the crossover — momentum is building and the regime is strengthening. When it crosses below, a red triangle marks the fading — momentum is weakening. These signal line crossovers typically lead regime flips by several bars, giving you early warning before the RalisLine overlay changes color. A MACD-style fill between the spread and signal line shades green when spread is above signal and red when below, making the momentum relationship visible at a glance.

Bar brightness indicates acceleration. When the spread is growing in its current direction — bullish bars getting taller or bearish bars getting deeper — bars render at full brightness. When the spread is shrinking toward zero (regime fading), bars dim to 50% opacity. This means a bright gold bar is a strengthening bull trend, while a dim gold bar is a bull trend losing steam. The dimming often appears several bars before a regime flip, adding another layer of early warning beyond the signal line crossovers.

An optional percentile reference line (off by default, toggle in settings) ranks the current absolute spread against a 120-bar rolling history using ta.percentrank(). This solves the cross-asset comparison problem — a 2% spread on gold means something very different than 2% on a volatile altcoin. The percentile line turns orange above the 80th percentile (spread is extreme for this asset), blue below the 20th (spread is compressed, transition likely), and white in between. The percentile value is always shown in the info table even when the line is hidden.

The info table displays five fields: Regime (BULLISH/BEARISH/NEUTRAL with color-coded background), Spread (current percentage), Momentum (GROWING or FADING based on acceleration), Percentile (rank against rolling history), and Signal (ABOVE or BELOW the signal line). The table can be toggled off in settings for a cleaner pane.

Six alert conditions are available: Signal Cross Up (spread crossed above signal EMA), Signal Cross Down (spread crossed below), Zero Cross Up (spread turned positive — fast SMMA now leading slow), Zero Cross Down (spread turned negative), Regime to Bullish (ribbon aligned bullish from inconclusive or bearish), and Regime to Bearish (ribbon aligned bearish).

Default SMMA lengths are 8/16/24/32 on HL2, matching the RalisLine overlay for synchronized regime reads. For best results, use both indicators on the same chart — RalisLine shows the structural ribbon directly on price while RalisLine Spread shows the momentum and conviction beneath it. The signal line crossovers on the Spread often fire 3–5 bars before the RalisLine flip dots appear on the overlay, giving you a head start on regime transitions.

Works on any asset and any timeframe. No repainting.
Catatan Rilis
cosmetic

Pernyataan Penyangkalan

Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.