TradeGuard-v0.5TradeGuard-v0.5 | Complete Options Trading System
⚠️ This is the only active version. All previous versions (v0.1, v0.2, v0.3, TradeGuard Full, TradeFlow Full System) are retired and no longer maintained. Remove old versions from your chart and add this one.
What is TradeGuard?
Built from scratch after losing money with a 72.5% win rate. The problem wasn't entries — it was exits and holding losers too long. TradeGuard is designed around one core idea: stop the trader from destroying their own edge. It reads market structure, institutional footprints and multi-timeframe alignment automatically so you can focus on executing, not analysing.
CORE SIGNALS
Trend Detection — fully automatic
Triple EMA system 13/48/200 in yellow/purple/red. Automatically reads UPTREND, DOWNTREND or CHOPPY. No manual input required.
BUY CALL / BUY PUT
Six entry types fire automatically — 13 EMA pullback, EMA reclaim, PMH/PML retest, PDH/PDL retest, ORB retest, liquidity sweep. All require trend + volume confirmation. Labels fire once on state change only — not every bar.
CUT CALL / CUT PUT
Fires the moment the EMA breaks. 0DTE mode uses 3-bar no-bounce rule — doesn't wait for candle close because theta doesn't wait. Weekly mode waits for candle close confirmation.
CONFLUENCE SCORING 0-10
Counts how many of 10 factors align before firing. 7+ = ★★★ label on chart, size up. 5-6 = ★★, normal size. Below 5 = silent. Stops you from entering weak setups that only have 2-3 things going for them.
LIQUIDITY SWEEP DETECTION
SW diamond fires when stops have been taken and institutions have entered. Four sweep types: PDH/PDL sweeps, PWH/PWL sweeps, EMA sweeps, equal highs/lows. The reversal after a sweep is sharper because weak hands are cleared out. Combining a sweep with 7/10 confluence is the highest probability setup in the system.
ORDER FLOW APPROXIMATION
Four signals reading the institutional footprint on price and volume. No Level 2 or DOM required.
🐟 Big Fish — Large institution filled an order here. High volume, tiny range = someone absorbed all the flow without moving price. That's a large fill.
W Wall — Big money blocking the move. Price keeps hitting same level with above average volume but cannot break through. Wall below = hidden buyer = CALL bias. Wall above = hidden seller = PUT bias.
Hidden — Iceberg order sitting at this level. Same price tested multiple times with volume, each time bouncing back. The order never runs out because it keeps refreshing.
F Flip — Big money changed direction. High volume reversal candle after a trending move. Institutional size switched sides.
The full sequence: Hidden → Wall → Big Fish at same level = institution finished accumulating or distributing. Label fires: "CALL SETUP BUILDING" or "PUT SETUP BUILDING". Add a sweep and 7/10 confluence = highest probability trade in the system.
REGIME QUALITY SCORE 0-6
Structural score before any entry fires: 2m trend, 5m aligned, 15m aligned, VWAP position, no squeeze, clean session time. LOW regime blocks all entries and tells you exactly what's missing.
KEY LEVELS — all automatic
PMH/PML — premarket high/low (orange)
PDH/PDL — previous day high/low (yellow)
PWH/PWL — previous week high/low (bright yellow, thick) ← most important for weekly options
ORB — opening range with 50%, 1.5x, 2x extensions (aqua)
Intraday fibonacci 0.5 and 0.618
Today's high/low
MTF Key Levels
Previous day/week/month OHLC + equilibrium levels (pdEQ, pwEQ)
Current week/month/year high/low
Y-VWAP (red, thick) — yearly institutional bias line
GEX Proxy Levels
~Flip — gamma flip proxy. Above = pinned/mean-reverting. Below = volatile/trending
~CW / ~PW — nearest $5 round number call wall / put wall proxy
Orange background when negative gamma (trending environment)
ASIA + LONDON SESSION BIAS (SPY/QQQ/indices only)
Shaded backgrounds for each session. Bias label at 9:30am open. London sweep detection — when London sweeps Asia lows and reverses, that's the strongest call setup of the session.
CHART PATTERNS
Bull flag, bear flag breakouts detected and shown in Pattern table row.
STATUS TABLE — 26 rows
Updates live every bar. Trend, EMA, VWAP, Volume, Squeeze, PMH/PML, PDH/PDL, Session, Order Flow, ORB, Pattern, 5m trend, 15m trend, Confluence, Signal, Regime, Gamma, Flip, Asia bias, London bias, US bias, Swing bias, Y-VWAP, Expiry suggestion, Stalled.
ALERTS
40+ alerts including: BUY CALL/PUT, CUT CALL/PUT, HIGH/GOOD confluence, all sweep types, all order flow signals, Y-VWAP cross, PWH/PWL break, MTF level touches, pattern breakouts.
ONE TOGGLE ONLY — 0DTE or Weekly mode. Everything else is automatic.
Best on 2-minute chart for entries. Table provides full higher timeframe context.
~ prefix on GEX labels = structural approximations, not live options chain data. Индикатор

Macro Risk Sentinel🛡️ Macro Risk Sentinel: Smart Crash Detector & Trend Filter
The Macro Risk Sentinel is a powerful risk management tool built to protect your trading from sudden market dumps. Instead of relying on lagging price indicators, this script looks under the hood of the market—tracking hidden credit health and volatility data—to spot panic before it destroys your chart.
Whether you trade manually or run automated algorithmic swing trading strategies, the Sentinel acts as a safety switch.
⚙️ How It Works: The "Smart Recovery" System
Most crash indicators lock you out of the market for way too long, making you miss the most profitable part of the rebound. We fixed this with our built-in Smart Recovery logic.
🔴 Red Zone (Lockdown): Real market panic detected. The indicator turns your chart background red, signaling a strict "Risk-Off" state. It's time to cut longs or pause your trading bots.
🟡 Yellow Zone (Caution): Early warning signs. The market is getting choppy. This is your cue to tighten stop-losses and reduce position sizes.
🚀 Smart Unlock: The game-changer. While in a lockdown, the Sentinel constantly monitors the market in the background. As soon as volatility drops and a healthy price trend begins, it fires a "Smart Unlock" signal. You get the green light to jump back in exactly as the new uptrend starts, without waiting for a blind timer to run out.
✨ Key Features
Under-the-Hood Data: Driven by real market stress metrics (Volatility and High-Yield Credit ratios), not just simple moving averages.
100% Backtest Safe (No Repaint): Built with strict causal logic and zero lookahead bias. What you see on historical bars is exactly what would have printed live, making it perfectly safe to build automated strategies around.
Clean Live Dashboard: A simple, non-intrusive panel on your chart shows the current market state, the recovery conditions, and the lockdown countdown at a glance.
Visual Clarity: Intuitive background colorings and clear chart markers (Crash ⛔, Smart Recovery 🚀) so you never have to second-guess the market environment.
Fully Customizable: Easily tweak the trigger thresholds and lockdown duration to match your specific trading style and risk tolerance.
🎯 Perfect For:
Algorithmic traders who need a "kill switch" for their automated systems.
Swing traders tired of getting caught and holding bags during sudden market crashes.
Systematic traders looking to automate their risk-on/risk-off rules based on hard data. Индикатор

Trend Dashboard - Direction and StrengthTrend Dashboard - Direction and Strength.
A single compact table that reads eleven trend, momentum, volatility, structure and volume-flow indicators on up to four timeframes at once. The directional readings are condensed into a score and a categorical verdict for each timeframe, while trend strength is reported separately by the ADX row and never enters the sum, so direction and strength stay two distinct answers. Built for top-down traders who want the confluence check they normally perform by switching charts to happen in one place, on the chart they are already trading.
How it works:
Every indicator for a given timeframe is computed inside one function and delivered by a single request.security call per timeframe, with lookahead disabled, so the table never reads data that was not available at the time of the bar. The four timeframe slots are user-assigned and default to daily, 4 hours, 1 hour and 5 minutes. Column headers are derived from the assigned timeframe itself, so reassigning a slot relabels the column. Market structure is delivered by a second request per timeframe: it tracks confirmed swing highs and lows over a configurable pivot window, registers the direction of the last break, and counts how many continuation breaks have followed the last change of character.
The table is rebuilt on the last bar only and cells are wiped before each refill, so toggling a timeframe off cannot leave stale values in a column that has shifted. Rows are ordered by the weight of the information they carry: structural context first, then macro regime, then medium-term structure, momentum, strength and the local price position, followed by the three context rows and the score and verdict at the bottom. A marker column carries a coloured dot for rows that must not be read as ordinary trend votes: orange for mandatory context that stays outside the score, white for indicators running on simplified parameters or on an approximation, blue for market structure. The script also detects whether the symbol reports volume. On symbols with no volume feed, cumulative volume delta and OBV divergence print a dash instead of a neutral reading, and the volume delta vote is dropped from the score, which lowers the maximum from eight to seven while the verdict thresholds stay absolute.
What it calculates:
- Market structure — direction of the last swing break, with a phase suffix (C, C+1, C+2 and higher) counting continuation breaks since the last change of character.
- EMA mid/slow — macro regime, the golden and death cross relation.
- EMA fast/mid — medium-term trend structure.
- SuperTrend — ATR trailing direction, computed from a configurable ATR length and factor.
- Ichimoku Kumo — price against the cloud built from the 9, 26 and 52 bar ranges.
- MACD — bullish only when the MACD line leads the signal line and the histogram agrees.
- RSI — directional reading around the midline, with the raw value shown in the cell.
- CVD — cumulative volume delta approximated from the position of the close inside the bar range, read as the agreement between flow slope and price slope.
- Price vs fast EMA — the local position of price, the most sensitive of the trend votes.
- ADX and DMI — trend strength with the raw ADX value shown in the cell, and direction from the DMI pair once the threshold is met.
- OBV divergence — price extreme of the window not confirmed by cumulative volume.
- RSI divergence — price extreme of the window not confirmed by momentum.
- Score — the sum of the eight directional votes per timeframe, shown against the maximum available on the symbol.
- Verdict — STRONG BULL, BULL, MIXED, BEAR or STRONG BEAR, derived from absolute score thresholds.
Key features:
- Four independently assignable timeframe slots, each with its own visibility toggle. Hidden columns shift the remaining ones left and are excluded from the alignment alerts.
- Column headers derived from the assigned timeframe, formatted as 1D, 4H, 1H, 5M rather than fixed labels.
- Separation of directional votes from context. Market structure, ADX and the two divergence rows are displayed but never summed into the score, so trend strength and reversal warnings are not confused with direction.
- Automatic handling of symbols without volume: the affected rows print a dash and the score maximum drops to seven, with verdict thresholds left absolute.
- Per-row tooltips that state what the indicator measures, how to read the three states, its role inside the system and its known failure modes.
- Configurable parameters for every indicator: EMA lengths, RSI length and thresholds, MACD triplet, ADX length and threshold, SuperTrend ATR and factor, CVD lookback, OBV and RSI divergence windows, and the market structure pivot window with a choice between candle close and wick confirmation.
- Ten alert conditions: a bullish and a bearish verdict transition for each of the four timeframes, plus full bullish and bearish alignment across all visible timeframes.
- Table position and text size selectable, with all signal and table colours exposed as colour inputs.
Who it's for:
Trend followers, swing traders and intraday traders who work top-down and want the higher timeframe bias, the execution frame and the entry frame visible at the same time. It suits price-action and SMC or ICT workflows that treat break of structure and change of character as the primary context, and momentum-based approaches that need a strength filter before acting on a directional signal. The outcome is one table that answers whether a trend exists, which way it points on each timeframe, and where the timeframes disagree, without stacking a dozen overlays on the chart. Индикатор

