Board logo

标题: 【Volume Ratio】 [打印本页]

作者: 龙听    时间: 2022-11-3 13:25     标题: 【Volume Ratio】

  1. inputs:
  2.         AvgLength( 14 ),
  3.         UpVolAlertPct( 5 ),                                                              
  4.         DnVolAlertPct( -5 ),                                             
  5.                         
  6.         ColorNormLength( 14 ),                                                      
  7.                                                                                      
  8.         UpColor( Yellow ),                                                            
  9.                                      
  10.         DnColor( Cyan ) ;        
  11. variables:
  12.         var0( 0 ),
  13.         var1( 0 ),
  14.         var2( 0 ),
  15.         var3( 0 ) ;

  16. if BarType <= 1 or BarType >= 5 then                              
  17.         begin
  18.         var0 = UpTicks + DownTicks ;
  19.         if var0 > 0 then
  20.                 var1 = 100 * ( UpTicks - DownTicks ) / var0
  21.         else
  22.                 var1 = 0 ;
  23.         var2 = XAverage( var1, AvgLength ) ;

  24.         Plot1( var2, "VolRatioAvg" ) ;
  25.         Plot2( 0, "ZeroLine" ) ;


  26.         condition1 = UpColor >= 0 and DnColor >= 0 ;
  27.         if condition1 then
  28.                 begin
  29.                 var3 = NormGradientColor( var2, true, ColorNormLength, UpColor,
  30.                  DnColor ) ;
  31.                 SetPlotColor( 1, var3 ) ;
  32.                 end ;

  33.                          
  34.         condition1  = var2 crosses over UpVolAlertPct ;
  35.         if condition1 then
  36.                 Alert( "UpVol alert" )
  37.         else
  38.         begin
  39.         condition1 = var2 crosses under DnVolAlertPct ;
  40.         if condition1 then
  41.                 Alert( "DnVol alert" ) ;
  42.         end;
  43.         end ;
复制代码





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