Tidal Volume Oscillator [JOAT]Tidal Volume Oscillator
Introduction
The Tidal Volume Oscillator is a separate-pane oscillator that attempts to answer a single question: is the current price movement being carried by genuine volume participation, or is it occurring on weak flow? It constructs a volume-weighted momentum score, normalizes it to a bounded range of −100 to +100, applies a Fourier-inspired exponential decay smoothing pass to reduce noise without introducing phase lag, and then scales the result with an adaptive trend filter. A flow momentum line tracks the acceleration of the oscillator itself. A divergence engine scans for all four divergence types simultaneously — regular bullish, regular bearish, hidden bullish, and hidden bearish — and plots them directly in the oscillator panel.
The indicator does not predict future price. It contextualizes current price movement relative to volume behavior and flags when price action and volume-weighted momentum are moving in opposite directions, which historically precedes changes in directional character — though not always, and not reliably in all instruments or conditions.
---
Core Concepts
The VZO Foundation
The Volume Zone Oscillator (VZO) is an established concept that categorizes volume as positive or negative based on the direction of price change, then computes a ratio of positive to negative volume over a rolling window. This indicator rebuilds that concept from the ground up using a different normalization approach:
Relative Volume: Instead of using raw volume, the oscillator first normalizes each bar's volume against a rolling SMA of volume. This produces a relative volume reading — a value above 1.0 means the bar traded heavier than average, below 1.0 means lighter. This step removes the absolute scale of volume from the calculation, allowing the oscillator to behave comparably across instruments with vastly different volume profiles and across timeframes where absolute volume differs by orders of magnitude.
Volume-Weighted Momentum: The price change on each bar is smoothed via EMA, and the relative volume is separately smoothed via EMA. Multiplying these two smoothed values produces a volume-weighted momentum signal. This is then smoothed again to form a base momentum reading.
RSI-Style Normalization: Positive and negative portions of the base momentum are separated, each independently smoothed, and their ratio is fed into an RSI-style formula: vzo = 100 * (ratio - 1) / (ratio + 1) . This bounds the oscillator strictly between −100 and +100 and gives it a symmetric zero-line structure where positive values indicate dominant upward volume momentum and negative values indicate dominant downward volume momentum.
Fourier Exponential Decay Smoothing
After the initial VZO is computed, a second smoothing pass is applied using exponential decay weights. For each bar, the contribution of each of the prior N bars is weighted by exp(-i / (len * 0.3)) , where i is the number of bars back. This means the most recent bar carries maximum weight and each earlier bar contributes exponentially less. The window clips naturally as the weights approach zero.
The result is a smoothing pass that is inspired by frequency-domain thinking: it emphasizes recent values and de-emphasizes older values in a continuous decay rather than in the binary on/off fashion of a simple rolling average. The smoothed output tracks the oscillator's underlying shape while suppressing high-frequency noise without the phase shift that a centered moving average would introduce.
ADF Trend Filter
An adaptive multiplier is derived by comparing a short SMA and a long SMA of price, normalizing their difference by the rolling standard deviation of price over a matching window. This produces a dimensionless value that reflects the strength of the current trend relative to recent volatility — conceptually analogous to the logic behind an Augmented Dickey-Fuller trend test applied in a simplified real-time form.
This multiplier is kept close to 1.0 intentionally. Its role is not to dramatically change the oscillator's value but to apply a mild scaling that slightly amplifies the VZO when trend conditions are strong and slightly suppresses it during choppy, mean-reverting conditions. The effect is subtle but helps the oscillator's readings align better with the underlying market character.
Final Blended VZO
The final oscillator value blends the EMA-smoothed VZO and the Fourier-smoothed VZO according to a blend parameter, scales the result by the ADF multiplier, and clamps the output to the range. The blend parameter controls how much weight goes to the Fourier-smoothed version versus the EMA-smoothed version, allowing the user to tune between responsiveness and smoothness.
Flow Momentum Line
A secondary line is plotted alongside the main oscillator, computed as:
flow_momentum = (vzo - ema(vzo, lookback)) * 0.5
This measures the rate of change of the oscillator — its acceleration — and scales it to stay visually proportional. When the flow momentum line is rising, the oscillator is accelerating upward. When it is falling, the oscillator is losing momentum regardless of its absolute level. Crossovers between the oscillator and the flow momentum line can highlight inflection points in volume-weighted momentum.
Divergence Engine
The divergence engine uses pivot high and pivot low detection to identify four divergence types:
Regular Bullish Divergence: Price makes a lower low while the oscillator makes a higher low. Suggests weakening downward volume participation on the new price low.
Regular Bearish Divergence: Price makes a higher high while the oscillator makes a lower high. Suggests weakening upward volume participation on the new price high.
Hidden Bullish Divergence: Price makes a higher low while the oscillator makes a lower low. Often associated with pullbacks within an established uptrend where volume momentum remains stronger than the pullback's depth implies.
Hidden Bearish Divergence: Price makes a lower high while the oscillator makes a higher high. Often associated with rallies within an established downtrend where volume momentum is failing to confirm the price bounce.
The engine uses ta.valuewhen to retrieve the oscillator's value at the most recent prior pivot of the same type, then compares it to the current pivot. Lines and labels are drawn directly in the oscillator pane, keeping all divergence context in a single panel.
Dynamic Color Blending
The oscillator line and histogram (if enabled) use color blending that responds to both the direction of the oscillator and the intensity of the flow momentum. Colors transition smoothly between bull and bear palettes as conditions shift, with intensity modulated by momentum acceleration. This avoids binary color flips and gives a continuous visual read of the oscillator's strength and direction.
---
Features
Relative-volume-normalized VZO foundation — removes absolute volume scale bias
RSI-style normalization producing a symmetric −100 to +100 oscillator
Fourier exponential decay smoothing pass for noise reduction without phase lag
ADF-inspired adaptive trend multiplier for regime-sensitive scaling
Blended output combining EMA and Fourier smoothing with user-adjustable weighting
Flow momentum line showing oscillator acceleration
Full four-type divergence engine: regular bull/bear and hidden bull/bear
Divergence lines and labels rendered directly in the oscillator pane
Dynamic color blending based on direction and momentum intensity
Overbought/oversold level lines at user-defined thresholds (default ±80)
Fully toggleable visual components including divergence types individually
---
Input Parameters
VZO Length: Primary lookback for the volume-weighted momentum and normalization calculations (default: 14)
Smoothing Length: Short EMA length used in the initial volume-weighted momentum construction (default: 5)
Signal Length: EMA length applied to the final VZO for the signal/flow line (default: 9)
Fourier Window: Number of bars used in the exponential decay smoothing pass (default: 20)
Fourier Blend: Proportion of the final output taken from the Fourier-smoothed VZO versus the EMA-smoothed VZO (default: 0.4, meaning 40% Fourier / 60% EMA)
Overbought Level: Upper reference line threshold (default: +80)
Oversold Level: Lower reference line threshold (default: −80)
Pivot Bars: Number of bars on each side required to confirm a pivot high or low for divergence detection
Visual Toggles: Individual controls for divergence types (regular bull, regular bear, hidden bull, hidden bear), flow momentum line, bar coloring, and OB/OS lines
---
How to Use
Reading the oscillator: Values above zero indicate that volume-weighted momentum favors buyers over the lookback window. Values below zero indicate it favors sellers. The magnitude reflects how dominant one side is. A reading of +60 is meaningfully different from +20 — the former suggests strong participation on the upside, the latter suggests modest positive lean.
Overbought/oversold levels: The default ±80 levels are deliberately set wide. Reaching ±80 indicates a statistically strong skew in volume momentum, not simply a directional bias. A reading at +85 that begins to decline is worth noting; a reading that has been above +80 for many bars without declining suggests strong persistent flow, not an automatic reversal condition.
Flow momentum line: Use the flow momentum line to identify when the oscillator is accelerating or decelerating. If the oscillator is above zero but the flow momentum line is falling and crossing below the oscillator, volume-weighted momentum is losing strength even if it has not crossed zero. This can be an early warning of a fading move.
Divergences: Divergence signals appear as labeled lines in the oscillator pane. They flag a disagreement between price structure and volume momentum structure. Regular divergences are typically associated with potential trend reversal conditions; hidden divergences are typically associated with trend continuation conditions during a pullback. Neither type is a standalone entry signal — they require context from price structure, higher timeframe trend, and other confirmation.
Combining types: A regular bearish divergence occurring while the oscillator is above +60 and the flow momentum line is declining is a more compelling condition than a divergence occurring at a neutral oscillator reading. Look for confluence between divergence signals, oscillator level, and flow momentum direction.
Timeframe notes: On lower timeframes, the divergence engine will fire frequently and many signals will resolve as noise. On higher timeframes, divergence signals are structurally more significant but rarer. The Fourier blend and VZO length should be calibrated to the timeframe being traded.
---
Limitations
This indicator does not predict future price movement. All readings are computed from past and current bar data.
Volume data quality varies significantly across instruments and data providers. On instruments with unreliable, synthetic, or missing volume data (some forex pairs, certain CFDs, spread-betting instruments), the oscillator's readings will be distorted or meaningless.
Divergences are detected only at confirmed pivot points, which by definition require a lookback into past bars. A divergence signal will appear after the pivot is confirmed, not at the pivot bar itself. This is inherent to pivot-based divergence detection and is not a bug.
Hidden divergences can occur frequently during strong trends and produce many signals that resolve without follow-through on shorter timeframes.
The ADF-inspired filter is a simplified heuristic, not a formal statistical test. It does not guarantee that the adaptive scaling accurately reflects whether a market is trending or mean-reverting at any given moment.
The Fourier exponential decay smoothing is not a formal frequency-domain Fourier transform. The term is used descriptively to indicate the exponential weighting pattern, not to imply that the calculation resolves into sinusoidal components.
Extreme or sustained overbought/oversold readings do not guarantee a reversal. Strong trends can keep the oscillator pinned at extremes for extended periods.
The oscillator is bounded at ±100 by construction. This means that at extreme readings, additional strengthening of volume momentum does not move the line further — the clamping obscures incremental changes at extremes.
Past divergence performance on a given instrument is not indicative of future performance.
---
Originality Statement
The VZO concept is established in the public domain. This implementation departs from the standard in several meaningful ways. Using relative volume (each bar's volume divided by a rolling SMA of volume) rather than raw volume removes the absolute scale of volume from the oscillator's behavior — a standard VZO applied to a futures contract and a low-float equity will behave differently purely due to volume magnitude; this version will not. The RSI-style normalization of the volume-weighted momentum ratio is retained from the VZO concept but is applied to a momentum signal constructed differently from the standard signed-volume approach. The Fourier exponential decay smoothing layer is an original addition: it is not a standard EMA, WMA, or VWMA — it applies a decaying weight function that is conceptually distinct from any standard Pine Script built-in smoothing function, producing a cleaner oscillator output with less phase distortion than an equivalent EMA. The ADF-inspired adaptive multiplier is a real-time regime-sensitivity mechanism not present in any standard oscillator. The four-type divergence engine built into the same panel, detecting all four divergence classes simultaneously using pivot comparison logic, provides complete divergence coverage without requiring additional scripts or manual line drawing. The combination of these elements — relative-volume normalization, Fourier decay smoothing, adaptive trend scaling, blended output, flow momentum line, and full-coverage divergence detection — into a single oscillator panel represents an original synthesis that is not replicated by any standard built-in indicator.
---
Disclaimer
This indicator is provided for educational and informational purposes only. It does not constitute financial advice, investment advice, or a recommendation to buy or sell any financial instrument. Trading involves substantial risk of loss. Past performance of any indicator or strategy is not indicative of future results. Always conduct your own research and consult a qualified financial professional before making any trading decisions.
-Made with passion by officialjackofalltrades
Indicador Pine Script®






















