Board logo

标题: 【_Historical Entry】 [打印本页]

作者: 龙听    时间: 2022-11-3 14:13     标题: 【_Historical Entry】

  1. [IntrabarOrderGeneration = false]
  2. inputs:
  3.         MyEntryPrice( 100 ),                              
  4.         Quantity( 1000 ),                                          
  5.         LongOrShort( 1 ),                                                  
  6.         PrevBarDate_YYMMDD( 050102 ),                                          
  7.         PrevBarTime_HHMM( 1300 ) ,                                                  
  8.                                                                             
  9.                                                                                   
  10.         OpenPriceEntryBar( 0 ) ;                                                                      
  11. variables:
  12.         var0( true ),
  13.         var1( iff( PrevBarDate_YYMMDD < 500000, PrevBarDate_YYMMDD + 1000000,
  14.          PrevBarDate_YYMMDD ) ) ;                                                   
  15.                   
  16. condition1 = var0 and Date = var1 and ( BarType = 2 or ( BarType = 1 and Time = PrevBarTime_HHMM ) ) ;
  17. if condition1 then begin
  18.         condition2 = getappinfo(aistrategyauto) = 1;
  19.         if condition2 then
  20.                 ChangeMarketPosition(iff(LongOrShort = 1, 1, -1) * Quantity, MyEntryPrice, "")
  21.         else
  22.         if LongOrShort = 1 then
  23.                 if MyEntryPrice > OpenPriceEntryBar then
  24.                         Buy Quantity shares next bar at MyEntryPrice stop
  25.                 else
  26.                         Buy Quantity shares next bar at MyEntryPrice limit
  27.         else
  28.                 if MyEntryPrice < OpenPriceEntryBar then
  29.                         Sell Short Quantity shares next bar at MyEntryPrice stop
  30.                 else
  31.                         Sell Short Quantity shares next bar at MyEntryPrice limit ;
  32. end;
  33. condition1 = var0 = true and LastBarOnChart;
  34. if condition1 then var0 = false;
复制代码





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