Deviation Scaled Moving Average [ChuckBanger]

This is a deviation scaled moving average original designed by John Ehlers . It is a new adaptive moving average that has the ability to rapidly adapt to volatility in price movement with minimal lag. Because it is so smooth and adapts to the volatility of the market it is by far a really great tool for spotting trend changes
Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Want to use this script on a chart?
My free indicators
For a list of payed indicators:

Tip jar, if you want to support my free indicators work
BTC: 3EV8QGKK689kToo1r8pZJXbWDqzyJQtHy6


Dear Sir;
This is great code

I see in

b1 = 2 * a1 * cos( 1.414 * 3.14159 / ( 0.5 * length) )
b1 = 2 * a1 * cos(1.414 * 180 / (0.5 * length))

And you choose

b1 = 2 * a1 * cos(1.414 * 180 / (0.5 * length))

Why you choose the number "180" ?
+4 Svara
Compared with the usual moving and the result was pleasantly surprised. Many thanks.
+1 Svara
ChuckBanger novoross86
@novoross86, I'm glad you like it. Thanks for the comment :)
+1 Svara
TedPham ChuckBanger
Great code
Hi @ChuckBanger. This is a great script! Thanks for coding and sharing it!

I noticed though, that it gives a different result than the DSMA script that @everget posted in the past.

As well as a different result than the script that @MarcoValente posted (which is different than both yours and everget's).

So my question is, do you happen to have any clue which one is correct as per Ehler's original design?
Hi @ChuckBanger this is a perfect script that I use all the time! is it possible to make it multi time frame? I tried but it returns an error message bellow:

"Cannot use a mutable variable as an argument of the security function."

the code I tried was:

res = input(title="Resolution", type=input.resolution, defval="360")

s1 = security(syminfo.tickerid, res, dsma, gaps=true)

plot(s1, title="upper line",color=color.purple, transp=50)

Do you have a solution for that?
@canpp, You can make it multi time frame by change row 5 from:
study("Deviation Scaled Moving Average ", overlay=true, shorttitle="DSMA")
To this:
study("Deviation Scaled Moving Average ", overlay=true, shorttitle="DSMA", resolution="")
canpp ChuckBanger
@ChuckBanger, Thanks a lot!
Hem Aktie-screener Forex-screener Krypto-screener Ekonomisk kalender Om Diagramfunktioner Priser Tipsa en vän Ordningsregler Hjälpcenter Webbsidor och mäklarlösningar Widgets Diagramlösningar Lightweight Charting Library Blogg och nyheter Twitter