Relative Positioning Map█ OVERVIEW
A cross-sectional relative-positioning map. It shows where each of up to 20 instruments sits versus a configurable benchmark right now, measured in daily-volatility units of the relative spread and anchored to the current session's open. It is a visualization and decision-support tool for relative momentum, cross-sectional dispersion and mean-reversion attention on a basket that shares one reference — for example semiconductor names against an ETF, or any sector against a broad index.
The benchmark is fully configurable, so the same tool works on any universe you want to read against a common index. Because every spread is referenced to the same benchmark and scaled the same way, the curves are directly comparable to one another.
█ WHAT IT IS, AND WHAT IT IS NOT
It is a relative-momentum and dispersion map, plus optional intraday attention shading. It is not a buy/sell signal generator and not a mean-reversion entry system: the shaded windows are attention zones, and any alert it raises flags a large relative move, not a trade.
█ WHAT MAKES IT DIFFERENT
Many relative-strength plots normalise a windowed return, such as price now divided by price a fixed number of bars ago. That quantity decays on its own as the lookback rolls past an old move, so the line can fall back toward zero even when price has not reverted at all — the plot and the price disagree. This script avoids that by working on the level of the relative spread rather than on a windowed return, and by anchoring to a static session reference that never chases the level the way a moving average would.
█ CONCEPTS
For each instrument versus the benchmark:
• Relative spread, as a level. s = log( price of instrument / price of benchmark ). It is pulled as a single synthetic ratio series built from the bare tickers. A single series is required because the volatility of a difference carries the cross-covariance of the two legs, which only exists when the ratio is one series. All calculations run at the chosen resolution, which makes the map independent of the chart's own timeframe.
• Session anchor. The opening value of the spread is captured at the session open and held fixed for the whole day, resetting each morning. It is static, not a moving average, so it never chases the level.
• Positioning value. v = ( spread now minus the opening spread ) divided by the spread's daily volatility. A reading of +2 means the instrument is two daily spread standard deviations above where it opened versus the benchmark; a reading of -5 means it has been five below and stayed there. Persistence is information, not an error: a chronically weak name can legitimately sit near -5 all day. No reversion is implied.
• Cross-sectional dispersion bands. At every bar the mean and standard deviation of the values across the whole basket are drawn as envelopes. Wide bands mean high dispersion (names diverging — the classic dispersion-trading backdrop); narrow bands mean the group is moving together.
• Benchmark baseline. The benchmark is the zero line by definition. It is drawn as a band tinted by its own short-term trend, so the regime the whole basket is riding is always visible.
█ HOW TO USE
1 — Set the Benchmark : the denominator of every spread. Change it to a broad index, a sector ETF, or any instrument. Prefer a bare ticker so the synthetic ratio resolves cleanly.
2 — Fill the Universe slots with up to 20 instruments; leave a slot empty to skip it.
3 — Pick the Resolution : the analysis timeframe that drives the calculations, independent of the chart timeframe.
4 — Read the curves: the top of the pane holds the relative outperformers, the bottom the laggards, scaled in daily spread standard deviations since the open.
5 — Read the dispersion bands for the regime: widening envelopes mean a dispersing basket (the dispersion-trading backdrop); contracting envelopes mean convergence.
6 — Use the grey mean-reversion attention windows as reminders of the times of day you choose to watch for reversion in the spreads. They are visual only; validate any reversion with your own analysis.
7 — Use the mover labels and the ranking table to see which names became extreme or accelerated away from the index, and the daily volatility of each spread for sizing.
█ FEATURES
• Configurable benchmark and up to 20 instruments, all comparable on one scale.
• Chart-timeframe-independent computation through a synthetic ratio evaluated at a chosen resolution.
• Cross-sectional dispersion envelopes around the basket mean.
• A trend-tinted benchmark baseline.
• Two configurable intraday attention windows (mean-reversion zones) plus further session highlights, with timezone and transparency controls.
• Mover labels that trigger on extreme positioning OR on acceleration away from zero, with a confirmation requirement, a per-name re-label cooldown, an end-of-session suppression window, and automatic anti-overlap stacking. Historical mover labels are semi-transparent; the live right-margin labels showing the current state are solid.
• A ranking table with each name's positioning value and its spread's daily volatility.
█ LIMITATIONS
• Relative spreads are not guaranteed to mean-revert. Whether a given pair reverts on your timeframe is an empirical question of stationarity and half-life that this tool does not test for you. Treat the shaded windows as attention zones only.
• In extended hours the synthetic ratio depends on both legs trading; where one leg is illiquid you will see stepwise or flat segments. That is market microstructure, not a calculation error.
• The synthetic ratio is built from bare tickers; an unusual symbol that does not resolve will show no data on that slot.
• Higher-timeframe values are requested without lookahead, so historical values are fixed once a bar of the chosen resolution closes; only the currently forming bar updates in real time. This is expected behaviour.
█ NOTES
This script is a context and visualization tool. It does not place orders, and its alerts are informational rather than trade instructions. Nothing in it constitutes financial advice, and past behaviour visible on the chart does not guarantee future results.
═════════════════════════════════════════════════════════════════════════
Published open-source so the calculations can be inspected and adapted. Reuse is governed by the license shown with the source and by PulseWire's House Rules. 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

