|
inputs:
AvgLength( 30 ),
AlertPct( 50 ),
UpColor( Green ),
DownColor( Red ) ;
variables:
VVol( 0 ),
AvgVVol( 0 ),
TVol( 0 ),
AvgTVol( 0 ),
AlertFactor( 1 + AlertPct * .01 ),
AlertStr( NumToStr( AlertPct, 2 ) ) ;
if BarType >= 2 then { ie, not tick/minute data }
begin
VVol = Volume ;
AvgVVol = AverageFC( Volume, AvgLength ) ;
Plot1( VVol, "Vol" ) ;
Plot2( AvgVVol, "VolAvg" ) ;
{ Alert criteria }
if VVol crosses over AvgVVol * AlertFactor then
Alert( "Volume breaking through " + AlertStr + "% above its avg" ) ;
end
else { if tick/minute data; in the case of minute data, also set the "For volume,
use:" field in the Format Symbol dialog to Trade Vol or Tick Count, as desired }
begin
TVol = Ticks ;
AvgTVol = AverageFC( Ticks, AvgLength ) ;
Plot1( TVol, "Vol" ) ;
Plot2( AvgTVol, "VolAvg" ) ;
{ Alert criteria }
if TVol crosses over AvgTVol * AlertFactor then
Alert( "Volume breaking through " + AlertStr + "% above its avg" ) ;
end ;
{ Color criteria }
if UpTicks > DownTicks then
SetPlotColor( 1, UpColor )
else if UpTicks < DownTicks then
SetPlotColor( 1, DownColor ) ; |
|