- UID
- 2
- 积分
- 2892817
- 威望
- 1396440 布
- 龙e币
- 1496377 刀
- 在线时间
- 13326 小时
- 注册时间
- 2009-12-3
- 最后登录
- 2024-12-26
|
【_Historical Entry】
- [IntrabarOrderGeneration = false]
- inputs:
- MyEntryPrice( 100 ),
- Quantity( 1000 ),
- LongOrShort( 1 ),
- PrevBarDate_YYMMDD( 050102 ),
- PrevBarTime_HHMM( 1300 ) ,
-
-
- OpenPriceEntryBar( 0 ) ;
- variables:
- var0( true ),
- var1( iff( PrevBarDate_YYMMDD < 500000, PrevBarDate_YYMMDD + 1000000,
- PrevBarDate_YYMMDD ) ) ;
-
- condition1 = var0 and Date = var1 and ( BarType = 2 or ( BarType = 1 and Time = PrevBarTime_HHMM ) ) ;
- if condition1 then begin
- condition2 = getappinfo(aistrategyauto) = 1;
- if condition2 then
- ChangeMarketPosition(iff(LongOrShort = 1, 1, -1) * Quantity, MyEntryPrice, "")
- else
- if LongOrShort = 1 then
- if MyEntryPrice > OpenPriceEntryBar then
- Buy Quantity shares next bar at MyEntryPrice stop
- else
- Buy Quantity shares next bar at MyEntryPrice limit
- else
- if MyEntryPrice < OpenPriceEntryBar then
- Sell Short Quantity shares next bar at MyEntryPrice stop
- else
- Sell Short Quantity shares next bar at MyEntryPrice limit ;
- end;
- condition1 = var0 = true and LastBarOnChart;
- if condition1 then var0 = false;
复制代码 |
论坛官方微信、群(期货热点、量化探讨、开户与绑定实盘)
|