Indicator

VWAP Deviation Divergence OscillatorVWAP Deviation Divergence Oscillator
## Overview
The VWAP Deviation Divergence Oscillator turns the **deviation of price from its session-anchored Volume-Weighted Average Price (VWAP)** into a standardized, bounded oscillator, and then looks for **divergence between price and that deviation**. The idea it tests: when price makes a new extreme but sits less far from VWAP than before, the volume-weighted average is no longer confirming the move.
It is a single-pane oscillator. It requires real traded volume (use a futures contract; cash indices report none, in which case the dashboard shows "no volume"). Every data input is user-configurable, so it runs on any symbol that reports volume, in any market and on any timeframe. Defaults target NSE NIFTY index futures on intraday charts.
## What it plots
- A z-scored **VWAP deviation oscillator** (stretched above VWAP = up, stretched below = down), with a glow line and sigma-based overbought/oversold levels.
- **Extreme-zone bands** (default +/-3 sigma) with a gradient fill that deepens toward the edge.
- **Divergence lines and labels** on the oscillator - regular (reversal) and hidden (continuation), in two colors.
- **In-band reversal dots** where the oscillator turns inside an extreme zone.
- Optional **price-pane marks** at the confirmation bar (all generated by this one indicator).
- A **background-adaptive status dashboard** (oscillator value in sigma, zone, last divergence, last reversal, live distance to VWAP).
## Why these components are combined (mashup rationale)
This script combines a **derived measure**, a **normalization stage**, a **divergence engine** and a **reversal read**, because each answers a question the others cannot and none is useful here alone:
1. **VWAP deviation (price + volume).** VWAP is the volume-weighted "fair value" the session has actually transacted at - it blends price and traded volume, which a price-only oscillator does not. How far price sits from VWAP, in standardized terms, is a mean-reversion read: the deviation = price - session VWAP.
2. **Standardization (rolling z-score).** VWAP deviation differs in scale across instruments. The z-score expresses it in standard-deviation units, so "overbought/oversold" and the extreme bands mean the same thing on NIFTY, on a commodity future, or on a crypto instrument. Without this step the divergence thresholds would not transfer between symbols.
3. **Divergence engine.** The original payload is reading **price-versus-VWAP deviation disagreement at confirmed pivots**. The engine pairs each new price pivot with the oscillator value, then requires: a genuine new price extreme; the measure failing to confirm it; a minimum oscillator gap scaled to the oscillator own stdev; the two pivots within a maximum bar distance; and optionally an overbought/oversold reading at the pivot. These gates make the combination produce signal rather than noise.
4. **Reversal read.** Independently, the engine flags oscillator turns that occur inside the extreme bands - a complementary exhaustion cue.
Together the components form one pipeline: **build the signal -> make it comparable (z-score) -> surface where price and that signal disagree (divergence) and where it exhausts (reversal).** Each is incomplete alone.
## How it works (method)
deviation = price - session-anchored VWAP (which resets each session and requires real volume); this is standardized with a rolling z-score to the oscillator.
Regular and hidden divergence are detected from confirmed pivothigh/pivotlow pivots and filtered by the gates above; reversals are oscillator pivots that print inside the extreme bands. Pivots confirm a few bars after they occur, so a printed signal does not repaint. The confirmation lag equals the pivot length.
## How to use it
1. Add the indicator on a volume-bearing instrument (a futures contract); on a cash index it will read "no volume".
2. Read divergence as **context, not a trigger**: a bearish divergence (price higher high, deviation lower high) says price is less extended above VWAP than at the prior high; a bullish divergence says the opposite at lows. Confirm with your own structure, levels and risk process.
3. Tune the **pivot length**, **max gap** and **min oscillator gap** to your timeframe; raise them for fewer, cleaner signals.
## Originality
This is an original implementation - not a VWAP deviation line and not a generic divergence script, but the specific combination of VWAP deviation, sigma-standardization that makes the read portable across markets, a multi-gate divergence engine (magnitude + distance + extreme-zone), hidden-divergence and in-band reversal detection, and a background-adaptive dashboard. The code is written from scratch; helper functions use only their arguments and built-ins.
## Credits
The **Volume-Weighted Average Price (VWAP)** and **price/oscillator divergence** are standard, publicly documented techniques. This script is not affiliated with, nor endorsed by, any third party.
## Notes / limitations
- VWAP deviation needs real volume and is session-relative; it resets each session and is undefined without a volume feed.
- Divergence is descriptive context, never a guarantee of reversal.
- Confirmation lags each pivot by the pivot length.
## Disclaimer
Research and educational tool only. NOT financial advice and no guarantee of profitability or accuracy. Indicators describe past behaviour; they do not predict the future. Trading carries risk of loss. Test out-of-sample and make your own decisions. The author accepts no liability for any use of this script.
Indicator

