Board logo

标题: 【均量线(Volume Avg)】 [打印本页]

作者: 龙听    时间: 2022-11-3 13:41     标题: 【均量线(Volume Avg)】

  1. inputs:
  2.         AvgLength( 50 ),
  3.         AlertPct( 50 ),
  4.         UpColor( Cyan ),
  5.         DownColor( Red ) ;

  6. variables:
  7.         var0( 0 ),
  8.         var1( 0 ),
  9.         var2( 0 ),
  10.         var3( 0 ),
  11.         var4( 1 + AlertPct * .01 ),
  12.         var5( NumToStr( AlertPct, 2 ) ) ;

  13. if BarType >= 2 and BarType < 5 then                             
  14.         begin
  15.         var0 = Volume ;
  16.         var1 = AverageFC( Volume, AvgLength ) ;
  17.         Plot1( var0, "Vol" ) ;
  18.         Plot2( var1, "VolAvg" ) ;

  19.         condition1 = var0 crosses over var1 * var4 ;   
  20.         if condition1 then
  21.                 Alert( "Volume breaking through " + var5 + "% above its avg" ) ;
  22.         end
  23. else                                                                              
  24.                                                                                  
  25.         begin
  26.         var2 = Ticks ;
  27.         var3 = AverageFC( Ticks, AvgLength ) ;
  28.         Plot1( var2, "Vol" ) ;
  29.         Plot2( var3, "VolAvg" ) ;
  30.                          
  31.         condition1 = var2 crosses over var3 * var4 ;
  32.         if condition1 then
  33.                 Alert( "Volume breaking through " + var5 + "% above its avg" ) ;
  34.         end ;

  35.                   
  36. if C > C[1] then
  37.         SetPlotColor( 1, UpColor )
  38. else if C < C[1] then
  39.         SetPlotColor( 1, DownColor ) ;
复制代码





欢迎光临 龙听期货论坛 (http://www.qhlt.cn/) Powered by Discuz! 7.2