Structure-Anchored VWAP [WillyAlgoTrader]📐 Structure-Anchored VWAP is an overlay indicator that anchors a true volume-weighted average price to market structure and re-anchors it automatically at every confirmed swing pivot, structure break, fast extreme, or one manual date — combining a pivot-based structure engine, an O(1) prefix-sum VWAP core, volume-weighted sigma bands, a retest entry model with ATR risk management, and a sectioned dashboard with session statistics.
The core insight: a VWAP anchored to the start of the current structural leg tells you the average price at which volume actually changed hands since this move began. That is the level participants in this leg are collectively break-even at. Session VWAP resets at midnight and ignores structure. Manual anchored VWAP requires you to drag it and re-drag it. This indicator keeps the anchor synchronised with the structure itself, and measures how stretched price is from that anchor in the leg's own volume-weighted standard deviations rather than in generic ATR units.
It works on any market and any timeframe. On instruments with no volume feed it falls back to time weighting automatically and says so in the dashboard.
🧩 WHY THESE COMPONENTS WORK TOGETHER
A VWAP alone has no memory of structure — it does not know whether the market is making higher highs or lower lows, so it cannot know when its own anchor has gone stale. A structure detector alone tells you HH / HL / LH / LL but gives you no price level to trade against. Deviation bands built on ATR describe candle size, not participation, so they say nothing about where volume was actually transacted. And an entry signal without a fixed stop and target is not a trade, it is an opinion.
This indicator connects all four into one chain:
Pivot structure engine → anchor selection → prefix-sum anchored VWAP → volume-weighted sigma bands → retest detection → ATR risk model → session statistics
The structure engine finds confirmed swing highs and lows, filters them by ATR amplitude and enforces strict high/low alternation, so every anchor is a real structural turn rather than a passing wick. Anchor selection decides which of those turns starts a new leg, with four different policies for four trading styles. The prefix-sum core then computes the anchored VWAP for that leg — and because it also accumulates the sum of squared prices, the same pass produces the leg's own volume-weighted standard deviation, so the bands are derived from the same data as the line instead of being bolted on. The retest engine watches the distance between price and that line, requires price to leave and come back, and only then produces an entry. The risk model turns the entry into a fixed stop and three targets, and the statistics layer records what happened to each of them.
Remove any link and the chain stops working. Without structure anchoring, the VWAP measures a leg that ended days ago. Without the ATR amplitude filter, every minor wick creates a new anchor and the line resets constantly. Without the sigma bands, "far from VWAP" has no unit. Without the retest rule, every touch of the line is a signal, including the fifty touches that happen while price is glued to it. Without the risk layer, you know where to enter but not where you are wrong.
🔍 WHAT MAKES IT ORIGINAL
1️⃣ Prefix-sum VWAP core — any anchor evaluated in O(1), including a decayed one.
Three running totals are maintained on every bar, where p is the price source and w is the bar weight:
— S_w(t) = lam × S_w(t−1) + w(t)
— S_pw(t) = lam × S_pw(t−1) + p(t) × w(t)
— S_p2(t) = lam × S_p2(t−1) + p(t)² × w(t)
The sum over any leg is then recovered without looping:
— sum = S(t) − lam^(t−a+1) × S(a−1)
With lam = 1 this is an exact cumulative anchored VWAP — every bar of the leg keeps its full weight, the same quantity the built-in Anchored VWAP tool computes. With lam < 1 the same identity still holds, which is what makes the optional Half-life mode possible without a second engine.
Why this matters: re-anchoring becomes cheap. Moving the anchor does not require replaying the whole leg bar by bar, so the indicator can afford four anchor modes and legs up to 4000 bars long without a performance penalty.
2️⃣ Volume-weighted sigma bands — dispersion of the leg, not size of the candle.
Because the squared-price sum is already accumulated, the leg's variance comes out of the same pass:
— VWAP = sum_pw / sum_w
— sigma = sqrt( max( sum_p2 / sum_w − VWAP², 0 ) )
Bands are drawn at VWAP ± multiplier × sigma. Band 1 defaults to 0.5 sigma (the value-area edge of this leg), Band 2 to 2.0 sigma and is off by default.
Why this matters: an ATR band tells you how big recent candles were. A volume-weighted sigma band tells you how widely the volume of this specific leg was distributed around its own average price. Two markets with identical ATR but different participation profiles get different bands, and the "Premium / Fair value / Discount" classification in the dashboard becomes comparable across instruments.
3️⃣ Four anchor modes — one engine, four trading styles.
— Swing (default): a new leg starts at every confirmed pivot. The anchor is the opposite extreme, so a bullish leg is anchored at the swing low that preceded it.
— Structure break : a new leg starts only when price closes beyond the previous swing. The anchor is then the extreme that preceded the break, found by scanning back from that swing. Fewer legs, each tied to an actual break of structure.
— Fast : no confirmation delay. The bar printing the highest high or lowest low of the last N bars (default 30) is treated as a new extreme, and the leg flips the moment an extreme opposite to the previous one appears. When a bar prints both a new high and a new low, the candle direction decides which one is taken.
— Manual : a single leg from a chosen date and time, which reproduces the behaviour of the built-in Anchored VWAP tool inside the same framework — useful for comparing against a manual anchor or pinning a level.
4️⃣ Structure engine with ATR amplitude filter and strict alternation.
Pivots come from equal left/right lookback (default 55/55). A new pivot of the opposite type is only accepted when it clears an ATR-scaled amplitude:
— accept a new high when: pivotHigh − lastSwingLow ≥ minSwing × ATR(atrLen)
— accept a new low when: lastSwingHigh − pivotLow ≥ minSwing × ATR(atrLen)
Default minSwing 1.5, ATR length 13. A pivot of the same type as the last one does not create a new structural point — it only supersedes the previous extreme if it is more extreme. This enforces a clean alternating high-low-high-low sequence instead of clusters of adjacent highs.
Classification against the previous extreme of the same type, with an equality tolerance (default 0.1 × ATR):
— |current − previous| ≤ eqTol × ATR → EQH or EQL
— current > previous → HH or HL
— current < previous → LH or LL
5️⃣ Retest entry model — price must leave before it can come back.
Every bar the engine measures the relationship between the bar range and the anchored VWAP:
— tol = sigma × touchTolerance (default 0.25), or ATR × 0.1 while sigma is still zero
— touch = low ≤ VWAP + tol and high ≥ VWAP − tol
— outside = bullish leg ? low > VWAP + tol : high < VWAP − tol
An "away" counter increments on every outside bar and resets to zero on every touch. A retest fires only when a touch happens while the committed away counter has already reached the threshold (default 5 bars).
Why this matters: a raw "price touched VWAP" condition fires continuously in the chop that surrounds every mean. Requiring a genuine departure first converts an omnipresent condition into a discrete, countable event.
6️⃣ Volume balance — who controlled this leg.
While the leg accumulates, every bar's weight is assigned to one of two buckets by where it closed relative to the VWAP at that moment:
— close ≥ VWAP → volUp += w
— close < VWAP → volDn += w
— balance = volUp / (volUp + volDn) × 100
The dashboard shows this as a percentage with a bar gauge, and relabels it "Bars above VWAP" automatically when the instrument has no volume data. Above 50 % means most of the leg's participation happened above its own average price.
7️⃣ Signal strength — a transparent 0-100 context score.
Four independent components, published in full so the number is auditable rather than a black box:
— 40 pts × (volume balance aligned with leg direction, 0..1). For a bearish leg the balance is inverted before scoring.
— 25 pts if price sits on the leg's own side of the VWAP.
— 20 pts if price is not stretched beyond Band 2, i.e. |distance in sigma| ≤ band 2 multiplier.
— 15 pts if the leg has already produced at least one retest.
The score is clamped to 100 and shown with a gauge. This is a context filter, not a proven edge — it says how coherent the current leg is, nothing more.
8️⃣ VWAP memory levels — dead legs leave a level behind.
When a leg ends on a genuine direction flip, its final VWAP value is written to the chart as a dashed horizontal line. That line extends forward until price trades through it, then it is either removed or faded to dotted, depending on a setting. Up to four such levels are kept (configurable), and the newest push out the oldest.
When a level is created, the bars between the anchor and the current bar are scanned first, so a level that was already traded through is never shown as untouched.
9️⃣ Single-position trade model with break-even and outcome tracking.
A retest signal opens a trade only while flat — signals never stack. On entry, the levels are fixed once and never recalculated:
— slDistance = ATR(riskAtrLen) × slMultiplier
— long: SL = entry − slDistance, TP(n) = entry + slDistance × tpMult(n)
— short: SL = entry + slDistance, TP(n) = entry − slDistance × tpMult(n)
Presets set all four multipliers at once — Conservative 2.5 / 1R / 2R / 4R, Balanced 1.5 / 1R / 2R / 3R, Aggressive 1.0 / 1.5R / 2.5R / 4R, Scalping 0.8 / 0.8R / 1.5R / 2R, or Custom.
Break-even is optional and on by default: the first touch of TP1 moves the stop to the entry price, the entry label changes to show it now acts as the stop, and the stop line dims. TP1 still counts as a win. Hit checks begin only on the bar after entry and only on confirmed bars, so the entry bar's own range cannot close the trade it just opened.
🔟 Persistent trade forensics — the chart keeps the last result.
SL and TP lines are not deleted when the trade closes. They stay until the next entry, so the last trade remains readable on the chart: any target that was reached is redrawn as a solid teal line and its label gets a check mark, while untouched targets keep their original dashed style. Labels can show the distance from entry in percent, for example "SL 78120.5 (-0.36%)".
1️⃣1️⃣ Realtime correctness — ring buffers and a commit/undo pattern.
Functions that only run on some bars cannot use the history operator safely, because the history they see is sparse and does not correspond to chart bars. All per-bar values this indicator needs later are therefore written to explicit ring buffers on every single bar, and read back by index.
On top of that, the live leg uses a commit/undo pattern: statistics are always recomputed from the last confirmed state, and the provisional point for the forming bar is popped before a new one is pushed. A bar being formed can therefore never be counted twice, no matter how many ticks arrive.
1️⃣2️⃣ Continuous curve across anchor changes.
When a new anchor appears, the previous leg is not erased — it is cut exactly at the new anchor bar and frozen. The curve therefore has no gaps at handover points, including the case where a stronger extreme of the same type supersedes the previous one.
⚙️ HOW IT WORKS — CALCULATION FLOW
Step 1 — Structure: On each confirmed bar the engine evaluates pivot highs and lows with equal left/right lookback, applies the ATR amplitude filter, enforces high/low alternation and classifies the result as HH, HL, LH, LL, EQH or EQL.
Step 2 — Weighting: The bar weight is volume, or 1.0 when the instrument has no volume. If spike clamping is on, the weight is capped at N × the 50-bar median volume so a single print cannot dominate the average.
Step 3 — Accumulation: The three running totals of weight, price × weight and price² × weight are advanced, decayed by lam if Half-life weighting is selected.
Step 4 — Buffering: The totals plus high, low, close and ATR are appended to ring buffers, one entry per bar, with the current bar's provisional entry overwritten rather than duplicated on repeat ticks.
Step 5 — Anchor decision: The active anchor mode decides whether this bar starts a new leg and where that leg's anchor sits.
Step 6 — Leg build: On a new anchor the previous leg is trimmed to the anchor bar, frozen and archived, a memory level is created if the direction actually flipped, and the new leg is replayed once from the anchor to the current bar. On every other bar the live leg simply advances by one point.
Step 7 — Readouts: VWAP, sigma, distance in sigma and percent, zone, volume balance, leg age and the strength score are computed for the current bar.
Step 8 — Signal: The retest rule is evaluated. A qualifying retest, on a confirmed and warmed-up bar, while flat, becomes an entry.
Step 9 — Risk: On entry the stop and three targets are fixed. On later confirmed bars they are tested for hits, break-even is applied after TP1, and the trade is closed by stop or final target.
Step 10 — Reporting: Lines, labels, markers, the dashboard and alerts are updated. Closed trades update the win/loss counters and the form strip.
📖 HOW TO USE
🎯 Quick start:
1. Add the indicator. Defaults are tuned for 15m to 4H swing structure.
2. Watch the coloured curve — it is the anchored VWAP of the leg the market is currently in.
3. Wait for a Long ▲ or Short ▼ marker. That is a retest of the VWAP in the direction of the leg.
4. Read the Trade section of the dashboard for the stop, the three targets and the R:R.
5. If signals are too frequent, raise "Bars away before a retest counts". If legs are too frequent, raise pivot strength or the minimum swing size.
👁️ Reading the chart:
— 🟢 Green curve = bullish leg, anchored at the swing low that started it.
— 🔴 Red curve = bearish leg, anchored at the swing high that started it.
— Shaded band around the curve = ± sigma of this leg. Price inside it is at fair value for the leg.
— 🟢 Long ▲ / 🔴 Short ▼ marker = a retest entry was taken on that bar.
— Dotted blue line = entry. Solid red line = stop. Dashed green lines = TP1, TP2, TP3.
— A target that turns solid teal with a ✓ in its label was reached.
— An orange entry label reading "→ SL (BE)" means the stop has been moved to break-even.
— Dashed horizontal level far from the curve = a memory level, the final VWAP of a finished leg.
— HH / HL / LH / LL / EQH / EQL tags mark every confirmed pivot.
📊 Dashboard fields:
— Trend : direction of the current leg.
— Signal : LONG, SHORT or Wait. A new trade can only open while flat.
— Strength : the 0-100 context score with a gauge.
— Last event : the most recent new leg or retest.
— Timeframe : the chart resolution.
— Mode : active anchor mode and weighting, plus a note when the symbol has no volume.
— Anchor : structure tag and price of the bar the leg is anchored to.
— Leg age : bars since the anchor and the price move from it.
— VWAP : the anchored VWAP on the current bar.
— Price vs VWAP : distance in sigma and in percent.
— Zone : Premium above Band 2, Discount below it, Fair value in between.
— Vol above VWAP : share of the leg's weight transacted above the VWAP, with a gauge.
— SL / TP1 / TP2 / TP3 : the fixed levels of the open trade. A ✓ marks a reached target, "BE @" marks a stop moved to entry.
— R:R (TP1) and SL Dist % : reward-to-risk at the first target and the stop distance as a percentage of entry.
— Trades / W / L / Win rate / Form : closed trades in the loaded history, the win-loss split, the win rate with a gauge and the last ten outcomes as ▰ and ▱.
🔧 Tuning guide:
— Too many legs, the line resets constantly: raise pivot strength (55/55 → 80/80) or the minimum swing size (1.5 → 3.0).
— Legs appear too late: lower pivot strength, or switch the anchor mode to Fast for immediate flips.
— Too many entries: raise "Bars away before a retest counts" and lower the touch tolerance.
— The line drifts too far from price on long legs: switch Weighting to Half-life. This is no longer a textbook VWAP, and the dashboard says so.
— Comparing against the built-in Anchored VWAP tool: set the mode to Manual with the same anchor time, price source to hl2, weighting to Cumulative, and turn volume clamping off.
— Stops feel too tight or too wide: change the Risk Preset before touching individual multipliers.
⚙️ KEY SETTINGS
⚙️ Main Settings:
— Pivot strength left / right (default 55 / 55): bars required on each side of a swing. Right is the confirmation delay.
— Minimum swing size (default 1.5 × ATR): amplitude filter for new pivots. 0 disables it.
— ATR Length (default 13): ATR used by the swing filter and the equality tolerance.
— Re-anchor on (default Swing): Swing, Structure break, Fast or Manual.
— Fast mode: extreme lookback (default 30): lookback for the Fast mode only.
— Equal high/low tolerance (default 0.1 × ATR): threshold for EQH and EQL tags.
— Manual anchor : date and time for the Manual mode, shown in the chart's timezone.
📐 Anchored VWAP:
— Price source (default hl2): hl2 matches the built-in tool, hlc3 weights closes more, close is the most reactive.
— Weighting (default Cumulative): Cumulative is a true VWAP, Half-life fades older bars.
— Half-life (default 21 bars): only used by Half-life weighting.
— Clamp volume spikes (default on, 4 × median): caps outlier volume bars.
— Max leg length (default 4000 bars): keeps very old anchors bounded.
📏 Deviation Bands:
— Band 1 (default on, 0.5 sigma): inner band.
— Band 2 (default off, 2.0 sigma): outer band, also defines the Premium and Discount zones.
— Fill transparency (default 90).
🎯 Signals & Levels:
— Bars away before a retest counts (default 5).
— Touch tolerance (default 0.25 sigma).
— VWAP memory levels (default on, max 4, crossed levels removed).
🛡️ Risk Management:
— Risk Preset (default Balanced): Conservative, Balanced, Aggressive, Scalping or Custom.
— ATR Length (SL) (default 13).
— SL ×ATR / TP1 / TP2 / TP3 ×Risk (defaults 1.5 / 1.0 / 2.0 / 3.0): used by the Custom preset.
— Break-Even After TP1 (default on).
— Show SL/TP Lines, Labels, % Distance (all on by default).
— Entry / SL / TP Line Style (defaults Dotted / Solid / Dashed).
🎨 Visual:
— Theme (default Auto): Auto detects the chart background, Dark and Light force it.
— Show Buy/Sell Signals, HH/HL/LH/LL, Leg Background, Watermark .
— SL/TP Label Font Size (default Small).
— Finished legs kept on chart (default 30).
📊 Dashboard:
— Position (default Top Right) and four independent section switches: Market, VWAP, Trade, Stats.
🔔 ALERTS
— 🟢 LONG — VWAP retest entry, with price, VWAP, SL, TP1, TP2, TP3 and R:R
— 🔴 SHORT — same payload, short side
— 🛑 SL HIT — entry and stop price. Reported as 🛡️ BE STOP-OUT when the stop had already been moved to break-even
— 🛡️ BREAK-EVEN — stop moved to entry after TP1 (optional)
— 🎯 TP1 HIT, 🎯🎯 TP2 HIT, 🏆 TP3 HIT — first touch of each target (optional)
— 🟢 New bullish leg / 🔴 New bearish leg — a new anchor was set (optional)
— 🔵 Close above VWAP / 🔵 Close below VWAP — the close crossed the anchored VWAP (optional)
Entry alerts support both plain text and a JSON webhook payload. All alerts fire on bar close.
⚠️ IMPORTANT NOTES
— 🚫 No repainting of confirmed values. Every structure event, entry, stop, target and alert is evaluated only when barstate.isconfirmed is true. Pivots use equal left and right lookback, so the swing point is in the past by the "right" value at the moment it becomes known — that is delayed confirmation, not a look into the future. Stop and target hits are tested only from the bar after entry. Alerts fire once per bar close.
— 📐 What does update intrabar. The VWAP value of the leg currently in progress moves while the bar is forming, because that is what an anchored average does. Values on closed bars never change. A commit/undo pattern makes sure a forming bar is never counted twice in the statistics.
— 📐 The unfinished leg can be shortened. When a stronger extreme of the same type is confirmed, the current leg is cut at that point and a new leg starts there. Legs that have already been archived are never modified.
— 📊 The statistics are not a backtest. Trades, win rate and the form strip are counted over the history currently loaded on the chart and reset when the chart reloads or a setting changes. They describe how this rule set behaved on the visible data. Past performance does not guarantee future results.
— 🧮 The strength score is a context filter. Its four components and weights are published above precisely so it can be judged on its merits. It measures the internal coherence of the current leg, not the probability of any outcome.
— ⚖️ Half-life weighting is not a VWAP. When that mode is selected the line is an exponentially weighted average, useful on instruments without volume, but it is no longer the textbook volume-weighted average price. The dashboard states the active mode at all times.
— 🌐 Universal compatibility. Works on stocks, futures, forex, crypto and indices, on every timeframe. Where no volume data exists the weighting falls back to time and the dashboard relabels the volume-balance row accordingly.
— 🛠️ Decision support, not automation. This is an anchored VWAP and structure analysis tool with a risk framework attached. It marks anchors, measures distance in the leg's own units, detects retests and lays out stops and targets — trade decisions remain yours. Indikator

3-Way Bollinger Trend [ZynAlgo]1. Overview
3-Way Bollinger Trend combines 3 layers of analysis into a single price band, rather than relying on a plain moving average: a fast center line , a volatility band (classic Bollinger-style, auto widening/narrowing with recent volatility), and momentum-based coloring (Bullish / Bearish / Sideway). On top of this it generates signals with a "pullback to the center line" logic - not a reversal-at-the-band-edge approach - to catch pullback continuations within a trend rather than only tops and bottoms.
2. The Three Components
Center line - reacts quickly to price with clearly less lag than a same-length standard moving average, while staying smooth enough to avoid noise. Band Settings -> HMA Length (default 20).
Volatility band - width reflects recent volatility; one single band tier (no inner/outer). Band Settings -> Band Width (x StDev) (default 2.0).
Momentum-based coloring - the center line and band both change color with the momentum state: Green = BULLISH (strong upward momentum), Red = BEARISH (strong downward momentum), Yellow = SIDEWAY (direction unclear). RSI Settings -> Bullish above / Bearish below. These thresholds do not just change color - they decide which trade direction is allowed (see section 3).
3. Reading the Signal
Pullback logic - the signal is built in two stages. Trigger: price closes back on the trend side of the center line. Confirmation: price holds on that side for a set number of extra bars (Signal Settings -> Confirmation Bars) without crossing back. Only when both complete does the signal fire; a cross-back during confirmation cancels it and a fresh Trigger is required.
Why confirmation - crossing the center line is a frequent event, so firing instantly would expose it to whipsaws. Confirmation is the only filter used; no candle-shape pattern (pin bar, engulfing) is required.
Effective Trend (most misunderstood) - the indicator remembers the most recent official trend whenever momentum reads clearly Bullish or Bearish. In the Sideway zone it does NOT clear that memory - it keeps using the last recorded trend to decide direction. Bullish -> only Buy allowed; Bearish -> only Sell allowed; Sideway -> follows the last effective trend. Sideway does not mean both directions are open.
Entry & Stop - Entry is the open of the bar immediately after the final confirmation bar (never the signal bar). Stop is an ATR distance from entry, computed at the confirmation bar, not from candle wicks. Signal Settings -> SL Distance (x ATR).
4. Take Profit & R-Multiple Management
Three R-based targets (R = the SL distance): TP1 = 1.0R (always on), TP2 = 2.0R (Enable TP2), TP3 = 3.0R (Enable TP3).
Automatic trailing stop: TP1 hit -> SL to breakeven; TP2 hit -> SL up to TP1.
Time-based exit: a trade open too long (default 200 bars) without hitting SL or the final TP closes as a TIMEOUT - neither win nor loss.
Adjustable under Risk & Reward (TP1/TP2/TP3, Enable TP2/TP3, Max Trade Duration).
5. Trade Mode - the Master Switch
OFF (default) - center line and colored band stay visible; signal arrows still fire with a hover explanation; Stability Mode and Smart Signal Filter are bypassed; no SL/TP boxes or Win Rate/PF tracking. Best for observing before live trading.
ON - center line and band hidden; full SL/TP boxes with a real-time trailing SL line; Stability Mode and Smart Signal Filter take effect; dashboard adds Trades / Win Rate / Profit Factor. Best for simulating real trading performance.
6. Execution Filters (active only when Trade Mode is ON)
Stability Mode (default On) - blocks new signals while a trade is already open.
Smart Signal Filter (default Off) - forces Buy/Sell to alternate.
Cooldown (Bars) (default 5) - minimum spacing between two consecutive signals.
7. Dashboard
RSI - current momentum reading.
Momentum Zone - BULLISH / BEARISH / SIDEWAY (color-coded).
Trades (Trade Mode ON) - total trades recorded.
Win Rate / PF (Trade Mode ON) - win rate and Profit Factor. A breakeven exit counts as 0.5 of a win; Profit Factor is unaffected since a breakeven trade adds 0 to both profit and loss.
Dashboard position and text size are adjustable under Display / Dashboard.
8. Alerts
Reversal Buy - fires when a Buy signal is officially confirmed.
Reversal Sell - fires when a Sell signal is officially confirmed.
9. Notes
The Trades / Win Rate / Profit Factor figures come from an internal, non-executed simulation over the visible history on the chart. They are a study of the settings on past data - not a backtest, not a broker report, and not indicative of future results.
No candle-shape requirement - the signal is defined only by the Trigger + Confirmation pairing described above.
All signal logic processes fully closed bars only, never a still-forming bar, so signals do not repaint.
Sideway does not mean fully neutral - always check the last effective trend (section 3) before wondering why a yellow band only shows Sell or Buy.
This indicator is a tool for study and education, not financial advice, and does not guarantee any trading outcome. Always apply your own analysis and risk management.
10. Practical Tips
New to it? Keep Trade Mode off for a while, watch when the arrows appear, and read the hover explanations first.
Market whipsawing around the center line? Raise Confirmation Bars to 3-4 to filter more false signals.
Want fewer, higher-conviction signals? Increase Cooldown (Bars) and consider enabling Smart Signal Filter.
SL too wide or tight for the instrument? Adjust SL Distance (x ATR) - it drives the whole R-multiple TP structure.
Indikator

VWAP AI - Statistical Bands & Touch Stats [Dots3Red]⚓ VWAP AI - STATISTICAL BANDS & TOUCH STATS
VWAP's standard deviation bands are treated more or less as reliable support and resistance — on faith. This script checks that faith against the actual chart in front of you: every band touch is graded, every break beyond a band is graded, and the results accumulate into a running, honest record.
✨ WHY THIS MATTERS
VWAP tells you the volume-weighted average price — where the "center of gravity" of trading has actually been. The bands around it are meant to show how far price typically wanders from that center before snapping back. But "typically" varies enormously by instrument, session, and market condition, and no plain VWAP tool tells you what's actually been happening on your chart.
This script tracks it directly:
📊 +1σ | 62% rejected (n=41)
That means 41 touches of the +1σ band have been recorded on this chart, and 62% of them resulted in price genuinely rejecting back toward VWAP. Measured history, not an assumption baked into the tool.
⚙️ HOW IT WORKS
⚓ Anchoring — VWAP resets at the start of each new period. Session is the classic intraday default; Week and Month extend the same logic to longer views. Custom Bar anchors once, permanently, to a specific historical point you choose — useful for anchoring to an earnings date, a gap, or any event you want to measure from, rather than the calendar.
📏 Two-tier statistical bands — Band 1 and Band 2 are both standard-deviation multiples of VWAP, computed from a proper running variance (not an ATR approximation). Defaults are ±1σ and ±2σ, both fully adjustable.
🎯 Touch grading — when price wicks into a band without closing beyond it, that's logged as a touch. Within a configurable window, it resolves as:
• Rejection — price moved back toward VWAP by a meaningful distance
• Break — price closed convincingly through the band
• Timeout — neither happened clearly enough to call
🔄 Break-to-reversion tracking — separately, when price actually closes beyond Band 1, the script watches whether that move reverts back toward VWAP or continues away from it. This answers a different question than touch grading: not "did the band hold," but "once it didn't, did price come back anyway?"
🔒 Non-repainting — all grading happens strictly on confirmed bars.
🧭 HOW TO USE
1️⃣ Check the band stats before treating a level as reliable. "+1σ: 71% rejected (n=38)" and "+1σ: 44% rejected (n=12)" look like the same line on the chart but mean very different things about how much to lean on it.
2️⃣ Use break-reversion stats to judge a breakout beyond VWAP's range. If breaks above Band 1 have reverted back 65% of the time on this chart, that's useful context before assuming a fresh breakout will keep running.
3️⃣ Read Price vs VWAP as the simplest possible bias check. Above VWAP means the average buyer today is in profit; below means the average buyer is underwater. It's a blunt but genuinely useful read on crowd positioning.
4️⃣ Let sample sizes build before trusting the percentages. Every stat shows its N= specifically so you can judge reliability yourself — a handful of touches is not yet a pattern.
5️⃣ Match the anchor mode to what you're actually measuring. Session for pure intraday structure, Week or Month for a longer view, Custom Bar when you want to measure from one specific moment forward.
⏱️ WHICH TIMEFRAMES WORK BEST
Session-anchored VWAP is fundamentally an intraday tool — it was built for, and is most meaningful on, timeframes where a full session contains enough bars to form a real distribution: 1-minute through 1-hour is the classic and most effective range, which is exactly where VWAP sees the heaviest institutional and day-trading use.
On daily or weekly charts, a Session anchor resets so frequently relative to the bar size that it stops being meaningful — you'd see very few bars per session. For higher-timeframe or swing-style use, switch the anchor to Week, Month, or Custom Bar instead, so the accumulation window actually spans enough bars to produce a meaningful VWAP and band structure.
The touch and break statistics also need enough occurrences to mean anything — a fast-moving intraday chart will accumulate a useful sample size in days; a slow higher-timeframe anchor will take considerably longer.
🛠️ SETTINGS
⚓ Anchoring — Session / Week / Month / Custom Bar, source price
📏 Bands — Band 1 and Band 2 standard-deviation multipliers, Band 2 visibility toggle
🎯 Touch Statistics — Touch Tolerance, Rejection Distance, Reversion Distance, Outcome Window
🎨 Visualization — independent Band 1 / Band 2 touch marker toggles, Dot or Triangle marker style, marker size, VWAP and band line widths, independent fill transparency per band tier
🎨 Colors — VWAP line, Band 1 lines, Band 2 lines, upper/lower touch markers, Price Above/Below VWAP indicator, and full dashboard color control (background, border, header, row styling)
🖥️ Dashboard — show/hide, position — current VWAP value, price position, all four band stats, and both break-reversion stats in one place
📝 NOTES
Statistics accumulate from when the indicator is added to the chart and reset only when explicitly cleared by reloading. A Custom Bar anchor never resets on its own, it measures continuously from the point you chose. Band 2 statistics take meaningfully longer to build a useful sample than Band 1, simply because price reaches ±2σ far less often than ±1σ.
⚠️ DISCLAIMER
This is an analytical and visualization tool. It does not generate trade signals and does not constitute financial advice. Historical rejection and reversion rates do not guarantee future performance. Indikator

