OPEN-SOURCE SCRIPT
Atualizado

Price to Volume Change

480
Price to Volume Change — All-Positive Ratio Lollipop Chart

A separate-pane indicator that measures the ratio between price change and volume change on consecutive completed bars. All values are positive — the ratio always shows how many times more the dominant side changed. Color indicates WHICH side is dominant (green = price, red = volume) and WHETHER price and volume agree on direction (bright = confirmed, dim = divergence).

What Makes This Original

  • All-positive scale — Unlike indicators that use positive/negative values, this chart plots the ratio as always >= 1 with the 1:1 line as the center. A reading of 3 means the dominant side changed 3x more. No zero line, no negative values — the chart is cleaner and easier to read at a glance.
  • Color encodes two dimensions — The hue (green vs red) shows which side is dominant: green = price moved more, red = volume moved more. The brightness shows direction agreement: bright = price and volume moved the same way (confirmed), dim = they diverged (warning). Four combinations give four distinct visual signals.
  • Lollipop chart with gradient intensity — Thin histogram stems with circle tips. Stronger ratios produce brighter, more saturated colors. Extreme ratios visually pop while moderate ones fade.
  • Completed bars only — All calculations compare the two most recently completed bars ([1] vs [2]). The current forming bar is excluded, so the display never flickers.


How to Read It

Bar height (ratio):
  • At 1 (white center line) — Equal change. Price and volume moved proportionally.
  • Above 1 — One side moved disproportionately more than the other. A reading of 3 means 3x more.
  • Above threshold (orange dashed) — Extreme disproportion. Default threshold is 3x.


Bar color (which side is dominant):
  • Green — Price dominant. Price changed proportionally more than volume.
  • Red — Volume dominant. Volume changed proportionally more than price.


Bar brightness (direction agreement):
  • Bright green — Price dominant + confirmed (price and volume moved same direction)
  • Dim green — Price dominant + divergence (price and volume moved opposite directions)
  • Bright red — Volume dominant + confirmed
  • Dim red/maroon — Volume dominant + divergence


How to Use

For breakout confirmation: A breakout with bright red bars (volume dominant + confirmed) means heavy volume participation driving the move — strong signal. A breakout with dim green bars (price dominant + divergence) means price is moving without volume support — suspect.

For accumulation/distribution: Tall bright red bars with small price changes indicate large volume activity with minimal price impact — potential institutional positioning.

For reversal warning: A shift from green to red bars (volume taking over from price as the dominant force) during a trend can signal exhaustion or a change in character.

For average context: The yellow MA line shows the average ratio. Bars above the MA indicate above-average disproportion between price and volume.

Details Table

An optional table shows the last completed bar's data:
  • Price Change % — percentage move in price
  • Volume Change % — percentage move in volume
  • Ratio — displayed as "3.2:1" (price dominant) or "1:2.5" (volume dominant)
  • Dominant — PRICE (green) or VOLUME (red)
  • Direction — Confirmed (green) or Divergence (red) or Flat (gray)


Important Notes

This indicator is designed for the 1-day (daily) timeframe. It requires volume data and will not produce meaningful results on assets without native volume (e.g., SPX index, some forex pairs). All calculations use completed bars only. Extreme ratios are capped at a configurable maximum (default 10) for chart readability. When either price or volume change is near zero (less than 0.01%), the ratio is displayed as n/a.


Recommended Timeframe: Daily (1D)

Default Parameters
  • Max Ratio Cap: 10.0
  • Ratio MA: SMA, Length 14
  • Threshold Line: 3.0
  • Details Table: Enabled, Top Right
Notas de Lançamento
Updates in This Version

1. Bug Fix: One-Bar Lag Corrected
The previous version compared [1] vs [2] (two bars ago vs three bars ago), causing the indicator to display data from the PREVIOUS bar rather than the current one. For example, Thursday's bar would show Wednesday's ratio. This has been fixed to use [0] vs [1] (current bar vs previous bar) so each bar's lollipop directly reflects that bar's price and volume change.

