Help With EasyLanguage Notation of John Ehlers 4 Pole Gaussian Filter

Welcome to futures.io.

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:

We work extremely hard to keep things positive on our forums.

We do not tolerate rude behavior, trolling, or vendor advertising in posts.

We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.

We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

Help With EasyLanguage Notation of John Ehlers 4 Pole Gaussian Filter

Here's the EasyLanguage code for John Ehlers' 4 Pole Gaussian Filter:

Four Poles: f = alpha^4g + 4(1-alpha)f[1] - 6(1-alpha)^2f[2] + 4(1-alpha)^3f[3] - (1-alpha)^4f[4]
g=price and where alpha = =-Beta+SQR(Beta^2 +2*Beta), and Where Beta = (1 – cos(symbol)) / (1.414^2/N – 1), where symbol = 2pi/P, N = # of poles in the filter, in this case 4, and P = Period, i.e 15

Here's what I came up with: (I just solved what 2pi b/c I don't know the function to use for pi, and I solved what 1.414^(2/N); N=4(4 Pole), so equals 1.18911732 minus 1 from the EasyLanguage formula above. The problem I'm experiencing is that I get a legit plot for 15 period, but once I adjust the plot, i.e move to 20 period, it goes insane, rendering it useless for higher than 20 period. Reason? Any suggestion would be awesome.

The thing to remember with EasyLanguage code is that it automatically converts degrees to radians whereas thinkscript does not. Here's a Gaussian 2-pole filter in thinkscript. Hope this helps.