SteynTrade

Colored Volume Bars with Standard Deviation from the Mean

I have updated the indicator to help visualize volume . The percentage scale is based on a 21 period look back average . The colored volume bars represent volumes that exceed specified standard deviation of this 21 period average as indicated in the figure. The deviation bands are based on a the 55sma of the 21 period average (brown line). A 8 period sma of the 21 moving average (red line) is also indicated.

オープンソーススクリプト

TradingViewの精神に則り、このスクリプトの作者は、トレーダーが理解し検証できるようにオープンソースで公開しています。作者に敬意を表します!無料で使用することができますが、このコードを投稿で再利用するには、ハウスルールに準拠する必要があります。 お気に入りに登録してチャート上でご利用頂けます。

免責事項

これらの情報および投稿は、TradingViewが提供または保証する金融、投資、取引、またはその他の種類のアドバイスや推奨を意図したものではなく、またそのようなものでもありません。詳しくは利用規約をご覧ください。

チャートでこのスクリプトを利用したいですか?
//
// @PVSA volume indicator -SteynTrade_v4
//
study("Colored Volume Bars with Standard Deviation from the Mean", shorttitle="Volume Deviation_V4")
lookback=input(21,minval=1, title="Time Frame Base")
showMA=input(true)
lengthMA=input(8,minval=1, title="Signal Ocsillation")
lengthband=input(55,minval=1, title="Base Oscillation")
hline(0, linewidth=1, color=black)
hline(100, title="100", color=green)
v1=volume
c1=close
o1=open

avvol=sum(v1, lookback)/lookback
pervol=(v1-avvol)/avvol*100
signal=sma(pervol, lengthMA)

vstd=stdev(pervol,lookback)

c=	iff(c1>o1 and pervol>(1.664 * vstd), green,
	iff(c1>o1 and pervol>(0.994*vstd), olive, 
	iff(c1<o1 and pervol>(1.644 * vstd), red,
	iff(c1<o1 and pervol>(0.994*vstd), orange, 
	iff(pervol<-(1.281*vstd),fuchsia, gray)))))

plot(pervol, style=histogram, color=c, linewidth=3)
plot(signal, style=line, color=red, linewidth=2)

ma=sma(pervol,lengthband)
offs=(1.644 * stdev(pervol, lengthband))
offs2=(0.994*stdev(pervol, lengthband))
up=ma+offs
up2=ma+offs2
dn=ma-offs2
dn2=ma-offs
mid=(up+dn2)/2
plot(showMA?up:na, color=black)
plot(showMA?dn:na, color=gray)
plot(showMA?ma:na, color=maroon)
plot(showMA?up2:na, color=gray)
plot(showMA?dn2:na, color=black)