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

Re: function



PureBytes Links

Trading Reference Links

>Subject:        Re: function
>  Date:         Fri, 27 Aug 1999 12:21:06 -0600
>  From:         "Gary Fritz" <fritz@xxxxxxxx>
>    To:         alainlef@xxxxxxxxxxxx
>    CC:         omega-list@xxxxxxxxxx
>
>> How could I write a function, so that I can refer to trading days
>> not with the date but with the rank it has in the year, such as the
>> first, second, third trading day of the year? 
>
>Someone else may know how to do this, but I don't see how you could 
>compute it.  There are too many variables -- market holidays, etc -- 
>to express it in a nice formula.
>
>I can think of two ways to accomplish it, both ugly.
>
>>> snip <<<
>
>Warning, this code is off the top of my head and hasn't been verified 
>or tested.  I offer it as a starting point that should be close to 
>what you need, but I don't promise it will work in its current form.  
>Which is not too bad considering what you paid for it.  :-)
>
>Gary

I don't think it has to be this complicated.  Each trading day is a bar
- holidays and weekends are irrelevant.  Simply save the bar number of
the first trading day of the year and SUBTRACT from the current bar. 

(Calculating the rank within ALL days of the year IS a chore.)

Warning: this idea is off the top of my head and hasn't been verified or
tested.

donc