Consolidation Ranges [ITA]🟠 OVERVIEW
Consolidation Ranges finds the places where price stopped trending and went sideways, draws the range while it forms, marks the bar that closes outside it, and then keeps watching to see whether that breakout actually held.
Finding a sideways range is the easy half. Every tool in this category draws the box and marks the breakout, and then stops, which is where the trader's real problem starts. The most common complaint about trading ranges is that the breakout fails and price comes straight back in, and almost nothing measures how often that happens.
So this one waits. After a breakout it gives price a set number of bars to stay outside. Close back inside within that window and the breakout is marked Failed. Stay out and it is marked Held. The running count of both sits in the corner.
🟠 CONCEPTS
* Consolidation - A stretch of bars whose full high to low span stays inside a chosen multiple of ATR. Measuring the range in ATR rather than in points means the same setting behaves the same way on a quiet symbol and a volatile one.
* Range Widening - While price stays inside, the box grows to contain each new bar, but only while the result is still narrow enough to count as a range. Without that limit a slow drift never breaks out, it just drags the box along with it.
* Breakout - The first close outside the box. The close matters rather than the wick, because a wick outside a range is the thing that most often reverses.
* Confirmation Window - The number of bars a breakout is given to prove itself.
* Held and Failed - What actually happened. Held means price stayed outside for the whole window. Failed means it closed back inside the range it had just left.
🟠 FEATURES
🔹 Range width measured in ATR, so one setting works across symbols and timeframes rather than needing to be retuned for each
🔹 The box builds live as the range develops and locks on the bar that breaks it
🔹 Breakouts marked in both directions at the price where the close happened
🔹 Every breakout followed to an outcome and labelled Held or Failed
🔹 A running count of held against failed breakouts, with the rate, for the symbol and timeframe on screen
🔹 Separate alerts for a break up, a break down, a failed breakout and a held breakout
🔹 If the settings are strict enough that nothing is found, the chart says so and names the two inputs to change, rather than leaving you looking at an empty chart unable to tell a quiet symbol from a bad setting
🟠 HOW TO USE
Set Range Length first. It decides how significant a consolidation has to be before it is drawn at all. Twenty bars is a reasonable starting point on any timeframe. Raise it for fewer and larger ranges.
Max Width is the second control. If nothing is being found on a volatile symbol, raise it. If the whole chart is boxes, lower it.
Then read the count in the corner before anything else. It is telling you whether breakouts on this symbol and timeframe have been worth taking. A symbol where most breakouts failed is not a symbol to trade breakouts on, and that is worth knowing before the next one rather than after it.
Bars To Confirm decides how patient the measurement is. A short window counts quick reversals as failures. A longer one only counts a breakout as failed if price genuinely came back.
🟠 CONCLUSION
Drawing the range is the part every tool does. The part that decides whether the range was worth trading is what happened after the break, and that is what this one records. Индикатор

Global Net Liquidity - (Giovanni Fork)Hello traders. This plots the combined balance sheets of the Fed, ECB, BoJ, PBoC and Bank of England, converted to dollars, with the US Treasury General Account and the Fed's reverse repo facility subtracted.
There are already a lot of global liquidity scripts on here, so I want to be clear about what this one does differently rather than just adding another overlay to the pile. Three things.
First, this is a net measure.
Gross central bank assets tell you how much money has been created. They do not tell you how much of it is actually available, because some of it gets created and then taken straight back out of circulation. Money sitting in the Treasury's account at the Fed is not in the system. Nor is cash parked overnight in the reverse repo facility. Subtracting those gives you what is genuinely out there, and that is what net means here. At the time of writing it is 0.97tn in the TGA coming off a gross of 22.37tn.
It is also worth saying that this is built from central bank balance sheets rather than M2. Those are related but they are not the same measure, so if you are comparing this against something else, check which one you are looking at.
Units are worth paying attention to when you combine feeds like this. The underlying sources do not agree with each other: FRED publishes the Fed balance sheet in millions and the reverse repo facility in billions, and the China balance sheet is reported in hundred millions of yuan. TradingView appears to normalise all of them to absolute units before serving them, which is why every scale factor in this script is 1.
I would still rather you checked than took my word for it. Every series has its own visible scale factor and the table prints each component in USD trillions, so you can compare the numbers against what you know the Fed and the ECB are actually running. If a row looks wrong by orders of magnitude, that series' scale input is wrong and you can correct it in the settings without touching the code.
Second, China is measured properly.
The PBoC balance sheet is a poor gauge of Chinese liquidity and most aggregates include it anyway. Its growth up to 2014 was foreign exchange accumulation rather than stimulus, so the series has meant different things in different decades. More importantly, the PBoC's main easing tool is the reserve requirement ratio, and that is balance sheet neutral. Cutting the RRR reclassifies required reserves as excess reserves, releasing roughly 1 trillion yuan per 50bp, while total assets do not move at all. The biggest thing the PBoC does is invisible to a balance sheet aggregate.
The default here subtracts required reserves, estimated as the reserve ratio applied to M2 as a deposit proxy, so an RRR cut registers as the easing it actually is. You can switch back to the plain balance sheet or to the commercial bank balance sheet in the settings. It is an approximation because China's RRR is tiered across large, small and rural banks and the headline rate only covers the large ones, but it responds to the right events.
Third, and this is the part I think adds most, the currency effect is separated out.
Every aggregate that converts foreign balance sheets at spot has dollar moves baked into it. A stronger dollar shrinks the line even when no central bank has done anything, and that gets reported as tightening.
The purple line is the same aggregate chain linked at constant currency. Each period's balance sheet change is converted at that period's own opening rate and accumulated, so it shows what the balance sheets did without the currency. The shaded gap between the two lines is the currency effect, and the table gives it as a number. Since January 2016 it is 1.56tn, meaning that much of the apparent decline in global liquidity was dollar strength rather than central bank action.
The BoJ is the clearest example. Its assets have grown in yen over recent years while its reported dollar contribution has fallen sharply. A gross liquidity chart reads that as the BoJ tightening. It didn't tighten, the yen moved.
A few things to be aware of before you use it.
The chain start date is January 2016 by default and it matters. The constant currency line is accumulated rather than measured, so it seeds at that date and the two lines are identical there by construction. The currency figure is always cumulative since the start date, so 1.56tn means since January 2016, not in absolute terms. Set the date later if you find a component with no data at the start.
The TGA and RRP are US specific drains applied to a global gross, which is slightly inconsistent. Everybody does it, few say so, so I am saying so.
The underlying data updates weekly at best and the PBoC monthly, so use this on daily or higher. Intraday just repeats the last print.
I built this because I wanted to know how much of the last three years of liquidity contraction was real and how much was the dollar. If it is useful to you, say so, and if you think I have got something wrong let me know. Индикатор

Delta Trend Delta Trend is a momentum and directional-trend indicator designed to measure the relative movement of price between the open and close of each candle. It converts the percentage change within each candle into a smoothed Delta Line, allowing traders to identify whether short-term price momentum is strengthening or weakening.
The indicator uses the relationship between the candle's Open and Close to calculate its raw directional movement. This value is then smoothed using a Weighted Moving Average (WMA) and multiplied by an adjustable Delta Adjust factor. The resulting Delta value provides a normalized representation of short-term price momentum.
How the Delta is calculated
The raw calculation is:
(Close − Open) / (Close + Open)
This measures the directional movement of the current candle relative to its overall price level.
The raw value is then smoothed using the selected Delta Smooth period and multiplied by the Delta Adjust setting:
Delta = WMA(Raw, Smooth) × 100 × Adjust
A higher Delta indicates stronger positive price momentum, while a negative Delta indicates bearish price momentum.
Delta Trend
The indicator compares the current Delta value with the previous Delta value.
Rising Delta → momentum is increasing or strengthening.
Falling Delta → momentum is decreasing or weakening.
The Delta Line is displayed in:
White when Delta is rising.
Red when Delta is falling.
This allows the trader to see changes in momentum visually without relying solely on whether price itself is moving up or down.
Zero Line and Thresholds
The indicator includes several reference levels:
0 — the primary bullish/bearish dividing line.
0.3 — an early positive-momentum threshold.
3 — a stronger positive-momentum threshold.
The area behind the indicator is shaded blue whenever Delta is zero or above, providing a quick visual indication that momentum is on the positive side of the zero line.
Delta Table
A table in the upper-right corner displays the current Delta value.
The table changes its background according to the strength of Delta:
Delta ≥ 5 → strong positive momentum.
Delta > 0 → positive momentum.
Delta ≤ 0 → negative momentum.
This gives the trader an immediate numerical reading of current momentum.
Alerts
The indicator contains alerts for both the direction and strength of Delta.
Trend alerts
Buy — Delta Line Rise
Triggered when Delta is rising compared with the previous candle.
Sell — Delta Line Fall
Triggered when Delta is falling compared with the previous candle.
Delta-level alerts
The indicator also provides bullish/bearish conditions around:
10
5
3
0.3
0
These thresholds allow traders to monitor different levels of momentum strength.
For example, a Delta above 5 represents considerably stronger positive momentum than simply being above zero.
Overall Interpretation
The Delta Trend indicator can be viewed as a short-term momentum and momentum-direction tool.
Its readings can be interpreted broadly as:
Positive Delta + Rising Delta
→ Positive momentum is strengthening.
Positive Delta + Falling Delta
→ Momentum remains positive but is weakening.
Negative Delta + Falling Delta
→ Negative momentum is strengthening.
Negative Delta + Rising Delta
→ Bearish momentum is weakening and a potential momentum transition may be developing.
The combination of the Delta level and the direction of the Delta Line is therefore more informative than either one by itself.
Example
If the indicator shows:
Delta = +6.2x
Delta Line = Rising
this suggests that the current smoothed price momentum is strongly positive and is increasing.
If it subsequently changes to:
Delta = +4.1x
Delta Line = Falling
the momentum is still positive, but its strength is declining.
If Delta eventually moves below 0, the indicator has transitioned into negative momentum.
Important Limitation
Delta Trend should not be interpreted as true order-flow or buy/sell volume delta.
Unlike an exchange-provided bid/ask delta, this indicator does not measure actual buyer-initiated versus seller-initiated trades. It derives its value entirely from the relationship between open and close prices.
Therefore, it is more accurately described as a smoothed price-momentum/directional-pressure indicator, rather than a true volume-delta indicator.
In simple terms
Delta Trend answers two questions:
1. Is price momentum positive or negative?
and
2. Is that momentum getting stronger or weaker?
The Delta value tells you the approximate strength of the momentum, while the rising/falling state of the Delta Line tells you whether that momentum is increasing or decreasing.
Индикатор

