Statistical Mean-Reversion Engine [SMRE]## Statistical Mean-Reversion Engine (SMRE)
SMRE is an open-source mean-reversion indicator that combines a rigorous statistical core with up to eight optional confirmation layers, designed primarily for index-futures trading on intraday timeframes (1-minute through 1-hour).
### What it does
For every bar, SMRE fits an Ornstein-Uhlenbeck (OU) process to the recent price series via linear regression on lag-1 prices, yielding four outputs:
- **μ (the mean)** — the equilibrium price the series is reverting to
- **θ (mean-reversion speed)** — how strongly the series pulls back to μ
- **HL (half-life)** — how many bars it takes to revert halfway
- **σ_eq (stationary residual variance)** — used to z-score the current price
The current price's z-score against μ (the "OU Z") is the primary signal. When |OU Z| exceeds a configurable threshold, a mean-reversion entry is considered — but only after the script also confirms that the recent price series is genuinely stationary using three orthogonal statistical tests:
- **Hurst exponent** must be below 0.55 (i.e., the series is not persistently trending)
- **Augmented Dickey-Fuller** t-statistic must be below -2.86 (rejects unit root)
- **Variance Ratio** test at q=4 must be below 1.0 (variance grows sub-linearly with horizon)
If all four conditions pass, the L1 (statistical core) signal fires.
### Why the multi-layer structure (mashup justification)
A single OU-based mean-reversion signal works well in stationary regimes but degrades in trending or volatile conditions. SMRE addresses this by validating each potential entry through up to eight orthogonal confirmation channels, each measuring something the others do not:
- **L2 — Volatility Regime (6-state):** Classifies market state via VIX, ADX, and realized volatility. Suppresses signals during high-trend conditions (regime 6, "Spike") where mean-reversion historically fails.
- **L3 — Spot-Futures Basis (Kalman filter):** Tracks the deviation between actual and theoretical futures pricing. Statistically significant basis dislocations often resolve via mean-reversion.
- **L4 — Options Surface:** Computes ATM implied volatility from straddle pricing and a skew z-score from OTM put/call ratio. Optional; requires user to provide option symbols.
- **L5 — Microstructure:** Blends rolling VWAP and session-anchored VWAP z-scores with VPIN (a volume-clock toxicity proxy) and order-flow imbalance. Captures flow-based exhaustion.
- **L6 — Gamma Walls (GEX) OR Put-Call Ratio:** Two mutually exclusive options. GEX requires OI symbols at five strikes; PCR requires a single broker-published PCR feed. Both detect option-driven price magnets.
- **L7 — Dispersion:** Rolling correlation of index returns with its top 5 constituent stocks' returns. High dispersion (low correlation) penalizes signals; high cohesion boosts them.
- **L7b — Residual Dispersion:** Idiosyncratic residual z-scores (β-adjusted) per constituent. If 3 of 5 stocks show same-sign extreme residuals, the index is detached from constituents — strong mean-reversion candidate.
- **L9 — Cross-Asset Stress:** Sigma-normalized stress across USD/INR, DXY, and crude oil. Penalizes signals during cross-asset hedging cascades.
Each layer outputs a {direction, strength} pair. The Layer 8 fusion engine combines these via a weighted composite score (default weights: L1=0.28, L5=0.22, L3=0.18, L4=0.12, L6/L7b=0.10), then applies a regime multiplier (L2 × L7 × VRP × cross-asset × expiry), clamped to to prevent extreme compounding.
If the absolute composite score crosses one of three thresholds (0.25 / 0.40 / 0.45 by default), a signal is fired at Scalp / Swing / Session horizon respectively. A TCA cost filter then validates that the expected move (distance to μ) exceeds estimated round-trip transaction cost; otherwise the signal is suppressed.
### Originality
The author is not aware of any other public Pine script that implements the full OU-fit chain (mean, mean-reversion speed, half-life, stationary variance) together with all three stationarity tests (Hurst, ADF, Variance Ratio) directly in Pine v6 — every step is computed natively, no external library calls. Additionally, the session-anchored VWAP with running volume-weighted sigma bands, the rolling-beta residual dispersion across multiple constituents, and the Kalman-filtered futures-basis residual are original Pine implementations. The signal telemetry module (a 200-signal FIFO ring buffer with horizon × composite-magnitude bucket attribution) is also an original diagnostic tool.
### How to use
1. **Apply to an index futures chart.** Defaults are pre-configured for NSE NIFTY1! futures, but inputs allow any index — change the VIX symbol, spot/futures symbols, constituent symbols, and currency pairs.
2. **Read the compact dashboard.** It's a single 9-row table (default position: middle-right) showing only what you need to evaluate a setup:
| Row | What it shows | What it means |
|---|---|---|
| Title | Profile + OU window in use | Confirms which calibration is active |
| OU Z-Score | Z-score with half-life (HL) | How extended price is + how long mean-reversion typically takes |
| Stat Validity | H / ADF / VR pass-fail | Whether the recent series is actually stationary (all 3 must pass) |
| Regime | Volatility state + VIX value | Whether market conditions favor mean-reversion |
| Composite | Fused score × regime multiplier | The unified signal strength |
| Confluence | Layers agreeing (out of 6) | How many orthogonal signals support the direction |
| TCA Edge | Expected move in bps + PASS/FAIL | Whether the trade clears transaction costs |
| E / SL / TP | Entry, Stop, Target + Risk:Reward | The trade levels if a signal fires |
| **DECISION** | Direction · Horizon · Side | The actionable output (green=long, red=short, gray=neutral) |
3. **Trade levels and markers.** When a signal fires, entry/stop/target lines auto-plot on the chart. Stop is ATR-based (default 1.2× ATR); target is min(OU mean μ, entry + 2× ATR). Triangle markers plot below (long) or above (short) the bar — small for Scalp, medium for Swing, large for Session.
4. **Optional diagnostic.** A separate Signal Telemetry table (disabled by default; enable via the "Show Telemetry Dashboard" input) tracks the last 200 signals' outcomes (win = price touched μ, loss = stop hit, expired = timeout) and reports hit rate by horizon × composite-magnitude bucket. This is a backward-looking diagnostic, not a backtest.
### Recommended chart and timeframe
This indicator was developed and parameter-tested primarily on NIFTY1! futures. The OU window auto-mapping (1m→32, 2m→20, 5m→12, 15m→32, 30m→20, 1h→24) was selected empirically through parameter sweeps. Users on other instruments should expect to tune the OU window manually or accept the auto-mapped default as a starting point.
The indicator works on any timeframe between 1 minute and daily, though intraday timeframes (1m through 1h) are where the multi-layer confluence adds the most value.
### Important notes
- This is an **indicator**, not a strategy — no backtest equity curve is produced. The telemetry table is a descriptive measure of recent signal outcomes only.
- Many layers are **optional**. If you don't have symbols for options OI, just leave those inputs blank; the script will redistribute composite weight naturally across the active layers.
- Signals can fluctuate intra-bar before bar close, especially in real-time mode. For consistent behavior, evaluate signals on closed bars only.
- The default constituents (top-5 NIFTY weights) need to be changed in the L7 inputs to use this on a different index.
### Disclaimer
This indicator is published for educational and research purposes only. It is not financial advice, not an investment recommendation, and not a solicitation to trade. Past behavior of signals does not guarantee future results. Trading futures, options, and equities carries substantial risk of loss. You are solely responsible for your trading decisions. The author makes no representations about the accuracy, completeness, or suitability of this indicator for any particular purpose. Use at your own risk, and always consult a qualified financial professional before trading.
Indicatore

Indicatore

