- UID
- 2
- 积分
- 2892937
- 威望
- 1396500 布
- 龙e币
- 1496437 刀
- 在线时间
- 13326 小时
- 注册时间
- 2009-12-3
- 最后登录
- 2024-12-26
|
【CurrentSession】
- inputs:
- SessionType( numericsimple ) ;
- variables:
- var0( false ),
- var1( 0 ),
- var2( 0 ),
- var3( 0 ) ;
- arrays:
- arr0[ 1, 50 ]( 0 ),
- arr1[ 1, 50 ]( 0 ) ;
-
- CurrentSession = -1 ;
- if var0 = false then
- begin
- for Value1 = 0 to 1
- begin
- var1 = SessionCount( Value1 ) ;
- for Value2 = 1 to var1
- begin
- arr0[ Value1, Value2 ] = MinutesIntoWeek( SessionStartDay(
- Value1, Value2 ), SessionStartTime( Value1, Value2 ) ) ;
- arr1[ Value1, Value2 ] = MinutesIntoWeek( SessionEndDay( Value1,
- Value2 ), SessionEndTime( Value1, Value2 ) ) ;
- end ;
- end ;
- var0 = true ;
- var3 = BarType ;
- end ;
- var2 = MinutesIntoWeek( DayOfWeek( Date ), Time ) ;
- var1 = SessionCount( SessionType ) ;
- for Value1 = 1 to var1
- begin
- condition1 = ( var2 > arr0[ SessionType, Value1 ] or ( ( var3 = 0 or var3 > 4 ) and
- var2 >= arr0[ SessionType, Value1 ] ) ) and var2 <=
- arr1[ SessionType, Value1 ] ;
- if condition1 then
- begin
- CurrentSession = Value1 ;
- Value1 = var1 ;
- end ;
- end ;
复制代码 |
论坛官方微信、群(期货热点、量化探讨、开户与绑定实盘)
|