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

Re: EL Help question



PureBytes Links

Trading Reference Links

I think Gary meant the month cond. to be '<>' , not '>' below.

You might consider making a user function which has all the dates
that match your cond, which returns a 1 only if the current
date (or even tomorrow's data if you prefer) is 3 from eom. This
is not a very elegant method but it works. You do need to periodically
update the UF list of dates.

{UserFunction "eom3"}
input:myd(numeric);
vars:ret(0);
ret=0;
if myd= 951027 then ret=1;
if myd= 951128 then ret=1;
if myd= 951227 then ret=1;
{etc}
eom3=ret;

 You can even let a simple indicator write most of the UF code for
you if you run this on a daily symbol which always trades:

if month(d) <> month(d[1]) then print("if myd= ",d[3]," then ret=1;"

>>   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