Elaris Session Liquidity Grabs Pro# Elaris Session Liquidity Grabs Pro
Elaris Session Liquidity Grabs Pro is a professional session-based liquidity sweep and reversal detection tool designed for traders who focus on smart money concepts, stop hunts, failed breakouts, and institutional liquidity behavior.
The indicator automatically builds key liquidity ranges from major global trading sessions including London, New York, and Asia, then detects high-probability liquidity grabs when price sweeps session highs or lows and rejects back into range.
Unlike basic sweep indicators, this tool includes advanced filtering systems designed to reduce noise and focus on stronger reversal conditions using ATR displacement, candle strength analysis, EMA trend filtering, and optional volume confirmation.
Built for active intraday traders, scalpers, and smart money traders, the indicator provides a clean visual framework for identifying areas where liquidity may have been engineered before a market reversal or continuation move.
━━━━━━━━━━━━━━━━━━
FEATURES
━━━━━━━━━━━━━━━━━━
• Automatic London, New York, and Asia session ranges
• Session high/low liquidity tracking
• Bullish and bearish liquidity grab detection
• Wick sweep and close-break detection modes
• ATR-based sweep validation filters
• Strong displacement candle confirmation
• EMA trend filter for directional bias
• Volume confirmation filter
• Optional cooldown system to reduce signal clustering
• Session equilibrium (midline) plotting
• Clean session range visualization
• Professional dashboard panel
• Dark mode and light mode support
• Alert conditions for automation and notifications
• Non-repainting confirmed signals
━━━━━━━━━━━━━━━━━━
HOW IT WORKS
━━━━━━━━━━━━━━━━━━
The indicator builds liquidity ranges from selected market sessions and monitors price action after those sessions complete.
When price aggressively sweeps a session high or low and then rejects back into the range, the indicator identifies it as a potential liquidity grab event.
Examples:
• Price sweeps above London High and closes back below → potential bearish liquidity grab
• Price sweeps below New York Low and closes back above → potential bullish liquidity grab
Additional confirmation filters help reduce weak or low-quality signals by requiring stronger candle displacement, trend alignment, and optional volume expansion.
━━━━━━━━━━━━━━━━━━
BEST USE CASES
━━━━━━━━━━━━━━━━━━
• Smart money trading concepts
• Session liquidity trading
• Stop hunt reversals
• Scalping and intraday trading
• ICT-style trading approaches
• Breakout failure detection
• Market manipulation detection
━━━━━━━━━━━━━━━━━━
RECOMMENDED MARKETS
━━━━━━━━━━━━━━━━━━
• Crypto Futures
• Forex
• Indices
• Gold and Commodities
━━━━━━━━━━━━━━━━━━
RECOMMENDED TIMEFRAMES
━━━━━━━━━━━━━━━━━━
• 1 Minute
• 3 Minute
• 5 Minute
• 15 Minute
━━━━━━━━━━━━━━━━━━
NON-REPAINTING
━━━━━━━━━━━━━━━━━━
This indicator is designed to be non-repainting.
Signals are confirmed only after candle close and session levels are finalized after the session completes. No future data is used.
━━━━━━━━━━━━━━━━━━
NOTES
━━━━━━━━━━━━━━━━━━
This tool is designed to assist with identifying liquidity behavior and market structure reactions. It should be used alongside proper risk management, higher timeframe analysis, and additional trade confirmation techniques.
No indicator guarantees profitability or win rate consistency across all market conditions.
Indicatore

Indicatore

Markov Transition MatrixMarkov Transition Matrix
This indicator classifies higher-timeframe returns into three states and then tracks how often price transitions from one state to the next.
The three states are:
Bullish when the N-bar return is above the selected positive threshold
Bearish when the N-bar return is below the selected negative threshold
Neutral when the return stays between those thresholds
The result is a 3x3 transition matrix that answers questions such as:
After a bullish state, how often does the next state stay bullish?
After a neutral state, how often does the next state turn bearish?
Which current state has the strongest tendency to persist or reverse?
How It Works
Choose an analysis timeframe.
Choose a lookback window in candles.
For each completed bar in that timeframe, the script computes the return from close to the current close.
That return is classified as Bullish, Neutral, or Bearish using the threshold input.
Each one-step transition from the previous state to the new state is added to the cumulative matrix.
What The Table Shows
The main value in each cell is the one-step transition probability for that row and column.
The detail row under each cell shows P^2, P^3, and the raw transition count.
The summary row shows the latest confirmed state plus the current row probabilities for Bullish, Neutral, and Bearish.
The bottom bar shows a simple directional bias: P(Bull) - P(Bear).
P^2 and P^3 in this script are powers of the one-step probability. They are not full 2-step or 3-step Markov-chain forecasts produced by matrix multiplication.
Inputs
Threshold (%) : Minimum absolute return needed to classify a bar as Bullish or Bearish.
Timeframe : Higher timeframe used for the transition analysis.
Lookback Window : Number of candles used to measure each return.
Table Position : Screen location of the matrix.
How To Read It
Diagonal cells show persistence. High values there mean a state often repeats.
Off-diagonal cells show transitions. High values there mean a state often rotates into another one.
A positive bottom-bar reading means Bullish transitions currently outweigh Bearish transitions from the latest confirmed state.
A negative bottom-bar reading means Bearish transitions currently outweigh Bullish transitions from the latest confirmed state.
Usage Notes
The chart timeframe must be less than or equal to the selected analysis timeframe.
The matrix is cumulative across all available history in the selected timeframe context.
Changing timeframe, threshold, or lookback recompiles the script and rebuilds the tally from scratch.
This is a state-transition study. It does not place trades or generate broker orders.
Practical Uses
Compare persistence vs reversal behavior across different symbols.
Test whether a market spends more time trending or mean-reverting at a chosen timeframe.
Check whether a recent state has historically led to bullish continuation, neutral drift, or bearish follow-through.
Indicatore

