[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Date Math?



PureBytes Links

Trading Reference Links

I've not used date functions in EL so I don't know if a date in Julian-date
form is available or not.  (If not, you can always calculate it yourself.)
If the Julian date is set up so that JD=1 represents a Monday, then JD mod 7
will give you an integer from 0 to 6;  0 represents Sunday, 1=Monday, and so
on.  If JD=1 represents some other day of the week, you can either map the
numbers to weekdays differently, or add a constant to JD before the mod
operation to force 1 to equal Monday.

Carroll Slemaker




> Anyone have any suggestions on doing date math?
>
> ie if I want the next trading date, how would I find that based on the
> current date (and I can't use Date of Next Bar because I'm using
> multiple data streams which prevents Next Bar terminology).
>
> I want to be sure that I don't make it a weekend or holiday.
>
> TIA,
>
> Cash