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.

Script open-source

Nello spirito di condivisione promosso da TradingView, l'autore (al quale vanno i nostri ringraziamenti) ha deciso di pubblicare questo script in modalità open-source, così che chiunque possa comprenderlo e testarlo. Puoi utilizzarlo gratuitamente, ma il riutilizzo del codice è subordinato al rispetto del Regolamento. Per aggiungerlo al grafico, mettilo tra i preferiti.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.

Vuoi usare questo script sui tuoi grafici?
//
// @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)