Multi-Timeframe Hull Moving Average (HMA) Candle Projection### Overview
The **Multi-Timeframe Hull Moving Average (HMA) Candle Projection** is a lightweight, clean chart overlay designed for traders utilizing multi-timeframe analysis.
Instead of traditional higher timeframe candlestick data, this tool applies a **Hull Moving Average (HMA)** calculation directly to the Open, High, Low, and Close (OHLC) values of a higher session. This extracts the noise-filtering benefits of a Hull Moving Average while still structuring the resulting data into recognizable candle bodies and wicks.
### Key Features
* **Live Sidebar Projection:** Rather than plotting blocks directly on top of your current price chart, this script cleanly isolates the real-time higher timeframe Hull candle to the right margin of your layout. This keeps your execution window clutter-free.
* **Lag Minimization:** By processing structural candle boundaries through the Hull formula, it smooths out higher timeframe data without introducing the heavy lag associated with standard simple moving averages.
* **Pine Script v6 Compliant:** Rewritten using the strict syntax rules of version 6 to ensure rapid rendering and seamless compatibility with modern TradingView engine performance metrics.
### How to Read & Use
1. **Trend Identification:** When the projected candle body is green, the higher timeframe Hull trend is bullish (Close >= Open). When it is red, the higher timeframe Hull trend is bearish (Close < Open).
2. **Top-Down Coordination:** This is highly effective for filtering micro-execution charts against macro-trends. For example, look for long setups on a 5-minute chart only when the 15-minute or 1-hour projected Hull candle on the right is green.
3. **Settings Controls:** Double-click the indicator to alter the higher timeframe source resolution (e.g., changing it from 15 to 60 or W for Weekly), modify the HMA lookback length (default is 9), or shift the candle further into your right margin screen space.
Индикатор

Pressure DeltaPressure Delta is a volume-weighted candle-pressure indicator designed to identify directional participation and unusually strong buying or selling activity. It estimates buy and sell pressure from the candle's closing position and wick structure, distributes the candle's volume according to that estimated pressure, and then normalizes the resulting directional delta against average volume. The indicator combines Pressure, Relative Volume Delta, Relative Volume Percentage, Delta Spike and Relative Volume to distinguish ordinary price movement from high-volume directional events.
The most useful way to think about it is:
Pressure = direction
RVoL = participation
RVoL Δ = directional participation
RVoL % = imbalance
Spike = unusualness
1. The core idea: estimating buy vs. sell pressure
The script first examines the candle:
high
low
open
close
volume
It calculates the candle's range:
candleRange = high - low
Then it asks two questions:
Where did the candle close within its range?
closeRatio = (close - low) / range
A close near the high gives a value close to 1.
A close near the low gives a value close to 0.
It also examines the wicks:
wickBias = (lowerWick - upperWick) / range
A relatively large lower wick contributes bullish pressure, while a relatively large upper wick contributes bearish pressure.
Those two components are then combined:
buyPressureRaw =
60% × close location
+ 40% × wick bias
So the indicator gives 60% weight to where the candle closes and 40% weight to the wick structure.
2. Pressure
This is probably the most intuitive component.
pressureFinal = buyPressureRaw × 100
So it produces a number between approximately:
0% → 100%
Conceptually:
0–20% → very strong selling pressure
20–40% → bearish pressure
40–50% → mildly bearish/neutral
50–60% → mildly bullish
60–70% → bullish
70–85% → strong bullish pressure
85–100% → very strong bullish pressure
Your chart labels the last 7 candles with this value.
The colors reinforce the interpretation:
🟢 >60 = bullish
🟡 40–60 = neutral/mixed
🔴 <40 = bearish
Example
Suppose a candle:
opens at 100
trades to 95
trades to 108
closes at 107
The close is very near the high, and the candle may have a relatively meaningful lower wick.
The algorithm therefore might calculate something like:
Pressure = 82%
That means:
"Based on this candle's structure, the indicator estimates strong buying dominance."
It does not mean that exactly 82% of actual trades were buys.
3. Estimated buy and sell volume
The script takes the estimated pressure and applies it to the candle's volume:
buyVol = buyPressureRaw × volume
sellVol = sellPressureRaw × volume
For example, imagine:
Volume = 1,000,000
and:
Pressure = 70%
The script estimates:
Buy volume ≈ 700,000
Sell volume ≈ 300,000
Then:
netDelta = buyVol - sellVol
giving:
+400,000
Again, this is modelled volume, not exchange-reported buy/sell volume.
4. RVoL — Relative Volume
The script calculates a 20-bar average volume:
avgVol = ta.sma(volume, 20)
Then:
rvol = volume / avgVol
So if:
Current volume = 2,000,000
and:
20-bar average = 1,000,000
then:
RVoL = 2.0x
Meaning:
The current candle traded approximately twice the normal volume.
This is useful because pressure by itself isn't necessarily meaningful.
A candle showing 80% pressure on extremely low volume is very different from an 80% pressure candle occurring on 3× normal volume.
5. RVoL Δ — probably one of the most important readings
The script calculates:
rvolBuy = buyVol / avgVol
rvolSell = sellVol / avgVol
and:
rvDelta = rvolBuy - rvolSell
This combines directional pressure + abnormal volume.
For example:
Scenario A
Pressure = 70%
RVoL = 1×
You might get a relatively modest positive RVoL Delta.
Scenario B
Pressure = 70%
RVoL = 3×
The RVoL Delta becomes much larger.
That's because the second candle has substantially more volume behind the estimated buying pressure.
So conceptually:
RVoL Δ attempts to measure the strength of directional volume pressure relative to normal volume.
Your alerts use thresholds of:
5, 6 and 7
So you're essentially saying:
"Alert me when estimated buying pressure is not only positive, but exceptionally large relative to normal volume."
6. RVoL %
This calculation is:
rvPct = (rvDelta / rvol) × 100
This is interesting because it normalizes the delta by total relative volume.
Mathematically, it effectively brings you back toward the buy/sell imbalance expressed as a percentage of volume.
For example:
+50%
means the estimated buying component is substantially greater than the estimated selling component.
The indicator colors:
>50% = green
0–50% = yellow
<0% = red
Your alerts are focused on 40% and 50%.
7. Spike
This is designed to identify unusually large directional-volume events.
The script calculates:
avgAbsDelta = ta.sma(math.abs(rvDelta), 5)
Then:
spike = rvDelta / avgAbsDelta
In other words:
How large is the current directional volume delta compared with the average magnitude of the last five deltas?
For example:
Spike = 0.5×
Normal-ish / relatively weak.
Spike = 1×
Around the recent average.
Spike = 2×
Approximately twice the recent average magnitude.
Spike = 4×
A potentially significant directional-volume event.
Your table highlights values above 2×.
One subtle point: because the denominator uses abs(rvDelta) but the numerator retains its sign, a large negative event can produce a strongly negative Spike.
Индикатор

Индикатор

Индикатор