2. Color Scheme Redesigned — Two Independent Visual Channels
The previous version used green/red for dominance (price vs volume), which implied that price dominance was "good" and volume dominance was "bad." Neither is inherently positive or negative — they are simply different regimes. The color scheme now separates two signals into two visual channels:
- Stem color = Confirmation vs Divergence (the actionable signal): Green = price and volume agree, Red = they disagree
- Tip color = Which side is dominant (the context): Cyan = price dominant, Orange = volume dominant
This lets the trader read both signals independently without confusion.

3. Log Compression Replaces Hard Cap
The previous version hard-capped ratios at a fixed maximum (default 10), clipping all extreme values to the same level. The new version uses logarithmic compression above a configurable threshold (default 10x). Values below 10x display at full linear resolution. Values above 10x are compressed but still visible and distinguishable — a ratio of 15 looks different from a ratio of 50. No information is lost; the actual ratio is always shown in the details table.

4. Reference Line and Compression Threshold Separated
Previously, a single "Threshold" setting controlled both the visual reference line and the compression breakpoint. At the default of 3, this compressed the entire normal range (3-10x) into a narrow band, making all bars above 3 look similar. Now these are two independent settings:
- Reference Line (default 3x, cyan dashed) — a visual marker for "notable disproportion." Purely informational, no compression effect.
- Log Compression Above (default 10x, orange dotted) — where the log scale begins. The 1-10x range has full linear detail.

5. Expanded Use Cases in Description
Added seven specific, actionable use cases: breakout validation, trend exhaustion warning, stealth accumulation/distribution detection, move quality comparison, daily stock screening, entry timing, and average context. Also added a "What This Indicator Does NOT Tell You" section clarifying limitations (no direction, no magnitude, no causation).

6. Removed Max Ratio Cap Input
The hard cap input has been removed entirely. The log compression handles extreme values naturally — no data is clipped or lost.

7. Table Updated for New Color Scheme
The "Dominant" row now shows PRICE with a cyan background and VOLUME with an orange background, matching the tip colors. The "Direction" row retains green (Confirmed) and red (Divergence) to match the stem colors.
Notas de Lançamento
Price to Volume Change — Version Update

Signed Histogram
The histogram now reflects price direction:
  • Bars above zero — price is up from the previous bar
  • Bars below zero — price is down from the previous bar
  • Bar height (magnitude) still represents the ratio between price change % and volume change %

Previously all bars were positive (absolute ratio), making it impossible to read direction at a glance. The zero line now serves as the directional anchor.

Health Zone (replaces Moving Average)
  • Removed the Ratio MA line — it was always above threshold on spiky ratio data and provided no actionable insight
  • Added shaded health zone bands at ±1 to ±3 representing the ideal price-to-volume ratio range for healthy, proportional moves
  • Green shading on the bullish side (+1 to +3), red shading on the bearish side (−1 to −3)
  • Bars landing inside the zone with confirmed direction = healthy move; bars outside = disproportionate activity


Log Compression Retuned
  • Default compression threshold lowered from 10 to 5
  • Values 1–5 display at full linear resolution; above 5 compresses logarithmically
  • The 1–3 health zone now occupies meaningful visual space instead of being squeezed at the bottom


Updated Color Scheme
  • Bright green — bullish confirmed (price up + volume up) within healthy 1–3x zone
  • Faded green — bullish confirmed but outside healthy zone
  • Bright red — bearish confirmed (price down + volume down) within healthy 1–3x zone
  • Faded red — bearish confirmed but outside healthy zone
  • Purple — divergence (price and volume moving in opposite directions)
  • Cyan tip — price dominant | Orange tip — volume dominant


Details Table
Added a 6th row: Health — displays HEALTHY (confirmed + in zone), In Range (in zone but diverging), or Outside.

Alert Conditions (new)
Five configurable alert conditions, each with an enable/disable toggle:
  • Healthy Bullish Move — price up, volume up, ratio 1–3x
  • Healthy Bearish Move — price down, volume down, ratio 1–3x
  • Bullish Divergence — price up but volume down
  • Bearish Divergence — price down but volume up
  • Extreme Ratio — ratio exceeds the reference line threshold (disproportionate move)

Aviso legal

As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.