Dynamic Grid Indicator [BigBeluga]🔵 OVERVIEW
The Dynamic Grid Indicator is an advanced technical indicator created by BigBeluga to map volatility-based grid channels across price charts while simultaneously plotting a synchronized multi-level oscillator pane. Traditional envelope indicators often use static standard deviation bands that fail to adjust to shifting trend momentum or localized price congestion. In order to provide a solution to this problem, this indicator combines a Hull Moving Average (HMA) central baseline with Average True Range (ATR) multiplier steps, automatically fading channel lines and generating precise crossover signals when price interacts with structural grid borders.
The indicator aims to visualize volatility expansion, compression, and overextended momentum zones. The core element of its calculation involves measuring price distance from the central baseline scaled by volatility steps defined as:
centerLine = ta.hma(close, hmaLength)
oscValue = atrVal != 0 ? (close - centerLine) / atrVal : 0.0
where centerLine acts as the adaptive trend anchor, and oscValue normalizes deviations into standardized grid units. Higher values of numLevels and ATR multipliers allow the indicator to filter out localized market noise and isolate major overbought or oversold structural extremes.
🔵 FEATURES
The system utilizes a multi-layered matrix structure to provide actionable market intelligence:
1 — Dynamic HMA & ATR Grid Engine
Central Baseline Momentum: Tracks trend direction and baseline elasticity using customizable Hull Moving Average lengths via ta.hma(close, hmaLength)
Volatility Multiplier Steps: Projects up to 5 multi-tiered grid levels above and below the baseline scaled dynamically by ATR volatility.
2 — Proximity Fade & Edge Label Management
Smart Proximity Hiding: Automatically hides chart grid line segments when price approaches a level within a set percentage threshold using diff <= proxDist .
Right-Edge Price Tags: Automatically renders live numerical price tags and oscillator labels on the right edge of the chart using custom label management functions.
3 — Synchronized Oscillator Pane & Position Dashboard
Multi-Level Oscillator Fill: Projects a synchronized sub-pane oscillator complete with gradient fills and crossover signal annotations.
Position Scale Dashboard: Features an interactive table displaying real-time level states and oscillator positioning across the grid.
🔵 HOW TO USE
Apart from the basic visualization of volatility channels, this tool can also act in alternative ways to support decision-making:
Identify Channel Extremes: Monitor the outer grid levels (+3 to +5 / -3 to -5) to spot overextended market conditions where price is likely to revert or consolidate.
Trade Grid Crossovers: Look for confirmed crossover signals and direction labels (▲/▼) when price breaks across key grid boundaries to catch trend continuations.
Track Momentum via Oscillator: Observe the sub-pane oscillator line and gradient fill to gauge the strength of the current move relative to the volatility baseline.
🔵 NOTES
Why this implementation is unique:
It combines an overlay price grid with a synchronized, volatility-normalized oscillator pane in a single unified script.
The proximity fade engine keeps the chart clean by automatically removing line clutter directly under active price action.
The script is fully optimized for Pine Script version 6, utilizing advanced conditional plotting, multi-timeframe safety filters, and dynamic dashboard tables.
Indikator

Modern VWAP with BandsModern VWAP with Bands is an anchored Volume Weighted Average Price overlay designed to show how far price has moved from its current volume-weighted reference and highlight unusually extended conditions that may be relevant to mean-reversion analysis.
The indicator combines an anchored VWAP, five configurable deviation bands, distance-based candle coloring, outer-band reversion signals, configurable Target and Stop reference levels, and separate historical Bull and Bear signal-outcome tables.
WHAT THE INDICATOR CALCULATES
The Trading Style setting determines the VWAP anchor period and price source.
Intraday = Daily VWAP using HLC3.
Swing/Daily = Weekly VWAP using HL2.
Long-term = Monthly VWAP using Close.
The VWAP resets automatically when the selected Daily, Weekly or Monthly anchor changes.
Five upper and five lower deviation bands are calculated around VWAP.
When ATR Bands is enabled, each deviation level represents an ATR multiple.
When ATR Bands is disabled, each deviation level represents a percentage offset from VWAP.
This allows the band structure to adapt either to current volatility or to fixed percentage distance from the VWAP reference.
WHY THE COMPONENTS ARE COMBINED
VWAP provides the central volume-weighted reference.
The deviation bands measure progressively larger extensions away from that reference.
The candle-coloring system provides a visual representation of how extended price currently is.
The outer Dev 5 signal logic identifies occasions when price moves through the most extreme configured band.
The Bull and Bear tables then provide historical context showing how those signals resolved using the selected Target and Stop assumptions.
Together, these components provide a workflow for identifying the current VWAP reference, measuring extension, highlighting extreme movement, identifying outer-band events and reviewing their historical outcomes.
BAR COLOR DISTANCE
Bar Color Distance Mode controls how distance from VWAP is normalized.
ATR mode measures absolute distance from VWAP relative to ATR.
% VWAP mode calculates the absolute percentage distance from the VWAP itself:
Absolute distance from VWAP / VWAP × 100
For example, if VWAP is 100 and the selected price source is 102, the % VWAP distance is 2%.
Auto mode uses ATR normalization when ATR Bands is enabled and % VWAP normalization when percentage bands are being used.
This keeps the candle-color distance measurement aligned with the selected band methodology.
REVERSION SIGNALS
A Bull reversion signal occurs when the closing price crosses below the lower Dev 5 band.
A Bear reversion signal occurs when the closing price crosses above the upper Dev 5 band.
These signals identify extreme extensions from VWAP. They do not confirm that a reversal has already started and should not be interpreted as predictions that price must return to VWAP.
Require Outside Dev 5 can apply an additional extension requirement beyond the Dev 5 band before a signal is accepted.
Dev 5 Outside % controls how far beyond Dev 5 price must extend when this filter is enabled.
The optional Cool Off Period prevents another accepted signal for a selected number of bars after the previous signal.
Show Reversion Signals controls only the visibility of the Bull and Bear markers. The underlying signal calculations and historical outcome tracking continue to operate when the markers are hidden.
ENTRY, TARGET AND STOP
The reference entry for both Bull and Bear signals is the closing price of the signal candle.
Bull Stop is positioned below the Bull reference entry according to Bull Stop %.
Bear Stop is positioned above the Bear reference entry according to Bear Stop %.
Target Source can be set to User % or VWAP.
With User % selected, Bull Target % and Bear Target % determine the Target distance from the signal-bar close.
With VWAP selected, the Target is the VWAP value that existed when the signal occurred.
The VWAP Target is fixed at that signal-bar value. It does not continue moving as the VWAP changes on later candles.
The Target and Stop lines displayed on the chart use the same corresponding values used by the historical outcome tables.
HISTORICAL SIGNAL-OUTCOME TABLES
The Bull and Bear tables provide simplified historical signal-outcome statistics.
T = Target reached.
S = Stop reached.
The displayed percentage is the number of Target outcomes divided by the total number of resolved Target and Stop outcomes for that direction.
The percentage is an internal historical measurement produced by the indicator's predefined evaluation rules. It is not a probability, expected win rate, accuracy prediction or guarantee of future performance.
The reference entry is the close of the signal candle.
Target and Stop evaluation begins on the following candle. Price movement that occurred earlier within the signal candle is therefore not used to determine an outcome after an entry at that candle's close.
If both the Target and Stop are touched during the same later candle, OHLC data cannot determine which level occurred first. The script therefore records the event conservatively as a Stop outcome.
Only one unresolved Bull simulation and one unresolved Bear simulation can be active at the same time.
If another signal in the same direction occurs while that direction already has an unresolved event, it is not added as another independently scored table event.
When Ignore Open Trades on Reset is enabled, unresolved events are discarded when the selected VWAP anchor resets. They are not counted as either a Target or Stop outcome.
These tables are analytical summaries and are not TradingView Strategy Tester backtests.
HOW TO USE
Start by selecting the Trading Style that matches the VWAP reference you want to analyse.
Use Intraday for a Daily VWAP, Swing/Daily for a Weekly VWAP, or Long-term for a Monthly VWAP.
Choose whether the deviation structure should react to current volatility using ATR Bands or represent fixed percentage distances from VWAP.
The inner deviation bands show smaller extensions from VWAP while the outer bands represent progressively larger extensions.
Use the candle colors as a quick visual indication of the current distance from VWAP.
Bull signals identify closes crossing below the lower Dev 5 band.
Bear signals identify closes crossing above the upper Dev 5 band.
These are extreme-extension conditions rather than automatic trade instructions. They can be combined with the trader's own price structure, trend, momentum, support/resistance or other confirmation methods.
Require Outside Dev 5 can be enabled when a greater extension beyond the outer band is desired.
The Cool Off Period can reduce repeated signals when price repeatedly moves around the outer band.
The Bull and Bear tables can then be used to examine how historical signals resolved under the currently selected Target and Stop assumptions.
IMPORTANT SETTINGS
Trading Style controls the VWAP anchor and source.
ATR Bands selects ATR-based or percentage-based deviation bands.
ATR Length controls the volatility calculation used by ATR bands and ATR-normalized visual calculations.
Level 1 Dev through Level 5 Dev control the five distances around VWAP.
Bar Color Distance Mode selects ATR or % VWAP normalization for candle coloring.
Bar Color Contrast Power controls how quickly color intensity increases as price moves farther from VWAP.
Bar Color Outside Boost increases visual emphasis after the most extreme configured distance is exceeded.
Require Outside Dev 5 adds an additional extension filter to signal generation.
Cool Off Period controls the minimum spacing between accepted signals when enabled.
Target Source selects percentage-based Targets or the fixed VWAP value at the signal.
Bull Target %, Bull Stop %, Bear Target % and Bear Stop % define the assumptions used for the corresponding historical signal-outcome calculations.
SIGNAL TIMING AND REPAINTING
The script does not use future-data lookahead, higher-timeframe request.security calculations, pivot calculations or historical pivot backplotting.
Signals are calculated using the current chart candle.
Because the closing price of a live candle changes while that candle is forming, a Bull or Bear signal can appear and disappear before the candle closes.
Once the candle has closed, that historical signal condition is fixed.
The script does not place a confirmed signal retrospectively onto an earlier pivot candle.
LIMITATIONS
VWAP depends on the volume data supplied for the selected chart symbol. Volume can differ between exchanges, brokers and data feeds, so VWAP and its resulting bands may also differ.
The indicator uses chart OHLCV data. It does not use order-book data, bid/ask trade classification or individual transaction-level order flow.
ATR is a historical volatility calculation and responds to changing market conditions rather than predicting them.
Extreme distance from VWAP does not guarantee mean reversion. Price can continue moving farther away from VWAP after a Bull or Bear signal.
Live-candle conditions can change before the candle closes.
The Bull and Bear historical statistics do not model commissions, spread, slippage, execution delay, liquidity, partial fills, leverage, position sizing or true intrabar sequencing.
When both Target and Stop occur inside the same candle range, the actual sequence cannot be determined from OHLC data and the event is therefore classified as a Stop.
Unresolved simulations can be removed at VWAP anchor resets when Ignore Open Trades on Reset is enabled.
The pre-reset and post-reset fading effects are visual features based on the expected length of the selected anchor period. Markets with restricted sessions or gaps may contain a different number of actual chart bars.
Historical results do not imply future performance.
ORIGINAL FUNCTIONALITY
Modern VWAP with Bands is designed as more than a standard VWAP plot.
Its implementation integrates selectable Daily, Weekly and Monthly VWAP anchoring, five ATR-or-percentage deviation zones, VWAP-relative or ATR-normalized candle coloring, configurable extreme-band signal filtering, fixed VWAP-or-percentage Targets, configurable Stops, anchor-reset handling and separate Bull and Bear historical outcome tracking.
The purpose of combining these elements is to connect VWAP location, distance measurement, visual extension analysis, signal generation and historical signal evaluation within one consistent overlay.
Indikator

Jamallo Channels🔹Intro
For decades, technical traders have relied on conventional channel models, each burdened by fundamental mathematical limitations:
- Bollinger Bands rely on simple moving averages (SMA) and raw price standard deviation. When strong directional trends emerge, raw variance conflates trend slope with volatility, causing the bands to artificially flare open ("volatility bulge") and produce severe lag and frequent false mean-reversion signals.
- Keltner Channels utilize exponential moving averages (EMA) wrapped with Average True Range (ATR). While smoother, the EMA introduces continuous phase delay, and the bands drift constantly with price, failing to provide stable, horizontal support and resistance benchmarks during consolidation.
- Donchian Channels plot rolling highest highs and lowest lows over an N-bar window. However, they are exceptionally vulnerable to single-bar outlier wicks and sudden step jumps that distort the true statistical distribution without accounting for underlying volatility dynamics.
Jamallo Channels resolves these structural flaws through a novel mathematical synthesis:
1. It replaces lagging moving averages with a multi-resolution Maximal Overlap Discrete Wavelet Transform (MODWT) Haar filter bank coupled with an energy-calibrated deadband step-hold state machine. The baseline remains strictly stationary during consolidation and snaps instantaneously to new price levels upon statistically significant drift.
2. It decouples trend from volatility by computing standard deviation strictly on the detrended high-frequency wavelet residual, filtered through a rolling linear-interpolation median to eliminate spike distortion.
3. It locks the volatility corridor at the exact moment a new regime step triggers—producing pristine, step-synchronized horizontal channels and mathematically robust exhaustion zones.
🔹Break down
1. Multi-Resolution Haar Wavelet MODWT Engine:
- Undecimated Dyadic Decomposition: Deconstructs raw price action across up to 5 dyadic scale levels (Level 1 = 2-bar, Level 2 = 4-bar, Level 3 = 8-bar, Level 4 = 16-bar, Level 5 = 32-bar) into orthogonal approximation (trend) and detail (high-frequency noise) coefficients without phase distortion or downsampling loss.
- Scale-Adaptive Smoothing: Isolates the true low-frequency structural trend from intraday churn and microstructure noise at the selected dyadic decomposition level.
- Dynamic Detail Energy Tracking: Measures the real-time volatility intensity of the high-frequency detail spectrum by computing a rolling Simple Moving Average of absolute detail coefficients over a calibrated lookback window.
2. Energy-Calibrated Deadband Step-Hold Mechanism:
- Statistical Innovation Filtering: Establishes an adaptive deadband threshold scaled directly by the product of the detail energy and a deadband multiplier.
- Zero-Drift Piecewise Step-Holding: The smooth wavelet baseline is held strictly horizontal until price innovation definitively breaches the dynamic detail deadband threshold. Once breached, the baseline snaps instantaneously to the new equilibrium price level, eliminating baseline drifting during consolidation phases.
- Clean Regime Direction State: Evaluates the direction of every confirmed step, immediately classifying the market into Bullish (Teal) or Bearish (Maroon) regime states.
3. Detrended Residual Volatility & Frozen Sigma Bands:
- Trend-Decoupled Dispersion Measurement: Unlike standard deviation calculated around lagging moving averages—which artificially inflates during strong trends—Jamallo Channels isolates the high-frequency wavelet residual (Price minus Wavelet Mid) before computing variance, capturing genuine localized volatility.
- Median Filter Outlier Rejection: Applies a rolling linear-interpolation median filter (50th percentile over a 100-bar window) to the raw residual standard deviation, immunizing the channel against one-off spike anomalies and erratic expansion.
- Step-Locked Volatility Corridors: Volatility is sampled and frozen precisely at the moment a new Haar baseline step triggers. The frozen sigma remains constant throughout the entire regime life cycle, producing stable, non-wiggling horizontal channels.
4. Multi-Tier Volatility Corridors & Exhaustion Envelopes:
- Inner Expansion Zone (1.0σ): Defines the immediate high-probability operational boundary around the stepped trend baseline.
- Mid Dispersion Boundary (2.0σ): Represents standard 2-sigma statistical bounds where normal trending impulse legs oscillate.
- Outer Exhaustion & Mean-Reversion Zone (3.0σ): The extreme channel boundary (2.0σ to 3.0σ highlighted by shaded backgrounds) marks statistical overextension where price is prime for momentum exhaustion and mean-reverting retests back to the Haar stepped baseline.
🔹How to use: Trend Following & Risk Management
Jamallo Channels provides clear, objective mathematical parameters for both momentum trend riders and mean-reversion scalpers across all timeframes.
Regime Trend Trading:
- Setup & Execution: Enter in the direction of a newly confirmed Haar baseline step (when the baseline shifts color to Teal for Longs or Maroon for Shorts) or upon a sustained price breakout above/below the baseline following volatility compression.
- Stop Loss Placement: Anchor stop loss orders directly behind the most recent stepped Haar baseline level or just outside the opposite inner/mid channel boundary.
- Trailing & Letting Winners Run: Trail stop loss orders systematically step-by-step as new horizontal baseline rungs are confirmed, protecting capital while letting winners ride the macro expansion.
Mean-Reversion & Exhaustion Scalping:
- Exhaustion Rejection: When price enters the extreme 2.0σ–3.0σ outer band corridor (upper red fill or lower teal fill) and forms rejection wicks or structural exhaustion patterns, execute counter-trend mean-reversion setups.
- Take-Profit Targets: Target the inner channel (1.0σ) for partial profits and the primary Haar stepped baseline (0σ mean) for final profit harvesting.
- Invalidation / Stop Loss: Place tight stop losses just beyond the outer 3.0σ boundary line.
🔹Settings Parameters
Haar Wavelet Basis:
- Basis Level (1 - 5): Selects the dyadic wavelet decomposition scale (1 = 2-bar, 2 = 4-bar, 3 = 8-bar, 4 = 16-bar, 5 = 32-bar). Higher levels smooth out larger macro trends, while lower levels capture high-frequency swings.
- Deadband Multiplier (0.1 - 10.0): Scaling coefficient applied to the detail energy. Higher values widen the deadband, requiring larger directional thrusts to trigger a new step and producing wider, noise-immune steps.
- Detail Energy Lookback (5 - 200): The rolling lookback window used to calculate the average magnitude of wavelet detail coefficients.
Stdev Bands:
- Stdev Length (min 2): Lookback period for measuring the standard deviation of the detrended wavelet residual.
- Inner Multiplier (0.1 - 10.0): Standard deviation multiplier for the inner channel envelope (default: 1.0σ).
- Mid Multiplier (0.1 - 10.0): Standard deviation multiplier for the middle channel envelope (default: 2.0σ).
- Outer Multiplier (0.1 - 10.0): Standard deviation multiplier for the extreme exhaustion envelope (default: 3.0σ).
Display Settings:
- Basis Up Color: Custom color for the stepped baseline during bullish regime states (default: Teal).
- Basis Down Color: Custom color for the stepped baseline during bearish regime states (default: Maroon).
- Upper Color: Accent color for the upper channel bands and exhaustion fills (default: Red).
- Lower Color: Accent color for the lower channel bands and exhaustion fills (default: Teal).
- Show Fill: Toggles background shading for the inner and outer volatility corridors.
Indikator

