⚙
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…
Checking the latest regular-session price…
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.

Regular session and overnight series

The Series menu (also under Data source in the settings) can run the indicator on the S&P 500 split into its two halves, built from SPY dividend-adjusted daily bars: regular session only chains each day’s open-to-close move, and overnight only chains each previous-close-to-open gap (dividends fall in the overnight leg). Both start at SPY’s first adjusted close in the data and are the same daily returns as the S&P 500: Trading vs After Hours page. Session bars carry the day’s high and low scaled onto the index; overnight bars have no intraperiod range, so their high and low are just the open and close. Volume is the regular-session volume in both, so volume-based options mean the same thing as on SPY. During market hours the session bar is provisional; the overnight bar is fixed once the market opens.

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 (historical cache up to 6 hours), overlaid with recent-session OHLCV and the latest available regular-market quote from binaryacc-recent.php (shared cache up to 30 seconds). The page checks on load, every minute while visible, and on return. Quote timestamps are displayed; Yahoo data may be delayed. The current session and its oscillator/signals are provisional until the close. 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.