Monthly Statistical LevelsMonthly Statistical Levels is an open-source indicator that plots monthly reference levels based on historical monthly price extensions from the monthly open.
The goal of the script is to provide a clean statistical map for the current and recent months. It is designed as a market structure and reference-level tool, not as a buy/sell signal system.
How it works
The script uses completed monthly candles from PulseWire data.
For each completed month, it calculates two historical extensions:
High extension:
Monthly High minus Monthly Open, divided by Monthly Open.
Low extension:
Monthly Open minus Monthly Low, divided by Monthly Open.
These historical extensions are stored separately for upside and downside movement.
At the start of each new month, the script uses the current monthly open and projects five reference levels:
Strong High
Avg High
Open
Avg Low
Strong Low
Avg High is based on the historical average upside extension from the monthly open.
Avg Low is based on the historical average downside extension from the monthly open.
Strong High uses the average upside extension plus a configurable standard deviation multiplier.
Strong Low uses the average downside extension plus a configurable standard deviation multiplier.
By default, the strong multiplier is set to 1.0, meaning strong levels use the historical average extension plus one standard deviation.
Lookback options
Users can choose the statistical lookback used for the calculations:
24 months
36 months
60 months
120 months
All available history
Using all available history can make the levels more stable, but it may also mix different market regimes. This is especially important for assets with structural changes, short trading histories, or very different behavior across cycles.
No lookahead logic
The indicator uses completed monthly candles to build the historical sample.
Each month keeps the levels calculated with the information available at the start of that month. The current month is used only for its monthly open, which is known once the month begins.
This means the levels are not recalculated using future monthly highs or lows.
How to use it
The levels can be used as a visual reference for monthly range structure.
Possible uses include:
Identifying where price is trading relative to its monthly statistical range.
Comparing the current month with recent monthly behavior.
Observing when price reaches average or stronger historical extension zones.
Keeping a cleaner chart with only the most recent visible months.
Main settings
Visible months:
Controls how many recent months are displayed. The default is 6 and the maximum is 12 to keep the chart readable.
Statistical lookback:
Controls the historical sample used to calculate average and strong levels.
Minimum closed months:
Defines the minimum number of completed monthly candles required before plotting levels.
Strong multiplier:
Controls how far strong levels are placed from average extension levels using standard deviation.
Labels:
Users can show labels only for the current month, for all visible months, or turn labels off.
Alerts
The script includes optional alert conditions for touches of:
Strong High
Avg High
Open
Avg Low
Strong Low
Limitations
This indicator does not predict future price movement.
It does not identify support or resistance with certainty.
It does not generate buy or sell signals.
It does not evaluate trend, fundamentals, macro conditions, liquidity, positioning, or news.
The levels depend on the PulseWire symbol selected, the available historical data, and the chosen lookback window.
Why it may be useful
Many traders look at monthly opens, monthly ranges, and volatility-based zones separately. This script combines those ideas into one clean open-source tool: monthly open-based statistical levels built from completed historical monthly extensions.
It helps traders visualize where price is trading relative to its own historical monthly behavior, while keeping the chart simple and readable. Indicator

Anchored VWAP Reversion ChannelAnchored VWAP Reversion Channel — Regime-Gated Fade Framework
## What this script does
This is an **analytical study** that frames mean-reversion ("fade") setups around an **anchored, volume-weighted regression channel**, then **gates** those setups by a statistical market-state test and **scores** them against their own forward outcomes. It does not place orders and it is not a signal service — its purpose is to let you see, on your own instrument and timeframe, whether fading a stretched move actually has an edge, instead of assuming it does.
It plots one channel (a centre line plus inner/outer residual-σ bands), marks fade setups at the outer band, draws supporting context (volume-profile POC / value area, untested prior-session POCs, momentum divergences, liquidity sweeps, and multi-timeframe trend lines), and reports a compact validation panel.
## Why these components are combined (mashup rationale)
Fading an extreme is really three separate questions, and no single classic indicator answers all three. Stacking look-alike indicators just echoes one input, so this tool deliberately combines **three non-redundant lenses and makes them check each other**:
1. **WHERE is price stretched?** — A **volume-weighted polynomial regression** anchored at the most recent swing pivot, with **residual-σ bands**. Because the curve tilts with the active leg, an outer-band tag stays meaningful even inside a trend, where a flat cumulative VWAP would not. A **volume profile** anchored to the *same* window supplies POC and value area, and prior-session POCs that have never since been traded through become **reversion targets**.
2. **Is a reversion actually firing here?** — Three orthogonal **tells** evaluated only at the band: a **close-back rejection**, a **band-confluent momentum divergence**, and an **equal-high/low liquidity sweep** (stop-run). Crucially, all three are derived from the same stretch, so their agreement is shrunk by a **design-effect correction** (effective-sample-size): three correlated echoes are not allowed to masquerade as three independent confirmations.
3. **Is the market in a reverting state at all?** — A **regime gate** combining a **variance-ratio test** and a **reversion-trust correlation** only lets a fade through when recent increments are offsetting (mean-reverting) rather than compounding (trending).
The pieces are not bolted together side by side: they share **one geometry** (the anchored channel) and **one volatility unit** (residual σ / ATR), and each can veto the others. A band tag with no tell does nothing; a tell with no reverting regime does nothing. The design goal is to **suppress** low-quality fades — into a trend, mid-range, or backed by a single echoed tell — more than to generate them.
## The honesty layer (what makes this more than a drawing)
Every fade that fires is logged and, a fixed horizon later, **resolved**: its forward return is measured in ATR units and tabulated **with the regime gate ON versus OFF**, reporting follow-through %, whipsaw %, a Wilson 95% confidence interval, and the **mean return per fade**. A per-fade series also exports to the Data Window so you can study the full return distribution offline. The gate has to **beat its own ungated baseline** to justify itself — the framework is built to be tested, not trusted blindly.
## How to use it
1. Set the **Price source** (group 01). It works on any symbol and any market; volume-based parts need a real volume feed.
2. A fade **arms** when price tags the outer band **and** at least one tell prints, then **passes** only if the regime gate reports a reverting state. Solid triangles are gated fades; the target is the centre line or the nearest untested POC.
3. Read the panel top-down: does **Gate ON** beat **Gate OFF** on both follow-through and mean R, with non-overlapping intervals and a reasonable sample size? If not, the edge is not present on this symbol/timeframe — change them rather than forcing the trade.
4. The signal lives on **higher intraday timeframes**; one-minute data is mostly noise.
## Defaults
Shipped tuned for **NSE:NIFTY** index futures on intraday timeframes (sources, pivot lengths, value-area %, and the Tuesday-style weekly session context reflect that instrument). Every value is exposed as an input — change the **Price source** and the relevant lengths to run the framework on any other instrument or market.
## What is original
The original work is the **coordination**, not any single formula: an anchored polynomial-regression channel used as a reversion frame, three decorrelated band tells fused by a design-effect shrink, a statistical regime gate, and a built-in A/B + forward-return validation harness — combined so each lens can veto the others and the whole thing reports its own hit rate. It is not a re-skin of one indicator.
## Concept credits (techniques are standard; this implementation is original)
Anchored VWAP (standard); volume-weighted least-squares / polynomial regression (standard); residual-σ channel (standard); Volume Profile, Value Area and POC — Market Profile, Steidlmayer / CBOT; Variance-Ratio test — Lo & MacKinlay (1988); design effect / effective sample size — Kish (1965); proportion confidence interval — Wilson (1927); ATR trailing stop / Supertrend (classic, used for the multi-timeframe context lines); RSI — Wilder; Stochastic — Lane.
## Disclaimer
For research and education only. This is an analytical study, **not** financial advice, **not** a recommendation, and **not** a guarantee of future results. All statistics shown are **in-sample** on loaded history, close-to-close, without costs or slippage — a study aid, not a backtest. Mean reversion fails in trends and through regime breaks. Do your own research and manage your own risk.
Indicator