MTF Liquidity Stack (Zeiierman)█ Overview
MTF Liquidity Stack (Zeiierman) is a multi-timeframe liquidity mapping indicator designed to identify, combine, and track unmitigated liquidity across higher-timeframe swing points, regional trading sessions, and previous-day extremes.
Instead of displaying every liquidity source independently, the indicator organizes multiple liquidity references into one unified structure:
• MTF Liquidity = confirmed swing highs and lows from up to five timeframes
• Session Liquidity = Asia, London, and New York session highs and lows
• Daily Liquidity = Previous Day High and Previous Day Low
• Liquidity Stack = multiple sources occupying the same price level
When several liquidity sources resolve to the same price, they are merged into a single level.
For example:
• 1h + 4h + 15m + Asia : means the same price is simultaneously recognized as a 1-hour swing liquidity level , a 4-hour swing liquidity level , a 15-minute swing liquidity level , and an Asia session liquidity level .
█ How It Works
⚪ Multi-Timeframe Liquidity
The indicator tracks confirmed 3-candle swing highs and lows across up to five timeframes, together with session highs and lows from Asia, London, and New York , plus PDH / PDL .
Once confirmed, each liquidity level is anchored to its exact price origin and projected forward on the chart until price trades through it.
This creates a unified view of liquidity from multiple timeframes, sessions, and daily reference points without separating them into different systems.
The Levels setting controls how many recent unmitigated MTF swing highs and lows are kept for each active timeframe.
⚪ Auto Higher Timeframes
When Auto is enabled, any configured timeframe that is equal to or below the current chart timeframe is automatically promoted to a meaningful higher timeframe.
Duplicate effective timeframes are removed, with explicitly selected higher timeframes taking priority.
For example:
Chart = 1H
• TF 1 = 1H → promoted to 4H
• TF 2 = 4H → explicit 4H
• TF 3 = 1D
Because 4H already exists explicitly, the promoted duplicate is ignored.
The effective structure becomes:
• 4H
• 1D
⚪ Stacked Liquidity
When multiple liquidity sources share the same price and side, they are combined into a single Stacked Liquidity level.
For example:
• PDH + 1D + Asia : means the same price is recognized as the Previous Day High , a Daily swing level , and an Asia session level .
This makes areas where several independent liquidity references overlap immediately visible.
█ How to Use
You can use MTF Liquidity Stack in four main ways: Liquidity Mapping, Liquidity Stacking, Session Trading, and Sweep Analysis.
⚪ Liquidity Mapping
The most direct use of the indicator is to identify liquidity that has not yet been traded through.
• Active horizontal lines represent unresolved liquidity.
• High-side levels mark confirmed highs that remain unswept.
• Low-side levels mark confirmed lows that remain unswept.
The right-side labels make it possible to immediately identify whether a level originates from:
• a higher timeframe
• a session
• PDH / PDL
• several sources simultaneously
This allows traders to quickly see where unresolved price structure remains above and below the market.
⚪ Liquidity Stacking
Liquidity becomes especially useful when several independent sources align at the same price.
For example:
• 1h + 4h : shows agreement between two timeframe structures.
• 1h + Asia + 4h : shows higher-timeframe liquidity aligned with a regional session extreme.
A larger stack does not guarantee that price will reverse from the level.
Instead, it identifies a price where multiple liquidity references overlap, making the area more important for contextual analysis.
⚪ Session Trading
Session liquidity tracks the completed highs and lows of Asia, London, and New York .
For example, after London closes:
• London High stays active until price trades above it
• London Low stays active until price trades below it
These levels can then be used to monitor later sweeps, reactions, and areas where session liquidity overlaps with higher-timeframe liquidity.
⚪ Liquidity Sweep Analysis
Track liquidity sweeps in real time as price trades through higher-timeframe, session, PDH / PDL, or Stacked Liquidity levels.
A sweep of Stacked Liquidity can carry more significance than a single-source sweep because multiple liquidity references are being taken at the same price.
After a sweep occurs, monitor the following price action for either:
• Rejection / reversal away from the swept level
• Continuation through the level in the direction of the move
The sweep itself is not the signal. It shows where liquidity has been taken and where the next price reaction may become important.
█ Settings
Auto: Automatically promotes enabled sources that are equal to or below the current chart timeframe. Explicit higher-timeframe sources take priority when duplicate effective timeframes occur.
Levels: Controls the number of recent unmitigated swing highs and swing lows retained for each active timeframe source.
TF 1 - TF 5: Enable or disable each MTF liquidity source and select its timeframe. Up to five timeframe sources can operate together.
Mode: Selects the global session structure. Full uses the configured Full windows. AM switches Asia, London, and New York together to their configured AM windows.
UTC: Controls the fixed UTC offset used for session timing and daily calculations. Session windows are defined from UTC+0 and shifted automatically.
Asia: Enables Asia liquidity and controls its name, Full session window, AM session window, and color.
London: Enables London liquidity and controls its name, Full session window, AM session window, and color.
New York: Enables New York liquidity and controls its name, Full session window, AM session window, and color.
Daily Reset: Clears both unmitigated and historical mitigated liquidity when a new calendar day begins.
PDH / PDL: Enables Previous Day High and Previous Day Low liquidity tracking.
Labels: Controls the size of liquidity origin labels and completed mitigation labels.
History: Controls whether historical mitigated liquidity remains visible.
-----------------
Disclaimer
The content provided in my scripts, indicators, ideas, algorithms, and systems is for educational and informational purposes only. It does not constitute financial advice, investment recommendations, or a solicitation to buy or sell any financial instruments. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from the use of or reliance on such information.
All investments involve risk, and the past performance of a security, industry, sector, market, financial product, trading strategy, backtest, or individual's trading does not guarantee future results or returns. Investors are fully responsible for any investment decisions they make. Such decisions should be based solely on an evaluation of their financial circumstances, investment objectives, risk tolerance, and liquidity needs.
Индикатор

Key Level Sweep & Breakout█ OVERVIEW
Key Level Sweep & Breakout is a multi-layer tool for analyzing key price levels, designed mainly for intraday traders. The indicator combines levels derived from previous-day, previous-week and previous-month structure with volatility-based levels, the previous-day range, and automatic Sweep and Breakout detection.
The main idea is to gather the most important reference levels in one consistent tool. PDH/PDL, PWH/PWL and PMH/PML make it possible to watch significant historical highs and lows, while ATR levels mark an approximate expected range relative to the day open. In addition, the Day/Session Open and the PDH–PDL range divisions help assess where price currently sits inside the structure of the day.
One of the most important parts of the indicator is automatic Sweep and Breakout signaling. A Sweep identifies a situation in which price violates a key level and then closes back on the opposite side, pointing to a potential rejection of that level. A Breakout identifies a situation in which price breaks the level and holds the close on the breakout side, pointing to a potential continuation.
The indicator is built so that its appearance can be adapted almost completely to a given strategy. Each group of levels can be enabled independently and styled by color, line style, width and transparency. The user can also control how much history is kept on the chart, label placement, the length of extra range-division segments, and how current values are displayed.
As a result, the tool can be used either as a minimal map of key levels or as a richer contextual panel for intraday analysis.
█ CONCEPTS
Key Levels
Key Levels form the foundation of the indicator. They include Previous Day High/Low (PDH/PDL), Previous Week High/Low (PWH/PWL) and Previous Month High/Low (PMH/PML).
These levels represent the previous day, week and month and can act as potential support, resistance and reaction points. The higher the reference timeframe, the broader the context that level provides.
Day / Session Open
Day/Session Open shows the opening price of the current day or session.
This level can be used as a simple reference for judging where price is developing. Price holding above or below the open can add extra context when assessing the direction of the session.
ATR Levels
ATR Levels plot two lines relative to the day open — one above and one below.
Their distance is defined by ATR and a chosen multiplier, so the levels stay linked to current market volatility. They provide an approximate expected range that can be used as an extra reference in intraday analysis.
Previous Day Range
Previous Day Range highlights the area between PDH and PDL as a visually marked zone.
The range can be shown as a two-color split or as a gradient. This makes it easier to see which part of yesterday’s range price is currently in, and how it relates to the upper and lower boundaries of that area.
Range Division Levels
Range Division Levels split the PDH–PDL range at selected percentage values.
The default 25%, 50% and 75% levels create extra reference points inside the previous day’s range, but these values can be changed freely. The levels are drawn as short segments to the right of the last candle, so they do not clutter the main price structure.
Sweep
A Sweep represents a potential rejection of a key level.
The setup is armed when a candle’s wick violates the level. The indicator then waits for confirmation inside a defined bar window. The confirming close must occur on a later candle, not on the same candle that made the breach. For example, after PDH is pierced, price must then close back below that level on a bearish candle (close below open) to produce a Sweep Sell. Likewise, a pierce of PDL followed by a close back above the level on a bullish candle (close above open) can produce a Sweep Buy.
Breakout
A Breakout represents a potential hold on the breakout side and continuation of the move.
After the level is violated, the indicator waits for the next confirmation. If price closes on the breakout side, the confirming candle closes in the direction of the move, and the distance filter is met, a Breakout signal is generated. The same mechanism is used for daily, ATR, weekly and monthly levels.
Confirmation & Distance Filter
Signals are not generated from a single touch or wick through the level. The indicator uses a confirmation window and an optional minimum-distance filter for the confirming close, expressed as a multiple of ATR.
This helps reduce weaker signals in which price only slightly crosses the level without a clear confirming move.
If the confirmation window expires without a valid close, or after a Breakout is printed, the setup is locked until price reclaims the level. Only then can a new Sweep or Breakout setup start.
Distance-from-Levels Table
The Distance-from-Levels table shows the current distance of price from the main levels.
For each level it displays the price value and the distance in ATR units and in percent. This makes it possible to see quickly how close price is to key levels without measuring distances on the chart by hand.
█ FEATURES
Day / Week / Month Levels
• PDH / PDL – previous day’s High and Low
• PWH / PWL – previous week’s High and Low
• PMH / PML – previous month’s High and Low
• Each group can be turned on or off independently and has its own visual settings
• Color, line style, width and transparency can be used to build a visual hierarchy of levels on the chart
ATR Levels
• ATR High / Low plotted from the Day/Session Open
• Configurable ATR length, timeframe and distance multiplier
• Independent visibility and style controls
• ATR used for these levels is taken from closed bars of the selected timeframe and is fixed at the start of the day
Day / Session Open
• Current day or session opening price
• Configurable color, style, width and transparency
• Can be used as an extra reference for session direction
Previous Day Range
• Visualisation of the full range between PDH and PDL
• Two-Color or Gradient fill mode
• Independent colors and transparency for the upper and lower parts of the range
• Two-Color mode keeps a limited history of range boxes. Gradient mode is drawn as a fill between the current previous-day high and low
Range Division Levels
• Up to three configurable percentage levels inside the PDH–PDL range
• Any values from 0% to 100%
• Configurable segment length, horizontal offset, style and width
• Optional percentage labels
Sweep / Breakout Signals
• Sweep signals – potential rejection after a level is violated and price closes back on the opposite side
• Breakout signals – potential continuation after price holds the close on the breakout side
• Signals can be enabled independently for daily, ATR, weekly and monthly levels
• Configurable confirmation window in number of bars
• The piercing candle itself never generates a signal from its own close. Confirmation is evaluated from the next bar through the last bar of the window
• The confirming candle must also close in the signal direction: close below open for sell-side signals, close above open for buy-side signals
• Optional ATR-based minimum distance filter for the confirming close
• Independent Buy / Sell signal colors
• Sweeps are marked with diamonds, Breakouts with triangles
Labels & Live Price
• Global switch for all labels
• Adjustable size and horizontal offset for day, ATR, week and month label groups
• Optional live price labels at the right end of active lines
• Configurable decimal precision and offset from the last candle
History
• Independent number of stored daily, weekly and monthly levels
• Older lines, labels and range boxes are removed automatically to keep the chart readable
Day / Week / Month Reset
• Reset aligned with the instrument session
• Alternatively a manually defined reset time
• Time zone can be set for the manual reset
• Week and month boundaries follow the same reset method as the day
Distance-from-Levels Table
• Current value of each level
• Distance from price in xATR and %
• Configurable table position, text size and value precision
• Optional coloring of levels depending on whether they sit above price (resistance) or below price (support), using the Sell / Buy colors from the Sweep section
• Table ATR is always calculated on the current chart timeframe
Alerts
• Separate alerts for Sweep and Breakout on each individual level
• Combined alerts for any Sweep Buy / Sell and any Breakout Buy / Sell
• Can be used in TradingView alert automation
█ APPLICATIONS
Identifying key intraday reaction levels
The indicator can be used to mark in advance the levels where price may show increased activity. PDH, PDL, PWH, PWL, PMH and PML build a map of important historical levels, while ATR Levels add extra reference points derived from current volatility.
Trading a Sweep
Example scenario: price approaches PDH. Instead of assuming an automatic reversal, the trader watches the reaction. If price violates PDH, then returns below the level and a confirmed Sweep Sell appears, this may indicate that the breakout was not held. In that case the trader can still review market structure, momentum and trend before taking a trade.
Trading a Breakout
Alternative scenario: price tests PDH and breaks above it. If a later close holds on the breakout side, the confirming candle is in the direction of the move, and the distance filter is met, the indicator prints a Breakout Buy. The trader may then treat the level as potential confirmation of continuation and look for an entry in the direction of the breakout.
Combining Levels with Trend
Levels do not have to be treated as standalone trade signals. They can be combined with trend analysis. For example, in an uptrend a trader may prefer reactions at PDL or breakouts above PDH, while in a downtrend more attention may be given to reactions at PDH and breaks below PDL.
Using the Previous Day Range
The PDH–PDL range can serve as a map of the previous day’s internal structure. The trader can observe whether price is in the upper, middle or lower part of the range, then use the 25%, 50% and 75% levels as extra reference points when planning scenarios.
Using the Distance Table
The distance table can be used to see quickly which key level is closest to current price. This reduces the need to inspect many lines by hand and helps judge whether price is near a potential reaction level.
█ NOTES
• Signals require confirmation on a later candle after the bar that pierced the level. The piercing candle never triggers a signal from its own close.
• The confirming close must also be in the signal direction (close below open for sell-side Sweep/Breakout, close above open for buy-side Sweep/Breakout).
• The ATR distance filter can require the confirming close to be a chosen number of ATRs away from the violated level, which may help filter weaker confirmations. A filter value of 0 disables the distance requirement.
• If no valid confirmation appears inside the window, or after a Breakout is confirmed, a new setup on that level can start only after price reclaims the level.
• All main visual elements can be configured individually, so the indicator can be adapted both to a minimal chart and to a more detailed intraday workflow.
• Signals are best used as part of a broader analysis that includes market structure, trend, price action, support and resistance, and proper risk management. Индикатор

