Cybernetic Oscillator

Cybernetic Oscillator

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.

Key Features at a Glance

  • Band-pass behavior: High-pass → Super Smoother low-pass chain isolates tradable swings.
  • RMS normalization: Divides by rolling RMS of the filtered signal to stabilize amplitude.
  • Zero-centered: Clear polarity around the 0-line for bias flips.
  • Threshold bands (±1 by default): Optional gating for “strong” moves.
  • Polarity coloring: Green above zero, red below, for instant read.

Intuition First: The Signal Pipeline

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.

  • The HP filter strips slow drift so momentum flips are timely.
  • The Super Smoother suppresses jitter without excessive lag.
  • RMS normalization keeps values consistent, making ±1 a meaningful, portable reference.

Formula Breakdown

  1. High-Pass (2nd order)
    • Frequency set by hpPeriod. Coefficients use expcos and π to emulate a digital HP.
    • Output: hp, removing low-frequency drift.
  2. Super Smoother (2nd order Low-Pass)
    • Frequency set by lpPeriod. Applied to the average of hp and hp[1] to reduce phase noise.
    • Output: lp, a smooth band-passed signal.
  3. RMS Normalization
    • Compute rolling RMS over rmsLen of lp².
    • Normalize: osc = lp / max(rms, ε) so amplitude ≈ 1 in steady conditions.
  4. Display & Thresholds
    • Plot osc, zero line, and optional ±threshold.
    • Dynamic color: green above zero, red below.

Inputs & Defaults

  • hpPeriod = 30
    Controls how aggressively drift is removed.

    • Shorter (15–25): faster bias flips, more whipsaws.
    • Longer (35–50): steadier bias, slower to turn.
  • lpPeriod = 20
    Governs smoothing of the high-pass output.

    • Shorter (10–16): snappier but noisier.
    • Longer (22–30): calmer but laggier.
  • rmsLen = 100
    Window for energy normalization.

    • Shorter (50–80): amplitude adapts quickly to volatility shifts.
    • Longer (120–200): more stable scaling across regimes.
  • threshold = 1
    Optional gating for “strong” moves.

    • Raise to 1.25–1.5 in choppy markets to reduce false positives.
    • Lower to 0.7–0.9 to be more permissive.

How to Read the Oscillator

  • Zero-line flips: Crossing above 0 suggests bullish momentum bias; below 0 suggests bearish.
  • Threshold zones: Moves beyond +threshold or below -threshold indicate stronger impulses.
  • Divergences: Price making new extremes while osc fails to confirm often precedes momentum fades.
  • Regime awareness: In strong trends, pullbacks may stall near the zero line; in ranges, price mean-reverts around zero more frequently.

Tip: Treat ±threshold as context, not absolute signals. Combine with trend/volatility filters.

Trading Playbooks (Examples, Not Advice)

  1. Momentum Flip
    • Entry: Bias flip through zero in trend direction (e.g., price above a slow MA, oscillator crosses > 0).
    • Exit: First loss of momentum back through zero or trail with ATR.
    • Use threshold: If the first push also clears +threshold, allow a wider stop; otherwise, be tighter.
  2. Pullback Continuation
    • Uptrend: After a dip above -threshold, look for osc to curl back up and cross zero.
    • Downtrend: Mirror logic with +threshold.
    • Idea: Avoid deeper counter-trend swings that pierce the opposite threshold.
  3. Range Mean-Reversion
    • In sideways regimes, fade moves that tag ±threshold when price is at range extremes.
    • Exit near the zero line or mid-range.

Risk management: Always define invalidation (e.g., ATR-based stops or swing points) and position sizing before entries.

Best Practices & Common Pitfalls

  • Don’t over-filter: Very long hpPeriod + lpPeriod can mute useful signals.
  • Keep RMS realistic: Too small rmsLen can inflate amplitude after brief shocks.
  • Mind regime shifts: Re-tune threshold when volatility regime changes.
  • Use confirmations: Pair zero-cross ideas with a simple regime filter (e.g., MA slope) and a volatility filter (e.g., ATR percentile) to decide whether to run momentum or mean-reversion playbooks.