Volume Dispersion Field [JOAT]Volume Dispersion Field
Introduction
The Volume Dispersion Field is an open-source non-overlay indicator that provides a comprehensive volume analysis suite combining relative volume classification, buy/sell delta tracking, volume dispersion measurement, climax detection, volume profile calculation, smart money activity analysis, and anomaly detection. Rather than showing a simple volume histogram, this indicator dissects volume into multiple analytical layers that reveal who is participating, how aggressively, and whether the activity is normal or anomalous.
Built with Pine Script v6, the indicator uses custom types for volume state, delta state, dispersion bins, profile data, smart money state, and volume pulse tracking.
Why This Indicator Exists
Standard volume indicators show a single bar per candle. This tells you how much volume occurred but not who was buying or selling, whether the volume is unusual, or how volume is distributed across the price range. This indicator addresses those gaps by providing:
Seven-tier volume classification: Categorizes each bar from Extreme Low to Extreme High relative to the moving average, giving immediate context about whether current activity is normal or exceptional
Delta analysis: Estimates buying and selling volume using candle structure, then calculates smoothed delta and cumulative delta to show the net direction of volume pressure
Volume dispersion: Measures how volume is distributed between the upper and lower halves of the recent price range, revealing whether volume is concentrated at highs (distribution) or lows (accumulation)
Climax detection: Identifies volume spikes that exceed a configurable threshold, often marking exhaustion points or the start of major moves
Smart money analysis: Tracks institutional-sized volume activity and classifies the market phase as Accumulation, Markup, Distribution, or Markdown
Anomaly detection: Uses Z-score analysis to flag statistically unusual volume events that may indicate institutional intervention
Core Components Explained
1. Volume Classification System
Every bar is classified into one of seven categories based on its ratio to the volume moving average:
volMA = ta.sma(volume, volMaLength)
volRatio = volume / volMA
Extreme High (>= 3.0x): Institutional-level activity, potential climax
High (>= 2.0x): Significant above-average interest
Above Average (>= 1.0x): Healthy participation
Average (>= 0.5x): Normal market conditions
Below Average (>= 0.25x): Reduced interest
Low (< 0.25x): Thin liquidity, potential for slippage
Extreme Low: Minimal activity
Each category is color-coded with a distinct color from the Quantum Volume palette, making it instantly visible which bars carry institutional weight and which are retail noise. The high and low volume multiplier thresholds are fully configurable.
2. Delta Analysis
The delta engine estimates buying and selling volume by analyzing candle structure. For a bullish candle (close > open), buying volume is estimated as the proportion of the candle range from low to close, multiplied by total volume:
if close > open
buyVol := volume * (close - low) / (high - low + 0.0001)
sellVol := volume - buyVol
else if close < open
sellVol := volume * (high - close) / (high - low + 0.0001)
buyVol := volume - sellVol
The raw delta (buyVol - sellVol) is smoothed with an EMA and also accumulated over a configurable period to produce cumulative delta. Rising cumulative delta with rising price confirms bullish conviction. Falling cumulative delta with rising price warns of hidden distribution.
The indicator also detects delta divergences — when price moves in one direction but delta moves in the opposite direction over a 10-bar window. These divergences are marked with cross symbols on the chart.
The Volume Dispersion Field panel showing color-coded volume bars, delta histogram, cumulative delta line, and smart money accumulation/distribution arrows with the dashboard displaying all metrics
3. Volume Dispersion Measurement
Dispersion quantifies how volume is distributed between the upper and lower halves of the recent price range. Over the dispersion lookback period (default 50 bars), the indicator sums volume for bars that closed in the upper half versus the lower half:
Positive dispersion (> 20): Volume is concentrated in the upper range — bullish bias, potential distribution if extended
Negative dispersion (< -20): Volume is concentrated in the lower range — bearish bias, potential accumulation if extended
Near zero: Volume is balanced across the range — no clear directional bias
Dispersion is plotted as a filled area chart, providing a visual representation of where the volume weight sits within the price range.
4. Volume Profile and POC
The indicator calculates a simplified volume profile by dividing the recent price range into configurable bins (default 10) and summing volume in each bin. From this profile, it derives:
Point of Control (POC): The price level with the highest volume — acts as a magnet for price
Value Area High (VAH): Upper boundary of the 70% volume concentration zone
Value Area Low (VAL): Lower boundary of the 70% volume concentration zone
The profile type is classified as Normal (balanced), Imbalanced (narrow value area, directional), or Ranged (wide value area, consolidation).
5. Smart Money and Anomaly Detection
The smart money engine analyzes volume distribution across the price range over a 50-bar window. If significantly more volume occurs in the lower 30% of the range while price is below its 50-period SMA, the indicator classifies the phase as Accumulation. If more volume occurs in the upper 30% while price is above the SMA, it classifies as Distribution.
Anomaly detection uses Z-score analysis:
volState.zScore := (volume - volMA) / (volStdDev + 0.0001)
volState.isAnomaly := math.abs(volState.zScore) > anomalyThreshold
Volume events with Z-scores exceeding the threshold (default 3.0 standard deviations) are flagged as anomalies and marked with diamond symbols. These statistically rare events often indicate institutional intervention or major news-driven activity.
6. Market Phase Classification
The indicator classifies the current market phase based on the combination of price direction and volume trend:
Markup: Price rising + volume rising — healthy uptrend
Distribution: Price rising + volume falling — potential top forming
Accumulation: Price falling + volume rising — smart money buying the dip
Markdown: Price falling + volume falling — healthy downtrend
Visual Elements
Volume Histogram: Color-coded bars by classification tier
Volume MA Line: 20-period moving average of volume
High/Low Volume Bands: Reference bands at the high and low multiplier levels with fill
Delta Histogram: Smoothed buy/sell delta with gradient coloring
Cumulative Delta Line: Running sum of delta over configurable period
Dispersion Area: Filled area showing volume distribution bias
Climax Markers: Triangle markers for buy and sell climax events
Anomaly Markers: Diamond markers for statistically unusual volume
Smart Money Arrows: Accumulation (up arrow) and Distribution (down arrow) signals
Volume Pulse: Circle markers when volume exceeds the pulse threshold
Heatmap Background: Subtle background coloring based on volume intensity
Dashboard: 14-row metrics table showing volume category, anomaly status, phase, delta direction, dispersion, and more
Close-up of the dashboard showing volume classification as "HIGH", phase as "Markup", delta as "BULLISH" with "BUY SIDE" flow, and an anomaly detection reading
Input Parameters
Volume Analysis:
Volume MA Length (default 20)
High Volume Multiplier (default 2.0) and Low Volume Multiplier (default 0.5)
Delta Analysis:
Delta Smoothing (default 3)
Cumulative Delta Length (default 20)
Dispersion Settings:
Dispersion Lookback (default 50) and Dispersion Bins (default 10)
Climax Detection:
Climax Threshold (default 2.5) and Climax Lookback (default 50)
Advanced Volume:
Smart Money Concepts, Institutional Activity, Volume Anomalies toggles
Anomaly Threshold (default 3.0 std dev)
Volume Pulse toggle and Pulse Threshold (default 1.5)
Visual Settings:
Volume Profile, Dashboard, Glow Effects, Heatmap toggles
Profile Width and Color Scheme (Quantum, Classic, Professional, Neon)
How to Use This Indicator
Step 1: Monitor the volume classification. Extreme High and High bars deserve attention — they indicate institutional participation. Consecutive high-volume bars in one direction confirm conviction.
Step 2: Check the delta direction. Bullish delta with rising price confirms the move. Bearish delta with rising price (divergence) warns of potential reversal.
Step 3: Watch for climax events. A buy climax (extreme volume + bullish candle) at a resistance level may signal exhaustion. A sell climax at support may signal capitulation.
Step 4: Monitor the market phase. Accumulation phases often precede significant upward moves. Distribution phases often precede declines.
Step 5: Pay attention to anomaly markers. These statistically rare volume events often mark turning points or the start of major institutional campaigns.
Step 6: Use dispersion to understand volume positioning. Positive dispersion (volume at highs) during an uptrend is healthy. Positive dispersion during a downtrend suggests distribution.
Indicator Limitations
Delta estimation uses candle structure as a proxy for actual order flow. It is an approximation, not true Level 2 data.
Volume analysis works best on instruments with reliable, consistent volume data. Forex spot volume from brokers is tick volume, not true exchange volume.
Anomaly detection assumes volume follows a roughly normal distribution. During earnings seasons or major events, multiple "anomalies" may fire in succession.
The volume profile is a simplified calculation using close prices, not a tick-by-tick profile. It provides a useful approximation but not exchange-grade precision.
Smart money phase classification is based on volume distribution patterns, not on actual institutional order data.
Climax detection identifies extreme volume events but does not predict the direction of the subsequent move.
Originality Statement
This indicator is original in its comprehensive, multi-layer approach to volume analysis. While individual volume tools exist, this indicator is justified because:
It combines seven distinct volume analysis methodologies (classification, delta, dispersion, profile, climax, smart money, anomaly) into a unified system
Z-score-based anomaly detection provides a statistical framework for identifying unusual volume that simple threshold methods miss
Market phase classification (Accumulation/Markup/Distribution/Markdown) adds a Wyckoff-inspired context layer to raw volume data
Volume dispersion measurement quantifies the spatial distribution of volume across the price range, a metric not available in standard volume indicators
The delta divergence detection system identifies hidden disagreements between price and volume pressure
The comprehensive dashboard presents 14 metrics simultaneously for holistic volume analysis
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Volume analysis is a tool for understanding market participation, not a crystal ball for predicting future price movement. Always use proper risk management. The author is not responsible for any losses incurred from using this indicator.
-Made with passion by officialjackofalltrades
Indicator

