Im looking for a way to alter the code for the indicator Volume Avg.
It performs as I want in the charts. But when added to the Watchlist/Scanner I want it to apear a bit different.
I want the indicator to show one column showing the difference between Vol and VolAvg in procentage. Ex. Vol is 340% larger then VolAvg. I want to create a list that I can sort showing the procentual difference between Vol and VolAvg.
The current code look like this:
Code: Select all
inputs:
AvgLength( 50 ),
AlertPct( 50 ),
UpColor( Cyan ),
DownColor( Red ) ;
variables:
var0( 0 ),
var1( 0 ),
var2( 0 ),
var3( 0 ),
var4( 1 + AlertPct * .01 ),
var5( NumToStr( AlertPct, 2 ) ) ;
if BarType >= 2 and BarType < 5 then
begin
var0 = Volume ;
var1 = AverageFC( Volume, AvgLength ) ;
Plot1( var0, "Vol" ) ;
Plot2( var1, "VolAvg" ) ;
condition1 = var0 crosses over var1 * var4 ;
if condition1 then
Alert( "Volume breaking through " + var5 + "% above its avg" ) ;
end
else
begin
var2 = Ticks ;
var3 = AverageFC( Ticks, AvgLength ) ;
Plot1( var2, "Vol" ) ;
Plot2( var3, "VolAvg" ) ;
condition1 = var2 crosses over var3 * var4 ;
if condition1 then
Alert( "Volume breaking through " + var5 + "% above its avg" ) ;
end ;
if C > C[1] then
SetPlotColor( 1, UpColor )
else if C < C[1] then
SetPlotColor( 1, DownColor ) ;