DAO GAM Reversal StructureBX Reversal Structure - Adaptive Top and Bottom is a market-structure indicator designed to identify potential horizontal reversal structures formed by two significant swing areas, referred to as A and B.
The indicator analyzes both top structures and bottom structures.
For a top structure, the script looks for an upward price phase followed by a meaningful rejection. It uses the high and close of the final bullish anchor candle to define a price zone around the swing high.
For a bottom structure, the logic is reversed. The script looks for a downward price phase followed by a meaningful recovery and uses the low and close of the final bearish anchor candle to define the swing-low zone.
When two valid zones, A and B, share an overlapping price area, the script attempts to determine a horizontal reference level called X.
The X level is selected so that it remains within the common price area of A and B while avoiding the interior of candle bodies located between the two structures. Wick interaction with X is permitted.
This approach is intended to distinguish meaningful horizontal market structures from simple price equality between two isolated swing points.
Main concepts
The indicator evaluates several structural conditions, including:
Minimum price movement into and away from each swing.
A minimum number of candles forming the directional phase before and after the swing.
Overlap between the price zones of A and B.
Candle-body interaction between A and B.
Separation between the two swing areas.
Distance and spacing between A and B.
Additional interactions with the X level after the structure is formed.
The indicator can detect:
Top structures: potential resistance or reversal structures.
Bottom structures: potential support or reversal structures.
Adaptive mode
The indicator includes an adaptive mode based on ATR (Average True Range).
Instead of relying exclusively on fixed price distances, ATR-based thresholds can automatically scale according to the volatility of the current symbol and timeframe.
This allows the indicator to be tested on different markets and timeframes, including forex, metals, cryptocurrencies, indices and other instruments available on TradingView.
A manual mode is also available for users who prefer fixed parameter values.
A, B and X
A represents the first qualified swing structure.
B represents a later qualified swing structure that shares a valid price area with A.
X is the horizontal reference level calculated from the overlapping zones of A and B.
Additional qualified interactions with the same level may be displayed as C, D, E or subsequent touches.
For top structures, X acts as a horizontal resistance reference.
For bottom structures, X acts as a horizontal support reference.
Line behavior
After a valid A-B structure is detected, the X line is extended to the right.
The visual line stops when a future candle body reaches the X level. Candle wicks alone do not necessarily stop the line.
The script may also generate a CHECK condition when price moves a specified distance beyond X within the configured monitoring period.
These signals indicate that the predefined structural condition has occurred; they are not automatic trading orders.
How to use
Users can apply the indicator directly to a chart and choose between:
AUTO (ATR): parameters adapt to current market volatility.
MANUAL: price-distance parameters are entered manually.
Because volatility and market structure differ significantly between instruments and timeframes, users should evaluate the parameters on the specific market they intend to analyze.
The indicator is intended primarily as a market-structure visualization and research tool. It can be combined with independent analysis of trend, volatility, liquidity, risk management and broader market context.
Original concept
The central idea of this indicator is that a horizontal resistance or support structure should not necessarily be defined by two identical highs or lows.
Instead, each swing is represented as a price zone between the close and the extreme of its anchor candle.
The indicator searches for the common price area between two qualifying zones and then determines a horizontal level that respects candle-body structure between them.
This zone-overlap and candle-body approach is the main structural concept used by the script.
Limitations
This indicator does not predict future market direction and does not guarantee that a detected support or resistance structure will produce a reversal.
Pivot-based structures require subsequent candles for confirmation, so signals are identified only after sufficient market data becomes available.
ATR adaptation improves portability between instruments and timeframes, but no single parameter configuration can provide identical behavior across all markets.
Low-liquidity instruments, gaps, unusually volatile market conditions and different data feeds may produce different results.
Historical structures should not be interpreted as evidence of future profitability.
Users should independently evaluate the indicator and apply appropriate risk management before making trading decisions. Индикатор

Индикатор

Modern Squeeze Momentum [GBB]MODERN SQUEEZE MOMENTUM
A rework of the Squeeze Momentum Indicator with an adaptive length, graded compression, normalised momentum, a qualified-release filter and a higher-timeframe context layer. Classic mode reproduces the original exactly.
The Squeeze Momentum Indicator (LazyBear's open-source implementation of John Carter's TTM Squeeze) is one of the most used free scripts on TradingView, and for good reason: Bollinger Bands inside Keltner Channels is a clean, intuitive way to spot compression before expansion. It also has four well-known limitations:
- The length is fixed at 20 bars regardless of the market's current cycle.
- The squeeze is binary. A hair inside the Keltner Channel counts the same as an extreme contraction.
- Momentum is in price units, so a reading of 15 on gold and 0.0004 on EURUSD tell you nothing comparable, and no fixed threshold works across symbols.
- Every squeeze release fires, whether or not price actually did anything.
This script keeps the original as its base (Layer 0) and adds five layers on top. Each layer has its own on/off switch so you can see exactly what each one changes.
HOW IT WORKS
Layer 0 - Classic base
Bollinger Bands (SMA +/- 2.0 standard deviations) and Keltner Channels (SMA +/- 1.5 x SMA of true range). Momentum is the linear regression of close minus the midpoint of the Donchian midline and the SMA, exactly as in the original.
Layer 1 - Adaptive length
Instead of a fixed 20, the length follows the dominant cycle measured by the Ehlers Homodyne Discriminator on (high + low) / 2. The cycle estimate is smoothed with a short EMA, clamped to a 12-40 bar range, and rounded. All bands and the momentum calculation use this length, so the indicator tightens in fast markets and widens in slow ones.
Layer 2 - Graded compression
The ratio Bollinger width / Keltner width is percentile-ranked over the last 150 bars. Three grades: light (bottom 30%), medium (bottom 15%), tight (bottom 5%). The zero-line dot grows and changes colour with the grade, and a duration counter tracks how many bars the squeeze has lasted. With this layer off, the classic binary test (BB inside KC) is used.
Layer 3 - Normalised momentum
Momentum is divided by the Keltner range, so the histogram is in "Keltner-range units". A reading of 1.0 means the same thing on BTC 1h, gold 15m and EURUSD 1h. Reference lines at +/-0.5 and +/-1.0 are drawn for orientation. The momentum threshold used in Layer 4 is set in the same units.
Layer 4 - Qualified release
A raw release is simply the squeeze ending. A qualified release additionally requires, on the release bar:
- momentum direction agrees with the bar direction (close vs open),
- absolute momentum is at or above the threshold (default 0.5),
- the squeeze lasted at least the minimum number of bars (default 3),
- close breaks the high (long) or low (short) of the range that formed during the squeeze.
Qualified releases are drawn as solid triangles (green up, red down). Unqualified releases are drawn as small grey dots so you can see what the filter removed. Turn the layer off and every release fires, as in the original.
Layer 5 - Context
HTF wash: the full layer stack is evaluated on a higher timeframe (default 4x the chart timeframe, or pick your own). When the higher timeframe is in a squeeze, the pane background is tinted, darker for tighter grades. Only closed higher-timeframe bars are used, lookahead is off. If the chosen HTF is not above the chart timeframe, a label says so and the wash is disabled.
Stats table: running counts on the loaded bars. Number of squeezes, raw vs qualified releases, hit rate (did close move in the release direction after H bars) and range multiple (the H-bar range after a qualified release, in ATR, relative to the H-bar range of all bars). H defaults to 10 bars.
READING THE PANE
- Histogram: the four original states are kept. Positive and rising, positive and falling, negative and falling, negative and rising, each in its own colour.
- Zero-line dot: small blue-grey = no squeeze; yellow / orange / red and increasingly large = light / medium / tight squeeze.
- Triangles: qualified release, long below the histogram, short above.
- Grey dots: releases that did not pass the filter.
- Background tint: the higher timeframe is in a squeeze.
- Reference lines: +/-0.5 and +/-1.0 Keltner-range units (only drawn when Layer 3 is on).
Three palettes: GBB (default), LazyBear (original colours) and Mono.
CLASSIC MODE
One switch in the General group turns Layers 1-4 off, sets the fixed length, and reproduces the original Squeeze Momentum Indicator histogram and squeeze dot. Combine it with the LazyBear palette if you want the familiar look. It is there so you can check for yourself what the added layers do and do not change.
ALERTS
Five alert conditions, all evaluated on confirmed bars only:
- Squeeze started (message includes the grade)
- Squeeze released (raw)
- Qualified release - long
- Qualified release - short
- HTF squeeze started / released
REPAINTING
Releases, markers, alerts and table counts are evaluated on confirmed bars. The higher-timeframe layer uses closed HTF bars only. The adaptive length and the percentile rank depend on recent history, so values on the current bar can move until it closes, like any indicator that uses the live bar.
SETTINGS OVERVIEW
- General: Classic mode.
- Adaptive length (Layer 1): on/off, min and max length, fixed length for when the layer is off.
- Bands: BB and KC multipliers.
- Compression (Layer 2): percentile ranking on/off, rank window, light / medium / tight percentiles, minimum squeeze bars.
- Momentum (Layer 3): normalisation on/off, momentum threshold.
- Release (Layer 4): qualified filter on/off, require range break, show unqualified releases.
- Context (Layer 5): HTF wash on/off, HTF selection, stats table on/off, stats horizon.
- Visual: palette.
CREDITS
- John Carter for the TTM Squeeze concept.
- LazyBear for the open-source Squeeze Momentum Indicator that this script extends. Layer 0 and Classic mode are his logic.
- John F. Ehlers for the Homodyne Discriminator (Rocket Science for Traders).
Open source. No hype, just data. Nothing here is a trade recommendation; a squeeze tells you volatility contracted, not which way it will expand. Индикатор