Indikator

KERNEL BANDS [vault]KERNEL BANDS
A non-parametric kernel regression centreline wrapped in adaptive residual sigma bands, with a full trade management layer on top: filtered entries, an exit engine that reports results in pips, a reversal radar, a dead-zone shield, session and momentum context, and a multi-timeframe screener. Everything is confirmed on bar close and nothing repaints.
A moving average assumes price came from a fixed-form equation (linear in lag, weighted in lag, and so on). Kernel regression makes no such assumption. It lets the local density of the data decide where the centreline sits, which gives a smoother and more honest picture of where price actually is, without the corner cutting EMAs and HMAs do around pivots. The bands around it are not arbitrary ATR multiples but a statistical measure of how far price normally strays from the kernel before reverting.
1. The kernel
Every moving average is a kernel, just a rectangular one (or, for HMA, a chained weighted one). Kernel regression generalises the idea: you pick the shape of the weight curve based on how much you want each historical bar to matter. Three kernels ship:
- Gaussian: the textbook bell curve, K(u) = exp(-u² / 2h²). Heavy tails, smooth everywhere. The most stable default.
- Epanechnikov: compact-support parabola, K(u) = max(0, 1 - u²/h²). Mathematically optimal in the mean-squared-error sense, lightest tails, slightly more responsive at the leading edge.
- Tricube: LOWESS-style, K(u) = max(0, (1 - |u/h|³)³). Very smooth shoulders, great on noisy intraday data where you want a confident centreline rather than a chasing one.
All three feed the same Nadaraya-Watson estimator, ŷ = Σ K(i) · close / Σ K(i), computed one-sided over the lookback window so it never looks into the future. The kernel choice sets the personality of the line, the bandwidth h sets its memory.
2. Adaptive bandwidth (ATR-scaled)
A static bandwidth breaks in changing regimes. When realised volatility expands a fixed h lags badly, when it contracts the same h starts amplifying noise. Here h is scaled live by normalised ATR:
h_eff = h_base × (1 + ATR / close × factor)
so the kernel widens when the market is loud and tightens when it is quiet, and the line behaves the same across gold, indices, crypto and FX without per-symbol tuning.
A Bandwidth Regime Shift alert fires when h moves by more than a user-set fraction in a single bar. It is your early warning that the volatility surface just changed: it typically fires before either directional signal and tells you whatever play you had on a minute ago may need to be re-evaluated. The dashboard shows the % jump that triggered it.
3. Residual sigma bands
The bands are the rolling standard deviation of the residual (close - kernel MA), EMA-smoothed, then scaled by the sigma multiplier. This answers a real question: how much do we usually deviate from the kernel before reverting? When the answer is small, the bands hug the line and a breakout is statistically meaningful. When it is large, band breaks are normal and should be downweighted.
Band Floor is an addition to the original concept. The half-width can never be thinner than a chosen fraction of ATR (0.6 by default). Without it, volatility compressions produced razor-thin bands and hair-trigger state flips on every wick. With it, a quiet market still needs a real move to change state.
4. State engine
A confirmed close above the upper band latches the state to Bullish, a confirmed close below the lower band latches it to Bearish. State only flips on the opposite band, there is no neutral repainting in between. Confirmation Closes sets how many consecutive closes beyond the band are required (default 2), which is the single biggest difference between a clean chart and a noisy one.
The band colour, the fill, the dashboard Signal row and the MTF screener all read from this one state.
5. Signal engine (what changed versus a plain band cross)
A state flip is not an entry any more. A flip arms the signal, and the entry prints only once every condition lines up within the entry wait window (default 6 bars). If the state reverts before that happens, the armed signal is dropped silently and nothing is printed. The dashboard shows the armed side in gold so you always know a setup is pending.
Conditions an entry must pass:
- Kernel slope must agree: buy only while the kernel is rising, sell only while it is falling. This kills counter-trend spikes, the classic "one violent wick through the lower band in an uptrend" trap.
- Entry candle must agree: a buy needs a green close, a sell needs a red close.
- Max extension beyond band: if the flip candle closed too far past the band (default 1.5× the band half-width) the engine waits for a calmer candle instead of chasing the blow-off.
- Skip blow-off candles: no entry on a bar (or the bar before it) whose range exceeds a multiple of ATR.
- Min bars between entries: a cooldown so two entries cannot stack on top of each other.
- Dead-zone shield: no entries while the market is flagged as chop (section 7).
- Session filter (optional, off by default): restrict entries to London / New York windows if you want it.
Re-entries: after an exit, if the state is unchanged and price crosses back through the kernel MA in the direction of momentum, a fresh entry arms. Trends are ridden in segments, each one banked.
Entry labels carry the side and the exact close price so you can enter at the same level.
6. Exit engine
Every entry is closed by the indicator with an Exit label in the colour of the side it closes (cyan closes a long, magenta closes a short). The label shows the exit price and the result in pips. Pip size is auto-detected (mintick × 10, so 0.1 on gold) and can be overridden.
An exit fires on whichever comes first:
- Flip: the state confirms the opposite way.
- Reversal: a reversal candle prints at a band extension while the trade is in profit.
- Giveback: after the trade has reached a minimum peak, it has given back a set percentage of that peak (default 50%).
- Structure: close breaks the lowest low (long) or highest high (short) of the last N bars while in profit.
The dashboard shows live Position, Open P&L and peak P&L, and the exit alert reports entry, exit, result, peak, trigger and bars held. Your journal writes itself.
7. Dead-zone shield
Flat, low-volume chop is where band systems buy the top and sell the bottom of the range. The shield scores four conditions every bar: flat kernel slope, clustered state flips (weighted double, because a burst of flips is the strongest chop tell there is), tight range and weak volume. Above the trigger score the chart is tinted, entries are suppressed and the dashboard reads DEAD ZONE with the bar count. The first genuine breakout escaping the zone still arms an entry.
Two alerts, deliberately not session-filtered: Dead Zone Entered (with the score and which conditions tripped it) and Dead Zone Cleared (with how long it lasted). The second one is the one to set: it tells you when to be back at the screen.
8. Reversal radar
Reversal candles (doji, pin bar, engulfing) that print at a band extension are marked with a ⚠ Rev label: red at the upper band, cyan at the lower. The dashboard tracks the most recent one as TOP FORMING / BOTTOM FORMING with its age. Kernel momentum is read live as Rising, Rising & Fading, Falling or Falling & Fading, with directional alerts when it turns. Together they are your early tell that a move is exhausting, and the Reversal exit uses the same signal.
9. Divergence engine
A pure slope-comparison divergence runs in parallel: the kernel slope over a window against the price slope over the same window. Bullish divergence is registered when price is falling while the kernel turns up, bearish is the mirror. Both slopes have separate minimum thresholds (as a fraction of ATR × window) so flat regions never trigger noise divergences, and a cooldown spaces them out. Labels print ▲ Div / ▼ Div at the wick they fire from, and the dashboard shows the active divergence with its bar age.
10. MTF screener
A compact board that shows the kernel state on 5m / 15m / 1h / 4h. The top row is pinned to whatever symbol your chart is on and follows you when you switch, so your active trade is always on the board. Up to five more symbols can be added in settings. Each cell is an arrow in the state colour, brighter when the flip is fresh (within a user-set number of bars) so you can tell at a glance whether a setup is new or already ran. The Σ column counts aligned timeframes and prints A+▲ or A+▼ when all four agree.
The screener requests nothing on your behalf: only symbols you type in are ever requested, so alerts save on every data plan.
11. Three visual modes
The same kernel and sigma feed every mode:
- Bands: classic upper / lower envelope with toggleable fill. Best for mean-reversion and band-touch analysis.
- Single Line: kernel centreline with a gradient fill between the line and price. Best for pure trend-following.
- Trail: only the trailing band is drawn, in the active state colour, with an optional sin-modulated pulse alpha that gives a subtle breathing effect. Best for visual conviction in directional moves.
State candles and bar colouring are independent toggles, and the kernel line can be drawn on top of Bands or Trail if you want it visible everywhere. A full Colors group covers bull, bear, neutral, text, accent and dashboard background / frame.
12. Dashboard
A monospaced table, positionable to any of nine anchors, with a subtle vertical gradient. Rows: Signal, Kernel MA, Upper Band, Lower Band, Band Width σ, Bandwidth h (with adaptive tag), Kernel, Divergence, Regime, Session, Position (including armed setups), Open P&L with peak, Market (Trending / Dead Zone), Momentum and Reversal.
13. Alerts
Seventeen named alert conditions, every one evaluated on bar close: BUY, SELL, EXIT LONG, EXIT SHORT, Bullish Breakout, Bearish Breakdown, Bullish Divergence, Bearish Divergence, Bandwidth Regime Shift, Reversal at Top, Reversal at Bottom, Dead Zone Entered, Dead Zone Cleared, Momentum Shift Bullish, Momentum Shift Bearish, Momentum Shift (any), Kernel State Flip.
On top of that the script sends dynamic messages through alert(): entries carry entry price, TP / SL geometry, live momentum and session, exits carry entry, exit, result in pips, peak, trigger and bars held, dead-zone events carry the score and the reason. Attach a webhook to "Any alert() function call" and a bot reading the payload has the same confluence a human reads on the dashboard.
Each named condition has to be selected individually in the alert dialog. "Any alert() function call" delivers the dynamic messages, not the named conditions. That is a TradingView rule, not a setting in this indicator.
How to use it
Trend-following: Single Line or Trail mode, Tricube kernel, adaptive bandwidth on, Confirmation Closes 2, kernel slope confirmation on. Take entries in the direction of the higher-timeframe rows on the screener and let the exit engine manage the trade.
Mean-reversion: Bands mode, Gaussian or Epanechnikov, fade band touches that coincide with a ⚠ Rev label, a divergence label and a low Band Width σ reading. Use the Regime Shift alert as a heads-up that a reversion play just got riskier.
Scalping 1m-5m: keep Band Floor at 0.6 or above and Confirmation Closes at 2, otherwise the band flips on every wick. If you get too few entries, loosen Entry Candle Must Agree first, then Max Extension to 2.0.
Suggested settings
Defaults are tuned for 5m-1H on liquid futures, gold and crypto: Lookback 30, Base Bandwidth 8, Sigma Multiplier 1.0, Band Floor 0.6, Confirmation Closes 2. For 1m-3m drop Lookback to ~20 and Bandwidth to ~6. For daily and above raise Lookback to 50 and Bandwidth to 12. The kernel and bandwidth jointly control how much the line trusts the recent past, the sigma multiplier and band floor separately control how much movement you are willing to call normal.
Limitations
The kernel is recomputed each bar over the lookback window, so very long lookbacks on very low timeframes can feel heavy. State transitions, entries, exits and reversal labels are all confirmed on bar close, so a band touch that gets reabsorbed within the bar will not fire. This is deliberate and is what prevents intra-bar repainting. The MTF screener reads higher-timeframe values that in real time come from the still-open bar, so a cell can flicker until that bar closes. Divergence is non-repainting but carries the natural lag of comparing slopes over a window.
What was improved over the original concept and why
- Band floor: the original residual sigma alone produced paper-thin bands in compressions and a flip on every wick. A floor tied to ATR fixed that without touching the statistical meaning of the band in normal conditions.
- Confirmation closes: one close beyond the band is a wick, two is a decision.
- Arm-then-fire entries: entries were firing on the flip bar no matter what that bar looked like. Now the flip arms the setup and the entry waits (up to a few bars) for kernel slope, candle colour and extension to agree, and is dropped if the state reverts.
- Kernel slope agreement: the single biggest source of bad trades was a sell printed during a spike down while the kernel was still rising. Requiring slope agreement removes the whole class.
- Blow-off check on two bars: a spike often spans the flip bar and the one before it.
- Dead-zone weighting: a cluster of flips is the strongest chop signal there is, so it counts double and the shield activates on a burst of flips alone instead of needing a second condition.
- Session filter off by default: gold and indices produce clean moves outside London / NY too, and the filter was skipping them. It is still there if you want it.
- Kernel MA plotted in every mode and alertable via the standard Crossing / Greater Than rules, plus a toggle to draw it on top of Bands or Trail.
- Screener requests only what you type in, so alerts save on any data plan.
Indikator

