OPEN-SOURCE SCRIPT
Aggiornato

Adaptive Volume Confluence Oscillator

495
What it is

One pane that fuses seven different reads of the bar into a single 0–100 confluence score, gates that score by a trend-vs-chop regime filter, confirms it against an auto-mapped higher timeframe, and — most importantly — forward-calibrates its own Buy/Sell signals against an unconditional base rate, so you can see whether the construction actually carries an edge on your instrument.

The seven votes: momentum sign · momentum vs its signal · money flow · trend structure (MA fan) · price location vs VWAP · trend slope · higher-timeframe bias.

The displayed wave is a volume-flow ribbon; the votes drive the score, the signals and the verdict. A plain-language verdict and a subtle pane tint make it readable at a glance (Simple view); a full analytic layer is available for advanced users (Pro view).

Why these are combined (mashup rationale)

A single oscillator whipsaws and a single signal over-fires. Combining helps only when the inputs key on different quantities and their agreement is checked. Each vote reads a different thing — momentum, momentum-vs-signal, volume flow, multi-MA structure, location vs a session mean, slope, and a higher-timeframe read — so the count that agrees carries more information than any one of them alone. A Kaufman Efficiency-Ratio regime gate suppresses conviction in chop, and a forward-calibration harness ties the whole construction back to realised forward outcomes.

An honest caveat, stated up front: the votes are not statistically independent. The oscillator itself embeds money flow, and vote 2 is derived from vote 1's series. Treat the score as a weight-of-evidence read, not as seven independent confirmations. The harness exists precisely so you can check whether the construction earns its keep on your instrument rather than taking the claim on faith.

How it works


Score — how many of the seven votes are bullish, scaled 0–100.
Regime — Kaufman Efficiency Ratio. Below the chop threshold, conviction dims, signals are withheld, and the verdict reads "WAIT – choppy".
HTF — the chart timeframe auto-maps to a confirming higher timeframe (~4–6×), requested with lookahead_off and offset by one bar while the live bar forms.
Signals — Buy/Sell fire only when the oscillator crosses its signal at a statistical OB/OS extreme and the score agrees and the regime isn't choppy and the visible wave isn't already at the opposite extreme.
Climax — a volume spike at an OB/OS extreme prints a Possible Bottom/Top exhaustion mark.
Divergence (Pro) — regular + hidden, from confirmed pivots on the momentum oscillator.
Calibration — each Buy/Sell is queued and resolved a fixed horizon later, then compared with the unconditional same-horizon base rate. The dashboard shows, per side: Hit %, Edge = Hit − Base, sample size, and a Wilson-gated star.


How to use it


Read the verdict and the score. Above the gate = bullish weight of evidence; below = bearish; in between, or in chop, the tool says WAIT — and it means it.
Treat Buy/Sell marks as context, not triggers. They already require the score, the regime and the wave to agree, but they remain a description of conditions — not a recommendation.
Read the Edge row before you weight any signal. If Buy/Sell Edge isn't clearly positive with an adequate sample and a star, this construction is not carrying an edge on this instrument — weight it down or ignore it. Do not tune the parameters until the Edge turns green: that is curve-fitting, and the harness is there to catch it, not to be defeated.
Combine with your own levels, structure and risk rules.


Universal across markets

Price / high / low are inputs, so the engine runs on any symbol or timeframe. The volume votes (money flow, climax, VWAP location) need real volume — prefer a futures contract or a stock. On a symbol with no volume the tool degrades gracefully: money flow is neutralised, the score falls back to the price-only votes, and the dashboard says "NO VOLUME", so you're never misled by a blank or a phantom reading.

Non-repainting

Votes read confirmed closes. The HTF series uses lookahead_off and is offset by one bar while the live bar forms. Divergences come from ta.pivot* and confirm a few bars after the pivot; once printed they don't move. The calibration harness logs and resolves only on confirmed bars, so its statistics never inflate intrabar. The live oscillator updates each bar, like any oscillator.