Indicator

Hash Dispersion Cone## Overview
The **Hash Dispersion Cone** is a forward-projecting statistical probability envelope built on realized volatility. Anchored to the current bar's close price, it projects where price is statistically expected to trade over the next N bars using log-normal volatility scaling — the same mathematical framework used by professional options desks and quantitative risk managers.
This is not a buy/sell signal generator. It is a **probability map** — a live, continuously recalculating field that shows the market's statistical boundaries given current realized volatility. When volatility is low, the cone is tight. When volatility is expanding, the cone widens in real time.
> *"Know your range before the market shows it to you."*
> — Hash Capital Research
---
## How It Works
### The Mathematics
The cone is constructed using the **square-root-of-time rule**, a foundational principle of financial mathematics. At each forward bar `t`, the projected price boundaries are calculated as:
```
Upper_k(t) = AnchorPrice × exp( +k × σ × √t )
Lower_k(t) = AnchorPrice × exp( −k × σ × √t )
```
Where:
- `k` = standard deviation multiplier (1 for 1σ, 2 for 2σ)
- `σ` = realized volatility per bar (selected method)
- `t` = number of bars forward
Using the **log-normal form** is intentional and correct. It keeps the cone asymmetric in price space — the upside boundary is always further from anchor than the downside boundary by an equal percentage amount. This reflects how asset prices actually behave: they cannot go below zero, but can theoretically rise without limit.
### Why the Cone Moves With Price
The cone repaints every bar because it is always anchored to the **current close**. This is by design. It answers the question: *"Given what volatility is right now, where could price go from here?"* — not where it could have gone from a past bar.
---
## Volatility Methods
Three realized volatility estimators are available. Each has distinct statistical properties suited to different market conditions.
### Close-to-Close (Default)
The standard log-return standard deviation:
```
σ = stdev( ln(Close / Close ), lookback )
```
Most widely understood. Can underestimate volatility on assets that gap frequently or have large intrabar swings. Best for: **daily timeframes, equities, stable assets**.
### Parkinson (High-Low)
Uses the high-low range instead of close-to-close returns:
```
σ² = mean / (4 × ln2)
```
Approximately **5x more statistically efficient** than Close-to-Close for the same lookback period. Captures intrabar volatility that close-to-close misses. Best for: **crypto, commodities, FX — any asset with large intrabar ranges**.
### Garman-Klass (OHLC)
The most efficient of the three estimators, using all four price points:
```
σ² = mean
```
Most accurate for intraday analysis where the open-to-close gap carries information. Best for: **intraday timeframes (1H, 4H), equities with significant opening gaps**.
---
## Inputs Reference
### Volatility Calculation
| Input | Default | Description |
|---|---|---|
| Lookback Period | 30 | Bars used to calculate σ. Lower = more reactive. Higher = smoother. |
| Volatility Method | Close-to-Close | Estimator used. See Volatility Methods above. |
| Vol Trend MA Length | 10 | SMA length applied to σ for regime classification. |
**Lookback Tuning Guide:**
- `10–20` bars → reactive, tracks recent volatility closely, cone resizes quickly
- `30` bars → balanced default, smooths out single-spike distortions
- `60–100` bars → slow-moving, regime-level volatility, stable cone width
### Projection
| Input | Default | Description |
|---|---|---|
| Forward Bars | 15 | How many bars ahead the cone projects. |
| Show 1σ Band | On | Displays ±1σ boundary (~68% probability zone). |
| Show 2σ Band | On | Displays ±2σ boundary (~95% probability zone). |
| Show Midline Anchor | On | Dotted horizontal line at anchor price. |
**Forward Bars Tuning Guide:**
- `5–10` bars → scalping and intraday setups
- `10–20` bars → swing trading (recommended for 4H/Daily)
- `20–50` bars → position trading and options expiry targeting
**Important:** Doubling forward bars does NOT double the projected range. Due to the √t rule, doubling projection bars widens the cone by only ~41%.
## Visual Guide
### Band Colors and Meaning
```
+2σ ──────────────────────────── Crimson solid (outer extreme, ~95%)
░░░░ TEAL FILL (upside risk zone) ░░░░
+1σ - - - - - - - - - - - - - - Green dashed (primary upside boundary, ~68%)
▓▓▓▓ NAVY FILL (highest-probability core) ▓▓▓▓
MID ····························· Grey dotted (anchor / flat scenario)
▓▓▓▓ NAVY FILL (highest-probability core) ▓▓▓▓
−1σ - - - - - - - - - - - - - - White dashed (primary downside boundary, ~68%)
░░░░ MAGENTA FILL (downside risk zone) ░░░░
−2σ ──────────────────────────── Crimson solid (outer extreme, ~95%)
```
### Three-Layer Fill System
**Navy Core (±1σ interior):** The highest-probability zone. Statistically, ~68% of all future closes are expected to land here. This is where price "wants" to stay in a low-volatility regime.
**Teal Upside Zone (+1σ to +2σ):** The upside risk corridor. Price entering this zone is statistically elevated — possible, but in the outer 14% of expected outcomes.
**Magenta Downside Zone (−1σ to −2σ):** The downside risk corridor. Mirror of the teal zone. Price here signals a statistically significant down-move.
---
## Trading Applications
### 1. Cone Width as Regime Filter
The most important signal is the **width of the cone itself**, not where price is within it.
- **Tight cone** = low volatility, compressed range → range-bound playbook (fade edges, mean revert to midline)
- **Wide cone** = high volatility, expanded range → momentum playbook (ride direction, wider stops)
Never take a counter-trend trade in a wide, expanding cone. Never chase a breakout in a tight, contracting cone.
### 2. Price at 1σ Edge = Mean Reversion Setup
When price reaches the projected +1σ or −1σ label price, it has statistically entered the outer 32% of expected outcomes.
**Setup:**
```
Condition 1: Vol Regime is STABLE (─)
Condition 2: Price has reached the ±1σ label level
Condition 3: Rejection candle confirms (wick, doji, engulf)
Entry: Fade the move back toward midline
Target: Anchor price (midline)
Stop: Just beyond the ±2σ label
R:R: Typically 2:1 to 3:1 depending on cone width
```
### 3. 2σ Touch = Extreme Signal
A touch of the ±2σ boundary represents a 2-standard-deviation move. Statistically, only ~5% of future closes are expected to exceed this level.
- In a **stable** or **contracting** regime: high-conviction mean reversion entry with defined risk to the 2σ line
- In an **expanding** regime: possible breakout continuation — wait for candle confirmation before fading
- Use the 2σ label price directly as a hard stop level for trades taken inside the cone
### 4. Vol Regime Arrow as Trade Filter
The regime classification in the dashboard acts as a meta-filter over all other signals.
- **▲ EXPANDING (red):** Do not counter-trend trade. Only take momentum entries in the direction of the move or stay flat. Cone edges are likely to be broken.
- **▼ CONTRACTING (green):** Volatility is compressing. A breakout is loading. Watch for the first expansion candle and trade the direction of the break. This is often the highest R:R setup the cone generates.
- **─ STABLE (white):** Range conditions active. Mean reversion setups at σ edges are highest probability in this state.
### 5. Stop Placement Reference
The σ label prices at the cone's right edge provide statistically-grounded stop levels:
- **Conservative stop:** Beyond ±2σ label (95% of moves contained)
- **Standard stop:** Beyond ±1σ label (68% of moves contained)
- **Tight stop:** A fixed percentage of the ±1σ distance
This gives every trade a volatility-adjusted stop rather than an arbitrary fixed-pip or percentage stop.
---
## Timeframe Recommendations
| Timeframe | Lookback | Forward Bars | Vol Method | Best Use |
|---|---|---|---|---|
| 5m / 15m | 20 | 10 | Garman-Klass | Scalping entries |
| 1H | 30 | 15 | Parkinson or GK | Intraday swing |
| 4H | 30 | 15 | Parkinson | Swing trading (default) |
| Daily | 30–50 | 20 | Close-to-Close | Position trading |
| Weekly | 20 | 10 | Close-to-Close | Macro range framing |
---
## Asset Class Notes
**Crypto (BTC, ETH, SOL, etc.):**
Parkinson is recommended over Close-to-Close due to large intrabar ranges common in 24/7 markets. Cone will be noticeably wider than equities at equivalent timeframes, reflecting structurally higher realized volatility. The 2σ touch setup is especially reliable on 4H BTC during STABLE regimes.
**FX:**
Parkinson works well. Forward Bars of 10–15 on 4H aligns well with typical intraweek swing durations. Cone width is generally tighter than crypto, making σ edge touches more frequent.
**Equities / Indices:**
Garman-Klass recommended for intraday. Close-to-Close is standard for daily and above. Be aware that equity close-to-close can underestimate true vol during earnings season — consider switching to Garman-Klass temporarily.
**Commodities:**
Parkinson preferred. Energy and agricultural commodities have gap and range behavior similar to crypto.
---
## Technical Notes
- The cone redraws on every bar close. It is anchored to the current close and always projects forward from the most recent confirmed price. This is expected behavior — not a repaint flaw.
- Fills are capped at 16 segments per zone to remain within Pine Script's linefill object limit (~50 total). At default 15 forward bars, all fills render completely.
- The annualization factor is automatically adjusted for timeframe: Daily (√252), Weekly (√52), Monthly (√12), and intrabar (derived from `timeframe.in_seconds()`).
- All price labels use comma-formatted output (e.g., `74,161.34`) for readability at large price scales.
---
## Disclaimer
The Hash Dispersion Cone is an educational and analytical tool. Statistical probability does not guarantee any specific price outcome. All trading involves risk. Past statistical behavior does not guarantee future results. This indicator does not constitute financial advice.
---
*Published on PulseWire by Hash Capital Research * Indicator

