Board logo

标题: 【NthExtremes】 [打印本页]

作者: 龙听    时间: 2022-11-2 11:17     标题: 【NthExtremes】

  1. inputs:
  2.         PriceValue( numericseries ),
  3.         Len( numericsimple ),
  4.         N ( numericsimple ),                    
  5.         HiLo( numericsimple ),                                                         
  6.         oExtremeVal( numericref ),
  7.         oExtremeBar( numericref ) ;

  8. arrays:
  9.         arr0[ 2, 100 ]( 0 ) ;                              

  10. condition1 = N > Len or Len > 100 ;
  11. if condition1 then
  12.         begin
  13.         oExtremeVal = 0 ;
  14.         oExtremeBar = -1 ;
  15.         NthExtremes = -1 ;
  16.         end
  17. else
  18.         begin
  19.                                                                                        
  20.                                                                    
  21.         for Value1 = 1 to Len
  22.                 begin
  23.                 arr0[ 1, Value1 ] = PriceValue[ Value1 - 1 ] ;
  24.                 arr0[ 2, Value1 ] = Value1 - 1 ;
  25.                 end ;
  26.                                                                                           
  27.                                                                       
  28.         Value1 = Sort2DArray( arr0, 2, Len, HiLo ) ;

  29.         oExtremeVal = arr0[ 1, N ] ;
  30.         oExtremeBar = arr0[ 2, N ] + ExecOffset ;
  31.         NthExtremes = 1 ;
  32.         end ;
复制代码





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