maXXit LevelTRG [V6 2.0]# maXXit Level Trigger — Overview
**Platform:** TradingView Pine Script v6 · Overlay indicator
---
## What does the Level Trigger do?
The Level Trigger automates trade entries and exits based on a freely configurable price level. False breakouts are filtered by an **N-closes confirmation** — only after N consecutive candles close through the level is an action triggered. The trigger fires JSON alerts to an external webhook server connected to a broker API (IBKR, OANDA, IG Markets).
If the signal generation is based on futures contracts (highly recommended), the mirror instruments are mapped through configurable parameters inside the script to the pre-configured broker API. The trigger does not fire position entries or exits inside TradingView directly. A plain-text message can be sent as an alternative.
All state machine logic runs **live only** — no historical replay arming.
---
## Flow (State Machine)
```
1. ARMED — Price touches the trigger level from the opposite side (intrabar, live bar only)
2. ENTRY — N consecutive closes back through the level → BUY / SELL alert
3. POSITION — Stop and TP monitor the open position
4. EXIT — SL or TP fires → closing order alert
```
---
## Features
| Feature | Description |
|---|---|
| **Long & Short** | Both directions configurable |
| **N-Closes (1–3)** | Consecutive closes required for arming confirmation, entry and SL/TP (Close mode) |
| **Live arming only** | Trigger arms only on real-time bars — no historical replay |
| **Trigger-level stop** | N closes back through the trigger level = automatic stop exit. Active only when no Absolute SL is set |
| **Absolute Stop Loss** | A separate SL level — fires immediately on intrabar touch, no close confirmation. When set, the trigger-level stop is deactivated |
| **Take Profit — Close mode** | TP arms on intrabar touch (high/low crosses TP level), exits on N consecutive closes back through TP |
| **Take Profit — Touch mode** | Exit fires immediately on intrabar TP touch |
| **Trailing stop** | Auto-stop locks at the TP level when TP is first reached — acts as a floor stop while price runs |
| **JSON alerts** | Direct broker integration (IBKR, OANDA, IG Markets) via webhook |
| **Symbol mapping** | Pre-defined instrument parameters for 15+ futures/CFDs |
| **Lock to Symbol** | Trigger stays bound to the selected instrument ticker prefix across chart changes |
| **Position Lock** | Preserves position state (LONG/SHORT) when inputs are changed mid-trade |
| **Fractal Grid** | Optional overlay of highest-high / lowest-low grids (5 levels, 10–50 bars) |
---
## Stop Loss Logic — Three-tier hierarchy
Only one tier is active at a time:
| Priority | Condition | Stop mechanism | Trigger |
|---|---|---|---|
| **1 — Absolute SL** | SL Level > 0 | Fixed price level | Intrabar touch — immediate |
| **2 — Auto-SL (TP lock)** | TP reached → auto_sl set | Old TP level becomes new stop | N consecutive closes through the level |
| **3 — Trigger-level stop** | No SL, no auto_sl | Trigger level acts as stop | N consecutive closes |
### How tiers interact
- When **Absolute SL is set**: tiers 2 and 3 are deactivated. Only the intrabar stop fires.
- When **TP is reached** (intrabar touch in Close mode): the TP level locks as a trailing stop (`auto_sl`). The Absolute SL can now be removed — `auto_sl` takes over with N-close confirmation.
- When **neither SL nor auto_sl is active**: the trigger level itself acts as the stop (N closes back through it).
### After a stop fires
The trigger does not re-arm automatically. To re-activate, change the Trigger Level input — this resets all state.
---
## Worked Example — LONG, N = 2 closes
**Setup:** Direction = LONG · Trigger = 5000 · TP = 5100 · Closes required = 2
### Phase 1 — Entry
| Event | What happens |
|---|---|
| Price dips below 5000 (intrabar, live) | Trigger **arms** — indicator starts watching |
| Price rises, 2 consecutive closes above 5000 | **Entry alert fired** → BUY order sent · stop activates at 5000 |
| Price dips back, 2 closes below 5000 (before TP) | **Stop exit** → SELL alert · trigger deactivates |
### Phase 2a — TP exit (Close mode, price reverses after TP)
| Event | What happens |
|---|---|
| Price rises through 5100 (intrabar) | TP **arms** — stop locks at 5100, indicator waits for reversal |
| Price falls back, 2 consecutive closes below 5100 | **TP exit alert** → SELL order sent · position closed |
### Phase 2b — Trailing stop (price keeps running above TP)
| Event | What happens |
|---|---|
| Price rises through 5100 | TP arms — stop **locks at 5100** (yellow line) |
| Price continues above 5100 | Position stays open · stop remains at 5100 |
| User raises TP to 5200 | `tp_armed` resets · stop stays locked at old 5100 level (use Active Position to preserve state) |
| Price reaches 5200 | Stop locks at 5200 |
| Price falls, 2 closes below 5200 | **Stop exit alert** → SELL order sent |
> The locked stop (old TP level) works exactly like the trigger-level stop: N consecutive closes through the level fire the exit.
### Workflow — raising TP while stop is locked
Pine Script resets all computed state (`tp_armed`, `auto_sl`) on every input change. To preserve the locked stop when raising TP:
| Step | Action |
|---|---|
| 1 | Note the current locked stop level (yellow line, e.g. 5100) |
| 2 | Set **Active Position** = `LONG` (or `SHORT`) |
| 3 | Set **Trigger Level** = locked stop value (e.g. 5100) |
| 4 | Set **TP Level** = new target (e.g. 5200) |
| 5 | After recalc: position restored · Trigger Level acts as stop · new TP active |
> **Why Trigger Level:** it is a persistent input that survives recalculation. When in position with no Absolute SL and no `auto_sl`, the trigger level acts as the N-closes stop.
---
## Visual Display
### Trigger label (at trigger level)
| State | Label | Color |
|---|---|---|
| Armed, LONG direction | TOUCHED ↑ | Green |
| Armed, SHORT direction | TOUCHED ↓ | Red |
| Active LONG position | LONG ↑ | Green |
| Active SHORT position | SHORT ↓ | Red |
| SL/Trigger crossed while in position | CAUTION | Orange |
| TP armed (acting as SL) | IDLE | Gray |
| No trigger configured | IDLE | Gray |
### SL label (at SL level)
| State | Label | Color |
|---|---|---|
| In LONG position | ARMED ▼ | Dark orange |
| In SHORT position | ARMED ▲ | Dark orange |
| Armed, LONG direction | ARMED ▼ | Dark orange |
| Armed, SHORT direction | ARMED ▲ | Dark orange |
| Hidden when TP is armed (TP line acts as SL) | — | — |
### TP label (at TP level)
| State | Label | Color |
|---|---|---|
| Position open, TP not yet reached | TP ACTIVE | Green |
| TP reached, acting as trailing stop (LONG) | SL ACTIVE ↑ | Green |
| TP reached, acting as trailing stop (SHORT) | SL ACTIVE ↓ | Red |
| TP exit just fired | TP CLOSED | Gray |
| No position | IDLE | Gray |
### Lines
- **Trigger line** — dashed · color matches trigger label state
- **SL line** — solid · dark orange when armed or in position · hidden when TP is acting as SL
- **TP line** — dashed · green (active) · color matches TP label state
- **Auto-SL line** — solid yellow · shows locked stop level when TP has armed
---
## Design Decisions & Rationale
### Why live-only arming (`barstate.isrealtime`)
All state machine logic runs only on real-time bars. Trigger levels are set manually based on the current Elliott Wave analysis. A historical simulation of manually-set levels would be meaningless — the level is valid only in the context of the current wave structure. Live-only arming ensures clean state on each session start and prevents false fills from historical data replay.
### Why the trigger does not re-arm automatically after exit
After a trade closes, re-entry at the same level requires re-analysis and a conscious decision. Re-arming is triggered by changing the Trigger Level input, which reloads all state. This is intentional: the wave structure has either confirmed or invalidated at that level.
### Why position sizing is manual
Risk per trade depends on the SL distance, which varies with each wave setup. The analyst calculates `quantity = max_risk_USD / (entry_price - SL_level)` before setting inputs. Automating this inside the script would require the entry price to be known in advance, which conflicts with the trigger-based entry mechanism.
### Why TradingView webhooks (no direct broker connection)
TradingView provides the charting and signal generation layer. The broker API integration lives in a separate webhook server. This separation keeps the Pine Script simple and broker-agnostic — switching brokers requires only a server-side change, not a script rewrite.
### Why N-closes confirmation instead of intrabar triggers
Intrabar wicks frequently penetrate Elliott levels without confirming. N confirmed closes through a level provide meaningful structure confirmation — a wick is noise, a close is a statement. The cost is a few points of slippage on the entry; the benefit is fewer false signals.
### Why TP Close mode arms on intrabar touch (not N closes)
TP is a profit target, not a structural level. Waiting for N closes above the TP level before arming would delay the trailing stop activation unnecessarily — the first intrabar touch is sufficient evidence that the target was reached. The exit itself still requires N closes back through the TP level, preserving the confirmation logic on the way out.
---
## Settings Reference
| Input | Group | Description |
|---|---|---|
| Send JSON Alert | Account & Broker | ON = JSON webhook · OFF = plain-text alert |
| Webhook Secret | Account & Broker | Token included in JSON payload for server authentication |
| Account ID | Account & Broker | Broker account identifier (IBKR, OANDA, IG Markets, etc.) |
| Use predefined mapping | Instrument | Uses built-in symbol → broker mapping table |
| Mirror Trade | Instrument | NO = trade the chart future · YES = trade mirror instrument (STK/CFD) |
| Mirror Instrument | Instrument | STK (IBKR ETF) or CFD (OANDA / IG Markets) |
| Quantity | Instrument | Size of the order |
| Direction | Level Trigger | LONG or SHORT |
| Trigger Level | Level Trigger | Price level. 0 = disarmed |
| Stop Loss Level | Level Trigger | Absolute SL. 0 = use trigger-level stop instead |
| TP Level | Level Trigger | Take profit level. 0 = disabled |
| TP Arm Mode | Level Trigger | Touch = immediate intrabar exit · Close = N-close reversal confirmation |
| Closes required | Level Trigger | 1–3 consecutive closes needed for arming, entry and SL/TP |
| Lock to Symbol | Level Trigger | Ticker prefix to lock trigger to one instrument (e.g. MNQ, FXXP) |
| Active Position | Level Trigger | Auto / LONG / SHORT — preserves position state across input changes |
| Fractal Grid | Position Management | Shows highest-high / lowest-low grid overlay |
---
## Supported Instruments
| Prefix | Instrument | Exchange | Mirror (STK) | Mirror (CFD OANDA) | Mirror (CFD IG) |
|---|---|---|---|---|---|
| MNQ | Micro Nasdaq-100 | CME | QQQ | NAS100_USD | NASDAQ |
| MES | Micro S&P 500 | CME | SPY | SPX500_USD | SPTRD |
| MYM | Micro Dow Jones | CBOT | DIA | US30_USD | DOW |
| FXXP / FSXE | Euro Stoxx 50 | EUREX | IMEU | EU50_EUR | STXE |
| MGC | Micro Gold | COMEX | GLD | XAU_USD | SPOTGOLD |
| MCL | Micro Crude Oil | NYMEX | USO | WTICO_USD | USOIL |
| MNG | Micro Nat Gas | NYMEX | — | NATGAS_USD | NATURALGAS |
| MHG | Micro Copper | COMEX | — | XCU_USD | COPPER |
| ZW | Wheat | CBOT | — | WHEAT_USD | — |
| ZN | 10Y T-Note | CBOT | — | USB10Y_USD | — |
| CN1 | FTSE China A50 | SGX | — | CN50_USD | — |
| EURUSD | EUR/USD Spot | IDEALPRO | — | EUR_USD | — |
| BTCUSD | Bitcoin | — | — | BTC_USD | BITCOIN |
| ETHUSD | Ethereum | — | — | ETH_USD | ETHUSD |
---
## Later Enhancements Planned
| # | Enhancement | Rationale |
|---|---|---|
| **1** | **Multi-level trigger** — two simultaneous trigger levels with independent directions | Allows monitoring Wave 3 and Wave 5 levels simultaneously without two separate chart instances |
| **2** | **Partial exits / scale-out** — e.g. 50% at TP1, remainder with trailing stop | Elliott Wave extensions are common; closing the full position at the first TP level often leaves significant profit on the table |
| **3** | **Volatility-adaptive N-closes** — automatically tighten/loosen confirmation count based on ATR or session volatility | A single N-close setting behaves differently in a quiet overnight session vs. a high-impact news event |
Indicator

Indicator

Smart Money Flow Signals [QuantAlgo + Raph]Modification of the Smart Money Flow Signals - QuantAlgo
Add-on - Not 100% accurate
Vertical lines
Blue= Prepare for long position
Green = Long position confirmation
Orange= Prepare for short position
Red = Short position confirmation
Core calculation
It computes several intermediate series: raw money flow, positive/negative money flow, a Money Flow Index (MFI), Chaikin Money Flow, a volume‐weighted momentum channel, and then combines them into a single composite wave that represents institutional or “smart money” buying and selling pressure.
The composite wave is optionally smoothed and plotted around a zero line, with configurable overbought and oversold levels that mark extreme positive or negative money flow conditions.
Visual styling and gradients
The indicator colors the area between the composite wave and the zero line with a dynamic gradient whose intensity depends on wave strength, volume intensity, and alignment between Chaikin Money Flow and the composite wave (stronger, more aligned flows produce a more saturated fill).
Bars on the price chart can be recolored using a gradient between a bullish and bearish color, again based on the current value of the composite wave, to project smart money direction directly onto price action.
Vertical background lines (slope and pivots)
The script analyzes the slope of the composite (or smoothed) wave; when the slope turns from negative to positive or positive to negative, and the change is larger than a user-defined threshold, it paints a semi-transparent green or red vertical background line behind that bar to highlight changes in momentum direction.
It also uses ta.pivothigh() and ta.pivotlow() on the composite wave to detect local swing highs and lows; pivot highs are only treated as “valid peaks” when they are above zero, allowing the script to distinguish positive peaks from other tops.
Confirmed positive peaks are highlighted with vertical orange background lines, while opposite swing lows (troughs) are highlighted with a different color, both shifted back by pivot_right_bars so that the vertical line appears on the actual peak/trough bar where the oscillator turned.
Inputs and presets
A set of inputs lets the user control calculation periods (momentum, trend, MFI, smoothing), overbought/oversold thresholds, color presets for bullish/bearish waves, and whether to show bar coloring and the extra smoothed trend line.
Additional inputs configure the visibility and sensitivity of slope-based background lines (including minimum slope change and colors) and pivot detection parameters (left/right bars for pivot confirmation and colors for positive peaks and troughs).
Alerts and trading use
The script provides alerts for zero-line crossovers (bullish/bearish flow changes), entries into and reversals from overbought/oversold zones, extreme conditions, and both positive peaks and troughs of the oscillator.
Overall, it is intended to visualize where institutional money is accumulating or distributing, mark key inflection points of the flow curve, and give traders structured, color-coded cues for momentum shifts, exhaustion zones, and swing turning points in the smart money wave Indicator

Indicator

Swing Delta Pressure | julzALGO📊 Swing Delta Pressure | julzALGO
🔷 1. Overview
Swing Delta Pressure is a swing-anchored directional pressure framework that combines market structure, estimated buy/sell participation, delta imbalance, and a pressure-weighted trend path into one integrated overlay.
The script is designed to help traders evaluate not only where price is moving, but whether buyer or seller participation is supporting that movement.
By combining swing detection with candle anatomy and directional participation modeling, Swing Delta Pressure can be used for:
• Initial swing flip detection
• Pullback observation
• Retest continuation planning
• Directional pressure confirmation
• Risk-to-reward execution planning
🔷 2. Core Concept
Traditional indicators often focus mainly on price movement, standard volume, or static smoothing.
Swing Delta Pressure expands this by integrating:
• Swing high / swing low structure
• Estimated buy volume
• Estimated sell volume
• Delta volume
• Pressure acceleration
• Participation weighting
• Swing-anchored pressure path
• Dynamic RR zones
The core idea is simple:
Each new swing establishes a structural anchor point.
From that anchor:
• Buyer and seller participation are estimated
• Delta pressure is accumulated
• Price is weighted by participation strength
• The active pressure path updates until the next structural swing flip
Where volume calculation starts:
Buy Volume (B), Sell Volume (S), Delta (Δ), and Imbalance (%) begin calculating from the swing anchor pivot marker and continue accumulating through each new bar until the next confirmed swing flip occurs.
Simple rule:
Swing Anchor Pivot → Present Active Bar
Bullish swing:
When a bullish swing is confirmed, volume tracking starts from the swing low anchor.
Bearish swing:
When a bearish swing is confirmed, volume tracking starts from the swing high anchor.
Reset rule:
When a new opposite swing flip occurs:
• Previous swing totals stop
• Previous path becomes historical
• New swing totals reset
• New cumulative tracking begins
Important:
B / S / Δ / % values are not single-candle values.
They represent cumulative estimated directional participation from the swing origin to the current active bar.
This helps traders evaluate whether the full active swing remains buyer- or seller-dominant, even during pullbacks or retests.
🔷 3. How It Works
The Swing Engine continuously tracks rolling swing highs and lows using the selected swing detection length.
This identifies:
• Bullish swing flips
• Bearish swing flips
• Structural pivots
• Active anchor zones
The Delta Pressure Engine estimates buyer and seller participation using:
• Candle body size
• Upper wick behavior
• Lower wick behavior
• Close position within candle range
• Relative volume intensity
• Delta acceleration
Instead of treating every candle equally, the pressure path weights price using directional participation.
High-participation candles influence the path more strongly than weak candles. This creates a more adaptive flow path compared with standard smoothing.
The RR system can project:
• Entry
• Stop Loss
• Take Profit
This allows traders to combine structure, participation, and visual risk planning in one workflow.
Visual interpretation:
• Blue path = Bullish directional pressure
• Purple path = Bearish directional pressure
• Blue anchor marker = Bull swing anchor where volume tracking starts
• Purple anchor marker = Bear swing anchor where volume tracking starts
• B = Estimated buyer participation from anchor to present bar
• S = Estimated seller participation from anchor to present bar
• Δ = Delta pressure from anchor to present bar
• % = Active swing imbalance strength
🔷 4. Settings
Swing Detection Length
Controls the sensitivity of structural swing flips.
Suggested reference:
• 20–30 = Faster / scalping
• 40–60 = Balanced / intraday
• 80+ = Higher timeframe / smoother
Weight Mode
Participation:
Balanced swing participation and stable path behavior.
Delta Absolute:
More reactive directional shifts.
Smart Pressure:
Higher sensitivity to stronger impulse moves.
Volume Mean / StdDev Length
Controls participation normalization.
Suggested reference:
• 100 = More reactive
• 200 = Balanced
• 300+ = Smoother
Stop Loss Type
ATR:
Adaptive volatility-based stop.
Pivot:
Structure-based stop.
ATR Multiplier
Suggested reference:
• 1.5 = Tight
• 2.0 = Balanced
• 2.5+ = Wider
Risk:Reward
Suggested reference:
• 1.5 = Conservative
• 2.0 = Balanced
• 3.0 = Extended trend target
General preset:
• Swing Length: 50
• Weight Mode: Participation
• Stop Loss Type: Pivot or ATR depending on strategy
• ATR Multiplier: 2.0–3.0
• Risk:Reward: 2.0
🔷 IMPORTANT NOTES
• This indicator does not guarantee profits and should not be used in isolation
• Market conditions can vary; always apply proper risk management
• Past performance does not indicate future results
🔷 DISCLAIMER
This script is for educational and informational purposes only.
It does not constitute financial advice. Always do your own analysis before making trading decisions.
Indicator

Impulse Follow-Through Quality [AGPro Series]Impulse Follow-Through Quality
🧠 Core Idea
Did the impulse receive enough follow-through to remain valid?
📌 Overview / What it does
Impulse Follow-Through Quality is a chart-first momentum expansion planner built to evaluate what happens after a strong impulse candle appears.
Instead of treating every strong candle as a standalone signal, the script starts a follow-through review window and measures whether price extends, pauses constructively, pulls back too deeply, reaches a target-room guide, or crosses a failure rail. These elements are converted into a 0-100 Impulse Quality score and a clear next-action state.
The script produces an impulse highlight, follow-through box, failure rail, measured target guide, compact labels, alerts, and a clean AGPro planning panel. It does not predict continuation, automate trades, or guarantee that momentum will continue.
🎯 Purpose & Design Philosophy
This script was built for traders who want to separate a meaningful impulse from a candle that only looks strong for one bar.
Many momentum tools focus on the impulse itself. The practical question often comes after that candle: does the move attract follow-through, or does it begin to fail? This planner fills that gap by turning the post-impulse phase into a readable decision process.
The design supports a patient review mindset: identify the impulse, watch the follow-through window, evaluate pullback depth, check target room, and review the failure rail before reacting.
⚡ Why This Script Is Different
Most tools focus on strong candles, volume spikes, momentum bursts, or basic continuation labels.
This script does NOT act as a Volume Climax Detector, does NOT rebuild an Institutional Candle Detector, and does NOT reduce the chart to a simple buy/sell momentum signal.
Instead, it evaluates what happens after the impulse. The key output is not the candle itself. The key output is the follow-through quality state: IMPULSE, WAIT FT, FT WATCH, VALID FT, PULLBACK RISK, WEAK FT, FAILED, or TARGET REVIEW.
⚙️ Methodology
1. Context Detection
The script detects qualified bullish or bearish impulse candles using ATR-normalized range, body efficiency, close location, trend context, and participation.
2. Reference Mapping
Once an impulse qualifies, the script maps the impulse origin, follow-through box, failure rail, and target-room guide.
3. Reaction Evaluation
The model evaluates follow-through progress, closes beyond the impulse close, retracement depth, participation support, target room, and whether price crosses the failure rail.
4. Visual Output
The result is displayed through an impulse highlight, centered follow-through box label, failure rail, target guide, compact labels, deterministic alerts, and a premium AGPro panel.
🗺️ How to Read the Chart
Impulse Highlight = the latest qualified impulse leg that starts the review window.
Follow-Through Box = the active planning area between the impulse close and the measured target-room guide. Its label is centered inside the box.
Failure Rail = the practical invalidation reference behind the impulse. It is an analytical line, not a stop order.
Target Guide = a measured target-room reference based on the impulse range.
Labels = compact state markers for impulse start, constructive follow-through, weak follow-through, pullback risk, failure rail review, and target review.
Colors = teal supports constructive long-side follow-through, pink supports short-side or failure context, amber marks review risk, and indigo marks watch states.
Panel = summarizes Impulse Quality, Follow-Through, Pullback Risk, Target Room, and Action.
🚦 Signals & States
• IMPULSE → a qualified impulse candle has started a review window.
• WAIT FT → the impulse exists, but follow-through is not confirmed yet.
• FT WATCH → follow-through conditions are improving but not strong enough for the highest state.
• VALID FT → follow-through quality is constructive according to the rule set.
• PULLBACK RISK → retracement depth is elevated inside the impulse range.
• WEAK FT → the follow-through window is aging without enough progress.
• FAILED → price crossed the failure rail behind the impulse.
• TARGET REVIEW → price reached the measured target-room guide and context should be reviewed.
🔔 Alerts Logic
Alerts can trigger when a new impulse starts, follow-through becomes constructive, follow-through enters watch state, the move weakens, pullback risk rises, price crosses the failure rail, or price reaches the target-room guide.
Each alert is an attention marker. Alerts are not trade instructions, entry commands, exit commands, or automated strategy rules.
🧩 Confluence Logic
The strongest context appears when a clean impulse candle is followed by measurable progress, multiple closes beyond the impulse close, controlled retracement depth, supportive participation, and readable target room.
When these components weaken, the planner can shift toward WAIT FT, FT WATCH, PULLBACK RISK, WEAK FT, or FAILED.
📊 When to Use
• After strong momentum candles where continuation quality matters.
• During trend continuation attempts that need follow-through review.
• After breakout or expansion bars where a one-bar move may be misleading.
• On liquid symbols where ATR, candle structure, and volume behavior are readable.
• When you want a post-impulse planning map instead of another raw momentum signal.
⚠️ When NOT to Use
• Very low-liquidity symbols with unstable candles or unreliable volume.
• Extremely noisy micro-timeframes where impulse candles appear too frequently.
• News-driven spikes where one-bar expansion can distort the model.
• Markets with large gaps that make ATR and failure-rail references less useful.
• Situations where the user expects guaranteed continuation or automated trade signals.
🎛️ Key Inputs
• Follow-Through Side → controls Auto, Long Follow-Through, or Short Follow-Through mode.
• Minimum Impulse ATR → changes how large a candle must be before review begins.
• Minimum Body Efficiency → controls how clean the impulse body must be.
• Minimum Edge Close → controls how near the candle must close to its directional edge.
• Follow-Through Window → controls how many bars are used to judge early continuation.
• Required Progress ATR → defines preferred movement after the impulse close.
• Maximum Pullback Ratio → controls when retracement depth becomes elevated risk.
• Failure Rail Buffer ATR → adjusts the analytical failure rail behind the impulse.
• Visual settings → control the impulse highlight, follow-through box, failure rail, target guide, labels, panel visibility, panel location, theme, and font sizes.
🖥️ Interface & Visual Design
The interface is designed to stay chart-first.
The impulse highlight gives the origin. The follow-through box gives the active planning area. The failure rail and target guide define the practical review frame.
The AGPro panel provides a compact decision summary with a merged blue title row, adjustable panel location, adjustable theme, and adjustable font size.
🧪 Practical Usage Workflow
1. Read the panel Impulse Quality score and Action.
2. Check the impulse highlight and the direction of the follow-through box.
3. Review whether price is extending beyond the impulse close.
4. Compare pullback depth with the failure rail.
5. Use the target guide as a context-review reference, not as a guarantee.
6. Treat alerts as attention markers inside broader analysis.
🔍 Interpretation Guidelines
Think in terms of follow-through quality, not prediction.
A higher score means the impulse has more constructive continuation characteristics according to the script's rule set. A weaker score means the move may be aging, retracing too deeply, lacking progress, or crossing its failure reference.
VALID FT does not mean price must continue. FAILED does not mean the market cannot recover later. The states organize the review process.
🚫 What This Script Is NOT
• Not a prediction engine.
• Not financial advice.
• Not an auto-trading system.
• Not a guaranteed signal tool.
• Not a buy/sell signal service.
• Not a Volume Climax Detector.
• Not an Institutional Candle Detector.
• Not a generic momentum oscillator.
⚠️ Limitations & Transparency
The script is rule-based and depends on recent price action, ATR, candle structure, selected inputs, and volume behavior.
Different timeframes can produce different impulse and follow-through readings. Volatility spikes can temporarily distort the score. Symbols with unreliable volume may produce weaker participation readings.
Outputs should always be interpreted with broader market structure, liquidity, and trader-defined risk controls.
🧠 Market Context Notes
Impulse candles are only useful when the market confirms or rejects them through follow-through.
A clean impulse that receives controlled extension may deserve more attention than a larger candle that immediately retraces. A smaller impulse can also become meaningful when the follow-through window stays organized.
🧾 Use Case Examples
When price prints a strong bullish impulse, closes near the high, then follows through with multiple closes above the impulse close while pullback depth remains controlled, the planner may classify the move as VALID FT.
When an impulse appears but price fails to extend, retraces deeply, or crosses the failure rail, the planner may shift toward WEAK FT, PULLBACK RISK, or FAILED.
🧱 System Philosophy
AGPro planning tools are designed to help traders evaluate context before reacting.
This script follows that philosophy by turning impulse follow-through into a structured planning question: did the move receive enough confirmation, progress, and risk clarity to remain worth reviewing?
🔐 Non-Promise Statement
No indicator can guarantee continuation, reversal, breakout success, or outcome.
This tool provides structured visual context and rule-based attention markers. It does not provide certainty.
📉 Risk Disclosure
Trading involves risk.
Market conditions can change quickly, and no script can remove uncertainty.
Users are responsible for their own analysis, risk management, position sizing, and trading decisions.
This script is for educational and analytical use only and does not provide financial advice.
📚 Educational Note
Use the planner to study how strong candles behave after they appear, how follow-through quality changes across timeframes, and how pullback depth affects the readability of momentum continuation.
Indicator

