Faithful port of the Pine Script v6 “Binary Accumulation [Multi-Method]” indicator — 10-stage configurable accumulation oscillator (scoring → deadband → weighting → accumulation → normalization → smoothing → bands → divergences → visuals → stats)
Methodology
This page replicates the TradingView Pine Script v6 indicator
Binary Accumulation [Multi-Method]. The indicator converts every bar into a signed score and feeds it through ten switchable stages:
1 · Binary definition
Each bar compares two values (default: close vs previous close). Ten scoring modes are available (vs open, vs a moving average, vs close N bars back, HL2/typical price persistence, custom source, higher-high & higher-low, prior-bar midpoint, session VWAP). A higher high accompanied by a higher low scores +1, the symmetric pattern scores −1.
2 · Deadband & neutral bars
An optional deadband (percent of price, ATR multiple, ticks, absolute points, or StDev multiple) zeroes out trivial moves; neutral bars can be scored 0, carry the previous sign, or be biased +1 / −1. Polarity can be inverted.
3 · Weighting
Each ±1 sign is multiplied by a weight. Eight methods: pure binary (±1), return magnitude (the default here — move size relative to its 50-day average), volatility-normalized return (ATR), volume relative, range expansion, close location value, streak escalation, and true-range relative. Weights are clamped to [min, max] = [0, 3] by default.
4 · Accumulation
The weighted scores are accumulated with one of seven engines: rolling sum (default, 50 bars), cumulative all-time, EMA accumulation (optionally scaled by length), decayed sum (α = 0.97), periodic reset (day/week/month/quarter/year), reset-on-zero-cross, or a smoothed rolling sum.
5 · Normalization
Optional rescaling: % of max possible, Z-score, percentile rank (±100), min-max (±100), or tanh squash (±100) over a 252-bar lookback.
6 · Smoothing & signal line
Optional smoothing (SMA/EMA/WMA/RMA/HMA/VWMA) applied before or after normalization, plus an optional signal line and osc − signal histogram.
7 · Bands / thresholds
Default static ±13 bands (or StDev / percentile / rolling-extreme bands). Zone entry/exit, zero-cross and signal-line-cross triggers produce the long/short arrows. An event clock tracks days since the last extreme-high and extreme-low entries and the gap between lows (shown in the cards below the charts).
8 · Divergences
5/5 pivot detection on the oscillator compares price vs oscillator highs/lows; bearish (price higher high, oscillator lower high) and bullish (price lower low, oscillator higher low) divergences within 8–120 bars are drawn as dashed lines with markers — optionally only inside the bands.
Reading the chart
Cyan = positive (accumulation) readings, magenta = negative (distribution) readings, yellow line = zero, dashed red/green lines = the bands, orange line = signal. Numeric labels mark oscillator pivots with |value| ≥ 8. All inputs match the Pine Script defaults except the weighting method, which is set to
Return magnitude.
Provenance
This Bitcoin version uses the same calculation engine and default parameters as the site's
S&P 500 Binary Accumulation study. It uses
Bitstamp's public BTC/USD daily OHLCV, beginning 18 August 2011. Each bar is one UTC calendar day, including weekends; the original 50-bar and 252-bar settings therefore mean 50 and 252 calendar days on Bitcoin, rather than stock-market sessions. They have not been retuned to optimize historical signals.
The price and current daily OHLCV are refreshed on load, every minute while visible and on return to the tab, using a shared 30-second server cache. The current day's price segment is dotted and explicitly provisional until midnight UTC. Indicators and signals can change during that day. Historical data is checked four times daily; failed or shortened updates retain verified history. The source can be delayed or unavailable.
Volume is BTC traded on Bitstamp only, not market-wide Bitcoin volume. The default return-magnitude weighting does not use volume; volume-weighted alternatives do. Thirty-three early historical bars have zero reported volume in the initial source snapshot; no replacement volume is invented. On daily bars, the session-VWAP scoring option reduces to daily typical price (H+L+C)/3 because each daily bar is a separate session; it is not an intraday trade-by-trade VWAP. Divergence pivot labels appear on the pivot date only after the selected number of right-hand bars confirms them.
All ten stages, adjustable parameters, bands, signal settings, URL bookmarks and saved browser settings are retained. Bitcoin has its own saved settings. This is an accumulation/distribution technical study, not an on-chain measure or a tested investment strategy.