Adaptive Linear Regression Structure [MarkitTick]💡 This indicator, is a sophisticated analytical tool designed to bridge the gap between classical statistical modeling and modern price action theory. By leveraging high-performance Ordinary Least Squares (OLS) calculations, it dynamically identifies the most statistically significant market structures—specifically linear regression channels—based on historical pivot points. Unlike static channels that rely on arbitrary lookback periods, this script scans a historical "horizon" of structural pivots to find the model with the highest mathematical "fit," providing traders with a non-repainting, objective view of trend exhaustion and volatility boundaries.
✨ Originality and Utility
● Dynamic Model Selection
Most linear regression indicators require the user to manually define a start and end point, or they use a fixed lookback period. This script is original because it treats the starting point of the regression as a variable. It scans multiple historical pivots (Highs and Lows) and performs a competitive analysis between different potential channels. The channel that is eventually displayed is the one that achieves the highest performance score, calculated via a combination of the Coefficient of Determination ($R^2$) and the natural log of the duration. This ensures the channel is both mathematically reliable and structurally relevant.
● Market Structure Integration
The utility of the indicator is enhanced by its "Market Structure Registry." Instead of calculating regressions on every single bar blindly, the script identifies "Pivot Highs" and "Pivot Lows" to use as anchors. This aligns the statistical modeling with the way professional traders view the market, focusing on major turning points rather than noise.
● Institutional-Grade Telemetry
The inclusion of a real-time HUD (Heads-Up Display) dashboard provides traders with immediate transparency into the model's health. By displaying the $R^2$ value and Z-Score, the indicator moves beyond simple "lines on a chart" and offers a quantitative assessment of how well the current price action respects the established trend.
🔬 Methodology and Concepts
● The OLS Kernel
At the heart of the script is a custom-built OLS (Ordinary Least Squares) method. It calculates the slope ($\beta$) and the intercept ($\alpha$) of the best-fit line through the closing prices of the selected period. The mathematical goal is to minimize the sum of the squared errors ( LSE:SSE $), ensuring the median line represents the "true" equilibrium of price over that duration.
● Heuristic Performance Scoring
The indicator does not just look for the highest correlation. It uses a "Performance Score" heuristic:
Score = $R^2$ * ln(Duration)
This formula rewards models that maintain a high degree of linearity over longer periods. A short-term channel with a high $R^2$ might be dismissed in favor of a long-term channel that has a slightly lower $R^2$ but significantly more structural weight.
● Volatility-Adjusted Envelopes
The upper and lower boundaries are not arbitrary. They are calculated based on the standard deviation of the residuals (the distance between actual price and the regression line). By applying a user-defined "Deviation Factor," the script creates volatility bands that expand or contract based on how "noisy" the trend is.
🎨 Visual Guide
● The Regression Channel
• Median Vector: A solid line representing the linear mean of the current trend. It is colored Cyan for bullish slopes and Orange for bearish slopes.
• Volatility Bands: Two solid lines flanking the median. These represent the "Deviation Factor" boundaries (defaulting to 2.0 standard deviations).
• Fill Core: A transparent background fill between the upper and lower bands, allowing for easy visualization of the "fair value" zone. The color dynamically shifts between Cyan and Orange based on the trend bias.
● Signal Labels
• LONG Labels: Cyan labels appearing below price when a "Mean Reversion" setup is detected (price crossing above the lower band).
• SHORT Labels: Orange labels appearing above price when a "Mean Reversion" setup is detected (price crossing below the upper band).
• Details: Labels include the Entry Price (EP), Take Profit (TP) at the median, and a suggested Stop Loss (SL).
● Telemetry Dashboard (HUD)
• Model Quality (R²): A value between 0.0 and 1.0. Values above 0.7 indicate a very strong trend.
• Trend Bias: Explicitly states "BULLISH" or "BEARISH."
• Deviation (Z-Score): Measures how many standard deviations the current price is away from the mean.
• Duration: Displays how many bars the current model covers.
📖 How to Use
● Mean Reversion Strategy
The primary use case is identifying overextended price action. When price moves outside the volatility bands (high Z-Score) and then crosses back inside, it suggests a return to the median "equilibrium" price.
• Bullish Entry: Look for a Cyan "LONG" label when price recovers from the lower band.
• Bearish Entry: Look for an Orange "SHORT" label when price pulls back from the upper band.
● Trend Strength Assessment
Use the $R^2$ value in the dashboard to filter trades. If the $R^2$ is low (e.g., below 0.5), the market is in a "Random Walk" phase, and the regression lines may be less reliable. High $R^2$ values suggest a "Trending" phase where the channel boundaries act as significant support and resistance.
● Dynamic Take Profits
The median line (the Cyan/Orange vector) serves as a dynamic take-profit target. Since the line is based on a linear slope, the price target adjusts every bar to reflect the ongoing trend.
⚙️ Inputs and Settings
● Algorithmic Core
• Scan Horizon: Determines how many historical pivots the script should evaluate. A higher number increases the "search depth" but requires more processing.
• Deviation Factor: Controls the width of the channel. A value of 2.0 covers approximately 95% of price action if the distribution is normal.
• Structural Sensitivity: Controls the lookback for the Pivot High/Low detection. Smaller values find more "local" structures; higher values find "major" structures.
● Signal Processing
• Quality Threshold (R²): This is a "gatekeeper" setting. If no model reaches this minimum quality, the indicator will not display a channel, protecting the user from weak or chaotic patterns.
🔍 Deconstruction of the Underlying Scientific and Academic Framework
● Statistical Basis (OLS)
The indicator is grounded in the Gauss-Markov theorem. By calculating the slope via the covariance of time and price divided by the variance of time, it provides the "Best Linear Unbiased Estimator" (BLUE) of the current price trajectory.
● Information Theory & Heuristics
The scoring mechanism (using the natural log of N) draws inspiration from Information Criteria (like AIC or BIC). In statistical modeling, increasing the sample size ($N$) usually improves the model's reliability but can introduce "lag." By using the log of duration, the script balances the benefit of a larger sample size against the need for current relevance.
● Standardized Residuals (Z-Scores)
The "Z-Metric" displayed in the dashboard is a calculation of:
$Z = (Price - Estimated Price) / Standard Error$
This standardizes the distance of price from the mean across different assets and timeframes, allowing for a universal interpretation of "overbought" or "oversold" conditions based on the specific volatility of the current trend.
⚠️ 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. I 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. Indicator

