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
Nicolas Thanks again for all your valuable posts... and well formatted code! :)
Abdelkrim Maksour hi sir is this indicator for mt4 and how i can get one .
Nicolas Thanks a lot for this new valuable addition to our library. I changed line 76 with "barindex...
Horance Thanks. I've noticed this leftover after submission, but it was too late for editing. BTW, I...
Etienne Thanks Horance for porting this code to PRT. I would like to bring some speedup to your cod...
Horance This is a good question. John Ehlers explains it in Rocket Science for Traders. You have to ...
cbeukes Much appreciated, I will give that a try. Also, is there any criteria that one could use to ...
avatar
Anonymous Thanks for the code! I'm trying to understand how it works, and have a few questions... line...
Bebbo Grazie del prezioso contributo Nicolas, scusa la mia inesperienza, sono alle prime armi e s...
Nicolas To avoid recalculation, you should use the one from this post.
Bebbo Ok Grazie Nicolas.
ALE Hi the color is given by a numerical value derived from the oscillator in use. If you comp...
efahmy Thanks mate
Jo-01-R Hello, it is possible to have this indicator but instead of colors rather have numbers rangi...
Appsoluxions Hi Nicolas, do you have the MT4 version of the indicator? I am not sure if these kind of que...
Nicolas Hi, don't have one sorry. But you can still ask for private coding through our programming s...
Appsoluxions Cool. Thanks for the response.
Etienne Hi, thanks for proving this code. I would like to contribute by adding a computation speed...
Etienne //Compute Super Smoother coefficients once if barindex = 1 then a1 = exp( -1.414 * 3.14159...
Nicolas Thanks a lot!
Bard From the url link #post-65420 above but without the chart image: Stocks & Commodities...
Bard Note: lter = filter
Bard Apologies, there's been an issue with copying "f" and "I" from the article and pasting.. whi...
Nicolas
6 years ago
Nicolas Oui. Pour changer la période, il faudra ajuster la variable MMperiod
macbartin plus la période est grande (en occurrence 20) plus l'indicateur est précis dans les changeme...
Hasardeur Hallo Nicolas, in John Ehlers book "cycle analytics for Traders" from 2013, Mr. Ehlers desc...
Khaled Thanks, but if I may ask what's EMA Period? The price which reverses the EMA[20] is not the ...
Francesco78 EMA is not a moving average, it is just the name we called the quantity defined above
Khaled My bad. Thank you so much!
Kris75 Hi Bolsatrilera, I love this indicator! Thanks; => did you develop a strategy around...
Francesco
7 years ago
oraclus Merci il lui ressemble bcp
juanj Think this is something we can experiment with in the 'universal' strategy along with the Bo...
ggolfet Hello Francesco, thanks for the code. Now I can do backtests on this indicator. I'm testin...
Abz  hi , you need to add the indicator from the "price" menu in chart
Francesco Thank you Abz!
phanz Hi Nicolas, this is an interesting strategy. For long position, I assume entry when prices ...
vitatrader35 Hola, Diego Puedes explicar cómo lo usas? Estoy tratando de emplearlo como validación de te...
diegofe_2000 Compra a la baja :  cruce de MEAN sobre AVG PEAK Compra al alza :   cruce de MEAN con AVG...
andrea ronca hi, do you know the best configuration for period, delta and fraction? thanks in advance
Etienne Hi, I'm quite late in this thread. I'd just like to propose an enhancement because this in...
Nicolas Thanks Etienne.
Bard Hi Nicolas, I wanted to make this scaled indicator above between -1 and +1 instead of 0 to +...
robertogozzi Vous ne pouvez pas, car ProBuilder ne prend actuellement pas en charge MTF (Multiple Time Fr...
jeanguy Merci pour ce travail En quoi cette MM est elle différente d’une MM courte ?
Bern latest version pro real time not accepting code, same with Ehler's MAMA indicator. any idea...

Top