SteynTrade

Colored Volume Bars standard deviation from mean

The colour bars:
Green: Price up - Volume > 2 x STD of last 21 bars
Blue: Price up - Volume > 1 x STD of last 21 bars
Maroon: Price down - Volume > 2 x STD of last 21 bars
Purple: Price down - Volume > 1 x STD of last 21 bars
Grey: not high volume bar
Green line: 2 bar sma
Red line: 8 period sma of the greenline
Bollinger band: 55 period sma of the 21 period sma with bands 1.618 deviation from the mean

Skrypt open-source

Zgodnie z prawdziwym duchem TradingView, autor tego skryptu opublikował go jako open-source, aby traderzy mogli go zrozumieć i zweryfikować. Brawo dla autora! Możesz używać go za darmo, ale ponowne wykorzystanie tego kodu w publikacji jest regulowane przez Dobre Praktyki. Możesz go oznaczyć jako ulubione, aby użyć go na wykresie.

Wyłączenie odpowiedzialności

Informacje i publikacje przygotowane przez TradingView lub jego użytkowników, prezentowane na tej stronie, nie stanowią rekomendacji ani porad handlowych, inwestycyjnych i finansowych i nie powinny być w ten sposób traktowane ani wykorzystywane. Więcej informacji na ten temat znajdziesz w naszym Regulaminie.

Chcesz użyć tego skryptu na wykresie?
//
// @PVSA volume indicator -SteynTrade
//
study("Colored Volume Bars standard deviation from mean", shorttitle="Volume Deviation")
lookback=input(21)
showMA=input(true)
lengthMA1=input(2)
lengthMA2=input(8)
lengthband=input(55)

v1=volume
c1=close
o1=open

vsma1=sma(v1,lengthMA1)
vsma2=sma(vsma1,lengthMA2)
vsma3=sma(v1[lookback],lookback)
vstd=stdev(v1[lookback],lookback)

c=	iff(c1>o1 and v1>(vsma3+(2 * vstd)), green,
	iff(c1>o1 and v1>(vsma3+vstd), blue, 
	iff(c1<o1 and v1>(vsma3+(2 * vstd)), maroon,
	iff(c1<o1 and v1>(vsma3+vstd), purple, gray))))
plot(v1, style=columns, color=c)
plot(vsma1, style=line, color=green)
plot(vsma2, style=line, color=red, linewidth=2)


ma=sma(vsma1,lengthband)
offs=(1.618 * stdev(vsma1, lengthband))
up=ma+offs
dn=ma-offs
mid=(up+dn)/2
plot(showMA?up:na, color=black)
plot(showMA?dn:na, color=black)
plot(showMA?mid:na, color=blue, linewidth =2)