Indicator

Indicator

MR DU Elliott Wave FOR IX0001Curtis, here's the English translation:
🌊 Complete Elliott Wave Structure Breakdown for Taiwan Stock Market (Figure 3-167)
Starting Point: Beginning of the 8th Major Stock Market Cycle
Key LevelDate (ROC Calendar)Description3,955.43 (Cycle Low)Nov 21, 2008 (ROC 97)Previous cycle trough; declined 5,904 points / -59.88%22,975.71 (Opening)Jan 2, 2025 (ROC 114)Observation starting point for this cycle
Wave I (Initial Advance)
Start: 17,306.97 (Apr 9, 2025 — tariff-shock low)
High: 28,594.61 (Nov 4, 2025)
Gain: +11,787.19 points (+68.16%)
Wave II (Corrective Wave)
Multiple minor pullbacks within the correction zone:
25,469.04 (Sep 26, 2025): down 924.99 pts / -3.50%
26,395.98 (Nov 21, 2025): down 2,158.63 pts / -7.56%
27,350.77 (Dec 28, 2025): down 1,217.25 pts / -4.26%
Although consolidation lasted roughly 5 months, the magnitude remained moderate.
Wave III (Main Advance) — Current Position
MilestoneDateLevelCumulative GainWave III startApr 9, 202517,306.97—Wave I highNov 4, 202528,594.61+65.22%Wave II highJan 29, 202632,090.07+85.4%Wave III peakFeb 26, 202635,579.34+105.58%Pullback lowMar 9, 202631,529.36Down 4,049.98 pts / -11.38%V-shaped new highApr 16, 202637,135.55+114.57%Closing priceApr 16, 202637,132.02YTD +28.02%
Wave III has now lasted 13 months, consistent with Teacher Du's original forecast of "April 2025 to April 2026, totaling 13 months."
📐 Fibonacci Target Price Calculations
Teacher Du provided two methods for calculating target levels:
1.618× target zone:
11,787 × 1.618 + 17,096 ≈ 36,378 points (already reached during the initial advance)
2.0× target zone:
11,787 × 2.0 + 17,306 ≈ 40,880 points (maximum extension target for the main advance)
Assessment: The main advance could end around 36,378 (already surpassed). If it extends further, the upper limit is approximately 40,880. At 37,135, the index has already exceeded the 1.618× target, meaning the main advance may conclude at any time, transitioning into the Wave IV correction.
Wave IV (Corrective Phase) — Approaching
Pattern: A 5-month sideways a-b-c-x-a-b-c-x box-range consolidation ("correction through time rather than price")
Estimated low: approximately 31,000 points (-16.5% from 37,135)
Expected bottom: before the October 2026 local elections
Strategic implication: Do not chase rallies in Q2/Q3 2026; wait patiently for the pullback.
Wave V (Final Advance) — Launching October 2026
Rally starting point: approximately 31,000 points
Price target: 43,000 points by May 2027
Volume: combined TWSE + OTC turnover expected to expand to NT$2.4 trillion
TSMC target price: NT$2,400
Indicator

Fractal Symmetry Detector [forexobroker]Fractal Symmetry Detector identifies classical ABC retracement patterns on the chart and measures their Fibonacci symmetry in real time. It tracks the last three alternating swing pivots (A-B-C), computes the BC/AB retrace ratio, and validates it against the standard Fibonacci levels -- 38.2%, 50%, 61.8%, and 78.6%. When BC completes at one of those levels, the pattern is marked complete and a directional BUY or SELL signal fires with projected T1 and T2 targets at 1.272 and 1.618 extensions.
This indicator is designed for swing traders and harmonic traders who want to enter continuation moves at the deepest pullback rather than chase breakouts. The ABC pattern is drawn live with neon lines, the Fib level is labeled at point C, and target projections extend from C into the future.
🔶 CONCEPTS
Markets rarely move in straight lines. After an impulse move (leg AB), price typically pulls back (leg BC) before continuing. The depth of that pullback -- measured as BC divided by AB -- almost always respects one of four Fibonacci levels: 38.2% (shallow), 50% (halfway), 61.8% (golden), or 78.6% (deep). A retrace that completes at one of these levels with a confirming candle and volume often marks the end of the correction and the start of a continuation leg. This is the foundation of harmonic trading and explains why Fibonacci levels produce reversals so reliably.
🔶 HOW IT WORKS
- Detects ZigZag pivots using the configured pivot length, maintaining an alternating high/low sequence
- When a new pivot forms, checks the last three pivots (A-B-C); A and C must be the same type and B the opposite
- Computes BC/AB ratio and checks proximity to each enabled Fib level using the tolerance setting
- Assigns a symmetry score 0-100 based on how close the ratio is to the matched Fib level
- Fires BUY on valid bullish ABC (low-high-low) with a bullish candle and volume confirmation; SELL on mirror
- If the immediate bar at C does not confirm, the setup becomes PENDING for up to 5 bars awaiting confirmation
🔶 HOW TO USE
1. Add the indicator -- whenever a completed ABC pattern is detected, AB and BC lines are drawn in neon with a C-point Fib label
2. Watch the dashboard (top-right) for live pattern status, Fib level matched, BC/AB ratio, and projected targets
3. Green BUY triangle with "ABC ↑" label fires on bullish ABC completion; pink SELL triangle on bearish
4. When C completes but the immediate candle does not confirm, the pattern becomes PENDING -- the signal will fire on the next qualifying candle within 5 bars
5. Target lines draw from the signal bar to T1 (1.272x AB) and T2 (1.618x AB); use as profit-taking guides
🔶 FEATURES
- Non-repainting signals (barstate.isconfirmed)
- Works on all timeframes and instruments
- 9 alert conditions with JSON webhook support
- Pending-setup mechanism that catches delayed confirmations
- Projected T1 and T2 target lines drawn from every signal
🔶 SETTINGS GUIDE
- Pivot Length -- Lookback for ZigZag pivot detection
- ATR Length -- Period for leg-length measurement in ATR units
- Fib Level Tolerance -- Acceptable deviation from a Fib level (fraction)
- Accept 38.2% / 50.0% / 61.8% / 78.6% -- Toggle which Fib retrace levels qualify
- Target Ext 1 / 2 -- Projected CD extension multiples of AB (classical 1.272 and 1.618)
- Volume SMA Length -- Baseline for volume confirmation
- Volume Confirm Multiplier -- Signal bar volume vs SMA; 1.0 accepts average volume
- Signal Cooldown Bars -- Minimum bars between consecutive signals
- Require Reversal Candle at C -- Enforce direction-matching candle; disable to trigger on pattern completion alone
🔶 ALERTS
- FSD Buy ABC -- Bullish ABC pattern confirmed with buy signal
- FSD Sell ABC -- Bearish ABC pattern confirmed with sell signal
- FSD Any Signal -- Any directional ABC signal
- FSD Pattern Complete -- ABC pattern completed at a Fib level (before confirmation)
- FSD Golden Fib -- 50% or 61.8% retrace detected
- FSD Bull Setup Pending -- Bullish ABC waiting for confirmation candle
- FSD Bear Setup Pending -- Bearish ABC waiting for confirmation candle
- FSD Perfect Symmetry -- Symmetry score 90%+ reached
- FSD Webhook JSON -- Generic webhook payload for external automation
🔶 LIMITATIONS & DISCLAIMER
- This is a technical analysis tool, not financial advice. Always use proper risk management.
- Past ABC pattern completions do not guarantee future price movements.
- Pivot detection lags by the pivot length; patterns only print after the third pivot is confirmed.
- Fibonacci retracement levels are reference levels with no mechanical guarantee of producing a continuation leg; the indicator reports the pattern, not a probability.
Indicator

Quantum Momentum Wave [Pineify]Quantum Momentum Wave
Quantum Momentum Wave is a signed peak-momentum oscillator paired with a Kaufman-style adaptive filter. Instead of measuring the net change from one point to another, the wave scans the full lookback window and returns the largest absolute price displacement with its original sign. The wave is linearly smoothed and then tracked by an adaptive signal line, so entry markers fire on context-filtered reversals rather than every momentum flip.
Key Features
Signed peak-momentum engine that isolates the strongest move inside the lookback
Linear regression smoothing to tame the step-change behavior of raw peak readings
Adaptive signal line that speeds up when the wave is stretched and slows down in noise
Zone-filtered BUY and SELL markers that only fire when the wave is past zero in the opposite direction
Gradient fill between the wave and zero — bullish above, bearish below
Alerts for reversal setups and for zero-line regime shifts
How It Works
The core function is a QMW scan. On each bar it walks the last Momentum Lookback bars, computes price minus each historical bar, and keeps the comparison that produced the largest absolute change. It returns that value with its original sign. So a -6 reading means the single strongest move inside the window was a 6-unit drop, even if the bar-to-bar change right now is small.
Raw peak readings step when a new candle takes over as the dominant move, so the output is passed through linear regression over the Signal Smoothing length. LR fits a straight line through the recent raw values and returns its endpoint, preserving signed direction while cutting short-term jitter.
The adaptive signal runs a Kaufman-style update on top of the smoothed wave. Its coefficient is the ratio of the wave's absolute value to the sum of its recent absolute one-bar changes. When momentum is clearly extended and directional, the ratio is high and the signal follows quickly. When the wave oscillates near zero, the ratio collapses and the line nearly freezes.
How the Components Work Together
Three layers combine into one output. The peak scan answers how hard has price moved inside the window, not just where it ended. Linear regression answers what is the underlying direction of the peak reading after filtering out one-bar swaps between competing peak bars. The adaptive signal answers when has that direction actually shifted by providing a responsive reference line.
Entries layer a location filter on top. A crossover only qualifies when the wave is on the opposite side of zero — buys look for the wave turning up while stretched below zero, sells for the wave rolling over while stretched above it. Crosses near the midline are ignored because they tend to be low-conviction flips without prior displacement, so the setup is biased toward reversals from extended states rather than trend-chasing entries.
Trading Ideas and Insights
BUY triangles below zero can flag exhaustion of a downside push and a possible rotation back toward the mean
SELL triangles above zero can flag fading upside strength after an extended rally
Zero-line crosses act as broader regime markers; alerts on those can frame intraday bias
During strong trends the wave may stay on one side of zero for many bars. Counter-trend BUY or SELL labels in that state often need extra confirmation from price structure or higher-timeframe context
Signals are context aids, not standalone trade instructions. Past reactions at these conditions do not guarantee future ones.
Unique Aspects
The momentum calculation returns the peak signed displacement within the lookback, not a simple close-minus-close value. The reading stays elevated while the dominant move is still inside the window, which tracks the strongest displacement in memory rather than just endpoint delta
The adaptive signal uses a non-standard variation of Kaufman's efficiency ratio — absolute wave value divided by total absolute wave travel — tuned for oscillator input rather than raw price
Entry markers require both a crossover and a zone match. No label prints for a crossover that happens in the neutral zone around zero, which filters out the weakest setups
How to Use
Add the indicator to the chart and start with the defaults. The thicker line is the Quantum Wave; the fainter line is the Adaptive Signal
Read the wave color and the gradient fill to see which side of zero the wave is on and how stretched it is
Watch for BUY triangles when the wave is clearly below zero and turning up through the signal line
Watch for SELL triangles when the wave is clearly above zero and turning down through the signal line
Configure alerts for buy, sell, or zero-cross conditions if you want notifications outside the chart
Customization
Source Data (default: close) — Price series used for the peak momentum scan
Momentum Lookback (default: 14) — Window size for the peak displacement scan. Higher values capture broader swings; lower values react faster
Signal Smoothing (default: 9) — Linear regression length applied to the raw wave. Higher values produce a cleaner line with more lag
Bullish Color / Bearish Color — Wave color in positive and negative territory, and the BUY/SELL marker colors
Adaptive Signal Color — Color of the adaptive reference line; a subtle contrast against the wave usually reads cleanest
Limitations
Linear regression smoothing introduces a small amount of lag. On fast reversals the wave can reach the crossover a few bars after price has already moved
Because the adaptive ratio uses the wave's own value, very small wave readings near zero make the signal line nearly freeze. This is deliberate but means the reference reacts slowly while momentum is mild
Mean-reversion style BUY and SELL labels can occur repeatedly during strong trends. Pair them with price structure or higher-timeframe bias instead of using them in isolation
Conclusion
Quantum Momentum Wave is for traders who want an oscillator that reflects the strongest recent move rather than the endpoint delta. Its value comes from the combination of peak-momentum measurement, linear regression smoothing, and an adaptive reference line that only produces labels when the wave is both stretched past zero and visibly turning back. Indicator