Dual Neighboring Price Dispersion [LuxAlgo]The Dual Neighboring Price Dispersion indicator calculates the standard deviation of historical prices within a specific neighborhood of the current price, providing a unique perspective on local price density and volatility within a long-term distribution.
🔶 USAGE
The indicator is displayed in a separate pane and consists of two primary components: a bullish dispersion (plotted above zero) and a bearish dispersion (plotted below zero). These components represent the volatility of prices immediately above and below the current market price based on a historical buffer.
Users can use this tool to identify "Price Discovery" zones or areas where the current price is trading in historical voids. When the indicator's lines disappear and the background is highlighted, it indicates that the current price has few or no "neighbors" within the historical distribution, suggesting the market is exploring new price levels.
🔹 Interpreting Dispersion
High Bullish Dispersion: Indicates that prices higher than the current close are widely spread out, suggesting potential resistance or volatile overhead supply.
High Bearish Dispersion: Indicates that prices lower than the current close are widely spread out, suggesting potential support or volatile demand zones.
Low Dispersion: Suggests high price density, where many historical data points are clustered together, often acting as "fair value" or high-liquidity zones.
🔶 DETAILS
The script maintains a historical buffer of OHLC values (up to 20,000 data points) which are stored in a sorted array. This allows the indicator to construct a "Global Price Distribution" that evolves with every new bar.
Instead of calculating volatility over time, the script calculates volatility over price space . It finds the position of the current closing price within the sorted distribution and calculates the standard deviation of the K nearest neighbors above (Bullish) and below (Bearish).
If the current price is at an all-time high or low, or if there are not enough neighboring data points within the specified range, the indicator will stop plotting and highlight the background. This visual cue signifies that the asset is currently in a state of "discovery," as there is insufficient historical data in that specific price range to determine a local dispersion.
🔶 SETTINGS
Historical Buffer (Bars): The number of historical bars used to build the price distribution. A higher value provides a longer-term memory of price levels.
Neighboring Range (K): The number of neighboring price points to include in the standard deviation calculation. Smaller values respond more quickly to local gaps, while larger values provide a broader view of density.
Smoothing: Applies a Simple Moving Average (SMA) to the dispersion components to filter out noise and produce smoother visual gradients.
Indicator

