Cybernetic Oscillator by John F. Ehlers

Forums ProRealTime English forum ProBuilder support Cybernetic Oscillator by John F. Ehlers

Viewing 5 posts - 1 through 5 (of 5 total)
  • #251959

    Hello guys,

    I’ve coded the cybernetic oscillator by John F. Ehlers, taking it from the article “Making a Better Oscillator” from the TASC journal, but I’ve faced some issues.

    The original code is written in Easy Language, you can find it in the pdf attached. I wrote in the same page the code of the high-pass filter, the Super Smoother and the RMS formula to obtain the final formula of the cybernetic oscillator, without calling the other indicators from external codes.

    The problem is that the oscillator’s values exploded in the first periods while are too small in the latests, so it seems like it’s not normalized as it should.

    Can anyone help me? The following is the code written in ProRealTime:

    #252008

    The PDF file is missing, if you can’t attach it, please post the text of the code.

     

    #252044

    Hi! I found the oscillator in trading view.

    1 user thanked author for this post.
    #252061

    Ops, sorry, It hasn’t been uploaded. I’ll try again, if it doesn’t work, here is the code, written in EasyLanguage from the original file:

    High-Pass filter:

    {
    Highpass Function
    (C) 2004-2024 John F. Ehlers
    }
    Inputs:
    Price(numericseries),
    Period(numericsimple);
    Vars:
    a1(0),
    b1(0),
    c1(0),
    c2(0),
    c3(0);
    a1 = expvalue(-1.414*3.14159 / Period);
    b1 = 2*a1*Cosine(1.414*180 / Period);
    c2 = b1;
    c3 = -a1*a1;
    c1 = (1 + c2 – c3) / 4;
    If CurrentBar >= 4 Then $HighPass = c1*(Price – 2*Price[1] +
    Price[2]) + c2*$HighPass[1] + c3*$HighPass[2];
    If Currentbar < 4 Then $HighPass = 0; Super Smoother: { SuperSmoother Function (C) 2004-2025 John F. Ehlers } Inputs: Price(numericseries), Period(numericsimple); Vars: a1(0), b1(0), c1(0), c2(0), c3(0); a1 = expvalue(-1.414*3.14159 / Period); b1 = 2*a1*Cosine(1.414*180 / Period); c2 = b1; c3 = -a1*a1; c1 = 1 - c2 - c3; If CurrentBar >= 4 Then $SuperSmoother =
    c1*(Price + Price[1]) / 2 + c2*$SuperSmoother[1] +
    c3*$SuperSmoother[2];
    If Currentbar < 4 Then $SuperSmoother = Price; Root Mean Square: { RMS Function (C) 2015-2025 John F. Ehlers } Inputs: Price(numericseries), Length(numericsimple); Vars: SumSq(0), count(0); SumSq = 0; for count = 0 to Length - 1 Begin SumSq = SumSq + Price[count]*Price[count]; End; If SumSq <> 0 Then $RMS = SquareRoot(SumSq / Length);

    Final formula of the Cybernetic Oscillator:

    {
    Cybernetic Oscillator
    (C) 2025 John F. Ehlers
    }
    Inputs:
    HPLength(30),
    LPLength(20);
    Vars:
    HP(0),
    LP(0),
    RMS(0),
    CyberneticOsc(0);
    HP = $HighPass(Close, HPLength);
    LP = $SuperSmoother(HP, LPLength);
    RMS = $RMS(LP, 100);
    If RMS <> 0 Then CyberneticOsc = LP / RMS;
    Plot1(CyberneticOsc);
    Plot2(0);

    #252066

    Thanks!
    I did wrong something about the RMS formula, I guess, now the values are way more stable and the same of the cybernetic oscillator posted on TradingView.

Viewing 5 posts - 1 through 5 (of 5 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login