* BUG: Further corrections for days_at_time
- Revert to using DateOffset, as Timedelta doesn't handle offsetting by
one day over a tz change properly:
In [12]: pd.Timestamp('2004-04-05', tz='America/Chicago') + pd.Timedelta(days=-1)
Out[12]: Timestamp('2004-04-03 23:00:00-0600', tz='America/Chicago')
In [13]: pd.Timestamp('2004-04-05', tz='America/Chicago') + pd.DateOffset(days=-1)
Out[13]: Timestamp('2004-04-04 00:00:00-0600', tz='America/Chicago')
By creating a DateOffset using the `days` kwarg, the issue previously
fixed in bcc867b is addressed.
- To preempt any other pandas issues around day offsets, changes to
performing these with no timezone, then localizing to the local
timezone when shifting the time.
- Adds unit test for days_at_time
* STY: Remove unused import
Prior to pandas 17, there were issues with offsetting dates with
DateOffset around discontinuities (like the start of DST). We can use
Timedelta here instead, which handles these edge cases.
is backwards-compatible with the previous format.
In USEquityLoader, use dailyreader's trading_calendar.
This is backwards compatible and will fall back to the NYSE calendar if
the reader doesn’t have a calendar specified.
Instead of having separate ExchangeCalendar and TradingSchedule objects, we
now just have TradingCalendar. The TradingCalendar keeps track of each
session (defined as a contiguous set of minutes between an open and a close).
It's also responsible for handling the grouping logic of any given minute
to its containing session, or the next/previous session if it's not a market
minute for the given calendar.
Limit the date range to one day, instead of a year.
On my local machine the following goes from taking 12 seconds to 0.6 seconds.
`$ nosetests -x tests/test_algorithm.py:TestMiscellaneousAPI`
In preparation of adding futures, add equity to the names of both the
classes and methods for writing bcolz data. Futures data will use a
different minutes per day with a separate reader. This change will allow
both equity and futures fixtures to be side by side.
Also, break out the method which generates the dataframes and trading
days member into fixtures (`EquityMinuteBarData` and
`EquityDailyBarData`) on which the `*BarReader` fixture depends. This
fixture is separated out to enable reader/writers in different formats
to use the same data setup. (There is internal code which needs to write
minute and daily bar data in a database format.)
`AverageDollarVolume` used `nanmean`, which discards NaNs before
averaging, giving an ADV which is too high for any equities that have
any NaNs.
Changing the method to `nansum` divided by window length so that the
denominator is the same no matter whether there are NaNs or not.