Neighboring Price Dispersion [LuxAlgo]The Neighboring Price Dispersion indicator calculates the standard deviation of historical prices within a specific price-based neighborhood of the current market level, providing a unique perspective on local price density and volatility within a long-term distribution.
🔶 USAGE
The indicator is displayed in a separate pane and represents the volatility of prices immediately surrounding the current market price based on a historical buffer. Unlike standard volatility indicators that measure price change over time, this tool measures the spread of prices across "price space."
Users can use this tool to identify "Price Discovery" zones or areas where the current price is trading in historical voids. When the indicator line disappears and the background is highlighted, it indicates that the current price has few or no "neighbors" within the historical distribution, suggesting the market is exploring new price levels.
🔹 Interpreting Dispersion
High Dispersion: Indicates that historical price points near the current level are widely spread out. This often suggests a lack of historical agreement on value at that level or a "thin" market area.
Low Dispersion: Suggests high price density, where many historical data points (OHLC values) are clustered together. These areas often act as "fair value" zones or high-liquidity regions where the market has spent significant time.
Background Highlights: When the background is colored, it signifies a "Discovery" phase. This occurs when the current price is at an extreme (all-time high/low within the buffer) or in a gap where there aren't enough historical neighbors to calculate a valid dispersion.
Signal Components: The indicator includes an orange Signal MA to help identify trends in dispersion and a white Cumulative Mean line to represent the long-term average dispersion of the current session.
🔶 DETAILS
The script maintains a historical buffer of OHLC values (up to 20,000 data points) which are stored in a sorted array. This allows the indicator to construct a "Global Price Distribution" that evolves with every new bar.
Instead of calculating volatility over a lookback period of bars, the script finds the position of the current closing price within the sorted distribution and calculates the standard deviation of the K nearest neighbors.
If the current price is trading in a range it has rarely or never visited within the defined buffer, the indicator will stop plotting. This visual cue signifies that the asset is currently in a state of "discovery," as there is insufficient historical data in that specific price range to determine a local dispersion.
🔶 SETTINGS
Historical Buffer (Bars): The number of historical bars used to build the price distribution. A higher value provides a longer-term memory of price levels.
Neighboring Range (K): The number of neighboring price points to include in the standard deviation calculation. Smaller values respond more quickly to local gaps, while larger values provide a broader view of density.
Smoothing: Applies a Simple Moving Average (SMA) to the dispersion calculation to filter out noise and produce smoother visual transitions.
MA Length: Sets the period for the signal moving average (orange line). This helps smooth the dispersion data to identify broader shifts in price density.
CMean Multiplier: A multiplier applied to the cumulative mean of the dispersion. This adjusts the level of the white baseline relative to the current dispersion values. Indicator

