- UID
- 2
- 积分
- 2892617
- 威望
- 1396340 布
- 龙e币
- 1496277 刀
- 在线时间
- 13326 小时
- 注册时间
- 2009-12-3
- 最后登录
- 2024-12-25
|
【_Single 1dir Rnge En】
- inputs:
- LongOrShort( 1 ),
- DayOrGTF( 1 ),
- RangeHi( 105 ),
- RangeLo( 95 ),
- Quantity( 1000 ),
- EffectiveBarDate_YYMMDD( 030102 ),
-
- EffectiveBarTime_HHMM( 1300 ) ;
-
-
- variables:
- var0( iff( EffectiveBarDate_YYMMDD < 500000, EffectiveBarDate_YYMMDD
- + 1000000, EffectiveBarDate_YYMMDD ) ),
- var1( false ),
- var2( false ),
- var3( false ),
- var4( false ) ;
- var1 = Date next bar = var0 and ( BarType = 2 or
- ( BarType = 1 and Time next bar >= EffectiveBarTime_HHMM ) ) ;
- var2 = Date next bar > var0 ;
- if DayOrGTF = 1 then
- var3 = var1
- else
- var3 = var1 or var2 ;
- if var3 then
- begin
- condition1 = var4 = false
- and var3[1]
- and ( High >= RangeHi or Low <= RangeLo ) ;
- if condition1
- then
- var4 = true ;
- if var4 = false then
- if LongOrShort = 1 then
- begin
- Buy Quantity shares next bar at RangeHi stop ;
- Buy Quantity shares next bar at RangeLo limit ;
- end
- else
- begin
- Sell Short Quantity shares next bar at RangeLo stop ;
- Sell Short Quantity shares next bar at RangeHi limit ;
- end ;
- end ;
复制代码 |
论坛官方微信、群(期货热点、量化探讨、开户与绑定实盘)
|