【CurrentSession】
[code]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 ;
[/code]
页:
[1]