Code (ProBuilder)

Share this

Risk disclosure:

No information on this site is investment advice or a solicitation to buy or sell any financial instrument. Past performance is not indicative of future results. Trading may expose you to risk of loss greater than your deposits and is only suitable for experienced investors who have sufficient financial means to bear such risk.

ProRealTime ITF files and other attachments : How to import ITF files into ProRealTime platform?

PRC is also on YouTube, subscribe to our channel for exclusive content and tutorials

  1. YvesRobert • 12 hours ago #

    Hello Ivan, I see that you are very good in PRT coding. Is it possible to have a code who searchs absorptions ? I think we have now the possibility to read volume exchange per price with PRT DOM but I don’t know if there are coding instructions for that.
    Thank you for your very good you work.

    • Iván • 7 hours ago #

      Hi. It is not possible to detect true absorptions with ProBuilder code. The PRT language does not provide access to order book (DOM) data or volume per price. Only bar volume and tick volume are available.

avatar
Register or

Likes

avatar avatar avatar
Related users ' posts
Marc Boliart Hi! i do not know why _v.1.1"] was on 1st line, remember to remove it!
sam00075 Accuracy is on point.
Mubin1308 Bonjour à tous, J'ai importé le fichier mais ça ne marche pas, rien qui s'affiche. Pourriez...
hdb1 Thank you so much Ivan..Been using this on 30min timeframe with excellent results. Now my ma...
Iván
11 months ago
Madrosat Bonjour ivan Quelle différence il y a t il entre Extra trend et ultra trend lequel est le p...
luxrun grazie Ivàn!
lee Thank you. Is it possible to convert this to a screener that displays instruments when bulli...
Iván //---------------------------------------------------------------// //PRC_Pollan Indicator /...
okeus Ciao, il tuo lavoro è incredibile, ti chiedo una cortesia è possibile veder un grafico con ...
kats BONJOUR je lai mis sur du renko , il est complexe car toujours a l'envers??? Peut être ne ...
RTR Great tool again and great job, thank you! So from what I see everytime Z-Score is over 0 m...
yas hi ivan I have logged this last week if when you get a chance if this can be converted ple...
Madrosat how do you use carnazzi filter in a strategy : smoothing , stop ,tendance
Bruno Carnazzi I have completely revised the mathematical foundations of this tool and offer you the finali...
Bruno Carnazzi Il me semble que la fonction "floor" n'est disponible qu'avec PRT11, à vérifier
DELBERT Bonjour , merci pour votre réponse , je m'excuse je suis avec PRT v10.3 donc c'est indicateu...
Nicolas c'est juste, c'est une instruction très récente.
atlante hi nicolas this indicator have 2 wrong borderline and islalastbarupdate. thank you can you h...
Nicolas That'"s because you are not using PRT v11? Just remove lines 59 to 62
robertogozzi An updated version can be found here https://www.prorealcode.com/topic/conversion-of-pine-sc...
jissey Bonjour Robertogozzi, cet indicateur est interessant mais serait-il possible de marquer la ...
robertogozzi Sure, but you should start a new topic on the Probuilder support forum. Thank you :)
RubberToe Is there something we are missing here, I just get the same curved line as well...
Khaled @Nicolas, Hi Nicolas, I've downloaded the itf and it doesn't display as an Oscillator, it"s ...
sal157011 I think the problem here is that you must feed the trigonometric functions cos and sin with ...
robertogozzi I don't actually know what they are calculating. As soon as I know, I will post further info.
robertogozzi It's because they calculate future bars, that's why it's not possible to use that indicator ...
poldoposta si potrebbe trovare una soluzione per sovrapporlo al prezzo?
robertogozzi Basta che tu clicchi sull'etichetta (tag) PREZZO del grafico (appena sotto l'angolo in alto ...
FernetTrader think i found a solution!
monochrome Thanks for the indicator. Very interesting!
monochrome Can you please share how you made it work? I cant seem to make it work in a strategy

Top