ZVOL — Z-Score Volume Heatmapⓩ ZVOL transforms raw volume into a statistically calibrated heatmap using Z-score thresholds. Unlike classic volume indicators that rely on fixed MA comparisons, ZVOL calculates how many standard deviations each volume bar deviates from its mean. This makes the reading adaptive across timeframes and assets, in order to distinguish meaningful crowd behavior from random volatility.
📊 The core display is a five-zone histogram, each encoded by color and statistical depth. Optional background shading mirrors these zones across the entire pane, revealing subtle compression or structural rhythm shifts across time. By grounding the volume reading in volatility-adjusted context, ZVOL inhibits impulsive trading tactics by compelling the structure, not the sentiment, to dictate the signal.
🥵 Heatmap Coloration:
🌚 Suppressed volume — congestion, coiling phases
🩱 Stable flow — early trend or resting volume
🏀 High activity — emerging pressure
💔 Extreme — possible climax or institutional print
🎗️ A dynamic Fibonacci-based 21:34-period EMA ribbon overlays the histogram. The fill area inverts color on crossover, providing a real-time read on tempo, expansion, or divergence between price structure and crowd effort.
💡 LTF Usage Suggestions:
• Confirm breakout legs when orange or red zones align with range exits
• Fade overextended moves when red bars appear into resistance
• Watch for rising EMAs and orange volume to front-run impulsive moves
• Combine with volatility suppression (e.g. ATR) to catch compression → expansion transitions
🥂 Ideal Pairings:
• OBVX Conviction Bias — to confirm directional intent behind volume shifts
• SUPeR TReND 2.718 — for directional filters
• ATR Turbulence Ribbon — to detect compression phases
👥 The OBVX Conviction Bias adds a second dimension to ZVOL by revealing whether crowd effort is aligning with price direction or diverging beneath the surface. While ZVOL identifies statistical anomalies in raw volume, OBVX tracks directional commitment using cumulative volume and moving average cross logic. Use them together to spot fake-outs, anticipate structure-confirmed breakouts, or time pullbacks with volume-based conviction.
🔬 ZVOL isn’t just a volume filter — it’s a structural lens. It reveals when crowd effort is meaningful, when it's fading, and when something is about to shift. Designed for structure-aware traders who care about context, not noise. Indicator

