General Idea
This indicator tries to spot classic Wyckoff "Spring" accumulation setups — moments where smart money shakes out weak sellers by briefly pushing price below support, then aggressively buys it back above that level before the move up. It combines this spring pattern with several confirming "ingredients" (strong candle structure, volume surge, prior volatility compression, and overall trend context) into a single composite Accumulation Score from 0–100, displayed as a histogram in a lower panel. The higher the score, the more confluence there is pointing to a potential explosive bullish reversal/continuation.
The Building Blocks
- Trend Filter – Checks if price is above its 200-period SMA. If this filter is enabled, setups that occur below the long-term trend get their score cut in half, since buying dips in an uptrend is statistically favored over buying in a downtrend.
- Energy Candle – Looks for candles with a strong lower wick (meaning sellers pushed price down but buyers absorbed it and pushed it back up), a close near the top of the candle's range, and volume at least 25% above its 20-period average. This is meant to capture "effort vs result" — big volume effort with a bullish result.
- Volatility Squeeze – Compares current ATR to its moving average. If ATR is noticeably below its average (i.e., the market has been quiet/compressed), it flags a "squeeze," since explosive moves often erupt after low-volatility consolidation — similar in spirit to a Bollinger Band squeeze.
- Spring Signal – The core Wyckoff pattern: checks whether the current candle's low broke below the lowest low of the last 15 (adjustable) candles, but the candle still closed back above that broken support — a classic "stop hunt" / false breakdown.
The Scoring System
Each of these components contributes points to the final score:
- Spring pattern: 40 points (most important)
- Energy candle (absorption + volume): 30 points
- Volatility squeeze: 15 points
- Strong close in upper third of the candle: 15 points
If price is below the trend filter (200 SMA), the total score is cut in half. The maximum possible score is 100.
How to Use It
- The histogram colors itself gray (weak signal, under 40), yellow (moderate, 40-69), or lime green (elite setup, 70+), with dotted reference lines at these two thresholds.
- When the score hits 70+ and an actual Spring pattern just occurred and the trend filter passes, the indicator highlights that candle in cyan directly on the price chart — this is the "Elite Entry Signal," meant to flag the highest-conviction buying opportunities.
- This elite signal is also registered so it can be used in scanners/alerts, letting you automatically screen for these setups across many tickers.
- In practice: watch for cyan candles or score spikes above 70 as potential low-risk entries after a shakeout, ideally in an established uptrend, and treat yellow zones as "watch list" conditions rather than action signals.
describe_indicator('Explosive Accumulation Pro (Energy & Kinetic Spring)', 'lower');
// =====================================================================
// INPUTS & PARÁMETROS CALIBRADOS (OPTIMIZACIÓN CUANTITATIVA)
// =====================================================================
const springLookback = input.number('Spring Lookback Window', 15, { min: 10, max: 30 });
const minLowerWickPct = input.number('Min Lower Wick % (Absorción)', 25, { min: 10, max: 50 });
const minClosePositionPct = input.number('Min Close Position %', 65, { min: 50, max: 80 });
const useTrendFilter = input.boolean('Filter Above 200 SMA', true);
const trendMaPeriod = input.number('Trend SMA Period', 200, { min: 50, max: 200 });
// Calibración de Volatilidad
const atrPeriod = input.number('ATR Period', 14, { min: 5, max: 50 });
const atrSmaPeriod = input.number('ATR SMA Period', 20, { min: 10, max: 50 });
const volSqueezeThreshold = input.number('ATR Squeeze Ratio', 0.85, { min: 0.70, max: 0.95 });
// Safety epsilon
const EPS = 0.0000001;
const safeDiv = (num, den) => Math.abs(den) < EPS ? 0 : num / den;
// =====================================================================
// 1. FILTRO DE TENDENCIA / CONTEXTO INSTITUCIONAL
// =====================================================================
const trendSma = sma(close, trendMaPeriod);
const trendOk = for_every(close, trendSma, (_c, _ma) => {
if (!useTrendFilter) return 1;
return (_c > _ma) ? 1 : 0;
});
// =====================================================================
// 2. GEOMETRÍA DE LA VELA & ABSORCIÓN DE OFERTA (Velas de Energía)
// =====================================================================
const barRange = for_every(high, low, (_h, _l) => Math.max(_h - _l, EPS));
const avgBarRange = sma(barRange, 20);
// Posición relativa del cierre en el rango (0 = mínimo, 1 = máximo)
const closePosition = for_every(close, low, barRange, (_c, _l, _r) => safeDiv(_c - _l, _r));
// Mecha inferior real (Presión compradora / absorción en el suelo)
const lowerWickPct = for_every(open, close, high, low, barRange, (_o, _c, _h, _l, _r) => {
const bottomBody = Math.min(_o, _c);
return safeDiv(bottomBody - _l, _r) * 100;
});
// =====================================================================
// 3. ENERGÍA CINÉTICA & EXPANSIÓN DE VOLUMEN
// =====================================================================
const avgVolume = sma(volume, 20);
const volExpansion = for_every(volume, avgVolume, (_v, _av) => (_av > EPS && _v > _av * 1.25) ? 1 : 0);
// Vela de Energía: Rango amplio + Cierre fuerte + Absorción de mecha
const energyCandle = for_every(closePosition, lowerWickPct, volExpansion, (_cp, _lw, _ve) => {
return (_cp >= (minClosePositionPct / 100) && _lw >= minLowerWickPct && _ve === 1) ? 1 : 0;
});
// =====================================================================
// 4. COMPRESIÓN DE VOLATILIDAD (Calibrada a 0.85)
// =====================================================================
const myAtr = atr(high, low, close, atrPeriod);
const atrSma = sma(myAtr, atrSmaPeriod);
const volatilitySqueeze = for_every(myAtr, atrSma, (_a, _as) => (_as > EPS && (_a / _as) < volSqueezeThreshold) ? 1 : 0);
// =====================================================================
// 5. DETECCIÓN ROBUSTA DE WYCKOFF SPRING
// =====================================================================
// Perforación de soporte previo y cierre recuperado de inmediato
const springSignal = for_every(low, close, (_l, _c, _prev, _idx) => {
if (_idx <= springLookback) return 0;
let priorSupport = Infinity;
for (let i = 1; i <= springLookback; i++) {
const prevLow = low[_idx - i];
if (prevLow < priorSupport) priorSupport = prevLow;
}
// Perfora soporte y cierra por encima
return (_l < priorSupport && _c > priorSupport) ? 1 : 0;
});
// =====================================================================
// 6. MOTOR DE PUNTUACIÓN DE ACUMULACIÓN EXPLOSIVA
// =====================================================================
const accumulationScore = for_every(
springSignal, energyCandle, volatilitySqueeze, trendOk, closePosition,
(_spring, _energy, _sq, _trend, _cp) => {
let score = 0;
if (_spring > 0) score += 40; // Patrón base de alta convicción
if (_energy > 0) score += 30; // Vela de energía y absorción
if (_sq > 0) score += 15; // Compresión previa de volatilidad
if (_cp >= 0.70) score += 15; // Cierre en tercio superior
// Si no está sobre tendencia MA200, penalizar score a la mitad
if (_trend === 0) score = Math.floor(score * 0.5);
return Math.min(score, 100);
}
);
// Señal de Entrada de Élite (Spring confirmado + Vela de energía + Tendencia)
const eliteEntrySignal = for_every(accumulationScore, springSignal, trendOk, (_score, _spring, _trend) => {
return (_score >= 70 && _spring > 0 && _trend > 0) ? 1 : 0;
});
// =====================================================================
// VISUALIZACIÓN & PINTADO EN GRÁFICO
// =====================================================================
paint(accumulationScore, {
style: 'histogram',
color: for_every(accumulationScore, _s => _s >= 70 ? 'lime' : (_s >= 40 ? 'yellow' : 'gray')),
name: 'Accumulation Score Pro'
});
paint(horizontal_line(70), { style: 'dotted', color: 'lime', name: 'Elite Buy' });
paint(horizontal_line(40), { style: 'dotted', color: 'yellow', name: 'Moderate' });
// Alerta de Velas
color_candles(for_every(eliteEntrySignal, _sig => _sig > 0 ? 'cyan' : null));
register_signal(eliteEntrySignal, 'Elite Energy Spring');