Artemis Volatility Bands PRO🟦 Artemis Volatility Bands PRO is a price-overlay volatility indicator built on the KernelLens Nadaraya–Watson regression library (a_jabbaroff/KernelLens/1). A single kernel estimate — selectable from eight classical kernel families — anchors the Basis line. Around it, two outer bands fan outward by a fixed multiple of the residual standard deviation, creating an envelope whose width is model-consistent with the kernel. The interior is washed with a 6-layer neon halo that mirrors the statistical density of price residuals under normality. A signal engine detects basis-breaks with confirming slope direction, guarded by Confirmed (zero-repaint) or Realtime mode. Twelve cohesive color themes, a theme-aware Dark / Light dashboard, and four opt-in alert conditions complete the indicator.
🟦 HOW IT WORKS
Artemis Volatility Bands PRO fuses two mathematical operations on every bar — a single kernel regression pass and a residual standard deviation calculation:
basis = kl.estimate(type, src, ℓ, α, period, phase, filter)
sigma = kl.confidenceBand(src, basis, window)
upper = basis + k · σ
lower = basis − k · σ
where ℓ is the Primary Bandwidth, k is the Band Multiplier, and window is the Residual σ Window. The kernel regression produces the Basis line, and the residual standard deviation (σ of price − basis) produces the per-σ band half-width.
This architecture collapses classical Bollinger band duality: in Bollinger bands, the moving average and volatility estimate live in different statistical universes. In Artemis, both emerge from a single kernel pass, so the envelope is internally consistent by construction. The Basis is always non-parametric, and the band width always measures deviation relative to the Basis, never to a disconnected moving average.
The library handles all weighted-sum computation, kernel weight evaluation, NA-safe iteration, division-by-zero guards, and input validation internally. Artemis Volatility Bands PRO does not reimplement any kernel math — every bug fix or optimization in the library automatically propagates to this indicator.
🟦 KERNEL LIBRARY INTEGRATION
Artemis Volatility Bands PRO imports the published KernelLens library and uses the following exports:
| Library Export | Used For |
|---|---|
| `kl.estimate()` | Unified dispatcher — routes to the correct kernel based on the user's Kernel Type dropdown. Called once per bar to produce the Basis line. |
| `kl.confidenceBand()` | Rolling residual standard deviation — computes σ of (source − basis) over the specified window. |
| `kl.trendState()` | Ternary trend detector — returns +1 (rising), 0 (flat), or −1 (falling) based on a 1-bar finite difference of the Basis. |
Every regression computation — kernel weight evaluation, NA-safe summation, bandwidth-aware loop termination — is delegated to the library. The indicator itself contains zero kernel math; it only orchestrates three library calls and aggregates their outputs into the band envelope and signal logic.
🟦 KERNEL REGRESSION & RESIDUAL VOLATILITY
**The Basis line** — A non-parametric kernel regression anchored to the user's choice of price source (default: close; also supports hl2, ohlc4, custom). Eight kernel families available:
| Kernel | Behavior | Best For |
|---|---|---|
| Rational Quadratic | Multi-scale mixer; α controls stretch | Default, balanced responsiveness |
| Gaussian / RBF | Canonical smoother, infinitely differentiable | Smooth trend, minimize noise |
| Periodic | Resonates with a known repetition distance p | Cyclic markets, seasonal patterns |
| Locally Periodic | Periodic × gaussian blend | Seasonal + trend drift |
| Epanechnikov | MSE-optimal, compact support | Minimal tail contamination |
| Tricube | LOWESS standard, near-Gaussian profile | Fast computation, robust |
| Triangular | Simplest compact kernel | Lightweight, real-time responsiveness |
| Cosine | Raised-cosine, smooth boundary transition | Smooth rolloff, professional appearance |
Three filter modes applied on top of the raw kernel estimate:
| Filter | Description | Use Case |
|---|---|---|
| No Filter | Single-pass Nadaraya–Watson | Rawest output, maximum responsiveness |
| Smooth | Double-pass: kernel applied to its own output | Cleaner, slightly more lag |
| Zero Lag | Ehlers de-lagging: 2·raw − smooth | Sharpens edges without increasing lag |
**Residual volatility** — Once the Basis is computed, the per-bar residual is (source − basis). The residual standard deviation is the rolling σ of this residual over a configurable window (default: 14 bars). This is the model-consistent volatility estimate — price deviations are measured relative to the kernel Basis, guaranteeing alignment between trend and volatility.
**Band levels** — upper = basis + k · σ and lower = basis − k · σ, where k is the Band Multiplier (default: 2.0, Bollinger-style). The multiplier is user-adjustable from 0.5 (tight) to 5.0 (wide).
🟦 SIGNAL ENGINE
Artemis fires Long / Short signals when price breaks the Basis with a confirming slope direction:
Long → close > basis AND basis rising
Short → close < basis AND basis falling
The signal state is persistent — once a direction flips, it remains latched until the opposite condition fires. This state machine (vii ∈ {−1, 0, +1}) ensures the Basis hue stays coherent across bars even when the raw trigger is a single-bar event.
Signal markers fire ONLY on the bar the state flips, not on every bar that satisfies the raw condition. This keeps the chart uncluttered and mirrors how discretionary traders consume trend-flip information.
**Signal Mode** — Two gating options:
| Mode | Behavior | Repaint |
|---|---|---|
| Confirmed | Signals fire ONLY after the bar closes via `barstate.isconfirmed` | Zero repaint, fully reliable for live trading |
| Realtime | Signals fire on the current (open) bar as soon as the condition is met | Fastest reaction; signal may vanish if price reverses before bar closes |
Historical repainting never occurs at any Signal Mode value. The library's `_phase` parameter shifts every kernel center into the past by that many bars, so historical bars' plotted values are final once confirmed.
🟦 6-LAYER NEON HALO VISUALIZATION
The interior between the Basis and each outer band is filled with a 6-layer gradient: 5 interior step plots plus the outer band, creating a stepped transparency schedule that mirrors the statistical density of price residuals under normality.
**Transparency schedule:**
| Layer | Transparency | Meaning |
|---|---|---|
| Outer band ↔ 1st interior | 70 % | Densest layer |
| 1st ↔ 2nd | 78 % | |
| 2nd ↔ 3rd | 85 % | |
| 3rd ↔ 4th | 90 % | |
| 4th ↔ 5th | 95 % | |
| 5th ↔ Basis | 98 % | Nearly invisible fade to centerline |
Every transparency value is scaled by the Gradient Intensity input (0–100 %), so the user can dial the visual density from invisible (0) to heavy fills (100).
**Color assignment:**
- Upper band + gradient: Bearish theme hue (short signal color)
- Lower band + gradient: Bullish theme hue (long signal color)
- Basis line: Slope-adaptive color (thBull when rising, thBear when falling, previous color on flat bars)
**Signal markers** — Two-layer neon glow plotshapes:
- Halo: size.small, 40 % opaque theme hue (glow layer)
- Core: size.tiny, 100 % opaque theme hue (bright center)
🟦 THEME SYSTEM
Twelve cohesive color palettes tuned to every trading aesthetic. One selection drives every visual component — Basis line, outer bands, gradient halos, long / short signal markers, dashboard accents — all sharing the same bull / bear / neutral color axes:
| Theme | Bull | Bear | Usage |
|---|---|---|---|
| Tropic | Cyan steel | Deep orange | Default, electric contrast |
| Amber | Warm amber | Indigo blue | Fire tones |
| Pastel | Sky blue | Soft lavender | Cool arctic glow |
| Cyber | Neon lime | Hot crimson | Cyber terminal aesthetic |
| Helios | Bright gold | Scarlet | Solar warmth |
| Electric | Electric aqua | Magenta | High-voltage neon |
| Candy | Neon green | Hot pink | Dark energy pop |
| Bloomberg | Terminal orange | Cyan | Wall Street finance heritage (PRO) |
| Solar | Solarized olive | Crimson | Developer palette, easy on eyes (PRO) |
| Royal | Imperial gold | Deep purple | Luxury signature (PRO) |
| Midnight | Deep navy | Dark crimson | Dark depth |
| Graphite | Near-black | Silver grey | Monochrome minimal |
**Dashboard display modes** — Dark (black background, bright accents) or Light (white background, darker accents), auto-adapting visual contrast regardless of chart background.
🟦 DASHBOARD
A 2-column, 9-row theme-aware status panel that updates only on the last bar (zero historical overhead). Supports Dark and Light display modes, six docking positions, and four text sizes. Renders via `force_overlay = true` on the main price chart.
| Row | Label | Content |
|---|---|---|
| Header | ARTEMIS PRO | DARK / LIGHT |
| Theme | Theme | Active palette name |
| Divider | KERNEL | — |
| Type | Type | Selected kernel type |
| Bandwidth ℓ | Bandwidth ℓ | Primary bandwidth + Phase φ |
| Basis | Basis | Current Basis value in chart mintick format |
| Divider | VOLATILITY | — |
| Residual σ | Residual σ | Current residual standard deviation |
| Signal | Signal | ▲ LONG / ▼ SHORT / ━ FLAT (direction-colored) |
🟦 ALERT CONDITIONS
Four opt-in alert conditions, each gated by its own toggle:
| Alert | Fires When |
|---|---|
| Long Signal | Price breaks above the Basis with a rising slope (confirmed state flip) |
| Short Signal | Price breaks below the Basis with a falling slope (confirmed state flip) |
| Upper Band Touch | Price touches or exceeds the upper outer band (raw crossover) |
| Lower Band Touch | Price touches or falls below the lower outer band (raw crossunder) |
Band touch alerts are useful as pre-signal early warnings in trending markets. Signal alerts are gated by the Signal Mode setting, so Confirmed mode ensures zero-repaint alerts suitable for live trading.
All alerts use `alertcondition()` for maximum compatibility with TradingView's alert system including webhooks. Messages are structured as `"Artemis Volatility Bands: "` for easy parsing in downstream automation.
🟦 RECOMMENDED PRESETS
| Trading Style | Bandwidth ℓ | Filter | Residual σ Window | Phase |
|---|---|---|---|---|
| Scalper | 10–20 | No Filter | 8–10 | 1 |
| Day Trader | 20–40 | Smooth | 14 | 2 |
| Swing | 30–60 | Smooth | 20–40 | 2 |
| Position | 60–120 | Smooth | 40–60 | 3 |
**Bandwidth tuning** — Smaller ℓ produces a tighter fit to price and faster reaction; larger ℓ produces smoother curves and more stability. Experiment with ℓ in your preferred style's range, then adjust the Residual σ Window and Filter mode for visual smoothness.
**Phase tuning** — Phase = 0 is live (flickers on the current bar); Phase = 2 is the recommended balance; Phase = 3+ adds margin against noise at the cost of lag. Historical charts are immutable at any phase value.
🟦 KERNEL-ONLY DESIGN PHILOSOPHY
Artemis Volatility Bands PRO contains zero classical technical analysis bolt-ons. No Bollinger Bands, no Keltner Channels, no linear regression, no ATR, no moving averages — only kernel regression and residual volatility. This kernel-only architecture guarantees that:
1. **Internal consistency** — The Basis and band width emerge from a single statistical model, not from mixing independent techniques.
2. **Unified parameterization** — All visual outputs (Basis, bands, gradient) are controlled by a single set of kernel-theoretic parameters.
3. **No analytical compromise** — Every choice in the indicator is mathematically motivated; no ad-hoc decorations.
The philosophy is defensive: traders who layer Artemis on top of their own edge strategies get a pure kernel-regression envelope that will not conflict with classical-TA signals already in use. Traders seeking a standalone kernel-based indicator get a complete, coherent system.
🟦 COMPATIBILITY
- Pine Script v6
- All exchanges, all asset classes (crypto, forex, equities, commodities, indices)
- All timeframes (1 minute through Monthly)
- Both Dark and Light chart themes — visual elements auto-adapt to chart background
- No exchange-specific logic — fully deterministic
Indicator renders on the main overlay chart with `force_overlay = true`. No secondary panes, no subplot logic.
🟦 TECHNICAL NOTES
- **Library dependency** — `import a_jabbaroff/KernelLens/1` — all kernel regression math is delegated to the published library
- **Plot budget** — 2 outer bands + 10 gradient interior plots + 1 Basis + 1 transparent anchor + 4 signal shapes + 12 fills + 4 alertconditions = 34 outputs, well under Pine's 64-output hard limit (50 % margin)
- **Table** — Single `var table` created once on `barstate.islast` with `force_overlay = true`; dashboard renders on the main chart pane, zero historical overhead
- **No persistent drawing objects** — no `box.new`, `line.new`, no `array.new`; all visuals are plots and fills
- **Opacity convention** — every user-facing opacity / transparency input follows `0 = invisible, 100 = fully opaque`; conversion to Pine's native transparency is centralized in a single helper function (`f_opac`)
- **Non-repainting** — inherits from the library's `_phase` parameter; no `request.security`, no lookahead, no future-bar leakage at any phase value
- **Residual consistency** — The residual σ is computed as `ta.stdev(source − basis, window)`, ensuring the band width always measures deviation relative to the kernel Basis
🟦 DISCLAIMER
Artemis Volatility Bands PRO is a technical analysis indicator built on the KernelLens Nadaraya–Watson regression library. It is provided solely for educational and research purposes and does not constitute financial, investment, or trading advice.
Kernel regression is a local smoothing technique. It estimates the mean of a source series in the neighborhood of the current bar based on historical data, but it does not predict future prices, does not generate trading signals on its own, and does not guarantee the profitability of any strategy built on top of its output. The signal engine is a mechanical detector of basis breaks and slope direction — not a forecast — and should always be combined with broader context: higher-timeframe structure, volatility regime, liquidity, news, and risk management.
Past performance of any model does not guarantee future results. Markets contain systemic risks that cannot be eliminated by any amount of mathematical rigor. Responsibility for any trading decisions rests entirely with the user. Always apply sound capital management, conduct your own independent analysis, and never risk capital you are not prepared to lose.
The author assumes no liability for direct or indirect losses incurred through the use of Artemis Volatility Bands PRO or the underlying KernelLens library. Indicator