Price Density Clouds [EXCAVO]Continuous Kernel-Density Map of Where Price Has Actually Traded
The Price Density Clouds builds a smooth, continuous probability density of
price over a lookback window and paints it as gradient clouds directly behind
the candles. Dense, saturated clouds mark value zones - the equilibrium levels
where the market has spent the most time and where price tends to stall and
revert. Thin, transparent gaps mark inefficiency zones - levels price travels
through quickly. A dashed POC line marks the single highest-probability price,
and the Value Area High / Low bracket the core of the distribution.
This is not a bin-based volume profile. Instead of chopping price into discrete
buckets, KDE sums a smooth gaussian kernel around every price point, producing a
continuous density curve with no bin-edge artefacts. The bandwidth is set
automatically by Silverman's rule, so the smoothing adapts to the instrument's
own volatility.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ HOW TO USE
Step 1 → Add the indicator. Gradient clouds appear behind the candles
over the lookback window, brightest at the highest-probability
levels and fading out toward thin zones.
Step 2 → Read the clouds. Saturated bands = value / equilibrium where
price tends to stall and mean-revert. Faint gaps = inefficiency
where price moves fast - natural travel targets.
Step 3 → Use the POC. The dashed POC line is the single most-traded
level - a robust magnet and support / resistance anchor. Price
far from POC has a statistical pull back toward it.
Step 4 → Use the Value Area. The dotted Value Area High / Low bracket
the core of the distribution (default 70%). Acceptance inside the
area is balance; rejection outside it is imbalance worth trading.
Step 5 → Check the side profile. The gradient density profile on the
right of the last bar is the same density rotated 90 degrees - a
quick read of the full distribution shape at a glance.
Step 6 → Combine with structure. Clouds are context, not direction.
They pair well with trend, sweep, and breakout tools - a breakout
into a thin zone tends to run; a breakout into a dense zone tends
to stall.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ HOW IT CALCULATES
◆ Gaussian Kernel Density
Every close in the lookback window contributes a gaussian bell curve centred at
its own price. The curves are summed across the price range to produce a single
continuous density function: density(x) = sum over j of exp(-0.5 x ((x - price_j)
/ h)^2). Levels where many bars cluster get tall, overlapping kernels and a high
density; isolated levels get a low density.
◆ Silverman Bandwidth
The kernel width h controls smoothness. It is set automatically by Silverman's
rule of thumb: h = 1.06 x sigma x n^(-1/5), where sigma is the stdev of the
lookback prices and n is the sample size. The Bandwidth Multiplier input scales
this for sharper or smoother clouds. Auto-bandwidth means the same settings
adapt across instruments and timeframes.
◆ Normalisation and POC
The density is evaluated at Resolution levels between the lookback high and low,
then normalised so the peak equals 1.0. That peak level is the POC (Point of
Control) - the single highest-probability price. Cloud opacity and colour are
driven by each level's normalised density.
◆ Value Area
Starting at the POC, the algorithm expands outward, each step absorbing the
denser of the two neighbouring levels, until the enclosed density reaches the
Value Area % of the total (default 70). The price extent reached becomes the
Value Area High and Low.
◆ Gradient Rendering
Each density band of the cloud is drawn as a horizontal box tinted by a
two-colour gradient: the Low Density Color at thin levels through to the High
Density Color at the POC, with opacity ramping in parallel. Adjacent bands tile
continuously, so the cloud reads as a smooth heat-map rather than discrete
blocks. The same gradient drives the right-side density profile, whose width
per level scales with density - at the default resolution the edge reads as a
near-smooth wave while keeping the per-level gradient colour.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ WHAT MAKES IT DIFFERENT
◆ Continuous Density, Not Bins
Standard volume / price profiles split price into discrete bins, so the result
depends heavily on bin size and shows hard edges. KDE produces a smooth
continuous curve - no bin-edge artefacts, no arbitrary bucket count, just the
true shape of where price has traded.
◆ Auto-Adaptive Bandwidth
Silverman's rule sizes the smoothing from the instrument's own volatility and
sample size. The clouds stay meaningful on BTC, EURUSD, gold or an index with
the same default settings.
◆ Value Structure In One View
POC, Value Area High / Low and the full density shape are all on the chart at
once, with a matching side profile - the complete market-profile read without a
separate pane or a session reset.
◆ Premium Gradient Visual
A smooth two-colour density gradient behind the candles with parallel opacity
ramp, a clean dashed POC, dotted value-area lines, and a right-side profile
histogram. The clouds sit behind price as context and never clutter the read.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ DASHBOARD
Real-time panel (top right) with the current value read:
POC - price of the highest-density level
Value Area High - upper bound of the value area
Value Area Low - lower bound of the value area
Price Zone - whether price is Above Value, In Value, or Below Value
Lookback - bars used to build the distribution
Legend table (bottom left) explains every colour. Both panels toggle in the
Dashboard settings.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
▸ SETTINGS
Engine
Lookback Period - 200 (bars used to build the price distribution)
Resolution - 120 (number of horizontal density bands; higher = smoother gradient and profile edge, up to 200)
Bandwidth Multiplier - 1.0 (smoothness; 1.0 = Silverman auto, higher = broader clouds)
Value Area % - 70 (percentage of total density that defines the value area)
Visualization
Low Density Color - blue (thin / inefficiency end of the gradient)
High Density Color - orange (dense / value end of the gradient)
POC Line Color - near-white (high contrast against the dense orange cloud the POC sits in)
Min Cloud Opacity - 8 (opacity of the lowest-density band; keeps empty zones faint)
Max Cloud Opacity - 65 (opacity of the POC band)
Show POC Line - ON
Show Value Area - ON (dotted Value Area High / Low lines)
Value Area Highlight - ON (boosts band opacity inside the value area so the 70% core pops)
Show Side Profile - ON
Profile Outline - ON (thin bright line tracing the right edge of the profile for a crisp silhouette)
Cloud Forward Extend - 10 (bars the clouds extend right of the last bar)
Dashboard
Show Dashboard - ON
Dashboard Position - Top Right
Show Legend - ON
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Best regards,
EXCAVO
Disclaimer
Trading involves significant risk. This indicator is a technical analysis tool
and does not constitute financial advice, investment recommendations, or a
guarantee of future results. Past indicator behavior does not guarantee future
performance. Always use proper risk management and your own judgment.
Indicatore