Indicator

STANDARD DEVIATION INDICATOR BY WISE TRADERWISE TRADER STANDARD DEVIATION SETUP: The Ultimate Volatility and Trend Analysis Tool
Unlock the power of STANDARD DEVIATIONS like never before with the this indicator, a versatile and comprehensive tool designed for traders who seek deeper insights into market volatility, trend strength, and price action. This advanced indicator simultaneously plots three sets of customizable Deviations, each with unique settings for moving average types, standard deviations, and periods. Whether you’re a swing trader, day trader, or long-term investor, the STANDARD DEVIATION indicator provides a dynamic way to spot potential reversals, breakouts, and trend-following opportunities.
Key Features:
STANDARD DEVIATIONS Configuration : Monitor three different Bollinger Bands at the same time, allowing for multi-timeframe analysis within a single chart.
Customizable Moving Average Types: Choose from SMA, EMA, SMMA (RMA), WMA, and VWMA to calculate the basis of each band according to your preferred method.
Dynamic Standard Deviations: Set different standard deviation multipliers for each band to fine-tune sensitivity for various market conditions.
Visual Clarity: Color-coded bands with adjustable thicknesses provide a clear view of upper and lower boundaries, along with fill backgrounds to highlight price ranges effectively.
Enhanced Trend Detection: Identify potential trend continuation, consolidation, or reversal zones based on the position and interaction of price with the three bands.
Offset Adjustment: Shift the bands forward or backward to analyze future or past price movements more effectively.
Why Use Triple STANDARD DEVIATIONS ?
STANDARD DEVIATIONS are a popular choice among traders for measuring volatility and anticipating potential price movements. This indicator takes STANDARD DEVIATIONS to the next level by allowing you to customize and analyze three distinct bands simultaneously, providing an unparalleled view of market dynamics. Use it to:
Spot Volatility Expansion and Contraction: Track periods of high and low volatility as prices move toward or away from the bands.
Identify Overbought or Oversold Conditions: Monitor when prices reach extreme levels compared to historical volatility to gauge potential reversal points.
Validate Breakouts: Confirm the strength of a breakout when prices move beyond the outer bands.
Optimize Risk Management: Enhance your strategy's risk-reward ratio by dynamically adjusting stop-loss and take-profit levels based on band positions.
Ideal For:
Forex, Stocks, Cryptocurrencies, and Commodities Traders looking to enhance their technical analysis.
Scalpers and Day Traders who need rapid insights into market conditions.
Swing Traders and Long-Term Investors seeking to confirm entry and exit points.
Trend Followers and Mean Reversion Traders interested in combining both strategies for maximum profitability.
Harness the full potential of STANDARD DEVIATIONS with this multi-dimensional approach. The "STANDARD DEVIATIONS " indicator by WISE TRADER will become an essential part of your trading arsenal, helping you make more informed decisions, reduce risks, and seize profitable opportunities.
Who is WISE TRADER ?
Wise Trader is a highly skilled trader who launched his channel in 2020 during the COVID-19 pandemic, quickly building a loyal following. With thousands of paid subscribed members and over 70,000 YouTube subscribers, Wise Trader has become a trusted authority in the trading world. He is known for his ability to navigate significant events, such as the Indian elections and stock market crashes, providing his audience with valuable insights into market movements and volatility. With a deep understanding of macroeconomics and its correlation to global stock markets, Wise Trader shares informed strategies that help traders make better decisions. His content covers technical analysis, trading setups, economic indicators, and market trends, offering a comprehensive approach to understanding financial markets. The channel serves as a go-to resource for traders who want to enhance their skills and stay informed about key market developments.
Indicator