Keltner Rings [Quantum Algo]Keltner Rings
═══════════════════════════════════════════════
🔶 OVERVIEW
Keltner Rings is a complete reading system built on Keltner Channels — volatility bands placed around an exponential moving average, with width set by the Average True Range. Three nested rings form a gradient volatility field around price, a regime classifier determines what kind of market you are actually in, and the dashboard translates it into plain instructions: when riding the upper band is strength, and when the very same touch is fade material.
That distinction is the heart of this tool. The most common way traders lose money with any channel indicator is applying range logic in a trend — shorting an upper-band touch while price is band-walking higher. Keltner Rings classifies the regime first, interprets every touch accordingly, generates three distinct signal families, and scores each family's historical performance on your exact symbol and timeframe.
═══════════════════════════════════════════════
🔶 WHAT ARE KELTNER CHANNELS?
Keltner Channels are volatility-based bands around a moving average. The concept originates with Chester W. Keltner (1960); the modern formulation — an exponential moving average with bands offset by multiples of the Average True Range — was popularized by Linda Bradford Raschke. Because the Average True Range expands and contracts with real movement, the channel breathes with the market: wide in storms, tight in calm.
This tool extends the classic single channel into three rings — inner, middle and outer — creating a graded map of how far price has traveled from its average in volatility-adjusted terms.
═══════════════════════════════════════════════
🔶 WHAT IS A BAND WALK?
In a genuine trend, price does not oscillate politely around its average — it presses against the channel and rides it, closing beyond the inner ring bar after bar. This is the band walk, and it is the single most misread behavior in channel trading: it looks overbought, and it is actually strength. Keltner Rings detects the walk explicitly (a configurable count of consecutive closes beyond the inner ring), paints the walking bars in full trend color, and marks the walk's beginning as a continuation signal rather than a fade.
═══════════════════════════════════════════════
🔶 WHY IS THIS ORIGINAL?
1. Regime-aware interpretation. The classifier combines average slope, band-walk state, squeeze condition and the channel's own width percentile into four regimes — Trend Up, Trend Down, Range, Squeeze — and the dashboard's "How To Read It" row states, live, how touches should be interpreted right now. The tool teaches its own correct usage.
2. Three signal families, separated on purpose. W marks the start of a band walk with the trend (continuation). R marks a middle-ring rejection in a range regime only (reversion, exactly where reversion belongs). S marks a squeeze release through the inner ring (expansion). One tool, three behaviors, never confused with each other.
3. Per-family statistics on your chart. Every family's ten-bar outcomes are tracked in first-in-first-out samples, shrunk toward neutral at small sizes, with Wilson lower bounds. Each signal's tooltip quotes its own family record on the current symbol at the moment it prints — and the dashboard shows all three records side by side.
4. The width cone. Channel width is ranked as a percentile inside its own recent history, so "tight" and "wide" are defined by this symbol's behavior, never by fixed numbers.
5. The squeeze, credited and integrated. Bollinger Bands closing inside the Keltner ring — the compression concept popularized by John F. Carter — is detected with duration tracking, gold coil markers on the average, and directional release signals.
═══════════════════════════════════════════════
🔶 HOW IT WORKS
— The exponential average and Average True Range build three rings at configurable widths; five gradient fills render the volatility field between them.
— Average slope, walk counters, squeeze state and width percentile feed the regime classifier every bar.
— Signals: W fires when the walk count is reached with the trend; R fires on middle-ring rejections in range regimes; S fires when a mature squeeze releases through the inner ring.
— Each family's outcomes feed its own statistics; the dashboard and tooltips report them with sample counts.
All signals are evaluated on confirmed bars and do not repaint. All drawings are capped for performance.
═══════════════════════════════════════════════
🔶 HOW TO USE IT
— Read the regime row first, then the guidance row — they tell you which of the three signal families is currently in its natural habitat.
— In trends: treat inner-ring pullbacks as entries in the trend direction, and let the painted band walk carry the position; the walk ending is your first warning.
— In ranges: middle-ring touches with rejection candles target the average — the R family's record shows how this symbol has respected that logic.
— In squeezes: the coil duration and width percentile tell you how compressed the spring is; the S release gives the direction, and the family record tells you how trustworthy releases have been here.
— Works on all markets and timeframes; every threshold is volatility-adjusted or percentile-based, so nothing needs retuning per symbol.
═══════════════════════════════════════════════
🔶 SETTINGS
— Keltner Channels: exponential average length, Average True Range length, three ring widths.
— Regime & Signals: trend slope threshold, band-walk bar count, width history window, cooldown, squeeze ring width.
— Statistics: sample cap, minimum samples, shrinkage strength, Wilson z-score.
— Visuals and dashboard: full color control, band-walk painting toggle, position and text size.
═══════════════════════════════════════════════
🔶 ALERTS
— Squeeze Started — compression began.
— Squeeze Release Up / Down — compression resolved through the inner ring.
— Band Walk Started — consecutive closes locked beyond the inner ring with the trend.
— Reversion Signal — middle-ring rejection in a range regime.
═══════════════════════════════════════════════
🔶 FAQ
Q: How is this different from standard Keltner Channels?
A: The standard indicator draws one channel and leaves interpretation to you — including the fatal ambiguity of what an upper-band touch means. This tool adds the regime classifier, the three-ring field, the band-walk engine, explicit signal families for continuation, reversion and expansion, and per-family statistics, so every touch arrives with its context and its track record.
Q: Does it repaint?
A: No. All signals are evaluated on confirmed closes; a printed signal never changes.
Q: Keltner Channels or Bollinger Bands?
A: They answer different questions. Bollinger Bands use standard deviation and react sharply to close-to-close variance; Keltner Channels use the Average True Range and breathe more smoothly with the full bar range. This tool uses both — the channel as the structure, and the Bollinger relationship as the squeeze detector.
Q: What do the family percentages mean?
A: The share of past signals in that family after which price had moved favorably ten bars later, on the current symbol and timeframe, shrunk toward fifty percent at small samples. They describe history — they are not predictions.
Q: Which settings matter most?
A: Band Walk Bars (higher = stricter walks, fewer W signals) and the ring widths — the defaults of one, two and three Average True Ranges follow common practice and suit most markets.
═══════════════════════════════════════════════
🔶 CREDITS
The original channel concept is by Chester W. Keltner (1960); the modern exponential-average and Average True Range formulation was popularized by Linda Bradford Raschke. The Average True Range is by J. Welles Wilder Jr. (1978). Bollinger Bands are by John Bollinger, and the band-compression squeeze concept was popularized by John F. Carter. The Wilson score interval is by Edwin B. Wilson (1927). The regime classifier, three-ring field, band-walk engine, signal families, per-symbol statistics and all code in this script are original work — no third-party or open-source script code was reused.
═══════════════════════════════════════════════
🔶 LIMITATIONS
— Regime classification is descriptive, not predictive: regimes are identified as they form, and transitions are only visible once underway.
— Reversion logic is disabled by design outside range regimes; traders who want to fade trends will not find those signals here.
— Statistics describe the current chart's history only; past frequencies never guarantee future outcomes.
═══════════════════════════════════════════════
🔶 DISCLAIMER
This indicator is a research and charting tool provided for educational purposes. It is not financial advice, and nothing it displays is a recommendation to buy or sell any asset. Trading involves substantial risk of loss. Always do your own analysis and manage risk responsibly. Indikator

Sattam | Trend FilterSATTAM | Trend Filter
A trend-following overlay built on a triple-pass exponential smoothing engine
with Fibonacci-adaptive volatility bands and a live command-center panel.
── HOW IT WORKS ──────────────────────────────────────────────
1) NOISE FILTER
Price is passed through three chained EMA stages. Each stage feeds the next,
which removes most of the intrabar noise that makes a single moving average
whipsaw, while keeping the turn of the trend readable.
2) TREND DETECTION
Direction is taken from the 2-bar slope of the filter line (base - base ),
not from a price/MA cross. The line turns green while the slope is positive
and red while it is negative. An orange diamond marks the exact bar where the
slope flips sign (confirmed on close only - no repainting of the signal).
3) FIBONACCI-ADAPTIVE BANDS
Band width is the smoothed high-low range, expanded by three Fibonacci
multipliers (0.236 / 0.382 / 0.618, scaled). The bands breathe with real
volatility, so the same settings work on a quiet range and on a fast trend.
Fills are gradient-colored by trend momentum, from bear color to bull color.
4) MULTI-FILTER (optional)
Adds a slower filter line. Triangles mark fast/slow crosses, and the panel
reports whether both filters agree (Aligned) or conflict (Divergent).
── COMMAND CENTER PANEL ──────────────────────────────────────
• Trend - current direction
• Strength - 0-100% of the strongest slope in the lookback window
(Strong / Moderate / Weak / Flat)
• Band Pos - where price sits inside the outer bands
(Over-Extended / Upper Band / Mid / Lower Band)
• Filters - fast vs slow agreement (multi-filter mode)
• Signal - the active flip on this bar
── HOW TO USE ────────────────────────────────────────────────
• Trade in the direction of the line color; treat flips as the alert to act.
• Prefer entries taken while Strength is Strong or Moderate; Flat readings
usually mean a range, where flips are least reliable.
• "Over-Extended" in Band Pos warns that price is stretched to the outer band
- useful for taking partials or waiting for a pullback instead of chasing.
• Turn on Multi-Filter for higher-timeframe context: take signals only when
the panel shows Aligned.
── SETTINGS ──────────────────────────────────────────────────
All inputs are labelled in English and Arabic.
• Filter Length - lower = faster and more signals, higher = smoother
(25 default; try 50-80 on lower timeframes, 10-20 for scalping)
• Slow Filter Length - the confirmation filter (80 default)
• Colors, fill transparency, bar coloring
• Panel position, size, and language (EN / AR)
── ALERTS ────────────────────────────────────────────────────
• Trend Bullish / Trend Bearish (slope flip)
• Fast Cross Up / Fast Cross Down (multi-filter cross)
All alerts fire once per bar close and include ticker, timeframe and price.
Panel language (EN / AR) also controls the alert message language.
Works on any symbol and any timeframe.
Disclaimer: for education and analysis only. This is not financial advice.
No indicator predicts the future - always use your own risk management.
SATTAM | Trend Filter — فلتر الاتجاه
مؤشر اتجاه يُرسم فوق الشارت، مبني على محرّك تنعيم أُسّي ثلاثي المراحل،
مع نطاقات فيبوناتشي متكيّفة مع التذبذب، ولوحة تحكّم مباشرة.
── كيف يعمل ─────────────────────────────────────────────────
١) فلتر الضجيج
يمرّ السعر عبر ثلاث مراحل EMA متسلسلة، كل مرحلة تُغذّي التي بعدها.
هذا يزيل معظم الضجيج الذي يجعل المتوسط المتحرك العادي يتذبذب،
مع بقاء لحظة انعكاس الاتجاه واضحة وقابلة للقراءة.
٢) تحديد الاتجاه
الاتجاه يُؤخذ من ميل الخط عبر شمعتين (base - base )، وليس من تقاطع
السعر مع متوسط. الخط أخضر عندما يكون الميل موجباً، وأحمر عندما يكون سالباً.
الماسة البرتقالية تحدّد الشمعة التي انقلب فيها الميل — وتُؤكَّد عند إغلاق
الشمعة فقط، بلا إعادة رسم للإشارة.
٣) نطاقات فيبوناتشي المتكيّفة
عرض النطاق = مدى (أعلى − أدنى) بعد تنعيمه، مضروباً في ثلاثة معاملات
فيبوناتشي (٠.٢٣٦ / ٠.٣٨٢ / ٠.٦١٨ بعد التحجيم). النطاقات تتّسع وتضيق مع
التذبذب الحقيقي، فتعمل نفس الإعدادات في السوق الهادئ وفي الترند السريع.
تعبئة النطاقات ملوّنة بتدرّج حسب زخم الاتجاه، من لون الهبوط إلى لون الصعود.
٤) الفلتر المزدوج (اختياري)
يضيف خط فلتر أبطأ. المثلثات تحدّد تقاطع السريع مع البطيء، واللوحة تُظهر
هل الفلتران متوافقان (متوافق) أم متعارضان (متعارض).
── لوحة التحكّم ─────────────────────────────────────────────
• الاتجاه — الاتجاه الحالي (صاعد / هابط)
• القوة — من ٠ إلى ١٠٠٪ مقارنةً بأقوى ميل في فترة القياس
(قوي / متوسط / ضعيف / محايد)
• موضع النطاق — أين يقع السعر داخل النطاقات الخارجية
(تشبّع / النطاق العلوي / الوسط / النطاق السفلي)
• الفلاتر — توافق السريع مع البطيء (في وضع الفلتر المزدوج)
• الإشارة — الانعكاس النشط على الشمعة الحالية
── طريقة الاستخدام ──────────────────────────────────────────
• تداول مع لون الخط، واعتبر لحظة الانعكاس هي إشارة التحرّك.
• فضّل الدخول عندما تكون القوة «قوي» أو «متوسط»؛ قراءة «محايد» غالباً تعني
سوقاً عرضياً تكون فيه الانعكاسات أقل موثوقية.
• ظهور «تشبّع» في موضع النطاق يعني أن السعر امتدّ إلى النطاق الخارجي —
مفيد لجني جزء من الأرباح أو انتظار الارتداد بدل المطاردة.
• فعّل الفلتر المزدوج للحصول على سياق الفريم الأكبر، وخذ الإشارات فقط
عندما تُظهر اللوحة «متوافق».
── الإعدادات ────────────────────────────────────────────────
جميع الإعدادات مكتوبة بالإنجليزية والعربية معاً.
• طول الفلتر — الأقل = أسرع وإشارات أكثر، والأعلى = أنعم
(الافتراضي ٢٥؛ جرّب ٥٠–٨٠ على الفريمات الصغيرة، و١٠–٢٠ للمضاربة السريعة)
• طول الفلتر البطيء — فلتر التأكيد (الافتراضي ٨٠)
• الألوان، وشفافية التعبئة، وتلوين الشموع
• موضع اللوحة وحجمها ولغتها (EN / AR)
── التنبيهات ────────────────────────────────────────────────
• اتجاه صاعد / اتجاه هابط (انعكاس الميل)
• تقاطع صاعد / تقاطع هابط للفلتر السريع (في الفلتر المزدوج)
كل التنبيهات تُطلق مرة واحدة عند إغلاق الشمعة، وتتضمّن الرمز والفريم والسعر.
لغة اللوحة (EN / AR) تتحكّم أيضاً في لغة نص التنبيه.
يعمل على جميع الرموز وجميع الفريمات الزمنية.
إخلاء مسؤولية: هذا المؤشر لأغراض تعليمية وتحليلية فقط، وليس نصيحة مالية.
لا يوجد مؤشر يتنبأ بالمستقبل — التزم دائماً بإدارة رأس المال الخاصة بك. Indikator