MA Dispersion+MA Dispersion+ — read the “breathing space” between your moving-averages
Get instant feedback on trend strength, volatility expansion and mean-reversion — across any timeframe.
MA Dispersion+ turns the humble moving-average stack into a single, easy-to-read oscillator that tells you at a glance whether price is coiling or fanning out.
🧩 What it does
Plugs into your favourite MA setup
• Pick the classic 5 / 20 / 50 / 200 lengths or disable any combination with one click.
• Choose the MA engine you trust — SMA, EMA, RMA, VWMA or WMA.
• Works on any timeframe thanks to PulseWire’s security() engine.
Measures “spread”
For every bar it calculates the absolute distance of each selected MA from their average.
The tighter the stack, the lower the value; the wider the fan, the higher the value.
Adds professional-grade controls
• Weighting — let short-term MAs dominate (Inverse Length), keep everything equal, or dial in your own custom weights.
• Normalisation — convert the raw distance into a percentage of price, ATR multiples, or scale by the MAs’ own mean so you can compare symbols of any price or volatility.
🔍 How traders use it
Trend confirmation – rising dispersion while price breaks out = momentum is genuine.
Volatility squeeze – dispersion parking near zero warns that a big move is loading.
Multi-TF outlook – drop one pane per timeframe (e.g. 5 m, 1 h, 1 D) and see which layer of the market is driving.
Mean-reversion plays – spikes that fade quickly often coincide with exhaustion and snap-backs.
⚙️ Quick-start
Add MA Dispersion+ to your chart.
Set the pane’s timeframe in the first input.
Tick the MA lengths you actually use.
(Optional) Pick a weighting scheme and a normaliser.
Repeat the indicator for as many timeframes as you like — each instance keeps its own settings.
✨ Why you’ll love it
Zero clutter – one orange line tells you what four separate MAs whisper.
Configurable yet bullet-proof – all lengths are hard-coded constants, so Pine never complains.
Context aware – normalisation lets you compare BTC’s $60 000 chaos with EURUSD’s four--decimals calm.
Lightweight – no labels, no drawings, no background processing — perfect for mobile and multi-pane layouts.
Give MA Dispersion+ a try and let your charts breathe — you’ll never look at moving-average ribbons the same way again.
Happy trading! Indicator