Индикатор

Prime Structure BiasKaushik Prime — Prime Structure Bias 👑 is a professional 1H market structure dashboard designed to identify the current market bias and structure using confirmed price action.
The indicator analyzes Higher Highs (HH), Higher Lows (HL), Lower Highs (LH), and Lower Lows (LL), along with BOS and CHOCH confirmations to determine whether the market is Bullish, Bearish, or Neutral.
It displays the analysis in a clean, table-only dashboard with no chart labels, arrows, or structure drawings. The dashboard shows Market Bias, Structure, Direction, Last Structure Event, Trend Strength, Market Condition, Trading Bias, and Analysis Timeframe.
The indicator is designed to provide a clear 1H higher-timeframe market direction for traders analyzing lower timeframes such as 5M and 15M.
Features:
• 1H Higher-Timeframe Market Bias
• HH / HL / LH / LL Structure Detection
• BOS & CHOCH Detection
• Bullish / Bearish / Neutral Classification
• Trend Strength Assessment
• Trending / Ranging Market Detection
• BUY / SELL / NO TRADE Bias
• Clean Table-Only Dashboard
• No unnecessary chart markings
Note: This indicator is intended as a market-structure analysis tool and does not guarantee future price movement. Индикатор

Индикатор

MAD Adaptive Trend Score [BackQuant]MAD Adaptive Trend Score
Overview
MAD Adaptive Trend Score is a trend oscillator built from a Median Absolute Deviation-based price filter and a multi-lookback relative-position score.
The indicator first calculates a rolling median and MAD from the selected source. Price deviation from the median is then clipped to a configurable MAD envelope, producing the MAD Adaptive Filter.
The current value of that filtered series is then compared with a range of its previous values. Each comparison contributes either +1 or -1 to a Trend Score.
The result is a bounded directional score that can be used with separate bullish and bearish thresholds to create a persistent trend state.
The script includes:
Exact rolling median and MAD calculations.
MAD-based clipping of source movement.
Configurable multi-lookback Trend Score.
Separate long and short regime thresholds.
Optional filter overlay on the main chart.
Trend candle colouring and signals.
Reference levels and alerts.
MAD Adaptive Filter
The first stage calculates the rolling median of the selected Source over the MAD Length.
It then calculates Median Absolute Deviation:
MAD = Median(|X - Median(X)|)
Raw MAD is multiplied by 1.4826:
Scaled MAD = Raw MAD × 1.4826
with a minimum value based on the instrument's minimum tick.
The 1.4826 factor is commonly used to scale MAD to approximately the same scale as standard deviation when the underlying distribution is normal.
The indicator then measures:
Deviation = Source - Rolling Median
and defines the maximum permitted deviation as:
Maximum Deviation = Scaled MAD × MAD Multiplier
The source deviation is clipped to this range before being added back to the median.
Conceptually:
If Source remains inside the MAD envelope, the filter follows Source.
If Source moves above the envelope, the filter is limited to the upper MAD boundary.
If Source moves below the envelope, the filter is limited to the lower MAD boundary.
The MAD Adaptive Filter is therefore not a conventional moving average. It is a source series whose distance from its rolling median is limited by the current MAD-derived envelope.
MAD Multiplier
MAD Multiplier controls the permitted distance between the filtered value and the rolling median.
Lower values:
Create a tighter envelope.
Clip more of the source movement.
Keep the filter closer to the median.
Higher values:
Create a wider envelope.
Allow more source movement through unchanged.
Make the filter follow price more closely.
Trend Score
The second stage scores the current MAD Filter against several previous values of the same filtered series.
For every lookback between Score Lookback Start and End:
+1 if the current MAD Filter is above the historical MAD Filter.
-1 otherwise.
The final Trend Score is the sum of all comparisons.
If N historical values are being compared, the theoretical score range is:
-N to +N
For the default 1-to-45 range, 45 comparisons are made, so the score can range from -45 to +45.
What the score represents
A high positive score means the current MAD-filtered value is above most of the historical filtered values being compared.
A strongly negative score means it is above very few of them.
For example, with 45 comparisons:
A score near +45 means the current filtered value is above nearly the entire comparison range.
A score near 0 means the comparisons are more evenly divided.
A score near -45 means the current filtered value is below, or equal to, nearly all of them.
The score is therefore best understood as a relative position / trend score of the filtered series.
It is not a return forecast or probability of future direction.
Why use several lookbacks?
Comparing the current filter with only one previous value would effectively reduce the calculation to short-term slope.
Using many previous values instead measures where the current filtered level sits relative to a broader section of its history.
A steadily rising filtered series will generally move toward higher positive scores because the current value becomes greater than an increasing number of historical values.
During sustained weakness, the opposite occurs.
Score Lookback Start and End
These settings define which historical MAD Filter values participate in the score.
For example:
Start = 1
End = 45
compares the current filter against each filtered value from 1 through 45 bars ago.
A shorter range:
Responds more quickly to recent changes.
Creates a smaller score range.
A longer range:
Includes more historical comparisons.
Produces a broader measure of relative trend position.
Usually changes more gradually.
Because the score range depends on the number of comparisons, threshold settings should be chosen with the selected score range in mind.
Trend State
The script converts the Trend Score into a persistent bullish or bearish signal state.
The bullish and bearish rules are deliberately separate.
Bullish condition
The signal becomes bullish when:
Trend Score > Long Threshold
Once bullish, the state remains bullish until a valid bearish condition occurs.
Bearish condition
The signal becomes bearish when the score crosses downward through the Short Threshold:
Previous Score >= Short Threshold
Current Score < Short Threshold
The bearish condition therefore requires an actual downward threshold crossing rather than simply remaining below the level.
Why use separate thresholds?
Using different bullish and bearish levels introduces persistence into the regime.
The signal does not need to reverse whenever the score crosses zero.
For example, with:
Long Threshold = 40
Short Threshold = -6
the score must reach a strongly positive state before the model turns bullish, but the bullish state can persist through a substantial amount of score deterioration before a bearish transition occurs.
This creates a form of threshold hysteresis and reduces rapid switching around a single center level.
The thresholds are fully configurable and do not need to be symmetrical.
Initial state
The signal begins neutral.
A bullish state can be established once the Long Threshold condition is satisfied.
A bearish state requires a valid downward crossing of the Short Threshold.
Signal markers are shown only when an established bullish state changes to bearish or an established bearish state changes to bullish.
The initial transition from neutral does not produce a long/short marker.
Reference Lines
The optional dashed reference lines display the Long and Short Thresholds directly in the oscillator pane.
These levels correspond to the actual regime settings and can be useful when visually tracking how the Trend Score approaches a possible state change.
MAD Filter Overlay
The MAD Adaptive Filter can optionally be plotted directly on the main price chart.
This makes it possible to compare:
Raw price.
The rolling-median/MAD envelope response.
The active trend colour.
The overlay uses the same bullish or bearish state colour as the oscillator.
Trend Candles
Optional chart candles are coloured from the stored trend state:
Bullish state = Long Color.
Bearish state = Short Color.
The colour represents the indicator's trend regime rather than the direction of each individual candle.
Background Colour
An optional transparent background can also display the current trend regime on the main chart.
This is purely visual and does not alter the calculation.
How to interpret it
Strong positive score
The current MAD Filter is above most values in the selected historical comparison range.
This typically accompanies a relatively strong upward position in the filtered trend.
Falling score while still bullish
The filtered trend is losing relative strength, but the Short Threshold has not yet been crossed.
The persistent state therefore remains bullish.
Short Threshold crossing
The score has deteriorated far enough to cross below the selected bearish boundary, changing the stored state to bearish.
Rising score while bearish
The score can recover substantially while the trend remains bearish.
A new bullish state is not established until the score exceeds the Long Threshold.
How to use the indicator
The indicator can be used as:
A directional trend filter.
A persistent bullish/bearish regime indicator.
A way to measure the relative position of a MAD-filtered price series.
A confirmation tool alongside other price or market-structure analysis.
The score itself can also provide additional context beyond the binary trend colour.
For example, a bullish regime with a score near its maximum is different from a bullish regime whose score has already fallen substantially toward the bearish threshold.
Input Guide
MAD Length
Controls the rolling sample used to calculate the median and Median Absolute Deviation.
Shorter values adapt more quickly.
Longer values produce a broader statistical reference window.
MAD Multiplier
Controls how far the filtered source may move away from its rolling median.
Lower values produce stronger clipping.
Higher values allow the filter to follow Source more closely.
Score Lookback Start / End
Defines the historical MAD Filter values used in the Trend Score comparisons.
Long Threshold
Score level that must be exceeded to establish a bullish state.
Short Threshold
Level that must be crossed downward to establish a bearish state.
Data Window
The script exposes:
Rolling Median.
Raw MAD.
Scaled MAD.
These values can help show how the underlying MAD filter is being constructed.
Limitations
The indicator is reactive rather than predictive.
The score measures the current filtered value relative to historical filtered values; it does not estimate future returns.
Threshold selection can materially change signal frequency and persistence.
A very tight MAD Multiplier can suppress meaningful movement along with noise.
A very wide MAD Multiplier makes the filter increasingly similar to the original Source.
Long score ranges can improve persistence but also delay changes in regime.
Strong trends can keep the score near an extreme for extended periods.
Alerts
The script includes:
MAD Trend Score Long: stored signal changes from bearish to bullish.
MAD Trend Score Short: stored signal changes from bullish to bearish.
Summary
MAD Adaptive Trend Score combines two simple ideas.
First, the selected Source is constrained around a rolling median using Median Absolute Deviation. Source movement inside the MAD envelope passes through normally, while movement beyond the envelope is clipped to the current boundary.
Second, the current filtered value is compared with a configurable range of its own historical values.
Those comparisons are summed into a Trend Score, with positive values indicating that the current filtered level is above more of the historical comparison range and negative values indicating the opposite.
Separate Long and Short Thresholds then convert the score into a persistent bullish or bearish regime.
The result is a MAD-based filtered series and relative-position trend score for experimenting with trend persistence and threshold behaviour. Индикатор