Indicator

Indicator

Indicator

Indicator

Weighted Standard Deviation BandsLinearly weighted standard deviations over linearly weighted mean.
The rationale of the study can be deduced from my latest publications where I go deeper into explaining the benefits of linear weighting, but in short, I can remind that by using linear weighting we are able to increase the information gain by communicating the sequential nature of time series to the calculations via linear weighting.
Note, that multiplier parameters can take both negative and positive values resulting in ability to have, for example, 1st and 6th weighted standard deviations higher than the weighted mean.
Despite the modification of the classic standard deviation formula, I assume that mathematical qualities of standard deviation will hold due to the fact we can alternately weight the window itself, and then apply the classic standard deviation over the weighted window. In both cases, the results will be the same.
Aight that was too formal, but your short strangles should be happy
Here is it, for you Indicator

Indicator

Library

Probability ConesA probability cone is an indicator that forecasts a statistical distribution from a set point in time into the future.
Features
Forecast a Standard or Laplace distribution.
Change the how many bars the cones will lookback and sample in their calculations.
Set how many bars to forecast the cones.
Let the cones follow price from a set number of bars back.
Anchor the cones and they will not update from their last location.
Show or hide any set of cones.
Change the deviation used of any cone's upper or lower line.
Change any line's color, style, or width.
Change or toggle the fill colors between any two cone lines.
Basic Interpretations
First, there is an assumption that the distribution starting from the cone's origin, based on the number of historical bars sampled, is likely to represent the distribution of future price.
Price typically hangs around the mean.
About 68% of price stays within the first deviation cones.
About 95% of price stays within the second deviation cones.
About 99.7% of price stays within the third deviation cones.
When price is between the first and second deviation cones, there is a higher probability for a reversal.
However, strong momentum while above or below the first deviation can indicate a trend where price maintains itself past the first deviation. For this reason it's recommended to use a momentum indicator alongside the cones.
There is no mean reversion assumption when price deviates. Price can continue to stay deviated.
It's recommended that the cones are placed at the beginning of calendar periods. Like the month, week, or day.
Be mindful when using the cones on various timeframes. As the lookback setting, which selects the number of bars back to load from the cone's origin, will load the number of bars back based on the current timeframe.
Second Deviation Strategy
How to react when price goes beyond the second deviation is contingent on your trading position.
If you are holding a losing trade and price has moved past the second deviation, it could be time to stop trading and exit.
If you are holding a winning trade and price has moved past the second deviation, it would be best to look at exit strategies to capitalize on the outperformance.
If price has moved beyond the second deviation and you hold no position, then do not open any new trades.
Indicator

Strategy

Indicator

Indicator