Indicator

Wave 3 Sniper SystemWave 3 Sniper System with AI - Precision Trend & Wave Analysis
Overview
Experience the next level of market analysis with the Wave 3 Sniper System with AI. This indicator is specifically designed to identify high-probability "Wave 3" setups—the most explosive phase of market trends. By integrating advanced AI-driven algorithms, the system filters out market noise and pinpoints precise entry and exit zones, as seen in the current XAUUSD (Gold) chart.
Key Features:
AI Trend Filtering: Uses machine learning logic to confirm trend direction, ensuring you're always on the right side of the market.
Wave 3 Detection: Specifically tuned to catch the strongest momentum waves for maximum R:R (Risk-to-Reward).
Visual Signals: Clear "W3 BUY" and "W3 SELL" flags with dynamic support/resistance levels.
Optimized for Gold (XAUUSD): While versatile, this system excels in high-volatility environments like Gold Spot.
Current Market Insight (XAUUSD):
As shown in the attached chart, the system recently signaled a W3 SELL near the 4,830 level, accurately capturing the bearish momentum. The AI is currently monitoring a consolidation zone near 4,795 for the next impulsive move.
Exclusive Partner Offer 🎁
To get the most out of this system, I recommend using TradingView’s Premium features for real-time alerts and deeper backtesting.
Special Benefit for My Community:
If you haven't upgraded your TradingView plan yet, use the link below to sign up. You will receive a $15 discount coupon toward your new plan immediately!
👉 www.tradingview.com OANDA:XAUUSD
Sign up within 90 days via the link above to claim your $15 credit and access professional tools that complement the Wave 3 Sniper System.
Disclaimer:
Trading involves significant risk. This script is for educational and analysis purposes only and does not constitute financial advice. Indicator

Indicator

Divergences - Elliott Wave FilteredDivergences — Elliott Wave Filtered
A multi-oscillator divergence detection system that filters signals through a three-degree Elliott Wave engine and Bayesian probability fusion. Distinguishes between Regular divergences (reversal signals at wave ends) and Hidden divergences (continuation signals during corrections) using wave position scoring, Hurst regime analysis, and statistical quality metrics.
What It Does
This indicator scans for price-oscillator divergences across four technical indicators (RSI, Stochastic RSI, MFI, ROC) and validates them against real-time Elliott Wave structure. Unlike standard divergence indicators that fire indiscriminately, this system employs a wave-context gate — divergences only trigger if they align with specific wave positions (e.g., W5 endings for reversals, W2/W4 depths for continuations) across Small, Medium, and Large degrees.
Regular Divergences (Reversal): Price makes higher high / lower low while oscillator makes lower high / higher low. Filtered for W5, Diagonal, Corrective C, Triangle E, and W4/W2 endings where trend exhaustion is probable.
Hidden Divergences (Continuation): Price makes higher low / lower high while oscillator makes lower low / higher high. Filtered for W2, W4, and Corrective C positions where trend resumption is probable.
The Six Analytical Pillars
Multi-Oscillator Concordance : Requires minimum 2-of-4 oscillators (RSI, Stoch RSI, MFI, ROC) to simultaneously register divergence, eliminating single-indicator false positives.
Tri-Degree Wave Engine : Runs independent swing detection on Small (micro), Medium (minor), and Large (primary) degrees to determine if the divergence occurs at a significant wave node.
Wave Position Scoring : Assigns base probabilities (0.0–1.0) to wave positions — W5 (0.92), Diagonal (0.88), W2 (0.38), W4 (0.42), etc. — with separate score tables for Regular vs Hidden divergence contexts.
Cross-Degree Modifiers : Boosts probability when multiple degrees agree (e.g., Small=W5 + Medium=W5) or penalizes when they conflict (e.g., Small=W5 + Medium=W3).
Regime Detection : Integrates Hurst Exponent (mean-reversion vs persistence) and Shannon Entropy (market disorder) to weight divergence reliability — low Hurst (<0.5) favors reversal divergences, high entropy reduces signal confidence.
Bayesian Fusion : Combines concordance, z-score magnitude, wave context, trend agreement, and over-extension ratios through log-odds transformation to produce a final 0.0–1.0 probability score.
Key Features
Wave Type Filtering : Independent toggle sets for Regular vs Hidden divergences — e.g., allow W5+Diagonal+Triangle E for reversals, but only W2+W4+Corr C for continuations.
Slope Non-Intersection : Optional validation ensuring price does not cross the linear slope between P1 and P2 pivots (clean divergence requirement).
Dynamic Target Projection : Upon valid divergence, projects Fibonacci extension targets (61.8%, 100%, 161.8%) from the swing leg and plots invalidation levels (pivot ± ticks).
Degree Proximity Scaling : Small degree waves must be within 12 bars of divergence, Medium within 24 bars, Large within 48 bars — ensuring temporal relevance.
Quality Gradient : Impulse and Diagonal patterns receive quality scores (0.0–1.0) based on momentum, channel alignment, and alternation, scaling the base wave position probability.
Trend Agreement Check : Validates that divergence direction opposes (Regular) or aligns with (Hidden) the detected wave trend direction across degrees.
Inputs & Parameters
Divergence Detection
Pivot Left/Right Bars: Confirmation delay and lookback for pivot detection (default 3/1).
Min/Max Bars P1→P2: Time window constraints for valid divergence legs (default 5–unlimited).
Cooldown Bars: Minimum spacing between same-direction signals to prevent clustering (default 8).
Require Slope Non-Intersection: Toggle strict linear slope validation.
Wave Filter — Regular vs Hidden
Enable wave filter: Master toggle for each divergence type.
Degree to check: Any, Small, Medium, Large, or All Degrees (consensus requirement).
Allowed wave positions: Independent toggles for W5, Diagonal, W3, W2, W4, Corr C, Triangle E, and No Context.
Multi-Oscillator Concordance
Individual length settings for RSI (33), Stoch RSI (33, %K 6), MFI (33), ROC (33).
Min concordance: Required number of oscillators showing divergence (default 2 of 4).
OB/OS Zones: Overbought/oversold thresholds for RSI (70/30), Stoch (80/20), MFI (80/20).
Statistical Quality & Bayesian Weights
Z-score threshold: RSI deviation sensitivity (default 1.5).
Hurst lookback/entropy bins: Regime calculation windows.
Fusion weights: Concordance (0.28), Z-score (0.12), Hurst (0.12), Entropy (0.08), Wave context (0.25), Over-extension (0.08), Trend agreement (0.07).
Prior log-odds: Base bias adjustment (−3 to +3).
Min Score: Probability threshold for signal emission (default 0.85).
Wave Engine (Three Degrees)
Small: Left 3–30, Right 1–3, Min swing 0.08%.
Medium: Left 10–80, Right 1–5, Min swing 0.20%.
Large: Left 25–200, Right 2–10, Min swing 0.50%.
Wave-div proximity: 12 bars (Small), scaled 2×/4× for Medium/Large.
How to Read It
Divergence Labels:
R↑ (Green): Regular Bullish divergence — price lower low, oscillator higher low. Expect reversal up.
R↓ (Red): Regular Bearish divergence — price higher high, oscillator lower high. Expect reversal down.
H↑ (Teal): Hidden Bullish divergence — price higher low, oscillator lower low. Expect continuation up.
H↓ (Orange): Hidden Bearish divergence — price lower high, oscillator higher high. Expect continuation down.
Label Annotations: Format "Type Concordance/Total Score% WavePos" — e.g., "R↑ 3/4 92% W5/mW5" indicates 3 of 4 oscillators agree, 92% Bayesian probability, Small=W5, Medium=W5.
Dotted Lines: Connect P1 (previous pivot) to P2 (current pivot) showing the divergence slope.
Target Lines: Horizontal dashed lines at T1 (61.8%), T2 (100%), T3 (161.8%) projected from the divergence leg.
Invalidation Line: Solid grey line at the pivot price ± tick buffer — crossing this invalidates the divergence setup.
Dashboard (Top-Right): Displays current Hurst (green <0.5 mean-reverting, red >0.5 trending), Entropy (high = disorder), and detected wave positions for S/M/L degrees.
Signal Logic & Validation
Base Conditions: Price pivot confirmed, oscillator divergence detected, concordance ≥ minimum, within P1–P2 time window, cooldown satisfied.
Wave Filter Gate: Divergence bar must be within proximity window of a classified wave end (W5, Diag, W2, W4, etc.) on the specified degree(s).
Bayesian Calculation: Each component (concordance, z-score, Hurst, entropy, wave context, over-extension, trend) is converted to log-odds, weighted, summed with prior, and transformed back to probability.
Emission Threshold: Final probability must exceed Min Score (default 85%) to plot signal.
Over-Extension Ratio: Measures leg length vs previous similar leg — ratios >2.0 increase reversal probability (exhaustion signature).
Important Notes
Wave Position Scoring: Regular and Hidden divergences use inverted score tables. W5 scores 0.92 for Regular (strong reversal) but only 0.15 for Hidden (weak continuation). Conversely, W2 scores 0.38 for Regular but 0.90 for Hidden.
Cross-Degree Conflict: When degrees disagree (e.g., Small=W5 bullish, Medium=W3 bullish continuation), the system applies conflict penalties (−0.20 to −0.28) to the composite score, often suppressing the signal unless other factors compensate.
Hurst Interpretation: Hurst < 0.5 (mean-reversion regime) adds probability to Regular divergences (reversal expected) and reduces Hidden divergence scores. Hurst > 0.5 (trending) does the opposite.
Entropy Impact: High entropy (>0.7) indicates chaotic, non-cyclical market conditions — the system reduces confidence in all divergences during high entropy regimes.
Non-Intersection Validation: When enabled, the system checks that no intermediate bar crosses the linear interpolation between P1 and P2 pivots, ensuring "clean" divergence without whipsaw noise.
Quality Scaling: Impulse patterns are scored on momentum (W3 strength), channel parallelism, and alternation (W2 vs W4 slope difference). Higher quality waves boost the base position score by up to 30%.
No Repainting: Uses confirmed pivots (right bars ≥ 1) and historical bar indexing. Once a divergence is plotted at P2 confirmation bar, it remains fixed.
Mathematical Summary
Wave Position Base Scores (Regular)
W5 = 0.92, Diagonal = 0.88, Corr C = 0.65, Tri E = 0.60,
W4 = 0.42, W2 = 0.38, Neutral = 0.50, W3 = 0.12
Wave Position Base Scores (Hidden)
W2 = 0.90, W4 = 0.88, Corr C = 0.70, Neutral = 0.50,
W5 = 0.15, W3 = 0.35
Cross-Degree Modifiers
Triple Agreement = +0.20 (Tri Boost)
Dual Agreement = +0.15 (Agree Boost)
Single High vs Others Low = -0.20 to -0.28 (Conflict Penalty)
Bayesian Fusion
L = PriorLO + Σ(Weight_i × log(p_i / (1 - p_i)))
Posterior = 1 / (1 + exp(-L))
Impulse Quality
Quality = (Momentum × 0.35) + (Channel × 0.35) + (Alternation × 0.30)
FinalWaveScore = BaseScore + (BaseScore - 0.5) × Quality × 0.3
Indicator

