S&P 500 Binary Accumulation — Multi-Method
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)
Loading data…
Pine Script Inputs — full replica · drag to recompute live · auto-saved to browser
1 · Binary Definition
Bar scoring method
Custom source
N (for Close vs Close[N])
Reference MA type / length
Invert polarity (short-side view)
2 · Deadband / Neutral Bars
Deadband type
Deadband size
ATR / StDev length
Neutral bar handling
3 · Weighting
Weighting method
Weight normalization length
Max weight (clamp)
Min weight (clamp)
4 · Accumulation
Accumulation engine
Rolling window (bars)
Decay factor
Scale EMA accumulation by length
Reset period
5 · Normalization
Normalization
Normalization lookback
Tanh steepness
6 · Smoothing & Signal Line
Smoothing type
Smoothing length
Apply smoothing
Show signal line
Signal MA type / length
Show osc − signal histogram
7 · Bands / Thresholds
Band method
Static upper level
Static lower level
Band lookback
StDev multiplier
Upper / lower percentile
Extreme fraction
Signal trigger
8 · Divergences
Detect divergences
Pivot left / right bars
Min / max bars between pivots
Only inside bands
Draw divergence lines
9 · Visuals
Plot style
Positive / negative color
Line width
Fill to zero
Fill transparency
Color price bars by regime
Shade extreme zones
Label oscillator pivot extremes
Min |value| for pivot label
10 · Data Source
Data source
Drag = pan · shift+drag = box-zoom · scroll = zoom X · drag Y-axis = zoom Y · double-click = reset
Focus
S&P 500 (log)
Binary accumulation oscillator
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

Computations are an in-page JavaScript port of the indicator’s Pine Script v6 source. Data is daily OHLCV from Yahoo Finance (^GSPC / SPY) served by binaryacc-data.php (refreshed at most every 6 hours). Parameters are mirrored into the URL hash so tuned configurations can be bookmarked; tweaks auto-save to the browser. This is a technical study, not investment advice; past signal timing does not guarantee future results.