Candle Streak StatisticsCandle Streak Statistics
What it does
This indicator counts every consecutive run of up-candles and down-candles in the chart's full history, then tells you how unusual the current run is compared to all the runs that came before it. Think of it as a "thermometer" that shows whether the market is in a perfectly normal streak or in territory it rarely visits.
Why it exists
I often ask myself: "Eight green candles in a row. Is that a lot?"
What you'll see
A compact stats table (position and size are configurable) showing, separately for up-streaks and down-streaks:
n: how many completed streaks were observed
Current run: length of the streak in progress
Pct rank: where the current run sits in the historical distribution (0% = shorter than everything, 100% = longest ever)
P(+1 more): historical probability that a streak which reached the current length extended by at least one more bar
Mean, Stdev, Median: central-tendency stats
p75 / p90 / p95: upper-percentile streak lengths
Mode: most common streak length (usually 1)
Optionally, a floating label above the last candle draws a 10-segment █/░ bar (the "thermometer" — for an at-a-glance read on rarity.)
How to read it
Pct rank ≥ 90% with low P(+1 more) → the current streak is in the rare-air zone and historically rarely extends further. Mean-reversion is statistically likely.
Pct rank mid-range with P(+1 more) ≥ 50% → nothing unusual; trend has room to continue.
Up vs. Down asymmetry → on equities, up-streaks typically have longer tails than down-streaks. Watching this gap shift can flag regime changes.
Design choices worth knowing
Doji handling: by default, exactly equal close == open bars are ignored (they don't break a streak). Adjustable via a tolerance input if you want to treat tiny-bodied candles the same way.
The live unfinished streak is excluded from the distribution by default. Including a still-in-progress run biases percentiles downward (it's censored data). A toggle lets you override.
Sample-size warning: if a direction has fewer than N completed streaks (default 20), its column gets a ⚠ marker. Don't trust statistics built on too little data.
Built on confirmed bars only. The distribution doesn't churn on every realtime tick.
Customization
Every visible element has a clearly labeled input: table position (9 anchor points), text size, all colors (text, neutral cell, up/down highlight, header), highlight transparency, and thermometer label colors. Defaults are tuned for light-themed charts.
Alerts
"Up streak ≥ p90": current up-run has entered the top 10% of history
"Down streak ≥ p90": current down-run has entered the top 10% of history
Best paired with
Any trend-following or stop-loss indicator. The combination of "my trailing stop says still hold" + "this streak is at p95 with a 15% continuation probability" is more informative than either signal alone. Use it as a sanity check on overextended moves.
Limitations
Streak-length distributions are roughly geometric. The mode is almost always 1, so I don't even know why I put it there. Don't lean on it.
Small samples (intraday timeframes on short chart histories) produce noisy upper-percentile estimates. Watch the n column.
Continuation probability is purely historical; it makes no claim about regime stability going forward. Statistics describe the past. Indicatore

Indicatore

Indicatore

Indicatore

Indicatore

Bang! Bang! - Candle AnomaliesBang! Bang! — Candle Anomalies
Overview
Bang! Bang! is a volume-anomaly detector. It flags bars where volume looks unusual against its recent neighbors and tags each anomaly with a direction (buy or sell), a tier (Bang! for notable, Bang! Bang! for extreme), and a placement on the chart that reflects where the activity actually concentrated.
Two independent detection pipelines can run side by side. Each one decides for itself when to fire, picks its own engine (bar-level or sub-bar level), and uses its own statistical threshold method. You can run both pipelines together for confluence, or just one for a cleaner chart. The indicator works on any chart type — time-based, Renko, Range, Point & Figure, Kagi, and Line Break — with intelligent fallback when a particular engine isn't available for the chart you're on.
Features
Two detection engines (picked per baseline mode):
- Intensity Engine (default) — bar-level volume analysis. Works on any chart type. A Volume Basis input lets you pick plain `volume` or `volume / bar duration` (a volume rate that respects how urgently a bar formed). The plain-volume basis turns this into a pure volume-anomaly detector; the rate basis is what makes the engine meaningful on non-time-based charts where bar duration varies.
- Delta Engine — sub-bar decomposition via lower-timeframe candles. Splits the chart bar's volume into buy-side and sell-side based on sub-bar direction, and places the dot at the highest-volume sub-bar's hl2 (so the mark lands where the activity actually concentrated within the bar). Time-based charts only; on Renko, Range, P&F, Kagi, and Line Break it silently falls back to Intensity.
*Note on the Lower Timeframe input:* the default is 1 minute, which works on every TradingView plan. If you have a Premium account, dropping the Lower Timeframe to a seconds-based value like 5S gives much finer sub-bar resolution and noticeably sharper direction and placement attribution from the Delta Engine.
Three threshold methods (picked per baseline mode):
- Sigma (default) — mean + N × stdev. The classical mean + standard deviation model.
- MAD — median + N × MAD × 1.4826. Robust to outliers, since the events being detected don't contaminate the baseline.
- Percentile — top X% of the rolling window. Distribution-agnostic and well-suited to heavy-tailed volume data.
Two independent baseline modes (both enabled by default):
- Unified Baseline — one rolling baseline on the full magnitude signal, with direction tagged separately. Best when you want a single, robust "this bar is unusual" call.
- Parallel Baseline — two rolling baselines, one for buy-side magnitude and one for sell-side. The side whose magnitude jumps gets the dot. Surfaces cases where one side of the flow becomes unusual independently of the other.
Each mode has its own Engine, Threshold Method, and Volume Basis, so you can configure them differently in the same chart (e.g., Unified on Sigma + Intensity for a stable baseline, Parallel on Percentile + Delta for sub-bar attribution).
Shooting Blanks overlay (Delta Engine only) — a small yellow dot when a Bang! or Bang! Bang! Delta dot fires AND the bar closes against its sub-bar flow direction. A "where did all that flow go?" tell that highlights bars where the heavy side of the sub-bar flow didn't carry the close — useful for spotting absorption-like patterns, late-bar reversals, and liquidity events.
Per-mode color customization — 14 user-configurable color slots across four groups (Unified Intensity, Unified Delta, Parallel Intensity, Parallel Delta), so each mode/engine combination can be styled independently. The Delta gradient is a five-step scale (Heavy Buyers → Light Buyers → Balanced → Light Sellers → Heavy Sellers) so dot color encodes conviction.
18 alert conditions — 9 per baseline mode, suffixed `(Unified)` or `(Parallel)` so per-mode firings stay unambiguous: `Bang!`, `Bang! Bang!`, `Bang! Buy`, `Bang! Sell`, `Bang! Bang! Buy`, `Bang! Bang! Sell`, `Bang! Bang! Balanced`, `Shooting Blanks (Buyers Failed)`, `Shooting Blanks (Sellers Failed)`.
Sensible, conservative defaults — Sensitivity = 6.0 and Tier Spacing = 2.0 by default, so Bang! fires at 6σ and Bang! Bang! at 8σ above the rolling mean. Tuned for the strongest anomalies only; turn them down for more frequent signals.
Visuals
The indicator plots up to three types of marks per bar:
Triangles — Unified Baseline
- **Triangle Up** appears below the bar when the magnitude jumped on a buy-direction bar.
- **Triangle Down** appears above the bar when the magnitude jumped on a sell-direction bar.
- **Size** encodes the tier — small triangle for Bang!, slightly larger triangle for Bang! Bang!.
- **Color** comes from the Unified color inputs (default 80% opacity so the smaller triangles read clearly).
Circles — Parallel Baseline
- A circle is placed at the bar's hl2 (Intensity Engine) or at the highest-volume sub-bar's hl2 (Delta Engine).
- **Size** encodes the tier — normal circle for Bang!, large circle for Bang! Bang!.
- **Color** comes from the Parallel color inputs (default 50% opacity).
When the **Delta Engine** is active in either mode, dot color also encodes sub-bar flow direction via a five-step gradient:
- **Heavy Buyers** — strongly buy-dominated sub-bar flow
- **Light Buyers** — moderately buy-leaning
- **Balanced** — roughly balanced buy/sell sub-bars (the neutral-grey middle of the gradient)
- **Light Sellers** — moderately sell-leaning
- **Heavy Sellers** — strongly sell-dominated
Shooting Blanks yellow dot
- A small yellow circle at the highest-volume sub-bar's hl2 when the Delta engine fires AND the close direction contradicts the sub-bar flow direction.
- Renders on top of any main dot sharing the same location, so the divergence reads at a glance.
- One shared dot per qualifying bar regardless of how many baseline modes detected the anomaly.
When both baseline modes fire on the same bar — Unified detecting a magnitude jump and Parallel detecting a side-specific jump — you'll see both marks together: a triangle outside the bar plus a circle inside it. Two independent confirmations from two different baseline approaches.
---
*Inspired by @colacorn's "Big Trades Whale Detector" — full credit for the core concept of statistical volume-anomaly detection on candle bars.*
Indicatore

Indicatore

Indicatore

SessionStack Pro 24h MarketMap for ESSession Highlighter + Key Levels — All-in-One 24h Trading Reference
This indicator consolidates everything a 24h futures trader needs into a single overlay — session context, key price levels, VWAP reference, and an overnight inventory bias estimate.
Sessions (background highlights)
Visualizes all major global trading sessions with configurable colors and transparency: Full Asia (23:00–08:00 GMT), Tokyo (00:00–06:00 GMT), HK/Singapore (01:00–09:00 GMT), Frankfurt (07:00–15:30 GMT), London (08:00–16:30 GMT), London/NY Overlap (dynamically computed — 1h in winter, 2h in summer due to DST), US AM and US PM windows (configurable 1h or 1.5h). All GMT-anchored sessions are DST-immune. US sessions use America/New_York timezone and adjust automatically twice a year.
Key Price Levels
PMH/PML — Premarket High/Low (04:00–09:30 ET), line anchored to the exact bar where the extreme was set
YH/YL — Yesterday's RTH High/Low, drawn at next session open
GH/GL — Globex High/Low (18:00–09:30 ET), anchored to the extreme bar
SH/SL — Live session High/Low, single label that moves as new extremes are set
MO — Midnight Open (00:00 ET), ICT-style daily bias reference
ORB H/L — Opening Range Breakout (configurable 5/15/30 min), with range box
VWAP (three anchors)
Globex VWAP — resets at 18:00 ET, runs full 24h cycle, primary reference
RTH VWAP — resets at 09:30 ET, visible only during regular session
Premarket VWAP — resets at 04:00 ET, visible only during premarket window
Overnight Inventory Bias Table
A real-time table estimating the directional skew of overnight participants using Globex VWAP as fair value anchor and ±1 standard deviation bands as a Value Area High/Low proxy (approximating the 70% value area concept from volume profile theory). Displays: directional bias (LONG/SHORT), value area position (IN VALUE / ABOVE VAH / BELOW VAL), estimated % of overnight range in profit, distance from Globex VWAP in points, and the ±1SD width for context. This is a heuristic approximation — it does not use tick-by-tick order flow data, but provides a statistically grounded directional reference updated on every bar.
Settings
All sessions, levels, and VWAPs are individually toggleable. Colors, transparency, line width, ORB window, US AM/PM duration, and table position are fully configurable.
Designed for: ES, NQ, MES, MNQ futures and any instrument with meaningful overnight sessions. Works on any intraday timeframe (1m–4h recommended). Indicatore

SpxSnipper - Chart Stock vs Sector RS DashboardSpxSnipper - Chart Stock vs Sector RS Dashboard
This indicator displays a compact relative strength dashboard that compares the current chart symbol against a selected sector ETF.
The stock symbol is detected automatically from the active chart, so users only need to select the relevant sector ETF. SPY is used as the default benchmark for sector-level relative strength.
The dashboard is designed to help answer two practical questions:
1. Is the stock outperforming or underperforming its sector?
2. Is the selected sector outperforming or underperforming SPY?
Main features:
• Automatically uses the current chart symbol as the stock
• User-selected sector ETF
• SPY benchmark comparison
• 6-month, 3-month, and 1-month performance
• Stock relative strength versus sector
• Sector relative strength versus SPY
• Weighted RS Score
• RS Trend status
• Compact table format
Performance periods:
The dashboard calculates performance over three configurable lookback periods:
• 6M
• 3M
• 1M
By default, these are approximated using trading days:
• 6M = 126 trading days
• 3M = 63 trading days
• 1M = 21 trading days
Stock vs Sector:
This row compares the stock’s return to the selected sector ETF.
Formula:
Stock Relative Return = Stock Return - Sector ETF Return
A positive value means the stock outperformed its sector during that period.
A negative value means the stock underperformed its sector during that period.
Sector vs SPY:
This row compares the selected sector ETF to SPY.
Formula:
Sector Relative Return = Sector ETF Return - SPY Return
A positive value means the sector outperformed SPY.
A negative value means the sector underperformed SPY.
RS Score:
The RS Score is a weighted relative strength score. It combines the 6M, 3M, and 1M relative returns into one number, with more weight given to recent performance.
Formula:
RS Score =
Relative 6M × 20%
+ Relative 3M × 30%
+ Relative 1M × 50%
For the stock, the RS Score is calculated versus the selected sector ETF.
For the sector, the RS Score is calculated versus SPY.
A positive RS Score indicates weighted outperformance.
A negative RS Score indicates weighted underperformance.
RS Trend:
RS Trend evaluates whether relative strength is improving, weakening, or mixed across the three timeframes.
The logic is:
RS ↑:
Relative strength is improving from 6M to 3M to 1M.
Rel 1M > Rel 3M > Rel 6M
RS ↓:
Relative strength is weakening from 6M to 3M to 1M.
Rel 1M < Rel 3M < Rel 6M
Mixed:
There is no clear sequential improvement or deterioration.
Suggested interpretation:
• Positive Sector RS Score or RS ↑ may indicate that the sector is showing relative strength versus SPY.
• Positive Stock RS Score or RS ↑ may indicate that the stock is showing relative strength versus its sector.
• A strong stock inside a strong sector may be useful for watchlist building and relative strength analysis.
• A stock can rise in absolute terms but still underperform its sector, which this dashboard helps identify.
Customization:
Users can adjust:
• Sector ETF
• Benchmark symbol
• 6M / 3M / 1M lookback periods
• Table position
Important note:
This dashboard is intended for relative strength analysis, sector comparison, and market research. It does not generate buy or sell signals and should not be used as a standalone trading system.
This script is for educational and analytical purposes only and does not provide financial advice. Indicatore

Libreria

Heikin Ashi Cloud Overlay | Rainbow MatrixGENERAL OVERVIEW
The Heikin Ashi Cloud Overlay renders a Heikin Ashi cloud directly on top of traditional candlesticks, giving traders both views in a single chart. HA candles smooth macro trend perception by filtering individual-bar noise, but they sacrifice entry-bar precision because each HA candle does not represent the actual price range traded on that bar. This script preserves both signals simultaneously: the HA cloud surfaces directional context, while the underlying real candles preserve precise execution-bar timing.
A compact corner HUD reports current HA direction, consecutive streak length, and body-size anomalies relative to a 20-bar rolling average — useful for monitoring momentum exhaustion and impulsive expansion in real time without analyzing the cloud manually.
The script adds a visual intelligence layer on top of the standard HA pattern: cloud fill opacity dynamically reflects body intensity (impulsive bars render densely opaque, normal bars render lightly), and small colored dots flag body anomalies (current body > 3× rolling average) directly on the chart.
WHAT IS THE THEORY BEHIND THIS INDICATOR?
Heikin Ashi candles are derived from traditional OHLC via a recursive smoothing formula introduced by Munehisa Homma in 18th-century Japanese rice trading and popularized in modern Western technical analysis through the work of Dan Valcu and others. The transformation produces candles that emphasize trend persistence over discrete price action: consecutive same-color HA candles indicate ongoing directional pressure, while doji-like HA candles or sudden color flips often signal pivots.
The trade-off is well-known: HA candles do not show real OHLC. The haOpen of each candle is the average of the previous haOpen and haClose, not the actual session open. This makes HA excellent for trend reading but unreliable for entry timing — orders need to reference the actual price range of the bar, not the smoothed projection.
The conventional solutions are either to switch back and forth between HA and regular candle views (cognitive overhead), or to use HA as the primary chart and lose precision on entries (execution cost). This indicator takes a third approach: render the HA candles as a transparent overlay envelope on top of the standard candlesticks. The trader sees both at once. The HA envelope communicates trend context; the underlying candles preserve real-bar precision.
The state machine layered on top — direction tracking, streak counting, and body-size anomaly detection against a rolling average — converts the visual cloud into a numerical readout, surfacing exhaustion and impulsive moves that might be missed at a glance.
HA CLOUD OVERLAY FEATURES
The indicator includes 5 main components:
Heikin Ashi Cloud Overlay
Body Intensity Modulation (dynamic opacity)
Body Anomaly Visual Markers
HA State HUD Panel
Three Optional Alerts
HEIKIN ASHI CLOUD OVERLAY
🔹 What It Does
For each bar on the chart, the indicator computes the four Heikin Ashi values (haOpen, haClose, haHigh, haLow) using Pine Script's canonical recursive formula. It then renders a thin envelope between haHigh and haLow with semi-transparent fill, plotted on top of the underlying traditional candles.
🔹 Method
The computation follows the standard HA definition:
◇ haClose = (open + high + low + close) / 4
◇ haOpen = average of the previous haOpen and the previous haClose (recursive)
◇ haHigh = max of (high, haOpen, haClose)
◇ haLow = min of (low, haOpen, haClose)
A `var float ha_open = na` seed pattern handles the first-bar initialization safely, avoiding NA propagation that would corrupt the recursive chain.
🔹 Visual Behavior
The envelope is rendered as a thin top-bottom band with translucent fill. The fill color reflects the HA direction: bullish (haClose ≥ haOpen) renders in the configured bull color (TradingView native teal by default); bearish (haClose < haOpen) renders in the bear color (TradingView native red by default). An optional midline (dotted) at the (haOpen + haClose) / 2 level can be toggled for traders who prefer an explicit midpoint reference.
BODY INTENSITY MODULATION
🔹 What It Does
The cloud fill transparency is dynamically modulated based on the current HA body size relative to the 20-bar rolling average. Bars with above-average body push the fill toward more opaque, surfacing impulsive expansion clusters visually without requiring HUD analysis.
🔹 Tier Logic
◇ Body < 1× average: standard transparency (user-configured slider value)
◇ Body 1-2× average: −10 transparency (notable bar — slightly more opaque)
◇ Body 2-3× average: −30 transparency (strong bar — clearly more opaque)
◇ Body ≥ 3× average: −50 transparency, floor 20 (anomaly — densely opaque)
The floor cap of 20 prevents the fill from becoming so opaque that the underlying candle wicks become unreadable, preserving the dual-view principle of the indicator.
🔹 Why It Helps
Body intensity modulation converts the cloud from a static color band into a momentum-aware visualization. During quiet conditions, the cloud whispers; during impulsive expansion or capitulation phases, the cloud intensifies visually. Traders monitoring multiple charts can identify regime changes peripherally without focusing on any single chart's HUD.
🔹 Toggle
The feature is enabled by default and can be disabled via the "Body Intensity Cloud Opacity" input in the HA CLOUD group, which restores fixed transparency from the slider.
BODY ANOMALY VISUAL MARKERS
🔹 What It Does
A small colored dot appears on the chart whenever the current HA body exceeds 3× the 20-bar rolling average. Bull anomalies render as a dot below the bar (location.belowbar); bear anomalies render as a dot above the bar (location.abovebar). Dot colors match the configured bull/bear palette.
🔹 Why It Helps
The markers convert the alert-only body anomaly detection into a persistent visual signal that remains visible on chart history. Traders reviewing past price action can identify impulsive expansion or capitulation events at a glance, without scrolling through alert history or replaying bars.
🔹 Independent of the Alert
The visual markers and the body anomaly alert are independently toggleable. Traders can show the markers without enabling the alert (visual-only mode) or enable the alert without showing the markers (sound/notification-only mode).
🔹 Toggle
Enabled by default via the "Show Body Anomaly Markers" input in the HA CLOUD group.
HA STATE HUD PANEL
🔹 What It Shows
A compact 4-row corner panel reports three live values:
◇ Direction — current HA candle direction (Bull / Bear), color-coded
◇ Streak — consecutive same-direction count (in current locale, e.g., "7 velas (candles)" in PT)
◇ Avg Body — the average HA body size over the last 20 bars, expressed as a percentage of price
🔹 Why It Helps
The HUD converts the cloud into a numerical readout. Instead of visually estimating streak length or body proportion, traders can read the exact values on each bar. This is particularly useful for traders monitoring multiple charts or running automated rules where consecutive-bar conditions need to be tracked precisely.
🔹 Customization
The HUD can be positioned in any of the four chart corners and rendered in any of five font sizes. The Direction row uses contrasting colors (bull vs bear) for immediate parsing.
THREE OPTIONAL ALERTS
🔹 Alert Types
Each alert is independently toggleable in the indicator settings:
◇ HA Direction Change — fires on the close of a confirmed bar when the HA direction flips (bull→bear or bear→bull). Useful as a confirmation filter on top of other entry signals.
◇ HA Streak Exhaustion — fires when the absolute streak length crosses a user-configurable threshold (default 7). Long consecutive streaks often precede mean-reversion phases, especially in ranging markets.
◇ HA Body Anomaly — fires when the current HA body exceeds 3× the 20-bar rolling average. Anomalous body sizes typically signal impulsive expansion, capitulation, or news-driven moves worth investigating.
🔹 Firing Mechanism
All alerts are gated by `barstate.isconfirmed`, which means they only trigger on the close of the bar that satisfies the condition — never intra-bar. This prevents false signals from intrabar fluctuations that get rejected before close. Each alert uses `alert.freq_once_per_bar` to avoid duplicate firings on the same candle.
🔹 alertcondition() Mode
A dummy `alertcondition` titled "HOW TO SETUP ALERTS (READ)" is exposed at the bottom of the script. It provides setup guidance via its message field, instructing users to select "Any alert() function call" in the TradingView alert condition menu and filter individual alerts via the indicator settings.
MULTILINGUAL INTERFACE
The indicator supports five languages for the HUD display and alert messages: English (default), Português, Español, Русский, and 中文 (Chinese). Code, comments, and configuration tooltips remain in English regardless of the selected language.
For reference, examples of multilingual UI strings used in the HUD:
◇ Direction labels: "Direction:" / "Direção:" / "Dirección:" / "Направление:" / "方向:"
◇ Direction text: "🟢 BULL"/"🔴 BEAR" / "🟢 ALTA"/"🔴 BAIXA" / "🟢 ALCISTA"/"🔴 BAJISTA" / "🟢 БЫЧИЙ"/"🔴 МЕДВЕЖИЙ" / "🟢 多头"/"🔴 空头"
◇ Streak units use a bilingual pattern: "candles" stays in English as a universal technical term; native terms appear in parentheses where the local equivalent is well-established (e.g., "7 velas (candles)").
CUSTOM PALETTE TOGGLE
🔹 What It Does
By default, the indicator uses native TradingView teal/red colors for visual familiarity. A "Use Custom Cloud Colors" toggle in the settings switches to user-configurable bull/bear colors, useful for traders who want to align the cloud palette with their personal indicator stack or color preferences.
HOW TO USE
This indicator is a visualization tool, not a signal generator. It surfaces three categories of structural information: HA direction (smoothed trend context), streak length (momentum persistence), and body anomalies (impulsive moves).
🔹 Reading the Cloud
◇ Bull cloud (default teal) = current HA candle is bullish (haClose ≥ haOpen).
◇ Bear cloud (default red) = current HA candle is bearish (haClose < haOpen).
◇ A long sequence of same-color HA candles indicates strong directional pressure; mixed colors or doji-like HA candles indicate consolidation or pivot zones.
◇ Cloud density (opacity): denser fills mark bars with above-average body — pay attention to these zones, they often correspond to ignition or capitulation phases.
◇ Anomaly dots: when a dot appears below a bull bar or above a bear bar, the bar's body is 3× the recent average — exceptional impulse worth contextualizing against your other signals.
🔹 Reading the HUD
◇ Direction row: parse the current HA candle's directional state at a glance.
◇ Streak row: |streak| ≥ 7 → trend is mature, increasing probability of mean reversion or pullback. Streak just flipped sign → fresh direction.
◇ Avg Body row: current bar body > 3× this value → impulsive expansion or capitulation, worth investigating contextually.
🔹 Tactical Reading
◇ HA color flip + confirmation on the underlying candle: potential trend reversal or pullback entry.
◇ HA streak crosses the exhaustion threshold while price approaches a key level (from another indicator or manual S/R): increased probability of structural reaction.
◇ Body anomaly during otherwise quiet conditions: impulsive move (often news-driven or stop-cascade) — trade with reduced size or wait for retest.
◇ Cluster of dense-opacity bars: regime change or ongoing impulsive move — momentum is structurally elevated.
🔹 Multi-Indicator Workflow
The HA Cloud Overlay is designed to layer cleanly with other indicators. It does not add lines or boxes that compete visually with structural indicators (VWAP, Volume Profile, S/R). The cloud sits behind the candles, the markers are minimal dots, and the HUD sits in a corner — total chart footprint is minimal.
INPUTS EXPLAINED
🔹 System Language
Display language for the HUD and alert messages. Options: English (default), Português, Español, Русский, 中文.
🔹 Show Cloud Envelope
Master toggle for the HA top-bottom envelope and fill.
🔹 Cloud Fill Transparency
Base alpha of the cloud fill (60 = denser, 95 = barely visible). Floor of 60 keeps candle wicks readable. Default 80. When Body Intensity Modulation is ON, this value is the baseline; bars with above-average body intensity become progressively more opaque from this baseline.
🔹 Show HA Midline (dots)
Optional thin dotted line at (haOpen + haClose) / 2.
🔹 Use Custom Cloud Colors
OFF: native TradingView teal/red. ON: apply custom bull/bear colors below.
🔹 Custom Bull Color / Custom Bear Color
Used when "Use Custom Cloud Colors" is ON.
🔹 Body Intensity Cloud Opacity
When ON: cloud fill becomes progressively more opaque on bars with above-average body size. When OFF: cloud uses fixed transparency from the slider above. Recommended ON.
🔹 Show Body Anomaly Markers
When ON: small colored dots appear on bars whose body exceeds 3× the 20-period average. Independent of the body anomaly alert.
🔹 Show HA State HUD
Toggle for the corner HUD reporting Direction / Streak / Avg Body.
🔹 HUD Position
Top Right (default), Top Left, Bottom Right, Bottom Left.
🔹 Font Size
Tiny, Small (default), Normal, Large, Huge.
🔹 Streak Warning Threshold
Streak length at which the Streak Exhaustion alert fires. Range 3–30, default 7.
🔹 Alert: HA Direction Change / HA Streak Extreme / HA Body Anomaly
Independent toggles for each of the three alert types.
IMPORTANT NOTES
The Heikin Ashi Cloud Overlay works on any timeframe and any instrument. The HA computation is timeframe-agnostic — it transforms whatever OHLC data the chart provides.
Alerts fire once per confirmed bar. Historical bars never repaint after they close. The live bar updates intra-bar as expected for a real-time indicator, but alerts will only fire after the bar closes. Body anomaly visual markers can update intra-bar (preview behavior) and settle on close.
The body anomaly threshold (3× rolling average) and streak warning threshold (default 7) are derived from empirical observation across common timeframes and instruments. Both are user-configurable and should be tuned to the trader's instrument and timeframe — high-volatility crypto on 1m may warrant a higher anomaly multiplier than large-cap equities on Daily.
The 20-bar body rolling average uses `ta.sma` of the percentage-based body size. The first 20 bars after script start will show partial values; once enough history is available, the value stabilizes.
The body intensity modulation tier floors (50, 30, 20) are calibrated to preserve candle wick readability even on extreme anomaly bars — the floor 20 ensures the cloud never becomes fully opaque.
Pine Script v6. Open-source under Mozilla Public License 2.0.
UNIQUENESS
The Heikin Ashi Cloud Overlay differs from the standard TradingView Heikin Ashi chart type and from other HA-based indicators in four structural ways.
First, it preserves both views simultaneously rather than replacing one with the other. Standard HA chart mode hides the real candles entirely; this overlay keeps the underlying candles visible at all times, giving traders smoothed trend context (the cloud) and precise entry-bar timing (the underlying candles) in the same visual without context-switching cost.
Second, the cloud fill opacity is dynamically modulated by body intensity relative to a 20-bar rolling average. Standard HA cloud indicators render fills with a single static transparency; this script renders impulsive bars (≥1×, ≥2×, ≥3× average body) with progressively more opaque fills, transforming the cloud from a static visualization into a momentum-aware density map. Capitulation, ignition, and impulsive expansion phases become visually identifiable peripheral signals.
Third, it adds an explicit state machine layer over the raw HA visualization. Direction tracking, consecutive streak counting, 20-bar rolling body-size anomaly detection, and on-chart visual anomaly markers convert the visual cloud into a numerical readout reported live on a corner HUD. This converts subjective visual estimation (is this a long streak? is this body unusually large?) into deterministic measurements with configurable thresholds and a persistent visual record on the chart history.
Fourth, it exposes three independently-toggleable alerts (direction change, streak exhaustion, body anomaly) gated by bar confirmation, making the indicator usable as a confirmation filter or trigger source in automated workflows. Most HA-based indicators are visualization-only or expose a single direction-flip alert; the multi-condition alert set here is designed for traders building structured rules around HA state rather than just observing it.
The combination of dual-view preservation, body-intensity opacity modulation, state machine readout, visual anomaly markers, and multilingual UI produces a single overlay that combines the readability of Heikin Ashi smoothing with the precision of real candles, the rigor of a deterministic state readout, and the visual intuition of a density-aware momentum map. Indicatore

Indicatore

Trading Rules ChecklistA simple and clean trade entry checklist for disciplined traders. The indicator displays a table with your trading rules — each rule can be toggled on or off directly from the settings. Once the required number of rules are met, the chart background turns green and the table shows "VSTUP" (Entry). If the conditions are not met, the background stays red showing "NEVSTUPUJ" (No Entry).
Features:
7 toggleable trading rules (default: VWAP, CVD, FIBO, Break, PDPOC, WPOC, POC)
Each rule can be renamed to match your own trading strategy
Configurable minimum number of rules required for entry (default: 3 out of 7)
Full-chart color background — green = entry confirmed, red = wait
Adjustable table position (4 corners of the chart)
Background colors fully customizable via the Style tab
How to use:
Before every trade, go through your checklist and toggle the rules that are currently met. The indicator will visually confirm whether you have enough confluences to enter the trade — helping you stay consistent and avoid impulsive decisions.
Works best with: VWAP, Volume Profile, CVD, Fibonacci retracements and trendline analysis. Indicatore

VIX Risk Territory + VIX Z-Score | Astral Vision VIX Risk Territory + VIX Z-Score | Astral Vision 🌠💠
This indicator plots the CBOE Volatility Index on any chart with two analytical modes: a raw VIX view that highlights when the index is in historically elevated territory, and a Z-Score normalized view that measures how statistically extreme the current VIX reading is relative to its own rolling history. The VIX measures the implied volatility of S&P 500 options over the next 30 days and is widely used as a proxy for market fear and risk appetite across all asset classes including Bitcoin, which historically peaks in volatility during the same macro stress events that drive the VIX higher.
Calculation ⚙️
The VIX is fetched from FRED on a daily timeframe. In Raw VIX mode, the index is plotted directly against a configurable overbought threshold, with a fill highlight when the VIX is above that level. The threshold default of 30 corresponds to the widely referenced boundary between normal market volatility and elevated fear regimes: VIX readings above 30 have historically coincided with financial stress events, equity drawdowns, and Bitcoin corrections.
In Z-Score mode, the VIX is normalized as: Z = (VIX - SMA(VIX, N)) / StDev(VIX, N), where N is a configurable rolling lookback window. This transforms the raw VIX level into a dimensionless measure of how far the current reading sits above or below its own historical mean in units of standard deviations. The Z-Score is more analytically useful than the raw level in two respects. First, the VIX has a secular baseline that shifts over time: a reading of 20 meant different things in 2007 versus 2017 versus 2022. The Z-Score adjusts for this drift by always measuring relative to the recent rolling distribution. Second, the Z-Score allows direct comparison of VIX extremes across different regimes: a +2σ reading is always a statistically rare event regardless of the absolute VIX level at the time.
Configurable overbought and oversold thresholds on the Z-Score identify statistically extreme fear and complacency readings. Elevated positive Z-Scores (VIX spiking far above its recent norm) have historically corresponded to capitulation events and macro bottoms. Negative Z-Scores (VIX compressed far below its norm) have historically corresponded to complacency phases that precede corrections.
Plots 📊
Raw VIX line with overbought threshold and fill when above threshold (Raw VIX mode)
Z-Score oscillator with overbought and oversold threshold lines and fill above the upper threshold (Z-Score mode)
Candle coloring or background color on the price chart reflecting current VIX regime, switchable between the two display styles
Inputs 🎛️
Mode: Raw VIX or Z-Score
OB Threshold (Candle): raw VIX level above which fear territory is signaled
OB Threshold (Z-Score): upper Z-Score extreme level
OS Threshold (Z-Score): lower Z-Score extreme level
Z-Score Length: rolling window for mean and standard deviation normalization
Chart Visualization: switch between candle coloring and background color on the price chart
Colors 🎨
5 Astral Vision presets + custom override plus a configurable neutral color. Default: Infinito.
Purpose 🎯
Most crypto-native indicators track on-chain or market structure data without any reference to the macro fear environment. The VIX provides a cross-asset context layer: Bitcoin's largest drawdowns have almost all occurred during periods of elevated macro fear that were visible in the VIX before or during the move. Adding VIX regime context to any Bitcoin chart allows traders to distinguish between Bitcoin-specific corrections and systemic risk-off events, which typically require different responses. The Z-Score mode further improves on the standard practice of using fixed VIX thresholds by adapting the extreme zone definition to the current volatility regime of the VIX itself.
Disclaimer ⭕️
This indicator is for informational and educational purposes only. It does not constitute financial advice. Past performance is not indicative of future results. Always do your own research before making investment decisions. Indicatore

Bitcoin Production Cost | Astral Vision Bitcoin Production Cost | Astral Vision 🌠💠
This indicator estimates the real-world cost of producing one Bitcoin by modeling the energy expenditure of the mining network from on-chain data, then divides by the daily coin issuance to express that cost in USD per BTC. The result is a fundamental price floor reference: sustained trading below the cost of production is historically short-lived because unprofitable miners shut down, reducing hash rate, reducing difficulty, and eventually restoring profitability for those who remain.
Calculation ⚙️
The hash rate is fetched from Glassnode in exahashes per second and converted to terahashes per second. The energy consumption of the network per day is then estimated as: kWh per day = hash rate (TH/s) × efficiency (J/TH) × 86,400 seconds per day / 3,600,000 joules per kWh. This converts the product of hash rate and energy per hash into kilowatt-hours of electricity consumed daily by the entire network.
The hardware efficiency parameter is set dynamically by era rather than using a single static value. Each major mining hardware generation is assigned an approximate efficiency in joules per terahash: 2,000 J/TH before 2014 (early GPU and first-generation ASICs), declining through 800, 500, 250, 100, 85, 55, 40, and 32 J/TH at successive epoch boundaries, with the user-configurable current efficiency applied to recent and future bars. This epoch-based schedule reflects the documented progression of ASIC hardware efficiency over Bitcoin's mining history.
The electricity price is similarly segmented by era, reflecting the documented geographic concentration of mining: a configurable pre-2019 rate for the early period, a lower configurable rate for the Chinese dominance era before the 2021 mining ban, and a configurable post-exodus rate for the current globally distributed mining landscape.
The daily BTC reward available to miners is computed as 144 blocks per day multiplied by the current block subsidy, derived from the block height using the halving schedule, plus daily transaction fees in BTC converted from the CoinMetrics USD fee data. This sum is smoothed with a 7-day SMA to reduce the noise from day-to-day block count variation.
The electricity cost per BTC is then: (kWh per day × electricity price) / daily reward in BTC. This represents what miners spend on electricity alone to produce one Bitcoin. The total production cost divides the electricity cost by the electricity percentage of total costs (default 60% based on CBECI methodology), adding the implicit cost of hardware amortization, facilities, and operations.
The Miner Price is a separate reference: current Bitcoin price plus the USD value of transaction fees per BTC, representing the effective revenue miners receive for each coin equivalent produced. When Miner Price exceeds Total Cost, mining is profitable; when it falls below, miners are operating at a loss.
Plots 📊
Electricity Cost per BTC with glow effect (toggleable)
Total Production Cost per BTC with glow effect (toggleable)
Miner Price with glow effect (toggleable)
Fill between Electricity Cost and Total Cost
Information table with current values for all key metrics: electricity cost, total cost, miner price, BTC price, price-to-total-cost ratio, efficiency, electricity rate, electricity percentage, and block subsidy
Inputs 🎛️
Electricity $/kWh for three historical eras: pre-June 2019, pre-May 2021, and post-May 2021
Electricity percentage of total costs: used to gross up electricity cost to total production cost
Efficiency J/TH: applied to recent and future bars, historical values are set automatically by epoch
Show Electricity Cost, Total Production Cost, Miner Price: individual toggles
Glow effect and info table toggles
Table position: four corner options
Colors 🎨
5 Astral Vision presets + custom override. Default: Infinito.
Purpose 🎯
Standard support and resistance tools are derived entirely from price history and have no connection to the economic reality of Bitcoin production. This indicator derives its reference levels from the physical cost of mining, making it independent of price action and structurally grounded in the economics of the network. The price-to-total-cost ratio in the table provides an immediate reading of how far current price sits above or below break-even for miners, which has historically been one of the most reliable macro cycle indicators available on-chain.
Disclaimer ⭕️
This indicator is for informational and educational purposes only. It does not constitute financial advice. Past performance is not indicative of future results. Always do your own research before making investment decisions. Indicatore

Miner Profitability Index | Astral Vision Miner Profitability Index | Astral Vision 🌠💠
This indicator constructs a measure of Bitcoin miner profitability per unit of mining difficulty, then applies Z-Score normalization in log space to quantify how statistically extreme current profitability conditions are relative to their own history. Miner profitability is a structurally important on-chain signal because miners are one of the few participants with predictable and measurable cost structures: when profitability collapses, miners are forced to sell reserves to cover operational costs, creating persistent sell pressure; when profitability is exceptionally high, miners tend to accumulate and expand capacity, which historically precedes periods of increased hash rate and eventually difficulty adjustment that compresses margins back toward equilibrium.
Calculation ⚙️
The daily miner revenue in USD is computed from three components: the number of blocks mined that day (computed as the difference between consecutive daily block height readings from Glassnode), the block subsidy in BTC (derived from the block height using the halving schedule: 50 BTC before block 210,000, halving at each subsequent 210,000-block interval), and the current Bitcoin price in USD. The formula is: miner revenue = blocks per day × block reward × BTC price.
This revenue figure is then divided by the current mining difficulty to produce the efficiency ratio: miner revenue / difficulty. Difficulty represents the computational work required to mine a block and serves as a proxy for the aggregate energy and capital expenditure of the mining network. Dividing revenue by difficulty produces a measure of how many dollars miners earn per unit of computational difficulty, normalizing for the expanding size of the mining network over time. Without this normalization, absolute revenue would grow indefinitely simply due to price appreciation and hash rate expansion, making historical comparisons meaningless.
The efficiency ratio is smoothed with a configurable EMA to reduce the noise introduced by day-to-day variation in block count. The natural logarithm is then taken before applying the Z-Score, which is necessary because the efficiency ratio follows an approximately log-normal distribution: in raw space it would be heavily right-skewed, making the standard deviation an unreliable measure of typical deviation. In log space the distribution is much more symmetric and the Z-Score thresholds carry consistent statistical meaning across all periods.
The Z-Score is computed as: (log(efficiency) - SMA(log(efficiency), N)) / StDev(log(efficiency), N), where N is the configurable lookback window. This expresses how many standard deviations the current log-efficiency sits above or below its rolling historical mean. Two pairs of thresholds define moderate and severe extreme zones on each side.
Plots 📊
Z-Score oscillator colored by zone: two upper levels and two lower levels with graduated opacity
Two upper and two lower threshold lines
Zero midline
Fill highlights when Z-Score is beyond the outer thresholds
Static zone fills between inner and outer thresholds on both sides
Background color on the price chart with four gradient levels reflecting zone severity
Inputs 🎛️
Z-Score Lookback: rolling window for mean and standard deviation normalization
Smoothing: EMA period applied to the raw efficiency ratio before log transformation
Upper Z 1 and Upper Z 2: configurable inner and outer upper threshold levels
Lower Z 1 and Lower Z 2: configurable inner and outer lower threshold levels
Colors 🎨
5 Astral Vision presets + custom override. Default: Futura.
Purpose 🎯
Standard miner revenue charts display absolute USD earnings, which grow indefinitely with price and provide no statistical context for whether current conditions are extreme or normal. Dividing by difficulty removes the network size effect, and normalizing with a Z-Score in log space makes readings directly comparable across all market cycles including early periods when absolute revenue was tiny. The dual threshold system separates mild deviations from statistically severe conditions, providing a more granular signal than a single overbought/oversold level.
Disclaimer ⭕️
This indicator is for informational and educational purposes only. It does not constitute financial advice. Past performance is not indicative of future results. Always do your own research before making investment decisions. Indicatore
