The Cybernetic Oscillator is a zero-centered, energy-normalized momentum oscillator inspired by John Ehlers’ digital signal processing work. It combines a high-pass filter to remove drift, a 2nd-order Super Smoother to reduce noise, and RMS normalization so the amplitude remains comparable across markets and timeframes. The result is a responsive, clean oscillator that highlights direction changes and strength without being dominated by raw volatility.
Price → remove trend with a 2nd-order High-Pass → reduce noise via 2nd-order Super Smoother → scale by RMS of recent energy → plot oscillator with zero line and ±thresholds.
hpPeriod. Coefficients use exp, cos and π to emulate a digital HP.hp, removing low-frequency drift.lpPeriod. Applied to the average of hp and hp[1] to reduce phase noise.lp, a smooth band-passed signal.rmsLen of lp².osc = lp / max(rms, ε) so amplitude ≈ 1 in steady conditions.osc, zero line, and optional ±threshold.hpPeriod = 30lpPeriod = 20rmsLen = 100threshold = 1+threshold or below -threshold indicate stronger impulses.osc fails to confirm often precedes momentum fades.Tip: Treat ±threshold as context, not absolute signals. Combine with trend/volatility filters.
+threshold, allow a wider stop; otherwise, be tighter.-threshold, look for osc to curl back up and cross zero.Risk management: Always define invalidation (e.g., ATR-based stops or swing points) and position sizing before entries.
hpPeriod + lpPeriod can mute useful signals.rmsLen can inflate amplitude after brief shocks.threshold when volatility regime changes.// ====================================================
//PRC_Cybernetic Oscillator (John Ehlers, TASC 2025)
//version = 0
//01.10.25
//Iván González @ www.prorealcode.com
//Sharing ProRealTime knowledge
// ====================================================
// ----- Parámetros
hpPeriod = 30 // Periodo filtro Highpass
lpPeriod = 20 // Periodo filtro Lowpass (Super Smoother)
rmsLen = 100 // Longitud RMS
threshold = 1 // Umbral opcional
// ----- Constantes
pi = 3.1415926535
sqrt2 = 1.41421356237
src = close
// ====================================================
// Calculos
// ====================================================
if barindex>=4 then
// ----- High-Pass Filter (2nd order)
a0 = sqrt2 * pi / hpPeriod
a1 = EXP(-a0)
c2hp = 2*a1*COS(a0*180/pi)
c3hp = -(a1*a1)
c1hp = (1 + c2hp - c3hp) * 0.25
hp = 0
hp = c1hp * (src - 2*src[1] + src[2]) + c2hp*hp[1] + c3hp*hp[2]
// ----- Super Smoother (Low-Pass, 2nd order)
a0lp = sqrt2 * pi / lpPeriod
a1lp = EXP(-a0lp)
c2lp = 2*a1lp*COS(a0lp*180/pi)
c3lp = -(a1lp*a1lp)
c1lp = 1 - c2lp - c3lp
lp = 0
lp = c1lp * 0.5*(hp + hp[1]) + c2lp*lp[1] + c3lp*lp[2]
endif
// ====================================================
// RMS Normalization
// ====================================================
pow2 = lp*lp
rms = SQRT(Average[rmsLen](pow2))
epsilon = 0.000001
den = MAX(rms, epsilon)
osc = lp / den
// ====================================================
// Líneas de referencia
// ====================================================
zeroline = 0
upth = threshold
lowth = -threshold
if osc > 0 then
red=0
green=255
blue=0
else
red=255
green=0
blue=0
endif
// ====================================================
RETURN osc AS "Cybernetic Osc" coloured(red,green,blue)style(histogram),zeroline COLOURED(200,200,200) AS "0",upth COLOURED(150,150,150) AS "+Threshold",lowth COLOURED(150,150,150) AS "-Threshold"