Artemis Regression Bands🟦 Artemis Regression Bands is a kernel-driven volatility envelope indicator built on the KernelLens Nadaraya–Watson regression library (a_jabbaroff/KernelLens/1). A single kernel estimate — selectable from eight classical kernel families — anchors the Fair Value line. Around it, three residual-standard-deviation bands (±1σ, ±2σ, ±3σ) fan outward with either Linear or Exponential spacing, producing a statistically grounded envelope far cleaner than the classical close-stdev approach used by legacy Bollinger-style indicators. A four-gate Romb signal engine overlays buy / sell diamond markers when price pokes through the outermost enabled σ boundary and reverses back inside.
🟦 HOW IT WORKS
Artemis calls the KernelLens library's unified dispatcher once per bar to build the Fair Value line, then queries three additional library exports to derive the band widths, slope direction, and residual σ:
```
fair = kl.estimate (type, src, ℓ, α, period, phase, filter)
sigma = kl.confidenceBand(src, fair, window)
slopeVal = kl.slope (fair, 1)
trendSt = kl.trendState (fair, 1)
dev = baseMult · sigma
upper1 = fair + 1·dev lower1 = fair − 1·dev
upper2 = fair + 2·dev lower2 = fair − 2·dev
upper3 = fair + k3·dev lower3 = fair − k3·dev (k3 = 3 Linear | 4 Exp)
```
The library handles all weighted-sum computation, loop-depth selection, NA-safe iteration, division-by-zero guards, and input validation internally. Artemis contains zero kernel math — every bug fix or optimization in the library automatically propagates to this indicator.
🟦 KERNEL LIBRARY INTEGRATION
Artemis imports the published KernelLens library and uses the following exports:
| Library Export | Used For |
|---|---|
| `kl.estimate()` | Unified dispatcher — routes to the correct kernel based on the user's Kernel Type dropdown. Called once per bar to produce the Fair Value line. |
| `kl.confidenceBand()` | Rolling standard deviation of the (source − Fair Value) residual. Drives the band half-widths on every bar. |
| `kl.slope()` | Discrete first derivative of the Fair Value line. Feeds trend flip alerts. |
| `kl.trendState()` | Ternary classifier (+1 rising / −1 falling / 0 flat) of the Fair Value line. Drives the slope-adaptive color, the kernel trend confluence filter, and the dashboard Trend row. |
Every regression computation — kernel weight evaluation, NA-safe summation, bandwidth-aware loop termination, residual stdev, finite-difference slope — is delegated to the library. The indicator itself only orchestrates the four library calls and layers the visual pipeline on top.
🟦 EIGHT KERNEL FAMILIES
A single Kernel Type dropdown selects any of the eight kernels shipped with the KernelLens library. Each is a different mathematical smoother with its own statistical character:
| Kernel | Formula | Best For |
|---|---|---|
| Rational Quadratic | (1 + d² / (2·α·ℓ²))^(−α) | Multi-scale mixer; α controls stretch. Recommended default. |
| Gaussian / RBF | exp(−d² / (2·ℓ²)) | Canonical smoother; infinitely differentiable. |
| Periodic | exp(−2·sin²(π·d/p) / ℓ²) | Resonates with a known repetition distance p. |
| Locally Periodic | Periodic × Gaussian | Seasonal patterns with slow trend drift. |
| Epanechnikov | (3/4)·(1 − u²), \|u\| ≤ 1 | MSE-optimal; compact support, no tail contamination. |
| Tricube | (70/81)·(1 − \|u\|³)³, \|u\| ≤ 1 | LOWESS standard; near-Gaussian compact profile. |
| Triangular | (1 − \|u\|), \|u\| ≤ 1 | Simplest compact kernel; cheapest to compute. |
| Cosine | (π/4)·cos(π·u/2), \|u\| ≤ 1 | Raised-cosine; smooth boundary transition. |
Because the dropdown feeds the library's `kl.estimate()` dispatcher directly, every kernel inherits the same three-mode filter layer (No Filter / Smooth / Zero Lag) and the same non-repainting guarantees — there is no special case per kernel in Artemis.
🟦 FILTER LAYER
A second dropdown applies an optional post-processing layer on top of the raw Nadaraya–Watson estimate:
| Filter | Formula | Trade-off |
|---|---|---|
| No Filter | ŷ = ŷ_raw | Single-pass kernel. Rawest output, most reactive. |
| Smooth | ŷ = K(ŷ_raw) | Double-pass — kernel applied to its own output. Cleaner line, slightly more lag. |
| Zero Lag | ŷ = 2·ŷ_raw − K(ŷ_raw) | Ehlers de-lagging identity — sharpens edges without adding lag. |
The filter is resolved entirely inside `kl.estimate()`, so switching modes incurs no runtime cost beyond the extra kernel pass.
🟦 RESIDUAL-σ BAND ENGINE
Artemis bands are statistically grounded on the residual standard deviation — not on raw close stdev as in classical Bollinger indicators. The residual is computed as:
```
residual = src − fair
sigma = ta.stdev(residual, window) // via kl.confidenceBand()
```
Because Fair Value is already an unbiased local estimate of the source, the residual is a zero-mean noise series and its stdev captures **only the portion of price variance that the kernel could not explain**. This produces three benefits over the classical approach:
1. **Tighter bands in trending regimes** — close-stdev widens during strong trends because the trend itself inflates the variance; residual-σ does not, because the kernel absorbs the trend.
2. **Faster reaction to volatility regime changes** — residual-σ tightens as soon as the kernel fits well, and widens the instant the market breaks out of the kernel's neighborhood.
3. **True statistical interpretation** — under the assumption of locally Gaussian residuals, ±1σ / ±2σ / ±3σ enclose approximately 68 % / 95 % / 99.7 % of near-term price variation. The traditional close-stdev envelope carries no such interpretation.
A dedicated Residual σ Window input controls the lookback; typical values range from 50 (reactive, scalping) to 300 (stable, position trading).
🟦 BAND SPACING MODES
Two spacing presets shape the outward fan of the three σ bands:
| Mode | Multipliers | Character |
|---|---|---|
| Linear | 1·, 2·, 3· | Classical Bollinger-style uniform steps. Predictable, symmetric. |
| Exponential | 1·, 2·, 4· | Fibonacci-flavored — outer band (4σ) is reserved for genuine blow-off excursions. |
Base Multiplier scales all three bands uniformly (default 1.0). The formula is:
```
band_level = fair ± (baseMult · k · sigma) k ∈ {1, 2, k3}
```
where k3 resolves to 3 in Linear mode and 4 in Exponential mode. Every band has an independent visibility toggle, so minimalist users can run ±1σ only, swing traders ±3σ only, or any combination.
🟦 FOUR-GATE ROMB SIGNAL ENGINE
The Romb engine prints buy / sell diamond markers when price pokes through the outermost enabled σ band and reverses back inside. Four sequential gates protect against false entries:
| Gate | Logic | Purpose |
|---|---|---|
| 1 — Crossover | `ta.crossunder(high, triggerUp)` / `ta.crossover(low, triggerDn)` | Detects the reversal back through the outer band. |
| 2 — Warm-up | Residual σ computable for N consecutive bars | Blocks signals during the early kernel-settlement window. |
| 3 — Confluence | Fair Value slope aligns with the reversal direction | Optional PRO filter — Sell Romb requires falling kernel, Buy Romb requires rising kernel. |
| 4 — Cooldown | Minimum bar gap since the last same-side Romb | Prevents signal clustering on a single extended poke-and-reverse sequence. |
A Signal Mode toggle layers on top:
- **Confirmed** — signals fire only on `barstate.isconfirmed`; zero repaint on closed bars.
- **Realtime** — signals fire live on the current open bar; faster reaction, may vanish if price reverses before close.
Each confirmed signal is rendered as a two-layer neon diamond:
- **Halo** — `size.small`, 40 % transparent theme hue (glow layer).
- **Core** — `size.tiny`, fully opaque theme hue (bright center).
The halo renders first so the core sits cleanly on top, producing a sharp luminous marker that reads instantly even on dense price charts.
🟦 ADAPTIVE OUTER-BAND TRIGGER
The Romb engine does not hard-code the ±3σ band as the signal trigger. Instead, it resolves the outermost currently-enabled band on every bar:
```
triggerUp = show3 ? upper3 : show2 ? upper2 : show1 ? upper1 : na
triggerDn = show3 ? lower3 : show2 ? lower2 : show1 ? lower1 : na
```
The result is an envelope that respects the user's visibility choices:
| Visible Bands | Romb Fires At |
|---|---|
| ±1σ + ±2σ + ±3σ | ±3σ (default) |
| ±1σ + ±2σ | ±2σ |
| ±1σ only | ±1σ |
| All off | no signals |
Diamond positioning follows the same trigger, so the glyph always floats ~0.3σ outside whatever envelope is actually drawn on the chart. The behavior matches user intent: the band I can see is the band that fires signals.
🟦 NON-REPAINTING BEHAVIOR
Artemis inherits non-repainting behavior directly from the KernelLens library's `_phase` parameter. A single Phase input (default 2) shifts the kernel center into the past by that many bars:
- **Phase = 0** — live estimate, flickers on the current bar (real-time only; history is immutable).
- **Phase = 1** — 1-bar lag, non-repainting once the bar is confirmed.
- **Phase = 2** — recommended balance between freshness and stability (default).
- **Phase = 3+** — extra margin against erratic ticks, higher lag.
Historical repainting never occurs at any phase value. The library contains no `request.security` calls, no lookahead, and no array rotation that could leak future data. Every historical bar's plotted Fair Value, band, and Romb signal is final once confirmed.
🟦 VISUAL PIPELINE
**σ Band Outlines** — Three upper bands (±1σ / ±2σ / ±3σ) in progressively lighter `thBear` hues, three lower bands in progressively lighter `thBull` hues. Hidden bands collapse to na via their individual visibility toggles; the outline widths share a single Band Line Width input.
**Tapered Gradient Fills** — Six fills drawn between the Fair Value line and each σ band. Opacity scales progressively from ±1σ (densest, most opaque) to ±3σ (lightest, most transparent), creating a halo that mirrors the statistical density of price residuals under normality. Master Fill Opacity input (0 = invisible, 100 = fully opaque) scales all three fills uniformly.
**Fair Value Line** — Slope-adaptive color resolver swaps between `thBull` (rising kernel) and `thBear` (falling kernel). Flat bars retain the previous color so the line never flashes neutral on a perfectly horizontal tick. Width is user-controlled (1–5 px).
**Romb Diamonds** — Two-layer neon glow at the adaptive trigger band; halo + core rendering described above.
**Bar Coloring** — Optional theme-aware candle coloring driven by the Fair Value slope. Off by default; when enabled it paints every bar with the active theme's bull / bear hue based on the current trend state.
🟦 THEME SYSTEM
Twelve cohesive color palettes drive every visual component — Fair Value line, σ band outlines, gradient fills, Romb diamonds, bar coloring, and dashboard accents — all sharing the same four color axes (`thBull`, `thBear`, `thNeutral`, `thSignal`):
| Theme | Bull | Bear |
|---|---|---|
| Tropic | Cyan steel | Deep orange |
| Amber | Warm amber | Indigo blue |
| Pastel | Sky blue | Soft lavender |
| Cyber | Neon lime | Hot crimson |
| Helios | Bright gold | Scarlet |
| Electric | Electric aqua | Magenta |
| Candy | Neon green | Hot pink |
| Bloomberg | Terminal orange | Cyan |
| Solar | Solarized olive | Crimson |
| Royal | Imperial gold | Deep purple |
| Midnight | Deep navy | Dark crimson |
| Graphite | Near-black | Silver grey |
A separate Display Mode toggle (Dark / Light) controls the dashboard palette independently of the chart theme — so a Bloomberg chart theme with a Light dashboard is a valid configuration, as is Midnight chart + Dark dashboard.
🟦 DASHBOARD
A 2-column, 12-row theme-aware status panel that updates only on the last bar (zero historical overhead). Supports Dark and Light display modes, six docking positions, and four text sizes. Renders via `force_overlay = true` on the main price chart.
| Row | Label | Content |
|---|---|---|
| Header | ARTEMIS | DARK / LIGHT |
| Theme | Theme | Active palette name |
| Kernel | Kernel | Selected kernel type |
| Divider | REGRESSION | — |
| Bandwidth | Bandwidth ℓ | Bandwidth value / Phase offset φ |
| Filter | Filter | No Filter / Smooth / Zero Lag |
| Fair Value | Fair Value | Current Fair Value in chart mintick format |
| Divider | BANDS | — |
| Spacing | Spacing | Linear 1·/2·/3· or Exp 1·/2·/4· |
| Residual σ | Band σ | Rolling residual standard deviation |
| Trend | Trend | ▲ BULL / ▼ BEAR / ━ FLAT (bull/bear colored) |
| Last Romb | Last Romb | ▲ BUY (N ago) / ▼ SELL (N ago) — bull/bear colored |
**Zebra-stripe layout** — alternating `dashBg` / `dashBgAlt` row backgrounds improve scan-ability on narrow cells. Section dividers (REGRESSION, BANDS) use a third background tone (`dashSection`) with the theme's bull accent as the header color — preserving brand identity across both Display Modes.
🟦 ALERT CONDITIONS
Six opt-in alert conditions, each gated by its own toggle:
| Alert | Fires When |
|---|---|
| Bullish Trend Flip | Fair Value slope crosses from ≤ 0 into positive territory |
| Bearish Trend Flip | Fair Value slope crosses from ≥ 0 into negative territory |
| Buy Romb | Confirmed Buy Romb fires — all four signal gates passing |
| Sell Romb | Confirmed Sell Romb fires — all four signal gates passing |
| Upper Band Touch | Price touches or exceeds the outermost enabled upper band |
| Lower Band Touch | Price touches or falls below the outermost enabled lower band |
All alerts use `alertcondition()` for maximum compatibility with TradingView's alert system including webhooks. Messages are structured as `"Artemis Regression Bands: "` for easy parsing in downstream automation. Touch alerts are off by default (can be noisy in trending markets); the four core alerts are on by default.
🟦 RECOMMENDED PRESETS
| Style | Bandwidth ℓ | Filter | Phase | Spacing | σ Window | Chart |
|---|---|---|---|---|---|---|
| Scalper | 10–20 | No Filter | 1 | Linear | 50–80 | 1m–5m |
| Day Trader | 20–40 | Smooth | 2 | Linear | 80–120 | 15m–1h |
| Swing | 30–60 | Smooth | 2 | Linear or Exp | 100–200 | 4h–1D |
| Position | 60–120 | Smooth or Zero Lag | 3 | Exp | 200–300 | 1D–1W |
**Kernel type tuning**
- **Trending instruments** — Rational Quadratic (α = 1–3) or Gaussian. Smooth multi-scale response.
- **Mean-reverting instruments** — Epanechnikov or Tricube. Compact support keeps the band envelope tight.
- **Session-cyclic patterns** — Periodic (with p = session length in bars) or Locally Periodic. Resonates with known cycles.
**Romb filter tuning** — Keep Kernel Trend Confluence ON for high-conviction setups only. Switch OFF on range-bound instruments to capture both sides of the oscillation.
🟦 COMPATIBILITY
- Pine Script v6
- All exchanges, all asset classes (crypto, forex, equities, commodities, indices)
- All timeframes (1 minute through Monthly)
- Both Dark and Light chart themes — the Display Mode toggle controls dashboard palette independently
- No exchange-specific logic — fully deterministic
🟦 TECHNICAL NOTES
- **Library dependency** — `import a_jabbaroff/KernelLens/1` — all kernel regression, residual σ, slope, and trend-state math is delegated to the published library.
- **Plot budget** — 6 band plots + 1 Fair Value anchor + 1 Fair Value visible + 6 gradient fills + 4 Romb plotshapes + 1 barcolor = well under Pine's plot limits.
- **Table** — Single `var table` rebuilt on `barstate.islast` with `force_overlay = true`; zero historical overhead.
- **Signal state** — Two `var int` cooldown anchors (`lastSellBar`, `lastBuyBar`) seeded at −10000 so the very first bar always passes the gap test. A `var int stabCount` warm-up counter blocks signals during early kernel settlement.
- **No persistent drawing objects** — no `box.new`, `line.new`, no array rotations; every visual is either a plot or a single-bar plotshape.
- **Adaptive trigger resolver** — Romb crossover detection, touch alerts, and diamond positioning all read from the same `triggerUp` / `triggerDn` resolver, so band visibility toggles stay semantically coherent across every layer of the indicator.
- **Non-repainting** — inherits from the library's `_phase` parameter; no `request.security`, no lookahead, no future-bar leakage at any phase value.
🟦 DISCLAIMER
Artemis Regression Bands is a technical analysis indicator built on the KernelLens Nadaraya–Watson regression library. It is provided solely for educational and research purposes and does not constitute financial, investment, or trading advice.
Kernel regression is a local smoothing technique. It estimates the mean of a source series in the neighborhood of the current bar based on historical data, but it does not predict future prices, does not generate trading signals on its own, and does not guarantee the profitability of any strategy built on top of its output. The residual-σ envelope describes past dispersion around the kernel estimate — not a forecast of future range — and should always be combined with broader context: higher-timeframe structure, volatility regime, liquidity, news, and risk management.
Past performance of any model does not guarantee future results. Markets contain systemic risks that cannot be eliminated by any amount of mathematical rigor. Responsibility for any trading decisions rests entirely with the user. Always apply sound capital management, conduct your own independent analysis, and never risk capital you are not prepared to lose.
The author assumes no liability for direct or indirect losses incurred through the use of Artemis Regression Bands or the underlying KernelLens library. Indicator

