// Downloaded From https://www.WiseStockTrader.com
_SECTION_BEGIN("Volume Lines");
/*

The code here was found from internet....

A 30 period moving average can be used to determine if volume is greater than average or less than average.
If you put a 2.0 standard deviation of that 30 average on the chart as well,then you could call all volume histogram bars greater than that line high.
You could also place a 3.0 standard deviation of the average on the chart and call all Volume histogram bars greater than that Ultra High Volume. This is basically what TG does."
*/
GraphXSpace = Param("Xspace", 10, 2, 20, 1);
// vol with std
LBP = Param("Look Back", 30, 0, 150,1 );
Mean = MA(ln(V),LBP);
StD = StDev(ln(V),LBP);
xp3 = exp(mean + 2*std); //3 band
xp2 = exp(mean + 1.5*std); //2 nd band
xp1 = exp(mean + 1*std); // 1st band
xm = exp(mean); // avg
xn1 = exp(mean - 1*std); // -1 band
xn2 = exp(mean - 1.5*std); //-2 band
Plot(xp3,"", 1,1|4096);
Plot(xp2,"", 1,1|4096);
Plot(xp1,"", colorPaleBlue,1|4096);
Plot(xm, "avg", colorAqua,1|4096);
Plot(xn1,"",colorPaleBlue,1|4096);
////Plot(xn2,"", 1,1|4096);
Clr = IIf(V>Ref(V,-1),29,32);
Plot(V,"vol",Clr,2+4);
PcntInc = NumToStr((V-xm)/xm*100,2);
_N(Title = "{{NAME}} - {{INTERVAL}} {{DATE}}: "+_DEFAULT_NAME()+" : {{VALUES}}"
+"\n"+EncodeColor(colorYellow)+
WriteIf(V > XM*(1 + (LBP * .01)),"Volume is("+PcntInc+")% ABOVE its("+Lbp+")average :","")+
WriteIf(V < XM*(1 + (LBP * .01)),"Volume is("+PcntInc+")% BELOW its("+Lbp+")average :",""));
_SECTION_END();