Contribute an indicator to the library by clicking here. Note you must be logged in.

New! Stock Portfolio Organizer is now available:
  • Shares, Margin, Futures and Forex
  • EOD and Realtime data
  • And Much More...
GoTo Stock Portfolio Organizer
New! WiseTrader Toolbox for Amibroker is now available with:
  • Advanced Adaptive Indicators
  • Advanced Pattern Exploration
  • Neural Networks
  • And Much More...
GoTo WiseTrader Toolbox

Popular Indicators

John F. Ehlers Autocorrelation Periodogram for Amibroker (AFL)

3 / 5 (Votes 5)

Good Day! I translated indicator “Autocorrelation Periodogram” from book “Cycle Analytics for Traders”. Who needs the other indicators from this book on AFL I can do without problems. Best Regards, Ilya

Here is a screenshot of how the indicator looks:

Similar Formulas




dominant cycle = 0; "syntax error???

Dear Ilya,

Thanks for sharing the code, its very good.
Request you please develop & share other indicators mentioned in the book.


The book (Free PDF) is available at

Guys interested can down load from there

5. Unlis

davidalan, “dominant cycle = 0; syntax error???” – сan you explain what is wrong? I am here simply declare an array and fills it with zeros.

Ilya, Autocorrelation Reversals code would be much apreciated.
kv_maligi, your free pdf has only 26 pages.

7. Unlis

sal157011, Ok!

i too realized after some time going thrpugh it. I am searching for full PDF.
I tried to read those pages, but looked Greek to me.

The code “Autocorrelation Periodogram”, after attaching to a chart, gives trend direction & also strength of the trend clearly. As saying goes “A picture reveals 1000 secretes….”

Its superb coding by llya, It seems he is blessed with lots of skills, I am sure he will develop all useful codes.


9. Unlis

Friends, “Autocorrelation Reversals” waiting for the approval.

10. parfumeur

Very nice work. You do need the book to understand what the indicator says.

Do post in the ‘Pastie’ area with “//” comments on the afl posted.

THANK YOU! for your contribution.

11. val2004

Tks a lot, autocorrelation reversals would be as well very appreciated

12. val2004

Unlis ,something else not related

Have a look please at

interesting indicator that may be translated into afl

13. Unlis

val2004, “” – well, I will do.

14. val2004

tks a lot,

15. target1cr

how to apply this or use it.

16. kv_maligi

Dear Unlis,

Plz go through this. Sling shot trading system

This seems to be fantastic code. Can you plz develop this


17. davidalan

error 31 syntax error,unexpected ‘=’,expecting ‘(’ that’s the error message version 5.9 dominate cycle highlighted in blue

18. hotaro3

Link for downloading full text book- cycle analytics for trader

19. kv_maligi

Many thanks hotaro3

20. kv_maligi

Plz have a look at CM sling slot trading system

I do not know in which language its written, can any AFL expert guys convert this into AFL?

21. kv_maligi

Hellow Hotor3,

Can also please paste PDF link for “John Ehlers – Rocket Science for Traders”


Hi Unlis,

Can please have a look at the MSLIDE, below is the code. can you try to convert it to AFL code.

src = hl2
w = input(defval=4, title="width", minval=1, maxval=7, step=1)
lrc = linreg(src, len, 0)

lrcColor=change(lrc) >= 0 ? lime:red

plot(lrc, color=lrcColor, linewidth=3)

plot(w>=7?lrc:na, offset=7, color=lrcColor)
plot(w>=6?lrc:na, offset=6, color=lrcColor)
plot(w>=5?lrc:na, offset=5, color=lrcColor)
plot(w>=4?lrc:na, offset=4, color=lrcColor)
plot(w>=3?lrc:na, offset=3, color=lrcColor)
plot(w>=2?lrc:na, offset=2, color=lrcColor)
plot(w>=1?lrc:na, offset=1, color=lrcColor)

plot(w>=7?lrc:na, offset=-7, color=lrcColor)
plot(w>=6?lrc:na, offset=-6, color=lrcColor)
plot(w>=5?lrc:na, offset=-5, color=lrcColor)
plot(w>=4?lrc:na, offset=-4, color=lrcColor)
plot(w>=3?lrc:na, offset=-3, color=lrcColor)
plot(w>=2?lrc:na, offset=-2, color=lrcColor)
plot(w>=1?lrc:na, offset=-1, color=lrcColor)


Hi, someone has the book for Cycle Analytics Traders in pdf? Thanks!

24. derek2209

Hello Ilya

On a Daily Chart
I would like to Plot a Weekly “Autocorrelation Periodogram “ in a Pane of its own.
I only need the ( LastValue( dominant Weekly Cycle )

I have tried inserting the lines of code below in the formula
but I get incorrect values for a Weekly Periodogram
I must have lines below in the wrong places

wc = TimeFrameCompress( Close, inWeekly );
TimeFrameSet( inWeekly );     // switch now to Weekly
TimeFrameRestore();        // restore time frame to original
Plot( TimeFrameExpand(dominantCycle,inWeekly)," dominantCycle Weekly", colorBlue );

Thank you in advance

Please login here to leave a comment.

Main Menu