Indicator

Indicator

Indicator

Indicator

Price Action IndexI've created a simple oscillator which I think does a good job of easily showing you when price is worth watching or not. I think all too often you get stuck looking at something like an RSI and end up trading noise.
From my observations and experiences, I've found that there are 2 major catalysts for price movement--
Price is either trending and reaches a top or bottom, or
Price is consolidating and ready to make a move in some direction
These movements can be seen quite well from a Bollinger Band, which is what mostly gave me the inspiration. When I watch a chart with a BB on it I see that either you're looking to trade price moving out of a squeeze or riding price up/down the band until it crosses over and makes a move to the moving average.
My solution was to multiply the direction of price by the strength of its deviation.
Price gets converted into a signal between -1.0 (bottom of the range) and 1.0 (top of the range)
Standard Deviation gets converted into a stochastic signal between 0 (next to no deviation from mean) and 100 (highest deviation in lookback)
These 2 get multiplied by each other
The result tells you if price action is trending bullish and if its approaching max strength (perhaps Overbought), example: Price is hitting highs (1.0) and deviation is also at its highest (100) = 100, opposite for bearish
Result can also tell you if price is at the top of the range but the deviation is so tiny and we're mostly pinned to the mean (1.0 * 5 = only 5)
How to Trade this Indicator--
If the indicator is stuck near the middle and purple:
- Don't make directional trades or you'll be eaten alive by the chop
- Good idea to sell options, Iron Condors/Butterflies, etc
- Wait for a move to breakout --> the purple will fade away and give way to a direction
--- As in all trading scenarios, be mindful of fakeouts/short moves to one direction that very quickly get reversed
If the indicator is heading higher:
- This would indicate there is a bull trend going on, get long
- If we are reaching the overbought area, this is an ideal place to take profits or look at spreads like Bearish Call Spreads (sell calls)
- I think you can make your own determination of when to sell by either selling when we're in the overbought area (if it reaches there) or staying bullish so long as it is above the zone
If the indicator is heading lower:
- Bear trend, shorting is possible
- Can use this as a contrarian signal to buy lows
A couple of charts with the indicator and a purple squeeze box I've drawn (can sometimes get noisy in real-time, but hindsight is 20/20)--
Bitcoin on Daily with default 20 length
Gamestop on 30 minute time frame with 100 length
Please feel free to use this indicator for your trading or your own indicators. This particular script is very stripped down/bare bones from what I have been working on as an ongoing project. If PulseWire ever returns scripts you can sell, I would probably open that up for a small premium. Indicator

Standard Deviation - Sum Of The Squares Minus Square Of The SumsIntroduction
The standard deviation measure the dispersion of a data set, in short this metric will tell you if your data is on average closer or farther away from the mean. Its one of the most important tools in statistics and living without it is pretty much impossible, without it you can forget about Bollinger-bands, CCI, and even the LSMA (ouch this hurt) .
Now i don't want to extend myself about the standard deviation since that would require a huge post but i want to show you how to calculate the standard deviation from the stdev pinescript function.
Sum Of The Squares Minus Square Of The Sums
Any metric calculated from a moving average can be classified as "running", this mean that the metric constantly update itself and is not constant, this is why it is better to say "running standard deviation" but its okay. If we use the standard calculation for the standard deviation which would be sqrt(sma(pow(close - sma,2))) we might get something totally different from the stdev function :
In white the pine stdev function and in red the standard calculation of both period 4, its clear that both are not the same, one might try to use the Bessel's correction but that won't do either, this is because most technical analysis tools will calculate the square root of the "Sum Of The Squares Minus Square Of The Sums" method to estimate the standard deviation
Another way is to use :
a = sqrt(sma(pow(close,2),length) - pow(sma(close,length),2))
By returning the difference we might still see some errors :
Nothing relevant of course.
Conclusion
Some of you might already be aware of this but a reminder is always good since it can be confusing to make what can be considered the good standard deviation formula and then have something totally different from the pine function, i hope this post will be useful and that you learned something from it.
Thanks for reading :) Indicator

Indicator

Indicator