ATR Extension to SMA50# How to Use the "ATR Extension to SMA50" Indicator
**Author:** CANSLIM Research by hkpress
**Platform:** TradingView
---
### Introduction
The **ATR Extension to SMA50** is a custom TradingView indicator designed to mathematically measure how "extended" or "stretched" a stock's price is from its 50-period Simple Moving Average (SMA50).
Instead of relying on fixed percentages, this tool uses the stock's own Average True Range (ATR) to calculate overbought or oversold conditions. This normalizes volatility, allowing you to use the exact same thresholds for a highly volatile tech stock and a slow-moving utility stock. It is an invaluable tool for risk management, identifying exhaustion points, and timing your entries or profit-taking.
---
### Section 1: How to Install on TradingView
Follow these steps to add the indicator to your TradingView charts:
1. **Open TradingView:** Log in to your account and open any chart.
2. **Open the Pine Editor:** At the very bottom of the charting screen, click on the tab labeled **Pine Editor**.
3. **Clear the Editor:** If there is any default code in the window, highlight all of it and delete it so you have a completely blank workspace.
4. **Paste the Code:** Copy the entire Pine Script code provided previously and paste it into the empty Pine Editor.
5. **Add to Chart:** Click the **Add to Chart** button located in the top right corner of the Pine Editor panel.
6. **Save the Script (Optional but Recommended):** Click **Save** in the Pine Editor, name it "ATR Extension to SMA50", so you can easily add it to other charts later from your "Indicators" menu under "My scripts".
---
### Section 2: Indicator Settings
Once the indicator is on your chart, you can adjust its parameters by hovering over the indicator's name in the bottom pane and clicking the **Settings (gear)** icon.
* **SMA Length (Default: 50):** The baseline moving average. 50 is the standard for intermediate-term trend following (favored by CANSLIM traders). You can adjust this to 20 for short-term trading or 200 for long-term investing.
* **ATR Length (Default: 14):** The lookback period for calculating the stock's volatility. 14 is the industry standard developed by J. Welles Wilder.
---
### Section 3: How to Read the Threshold Lines
The indicator plots as an oscillator with a baseline of `0` (which represents the exact price of the SMA50). Positive numbers indicate the stock is *above* the SMA50, and negative numbers indicate it is *below* it. The indicator line changes color dynamically based on the current extension.
#### Above the Mean (Uptrends)
* **0 to +1 ATR (Gray):** *Normal Base.* The stock is hugging its moving average. It is consolidating or moving quietly.
* **+2 ATR (Green):** *Healthy Trend.* The stock is trending up smoothly. A safe zone to hold.
* **+3 ATR (Yellow):** *Overextended.* The stock is starting to run hot. Breakout buyers entering here face higher risks of a pullback.
* **+4 ATR (Orange):** *Exhaustion Zone.* The stock is deeply extended. It is highly recommended to stop buying and consider protecting existing profits.
* **+5 ATR or up (Red):** *Extreme Parabolic.* A historically rare extension. Usually marks a blow-off top or climax run. Mean reversion (a sharp pullback) is highly probable.
#### Below the Mean (Downtrends)
* **0 to -1 ATR (Gray):** *Normal Pullback.* Slight weakness below the moving average.
* **-2 ATR (Green):** *Downtrend.* The stock is consistently weak.
* **-3 ATR (Yellow):** *Oversold.* The stock is getting hammered and may be due for a relief bounce.
* **-4 ATR (Orange):** *Capitulation Warning.* Deeply oversold. Sellers are exhausted.
* **-5 ATR or down (Red):** *Extreme Waterfall.* A rare panic-selling event. Often marks a tradable bottom or "V-shaped" recovery point.
---
### Section 4: Practical Trading Application
Here is how you can integrate this indicator into a trading system like CANSLIM:
**1. Avoid Chasing Breakouts**
If a stock breaks out of a base, but the ATR Extension reads **+3 or higher**, the breakout is considered "extended." It is mathematically safer to skip the trade and wait for the stock to build a new base or pull back closer to the SMA50 (the 0 to +1 zone).
**2. Defensive Profit Taking**
If you bought a stock correctly out of a base and it goes on a massive run, watch the ATR Extension. If it hits the **+4 (Orange) or +5 (Red)** levels, sell 20% to 50% of your position into the strength to lock in profits before the inevitable reversion to the mean.
**3. Spotting Climax Tops**
If a stock gaps up on massive volume after a long uptrend and the indicator hits **+5 ATR or up**, it is a classic "Climax Run" sell signal.
**4. Hunting for Snapback Bounces (Counter-Trend)**
If a fundamentally strong stock experiences a brutal sell-off due to market panic and hits the **-4 or -5 ATR or down** zone, aggressive traders can look for intraday reversal signals to buy the stock for a quick, violent snapback rally toward the SMA50.
---
*Disclaimer: This indicator is a mathematical tool designed to aid in technical analysis. It does not guarantee future performance or prevent losses. Always use proper risk management and stop losses when trading.* Indicator