Robust Regression Residual Bands [Pineify]Robust Regression Residual Bands
Overview
This overlay fits a rolling line while bounding influence from unusual closes. It shows a robust center, two MAD shells, confirmed extremes, and an optional dashboard. It is context, not a forecast.
Problem Definition
Least-squares channels and standard deviation magnify large errors. One gap, wick, or bad print can rotate the line and widen its bands, changing both the reference and the meaning of “far.” Short windows add noise; long ones preserve distortion. The invariant is that ordinary observations define the path, extremes stay visible, and their influence remains bounded.
Design Rationale
Regression stays because slope and residual distance answer different questions. Finite Huber-style refits replace unrestricted influence: residuals inside a threshold keep full weight; those outside receive progressively less. Hard deletion was rejected because values switch abruptly at a cutoff. Final scale uses median absolute deviation (MAD) times 1.4826. MAD resists isolated extremes but is less efficient for Gaussian errors. Two passes balance refreshed weights with bounded workload; users may select one to three.
Key Features
Rolling regression with bounded influence refits.
Two shells sized from final residual MAD.
Center color for normalized slope.
Confirmed outer-entry diamonds.
Optional bar color and dashboard for residual z, slope/MAD, scale, window, and passes.
How It Works
Each bar loads a chronological rolling window and fits an equal-weight line. It finds every residual, their median, and median absolute distance from that median. MAD times 1.4826 becomes robust scale; minimum tick prevents zero division.
Each distance is compared with clipping threshold times scale. Inside values keep weight 1. Outside values receive threshold divided by distance, smoothly capping influence. The line is refitted for the selected passes; residual median and MAD are then recomputed. Displayed center is the newest fit plus median residual.
Bands equal center plus or minus selected MAD multiples. Residual z divides current distance by scale; slope divided by scale controls color. A full window without missing data is required. Open-bar values can change; markers and alerts require confirmation.
How Multiple Indicators Work Together
These are causal stages, not unrelated indicators. Regression supplies direction but needs clipping to limit leverage. Clipping needs scale, and MAD prevents the same extreme from dominating it. Final residual measures price against the stabilized path; normalized slope separates direction from dispersion. Without refitting, bands inherit a tilted center; without scale, distance is not comparable. All visuals expose one model.
Trading Ideas and Insights
A confirmed outer entry means the close is unusual relative to current path and scale; it does not imply reversal. Alignment with strong slope can describe expansion, while repeated extremes with flattening slope can motivate a balance review. Alternating center crosses expose noise. Compare states with structure, liquidity, events, and risk controls. The script provides no entries, stops, sizing, or expected returns.
Unique Aspects
The contribution couples bounded influence refits with a median-centered MAD field. Common channels let an extreme affect slope and width through squared error. Here distance sets a smooth influence cap, the line is rebuilt, and final residuals size the tunnel. Median residual shifts the newest fit instead of assuming zero arithmetic mean. Center is primary, shells encode distance, and amber diamonds encode confirmed entries—not probability.
How to Use
Add it to a standard chart and wait for a full window.
Choose a window matching the horizon and review several regimes.
Read center color as normalized direction and bands as robust distance.
Use the dashboard to compare raw and scale-relative movement.
Alert on confirmed outer entry or center crossing, then apply independent context and risk rules.
Secondary layers can be disabled without changing the model.
Customization
Short windows adapt faster and vary more; long ones smooth more and retain old regimes. Extra refit passes can limit leverage further but cost computation and may underweight a true break. Lower clipping resists extremes sooner; higher clipping approaches ordinary regression. MAD multiples set tunnel thresholds, with a minimum shell gap enforced. Visual layers and palette are independent. Defaults are not universal optima.
Assumptions and Limitations
The model assumes a useful local line and comparable source data. Curves, breaks, gaps, rolls, illiquidity, adjusted history, and non-standard charts weaken it. Robust weights bound influence but cannot label an extreme as error or regime change. Results lag, parameters matter, and small MAD makes flat markets sensitive to the tick floor.
Open-bar values may change. Confirmed alerts still depend on feed and settings. Missing data restarts warm-up. The script has no volume, order flow, higher-timeframe request, future value, pivot, or simulation. It estimates neither reversal probability nor fair value, execution, risk, or profit. Outer distance is deviation, not proof of return.
Conclusion
Bounded refits stabilize rolling path, MAD stabilizes scale, and the tunnel exposes both. Treat distance and direction as lagging context, not a forecast; use independent confirmation.
Indikator

Squeeze AI - Breakout Direction Probability [Dots3Red]🗜️ SQUEEZE AI - BREAKOUT DIRECTION PROBABILITY
A squeeze tells you volatility is loading. It has never told you which way it's going to release. This script fixes that second half of the problem - not by predicting the future, but by remembering the past. Every completed squeeze on your chart becomes a measured data point, and when a new squeeze fires, the script reports what the most similar past squeezes actually did.
✨ WHY THIS MATTERS
Bollinger-inside-Keltner squeeze detection has existed for years, and every version of it does the same thing: flags that a squeeze is happening, then flags that it released. What happens next has always been left to the trader's judgment.
This script keeps score instead. It records the character of every squeeze that completes — how long it ran, how tight it got, what volume and momentum looked like — and pairs that with what price genuinely did afterward. When the next squeeze fires, it doesn't guess; it looks up the most similar squeezes this chart has actually produced and reports their real outcomes.
📊 ▲ 68% | +2.1 ATR | N=34
That reads as: of the 34 most similar past squeezes on this chart, 68% broke upward, averaging a 2.1 ATR move. Measured history, not a formula assuming squeezes behave a certain way.
⚙️ HOW IT WORKS
🗜️ Squeeze detection — the standard definition: Bollinger Bands (mean ± standard deviation) compress fully inside Keltner Channels (mean ± ATR). The moment BB's upper band drops below KC's upper band and BB's lower band rises above KC's lower band, a squeeze is active. A minimum-duration filter discards brief compressions too short to carry real information.
📐 Compression depth — beyond simple on/off, the script tracks how tight the squeeze actually gets: 0% means BB has barely tucked inside KC, approaching 100% means BB has nearly collapsed to a point. This becomes one of the features used for matching, since a shallow squeeze and an extreme one are genuinely different situations.
🧠 The KNN engine — every completed squeeze is stored as five measurements: duration, compression depth, average volume behavior during the squeeze, momentum at release, and volatility context. When it resolves, the actual outcome — direction and distance in ATR — is recorded against those five measurements. A new squeeze is compared against this stored history, and the K most similar past squeezes vote on direction and expected distance.
🔮 Live anticipation — while a squeeze is still compressing, before it even releases, an optional live label shows the KNN's current lean based on the squeeze's characteristics so far. This updates as the compression develops, so you're not waiting for the release to get a read.
🔒 Non-repainting — squeeze tracking, firing, and outcome grading all happen only on confirmed bars. The live anticipation label is explicitly a live-state readout (clearly distinguished from the historical fire labels) and is deleted and redrawn each update rather than left as a permanent mark.
🧭 HOW TO USE
1️⃣ Wait for the sample count. Early on a fresh chart, fire labels will show "Training… (4/12)" instead of a probability. The engine needs a real base of completed squeezes before its reads mean anything — don't trust a probability built on a handful of samples.
2️⃣ Read the N, not just the percentage. "▲ 68% | N=34" is a meaningfully different statement than "▲ 68% | N=8" — the first is a real pattern, the second could easily be noise. The script always shows N specifically so you can judge that yourself.
3️⃣ Watch the live anticipation label as the squeeze develops. A squeeze's characteristics (duration, compression, volume) can shift the KNN lean while it's still compressing — the live label lets you see that lean forming before release, not just after.
4️⃣ Check the dashboard's global stat for chart-level context. Beyond any single squeeze, the dashboard tracks what percentage of every recorded squeeze on this chart broke upward overall — useful context for whether this instrument has had a directional bias in its squeeze behavior.
5️⃣ Tune the minimum squeeze duration to the timeframe. A 4-bar minimum on a daily chart and a 4-bar minimum on a 1-minute chart represent very different amounts of real compression — adjust it to the timeframe you're actually trading.
🛠️ SETTINGS
🗜️ Squeeze Detection
• BB Length / Multiplier, KC Length / Multiplier — standard Bollinger and Keltner parameters
• Min Squeeze Duration — shortest compression the script will bother recording
📊 KNN Engine
• Outcome Window — bars after release over which direction and distance are measured
• K Neighbors — how many similar past squeezes vote on the current one
• Max / Min Training Samples — memory cap and the minimum before probabilities display
• ATR Baseline Period — the volatility-context window used in matching
🎨 Visualization
• Fill between BB — boolean to control area fill
• Squeeze Background Tint, Squeeze Zone Box — two independent ways to mark the active compression, usable together or separately
• Fire Labels with Probability — the KNN readout shown on release
• Live Anticipation Label — the developing-squeeze readout described above
🖥️ Dashboard
• Show/hide, position — current squeeze state and duration, compression %, live KNN read, and chart-wide sample totals
EXAMPLE (area fill between BB bands)
📝 NOTES
Squeeze frequency varies enormously by instrument and timeframe — a fast-moving asset will accumulate the sample count needed for meaningful probabilities much faster than a slow one. On a new chart, expect several squeezes to pass before the KNN read becomes genuinely informative rather than a placeholder.
⚠️ DISCLAIMER
This is an analytical and visualization tool. It does not generate trade signals and does not constitute financial advice. Historical squeeze outcomes do not guarantee how any future squeeze will resolve. Indikator

Squeeze Pro [StrixEDGE]📊 WHAT IT DOES
StrixEDGE Squeeze Pro detects when Bollinger Bands contract inside Keltner Channels — a condition known as the "squeeze" — indicating extremely low volatility that typically precedes explosive moves. It measures squeeze intensity across three levels and uses MACD momentum to predict the breakout direction.
🔬 WHY IT'S DIFFERENT
Standard squeeze indicators show only ON/OFF. This version introduces three intensity levels: the tighter the Bollinger Bands compress inside Keltner Channels, the more powerful the expected breakout. Level 3 (extreme) squeezes historically produce the largest moves. Additionally, a real-time statistics table shows squeeze frequency, average duration, directional bias, and average post-squeeze move size for the current chart.
⚙️ HOW IT WORKS
The indicator calculates Bollinger Band width relative to Keltner Channel width. When BB fits inside KC, a squeeze is active. The ratio between their widths determines intensity:
• Level 1 (yellow dots): Light compression, ratio 0.8-1.0
• Level 2 (orange dots): Medium compression, ratio 0.5-0.8
• Level 3 (red dots): Extreme compression, ratio below 0.5
A four-color MACD momentum histogram shows breakout direction:
• Dark green = bullish accelerating, Light green = bullish fading
• Light red = bearish fading, Dark red = bearish accelerating
📈 HOW TO USE
• Wait for red/orange squeeze dots (Level 2-3) to accumulate
• When dots turn green (squeeze fires), enter in the histogram's direction
• Dark green histogram bars after squeeze = LONG entry
• Dark red histogram bars after squeeze = SHORT entry
• Level 3 squeezes produce the most reliable and powerful breakouts
• Use the stats table to understand squeeze behavior on your specific chart/timeframe
🎛️ INPUTS & DEFAULTS
BB: 20 period, 2.0 multiplier | KC: 20 period, 1.5 multiplier
MACD: 12/26/9 | Stats Lookback: 200 bars
All fully customizable.
═══════════════════════════════════════════════════════
🔧 CUSTOMIZATION
All parameters are fully adjustable through the indicator settings panel. Inputs are grouped logically:
• ⚙️ Core Parameters — main calculation settings
• 📊 Table Settings — table size (Tiny to Huge), position (4 corners), visibility toggle
• 🎨 Visual Settings — colors, show/hide elements
• 🔔 Alert Settings — threshold values for notifications
📊 DATA TABLE
A built-in data table displays all key metrics in real-time. Adjust the table size from Tiny to Huge to match your chart layout. Position it in any corner. Toggle visibility on/off.
🔔 ALERTS
Pre-built alert conditions for all major signals. Set up alerts via TradingView's alert dialog — select this indicator and choose from the available conditions.
⏱️ RECOMMENDED TIMEFRAMES
Works on all timeframes. Recommended: 1H, 4H, Daily for best signal quality. Lower timeframes produce more signals but with higher noise. Weekly/Monthly for position trading context.
✅ COMPLIANCE
• No repainting — all signals based on confirmed bar close data
• No future data references
• Open-source code — verify the logic yourself
⚠️ DISCLAIMER
This indicator is a technical analysis tool, not financial advice. It does not predict future price movements. Past patterns and signals do not guarantee future results. Trading involves substantial risk of loss. Always use proper risk management, including stop losses and appropriate position sizing. Never risk more than you can afford to lose. Indikator

MAs BB Lines_wt [WynTrader]MAs BB Lines --- Published : 2026-08-08
This indicator draws on the classical moving-average-and-Bollinger-Bands framework commonly taught by many specialist authors, to combine an 18-day Bollinger Band setting with a set of key moving averages (21, 50, 100, 200) to read trend direction, volatility, and potential support/resistance zones together. This script builds on that same general approach with a fully customizable, five-MA overlay and an added forward-projection layer.
Features:
📊 5 Independent Moving Averages
Each MA has its own length and type (SMA, EMA, RMA, VWMA, HMA), fully customizable to fit any trading style.
- MA1 (default: 8 EMA) — plotted as stepline for fast reaction visibility
- MA2 (default: 21 SMA), - MA3 (default: 50 SMA), - MA4 (default: 100 SMA) and - MA5 (default: 200 SMA)
📈 Bollinger Bands
Middle line 18-period, 2.0 deviation bands (basis, upper, lower) to frame volatility and price extremes around the trend structure.
🔮 Forward Projection Lines
Dashed projection lines extend from end of lines into future bars, based on each MA's recent slope (lookback-configurable). This gives traders a visual read on where each average is heading if current momentum persists.
- Lookback period: 3–10 bars (controls slope sensitivity)
- Forward projection length: 5–30 bars
- Projections can be toggled on/off
How to use it:
Watch for convergence or crossing of the moving averages and their projected paths — these often mark potential inflection points. Use the Bollinger Bands to gauge whether price is stretched relative to trend. Combine short-term (MA1) and long-term (MA5) MA slopes to confirm trend direction and strength.
Notes:
- Overlay indicator, works on any timeframe and instrument
- All moving average types and lengths are fully adjustable in settings
- Projection lines are visual guides based on recent slope, not predictive signals — always confirm with price action and other analysis
- Conceptual framework inspired by moving-average/Bollinger-Band methods commonly taught by several specialist authors and used by many professionals to identify support and resistance pivots. Indikator

Ronaldo Bicycle Kick Orbit Break Reversal [ Viprasol ]Ronaldo Bicycle Kick — Orbit Break Reversal (Viprasol)
WHAT IT DOES (the idea)
Most reversal tools watch a single line. This one watches a region. It treats recent price structure as a set of confirmed swing points that "orbit" a structural centre of mass, and it trades the moment price escapes that orbit to the upside. Like a ball coiling around a centre and then leaving orbit — that break is the signal. The name is a sporting homage to a spectacular finish; the tool itself is pure geometry.
HOW IT DETECTS
1. Swings: a lightweight zigzag keeps the last several confirmed pivots. A pivot is only accepted after the required number of bars close to its right, so swings do not move once printed.
2. Orbit geometry: from the last K swings (default 6) it computes the geometric centroid — the mean bar position and mean price. It then measures the average (root-mean-square) distance those swings sit from the centroid price. That distance, scaled by "Orbit radius," becomes the orbit ring. A minimum radius floor (in ATR) filters out flat, meaningless rings.
3. Escape: the setup arms only when the orbit is valid. The signal fires on the first bar that CLOSES above the top of the orbit ring (centroid price + radius) having closed at or below it on the prior bar.
ENTRY / STOP / TARGET
- Entry: the close of the escape bar (long only).
- Stop: the lowest swing price inside the orbit, minus an ATR buffer.
- Target: Entry + R multiple x risk (default 2R), where risk = Entry - Stop.
Each trade draws an entry line plus filled TP and SL zones that extend forward bar by bar until price touches one of them, then freeze.
NON-REPAINTING
Signals are built from confirmed pivots and only evaluated on a confirmed (closed) bar. Nothing is placed on the developing bar, so a printed signal does not disappear or shift on later ticks. The dotted "live orbit" preview is a forward-looking sketch of the current geometry and is not a signal.
KEY FEATURES
- A real orbit ellipse is drawn around the centroid so you can see the ring being broken.
- Extend-until-hit TP/SL zones with a one-trade-at-a-time option.
- Optional hide-new-setup-while-in-trade to reduce clutter.
- Adjustable pivot width, swing count, orbit radius, ATR floor, R multiple, stop buffer, and a minimum-bars-between-signals gap.
INPUTS OVERVIEW
Swing pivot left/right bars; swings used for the orbit; minimum swings for validity; orbit radius multiplier; minimum orbit radius in ATR; ATR length; TP R multiple; SL ATR buffer; signal gap; one-trade toggle; visual colours and label offset.
HOW TO USE
1. Add to any liquid symbol and timeframe; it works on all.
2. Watch for the dotted orbit ring to form around recent structure.
3. Take note when a bar closes above the ring and the GOAL label prints.
4. Use the drawn entry, TP, and SL zones as a visual trade map; adjust the R multiple and stop buffer to your own plan.
5. Raise the pivot width or ATR floor on noisy, low-timeframe charts to demand cleaner structure.
LIMITATIONS (honest)
- This is a pattern and education tool, not a signal service or an autotrading system. It highlights a geometric condition; it does not predict outcomes.
- Long-only by design. It will not flag downside setups.
- In strong one-way trends the orbit ring can be escaped repeatedly; in choppy ranges valid orbits may be sparse. Context and discretion still matter.
- Requiring confirmed pivots means the orbit is defined slightly after a swing forms, which is the cost of non-repainting behaviour.
- Past behaviour of any pattern does not guarantee future results.
CREDITS
Built on public, well-known concepts: Average True Range (J. Welles Wilder) for volatility scaling, and standard pivot/zigzag swing detection. The orbit-centroid geometry and the escape logic are original Viprasol work. The "Bicycle Kick" name is an affectionate sporting homage and does not imply any endorsement or affiliation.
This script is an educational tool and is not financial advice. Trade your own plan and manage risk.
Original Viprasol work; no third-party Pine code reused.
Indikator