Risk Position Sizing tool using Coefficient of VariationA way to manage portfolio risk using relative standard deviation, also known as coefficient of variation. This tool tells you how much of each stock in shares and in value to buy adjusted for their volatility risk for a given starting account capital. A problem many people have is how to diversify an account and adjusting it for the risk involved in each equity. Many would put in an equal amount of capital value into each share but is it really equal if some equities have more risk than others? A solution is to adjust the portfolio by giving less weight to those that are more volatile or risky. It's done by using a starting percent of the account, preferably a small percent of it, and buying up shares with that same amount for each equity. Each equity will also be divided by the COV to risk adjust the portfolio by giving less weight to the more volatile stocks. This is done until as much of the initial capital in the account as possible is spent.
COV is how far away the price is from the mean or average. The further the price is from the mean the more risk or volatility there is. It uses standard deviation in its calculation. The problem with SD and ATR is that they are not relative to the past or to other equities to compare to. An application where COV can be used is risk portfolio management formulas. This does not take into account correlation or other equation parts in some portfolio management formulas but only the risk or volatility, the default volatility length is mostly arbitrary, and the lower risk stocks may end up being the slowest in performance.
The text label will show how many shares will be bought and how much value each equity will have. At the end it will show the initial capital that was started off with, the total shares bought, the total value of all the shares, and the amount of capital left over. If the sources are not blank then they will be used, to blank them you will need to reset the settings to default otherwise they might still be read. If you want to add more than the given 10 equity spaces to the portfolio then you will need to add in the code manually and add it to the chart. The denominator is perhaps the important part in these types of risk position sizing tools, you can change to other things such as risk-reward ratio instead of volatility or change the volatility type, etc. Indicator

Pinescript - Standard Array Functions Library by RRBStandard Array Functions Library by RagingRocketBull 2021
Version 1.0
This script provides a library of every standard Pinescript array function for live testing with all supported array types.
You can find the full list of supported standard array functions below.
There are several libraries:
- Common String Functions Library
- Common Array Functions Library
- Standard Array Functions Library
Features:
- Supports all standard array functions (30+) with all possible array types* (* - except array.new* functions and label, line array types)
- Live Output for all/selected functions based on User Input. Test any function for possible errors you may encounter before using in script.
- Output filters: show errors, hide all excluded and show only allowed functions using a list of function names
- Console customization options: set custom text size, color, page length, line spacing
Notes:
- uses Pinescript v3 Compatibility Framework
- uses Common String Functions Library
- has to be a separate script to reduce the number of local scopes in Common Array Function Library, there's no way to merge these scripts into a single library.
- lets you live test all standard array functions for errors. If you see an error - change params in UI
- array types that are not supported by certain functions and producing a compilation error were disabled with "error" showing up as result
- if you see "Loop too long" error - hide/unhide or reattach the script
- doesn't use pagination, a single str contains all output
- for most array functions to work (except push), an array must be defined with at least 1 pre-existing dummy element 0.
- array.slice and array.fill require from_index < to_index otherwise error
- array.join only supports string arrays, and delimiter must be a const string, can't be var/input. Use join_any_array to join any array type into string. You can also use tostring() to join int, float arrays.
- array.sort only supports int, float arrays. Use sort_any_array from the Common Array Function Library to sort any array type.
- array.sort only sorts values, doesn't preserve indexes. Use sort_any_array from the Common Array Function Library to sort any array while preserving indexes.
- array.concat appends string arrays in reverse order, other array types are appended correctly
- array.covariance requires 2 int, float arrays of the same size
- tostring(flag) works only for internal bool vars, flag expression can't depend on any inputs of any type, use bool_to_str instead
- you can't create an if/function that returns var type value/array - compiler uses strict types and doesn't allow that
- however you can assign array of any type to another array of any type creating an arr pointer of invalid type that must be reassigned to a matching array type before used in any expression to prevent error
- source_array and create_any_array2 use this loophole to return an int_arr pointer of a var type array
- this works for all array types defined with/without var keyword. This doesn't work for string arrays defined with var keyword for some reason
- you can't do this with var type vars, this can be done only with var type arrays because they are pointers passed by reference, while vars are the actual values passed by value.
- wrapper functions solve the problem of returning var array types. This is the only way of doing it when the top level arr type is undefined.
- you can only pass a var type value/array param to a function if all functions inside support every type - otherwise error
- alternatively values of every type must be passed simultaneously and processed separately by corresponding if branches/functions supporting these particular types returning a common single result type
- get_var_types solves this problem by generating a list of dummy values of every possible type including the source type, allowing a single valid branch to execute without error
- examples of functions supporting all array types: array.size, array.get, array.push. Examples of functions with limited type support: array.sort, array.join, array.max, tostring
- unlike var params/global vars, you can modify array params and global arrays directly from inside functions using standard array functions, but you can't use := (it only works for local arrays)
- inside function always work with array.copy to prevent accidental array modification
- you can't compare arrays
- there's no na equivalent for arrays, na(arr) doesn't work
P.S. A wide array of skills calls for an even wider array of responsibilities
List of functions:
- array.avg(arr)
- array.clear(arr)
- array.concat(arr1, arr2)
- array.copy(arr)
- array.covariance(arr1, arr2)
- array.fill(arr, value, index_from, index_to)
- array.get(arr, index)
- array.includes(arr, value)
- array.indexof(arr, value)
- array.insert(arr, index, value)
- array.join(arr, delimiter)
- array.lastindexof(arr, value)
- array.max(arr)
- array.median(arr)
- array.min(arr)
- array.mode(arr)
- array.pop(arr)
- array.push(arr, value)
- array.range(arr)
- array.remove(arr, index)
- array.reverse(arr)
- array.set(arr, index, value)
- array.shift(arr)
- array.size(arr)
- array.slice(arr, index_from, index_to)
- array.sort(arr, order)
- array.standardize()
- array.stdev(arr)
- array.sum(arr)
- array.unshift(arr, value)
- array.variance(arr)
Indicator
