# Ehlers – Adaptive Cyber Cycle

Hello,

this is my first sharing in ProRealCode.

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

This is the code for the indicator Adaptive Cyber Cycle:

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

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?

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

1. • 06/01/2017 #

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

2. • 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. • 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

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\"

• • 06/01/2017 #

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

4. • 06/01/2017 #

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

5. • 06/01/2017 #

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

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

Ok thank you Pietro…

7. • 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. • 174 days ago #

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

Register or

#### Likes

Related users ' posts
Nicolas
2 months ago
v10.3
2
Indicators
Hi Nicolas, thanks a lot for coding this interesting looking indicator. I read: https://...
I've also just noticed that changing the "Bands Deviation" setting from 1.25 to eg 3 doesn't...
Nicolas
3 months ago
6
Indicators
I don't know, that code is a 1:1 translation from another platform.
Hello Nicolas, Is this a conversion from Tradestation Easy Language? If so, do you have a ...
Sorry I do not provide assistance for Tradestation code.
AlexF
3 months ago
0
Indicators
ALE
4 months ago
v10.3
10
Indicators
:-) thanks
Hola amigos. El indicador con la nueva versión de PRT funciona muy mal, no dibuja igual que ...
Salut, les amis. L'indicateur avec la nouvelle version de PRT 11 fonctionne très mal, ne fon...
robertogozzi
5 months ago
9
Indicators
Ok, thank you
I just discovered that ProOrder (for automated strategies) does not evaluate the expression ...
//Ti = ((close > Cy) * Tt) OR (((close Cy) THEN Ti = Tt ELSE Ti = -Tt ENDIF
robertogozzi
5 months ago
4
Indicators
Hello Roberto! Thank you for this indicator. I thought I would try it out in a strategy, bu...
I just realized that there's a line that shouldn't be there. It's line 5, please remove it,...
I just discovered that ProOrder (for automated strategies) does not evaluate the expression ...
robertogozzi
5 months ago
3
Indicators
bellissimo lavoro, Roberto, grazie!
I just discovered that ProOrder (for automated strategies) does not evaluate the expression ...
Hi Roberto the WPZO is the bounded oscillator by percentage like the SHO Here is the artic...
Nicolas
11 months ago
v10.3
2
Indicators
hello, thank you for this code, I was wondering if it is compatible with thinkorswim at all?
No, but you can ask for private coding job at our programming services.
Horance
12 months ago
2
Indicators
Thanks again for all your valuable posts... and well formatted code! :)
hi sir is this indicator for mt4 and how i can get one .
Horance
12 months ago
0
Indicators
Horance
12 months ago
0
Indicators
Horance
12 months ago
0
Indicators
Horance
12 months ago
3
Indicators
Thanks a lot for this new valuable addition to our library. I changed line 76 with "barindex...
Thanks. I've noticed this leftover after submission, but it was too late for editing. BTW, I...
Thanks Horance for porting this code to PRT. I would like to bring some speedup to your cod...
Horance
12 months ago
4
Indicators
This is a good question. John Ehlers explains it in Rocket Science for Traders. You have to ...
Much appreciated, I will give that a try. Also, is there any criteria that one could use to ...
Thanks for the code! I'm trying to understand how it works, and have a few questions... line...
Nicolas
12 months ago
v10.3
5
Indicators
Grazie del prezioso contributo Nicolas, scusa la mia inesperienza, sono alle prime armi e s...
To avoid recalculation, you should use the one from this post.
Ok Grazie Nicolas.
ALE
1 year ago
v10.3
6
Indicators
:-)
Hola Ale Can we have this same code from Nicolas's code in smoothed heikin Ashi? Sorry...
Ok, We can discuss in the topic "3D Candlesticks TOPIC" Write me more details
Nicolas
1 year ago
9
Indicators
Hi Nicolas, do you have the MT4 version of the indicator? I am not sure if these kind of que...
Hi, don't have one sorry. But you can still ask for private coding through our programming s...
Cool. Thanks for the response.
Despair
1 year ago
5
Indicators
Hi, thanks for proving this code. I would like to contribute by adding a computation speed...
//Compute Super Smoother coefficients once if barindex = 1 then a1 = exp( -1.414 * 3.14159...
Thanks a lot!
Despair
1 year ago
6
Indicators
From the url link #post-65420 above but without the chart image: Stocks & Commodities...
Note: lter = filter
Apologies, there's been an issue with copying "f" and "I" from the article and pasting.. whi...
Nicolas
2 years ago
v10.3
9
Indicators
merci, possible de l'utiliser seul pour le faire fonctionner en tant que stratégie ? de même...
Oui. Pour changer la période, il faudra ajuster la variable MMperiod
plus la période est grande (en occurrence 20) plus l'indicateur est précis dans les changeme...

Top