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.

Open-source Skript

Ganz im Spirit von TradingView hat der Autor dieses Skripts es als Open-Source veröffentlicht, damit Trader es besser verstehen und überprüfen können. Herzlichen Glückwunsch an den Autor! Sie können es kostenlos verwenden, aber die Wiederverwendung dieses Codes in einer Veröffentlichung unterliegt den Hausregeln. Sie können es als Favoriten auswählen, um es in einem Chart zu verwenden.

Haftungsausschluss

Die Informationen und Veröffentlichungen sind nicht als Finanz-, Anlage-, Handels- oder andere Arten von Ratschlägen oder Empfehlungen gedacht, die von TradingView bereitgestellt oder gebilligt werden, und stellen diese nicht dar. Lesen Sie mehr in den Nutzungsbedingungen.

Möchten Sie dieses Skript auf einem Chart verwenden?
//
// @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)