# Colored Volume Bars standard deviation from mean

853 6
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
```//
//
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)
```
Is your volume deviation script still available?
jv12375
@jv12375, Hi, do you mean the script given above or this one:
They are both still available.
do u use both the indicators on dialy or any tf.. also where can I get the TDO_LB.. Have u got any more or do u recommend any other indicator and oscillators.. I m new
MONEYMENOW
Hi, I m not a coder to spot the difference but just a question.. have u posted this script twice or does the other one have changes.. Thanks..
MONEYMENOW
Hi yes. Due to a time delay, I had thought it did not post and I did it twice. I do not know how to remove the one post. So they are the same code. I posted a later version of the code and again I did this twice. So if you have some advice on how to remove one of these posts please let me know.
EN English
EN English (UK)
EN English (IN)
DE Deutsch
FR Français
ES Español
IT Italiano
PL Polski
SV Svenska
TR Türkçe
RU Русский
PT Português
ID Bahasa Indonesia
MS Bahasa Melayu
TH ภาษาไทย
VI Tiếng Việt
JA 日本語
KO 한국어
ZH 简体中文
ZH 繁體中文
AR العربية