Indikator

Bolinger Bands Range RSI Oscillator [ChartPrime]🔶 OVERVIEW
Traditional oscillators live in a separate sub-window beneath your price chart, forcing you to constantly split your focus between market structure and momentum data. The BB Range RSI Oscillator solves this by projecting Relative Strength Index momentum directly onto an adaptive Bollinger Bands channel right on your main chart layout.
This indicator normalizes standard RSI readings and maps them directly into price coordinates, letting you track momentum extremes, zone expansions, and automated structural divergences directly over the candles.
🔶 HOW IT WORKS
The indicator executes its structural calculations through a multi-tier transformation pipeline:
Adaptive Channel Matrix: The engine computes a moving average basis and applies a standard deviation multiplier to project upper and lower outer boundaries, alongside half-deviation warning lines, framing the primary price canvas.
Normalized RSI Mapping: Instead of rendering a separate panel, raw RSI values are normalized on a standardized scale and mapped directly relative to the middle basis and band width, translating momentum oscillations into exact price-level coordinates.
Dynamic Transparency Engine: The core oscillator line features a dynamic fade factor based on its distance from the center, shifting opacities to visually emphasize when momentum is pushing toward outer band extremes.
Automated Pivot Divergence Logic: The script evaluates pivot points on the mapped oscillator coordinates against price highs and lows. It measures exact bar spacing intervals to flag regular and prime momentum divergences.
🔶 KEY FEATURES
On-Chart Core Oscillator: Plots a fluid momentum curve directly onto the price candles, complete with an optional smoothing signal line to track trend momentum changes.
Dynamic Zone Shading: Automatically fills the upper and lower channel boundaries with custom color fills when the oscillator breaks past half-deviation or outer band extremes.
Automated Divergence Callouts: Pins custom signal badges (+ Bull, Bull, Bear, + Bear) directly onto historical pivot points when structural momentum divergences are detected.
Customizable Palette & Layout: Full user control over band lengths, RSI lookbacks, divergence parameters, and accent color schemes to fit your preferred charting setup.
🔶 TRADING APPLICATIONS
Extreme Band Rejection Entries: When the core oscillator pushes outside the outer Bollinger Band boundaries and flashes zone shading, look for price action reversal confirmations to catch institutional exhaustion moves.
Momentum Divergence Reversals: Utilize the automated Bullish and Bearish divergence tags to spot hidden shifts in market pressure. A regular or prime divergence near outer bands often signals an impending trend reversal.
Signal Line Crossovers: Enable the signal line to track short-term momentum shifts relative to the core mapped oscillator, giving you clean cross-over execution triggers.
🔶 SETTINGS
Bollinger Bands Settings (Length / Multiplier): Controls the lookback window and standard deviation width of the primary channel boundaries.
RSI Oscillator Settings (Period Length / Signal Line): Adjusts the sensitivity of the underlying momentum engine and configures the optional signal line length and styling.
Divergence Settings (Pivot Lookbacks / Min-Max Bars): Fine-tunes the strictness and spacing constraints used by the pivot detection engine to filter out noise.
🔶 CONCLUSION
The BB Range RSI Oscillator unifies volatility bands and momentum oscillators into a single, cohesive on-chart tool. By mapping RSI directly to price structure, it gives you a clean, distraction-free environment for spotting momentum extremes and institutional divergence setups. Indikator

Regression Trend [MiesOnCharts]Regression Trend - Mies
What it does
This indicator fits a linear regression line to price over a rolling window and draws a corridor around it based on the statistical error of that fit. The corridor is what decides the trend state. As long as price stays inside it, nothing changes. When price closes outside one side, the whole thing flips color and a triangle marks the bar.
The result is a trend line that carries its own tolerance band with it, so you can see at a glance both where the fitted trend sits and how much room price has before the state changes.
How it works
A least squares regression is fitted across the lookback window. That gives the center line.
Around it, the script computes the standard error of the estimate, which is the typical distance between actual price and the fitted line. It comes from the correlation between price and time:
r is the correlation of the source with bar index over the window
residual variance is the price variance scaled by (1 - r²)
the standard error is the square root of that, adjusted for the degrees of freedom of the fit.
This is the part that makes the corridor behave differently from a standard deviation band. The width responds to how well price is actually tracking the trend, not just to raw volatility. A strong, clean trend produces a high correlation, small residuals, and a narrow corridor, so the indicator stays sensitive.
Choppy price that wanders around the line produces a weak fit, a wide corridor, and a much higher bar for triggering a state change. The indicator effectively demands more evidence in exactly the conditions where evidence is thin.
The bands sit at the center line plus and minus a multiple of that standard error. A close above the upper band turns the state bullish, a close below the lower band turns it bearish, and everything in between leaves the previous state untouched. That hysteresis is intentional. It is what stops the indicator from flipping every time price crosses its own mean.
On the chart
Regression line, green when the state is bullish, red when bearish, gray before the first breakout
Upper and lower standard error bands with a light fill between them, colored to match the current state Triangle below the bar when the state flips bullish Triangle above the bar when the state flips bearish.
Display controls to hide the fill, or the bands entirely, if you want a bare trend line
Two alert conditions, one for each direction
Settings
Source sets which series gets fitted. Close is the standard choice. HL2 or a smoothed input will give a calmer line and fewer flips.
Regression Window sets how many bars the fit covers. Shorter windows follow recent structure and react fast. Longer windows describe the broader trend and produce fewer, slower signals. This is the main setting for matching the tool to your timeframe.
SE Band Multiplier controls how far price has to move from the fitted line before the state changes. Lower values tighten the corridor and generate more signals. Higher values require a more decisive break and filter more noise, at the cost of entering later.
Display group toggles the bands and the fill, and adjusts band opacity.
How to use it
The most direct use is as a trend filter. Trade only in the direction the line is colored and treat the opposite flip as your exit or your cue to step aside.
The corridor itself gives you two readable things. Its width tells you how well price is respecting the trend, so a corridor that has narrowed over recent bars means the fit is tightening and the move is orderly. A corridor that has ballooned means the fit has broken down and the state you are looking at is stale. The center line works as a dynamic reference within an established regime, since a pullback toward it is price returning to its own fitted mean rather than to an arbitrary level.
It pairs well with a volume or momentum check. A corridor break tells you the move is statistically unusual relative to the current fit, but it says nothing about whether there is participation behind it.
Behavior worth understanding
The regression is recalculated on every bar, and the corridor plotted on each bar is that bar's own fit. This is a running envelope, not a fixed channel anchored to a pivot, so the bands will look wavier than a manually drawn regression channel. The reference moves with price, which is what keeps the state stable through a sustained run.
Signals are evaluated on the live bar, so a flip can appear and then vanish before the bar closes. Wait for bar close if you need signals that hold.
Limitations
Linear regression assumes price is moving in a straight line across the window, which is never fully true. The fit degrades at sharp reversals and around gaps, and the corridor is slow to acknowledge a turn right after a strong move because that extension is still inside the window. Treat this as a description of current trend structure, not a forecast.
Disclaimer
The indicator provided is not financial advice. Always conduct your own research and consider multiple factors before making trading decisions. Trade at your own risk. Indikator

Reversal Trap Probability Bands [BigBeluga]🔵 OVERVIEW
The Reversal Trap Probability Bands is an advanced technical indicator created by BigBeluga to identify and trade fakeout traps around market extremes. Traditional envelope or band indicators often fail because traders blindly enter breakouts that quickly reverse into whipsaw losses. In order to provide a solution to this problem, this indicator combines volatility-based envelope channels with a dynamic probability tracking engine, measuring historical RSI buckets to calculate real-time win probabilities for reversal traps.
The indicator aims to visualize institutional exhaustion and subsequent mean-reversion expansions. The core element of its calculation involves tracking baseline moving averages alongside outer volatility bounds defined as:
upper_band = basis + (multiplier * vola)
lower_band = basis - (multiplier * vola)
where basis is an exponential moving average of length envelope_len , and vola is the ATR volatility measure scaled by multiplier . Higher values of envelope_len and multiplier allow the indicator to filter out routine market noise and isolate major structural exhaustion points.
🔵 FEATURES
The system utilizes a multi-layered matrix structure to provide actionable market intelligence:
1 — Volatility Envelope & Basis Engine
envelope_len = input.int(55, "Envelope Smoothness") : Controls the responsiveness and smoothness of the central baseline.
upper_band & lower_band : Dynamic outer boundaries that shade gradient fills to visualize upper and lower market extremes.
2 — Reversal Trap Detection & RSI Probability Tracking
trap_window = input.int(10, "Trap Window (Candles)") : Defines the maximum candle count allowed outside the bands before invalidating a fakeout setup.
rsi_bucket = math.max(0, math.min(10, math.round(rsi / 10))) : Automatically categorizes momentum into distinct RSI tiers to calculate real-time win probability rates.
3 — Dynamic Target, Stop, & Signal Management
Bull_Stop = ta.lowest(low, 2) - atr & Bear_Stop = ta.highest(high, 2) + atr : Calculates volatility-adjusted safety padding for active trade management.
Signal Labels & Targets: Plots clear entry notifications displaying win probability percentages, along with dashed target and stop lines.
🔵 HOW TO USE
Apart from the basic visualization of volatility extremes, this tool can also act in alternative ways to support decision-making:
Identify Reversal Traps: Wait for price to break outside the upper or lower envelope boundaries and subsequently close back inside within the defined trap_window .
Evaluate Win Probability: Check the probability percentage displayed on the trap signal label (backed by historical RSI bucket tracking) before entering a trade.
Manage Risk with Stops and Targets: Use the projected dashed target lines (anchored to the basis line) and ATR-padded stop lines to execute and protect positions.
🔵 NOTES
Why this implementation is unique:
It moves beyond static band indicators by integrating a self-learning historical database that calculates live win probabilities based on momentum buckets.
The automated target and stop-loss line projection engine provides clear visual roadmaps for every triggered setup.
The script is fully optimized for Pine Script version 6, utilizing high-performance array tracking (`var int bull_total = array.new_int(11, 0)`) for smooth execution.
Note: Because the win probability engine evaluates historical trade performance dynamically in real time, initial signals on a freshly loaded chart may display "Tracking..." until sufficient sample data is recorded.
Indikator

