Board logo

标题: 【海利克精算指标(HPI)】 [打印本页]

作者: 龙听    时间: 2022-11-3 13:55     标题: 【海利克精算指标(HPI)】

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

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

  23. if CurrentBar = 1 then
  24.         var0 = GetAppInfo( aiApplicationType ) ;

  25. var1 = HPI( OneCent, SmoothingFactor ) * 0.00001 ;

  26. Plot1( var1, "HPI" ) ;
  27. Plot2( 0, "ZeroLine" ) ;

  28. condition1 = UpColor >= 0 and DnColor >= 0;         
  29. if condition1 then
  30.         begin
  31.         var2 = NormGradientColor( var1, true, ColorNormLength, UpColor,
  32.          DnColor ) ;
  33.         if var0 = 1 then                                
  34.                 SetPlotColor( 1, var2 )
  35.         else if var0 > 1 then                                 
  36.                 begin
  37.                 SetPlotColor( 1, GridForegroundColor ) ;
  38.                 SetPlotBGColor( 1, var2 ) ;
  39.                 end ;
  40.         end ;

  41.                   
  42. condition1 = LowestBar( C, AlertLength ) = 0 and LowestBar( var1, AlertLength ) > 0 ;
  43. if condition1 then
  44.         Alert( "Bullish divergence - new low not confirmed" )
  45. else
  46. begin
  47. condition1 = HighestBar( C, AlertLength ) = 0 and HighestBar( var1, AlertLength ) > 0;
  48. if condition1
  49. then
  50.         Alert( "Bearish divergence - new high not confirmed" ) ;
  51. end;
复制代码





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