PureBytes Links
Trading Reference Links
|
Holidays are easy... you can do something like:
{ to get tomorrow's julian date }
value1 = DateToJulian(date)+1;
{ to get if tomorrow is a weekend }
condition1 = DayOfWeek( JulianToDate(value1) ) = 6 or
DayOfWeek( JulianToDate(value) ) = 0;
If condition1 then...
In order to do the holidays, you can create a function
that has a list of the holidays, but you would have to
update them manually. Something like:
{Function called IsAHoliday)
Input: numeric(cDate);
If cDate = ELDate(12, 31, 2001)
or date = ELDate(01, 01, 2002) then
IsHoliday = true;
Hope this helps,
Victor Cuadra
www.cuadraE.com
--- cash@xxxxxxxxxxx wrote:
> 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
>
>
> "Buy Low, Sell High"
> (If this statment is used for financial gain, I am
> entitled to 10% of all profits. ;) )
>
=====
Victor Cuadra
www.cuadraE.com
|