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

Re: EL Help question



PureBytes Links

Trading Reference Links

>   Can  someone  help  me  with  an  EL coding question? I am trying to
>   determine  what business day of the month the current bar is. What I
>   want  to  determine is is today's date the third to the last trading
>   day  of  the  month.  All I can find is functions and reserved words
>   which deal with calandar days not business days.

The best way to determine what trading day (not business day) the
current day is, is to count them as they go by, i.e.

if Month(Date) > Month(Date[1]) then TradingDay = 0;
if Date > Date[1] then TradingDay = TradingDay + 1;

That tells you how many trading days have occurred in the month
so far, and what # trading day the current bar is in.

But how do you tell the "third from the last" trading day, unless
you know how many trading days are left in the month?  You need a
way to figure if future days are trading days, and that's a lot
trickier.  You can check to see if the next N calendar days are
weekdays, and see if there are only 2 more weekdays left in the
month, but that won't help you for holidays.  You'd have to
handle that yourself.

Gary