Индикатор

Williams Variable A/D Pressure [MarkitTick]💡 This tool reframes Larry Williams' Variable Accumulation/Distribution concept as a fully adaptive, confluence-filtered oscillator, then extends it into a complete ATR-based trade-management layer with a live on-chart dashboard. Rather than reading a single fixed-formula line, traders get a volume-weighted pressure reading that can be reshaped through eight different smoothing engines, gated by a trend-strength filter and a higher-timeframe bias check, and translated directly into projected entry, stop, and take-profit levels the moment a qualifying signal appears.
✨ Originality and Utility
The core value of this script is not the Variable A/D formula itself — that calculation is decades old — but the pipeline built around it. Three distinct engineering layers are stacked with a specific purpose each, which is what justifies combining them into a single publication rather than three separate scripts:
A selectable adaptive-smoothing stage that lets the trader choose how the raw pressure sum is denoised — from simple averaging to cascaded, lag-reduced, and custom recursive estimators — instead of being locked into one fixed filter shape.
A dual confluence gate (trend-strength via ADX and directional bias via a higher timeframe) that suppresses crossovers occurring in weak or conflicting conditions, rather than firing on every raw cross of the smoothed line against its signal average.
An execution layer that converts a confirmed crossover into a concrete, volatility-scaled trade plan (entry, stop, three take-profit tiers) with automatic on-chart tracking of which levels have been touched, plus JSON webhook payloads for each event so the signal can drive external automation without manual re-entry of parameters.
None of these layers is arbitrary window-dressing: the adaptive filter changes what "the trend" looks like, the confluence gate decides whether that trend is tradeable, and the trade-management layer answers the practical question of where to actually place risk once a decision has been made. Removing any one of the three would leave either a raw unfiltered oscillator, an unfiltered signal, or a signal with no execution framework.
🔬 Methodology and Concepts
• Williams Variable Accumulation/Distribution Core
For every bar, a raw pressure value is calculated as the bar's directional efficiency — (close − open) divided by the bar's full range (high − low) — multiplied by that bar's volume. This produces a signed, volume-weighted read of how much of the bar's traded volume pushed price toward its close relative to its open, scaled by how decisively the bar closed within its own range. This raw series is then summed over the WVAD Period using a simple moving average multiplied by the period length, which reconstructs a rolling total (rather than an average) of accumulated buying or selling pressure over that window — consistent with Williams' original "variable" accumulation/distribution concept, where the weighting factor varies bar to bar instead of using a fixed multiplier.
• Adaptive Filter Engine
The rolling WVAD sum is then optionally reshaped by one of eight selectable smoothing methods before it becomes the tool's working "WVAD" line:
SMA / EMA / RMA — standard simple, exponential, and Wilder-style moving averages applied directly to the WVAD sum.
Double WMA — a weighted moving average applied to the output of a first weighted moving average, compounding the weighting to reduce lag further than a single WMA pass.
Triple VWMA — a volume-weighted moving average cascaded through itself three times, so the smoothing itself continues to lean on volume at each stage rather than only at the raw-pressure stage.
HMA — a Hull Moving Average pass, used here for its reduced-lag response relative to standard averages.
LLAMA — a proprietary in-house filter unique to this script. It combines a simple moving average of the WVAD sum with a linear extrapolation term: the average per-bar slope of the WVAD sum across the lookback window, scaled by half that window's length, is added back to the moving average. In practice this projects the average forward along its recent trend rather than leaving it lagging behind price the way a plain moving average would.
Kalman Filter — also a proprietary, simplified single-state implementation rather than a textbook multi-variable Kalman filter. It maintains a running error estimate and a fixed process-noise term equal to the reciprocal of the selected length; on each bar it computes an adaptive gain from the ratio of predicted error to that error plus a fixed measurement-noise constant, then nudges its estimate toward the new WVAD value by that gain. Shorter lengths raise the process-noise term and make the filter react faster to new data; longer lengths make it progressively smoother and slower to adapt.
Selecting "None" bypasses this stage and the raw WVAD sum is used directly.
• Signal & Confluence Logic
A Signal Length moving average of the (optionally filtered) WVAD line produces the Signal line, and the difference between the two produces the histogram. A raw long or short bias is registered when the WVAD line crosses above or below its Signal line. That raw bias only becomes an active Long/Short signal when both confluence conditions pass: the ADX Filter, when enabled, requires the prior bar's ADX reading to be at or above the ADX Threshold before a crossover is accepted, filtering out signals born in low-trend-strength conditions; the HTF Confirmation filter, when enabled, requires the previous, fully closed candle on the selected higher timeframe to have closed bullish for long signals or bearish for short signals, filtering out crossovers that fight the higher-timeframe bias.
• Confirmation & Non-Repainting Design
The script is built so that no decision depends on data that has not yet closed. The crossover check itself compares the previous bar's WVAD and Signal values, the ADX gate reads the previous bar's confirmed ADX value, and the higher-timeframe request pulls the prior, already-closed candle on that timeframe rather than the currently forming one. Entry price for a new trade plan is likewise taken from the previous bar's close rather than the live price. Entry/exit alerts only fire once a bar is fully confirmed. One practical consequence worth understanding: because the crossover and entry reference both use the prior bar, there is a small, consistent one-bar delay between the moment the underlying pressure line actually crosses its signal and the bar on which the trade plan is drawn and the alert can fire — this is a deliberate confirmation design choice, not an inconsistency. Take-profit and stop-loss "hit" detection, by contrast, is checked against each bar's own intrabar high/low as it happens and can alert in real time, since that behavior simply reports a price touching an already-fixed level rather than altering a prior signal.
🎨 Visual Guide
• Oscillator Pane
The WVAD line plots the (optionally adaptively filtered) pressure sum.
The Signal line plots its moving average.
The Histogram, drawn as columns, shows the difference between the two and cycles through four shades: a solid strong color when rising above zero, a faded shade when falling but still above zero, a solid opposite color when falling below zero, and a faded shade when rising but still below zero — giving an at-a-glance read of both direction and momentum change.
A flat Zero Line marks the neutral pressure boundary.
BULL and BEAR text markers appear directly on the oscillator at the bar where a confirmed long or short signal registers.
• Price Chart Overlay Elements
Several elements are pushed onto the main price chart even though the indicator's native pane is the oscillator below it:
Heatmap Candles optionally recolor the actual price candles' bodies, wicks, and borders based on whether the WVAD line is above, below, or equal to its Signal line — turning the price chart itself into a running visual of the underlying bias.
A second copy of the BULL/BEAR marker is placed directly below or above the corresponding price bar, so the signal is visible on the price chart without needing to also watch the oscillator pane.
• Trade Level Projection
When a confirmed signal fires (and levels are not locked), five horizontal lines and matching labels are drawn from the signal bar forward: the Stop-Loss line and label, the Entry line and label, and three Take-Profit lines and labels (TP1–TP3). A shaded Risk fill spans the zone between stop and entry, and a shaded Reward fill spans between entry and TP3, giving an immediate visual sense of the risk/reward geometry. All five lines automatically extend to the right as new bars form. Once a take-profit or stop level is touched, its label text updates in place to show a hit confirmation and the resulting percentage gain or loss from entry — the lines are not redrawn or repositioned, only the label text and the ongoing color state update.
• Dashboard Panel
An optional table (position configurable) summarizes, in real time: the symbol and timeframe, whether Lock Signal is active, the current directional Bias, the raw WVAD and Signal values, the Histogram value, a filled-bar Strength readout (WVAD magnitude relative to its own 100-bar high), current Volume and a filled-bar Volume Ratio (versus its 20-bar average), the Higher-Timeframe Bias (only shown when that filter is enabled), the current ADX reading (only shown when the ADX filter is enabled), the active Adaptive Filter name (only shown when one is selected), and the live Trade direction with Entry, SL, and TP1–TP3 prices, each recoloring once its corresponding level has been hit.
📖 How to Use
Treat a WVAD-over-Signal cross, confirmed by a BULL/BEAR marker and matching histogram color flip, as the core directional bias; the heatmap candles offer the fastest visual confirmation of that same bias directly on price.
Enable the ADX Filter to require a minimum trend-strength reading before a crossover is accepted — useful for avoiding signals generated during flat, low-conviction chop.
Enable HTF Confirmation and choose a higher timeframe to only accept longs when that timeframe's last closed candle was bullish, and shorts when it was bearish — this narrows signals to those aligned with the broader trend context.
Use the Adaptive Filter dropdown to trade off responsiveness against smoothness: SMA/EMA/RMA are the most transparent baseline options, Double WMA and Triple VWMA add extra lag reduction (the latter leaning more heavily on volume), HMA targets minimal lag, and LLAMA and Kalman Filter are the script's proprietary adaptive options for traders who want the smoothing itself to react to changing conditions rather than stay fixed.
Lock Signal freezes the currently displayed trade-level lines and labels so a new opposite signal will not replace them while it is enabled; it does not stop new BULL/BEAR markers, histogram behavior, or alert conditions from continuing to register — it only holds the visual trade plan in place.
The Entry price used for any trade plan is the previous bar's close, not the live price at the moment the signal appears, so real-world fills will vary from the plotted entry level depending on slippage and gap risk.
Configure the Alerts group's action-tag fields to match whatever automation system consumes the webhook payloads, then build a TradingView alert on this script using "Any alert() function call" to receive the JSON messages for entries, exits, and each TP/SL event.
⚙️ Inputs and Settings
• Core Settings
WVAD Period — the summation length for the raw Variable A/D pressure calculation.
Signal Length — the moving-average length used to derive the Signal line from the (filtered) WVAD line.
• Filters
Use HTF Confirmation / HTF Timeframe — enables the higher-timeframe directional gate and sets which timeframe it checks.
Use ADX Filter / ADX Threshold / ADX Length — enables the trend-strength gate and sets its minimum qualifying reading and DMI length.
Adaptive Filter / Adaptive Filter Length — selects which of the eight smoothing methods (or none) is applied to the WVAD sum, and its lookback length.
• Trade Tools
Lock Signal — freezes the current trade-level projection against replacement by a new signal, as described above.
Show Trade Levels — toggles whether entry/SL/TP lines, labels, and fills are drawn at all.
SL × ATR — sets the stop distance as a multiple of ATR from the entry reference price.
TP1 × R / TP2 × R / TP3 × R — set each take-profit distance as a multiple of the initial risk (R) defined by the stop distance.
ATR Length — the lookback used for the ATR value driving stop and target distances.
• Visuals
Show Histogram, Show WVAD/Signal Lines, Show Signal Markers, Show Zero Line, and Color Candles independently toggle each corresponding chart element described in the Visual Guide.
• Dashboard
Show Dashboard and Position control whether the summary table is displayed and which corner it occupies.
• Alerts
Long / Short / Close Long / Close Short Action and TP1 / TP2 / TP3 / SL Hit Action — free-text tags inserted into each event's JSON webhook payload (alongside ticker, timeframe, and relevant price fields) so external automation can route each message correctly.
Colors for every line, fill, label, candle state, and dashboard element are independently configurable and are purely cosmetic.
🔍 Deconstruction of the Underlying Scientific and Academic Framework
The foundation is Larry Williams' Variable Accumulation/Distribution concept: a price-volume flow measure in the same family as Chaikin's Accumulation/Distribution Line, but weighting each bar's volume by its own directional efficiency — (close − open)/(high − low) — rather than the Close Location Value used in Chaikin's version, making the "variable" weighting bar-specific rather than fixed.
The adaptive-smoothing stage draws on several established ideas from technical filtering theory: cascaded weighted and volume-weighted averaging (repeated WMA/VWMA passes) as a lag-reduction technique, Alan Hull's reduced-lag moving average construction, and the broader concept of adaptive filters that vary their responsiveness with market conditions rather than using a static weighting scheme — the category popularized by adaptive moving-average research such as Kaufman's work. Within that category, this script's LLAMA and Kalman Filter options are simplified, single-parameter, in-house approximations: LLAMA borrows the linear-extrapolation logic underlying least-squares/regression-adjusted moving averages (projecting a simple average forward using its own recent slope), while the Kalman Filter option implements a single-state recursive estimator in the spirit of Kalman filtering — updating an estimate and its error term each bar based on a fixed process/measurement noise ratio — rather than the multi-state, matrix-based formulation used in full Kalman filter implementations.
The ADX/DMI confluence gate is drawn from Welles Wilder's Directional Movement System, using ADX as a proxy for trend strength independent of direction. The higher-timeframe confirmation gate reflects standard multi-timeframe analysis practice, where aligning a lower-timeframe signal with a higher-timeframe directional read is used to reduce signals that contradict the broader trend. Finally, the ATR-based stop and R-multiple take-profit structure reflects standard volatility-adjusted position and risk management practice, sizing trade levels to each instrument's own recent average range rather than to a fixed point or percentage value.
⚠️ Disclaimer
All provided scripts and indicators are strictly for educational exploration and must not be interpreted as financial advice or a recommendation to execute trades. We expressly disclaim all liability for any financial losses or damages that may result, directly or indirectly, from the reliance on or application of these tools. Market participation carries inherent risk where past performance never guarantees future returns, leaving all investment decisions and due diligence solely at your own discretion. Индикатор

