i.trader

標準偏差とATR

754 views
20
STDEV & ATR for price.
オープンソーススクリプト

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.

チャートでこのスクリプトを利用したいですか?
//@version=2
study(title="標準偏差とATR", shorttitle="stdev&atr", overlay=false)
length=input(20,minval=1,title="期間")
src = input(close, title="Source")
useTrueRange = input(true)

ma = sma(src, length)

dev =stdev(src, length)
plot(dev,title="STDEV",color=red)

range = useTrueRange ? tr : high - low
rangsma =sma(range, length)
plot(rangsma,title="ATR",color=blue)

hs=abs(dev-rangsma)
c=dev>rangsma?red:(dev<rangsma?blue:green)
plot(hs,style=columns,color=c,transp=70,title="差")