Heh.Quote from stock777:
lol, nice Wayne. There are complete black box trading systems with fewer lines of code than that.

Maybe so, but a lot of that junk is for Julian Day calcs and to find Good Friday expirations (past and future) for accuracy.
You need to convert to Julian to easily count the number of calendar days between dates, so it can be used in Black-Scholes crunching.
And besides, WealthScript isn't exactly the most compact language...
Here's a fun JD calculator:
Code:
Function DaysBetweenExp(Month1, Day1, Year1, Month2, Day2, Year2:integer):integer;
begin
var J1, J2:integer;
Function JulianDay(Month, Day, Year:integer):integer;
begin
var I, J, K: integer;
I := Year;
J := Month;
K := day;
Result := K-32075+1461*(I+4800+(J-14)/12)/4+367*(J-2-(J-14)/12*12)/12-3*((I+4900+(J-14)/12)/100)/4;
end;
J1 := JulianDay(Month1, Day1, Year1);
J2 := JulianDay(Month2, Day2, Year2);
Result := J2 - J1;
end;
