Board logo

标题: 【_Stops & Targets】 [打印本页]

作者: 龙听    时间: 2022-11-3 14:15     标题: 【_Stops & Targets】

  1. [IntrabarOrderGeneration = false]
  2. inputs:
  3.         ShareOrPosition( 1 ),                                                        
  4.         ProfitTargetAmt( 5 ),                                                
  5.         StopLossAmt( 1 ),                                            
  6.         BreakevenFloorAmt( 0 ),                                                
  7.         DollarTrailingAmt( 0 ),                                                      
  8.         PctTrailingFloorAmt( 0 ),                                                         
  9.                                   
  10.         PctTrailingPct( 0 ),                                                            
  11.                                                                   
  12.         ExitOnClose( false ) ;                                                        
  13.                                                                                           
  14.                                                                                        
  15.                                                                                         
  16.                                                  

  17. if ShareOrPosition = 1 then
  18.         SetStopShare
  19. else
  20.         SetStopPosition ;

  21. if ProfitTargetAmt > 0 then
  22.         SetProfitTarget( ProfitTargetAmt ) ;
  23. if StopLossAmt > 0 then
  24.         SetStopLoss( StopLossAmt ) ;
  25. if BreakevenFloorAmt > 0 then
  26.         SetBreakeven( BreakevenFloorAmt ) ;
  27. if DollarTrailingAmt > 0 then
  28.         SetDollarTrailing( DollarTrailingAmt ) ;
  29. condition1 = PctTrailingFloorAmt > 0 and PctTrailingPct > 0 ;
  30. if condition1 then
  31.         SetPercentTrailing( PctTrailingFloorAmt, PctTrailingPct ) ;
  32. if ExitOnClose = true then
  33.         SetExitOnClose ;
复制代码





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