Concept credits

Super Smoother and Ultimate Smoother low-lag filters — John Ehlers. Chebyshev Type-I filter — classical DSP. Recursive (Kalman) smoothing — R. E. Kalman. Volume Zone Oscillator — Walid Khalil & David Steckler. Accumulation/Distribution money-flow multiplier — Marc Chaikin. Efficiency Ratio — Perry J. Kaufman. ATR — J. Welles Wilder. Wilson score interval — Edwin B. Wilson. VWAP, Hull MA and percentile rank — standard public methods.

Original implementation; not affiliated with, nor endorsed by, any third party. No third-party code is reused.

Honest limits

The score is context, not a guarantee, and the votes are correlated (see the caveat above). The Edge figures are in-sample, close-to-close, with overlapping forward windows and no costs — descriptive context, not a verified backtest. An Edge near zero, negative, or unstable across timeframes is the harness honestly telling you the signal has no reliable edge on that instrument. Nothing here predicts price.

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.
Note di rilascio
Minor Change
Note di rilascio
Adaptive Volume Confluence Oscillator v1.1 — climax detection fix

Climax detection compared volume against a simple moving average placed behind a volume-availability guard. Because that guard varies whenever the feed has gaps, the average was skipped on those bars and drifted over a broken history, making exhaustion reads unreliable.

The average is now computed unconditionally and the comparison masked afterwards. The confluence oscillator, adaptive weighting and divergence logic are unchanged.
Note di rilascio
This update fixes a real defect that was silently breaking the honesty layer, prints the setups on price, ships leaner, and makes the visuals read the strength of the move.

• On-price signals (new, default on). Every marker you see in the pane now also prints directly on the price chart (force-overlay): a bright green triangle below the bar for a Buy, a bright red triangle above the bar for a Sell, plus smaller triangles mirroring the Possible Top / Possible Bottom exhaustion turns. Colours are tunable and there's an optional "BUY"/"SELL" text label. So one indicator gives you both the on-chart signals and the full pane analysis — no companion needed. Toggle "Buy / Sell triangles on price" off if you only want the pane.

• Hidden divergences on by default. Regular and hidden divergences (Pro view) both ship enabled, so continuation divergences are surfaced out of the box.

• Correctness — integer division fixed (the important one). Three calculations were written as int ÷ int, which Pine truncates to 0 or 1 before scaling: the trend-structure vote (the MA fan), and — worse — every forward-calibration figure (Hit %, base %, Edge) and the Wilson star. They collapsed to 0/100 and told you nothing. All three now compute true fractional rates, so the trend-structure vote and the whole calibration harness finally work as designed. Because that vote was effectively stuck off, the confluence score and signals now reflect the corrected design.

• Leaner & faster (no behaviour change from these). A dead Chaikin money-flow chain that computed two rolling windows every bar for a value nothing used was removed; a repeated array fetch and the pair count in the fan loop were hoisted; and the dashboard strings are built only on the last bar. The trend-structure fan (vote 4) now uses incremental EMAs — O(1) per average instead of recomputing moving averages in a loop — which is faster AND removes Pine's "call ta.* on every bar" warning.

• Trend-readable visuals. The pane tint now darkens as conviction rises and the flow-glow brightens with money-flow strength, so a decisive push radiates while a marginal one stays faint — the strength of the move reads at a glance, not only its direction.

• Compliance tidy. The verdict reads "Long setup" / "Short setup" (was "BUY/SELL setup"), and the one home-market phrase was genericized. No symbol is hardcoded — every fetch uses the chart's own ticker.

Non-repaint discipline (confirmed closes, HTF requested lookahead-off with a realtime offset, calibration logged and resolved only on closed bars), the seven votes, the regime gate, the signals and the exports are otherwise unchanged. No default was changed except the trend-structure fan's moving-average type and the two visibility toggles noted above.

This is a study for research and education. It is not financial advice, not a signal service, and not a trading system.

Declinazione di responsabilità

Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.