TradingView
dkncrypto
Dec 27, 2020 2:50 AM

Percentage Distance From Moving Average 

Tesla, Inc.NASDAQ

Description

This indicator shows the percentage that an asset price is above or below its 50-period simple moving average.

You can change the 50-period moving average to whatever you'd like in the settings of the indicator.

There are other versions of this indicator that are currently public, but they all use the exponential moving average instead of the simple moving average.
Comments
Leaping4
I love this script! Is there any way to set alerts when the percentage away from MA hits a certain point?
dkncrypto
@Leaping4, Thanks! I’m not sure but I can look into adding that. The other indicator I’m working on is converting % difference from MA to a standard deviation so you can see how common or uncommon it is for price to be where it is relative to the MA. Will keep you posted on both. Happy trading!
Leaping4
@dkncrypto, That would be really useful!. I've been looking into the correlation of % away from VWAP too and I'm liking my back tests. Might be worth looking into. Once again, thank you. I wish I could code so I could test all of these theories I have...
DanielWit
@Leaping4, just learn it's easy
patricklee1101
@dkncrypto, This is very great Script ! But I tried Add it to Futu and Not successful ! Any comment how to integrate ? Thx a lot
muchobrento
Trying out your script. Lots of options, and clean looking (nice!).

One question, though. The Std Dev measurement is fluctuating in real time as the price of the candle is fluctuating. To me this is an indicator that the current candle is being included in the std dev measurement. Is this supposed to be like that? I'm having a difficult time figuring out how to use the indicator when the measurement keeps moving.

Hoping to hear your thoughts. Thanks!
kiero
Do you use it? And if you do, then for mean reversion?
More