3D Trend Vortex [BOSWaves]3D Trend Vortex - Slope-Adaptive Gradient Bands with Polyline 3D Extrusion and Zone Entry Signal Detection
Overview
3D Trend Vortex is a slope-driven trend band system that constructs a pair of eight-layer gradient bands positioned above and below price using ATR-scaled offsets from a configurable moving average baseline, where band width breathes inversely with slope magnitude, candle gradient intensity reflects normalized slope strength, and a polyline-based three-dimensional extrusion renders the outer and inner band edges as volumetric ribbon geometry that follows the bands across the configured display length.
Instead of relying on static symmetric bands or fixed volatility channels, the band width contracts when trend slope is strong and expands when slope is flat or weakening, producing a visual breathing effect that communicates momentum intensity through band geometry rather than through a separate indicator. The eight gradient fill layers within each band progress from near-transparent at the inner edge to full opacity at the outer edge, creating a visual depth effect that reinforces the three-dimensional extrusion rendered at the current bar.
This creates a trend framework where every visual layer simultaneously communicates the same underlying information from a different angle. The gradient bands reveal momentum intensity through their width. The candle gradient communicates slope conviction through brightness. The 3D extrusion at the band edges provides spatial depth cues that make the band structure immediately readable across varying zoom levels. Signal labels fire when price first enters either band after the cooldown period, identifying the specific bars where price has moved into the zone of interest defined by the ATR-offset band boundary.
Price is therefore tracked not just for its directional relationship to the basis MA but for its position within or outside a dynamically breathing gradient band system whose visual geometry encodes slope strength and momentum quality on every bar.
Conceptual Framework
3D Trend Vortex is founded on the principle that trend band visualization should communicate momentum quality through the geometric properties of the bands themselves rather than requiring separate momentum indicators, and that introducing three-dimensional spatial depth into the band rendering provides immediate structural legibility that flat two-dimensional bands cannot achieve regardless of color or transparency settings.
Traditional band indicators apply fixed widths or static volatility multiples that remain visually identical whether momentum is surging or stalling, requiring traders to consult separate oscillators for conviction context. This framework embeds conviction directly into band geometry through the breathing width mechanism, where strong slope produces tighter, more concentrated bands reflecting focused directional commitment and weak slope produces wider, more diffuse bands reflecting reduced momentum quality. The three-dimensional extrusion layer adds spatial depth cues that reinforce the structural separation between the supply zone above price and the demand zone below.
Three core principles guide the design:
Band width should adapt to slope magnitude, contracting during strong momentum and expanding during low-conviction conditions, encoding trend health directly into the geometric properties of the bands without requiring a separate momentum indicator.
The gradient fill system across eight layers within each band should provide visual depth that reinforces the three-dimensional extrusion, creating a consistent spatial reading between the flat fill and the extruded geometry at the current bar edge.
Signals should fire on first entry into band territory after the cooldown period rather than on crossover of a single line, capturing the structural significance of price reaching the offset zone while preventing signal clustering during extended band interactions.
This shifts trend band analysis from static channel monitoring into a momentum-adaptive visual system where band breathing, candle intensity, and three-dimensional geometry collectively communicate trend conviction across every bar of the display window.
Theoretical Foundation
The indicator combines configurable moving average baseline selection, ATR-based band offset and width calculation with slope-driven breathing modulation, eight-level gradient fill construction across inner-to-outer band subdivisions, polyline-based three-dimensional extrusion geometry using depth offset coordinates, and slope-normalized candle gradient coloring.
The basis MA is computed in the selected type over the configured length and the three-bar slope is measured as the difference between current and three-bar-lagged values. The slope magnitude is normalized against its highest value over an eighty-bar window, producing a 0-1 score that drives the breathing multiplier applied to the band width. ATR is smoothed over fifty bars to reduce sensitivity to individual volatility spikes, providing a stable scaling unit for both band offset and width calculations. The eight gradient fill layers divide the inner-to-outer band distance into equal steps with progressively increasing opacity, connecting smoothly to the polyline faces of the 3D extrusion that render the outer edge face, top face, and inner top face as separate filled polygon regions at configurable depth offsets.
Four internal systems operate in tandem:
Slope-Adaptive Band Engine : Calculates ATR-smoothed band offset and width, applies EMA smoothing to all four band edges, and modulates total band width by a breathing factor derived from normalized slope magnitude so that bands contract proportionally during high-momentum conditions.
Eight-Layer Gradient Fill System : Subdivides the inner-to-outer band width into eight equal steps and fills each interval with progressively decreasing transparency, producing a continuous opacity gradient from the near-transparent inner edge to the full-opacity outer edge across both the top and bottom bands.
Three-Dimensional Extrusion Engine : On the last bar, constructs polyline polygon arrays for the outer face, top face, and inner top face of each band by combining current bar coordinates with depth-offset coordinates at the configured bar and ATR depth, rendering six filled polyline regions that create the illusion of volumetric band geometry extending from the current bar edge into the chart space.
Zone Entry Signal System : Monitors price crossing into the top or bottom band on each bar, applying independent cooldown tracking for each side to prevent signal clustering during extended band interactions.
This design allows band geometry, candle coloring, and 3D extrusion to all derive from the same underlying slope and ATR measurements, ensuring visual consistency across every layer of the indicator.
How It Works
3D Trend Vortex evaluates price through a sequence of slope-aware band construction and visualization processes:
Basis MA Calculation : The selected moving average type is calculated over the configured length, providing the directional baseline from which all band positions and slope measurements are derived.
ATR Smoothing : Raw ATR over fourteen bars is smoothed with a fifty-bar SMA to produce a stable volatility unit that prevents individual spike bars from distorting band positioning across the display window.
Slope Measurement and Normalization : The three-bar change in basis MA is measured and its absolute value is normalized against the highest absolute slope over eighty bars, producing a 0-1 score reflecting how strong the current slope is relative to recent momentum history.
Breathing Width Calculation : The normalized slope score is scaled and subtracted from 1.0 to produce a breathing multiplier that reduces band width proportionally during high-slope conditions, causing bands to contract during strong momentum and expand during low-conviction flat conditions.
Band Edge Calculation and Smoothing : Inner and outer edges for both the top and bottom bands are calculated by adding and subtracting ATR-scaled offset and width values from the basis MA, then smoothed with the configured EMA length to prevent jagged edge movement.
Eight-Layer Gradient Fill Rendering : The inner-to-outer distance of each band is divided into eight equal steps and plot-fill pairs are rendered at each subdivision with transparency increasing from outer to inner, producing a smooth opacity gradient across the band depth.
Candle Gradient Coloring : The normalized slope score is power-transformed and mapped to a gradient from a dimmed version of the trend color at low slope to full saturation at high slope, coloring chart candles proportionally to current momentum conviction.
Zone Entry Detection : Price crossing into the top band from below or the bottom band from above is detected with independent cooldown tracking for each side. When entry is confirmed and cooldown is satisfied, a signal label is placed at the bar high or low respectively.
3D Extrusion Construction : On the last bar, polyline arrays are constructed for each of the six extruded faces using combinations of current and depth-offset bar indices and price coordinates, rendering the outer face, top face, and inner top face for both the top and bottom bands as filled polygon regions.
Together, these elements form a continuously updating slope-adaptive band system where gradient geometry, candle brightness, and three-dimensional extrusion simultaneously communicate trend direction, momentum conviction, and structural band positioning across the full display window.
Interpretation
3D Trend Vortex should be interpreted as a slope-driven momentum band system with spatial depth visualization and zone entry monitoring:
Bullish Trend State (Green) : Active when the basis MA slope is positive, with the bottom gradient band rendered in green and candles coloring green with intensity proportional to slope strength.
Bearish Trend State (Red) : Active when the basis MA slope is negative, with the top gradient band rendered in red and candles coloring red with intensity proportional to slope strength.
Band Width Dynamics : Narrow bands indicate strong slope momentum with high directional conviction. Wide bands indicate weak slope with reduced momentum quality. Monitoring band width evolution provides real-time conviction context without requiring a separate momentum oscillator.
Eight-Layer Gradient Fill : The opacity gradient from inner to outer edge provides visual depth within each band, with the near-transparent inner boundary representing the threshold where price enters the zone of interest and the fully opaque outer boundary representing the extreme of the ATR-scaled offset distance.
3D Extrusion : The three-dimensional polyline faces rendered at the current bar edge provide spatial depth cues that reinforce the structural separation between the top supply zone and bottom demand zone, making band positioning immediately readable across varying chart zoom levels.
▲ Buy Signals : Green upward triangles mark the first bar where price enters the bottom band after the cooldown period, identifying price reaching the lower ATR-offset zone of interest.
▼ Sell Signals : Red downward triangles mark the first bar where price enters the top band after the cooldown period, identifying price reaching the upper ATR-offset zone of interest.
Candle Gradient : Price candles brighten toward full trend color saturation as slope strengthens and dim toward a muted version of the trend color as slope weakens, providing bar-level momentum conviction readings directly on the candlestick display.
Band width dynamics, candle gradient intensity, signal zone entry, and 3D extrusion depth collectively provide more momentum and structural context than any element in isolation.
Signal Logic & Visual Cues
3D Trend Vortex presents two zone entry signal types with independent cooldown enforcement:
Buy Signal (▲) : Green triangle placed below the bar when price first closes below the bottom band inner edge after the configured cooldown period has elapsed since the previous buy signal, identifying price entry into the lower ATR-offset demand zone.
Sell Signal (▼) : Red triangle placed above the bar when price first closes above the top band inner edge after the configured cooldown period has elapsed since the previous sell signal, identifying price entry into the upper ATR-offset supply zone.
Independent per-side cooldown tracking prevents consecutive signals on the same side while allowing the opposite side to signal freely, ensuring that transitions between upper and lower zone interactions are captured without artificial suppression.
Alert generation covers buy and sell zone entry events for systematic monitoring workflows.
Strategy Integration
3D Trend Vortex fits within momentum-informed band interaction and zone-based directional approaches:
Band Width Conviction Reading : Use band width as a continuous momentum quality gauge. Entering a position during a narrow-band high-slope period indicates stronger directional conviction than entries during wide-band low-slope conditions where momentum quality is reduced.
Zone Entry Signal Framework : Use buy and sell signals as structural alerts that price has reached the ATR-offset zone of interest rather than as standalone entry triggers. Evaluate slope direction and band width at the signal bar to assess whether the zone entry occurs during supporting or deteriorating momentum conditions.
Candle Gradient Momentum Monitoring : Use the brightness of trend-colored candles as a bar-level momentum reading throughout the trend. Progressively brightening candles indicate strengthening slope. Dimming candles within an established trend suggest momentum deterioration before band width changes confirm it visually.
3D Extrusion Spatial Reference : Use the three-dimensional band faces at the current bar edge as a visual anchor for where the current supply and demand zones sit relative to price, with the depth extending into future chart space providing an intuitive structural reference for the zone boundaries.
Basis Type Selection : Use EMA for standard responsive trend tracking. Use HMA for lower-lag applications requiring faster slope detection with minimal smoothing delay. Use WMA for weighted recent-bar emphasis. Use SMA for a simpler unweighted baseline reference.
Multi-Timeframe Band Alignment : Apply higher-timeframe slope direction and band positioning as a directional bias filter, engaging with lower-timeframe zone entry signals only when they align with the established higher-timeframe momentum state.
Technical Implementation Details
Basis Engine : Configurable EMA, SMA, WMA, or HMA with slope measurement and normalization against eighty-bar highest absolute slope
Band Construction : Smoothed ATR offset and width with slope-derived breathing modulation across four band edges
Gradient System : Eight equal subdivisions between inner and outer band edges with plot-fill pairs at progressively increasing transparency
3D Extrusion : Polyline polygon arrays for outer face, top face, and inner top face of each band using depth-offset bar index and ATR height coordinates
Signal Logic : Zone entry detection with independent per-side cooldown bar tracking
Candle Coloring : Power-transformed slope normalization mapped to trend-color gradient
Performance Profile : 3D extrusion triggered only on last bar with full polyline rebuild and cleanup each render cycle, configurable display length cap for object management
Optimal Application Parameters
Timeframe Guidance:
1 - 5 min : Intraday zone monitoring for scalping with shorter basis length and tighter band offset for responsive zone positioning on fast intraday momentum
15 - 60 min : Session-level momentum band tracking with balanced basis length and moderate offset for meaningful zone separation across typical intraday swings
4H - Daily : Swing-level momentum band analysis with longer basis length for sustained slope readings and wider offset reflecting larger price excursions from trend
Suggested Baseline Configuration:
Basis Length : 21
Basis Type : EMA
Band Offset (ATR×) : 3.0
Band Width (ATR×) : 0.9
Band Smoothing : 65
3D Display Length : 400
3D Depth (Bars) : 8
3D Height (ATR×) : 0.5
Show Signals : Enabled
Signal Cooldown : 20
Color Candles : Enabled (requires disabling original chart candles in chart settings)
These suggested parameters should be used as a baseline; their effectiveness depends on the instrument's volatility characteristics, typical ATR range, and preferred band sensitivity, so fine-tuning is expected for optimal performance.
Parameter Calibration Notes
Use the following adjustments to refine behavior without altering the core logic:
Bands too far from price : Decrease Band Offset to bring the inner band edge closer to price, reducing the ATR distance required for price to reach the signal zone.
Bands too close to price : Increase Band Offset to push bands further from price, requiring more significant price extension before zone entry signals fire.
Band width breathing too pronounced : The breathing effect scales with slope normalization. On instruments with highly variable slope the breathing range may appear extreme. Reduce Band Width to compress the overall width range and make breathing less visually dramatic.
Bands too jagged or smooth : Adjust Band Smoothing to control EMA smoothing on band edges. Higher values produce smoother, more gradual band curves. Lower values produce more responsive edges that track price structure changes faster.
Too many signals : Increase Signal Cooldown to enforce greater bar separation between consecutive zone entry signals on the same side, focusing attention on less frequent but more structurally spaced entries.
3D extrusion too deep or shallow : Adjust 3D Depth (Bars) to change the horizontal extent of the extruded faces and 3D Height (ATR×) to change the vertical depth of the extrusion, calibrating the spatial effect to the chart's aspect ratio and zoom level.
3D extrusion covers too many or too few bars : Adjust 3D Display Length to control how many recent bars receive the polyline extrusion rendering, reducing for performance on slower systems or increasing to extend the visual depth effect further back into price history.
Adjustments should be incremental and evaluated across multiple session types rather than isolated market conditions.
Performance Characteristics
High Effectiveness:
Trending markets with clear directional momentum where slope normalization produces meaningful band breathing dynamics and candle gradient provides reliable conviction context throughout the trend
Instruments with consistent ATR behavior where the volatility-scaled band offset positions zones at structurally meaningful distances from price across varying market conditions
Zone interaction strategies where price reaching the ATR-offset band boundary identifies structurally significant extension events worth monitoring for reversal or continuation behavior
Visualization-focused workflows where the three-dimensional band geometry provides spatial chart reading advantages that improve structural awareness relative to flat two-dimensional bands
Reduced Effectiveness:
Choppy, trendless markets where slope alternates rapidly in direction, causing frequent trend color flips and band breathing that produces no sustained directional momentum context
Extremely high-volatility instruments where ATR spikes push band offsets to distances so large that price rarely reaches the zone boundaries and signals become infrequent regardless of cooldown settings
Low-ATR instruments where the extrusion height and band width produce visually imperceptible geometry requiring significant parameter adjustment to produce meaningful spatial depth
Markets with highly irregular slope profiles where the eighty-bar normalization window consistently registers outlier slope readings that compress the breathing range for typical bars
Consolidation environments where flat slope produces maximum band width expansion and near-neutral candle coloring simultaneously, reducing the visual differentiation that makes momentum context readable
Integration Guidelines
Confluence : Combine with BOSWaves order flow tools, structural analysis, or momentum oscillators to validate zone entry signals with broader analytical context before acting on band boundary interactions
Band Breathing Awareness : Monitor band width evolution throughout established trends as a continuous slope health indicator. Progressively widening bands during a trend suggest slope is weakening and conviction is diminishing before price structure confirms the change.
Candle Gradient Divergence : Watch for price extending toward the outer band while candles are simultaneously dimming, indicating momentum deterioration during price extension that may precede reversal toward the basis MA.
3D Depth Calibration : Adjust 3D Depth and Height parameters until the extrusion provides clear spatial depth without obscuring price action. The extrusion is a visualization aid and should complement rather than dominate the chart reading experience.
State Discipline : Maintain directional bias aligned with current slope direction until slope reverses. Zone entry signals within the same trend direction represent extension events rather than reversal triggers and should be interpreted as monitoring alerts rather than directional change signals.
Disclaimer
3D Trend Vortex is a professional-grade slope-adaptive trend visualization and zone monitoring tool. It uses moving average slope normalization with ATR-scaled breathing band construction and polyline three-dimensional extrusion but does not predict future price movements. Results depend on market conditions, instrument momentum characteristics, parameter selection, and disciplined execution. BOSWaves recommends deploying this indicator within a broader analytical framework that incorporates order flow context, structural analysis, and comprehensive risk management. Indikator

Futures Session TWAP + Bands - CFD ChartsAn anchored TWAP (time-weighted average price) with 1/2/3-sigma bands that
knows when the real market is actually open — built for CFD and cash-index
charts whose 24h quotes distort classic session averages.
What makes it original: a TWAP weighs every bar equally, so on a 24h CFD chart
the thin overnight bars count as much as the liquid session and drag the line
away from the number execution desks reference. This indicator pulls the
volume of the auto-detected futures contract and uses it as a SESSION GATE:
only bars where the future actually traded are counted. It also plots an
optional futures-volume VWAP on the same anchor, so the TWAP-vs-VWAP spread
becomes readable at a glance — that spread is the point of the pair.
How it works:
- TWAP = equal-weight average of the chart's price (hlc3 by default) over the
anchor period (session/week/month); bands from the time-weighted variance.
- Session gate (optional, on by default): bars without futures volume are
skipped, so the TWAP covers the real trading session. Only session/volume
information is borrowed from the future — the price stays this chart's
price, so the futures-vs-cash basis cannot distort the level.
- The futures contract is auto-detected from the chart symbol (DAX/GER40 ->
FDAX, NAS100 -> NQ, US30 -> YM, UK100 -> Z, US500 -> ES), or set manually.
- Optional "Daily anchor = futures trading day" resets at the futures day
change instead of CFD broker midnight, matching the sibling VWAP tool.
- A status label shows the active source, the gate state and the current
VWAP-minus-TWAP spread.
How to use it: the TWAP is the fair time-average of the session — the line an
evenly-sliced execution would achieve. Compare it with the futures-volume
VWAP: VWAP above TWAP means volume was concentrated above the time average
(participants paid up), VWAP below TWAP means volume traded below it. The two
lines glued together signals balanced rotation; a widening spread marks
one-sided participation. The 2/3-sigma bands frame statistically stretched
zones relative to the session mean. Check the status label once after loading
to confirm the futures feed is active.
*This script is part of a consistent set of open-source session, range and
volume tools — the companions are on my profile.* Indikator

Indikator

Average Top / Bottom ChannelsThis script is designed to simplify price action by creating an average top and average bottom channel around the market. Instead of focusing on every candle, wick, and short-term price fluctuation, the indicator calculates recent swing highs and swing lows, averages them, and displays a clean visual range where price is moving over time.
The upper line represents the average of recent price tops, while the lower line represents the average of recent price bottoms. The area between them acts like a simplified trend channel, helping identify whether price is moving higher, lower, sideways, or stretching outside its normal range.
My preferred way to use this script is to hide the regular price chart after adding the indicator. This removes visual noise from the candles and makes it easier to focus on the overall direction, structure, and trend behavior. After that, I adjust the settings to fit the market and timeframe I am viewing.
Lower sensitivity settings make the channel react faster to recent price movement, while higher sensitivity settings create a smoother channel for broader trend analysis. The goal is not to predict every candle, but to simplify the chart so the larger trend and average price range become easier to see. Indikator
