Ehlers – Adaptive Cyber Cycle

Ehlers – Adaptive Cyber Cycle

Hello,

this is my first sharing in ProRealCode.

I’ve converted the Adaptive Cycle Indicator from TradingView, that was coded by LazyBear: https://it.tradingview.com/script/3lV1e3ci-Ehlers-Adaptive-Cyber-Cycle-Indicator-LazyBear/

Feel free to contact me if you find bug or share the corrections.

Happy Trading.

This is the code for the indicator Adaptive Cyber Cycle:

You need also to code the function “[FN] MED” called in the script.

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. ALE • 06/01/2017 #

    Hello Pietro
    thanks for your code, could you suggest to use it?

  2. Pietro Fontana • 06/01/2017 #

    Hi Ale,
    the use is similar to other oscillator, mainly divergence.
    In this link you will find some graphical example from lazybear that explain pretty well the use: https://it.tradingview.com/script/3lV1e3ci-Ehlers-Adaptive-Cyber-Cycle-Indicator-LazyBear/
    Regards.

  3. Pietro Fontana • 06/01/2017 #

    Hello people,
    i’ve made a little modification in the code for eliminate the function call. Now the indicator should work much faster.
    Enjoy.
     
    // @author Pietro Fontana
    // Kudos to LazyBear to made it in TradingView

    src=typicalprice
    a=.07
    s = (src + 2*src[1] + 2*src[2] + src[3])/6.0
    if barindex < 7 then
    c = (src - 2*src[1] + src[2])/4
    ac = (src-2*src[1]+src[2])/4
    endif
    if barindex > 7 then
    c = ((1 - 0.5*a)*(1 - 0.5*a)*(s - 2*s[1] + s[2]) + 2*(1-a)*c[1] - (1 - a)*(1-a)*c[2])
    q1 = (.0962*c + 0.5769*c[2] - 0.5769*c[4] - .0962*c[6])*(0.5+.08*ip[1])
    I1 = c[3]
    if q1 <> 0 and q1[1] <> 0 then
    dp1 = (I1/q1 - I1[1]/q1[1]) / (1 + I1*I1[1]/(q1*q1[1]))
    else
    dp1 = 0
    endif
    if dp1 < 0.1 then
    dp2 = 0.1
    else
    if dp1 > 1.1 then
    dp2 = 1.1
    else
    dp2 = dp1
    endif
    endif
    myFNMED1 = (dp2[2] + dp2[3] + dp2[4]) - min(dp2[2],min(dp2[3], dp2[4])) - max(dp2[2],min(dp2[3], dp2[4]))
    md = (dp2 + dp2[1] + myFNMED1) - min(dp2,min(dp2[1], myFNMED1)) - max(dp2,min(dp2[1], myFNMED1))
    if md = 0 then
    dc = 15
    else
    dc = 6.28318 / md + 0.5
    endif
    ip = .33*dc + .67*ip[1]
    p = .15*ip + .85*p[1]
    a1 = 2/(p+1)
    ac = ((1-0.5*a1)*(1-0.5*a)*(s-2*s[1]+s[2])+2*(1-a1)*ac[1]-(1-a1)*(1-a1)*ac[2])
    t = ac[1]
    endif

    return ac as \"Adaptive Cyber Cycle\", t as \"ACC[1]\", 0 as \"0\"
     

    • Nicolas • 06/01/2017 #

      Very cool! Thanks a lot for the update! much appreciated 🙂

  4. johnb9999 • 06/01/2017 #

    Just a suggestion, not an expert, what happens if the barindex = 7

  5. Alai-n • 06/01/2017 #

    Hello … What does FN-MED mean exactly in the code complement? It is a mess to load the indicator!

    • Pietro Fontana • 06/01/2017 #

      Hi Alain,
      in the comment there’s a version that does not require the call function, and is more fast, but don’t expect good performance, prorealcode was not built with performance in mind.

  6. Alai-n • 06/01/2017 #

    Ok thank you Pietro…

  7. Halan • 06/01/2017 #

    thank you for the code.

    coded as per above, I encounter an error “unexpected character” (i.e. “ip” in line q1 = (.0962*c + 0.5769*c[2] – 0.5769*c[4] – .0962*c[6])*(0.5+.08*ip[1])

    i suspect that may be because it ( ip) has not been previously defined. can you help please??

    thank you

  8. Gianluca • 06/01/2017 #

    Hello there is a new version, is it possible to translate it?

    https://www.tradingview.com/script/CPLfkmht-Ehlers-Stochastic-Cyber-Cycle/

  9. christophe11560 • 06/01/2017 #

    bonjour,
    PRT me demande de réduire la période d’adaptive cyber Cycle suite à de fort ralentissement de l’appli.
    Lorsque je rajoute “defparam calculateonlastbars = 200”
    Les 2 courbes disparaissent. Uniquement la ligne horizontale 0. Comment je peux faire ?
    merci

  10. Pietro Fontana • 06/01/2017 #

    christophe11560, i’ve coded this a long time ago for a different version of the PRT, i’m not using PRT anymore.

    Have you tried with the code that i’ve posted in the comment, not the one that you can download? It’s faster.

    @Gianluca, sorry but i don’t use PRT anymore, anyway what you linked is another indicator i think.

    Best regards.

avatar
Register or

Likes

avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar avatar
Related users ' posts
Fgats https://www.prorealcode.com/topic/indicateur-3-sigma-documentation/ lien pour la documentat...
DELBERT Bonjour , merci pour le partage et la traduction , je vais essayer d'assimiler ce nouvelle i...
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.
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 ...
ggolfet Hi Actarus, what's the name of the histogram indicator below Apple's chart?
Actaru5 Flag ShowState in setting and show histogram
NicolaSilvagni hi, thank you for creating this indicator. i can't figure out how to get the three graphs b...
Nicolas Check your custom trading hours and use the default market ones.
fj_pastor Hello Nicolas, Thanks again for all your support. Finally I debugged the problem. The sim...
kallistos Hi Nicolas, Thank you very much indeed for this indicator (and all the others you are provi...
Morrissey38 Muchísimas gracias Nicolás , muy amable.
Bruno Carnazzi extrèmement pertinent
Bruno Carnazzi Is that beatable ?
Sapo Thank you for your indicators. As always it's perfect, I thank you for your help it's preci...
Sapo Thank you very much. as always your indicators are extremely effective. kind regards Vonasi.
mitsu21 Hi, it looks nice. I'll try it tomorrow thank you for your share kind regards bruno
kj1988 Thank you Vonasi for sharing this indicator. Very useful as a comfirmation to the price act...
eivaremir have u got the trading view version?
Bard I've also just noticed that changing the "Bands Deviation" setting from 1.25 to eg 3 doesn't...
bartekz Hi @Nicolas, Really impressed by your work. I am trying to replicate the Wave-PM indicator t...
Nicolas You don't have to replicate it, download the file and import it into your platform.
Nicolas Sorry I do not provide assistance for Tradestation code.
surfeur Bonjour, Je suis pas expert en PRT donc si qq'un peut m'expliquer un peu le code ? Par...
Nicolas src c'est bien le customclose en effet. ATR, si aucune série de données n'est spécifié, il u...
carlvan That's a great indicator and I especially the use of colors, more or less pronounced to indi...
diegofe_2000 CORDIAL SALUDO. CUANDO REALIZO UN PROGRAMA CON ESTE INDICADOR ME SALE EL SIGUIENTE LETRE...
ALE Hello do you want to explain to me in more detail what you have to do? Please replay here:...
luxrun Roberto, I tried again to use both the SHI indicator and the WPO oscillator but they don't w...
robertogozzi WPO should work as posted at https://www.prorealcode.com/prorealtime-indicators/wpo-wave-per...
luxrun Now is ok! Thanks a lot
PastaPesto Hello Roberto! Thank you for this indicator. I thought I would try it out in a strategy, bu...
robertogozzi I just realized that there's a line that shouldn't be there. It's line 5, please remove it,...
robertogozzi I just discovered that ProOrder (for automated strategies) does not evaluate the expression ...
luxrun bellissimo lavoro, Roberto, grazie!
robertogozzi I just discovered that ProOrder (for automated strategies) does not evaluate the expression ...
Akram Hi Roberto the WPZO is the bounded oscillator by percentage like the SHO Here is the artic...
skysoldier hello, thank you for this code, I was wondering if it is compatible with thinkorswim at all?
Nicolas No, but you can ask for private coding job at our programming services.

Top