Board logo

标题: 【蔡金摆动指标(Chaikin Oscillator)】 [打印本页]

作者: 龙听    时间: 2022-11-3 14:01     标题: 【蔡金摆动指标(Chaikin Oscillator)】

  1. inputs:
  2.         FastLength( 3 ),
  3.         SlowLength( 10 ),
  4.         AlertLength( 14 ),
  5.         ColorNormLength( 14 ),                                                      
  6.                                                                                      
  7.         UpColor( Yellow ),                                                            
  8.                                      
  9.         DnColor( Red ),                                                            
  10.                                      
  11.         GridForegroundColor( Black ) ;                                                
  12.                                                                                      
  13.                                      
  14.                 
  15.                                                                                     
  16.                                                                                     
  17.                                                                                   
  18.                  

  19. variables:
  20.         var0( 0 ),
  21.         var1( 0 ),
  22.         var2( 0 ),
  23.         var3( 0 ) ;

  24. if CurrentBar = 1 then
  25.         var0 = GetAppInfo( aiApplicationType ) ;
  26.        
  27. if BarType >= 2 and BarType < 5 then                              
  28.         var2 = Volume
  29. else                                                                              
  30.                                                                                  
  31.         var2 = Ticks ;

  32. var1 = ChaikinOsc( var2, FastLength, SlowLength ) ;

  33. Plot1( var1, "ChaikinOsc" ) ;
  34. Plot2( 0 , "ZeroLine" ) ;

  35. condition1 = UpColor >= 0 and DnColor >= 0 ;                                          
  36. if condition1 then
  37.         begin
  38.         var3 = NormGradientColor( var1, true, ColorNormLength, UpColor,
  39.                  DnColor ) ;
  40.         if var0 = 1 then                                
  41.                 SetPlotColor( 1, var3 )
  42.         else if var0 > 1 then                                 
  43.                 begin
  44.                 SetPlotColor( 1, GridForegroundColor ) ;
  45.                 SetPlotBGColor( 1, var3 ) ;
  46.                 end ;
  47.         end ;
  48.                
  49.                   
  50. condition1 = LowestBar( C, AlertLength ) = 0 and LowestBar( var1, AlertLength ) > 0;
  51. if condition1
  52. then
  53.         Alert( "Bullish divergence - new low not confirmed" )
  54. else
  55. begin
  56. condition1 = HighestBar( C, AlertLength ) = 0 and HighestBar( var1, AlertLength ) > 0 ;
  57. if condition1 then
  58.         Alert( "Bearish divergence - new high not confirmed" ) ;
  59. end;
复制代码





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