【Next3rdFriday】
[code]inputs:Series( numericsimple ) ;
variables:
var0( 0 ),
var1( 0 ),
var2( 0 ),
var3( 0 ),
var4( 0 ),
var5( 0 ),
var6( 0 ),
var7( 0 ),
var8( 0 ),
var9( 0 ),
var10( 0 ) ;
var0 = DayOfMonth( Date ) ;
var1 = Month( Date ) ;
var2 = Year( Date ) ;
var3 = DayOfWeek( var2 * 10000 + var1 * 100 + 1 ) ;
if var3 < 6 then
var4 = 6 - var3
else
var4 = 7 ;
var5 = var4 + 14 ;
if var5 > var0 then
var7 = var1 + Series - 1
else
var7 = var1 + Series ;
if var7 > 12 then
begin
var7 = var7 - 12 ;
var8 = var2 + 1 ;
end
else
var8 = var2 ;
var3 = DayOfWeek( var8 * 10000 + var7 * 100 + 1 ) ;
if var3 < 6 then
var4 = 6 - var3
else if var3 = 6 then
var4 = 7 ;
var6 = var4 + 14 ;
var9 = DateToJulian( var8 * 10000 + var7 * 100 + var6 ) ;
var10 = DateToJulian( Date ) ;
Next3rdFriday = var9 - var10 ;
[/code]
页:
[1]