Quant Edge Ribbon PRO🟦 Quant Edge Ribbon PRO is a multi-kernel divergence ribbon indicator built on the KernelLens Nadaraya–Watson regression library (a_jabbaroff/KernelLens/1). A primary kernel and eleven longer-bandwidth kernels form a dual-ribbon visualization driven by kernel regression mathematics, an integer trend score in , a theme-aware rendering pipeline, four user-configurable reference levels, and a PRO dashboard. All twelve kernels route through the unified library dispatcher, so the user may select any of the eight kernel families and any of the three filter modes from a single configuration panel.
🟦 HOW IT WORKS
Quant Edge Ribbon PRO calls the KernelLens library's unified dispatcher (`kl.estimate`) twelve times per bar — once for the primary kernel and once for each of the eleven outer kernels:
```
primary = kl.estimate(type, src, ℓ, α, period, phase, filter)
long00 = kl.estimate(type, src, ℓ + 1·s, α, period, phase, filter)
long01 = kl.estimate(type, src, ℓ + 2·s, α, period, phase, filter)
...
long10 = kl.estimate(type, src, ℓ + 11·s, α, period, phase, filter)
```
where ℓ is the Primary Bandwidth and s is the Bandwidth Step. All twelve kernels share the same kernel type, filter, shape α, period, and phase — only the bandwidth differs. This guarantees the ribbon behaves as a coherent spectrum of kernel scales rather than a mixture of unrelated signals.
The library handles all weighted-sum computation, loop-depth selection, NA-safe iteration, division-by-zero guards, and input validation internally. Quant Edge Ribbon PRO does not reimplement any kernel math — every bug fix or optimization in the library automatically propagates to this indicator.
🟦 KERNEL LIBRARY INTEGRATION
Quant Edge Ribbon PRO imports the published KernelLens library and uses the following export:
| Library Export | Used For |
|---|---|
| `kl.estimate()` | Unified dispatcher — routes to the correct kernel based on the user's Kernel Type dropdown. Called twelve times per bar, once for the primary kernel and once for each of the eleven outer kernels. |
Every regression computation — kernel weight evaluation, NA-safe summation, bandwidth-aware loop termination — is delegated to the library. The indicator itself contains zero kernel math; it only orchestrates twelve library calls and aggregates their outputs into the trend score.
🟦 THE TWELVE-KERNEL RIBBON ARCHITECTURE
**Primary kernel (the shortest, the anchor)** — A single kernel at bandwidth ℓ that serves two roles: (1) it is the reference baseline for the trend score calculation, and (2) it is plotted as a dedicated highlighted anchor line when the "Highlight Primary Kernel" toggle is ON.
**Eleven outer kernels (progressively wider)** — Kernels at bandwidths ℓ+1·s, ℓ+2·s, …, ℓ+11·s, where s is the Bandwidth Step (default: 1). Each outer kernel is plotted as a line on the main chart, all eleven sharing a single score-driven gradient color — so the entire outer ribbon shifts between the theme's bull and bear hues as the trend score moves between −11 and +11.
**Eleven inner ribbon plots (lagged primary snapshots)** — The primary kernel plotted at eleven time-lag offsets (0, 1, 2, …, 10 bars). The resulting visual is a gently flowing shadow that makes expansion and contraction of the outer ribbon easier to perceive. Opacity is user-controlled (default: 40 %).
🟦 INTEGER TREND SCORE
The trend score is a signed integer in , computed on every bar by eleven pairwise comparisons between the primary kernel (at progressive lag offsets) and the eleven outer kernels:
```
score = 0
for i in 0..10:
if primary < long_i:
score += 1
else:
score -= 1
```
**Semantic interpretation** — Each comparison pairs an older snapshot of the shortest kernel against a current snapshot of a progressively wider kernel. In an uptrend, past primary values are lower while current wider-kernel values have caught up above them — the inequality resolves positive on most pairs and the score climbs toward +11. The symmetric argument drives the score toward −11 in a downtrend.
**Score parity** — Because the score is a sum of eleven ±1 terms (score = 2k − 11, k ∈ ), it is always odd. Reachable values: { −11, −9, −7, −5, −3, −1, 1, 3, 5, 7, 9, 11 }. The score is never exactly zero.
🟦 STRENGTH CATEGORIZATION
The absolute score is bucketed into four bands, each with a matched label glyph used throughout the dashboard and the last-bar signal label:
| Score Range | Strength | Label |
|---|---|---|
| \|score\| = 1 | NEUTRAL | ▰▱▱▱ NEUTRAL |
| \|score\| ∈ {3, 5} | WEAK | ▰▰▱▱ WEAK BULL / WEAK BEAR |
| \|score\| = 7 | STRONG | ▰▰▰▱ STRONG BULL / STRONG BEAR |
| \|score\| ∈ {9, 11} | TRIPLE | ▰▰▰▰ TRIPLE BULL / TRIPLE BEAR |
The bull / bear suffix is driven by the sign of the score. The progress-bar glyphs (▰▱) give an instant at-a-glance read of confluence intensity without needing to parse the numeric value.
🟦 NON-REPAINTING BEHAVIOR
Quant Edge Ribbon PRO inherits non-repainting behavior directly from the KernelLens library's `_phase` parameter. A single Phase input (default: 2) shifts every one of the twelve kernel centers into the past by that many bars.
- Phase = 0 — live estimate, flickers on the current bar (real-time only; history is immutable)
- Phase = 1 — 1-bar lag, non-repainting once the bar is confirmed
- Phase = 2 — recommended balance between freshness and stability (default)
- Phase = 3+ — extra margin against erratic ticks, higher lag
Historical repainting never occurs at any phase value. The library contains no `request.security` calls, no lookahead, and no array rotation that could leak future data. Every historical bar's plotted value is final once confirmed.
🟦 VISUAL PIPELINE
**Outer Ribbon Gradient** — All eleven outer kernels are plotted with a single shared color driven by the trend score via `color.from_gradient(score, -11, 11, thBear, thBull)`. As the score walks across its range, the entire ribbon shifts continuously between the active theme's bearish and bullish hues — producing a smooth visual feedback loop between the math and the palette.
**Inner Ribbon Shadow Trail** — Eleven lag-shifted primary snapshots (primary through primary ) drawn in the theme's accent hue with user-controlled opacity. On a trending chart the trail visually expands; on a reversing chart it contracts. Adjust opacity from 0 (invisible) to 100 (fully opaque) — default 40 balances presence and subtlety.
**Primary Kernel Anchor Line** — The primary kernel plotted as a dedicated bold line in the theme's accent color at 80 % opacity, distinct from the shadow trail. Provides a clear centerline amid the ribbon flow. Toggleable.
**Oscillator Subplot** — The smoothed trend score plotted in a dedicated subplot with a score-gradient vertical fill between the score line and the zero line. Opacity is user-controlled. An optional bold score line (up to 4 px wide) overlays the fill for sharp numeric reading.
**Last-Bar Trend Label** — A right-anchored label at the current bar in the oscillator pane. Format: `▲ TRIPLE BULL 11 / 11` (bull) or `▼ WEAK BEAR −3 / 11` (bear). The label is deleted and redrawn on every bar, so only one instance is ever present on the chart.
🟦 OSCILLATOR STYLES
The oscillator subplot ships with two visual presets, selectable from the Oscillator Style dropdown:
| Style | Plot Style | Fill | Best For |
|---|---|---|---|
| Classic Gradient | `plot.style_line` (smooth curve) | Continuous vertical gradient from score to zero | Trend flow, slope momentum |
| Stepline | `plot.style_stepline` (staircase) | Stepped gradient mirroring the discrete score plateaus | Signal / threshold trading, discrete level crossings |
**Classic Gradient** produces a smooth curve traced through the smoothed score values, with the gradient fill flowing continuously between the score line and the zero line. This is the default and suits traders who read trend direction through slope and curvature.
**Stepline** renders each bar as a horizontal plateau joined to the next bar by a vertical edge. Because the raw score is always an odd integer in { −11, −9, …, 9, 11 }, the staircase visualization honors the score's true discrete nature — making it easier to identify exact threshold crossings (e.g. the moment the score enters the ±9 extreme zone). The fill inherits the same stepline style, so the entire oscillator pane stays geometrically consistent.
Both styles share the same opacity controls, score line toggle, and line width setting — only the geometry of the score line and its fill changes between them.
🟦 THEME SYSTEM
Ten cohesive color palettes tuned to the Quant Edge Ribbon PRO optical brand. One selection drives every visual component — outer ribbon gradient, inner ribbon accent, oscillator fill, reference lines, signal label, dashboard accents — all sharing the same bull / bear / accent color axes:
| Theme | Bull | Bear |
|---|---|---|
| Prism | Forest green | Crimson red |
| Focus | Cyan steel | Deep orange |
| Solar | Warm amber | Indigo red |
| Frost | Sky blue | Soft lavender |
| Laser | Neon lime | Hot crimson |
| Aurora | Bright gold | Scarlet |
| Plasma | Electric aqua | Magenta |
| Bloom | Mint green | Hot pink |
| Eclipse | Deep navy | Dark crimson |
| Carbon | Near-black | Silver grey |
The oscillator's zero line uses Pine's `chart.fg_color` so it auto-adapts to the actual chart background (white on dark charts, black on light charts) — independent of the Dashboard's Display Mode setting.
🟦 REFERENCE LEVELS
Four user-configurable horizontal reference lines mark the score's structural thresholds inside the oscillator subplot:
| Level | Style | Meaning |
|---|---|---|
| +11 / −11 | Dotted | Ceiling / floor — the mathematical maximum (every comparison aligned) |
| +9 / −9 | Dashed | Extreme zone — nine or more of the eleven comparisons agree on direction |
Each pair (±11 and ±9) has an independent opacity input (0–100 %). A master toggle (Show Reference Levels) collapses all four lines to fully transparent in a single branch — useful for minimalist layouts. An additional `showOsc` gate hides them automatically when the oscillator itself is disabled.
🟦 PRO DASHBOARD
A 2-column, 12-row theme-aware status panel that updates only on the last bar (zero historical overhead). Supports Dark and Light display modes, six docking positions, and four text sizes. Renders via `force_overlay = true` on the main price chart.
| Row | Label | Content |
|---|---|---|
| Header | Q-EDGE PRO | DARK / LIGHT |
| Theme | Theme | Active palette name |
| Kernel | Kernel | Selected kernel type |
| Divider | RIBBON | — |
| Primary ℓ | Primary ℓ | Primary bandwidth value |
| Span | Span | ℓ → ℓ + 11·s |
| Filter | Filter | No Filter / Smooth / Zero Lag |
| Divider | SCORE | — |
| Score | Score | ▲/▼ + integer score + " / 11" (bull/bear colored) |
| Bull / Bear | Bull / Bear | Bull comparison count / bear comparison count |
| Strength | Strength | ▰-bar + NEUTRAL / WEAK / STRONG / TRIPLE label |
| Primary | Primary | Primary kernel value in chart mintick format |
**Bull / Bear breakdown** — The eleven pairwise comparisons split into bulls (resolved +1) and bears (resolved −1). Always sums to 11, so this row gives a direct visual of how many kernel scales agree with the net direction.
🟦 ALERT CONDITIONS
Six opt-in alert conditions, each gated by its own toggle:
| Alert | Fires When |
|---|---|
| Bullish Flip | Score crosses from ≤ 0 into positive territory |
| Bearish Flip | Score crosses from ≥ 0 into negative territory |
| Extreme Bullish | Score reaches +9 or higher (first entry into the zone) |
| Extreme Bearish | Score reaches −9 or lower (first entry into the zone) |
| Full Confluence Up | Score hits +11 — every outer kernel aligned bullishly |
| Full Confluence Down | Score hits −11 — every outer kernel aligned bearishly |
All alerts use `alertcondition()` for maximum compatibility with TradingView's alert system including webhooks. Messages are structured as `"Quant Edge Ribbon PRO: "` for easy parsing in downstream automation.
🟦 RECOMMENDED PRESETS
| Style | Primary ℓ | Bandwidth Step s | Phase | Filter | Chart |
|---|---|---|---|---|---|
| Scalper | 8–16 | 1 | 1 | No Filter | 1m–5m |
| Day Trader | 16–32 | 1–2 | 2 | Smooth | 15m–1h |
| Swing | 25–50 | 1–2 | 2 | Smooth | 4h–1D |
| Position | 50–120 | 2–3 | 3 | Smooth | 1D–1W |
**Bandwidth Step tuning** — Step = 1 produces a tight ribbon where adjacent outer kernels sit visually close together. Steps of 2–4 spread the eleven outer kernels across a broader spectrum of scales, making expansion / contraction easier to read at a glance. Step 5–6 is reserved for very wide ribbons where each line represents a distinctly different time scale.
🟦 COMPATIBILITY
- Pine Script v6
- All exchanges, all asset classes (crypto, forex, equities, commodities, indices)
- All timeframes (1 minute through Monthly)
- Both Dark and Light chart themes — visual elements auto-adapt via `chart.fg_color`
- No exchange-specific logic — fully deterministic
🟦 TECHNICAL NOTES
- **Library dependency** — `import a_jabbaroff/KernelLens/1` — all kernel regression math is delegated to the published library
- **Plot budget** — 11 outer + 11 inner + 1 primary + 2 oscillator plots + 1 fill + 4 hlines = well under Pine's 64-plot limit
- **Table** — Single `var table` created once on `barstate.islast` with `force_overlay = true`; dashboard renders on the main chart pane, zero historical overhead
- **No persistent drawing objects** — no `box.new`, `line.new`, no `array.new`; the single trend label is deleted and recreated every bar so only one instance is ever present
- **Opacity convention** — every user-facing opacity input follows `0 = invisible, 100 = fully opaque`; conversion to Pine's native transparency is centralized in a single helper function (`f_opac`)
- **Non-repainting** — inherits from the library's `_phase` parameter; no `request.security`, no lookahead, no future-bar leakage at any phase value
- **Chart background adaptive** — the oscillator's zero line uses `chart.fg_color`, so it always renders with high contrast regardless of the user's chart color scheme
🟦 DISCLAIMER
Quant Edge Ribbon PRO is a technical analysis indicator built on the KernelLens Nadaraya–Watson regression library. It is provided solely for educational and research purposes and does not constitute financial, investment, or trading advice.
Kernel regression is a local smoothing technique. It estimates the mean of a source series in the neighborhood of the current bar based on historical data, but it does not predict future prices, does not generate trading signals on its own, and does not guarantee the profitability of any strategy built on top of its output. The integer trend score is a geometric summary of kernel alignments — not a forecast — and should always be combined with broader context: higher-timeframe structure, volatility regime, liquidity, news, and risk management.
Past performance of any model does not guarantee future results. Markets contain systemic risks that cannot be eliminated by any amount of mathematical rigor. Responsibility for any trading decisions rests entirely with the user. Always apply sound capital management, conduct your own independent analysis, and never risk capital you are not prepared to lose.
The author assumes no liability for direct or indirect losses incurred through the use of Quant Edge Ribbon PRO or the underlying KernelLens library. Indicator

Indicator

Indicator

Delta Pressure Gauge [JOAT]Delta Pressure Gauge
Introduction
Delta Pressure Gauge is a pane-based oscillator that constructs a volume-weighted directional wave from bar-by-bar delta estimation, normalized using a rolling maximum to ensure consistent scaling across all instruments and timeframes. The oscillator measures the pressure imbalance between buying volume and selling volume, smoothed into a wave that reveals accumulation and distribution phases with high visual clarity. The indicator includes a money flow pressure line, a cumulative windowed delta cloud, divergence detection, and crossover signal dots.
Traditional volume indicators — OBV, CMF, MFI — measure volume flows using raw or price-weighted calculations that are difficult to compare across instruments or timeframes because their absolute values depend on the asset's volume profile. Delta Pressure Gauge normalizes everything to a -1 to +1 scale using a rolling maximum, producing readings that are immediately interpretable regardless of whether the asset trades 100 shares or 100 million. The wave design provides a visual rhythm that makes accumulation and distribution phases recognizable at a glance.
Core Concepts
1. Body-Quality Weighted Bar Delta
Each bar contributes a delta value based on direction (bullish = +volume, bearish = -volume) multiplied by the bar's body quality ratio (body size divided by total range). A full-body bar contributes 100% of its volume to delta. A doji bar with no body contributes 0%. This filtering reduces the noise contribution of indecision bars that add volume without directional information.
body_qual = math.abs(close - open) / math.max(high - low, syminfo.mintick)
bar_delta = bar_dir * volume * body_qual
2. Rolling Maximum Normalization
The raw wave EMA is normalized by dividing by the rolling maximum absolute value over the normalization window. Unlike percentile-based normalization, rolling maximum works reliably from the first bar, requires no minimum warmup period, and produces values that are always within the -1 to +1 range:
norm_ref = ta.highest(math.abs(raw_wave), i_norm)
wt1 = raw_wave / math.max(nz(norm_ref, 1.0), 1.0)
3. Windowed Cumulative Delta
Rather than using an all-time cumulative delta (which grows without bound and becomes dominated by early bars), the cumulative component uses a 30-bar rolling sum. This produces a medium-term delta bias that reflects the recent directional commitment of volume participants.
4. Money Flow Pressure Line
A separate money flow calculation weights volume by the ratio of price movement to range: (close - open) / range × volume. This captures the efficiency of price movement relative to its volume cost — high-momentum bars have larger weights than range-bound bars.
5. Divergence Detection
Bullish divergence is detected when the delta wave makes a higher low while price makes a lower low. Bearish divergence is the mirror. Detection uses confirmed pivot points on the wave with persistent previous-pivot storage, avoiding any ta.valuewhen type compatibility issues. Divergence lines are rendered directly on the oscillator pane.
Features
Wave Oscillator: Gradient area fill between wave and zero, color-coded by direction and intensity
Signal Line: Smoothed signal with direction-colored rendering
Histogram: Four-state colored momentum bars showing wave-signal separation and its rate of change
Crossover Dots: Large circles with glow rings at every wave/signal crossover
Zero-Line Cross Dots: Small markers when wave crosses the zero line
Overbought/Oversold Extreme Dots: Markers at extreme readings
Divergence Triangles and Lines: Yellow markers and connecting lines when divergence is detected
Cumulative Delta Cloud: Area fill showing 30-bar rolling delta direction
Money Flow Line: Purple secondary line for cross-confirmation
Volume Surge Markers: Cross markers when volume exceeds 2x average
12-Row Dashboard: Pressure state, wave values, histogram, signals, cumulative delta, money flow, volume ratio, divergence state
Input Parameters
Wave Channel Length: Fast EMA for wave construction (default: 10)
Wave Average Length: Signal line smoothing period (default: 21)
Rolling Norm Window: Window for rolling maximum normalization (default: 100)
Overbought/Oversold levels: Four configurable threshold lines
Divergence pivot lookback settings
How to Use This Indicator
Crossover Dots as Momentum Shifts
When the wave crosses above the signal line (green dot), buying pressure is accelerating relative to the smoothed baseline. This confirms a momentum pickup. The opposite for bearish crosses. These signals are strongest when they occur near or below the oversold line.
Zero-Line Confirmation
The wave crossing zero from below indicates that aggregate buying pressure over the wave window has turned net positive. This is a regime confirmation, not an entry signal in isolation, but it supports bullish bias when aligned with price structure.
Divergence at Extremes
Divergence is most meaningful when the wave is at or near an overbought or oversold extreme. A bullish divergence from the oversold zone (yellow triangle pointing up) suggests the distribution of buying pressure is shifting despite continued price weakness.
Cumulative Delta Direction
The blue-purple cloud shows whether the 30-bar rolling delta is net positive or negative. When the wave crosses bullishly and the cumulative delta is also positive, both the momentum and the persistent pressure agree.
Limitations
This indicator uses close-open direction to estimate bar delta. True bid-ask volume data (available only through specialized data providers) would be more precise. On instruments with significant wick activity (doji bars), this estimation introduces noise
Normalization by rolling maximum means a single extreme bar sets the scale for the entire norm window. One unusually large volume bar will compress all surrounding readings
Divergence detection requires enough bars for pivot confirmation. The pivot right-side lookback introduces a lag in divergence signals
This indicator measures volume pressure proxies, not actual institutional activity. Large volume does not always reflect institutional intent
Originality Statement
The body-quality weighting applied before delta smoothing is a deliberate design choice that reduces doji noise in a way that raw-volume or typical-price approaches do not. The rolling maximum normalization (rather than percentile or z-score) was chosen specifically because it operates reliably from the first bar without a warmup cliff, making the indicator immediately usable on limited datasets. The combination of a wave oscillator, cumulative delta cloud, and money flow line on a single pane provides three independent perspectives on the same underlying volume pressure question.
Disclaimer
This indicator is for educational and informational purposes only. Volume pressure readings are estimates derived from OHLCV data. They do not represent actual order flow or institutional positioning. Past divergence patterns do not predict future price reactions. Always apply appropriate risk management.
-Made with passion by officialjackofalltrades
Indicator

Indicator
