【均量线(Volume Avg)】
[code]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 ) ;
[/code]
页:
[1]