Wednesday, January 23, 2008

TS Code fro Roland's Volume Bars

Inputs: AverageLength(10);
vars: color(Green),sdvol(10), avgVol(0);
sdvol = standarddev(volume, AverageLength,2);
avgVol = average(volume, averagelength);
Plot1(Volume, "Vol");Plot2(avgVol, "Avg");
if open data1 > close data1 then
begin if volume > volume[1] then color = Red
else color = darkred;
end;
if open data1 < close data1 then
begin if volume > volume[1] then color = Green
else color = DarkGreen;
end;
SetPlotColor(1,color);SetPlotWidth(1,1);
if volume > avgVol then SetPlotWidth(1,2);
if volume > avgVol + sdVol then SetPlotWidth(1,3);
if volume > avgVol + 2 * sdVol then SetPlotWidth(1,4);
SetPlotColor(2,white);

{You'll notice this last part, I make the bars wider if they are greater than the m/a by a little, 1 SD or 2 SDs}

No comments: