QuantSoftware / QuantSoftwareToolkit

QuantSoftwareToolkit
Other
467 stars 215 forks source link

Trouble with getNYSEdays function #50

Open andrelfpinto opened 10 years ago

andrelfpinto commented 10 years ago

The documentation of the getNYSEdays function says that it creates a list of timestamps between startday and endday (inclusive). With endday being the last day to consider.

As I see, the list is not inclusive:

import QSTK.qstkutil.qsdateutil as du
import datetime as dt

dt_start = dt.datetime(2012, 1, 3)
dt_end = dt.datetime(2012, 1, 4)
dt_timeofday = dt.timedelta(hours=16)
ldt_timestamps = du.getNYSEdays(dt_start, dt_end, dt_timeofday)
ldt_timestamps

[Timestamp('2012-01-03 16:00:00', tz=None)]
emoen commented 8 years ago

still isnt inclusive. Work around is: ldt_timestamps = du.getNYSEdays(dt_start, dt_end + datetime.timedelta(days=1), dt_timeofday)