OPEN-SOURCE SCRIPT
Mis à jour Artemis Squeeze Momentum

🟦 Artemis Squeeze Momentum collapses an entire momentum-and-volatility workflow into a single oscillator pane. Eight analytical layers — Squeeze Momentum core, Directional Flux, three-tier compression detection with a release tracker, dual confluence gauges, dual anchor Regular + Hidden divergence with a Smart AI Filter, a composite Trend Strength Score (0–100), a four-timeframe MTF Confluence panel with alignment / divergence detection, and a theme-adaptive PRO dashboard — operate as one integrated system, all driven by a single theme dropdown across 12 cohesive palettes.
Most squeeze indicators ship as a strip of black-and-red dots with a lone momentum histogram, then require a separate ADX, a separate divergence tool and a separate confluence gauge to complete the read. Artemis Squeeze Momentum closes that gap: every compression tier, every directional cross, every divergence, every higher-timeframe bias reads from the same pane in the same colour language — no inline colour pickers, no palette drift, no pane-hopping. The result is a complete momentum workbench where compressions, breakouts, regime flips, divergences and multi-TF bias are all readable at a glance.
🟦 HOW THE CORE ENGINE WORKS
**Squeeze Momentum Engine**
Each bar, the engine builds three anchors over the Momentum Length window:
1. **Channel midpoint** — `(highest(high, len) + lowest(low, len)) / 2`
2. **Smoothed midline** — `SMA(HL2, len)`
3. **Channel ATR** — channel range plus the gap-to-prior-close component (matches Pine v5 `tr(true)` on the synthetic channel bar)
The raw momentum is then computed as:
mom_raw = (close − avg(channelMid, smaMid)) / channelATR × 100
This produces a channel-aware, ATR-normalized residual scaled to roughly the ±100 range. The result is then passed through `ta.linreg(mom_raw, len, 0)` to produce the visible momentum line — a linear-regression smoothing that gives the curve its characteristic forward-leaning shape. An SMA of length Signal Length builds the trigger line. Crossovers between momentum and signal mark momentum regime changes — the same convention used by classical MACD.
**Directional Flux**
A custom ADX-style oscillator running in parallel. Each bar, the engine measures positive high-changes vs. negative low-changes, each RMA-smoothed and ATR-normalized:
up = RMA(max(change(high), 0), len) / ATR(len)
dn = RMA(max(−change(low), 0), len) / ATR(len)
ratio = (up − dn) / (up + dn)
flux = RMA(ratio, len / 2) × 100
The result is a directional bias oscillator bounded to ±100. An overflow branch (values past ±25 — where the directional pressure becomes structurally significant) renders as a separate, brighter fill so traders read both raw direction and acceleration in one glance.
**Heiken Ashi Bias (Optional)**
When `Use Heiken Ashi Bias` is enabled, the Flux engine reads from a Heiken Ashi bar stream instead of raw OHLC. HA bars smooth body / wick noise and emphasise trend continuation — useful on lower timeframes where raw OHLC is noisy.
🟦 SQUEEZE DETECTION
A three-tier Bollinger-vs-ATR compression detector running on the same Length as the Momentum Core (so compression and momentum stay perfectly aligned):
| Tier | Condition | Visual |
|---|---|---|
| Tight | stdev < ATR × 0.5 | Deepest, most saturated theme tone |
| Mid | stdev < ATR × 0.75 | Middle-intensity theme tone |
| Loose | stdev < ATR × 1.0 | Lightest tier — broadest detection |
Tiers nest — tight implies mid implies loose. The bottom-of-pane squeeze column lights up whenever any tier is active and the colour escalates as compression tightens, using a theme-native ramp drawn from each palette's own colour family (so the column reads as part of the theme rather than an imported generic warning).
The standard deviation is computed via a single-pass Welford algorithm — numerically stable on long histories where naive sum-of-squares accumulators drift.
**♦ Squeeze Release Marker**
The signature feature of the engine. The bar after the loosest active tier (stdev < ATR × 1.0) finally drops off, a tiny ♦ diamond paints at the midline in the theme's vivid release accent — one step brighter and more saturated than the tight tier so the climax moment reads as the most luminous point in the squeeze cycle.
This is the canonical "spring uncoiled" moment: compression has fully ended, volatility expansion begins, breakout direction is about to reveal itself. Historically the highest-conviction breakout setup the squeeze model produces. Hovering on the marker surfaces:
- Current bar state (compression ended this bar)
- Meaning (volatility expansion incoming)
- Next steps (watch the next 1–5 bars, confirm with Momentum slope, cross-check Flux, prioritise MTF-aligned setups)
🟦 CONFLUENCE GAUGES
Two horizontal strips render at the top (Bull side, +70 to +75) and bottom (Bear side, −70 to −75) of the pane. Each strip lights up when momentum and flux agree on direction, with brightness reflecting the confluence tier:
| State | Condition | Opacity |
|---|---|---|
| Strong Bull | mom > 0 AND flux > 0 | Full |
| Weak Bull | mom > 0 OR flux > 0 | Half |
| Strong Bear | mom < 0 AND flux < 0 | Full |
| Weak Bear | mom < 0 OR flux < 0 | Half |
| Neutral | Neither side dominates | Transparent |
The display mode (Both / Bull / Bear / None) lets traders mute one half if they only trade one direction.
**Confluence Buy / Sell Triangles**
A separate signal layer rides outside the gauges. The detector fires only when momentum crosses its signal line WHILE in the opposite zone past the Signal Threshold AND with flux in the opposite direction (classic mean-reversion logic):
- **Buy ▲** (below bear gauge at −90) — `xMomUp AND momVal < −threshold AND fluxVal < 0`
- **Sell ▼** (above bull gauge at +85) — `xMomDn AND momVal > +threshold AND fluxVal > 0`
Each triangle pairs with an invisible label carrying a tooltip that lists current mom, signal, flux, the active threshold, and a one-line interpretation of the trigger. The Signal Threshold (default 40) is independent of the Divergence Sensitivity setting — the two engines need different thresholds (divergence wants permissive at 25 for pivot detection, confluence wants strict at 40 for deep mean-reversion triggers).
🟦 DIVERGENCE DETECTION
A cross-confirmed, dual-anchor detector that fires on signal-line crossovers (NOT on Pine pivots). Regular divergences signal exhaustion reversals, Hidden divergences signal trend continuation.
**Four divergence types:**
| Type | Price | Momentum | Signal |
|---|---|---|---|
| Regular Bull (D▲) | Lower Low | Higher Low | Potential reversal up |
| Regular Bear (D▼) | Higher High | Lower High | Potential reversal down |
| Hidden Bull (H▲) | Higher Low | Lower Low | Uptrend continuation |
| Hidden Bear (H▼) | Lower High | Higher High | Downtrend continuation |
Regular divergence uses solid lines; Hidden uses dashed lines — visually quieter to match the continuation signal's lower conviction tier. Labels (D▲ / D▼ / H▲ / H▼) each carry a tooltip-rich hover with price + momentum + meaning context.
**Dual-Anchor Logic**
The key engineering choice. Regular and Hidden divergences each maintain their own separate anchor pair:
- **Regular anchors** — stored only at extreme-zone crosses (|mom| > Sensitivity). Catches classical exhaustion reversals at deep extremes.
- **Hidden anchors** — stored at ANY signal-line cross, regardless of zone. Shallow pullbacks inside an established trend rarely push momentum past ±Sensitivity, so the Hidden detector must accept every cross to capture the classical "price HL + mom LL" / "price LH + mom HH" continuation pattern.
A detected divergence consumes its anchor (resets to na) so the next setup starts fresh.
**Smart Divergence Filter (AI)**
Optional pre-filter that rejects low-quality divergences before they render. Three independent gates:
1. **Min Momentum Swing** — minimum |momentum| difference between the two pivot momentum values (default: 10 units). Drops noise-level differences.
2. **Min Price Swing (%)** — minimum price swing between pivots as a percentage of the recent `Momentum Length × 4` high-low range (default: 0.3%). Drops divergences where price barely moved relative to recent volatility.
3. **Require Flux Confirmation** — Flux must agree with the divergence direction at the moment of detection (Bull div needs Flux > 0, Bear div needs Flux < 0). Filters out divergences that fire counter to the broader directional bias.
When the master toggle is OFF (default), all detected divergences render. When ON, only divergences that clear all three gates survive. The filter applies identically to chart rendering and alert conditions — no mismatch between visual and alert signals.
🟦 COMPOSITE TS SCORE (0–100)
A weighted blend of every analytical layer into a single RSI-style 0–100 reading. 50 is neutral, > 50 leans bull, < 50 leans bear.
| Component | Weight | Mapping |
|---|---|---|
| Momentum | 30% | mom value mapped from −100..+100 → 0..100 |
| Flux | 30% | flux value mapped the same way |
| Mom × Signal | 15% | 70 if mom > sig, else 30 (slope direction confirmation) |
| Confluence | 25% | 90 strong-bull / 65 weak-bull / 50 neutral / 35 weak-bear / 10 strong-bear |
The score is rounded to the nearest integer and labelled into five tiers in the dashboard: STRONG BULL (≥75) / BULL (≥60) / NEUTRAL (40–59) / BEAR (≥25) / STRONG BEAR (<25), each prefixed with a directional glyph (▲ ▼ ■). The tier label gives traders an executive summary at a glance — one row in the dashboard tells you what every other row collectively says.
🟦 MULTI-TIMEFRAME CONFLUENCE
A separate PRO panel that runs the full Momentum + Flux + Confluence stack on four higher timeframes simultaneously via `request.security()` and surfaces the overall alignment state. All MTF calls use `lookahead = barmerge.lookahead_off` — fully repaint-safe on every closed bar.
**Six Presets**
Pre-tuned four-timeframe packs matched to common trader profiles:
| Preset | TF 1 | TF 2 | TF 3 | TF 4 | Use case |
|---|---|---|---|---|---|
| Scalp | 1m | 5m | 15m | 1h | Fast scalper |
| Intraday | 5m | 15m | 1h | 4h | Day trader |
| Swing | 15m | 1h | 4h | 1D | Default — swing trader |
| Position | 1h | 4h | 1D | 1W | Position trader |
| Crypto | 5m | 15m | 1h | 4h | 24/7 markets |
| Forex | 15m | 1h | 4h | 1D | Session-based markets |
**Alignment Detection**
Each TF returns a bias tag (▲ STRONG / ▲ WEAK / ▼ STRONG / ▼ WEAK / ◈ NEUTRAL) and a direction code (+1 / 0 / −1). The header rolls up the four codes into one of three states:
- **▲▲▲▲ ALIGNED** — all four TFs bullish (highest-conviction long setup)
- **▼▼▼▼ ALIGNED** — all four TFs bearish (highest-conviction short setup)
- **◈ MIXED** — TFs disagree (no clean direction)
**Divergence Detection**
When the current chart's bias contradicts ≥ 3 of the 4 HTF biases (e.g., chart bullish but 3+ HTFs bearish), an MTF Divergence flag fires — a contrarian / counter-trend warning. Treat as a "current move may be a bull / bear trap" signal.
**Panel Style**
Direction is conveyed purely by the ▲ / ▼ glyphs in each row's tag — never by cell colour. Every cell uses a uniform `thBull` text colour matching the main Dashboard, so the two panels feel like one product across all twelve themes, light and dark alike.
🟦 BAR COLORING
Five mutually exclusive modes apply an oscillator-driven colour to every price bar on the chart:
| Mode | Behavior |
|---|---|
| None | Leave bars untouched (default) |
| Momentum | Bull when mom > 0, bear when mom < 0 |
| Flux | Bull when flux > 0, bear when flux < 0 |
| Squeeze | Theme-native ramp when compressed, neutral otherwise |
| Confluence | Strong / Weak / Neutral tiers via mom + flux agreement |
| Slope | Bull when mom > signal, bear when mom < signal |
Colours are pulled from the active theme — no per-mode color picker needed.
🟦 DASHBOARD
A compact 2-column, 8-row data panel renders on the last bar when enabled. Every value derives from variables already computed upstream, so the dashboard adds zero overhead until the final bar.
| Row | Left | Right |
|---|---|---|
| Header | Artemis Squeeze | ▲ STRONG BULL / ▲ WEAK BULL / ■ NEUTRAL / ▼ WEAK BEAR / ▼ STRONG BEAR |
| TS Score | TS Score | 0–100 composite + tier label (STRONG BULL / BULL / NEUTRAL / BEAR / STRONG BEAR) |
| Momentum | Momentum | Current value + trend arrow (▲ ▼ ■) |
| Flux | Flux | Current value + trend arrow (▲ ▼ ■) |
| Squeeze | Squeeze | TIGHT / MID / LOOSE / — |
| Confluence | Confluence | STRONG BULL / WEAK BULL / NONE / WEAK BEAR / STRONG BEAR |
| Div | Div | Most recent divergence within last 50 bars (▲ REG / ▼ REG / ▲ HID / ▼ HID / —) |
| Slope | Slope | ▲ UP / ▼ DOWN / ■ FLAT |
**Theme-Adaptive Chrome**
The dashboard auto-inverts its layout based on the active theme:
- **Dark themes** (Tropic, Amber, Pastel, Cyber, Helios, Electric, Candy, Bloomberg, Solar, Royal): header and footer use a faint `thBull` tint, middle rows stay solid dark, text uses full-saturation `thBull`. Border uses `thBull` at 20% transparency for strong theme presence.
- **Light themes** (Midnight, Graphite): backgrounds flip to white, text stays `thBull` (which is itself dark on these themes), border uses `thBull` at 40% transparency.
This guarantees text legibility against every palette without per-theme manual tuning. The MTF Confluence panel uses identical chrome rules so the two panels feel like one product.
**Position & Size**
Six anchor slots (Top / Middle / Bottom × Left / Right) and four text sizes (Tiny / Small / Normal / Large). The Dashboard defaults to Bottom Right and the MTF panel to Top Right — vertically opposite so the two never overlap.
🟦 COLOR THEMES
Twelve cohesive palettes, each resolving to four axis colours plus a four-step squeeze ramp:
| Theme | Character | Bull | Bear |
|---|---|---|---|
| Tropic | Cyan steel + deep orange | #00bcd4 | #ff6d00 |
| Amber | Warm amber + ember red | #ff9800 | #e53935 |
| Pastel | Sky blue + soft lavender | #4fc3f7 | #9575cd |
| Cyber | Neon lime + hot crimson | #00e676 | #ff1744 |
| Helios | Bright gold + scarlet | #ffd600 | #ef5350 |
| Electric | Electric aqua + magenta | #00e5ff | #e040fb |
| Candy | Neon green + hot pink | #69F0AE | #FF4081 |
| Bloomberg | Terminal orange + cyan | #ff8c00 | #00b0ff |
| Solar | Solarized olive + crimson | #859900 | #dc322f |
| Royal | Imperial gold + deep purple | #ffd700 | #6a0dad |
| Midnight | Deep navy + dark crimson | #0d47a1 | #b71c1c |
| Graphite | Near-black + silver grey | #1a1a1a | #757575 |
Beyond the four axis colours (bull / bear / neutral / signal), each theme also defines its own four-step squeeze ramp (tight / mid / loose / release) drawn from its own colour family — so the squeeze column and the ♦ release marker harmonise with the active theme rather than imposing a generic warning hue. Nothing below the theme resolver block references a raw hex literal, so a single dropdown selection drives every plot, fill, gauge, divergence line, dashboard cell, MTF panel and bar colour.
🟦 ALERT SYSTEM
Twenty-two alert conditions, all using `alert.freq_once_per_bar_close`. Each alert is gated by its own toggle in the Alerts group — hiding a feature on the chart silences its alerts automatically.
| Alert | Condition |
|---|---|
| Confluence Buy | Mom crossed UP through signal while below −Threshold AND Flux bearish |
| Confluence Sell | Mom crossed DOWN through signal while above +Threshold AND Flux bullish |
| Momentum Cross Up | Mom crossed above zero |
| Momentum Cross Down | Mom crossed below zero |
| Flux Cross Up | Flux crossed above zero |
| Flux Cross Down | Flux crossed below zero |
| Bullish Swing | Mom × signal upward cross (any zone) |
| Bearish Swing | Mom × signal downward cross (any zone) |
| Strong Bull Confluence | Mom AND flux both turned bullish |
| Strong Bear Confluence | Mom AND flux both turned bearish |
| Weak Bull Confluence | Mom OR flux turned bullish |
| Weak Bear Confluence | Mom OR flux turned bearish |
| Tight Squeeze | stdev < ATR × 0.5 |
| Mid Squeeze | stdev < ATR × 0.75 |
| Loose Squeeze | stdev < ATR × 1.0 |
| Regular Divergence | D▲ or D▼ detected (respects Smart Filter) |
| Hidden Divergence | H▲ or H▼ detected (respects Smart Filter) |
| Squeeze Release ♦ | stdev re-expanded above ATR × 1.0 |
| MTF Aligned | All four MTF timeframes agree on direction |
| MTF Divergence | Current chart bias contradicts ≥ 3 of 4 HTF biases |
Each alert fires through `alert()` so the message body carries live context — direction, current values, the trigger condition, and a one-line interpretation. Divergence alerts respect the Smart Filter — if the filter is ON and a divergence is rejected visually, the alert will also not fire.
🟦 SETTINGS REFERENCE
**Visual**
- Theme — 12 cohesive palettes. Default: Tropic
**Bar Coloring**
- Bar Color Mode — None / Momentum / Flux / Squeeze / Confluence / Slope. Default: None
**Momentum Core**
- Length — Lookback for both the Momentum engine and the Squeeze window. Range 7–50. Default: 20
- Signal Length — SMA smoothing for the signal line. Range 2–7. Default: 3
- Show Momentum — Toggle. Default: ON
**Directional Flux**
- Length — Lookback for the Flux engine. Range 7–50. Default: 30
- Use Heiken Ashi Bias — Toggle. Default: OFF
- Show Flux — Toggle. Default: ON
**Squeeze Engine**
- Show Squeeze — Toggle. Default: ON
- Show Squeeze Release — Toggle for the ♦ marker. Default: ON
**Confluence Gauges**
- Display Mode — Both / Bull / Bear / None. Default: Both
- Signal Threshold — |momentum| floor for Buy ▲ / Sell ▼ arrows. Range 10–80. Default: 40
**Divergence**
- Sensitivity — |momentum| floor for Regular div detection. Range 10–50. Default: 25
- Regular Divergence — Toggle. Default: ON
- Hidden Divergence — Toggle. Default: ON
- Show Divergence Lines — Toggle. Default: ON
- Show Divergence Labels — Toggle. Default: ON
- Label Size — Tiny / Small / Normal / Large. Default: Tiny
- Smart Divergence Filter (AI) — Master toggle. Default: OFF
- Min Momentum Swing — Default: 10.0
- Min Price Swing (%) — Default: 0.3%
- Require Flux Confirmation — Default: ON
**Multi-Timeframe**
- Show MTF Panel — Toggle. Default: ON
- Timeframe Preset — Scalp / Intraday / Swing / Position / Crypto / Forex. Default: Swing
- Panel Position — 6 anchor slots. Default: Top Right
- Panel Text Size — Tiny / Small / Normal / Large. Default: Small
**Dashboard**
- Show Dashboard — Toggle. Default: ON
- Panel Position — 6 anchor slots. Default: Bottom Right
- Panel Text Size — Tiny / Small / Normal / Large. Default: Small
**Alerts**
- 20 toggles covering all 22 alert conditions (Regular and Hidden divergence each drive two alerts — bull + bear — from one toggle).
- Defaults ON: Confluence Buy/Sell, Mom Cross Up/Dn, Flux Cross Up/Dn, Strong Bull/Bear Confluence, Tight Squeeze, Regular Divergence, Squeeze Release, MTF Aligned.
- Defaults OFF: Swings, Weak Confluences, Mid/Loose Squeeze, Hidden Divergence, MTF Divergence.
🟦 COMPATIBILITY
Works on all asset classes and all timeframes in TradingView Pine Script v6.
- Crypto: Spot, futures, perpetual contracts
- Forex: All pairs
- Equities: Stocks, ETFs, indices
- Commodities: Metals, energy, agriculture
- Timeframes: 1m through Monthly
The channel-aware ATR normalization in the Momentum engine, the ATR-normalized Flux ratio, and the stdev / ATR squeeze tests make every layer volatility-agnostic. The same default settings work on a 1m BTC chart and a weekly index chart without retuning. The MTF presets cover the common scalp / intraday / swing / position profiles plus dedicated Crypto and Forex packs.
🟦 DISCLAIMER
This indicator is provided for educational and informational purposes only. It does not constitute financial advice. Past performance does not guarantee future results. Always conduct your own analysis and apply proper risk management.
Most squeeze indicators ship as a strip of black-and-red dots with a lone momentum histogram, then require a separate ADX, a separate divergence tool and a separate confluence gauge to complete the read. Artemis Squeeze Momentum closes that gap: every compression tier, every directional cross, every divergence, every higher-timeframe bias reads from the same pane in the same colour language — no inline colour pickers, no palette drift, no pane-hopping. The result is a complete momentum workbench where compressions, breakouts, regime flips, divergences and multi-TF bias are all readable at a glance.
🟦 HOW THE CORE ENGINE WORKS
**Squeeze Momentum Engine**
Each bar, the engine builds three anchors over the Momentum Length window:
1. **Channel midpoint** — `(highest(high, len) + lowest(low, len)) / 2`
2. **Smoothed midline** — `SMA(HL2, len)`
3. **Channel ATR** — channel range plus the gap-to-prior-close component (matches Pine v5 `tr(true)` on the synthetic channel bar)
The raw momentum is then computed as:
mom_raw = (close − avg(channelMid, smaMid)) / channelATR × 100
This produces a channel-aware, ATR-normalized residual scaled to roughly the ±100 range. The result is then passed through `ta.linreg(mom_raw, len, 0)` to produce the visible momentum line — a linear-regression smoothing that gives the curve its characteristic forward-leaning shape. An SMA of length Signal Length builds the trigger line. Crossovers between momentum and signal mark momentum regime changes — the same convention used by classical MACD.
**Directional Flux**
A custom ADX-style oscillator running in parallel. Each bar, the engine measures positive high-changes vs. negative low-changes, each RMA-smoothed and ATR-normalized:
up = RMA(max(change(high), 0), len) / ATR(len)
dn = RMA(max(−change(low), 0), len) / ATR(len)
ratio = (up − dn) / (up + dn)
flux = RMA(ratio, len / 2) × 100
The result is a directional bias oscillator bounded to ±100. An overflow branch (values past ±25 — where the directional pressure becomes structurally significant) renders as a separate, brighter fill so traders read both raw direction and acceleration in one glance.
**Heiken Ashi Bias (Optional)**
When `Use Heiken Ashi Bias` is enabled, the Flux engine reads from a Heiken Ashi bar stream instead of raw OHLC. HA bars smooth body / wick noise and emphasise trend continuation — useful on lower timeframes where raw OHLC is noisy.
🟦 SQUEEZE DETECTION
A three-tier Bollinger-vs-ATR compression detector running on the same Length as the Momentum Core (so compression and momentum stay perfectly aligned):
| Tier | Condition | Visual |
|---|---|---|
| Tight | stdev < ATR × 0.5 | Deepest, most saturated theme tone |
| Mid | stdev < ATR × 0.75 | Middle-intensity theme tone |
| Loose | stdev < ATR × 1.0 | Lightest tier — broadest detection |
Tiers nest — tight implies mid implies loose. The bottom-of-pane squeeze column lights up whenever any tier is active and the colour escalates as compression tightens, using a theme-native ramp drawn from each palette's own colour family (so the column reads as part of the theme rather than an imported generic warning).
The standard deviation is computed via a single-pass Welford algorithm — numerically stable on long histories where naive sum-of-squares accumulators drift.
**♦ Squeeze Release Marker**
The signature feature of the engine. The bar after the loosest active tier (stdev < ATR × 1.0) finally drops off, a tiny ♦ diamond paints at the midline in the theme's vivid release accent — one step brighter and more saturated than the tight tier so the climax moment reads as the most luminous point in the squeeze cycle.
This is the canonical "spring uncoiled" moment: compression has fully ended, volatility expansion begins, breakout direction is about to reveal itself. Historically the highest-conviction breakout setup the squeeze model produces. Hovering on the marker surfaces:
- Current bar state (compression ended this bar)
- Meaning (volatility expansion incoming)
- Next steps (watch the next 1–5 bars, confirm with Momentum slope, cross-check Flux, prioritise MTF-aligned setups)
🟦 CONFLUENCE GAUGES
Two horizontal strips render at the top (Bull side, +70 to +75) and bottom (Bear side, −70 to −75) of the pane. Each strip lights up when momentum and flux agree on direction, with brightness reflecting the confluence tier:
| State | Condition | Opacity |
|---|---|---|
| Strong Bull | mom > 0 AND flux > 0 | Full |
| Weak Bull | mom > 0 OR flux > 0 | Half |
| Strong Bear | mom < 0 AND flux < 0 | Full |
| Weak Bear | mom < 0 OR flux < 0 | Half |
| Neutral | Neither side dominates | Transparent |
The display mode (Both / Bull / Bear / None) lets traders mute one half if they only trade one direction.
**Confluence Buy / Sell Triangles**
A separate signal layer rides outside the gauges. The detector fires only when momentum crosses its signal line WHILE in the opposite zone past the Signal Threshold AND with flux in the opposite direction (classic mean-reversion logic):
- **Buy ▲** (below bear gauge at −90) — `xMomUp AND momVal < −threshold AND fluxVal < 0`
- **Sell ▼** (above bull gauge at +85) — `xMomDn AND momVal > +threshold AND fluxVal > 0`
Each triangle pairs with an invisible label carrying a tooltip that lists current mom, signal, flux, the active threshold, and a one-line interpretation of the trigger. The Signal Threshold (default 40) is independent of the Divergence Sensitivity setting — the two engines need different thresholds (divergence wants permissive at 25 for pivot detection, confluence wants strict at 40 for deep mean-reversion triggers).
🟦 DIVERGENCE DETECTION
A cross-confirmed, dual-anchor detector that fires on signal-line crossovers (NOT on Pine pivots). Regular divergences signal exhaustion reversals, Hidden divergences signal trend continuation.
**Four divergence types:**
| Type | Price | Momentum | Signal |
|---|---|---|---|
| Regular Bull (D▲) | Lower Low | Higher Low | Potential reversal up |
| Regular Bear (D▼) | Higher High | Lower High | Potential reversal down |
| Hidden Bull (H▲) | Higher Low | Lower Low | Uptrend continuation |
| Hidden Bear (H▼) | Lower High | Higher High | Downtrend continuation |
Regular divergence uses solid lines; Hidden uses dashed lines — visually quieter to match the continuation signal's lower conviction tier. Labels (D▲ / D▼ / H▲ / H▼) each carry a tooltip-rich hover with price + momentum + meaning context.
**Dual-Anchor Logic**
The key engineering choice. Regular and Hidden divergences each maintain their own separate anchor pair:
- **Regular anchors** — stored only at extreme-zone crosses (|mom| > Sensitivity). Catches classical exhaustion reversals at deep extremes.
- **Hidden anchors** — stored at ANY signal-line cross, regardless of zone. Shallow pullbacks inside an established trend rarely push momentum past ±Sensitivity, so the Hidden detector must accept every cross to capture the classical "price HL + mom LL" / "price LH + mom HH" continuation pattern.
A detected divergence consumes its anchor (resets to na) so the next setup starts fresh.
**Smart Divergence Filter (AI)**
Optional pre-filter that rejects low-quality divergences before they render. Three independent gates:
1. **Min Momentum Swing** — minimum |momentum| difference between the two pivot momentum values (default: 10 units). Drops noise-level differences.
2. **Min Price Swing (%)** — minimum price swing between pivots as a percentage of the recent `Momentum Length × 4` high-low range (default: 0.3%). Drops divergences where price barely moved relative to recent volatility.
3. **Require Flux Confirmation** — Flux must agree with the divergence direction at the moment of detection (Bull div needs Flux > 0, Bear div needs Flux < 0). Filters out divergences that fire counter to the broader directional bias.
When the master toggle is OFF (default), all detected divergences render. When ON, only divergences that clear all three gates survive. The filter applies identically to chart rendering and alert conditions — no mismatch between visual and alert signals.
🟦 COMPOSITE TS SCORE (0–100)
A weighted blend of every analytical layer into a single RSI-style 0–100 reading. 50 is neutral, > 50 leans bull, < 50 leans bear.
| Component | Weight | Mapping |
|---|---|---|
| Momentum | 30% | mom value mapped from −100..+100 → 0..100 |
| Flux | 30% | flux value mapped the same way |
| Mom × Signal | 15% | 70 if mom > sig, else 30 (slope direction confirmation) |
| Confluence | 25% | 90 strong-bull / 65 weak-bull / 50 neutral / 35 weak-bear / 10 strong-bear |
The score is rounded to the nearest integer and labelled into five tiers in the dashboard: STRONG BULL (≥75) / BULL (≥60) / NEUTRAL (40–59) / BEAR (≥25) / STRONG BEAR (<25), each prefixed with a directional glyph (▲ ▼ ■). The tier label gives traders an executive summary at a glance — one row in the dashboard tells you what every other row collectively says.
🟦 MULTI-TIMEFRAME CONFLUENCE
A separate PRO panel that runs the full Momentum + Flux + Confluence stack on four higher timeframes simultaneously via `request.security()` and surfaces the overall alignment state. All MTF calls use `lookahead = barmerge.lookahead_off` — fully repaint-safe on every closed bar.
**Six Presets**
Pre-tuned four-timeframe packs matched to common trader profiles:
| Preset | TF 1 | TF 2 | TF 3 | TF 4 | Use case |
|---|---|---|---|---|---|
| Scalp | 1m | 5m | 15m | 1h | Fast scalper |
| Intraday | 5m | 15m | 1h | 4h | Day trader |
| Swing | 15m | 1h | 4h | 1D | Default — swing trader |
| Position | 1h | 4h | 1D | 1W | Position trader |
| Crypto | 5m | 15m | 1h | 4h | 24/7 markets |
| Forex | 15m | 1h | 4h | 1D | Session-based markets |
**Alignment Detection**
Each TF returns a bias tag (▲ STRONG / ▲ WEAK / ▼ STRONG / ▼ WEAK / ◈ NEUTRAL) and a direction code (+1 / 0 / −1). The header rolls up the four codes into one of three states:
- **▲▲▲▲ ALIGNED** — all four TFs bullish (highest-conviction long setup)
- **▼▼▼▼ ALIGNED** — all four TFs bearish (highest-conviction short setup)
- **◈ MIXED** — TFs disagree (no clean direction)
**Divergence Detection**
When the current chart's bias contradicts ≥ 3 of the 4 HTF biases (e.g., chart bullish but 3+ HTFs bearish), an MTF Divergence flag fires — a contrarian / counter-trend warning. Treat as a "current move may be a bull / bear trap" signal.
**Panel Style**
Direction is conveyed purely by the ▲ / ▼ glyphs in each row's tag — never by cell colour. Every cell uses a uniform `thBull` text colour matching the main Dashboard, so the two panels feel like one product across all twelve themes, light and dark alike.
🟦 BAR COLORING
Five mutually exclusive modes apply an oscillator-driven colour to every price bar on the chart:
| Mode | Behavior |
|---|---|
| None | Leave bars untouched (default) |
| Momentum | Bull when mom > 0, bear when mom < 0 |
| Flux | Bull when flux > 0, bear when flux < 0 |
| Squeeze | Theme-native ramp when compressed, neutral otherwise |
| Confluence | Strong / Weak / Neutral tiers via mom + flux agreement |
| Slope | Bull when mom > signal, bear when mom < signal |
Colours are pulled from the active theme — no per-mode color picker needed.
🟦 DASHBOARD
A compact 2-column, 8-row data panel renders on the last bar when enabled. Every value derives from variables already computed upstream, so the dashboard adds zero overhead until the final bar.
| Row | Left | Right |
|---|---|---|
| Header | Artemis Squeeze | ▲ STRONG BULL / ▲ WEAK BULL / ■ NEUTRAL / ▼ WEAK BEAR / ▼ STRONG BEAR |
| TS Score | TS Score | 0–100 composite + tier label (STRONG BULL / BULL / NEUTRAL / BEAR / STRONG BEAR) |
| Momentum | Momentum | Current value + trend arrow (▲ ▼ ■) |
| Flux | Flux | Current value + trend arrow (▲ ▼ ■) |
| Squeeze | Squeeze | TIGHT / MID / LOOSE / — |
| Confluence | Confluence | STRONG BULL / WEAK BULL / NONE / WEAK BEAR / STRONG BEAR |
| Div | Div | Most recent divergence within last 50 bars (▲ REG / ▼ REG / ▲ HID / ▼ HID / —) |
| Slope | Slope | ▲ UP / ▼ DOWN / ■ FLAT |
**Theme-Adaptive Chrome**
The dashboard auto-inverts its layout based on the active theme:
- **Dark themes** (Tropic, Amber, Pastel, Cyber, Helios, Electric, Candy, Bloomberg, Solar, Royal): header and footer use a faint `thBull` tint, middle rows stay solid dark, text uses full-saturation `thBull`. Border uses `thBull` at 20% transparency for strong theme presence.
- **Light themes** (Midnight, Graphite): backgrounds flip to white, text stays `thBull` (which is itself dark on these themes), border uses `thBull` at 40% transparency.
This guarantees text legibility against every palette without per-theme manual tuning. The MTF Confluence panel uses identical chrome rules so the two panels feel like one product.
**Position & Size**
Six anchor slots (Top / Middle / Bottom × Left / Right) and four text sizes (Tiny / Small / Normal / Large). The Dashboard defaults to Bottom Right and the MTF panel to Top Right — vertically opposite so the two never overlap.
🟦 COLOR THEMES
Twelve cohesive palettes, each resolving to four axis colours plus a four-step squeeze ramp:
| Theme | Character | Bull | Bear |
|---|---|---|---|
| Tropic | Cyan steel + deep orange | #00bcd4 | #ff6d00 |
| Amber | Warm amber + ember red | #ff9800 | #e53935 |
| Pastel | Sky blue + soft lavender | #4fc3f7 | #9575cd |
| Cyber | Neon lime + hot crimson | #00e676 | #ff1744 |
| Helios | Bright gold + scarlet | #ffd600 | #ef5350 |
| Electric | Electric aqua + magenta | #00e5ff | #e040fb |
| Candy | Neon green + hot pink | #69F0AE | #FF4081 |
| Bloomberg | Terminal orange + cyan | #ff8c00 | #00b0ff |
| Solar | Solarized olive + crimson | #859900 | #dc322f |
| Royal | Imperial gold + deep purple | #ffd700 | #6a0dad |
| Midnight | Deep navy + dark crimson | #0d47a1 | #b71c1c |
| Graphite | Near-black + silver grey | #1a1a1a | #757575 |
Beyond the four axis colours (bull / bear / neutral / signal), each theme also defines its own four-step squeeze ramp (tight / mid / loose / release) drawn from its own colour family — so the squeeze column and the ♦ release marker harmonise with the active theme rather than imposing a generic warning hue. Nothing below the theme resolver block references a raw hex literal, so a single dropdown selection drives every plot, fill, gauge, divergence line, dashboard cell, MTF panel and bar colour.
🟦 ALERT SYSTEM
Twenty-two alert conditions, all using `alert.freq_once_per_bar_close`. Each alert is gated by its own toggle in the Alerts group — hiding a feature on the chart silences its alerts automatically.
| Alert | Condition |
|---|---|
| Confluence Buy | Mom crossed UP through signal while below −Threshold AND Flux bearish |
| Confluence Sell | Mom crossed DOWN through signal while above +Threshold AND Flux bullish |
| Momentum Cross Up | Mom crossed above zero |
| Momentum Cross Down | Mom crossed below zero |
| Flux Cross Up | Flux crossed above zero |
| Flux Cross Down | Flux crossed below zero |
| Bullish Swing | Mom × signal upward cross (any zone) |
| Bearish Swing | Mom × signal downward cross (any zone) |
| Strong Bull Confluence | Mom AND flux both turned bullish |
| Strong Bear Confluence | Mom AND flux both turned bearish |
| Weak Bull Confluence | Mom OR flux turned bullish |
| Weak Bear Confluence | Mom OR flux turned bearish |
| Tight Squeeze | stdev < ATR × 0.5 |
| Mid Squeeze | stdev < ATR × 0.75 |
| Loose Squeeze | stdev < ATR × 1.0 |
| Regular Divergence | D▲ or D▼ detected (respects Smart Filter) |
| Hidden Divergence | H▲ or H▼ detected (respects Smart Filter) |
| Squeeze Release ♦ | stdev re-expanded above ATR × 1.0 |
| MTF Aligned | All four MTF timeframes agree on direction |
| MTF Divergence | Current chart bias contradicts ≥ 3 of 4 HTF biases |
Each alert fires through `alert()` so the message body carries live context — direction, current values, the trigger condition, and a one-line interpretation. Divergence alerts respect the Smart Filter — if the filter is ON and a divergence is rejected visually, the alert will also not fire.
🟦 SETTINGS REFERENCE
**Visual**
- Theme — 12 cohesive palettes. Default: Tropic
**Bar Coloring**
- Bar Color Mode — None / Momentum / Flux / Squeeze / Confluence / Slope. Default: None
**Momentum Core**
- Length — Lookback for both the Momentum engine and the Squeeze window. Range 7–50. Default: 20
- Signal Length — SMA smoothing for the signal line. Range 2–7. Default: 3
- Show Momentum — Toggle. Default: ON
**Directional Flux**
- Length — Lookback for the Flux engine. Range 7–50. Default: 30
- Use Heiken Ashi Bias — Toggle. Default: OFF
- Show Flux — Toggle. Default: ON
**Squeeze Engine**
- Show Squeeze — Toggle. Default: ON
- Show Squeeze Release — Toggle for the ♦ marker. Default: ON
**Confluence Gauges**
- Display Mode — Both / Bull / Bear / None. Default: Both
- Signal Threshold — |momentum| floor for Buy ▲ / Sell ▼ arrows. Range 10–80. Default: 40
**Divergence**
- Sensitivity — |momentum| floor for Regular div detection. Range 10–50. Default: 25
- Regular Divergence — Toggle. Default: ON
- Hidden Divergence — Toggle. Default: ON
- Show Divergence Lines — Toggle. Default: ON
- Show Divergence Labels — Toggle. Default: ON
- Label Size — Tiny / Small / Normal / Large. Default: Tiny
- Smart Divergence Filter (AI) — Master toggle. Default: OFF
- Min Momentum Swing — Default: 10.0
- Min Price Swing (%) — Default: 0.3%
- Require Flux Confirmation — Default: ON
**Multi-Timeframe**
- Show MTF Panel — Toggle. Default: ON
- Timeframe Preset — Scalp / Intraday / Swing / Position / Crypto / Forex. Default: Swing
- Panel Position — 6 anchor slots. Default: Top Right
- Panel Text Size — Tiny / Small / Normal / Large. Default: Small
**Dashboard**
- Show Dashboard — Toggle. Default: ON
- Panel Position — 6 anchor slots. Default: Bottom Right
- Panel Text Size — Tiny / Small / Normal / Large. Default: Small
**Alerts**
- 20 toggles covering all 22 alert conditions (Regular and Hidden divergence each drive two alerts — bull + bear — from one toggle).
- Defaults ON: Confluence Buy/Sell, Mom Cross Up/Dn, Flux Cross Up/Dn, Strong Bull/Bear Confluence, Tight Squeeze, Regular Divergence, Squeeze Release, MTF Aligned.
- Defaults OFF: Swings, Weak Confluences, Mid/Loose Squeeze, Hidden Divergence, MTF Divergence.
🟦 COMPATIBILITY
Works on all asset classes and all timeframes in TradingView Pine Script v6.
- Crypto: Spot, futures, perpetual contracts
- Forex: All pairs
- Equities: Stocks, ETFs, indices
- Commodities: Metals, energy, agriculture
- Timeframes: 1m through Monthly
The channel-aware ATR normalization in the Momentum engine, the ATR-normalized Flux ratio, and the stdev / ATR squeeze tests make every layer volatility-agnostic. The same default settings work on a 1m BTC chart and a weekly index chart without retuning. The MTF presets cover the common scalp / intraday / swing / position profiles plus dedicated Crypto and Forex packs.
🟦 DISCLAIMER
This indicator is provided for educational and informational purposes only. It does not constitute financial advice. Past performance does not guarantee future results. Always conduct your own analysis and apply proper risk management.
Notes de version
🟦 UPDATE — v1.1.0Major feature update — four new analytical layers, a new theme, and a full documentation refresh.
✦ Squeeze Release Direction Predictor — the Release marker is now direction-aware. When compression ends, it analyzes the momentum slope and prints ✦▴ if a bullish breakout is likely, ✦▾ if a bearish breakout is likely, or a plain ✦ if the direction is still unclear. No need to wait for a confirmation candle to estimate the breakout direction.
Trend Regime Detector — the built-in ADX + DI± classifier adds a Regime row to the Dashboard: ⯅ TRENDING UP / ⯆ TRENDING DOWN / ▣ RANGING / ▤ TRANSITION. The optional Auto-Adjust Signal Threshold loosens the Confluence threshold in trending markets and tightens it in ranging markets, so signals better match the current market condition. A new Regime Shift alert has also been added.
Volume Confirmation Gate — Confluence Buy / Sell arrows can now require above-average volume, helping filter out weak false moves. On symbols without reliable volume data, the filter is automatically bypassed, keeping the indicator universal.
Emerald Theme — a new jewel-tone palette with vibrant emerald and ruby red. The total number of themes is now thirteen. One dropdown still controls every plot, fill, gauge, divergence line, and dashboard cell.
Friendly MTF Labels — the Multi-Timeframe panel now shows chart-style timeframes such as 15m / 1h / 4h / 1D instead of raw codes, making everything easier to read at a glance.
Notes de version
🟦 UPDATE — v1.2.0Precision & polish update — a community-driven review pass that sharpens the signal logic, adds three new controls, and refreshes the documentation end to end.
Confluence reading is now sign-exact — when Momentum and Flux disagreed, the bias used to default bullish. It now resolves by Momentum's direction, so a mixed market reads honestly instead of leaning long. This sharpens the Bias row, the Confluence gauges, the TS Score, Confluence bar-coloring, and every Multi-Timeframe row at once.
Adaptive Signal Threshold direction corrected — the Confluence Buy ▲ / Sell ▼ arrows are mean-reversion (counter-trend) triggers, so the Auto-Adjust now tightens the threshold in trends (where fades get run over) and loosens it in ranges (where reversion actually pays off). The behaviour finally matches what the signals are for.
✦ New — TS Score Tier Change alert — get notified the moment composite trend strength shifts tier (Strong Bull / Bull / Neutral / Bear / Strong Bear). The flagship 0–100 score is now fully alertable, bringing the total to twenty-four alerts.
▣ New — configurable Squeeze tiers — the Tight / Mid / Loose compression multipliers (0.5 / 0.75 / 1.0) are now inputs, so you can tune the squeeze model to any market or timeframe. They auto-sort ascending, so the three tiers can never be set out of order.
◈ New — Hover Tooltips toggle — the rich per-bar hover labels on the Momentum-cross dots, the ✦ Release marker and the Buy/Sell triangles now sit behind a single switch (default OFF). On long, active charts those invisible labels could crowd Divergence markers out of the drawing pool — keeping them off by default protects every D▲ D▼ H▲ H▼. Divergence markers keep their own tooltips regardless of this setting.
Multi-Timeframe is smarter — if a preset requests a timeframe below your chart's, that row now reads "— n/a" instead of polluting the alignment math, and the header shows N/A when every row sits below the chart. Heiken Ashi bias now also applies to the MTF Flux, so the panel and the chart can never disagree for a reason unrelated to the timeframe.
Cleaner Divergence under the Smart Filter — a divergence that the AI filter suppresses no longer consumes its pivot anchor, so a later, genuinely valid divergence from the same swing is no longer silently lost.
Under the hood — the Directional Flux engine was streamlined (identical output, one fewer calculation per bar), the Graphite theme and panels were polished, and the full inline + tooltip documentation was rewritten for accuracy across every component.
A note on two behaviour changes: in mixed Momentum/Flux conditions the Bias and gauges now read by Momentum's sign (intended), and the new Hover Tooltips switch ships OFF — flip it on under Visual 🔹 if you want the per-bar hover context back.
Thank you to everyone who sent detailed feedback — this pass was driven by it. ❤️
Notes de version
🟦 UPDATE — v1.3.0A focused refinement built on community feedback.
Length-stable Squeeze calibration — the squeeze tiers compare stdev against ATR, but that ratio naturally grows with the window (~√Length), so the same multiplier quietly meant different things at different Lengths — firing on most bars at Length 10 and rarely at Length 50. Each tier threshold now auto-scales by √(Length / 20), so a multiplier holds the same selectivity at any Length: Length sets the timescale, the multiplier sets how often the squeeze fires. Unchanged at the default Length 20 — re-calibrated everywhere else (so if you run a non-20 Length, the squeeze frequency will shift to its corrected value).
Hover Tooltips now ON by default — the rich per-bar tooltips on the Momentum-cross dots, the ✦ Release marker and the Confluence Buy ▲ / Sell ▼ triangles are now on out of the box, since they're genuinely useful. They're capped to a small rolling window so they can never crowd the drawing pool or push Divergence markers off the chart, even on long histories. (On an existing chart you may need to enable "Show Hover Tooltips" under Visual 🔹 manually — TradingView keeps your saved inputs across updates.)
Thank you to the community for the sharp, detailed feedback that shaped this release. ❤️
Notes de version
🟦 UPDATE — v1.4.0Directional dashboard colors — a new "Cell Color Mode" under Visual/Dashboard. Default stays Uniform (the cohesive single-tone look). Switch to Directional and every value cell in the Dashboard and MTF panel tints by its live state — bullish, bearish or neutral — so you read the whole panel at a glance by colour. Purely cosmetic; no signal logic changes.
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.