XeL OnlineRecursionXeL OnlineRecursion is a Pine Script library for online and streaming statistical estimation on continuous numerical and financial data.
The library is designed around recursive statistical populations whose retained state is updated observation by observation. Most recursive components use constant retained memory and O(1) work per observation, making them suitable for indicators and models that require adaptive statistics without repeatedly recalculating an entire historical window.
OnlineRecursion is statistical infrastructure rather than a trading signal, strategy, or standalone indicator. It is intended to be imported and composed by other Pine scripts.
CORE DESIGN
The library separates four conceptual layers:
Streaming and population mechanics.
Generic retained statistical state.
Derived statistical interpretations.
Finance-oriented evidence and recursive weighting models.
A central design principle is that retained state represents a statistical population. Statistics that can be derived from an existing population are computed from that state rather than introducing unnecessary independent recursions.
STATISTICAL TOOLS
The library includes:
First-order recursive filtering and recursive extrema estimation.
Sample-and-hold, settlement, accumulation, and exact rolling-sum tools.
Fixed-memory P2 cumulative quantile estimation.
Adaptive quantile and expectile estimation.
Adaptive conditional tail-mean estimation.
Adaptive Huber location estimation.
Adaptive MAD and Gaussian-equivalent robust scale.
Recursive univariate moments through fourth order.
Variance, sigma, skewness, kurtosis, and effective sample size.
Recursive covariance and correlation.
Recursive linear-regression views including beta, intercept, and R-squared.
Recursive Heavy-Tail distribution estimation.
Relative-return, relative-projection, and additive-moment transforms.
Recursive decay, anchored, participation, and composite-alpha constructors.
Market-participation models.
Market-dispersion models.
POPULATION SEMANTICS
OnlineRecursion treats population geometry as part of the mathematical definition of an estimator.
Depending on the component, the represented population may be:
Cumulative.
Finite rolling.
Exponentially weighted.
Anchored.
Conditional.
Observation-clock.
Event-clock.
These population interpretations are not assumed to be interchangeable.
Initialization, missing observations, reset behavior, recursive coefficients, and population boundaries are therefore explicit estimator semantics rather than incidental implementation details.
Where defined as a recursive feedback coefficient, alpha generally follows a convention. Exact initialization behavior is defined by each estimator because creation of a new statistical population is not always equivalent to an ordinary recursive update.
FINANCE-ORIENTED EVIDENCE
The library includes reusable tools for constructing adaptive market evidence, including time-decay weighting, participation-based weighting, relative-return transformations, and recursive market-dispersion models.
Available dispersion interpretations include:
Mean displacement.
Realized movement.
Drawdown.
Upthrust.
Directional stress peaks.
Average directional stress.
Participation models allow recursive weighting to respond to different market-population relationships rather than treating every observation as equally informative.
The chart accompanying this publication demonstrates library mechanics on NQ continuous futures using hourly observations and Open Interest participation.
The upper and lower dispersion plots, recursive mean, and lower-pane statistic illustrate one possible composition of exported library functionality.
These plotted outputs are demonstrations of statistical mechanics. They are not trading signals or recommended parameter settings.
HEAVY-TAIL MODEL
The Heavy-Tail estimator combines generic recursive moment state with additional model-specific interpretations such as Student-t degrees of freedom, t-distribution scale, and absolute-innovation scale.
HeavyTail is one statistical interpretation built on the generic moment backbone. The library does not assume that this model is appropriate for every market, instrument, or application.
USAGE
Import the library from another Pine Script and use the exported state types, methods, enumerations, or functional interfaces required by the application.
Stateful interfaces provide explicit control over retained state and update timing. Functional interfaces are also provided where convenient for series-oriented use.
Some estimator compositions intentionally require caller-controlled timing.
For example, when one adaptive estimator supplies a threshold, center, or scale to another estimator, the caller may need to use the previously retained value to avoid unintended same-observation feedback.
MISSING DATA AND CALLER POLICY
Market-data-dependent functions can return na when required information is unavailable or when the requested statistical relationship is not currently defined.
Fallback behavior intentionally remains with the importing application when the library cannot define the relationship mathematically.
This prevents unavailable data from being silently converted into a different statistical assumption.
LIMITATIONS
OnlineRecursion does not provide:
Entry or exit logic.
Trading recommendations.
Profitability claims.
A guarantee that any estimator is appropriate for a particular market.
Recursive estimators depend on their coefficient policy, population definition, and initialization semantics.
A recursive population is not automatically equivalent to a finite rolling-window population merely because their outputs may appear similar.
Users should therefore select estimators and coefficient models according to their statistical meaning rather than treating all recursive parameters as interchangeable smoothing controls.
DESIGN INTENT
OnlineRecursion is intended to provide reusable statistical infrastructure from which higher-level models can be composed.
The architecture follows this separation:
Foundational state represents the retained population.
Derived statistics interpret that population.
Models add model-specific assumptions.
Applications decide how statistical evidence is used.
This separation is intended to keep generic statistical machinery independent from application-specific trading logic.
VERSION
This first TradingView library publication corresponds to XeL OnlineRecursion development release 1.0.0-rc.2 , dated 2026-09-04.
TradingView library publication revisions such as /1 are independent of the project's development release numbering. Библиотека

TMA Volatility BandsTMA Volatility Bands
TMA Volatility Bands is a trend and volatility indicator built around a smoothed Triangular Moving Average (TMA) and dynamically calculated deviation bands.
The indicator is designed to show the current market trend, volatility range, and potential reversal areas through a structured set of expanding TMA bands.
The TMA acts as the central trend reference, while the surrounding bands expand according to the current deviation of price from the TMA. This creates three volatility levels on both sides of the TMA, helping visualize how far price has moved from its smoothed average.
Main Settings
TMA Trend Line
The central TMA provides a smooth representation of the underlying price trend and reduces short-term market noise.
Dynamic Volatility Bands
Three band levels are calculated above and below the TMA. The bands automatically adapt to changing price volatility, creating a dynamic market range.
Multi-Level Band Structure
The first band represents the primary volatility boundary, while the middle and outer bands extend progressively farther from the TMA. This makes it easier to identify stronger extensions in price movement.
Trend Strength Gradient
The TMA changes color according to the direction and strength of its movement relative to ATR-based volatility. Stronger TMA movement produces a stronger color transition, while weaker movement moves toward a neutral color.
Buy and Sell Signals
The indicator includes automatic reversal-style signals based on price extending beyond the primary volatility band and then forming an opposite-direction candle.
A Buy signal appears when the previous candle moves below the lower primary band and the current candle closes bullish.
A Sell signal appears when the previous candle moves above the upper primary band and the current candle closes bearish.
Adjustable Settings
TMA Period controls the smoothing and responsiveness of the central TMA.
Band Deviation controls the distance of the primary volatility bands from the TMA.
Price Source allows the calculation to use the selected price source.
Trend Threshold controls the sensitivity of the TMA trend-strength gradient.
TMA Volatility Bands is designed to provide a clean visual framework for analyzing trend direction, volatility expansion, price extensions, and potential reversal areas.
The signals should be used as part of a broader trading strategy and confirmed with price action, market structure, or other analysis tools.
Индикатор
