OPEN-SOURCE SCRIPT
Mis à jour Swell - Fast/Slow Consensus Oscillator

This oscillator plots one statistic at two speeds and trades their consensus. Both lines measure the same thing — the volatility-normalized deviation of price from a moving mean, a z-score. The fast line is raw Bollinger percent-B; the slow line is the same deviation passed through triple smoothing, in the style of the Firefly oscillator. Think of one sea surface decomposed into two frequencies: the slow line is the swell, the long-wavelength energy that sets the direction of the water; the fast line is the chop on top of it. Consensus signals ride the chop in the direction of the swell — the century-old tide-and-wave reading of markets, made spectral. The slow line defines the directional regime and wears its verdict as color: teal when it sits above the midline and rises, red when it sits below and falls, amber when position and slope disagree — the regime is on hold and regime-gated signals disarm until the two agree again.
Markers are emoji, and every extreme marker sits directly on the boundary that fired it. A bull prints when the fast line reclaims the midline inside a bullish regime; a bear prints on the mirror event. A sprout prints when the fast line turns up through an oversold boundary, a diamond when that happens inside a bullish regime. A fire prints when the fast line rolls over through an overbought boundary, a trap when that happens inside a bearish regime, and a siren when the rollover coincides with the slow line stalling at elevated levels. Overbought and oversold are hybrid by default: enclosing bands drawn from the fast line's own recent statistics, lagged one bar so a spike is judged against pre-spike conditions, tighten the definition of extreme in quiet stretches, while the fixed levels stay armed as an absolute safety net — a crossback fires on either boundary. All four trigger boundaries are drawn as thin lines, so every marker can be traced to the exact line it crossed.
Background tints follow the short-term motion and carry small labels with the judgment, drawn along the top of the pane and horizontally centered on each episode; the ongoing episode's label slides until the episode closes, then freezes. A red tint marks a pullback zone — the slow line bullish while the fast line sits below the midline, a dip within an uptrend. A green tint marks a suspect rally — the slow line bearish while the fast line pushes above the midline, a bounce to distrust. A violet tint marks a volatility squeeze, when Bollinger bandwidth sits below a percentile threshold of its own history — quiet stretches that tend to precede expansions. An optional filter restricts the four entry signals to a release window after a squeeze; advisories and regime alerts are never filtered. Every event on the chart is subscribable as an alert: each of the seven markers fires exactly when its emoji prints, plus regime turns, zone starts, squeeze start and release, and a catch-all condition covering any marker.
Inputs. The fast side takes the usual Bollinger length and multiplier. The slow side takes the Firefly lookback and smoothing length, with optional double smoothing and a ZLEMA variant. The consensus block sets the midline, the adaptive band length and multiplier, the fixed overbought and oversold levels, the elevated threshold for exhaustion, and a toggle requiring slope agreement for the regime, which makes signals stricter and later. The squeeze block sets the bandwidth lookback, the percentile threshold, and the release window.
Scope. An oscillator reads stretch, not regime-appropriateness: in a strong trend, extreme readings often mark strength rather than reversal, and the overheat cue in particular will fire repeatedly while price keeps running. Treat the markers as cues to investigate, not as a trading system, and let the slow line's color arbitrate which side of the book is open. The fast line is based on BBPCT% by AlgoAlpha; the slow line is based on the Firefly Oscillator by LazyBear, from an original idea by Yasu.
Markers are emoji, and every extreme marker sits directly on the boundary that fired it. A bull prints when the fast line reclaims the midline inside a bullish regime; a bear prints on the mirror event. A sprout prints when the fast line turns up through an oversold boundary, a diamond when that happens inside a bullish regime. A fire prints when the fast line rolls over through an overbought boundary, a trap when that happens inside a bearish regime, and a siren when the rollover coincides with the slow line stalling at elevated levels. Overbought and oversold are hybrid by default: enclosing bands drawn from the fast line's own recent statistics, lagged one bar so a spike is judged against pre-spike conditions, tighten the definition of extreme in quiet stretches, while the fixed levels stay armed as an absolute safety net — a crossback fires on either boundary. All four trigger boundaries are drawn as thin lines, so every marker can be traced to the exact line it crossed.
Background tints follow the short-term motion and carry small labels with the judgment, drawn along the top of the pane and horizontally centered on each episode; the ongoing episode's label slides until the episode closes, then freezes. A red tint marks a pullback zone — the slow line bullish while the fast line sits below the midline, a dip within an uptrend. A green tint marks a suspect rally — the slow line bearish while the fast line pushes above the midline, a bounce to distrust. A violet tint marks a volatility squeeze, when Bollinger bandwidth sits below a percentile threshold of its own history — quiet stretches that tend to precede expansions. An optional filter restricts the four entry signals to a release window after a squeeze; advisories and regime alerts are never filtered. Every event on the chart is subscribable as an alert: each of the seven markers fires exactly when its emoji prints, plus regime turns, zone starts, squeeze start and release, and a catch-all condition covering any marker.
Inputs. The fast side takes the usual Bollinger length and multiplier. The slow side takes the Firefly lookback and smoothing length, with optional double smoothing and a ZLEMA variant. The consensus block sets the midline, the adaptive band length and multiplier, the fixed overbought and oversold levels, the elevated threshold for exhaustion, and a toggle requiring slope agreement for the regime, which makes signals stricter and later. The squeeze block sets the bandwidth lookback, the percentile threshold, and the release window.
Scope. An oscillator reads stretch, not regime-appropriateness: in a strong trend, extreme readings often mark strength rather than reversal, and the overheat cue in particular will fire repeatedly while price keeps running. Treat the markers as cues to investigate, not as a trading system, and let the slow line's color arbitrate which side of the book is open. The fast line is based on BBPCT% by AlgoAlpha; the slow line is based on the Firefly Oscillator by LazyBear, from an original idea by Yasu.
Notes de version
This oscillator plots one statistic at two speeds and trades their consensus. Both lines measure the same thing — the volatility-normalized deviation of price from a moving mean, a z-score. The fast line is raw Bollinger percent-B; the slow line is the same deviation passed through triple smoothing, in the style of the Firefly oscillator. Think of one sea surface decomposed into two frequencies: the slow line is the swell, the long-wavelength energy that sets the direction of the water; the fast line is the chop on top of it. Consensus signals ride the chop in the direction of the swell — the century-old tide-and-wave reading of markets, made spectral. The slow line defines the directional regime and wears its verdict as color: teal when it sits above the midline and rises, red when it sits below and falls, amber when position and slope disagree — the regime is on hold and regime-gated signals disarm until the two agree again.Markers are emoji, and every extreme marker sits directly on the boundary that fired it. A bull prints when the fast line reclaims the midline inside a bullish regime; a bear prints on the mirror event. A sprout prints when the fast line turns up through an oversold boundary, a diamond when that happens inside a bullish regime. A fire prints when the fast line rolls over through an overbought boundary, a trap when that happens inside a bearish regime, and a siren when the rollover coincides with the slow line stalling at elevated levels. Overbought and oversold are hybrid by default: enclosing bands drawn from the fast line's own recent statistics, lagged one bar so a spike is judged against pre-spike conditions, tighten the definition of extreme in quiet stretches, while the fixed levels stay armed as an absolute safety net — a crossback fires on either boundary. All four trigger boundaries are drawn as thin lines, so every marker can be traced to the exact line it crossed.
Background tints follow the short-term motion and carry small labels with the judgment, drawn along the top of the pane and horizontally centered on each episode; the ongoing episode's label slides until the episode closes, then freezes. A red tint marks a pullback zone — the slow line bullish while the fast line sits below the midline, a dip within an uptrend. A green tint marks a suspect rally — the slow line bearish while the fast line pushes above the midline, a bounce to distrust. A violet tint marks a volatility squeeze, when Bollinger bandwidth sits below a percentile threshold of its own history — quiet stretches that tend to precede expansions. An optional filter restricts the four entry signals to a release window after a squeeze; advisories and regime alerts are never filtered. Every event on the chart is subscribable as an alert: each of the seven markers fires exactly when its emoji prints, plus regime turns, zone starts, squeeze start and release, and a catch-all condition covering any marker. A separate runtime alert composes the exact marker names into the notification: create one alert on the "Any alert() function call" condition to receive named events from a single subscription.
Inputs. The fast side takes the usual Bollinger length and multiplier. The slow side takes the Firefly lookback and smoothing length, with optional double smoothing and a ZLEMA variant. The consensus block sets the midline, the adaptive band length and multiplier, the fixed overbought and oversold levels, the elevated threshold for exhaustion, and a toggle requiring slope agreement for the regime, which makes signals stricter and later. The squeeze block sets the bandwidth lookback, the percentile threshold, and the release window.
Scope. An oscillator reads stretch, not regime-appropriateness: in a strong trend, extreme readings often mark strength rather than reversal, and the overheat cue in particular will fire repeatedly while price keeps running. Treat the markers as cues to investigate, not as a trading system, and let the slow line's color arbitrate which side of the book is open. The fast line is based on BBPCT% by AlgoAlpha; the slow line is based on the Firefly Oscillator by LazyBear, from an original idea by Yasu.
Notes de version
This oscillator plots one statistic at two speeds and trades their consensus. Both lines measure the same thing — the volatility-normalized deviation of price from a moving mean, a z-score. The fast line is raw Bollinger percent-B; the slow line is the same deviation passed through triple smoothing, in the style of the Firefly oscillator. Think of one sea surface decomposed into two frequencies: the slow line is the swell, the long-wavelength energy that sets the direction of the water; the fast line is the chop on top of it. Consensus signals ride the chop in the direction of the swell — the century-old tide-and-wave reading of markets, made spectral. The slow line defines the directional regime and wears its verdict as color: teal when it sits above the midline and rises, red when it sits below and falls, amber when position and slope disagree — the regime is on hold and regime-gated signals disarm until the two agree again.Markers are emoji, and every extreme marker sits directly on the boundary that fired it. A bull prints when the fast line reclaims the midline inside a bullish regime; a bear prints on the mirror event. A sprout prints when the fast line turns up through an oversold boundary, a diamond when that happens inside a bullish regime. A fire prints when the fast line rolls over through an overbought boundary, a trap when that happens inside a bearish regime, and a siren when the rollover coincides with the slow line stalling at elevated levels. Overbought and oversold are hybrid by default: enclosing bands drawn from the fast line's own recent statistics, lagged one bar so a spike is judged against pre-spike conditions, tighten the definition of extreme in quiet stretches, while the fixed levels stay armed as an absolute safety net — a crossback fires on either boundary. All four trigger boundaries are drawn as thin lines, so every marker can be traced to the exact line it crossed.
Background tints follow the short-term motion and carry small labels with the judgment, drawn along the top of the pane and horizontally centered on each episode; the ongoing episode's label slides until the episode closes, then freezes. A red tint marks a pullback zone — the slow line bullish while the fast line sits below the midline, a dip within an uptrend. A green tint marks a suspect rally — the slow line bearish while the fast line pushes above the midline, a bounce to distrust. A violet tint marks a volatility squeeze, when Bollinger bandwidth sits below a percentile threshold of its own history — quiet stretches that tend to precede expansions. An optional filter restricts the four entry signals to a release window after a squeeze; advisories and regime alerts are never filtered. Every event on the chart is subscribable as an alert: each of the seven markers fires exactly when its emoji prints, plus regime turns, zone starts, squeeze start and release, and a catch-all condition covering any marker. A separate runtime alert composes the exact marker names into the notification: create one alert on the "Any alert() function call" condition to receive named events from a single subscription; its wording is a template input customizable in the settings without editing code, with placeholders in the familiar double-brace style — symbol, exchange, timeframe, closing price, line readings, and the fired markers as emoji, names, or both — substituted by the script at runtime.
Inputs. The fast side takes the usual Bollinger length and multiplier. The slow side takes the Firefly lookback and smoothing length, with optional double smoothing and a ZLEMA variant. The consensus block sets the midline, the adaptive band length and multiplier, the fixed overbought and oversold levels, the elevated threshold for exhaustion, and a toggle requiring slope agreement for the regime, which makes signals stricter and later. The squeeze block sets the bandwidth lookback, the percentile threshold, and the release window.
Scope. An oscillator reads stretch, not regime-appropriateness: in a strong trend, extreme readings often mark strength rather than reversal, and the overheat cue in particular will fire repeatedly while price keeps running. Treat the markers as cues to investigate, not as a trading system, and let the slow line's color arbitrate which side of the book is open. The fast line is based on BBPCT% by AlgoAlpha; the slow line is based on the Firefly Oscillator by LazyBear, from an original idea by Yasu.
Notes de version
This oscillator plots one statistic at two speeds and trades their consensus. Both lines measure the same thing — the volatility-normalized deviation of price from a moving mean, a z-score. The fast line is raw Bollinger percent-B; the slow line is the same deviation passed through triple smoothing, in the style of the Firefly oscillator. Think of one sea surface decomposed into two frequencies: the slow line is the swell, the long-wavelength energy that sets the direction of the water; the fast line is the chop on top of it. Consensus signals ride the chop in the direction of the swell — the century-old tide-and-wave reading of markets, made spectral. The slow line defines the directional regime and wears its verdict as color: teal when it sits above the midline and rises, red when it sits below and falls, amber when position and slope disagree — the regime is on hold and regime-gated signals disarm until the two agree again.Markers are emoji, and every extreme marker sits directly on the boundary that fired it. A bull prints when the fast line reclaims the midline inside a bullish regime; a bear prints on the mirror event. A sprout prints when the fast line turns up through an oversold boundary, a diamond when that happens inside a bullish regime. A fire prints when the fast line rolls over through an overbought boundary, a trap when that happens inside a bearish regime, and a siren when the rollover coincides with the slow line stalling at elevated levels. Overbought and oversold are hybrid by default: enclosing bands drawn from the fast line's own recent statistics, lagged one bar so a spike is judged against pre-spike conditions, tighten the definition of extreme in quiet stretches, while the fixed levels stay armed as an absolute safety net — a crossback fires on either boundary. All four trigger boundaries are drawn as thin lines, so every marker can be traced to the exact line it crossed.
Background tints follow the short-term motion and carry small labels with the judgment, drawn along the top of the pane and horizontally centered on each episode; the ongoing episode's label slides until the episode closes, then freezes. A red tint marks a pullback zone — the slow line bullish while the fast line sits below the midline, a dip within an uptrend. A green tint marks a suspect rally — the slow line bearish while the fast line pushes above the midline, a bounce to distrust. A violet tint marks a volatility squeeze, when Bollinger bandwidth sits below a percentile threshold of its own history — quiet stretches that tend to precede expansions. An optional filter restricts the four entry signals to a release window after a squeeze; advisories and regime alerts are never filtered. Hidden data-window columns encode everything for the Pine Screener — long and short signal codes, regime, zone, squeeze, and two 0-100 gauges: regime pressure, which reads the slow line's health and rises as the regime nears a flip, and trigger proximity, which reads how close the fast line sits to its nearest event line — so each scan is a single numeric filter, while chart-only aids stay out of the column picker. Every event on the chart is subscribable as an alert: each of the seven markers fires exactly when its emoji prints, plus regime turns, zone starts, squeeze start and release, and a catch-all condition covering any marker. A separate runtime alert composes the exact marker names into the notification: create one alert on the "Any alert() function call" condition to receive named events from a single subscription; its wording is a template input customizable in the settings without editing code, with placeholders in the familiar double-brace style — symbol, exchange, timeframe, closing price, line readings, and the fired markers as emoji, names, or both — substituted by the script at runtime.
Inputs. The fast side takes the usual Bollinger length and multiplier. The slow side takes the Firefly lookback and smoothing length, with optional double smoothing and a ZLEMA variant. The consensus block sets the midline, the adaptive band length and multiplier, the fixed overbought and oversold levels, the elevated threshold for exhaustion, and a toggle requiring slope agreement for the regime, which makes signals stricter and later. The squeeze block sets the bandwidth lookback, the percentile threshold, and the release window.
Scope. An oscillator reads stretch, not regime-appropriateness: in a strong trend, extreme readings often mark strength rather than reversal, and the overheat cue in particular will fire repeatedly while price keeps running. Treat the markers as cues to investigate, not as a trading system, and let the slow line's color arbitrate which side of the book is open. The fast line is based on BBPCT% by AlgoAlpha; the slow line is based on the Firefly Oscillator by LazyBear, from an original idea by Yasu.
Notes de version
This oscillator plots one statistic at two speeds and trades their consensus. Both lines measure the same thing — the volatility-normalized deviation of price from a moving mean, a z-score. The fast line is raw Bollinger percent-B; the slow line is the same deviation passed through triple smoothing, in the style of the Firefly oscillator. Think of one sea surface decomposed into two frequencies: the slow line is the swell, the long-wavelength energy that sets the direction of the water; the fast line is the chop on top of it. Consensus signals ride the chop in the direction of the swell — the century-old tide-and-wave reading of markets, made spectral. The slow line defines the directional regime and wears its verdict as color: teal when it sits above the midline and rises, red when it sits below and falls, amber when position and slope disagree — the regime is on hold and regime-gated signals disarm until the two agree again.Markers are emoji, and every extreme marker sits directly on the boundary that fired it. A bull prints when the fast line reclaims the midline inside a bullish regime; a bear prints on the mirror event. A sprout prints when the fast line turns up through an oversold boundary, a diamond when that happens inside a bullish regime. A fire prints when the fast line rolls over through an overbought boundary, a trap when that happens inside a bearish regime, and a siren when the rollover coincides with the slow line stalling at elevated levels. Overbought and oversold are hybrid by default: enclosing bands drawn from the fast line's own recent statistics, lagged one bar so a spike is judged against pre-spike conditions, tighten the definition of extreme in quiet stretches, while the fixed levels stay armed as an absolute safety net — a crossback fires on either boundary. All four trigger boundaries are drawn as thin lines, so every marker can be traced to the exact line it crossed.
Background tints follow the short-term motion and carry small labels with the judgment, drawn along the top of the pane and horizontally centered on each episode; the ongoing episode's label slides until the episode closes, then freezes. A red tint marks a pullback zone — the slow line bullish while the fast line sits below the midline, a dip within an uptrend. A green tint marks a suspect rally — the slow line bearish while the fast line pushes above the midline, a bounce to distrust. A violet tint marks a volatility squeeze, when Bollinger bandwidth sits below a percentile threshold of its own history — quiet stretches that tend to precede expansions. An optional filter restricts the four entry signals to a release window after a squeeze; advisories and regime alerts are never filtered. Hidden data-window columns encode everything for the Pine Screener — long and short signal codes, regime, zone, squeeze, and two 0-100 gauges: regime pressure, which reads the slow line's health and rises as the regime nears a flip, and trigger proximity, which reads how close the fast line sits to its nearest event line — so each scan is a single numeric filter. They are declared right after the main lines so the screener's auto-added default filter set is exactly the useful ten; every plot remains available in its column list regardless of display settings. Every event on the chart is subscribable as an alert: each of the seven markers fires exactly when its emoji prints, plus regime turns, zone starts, squeeze start and release, and a catch-all condition covering any marker. A separate runtime alert composes the exact marker names into the notification: create one alert on the "Any alert() function call" condition to receive named events from a single subscription; its wording is a template input customizable in the settings without editing code, with placeholders in the familiar double-brace style — symbol, exchange, timeframe, closing price, line readings, and the fired markers as emoji, names, or both — substituted by the script at runtime.
Inputs. The fast side takes the usual Bollinger length and multiplier. The slow side takes the Firefly lookback and smoothing length, with optional double smoothing and a ZLEMA variant. The consensus block sets the midline, the adaptive band length and multiplier, the fixed overbought and oversold levels, the elevated threshold for exhaustion, and a toggle requiring slope agreement for the regime, which makes signals stricter and later. The squeeze block sets the bandwidth lookback, the percentile threshold, and the release window.
Scope. An oscillator reads stretch, not regime-appropriateness: in a strong trend, extreme readings often mark strength rather than reversal, and the overheat cue in particular will fire repeatedly while price keeps running. Treat the markers as cues to investigate, not as a trading system, and let the slow line's color arbitrate which side of the book is open. The fast line is based on BBPCT% by AlgoAlpha; the slow line is based on the Firefly Oscillator by LazyBear, from an original idea by Yasu.
Notes de version
Alerts overhaul: the catch-all "Any Marker" alertcondition has been replaced by two composite side alerts, so a single subscription now covers a whole direction.- "Any Long-Side Signal (dip-buying composite)" fires on 🐂 long trigger, 💎 oversold reversal, and 🌱 oversold rebound.
- "Any Short-Side Signal (rally-selling composite)" fires on 🐻 short trigger, 🪤 overbought reversal (trap), 🔥 overheat rollover, and 🚨 exhaustion.
A new toggle in the Alerts group ("Composite Side Alerts: regime-gated entries only", off by default) drops the regime-agnostic advisories (🌱 🔥 🚨) from the composites, leaving only the regime-gated entries (🐂 💎 long, 🐻 🪤 short).
All thirteen individual alerts are unchanged. Since alertcondition() messages are frozen constants, composite notifications list the possible markers rather than the exact one that fired; the named master alert ("Any alert() function call" condition) still composes the exact marker names at runtime and always covers the full marker set, ignoring the toggle.
No changes to calculations, plots, or markers. As always, alerts are snapshots of code plus inputs: delete and recreate existing alerts after this update, and recreate the composites if you later flip the strict toggle.
Notes de version
Pine Screener support overhaul. Calculations, markers, and alert logic are unchanged; this release only reorganizes the script's outputs so they load better in the Pine Screener, which auto-adds a script's first ten plots as its default filter and column set and the first two alert conditions as ready-made filters.The default ten columns now read: Firefly slow value, BBPCT fast value, Long signal code, Short signal code, Bars since long-side signal, Bars since short-side signal, Regime, Zone, Squeeze, and Regime pressure. The two new bars-since columns exist because screener scans are manual snapshots and one-bar signal pulses are easy to miss; a recency filter such as bars-since at most 3 is robust. Both follow the composite side definitions and therefore respect the strict toggle, which remains adjustable in the screener's settings dialog. The Firefly Signal line, empty unless enabled, no longer occupies a default column slot. The two composite side alerts now lead the alert list, so the screener's two auto-added alert filters are one per direction. The screener computes on the last 500 bars only; the 250-bar squeeze lookback fits within that window. As always, delete and recreate existing chart alerts after updating.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.
Script open-source
Dans l'esprit TradingView, le créateur de ce script l'a rendu open source afin que les traders puissent examiner et vérifier ses fonctionnalités. Bravo à l'auteur! Bien que vous puissiez l'utiliser gratuitement, n'oubliez pas que la republication du code est soumise à nos Règles.
Clause de non-responsabilité
Les informations et publications ne sont pas destinées à être, et ne constituent pas, des conseils ou recommandations financiers, d'investissement, de trading ou autres fournis ou approuvés par TradingView. Pour en savoir plus, consultez les Conditions d'utilisation.