TradingView
ChuckBanger
4 de Ene. de 2020 5:42

Deviation Scaled Moving Average [ChuckBanger] 

Bitcoin / U.S. dollarBitstamp

Descripción

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
Comentarios
TedPham
Dear Sir;
This is great code

I see in traders.com/Documentation/FEEDbk_docs/2018/07/TradersTips.html

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" ?
novoross86
Compared with the usual moving and the result was pleasantly surprised. Many thanks.
ChuckBanger
@novoross86, I'm glad you like it. Thanks for the comment :)
TedPham
Great code
JGrams1
hey bro, do you have the code for MQL?

tks
TraderGxyz
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.
tradingview.com/script/Vsa2HTzq-Ehlers-Deviation-Scaled-Moving-Average-DSMA/

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

So my question is, do you happen to have any clue which one is correct as per Ehler's original design?
canpp
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?
ChuckBanger
@canpp, You can make it multi time frame by change row 5 from:
study("Deviation Scaled Moving Average [ChuckBanger]", overlay=true, shorttitle="DSMA")
To this:
study("Deviation Scaled Moving Average [ChuckBanger]", overlay=true, shorttitle="DSMA", resolution="")
canpp
@ChuckBanger, Thanks a lot!
Más