jasondhadley

Super Smooth Moving Averages

211 8 11
Straight conversion of:
SuperSmoother filter © 2013 John F. Ehlers

Yellow/Green line is Super Smoothing Average , blue line is EMA(10) to give a comparison
Remove from Favorite Scripts Add to Favorite Scripts
JustUncleL PRO
3 months ago
Thanks for sharing, this is a smooth curve and gives smoother results than the HullMA particular at lengths less than 10 after that the Hull gives similar results with slightly shorter lengths. I will add to my list of tools. If you want a really slow and smooth curve try the Triangular MA (=sma((source,length),length).
Reply
JustUncleL PRO JustUncleL
3 months ago
Sorry that should be = sma(sma(source,length),length)
Reply
sal157011 JustUncleL
3 months ago
that it is not a triangular moving average
Reply
JustUncleL PRO sal157011
3 months ago
That is the calculation according to the information I have on the subject. Although, I may be corrected, I am not an expert on the different MA calculations, it may be misnamed in my reference.
Reply
sal157011 JustUncleL
3 months ago
@JustUncleL, I think you are right. I was used to the formula with coeficcients used by John Ehlers on his book Cybernetic Analysis for Stock and Futures but, your formula achieves the same thing.
Reply
JustUncleL PRO
3 months ago
Just letting you know it does not work at all period lengths, like if I put in 11,12, or 15 I get jagged MA plot.
Reply
sal157011 JustUncleL
3 months ago
@JustUncleL, I think you are refering to the SuperSmoother when you get de jagged plot and not to the triangular moving average. The triangular moving average has a problem with the odd/even lengths but doesn't jag.
The problem with the jagged SuperSmoother is a very common error when translating scripts from Tradestation Easylanguage, and many more scripts in this library suffer from this error.
The error is that in tradestation Easylanguage when you have cos(x) the angle x must be in degrees and in PineScript in cos(x) the angle x must be in radians.
To solve the problem you must convert the x degrees to radians multiplying de x degrees by pi / 180.
Thus, the line 13 b1 = 2*a1*cos(1.414*180 / ssPeriod)
should be replaced by b1 = 2*a1*cos((3.14159/180)*(1.414*180 / ssPeriod)) and voilà.

Reply
JustUncleL PRO sal157011
3 months ago
@sal157011, Yes I was referring to the SuperSmoother. I did wonder whether it should have been converted to radian. I had a similar issue when I coded another one of Ehlers Easylanguage indicators.
Reply
Ideas Scripts Chart
United States
United Kingdom
India
España
Italia
Brasil
Россия
Türkiye
日本
한국
Home Stock Screener Economic Calendar How It Works Chart Features House Rules Moderators For the WEB Widgets Stock Charting Library Priority Support Feature Request Blog & News FAQ Help & Wiki Twitter
Private Messages Chat Ideas Published Followers Following Priority Support Public Profile Profile Settings Account and Billing Sign Out