Commit Graph

1114 Commits

Author SHA1 Message Date
Nathan Wolfe ab9a899c5b MAINT: Switch PanelBarReader to take trading calendar and freq args 2016-07-29 17:36:08 -04:00
Nathan Wolfe 763f2ab8b4 MAINT: Combine daily and minute into PanelBarReader.
Also simplify `load_raw_arrays` and `get_last_traded_dt`.
2016-07-29 17:34:28 -04:00
Nathan Wolfe bdce4ef257 TST: Expand Panel data test to test for multiple sids. 2016-07-29 17:32:00 -04:00
Nathan Wolfe 55b79e8f32 TST: Test TradingAlgorithm.run and run_algorithm on raw Panel data 2016-07-29 17:15:35 -04:00
Jean Bredeche 3305933089 DEV: Change daily mode to use last minute of session instead of session itself. 2016-07-27 09:20:24 -04:00
Jean Bredeche 2462929368 Revert "Merge pull request #1340 from quantopian/by-daily-i-mean-minutely"
This reverts commit f4456719b0, reversing
changes made to 4be07e4628.
2016-07-26 16:20:14 -04:00
Joe Jevnik fb532c3fe8 TST: Adds test for symbol changes 2016-07-26 13:34:58 -04:00
Joe Jevnik 7fd8c29880 ENH: add point in time aspect to equity symbol mapping
Changes the overlap behavior so that it is an error to write data which
would have two companies holding the same ticker. Other than one test
around which company would win in that case, all the other tests are
passing. That single test has been changed to check the write-time
error.
2016-07-26 13:34:58 -04:00
Jean Bredeche bcb547d5a8 DEV: Change daily mode to use last minute of session instead of session itself. 2016-07-26 12:49:49 -04:00
Scott Sanderson 49bb8264dc ENH: Finish adding groupby to rank/top/bottom.
- Added test coverage for grouped and masked top/bottom.

- Added test coverage for grouped rank on datetime factors.

- Fixed an issue where grouped rank would fail on datetime inputs
  because unary-negative isn't defined for datetimes.  We now instead
  directly invoke a function from rank.pyx that does the normalizations
  as neeeded.

- Fixed an issue where GroupedRowTransform assumed that it produced the
  same dtype as its input.  This isn't true for rank() of a
  datetime-dtype factor.  GroupedRowTransform now takes a required dtype
  parameter.

- Similarly, fixed an issue where GroupedRowTransform assumed that its
  missing_value was the same as its parent's, which isn't true for
  rank() of a datetime-dtype factor.  GroupedRowTransform now takes a
  required dtype parameter.

- Fixed an issue where Factor.demean() and Factor.zscore() weren't
  properly cached because their static_identity included a closure that
  was dynamically generated on each invocation.  They both now always
  use a function defined at module scope.
2016-07-26 02:57:35 -04:00
Andrey Portnoy 9e3404646e add groupby to rank, top, and bottom 2016-07-25 23:53:33 -04:00
Lotanna Ezenwa 161922897e Merge pull request #1282 from quantopian/fix-data-tests-discovery
TST: fix bundle test discovery
2016-07-25 18:36:38 -04:00
Joe Jevnik ec0ecfc1b9 TST: don't use showprogress in tests 2016-07-25 13:09:55 -04:00
Joe Jevnik e8728c0cd4 TST: fix data tests 2016-07-25 13:09:55 -04:00
Joe Jevnik ef4eafbbb8 TST: fix bundle test discovery 2016-07-25 13:09:55 -04:00
ChrisPappalardo 5888cf1657 ENH: add true range technical factor 2016-07-25 12:37:25 -04:00
Andrew Liang 2fe94d0c29 Merge pull request #1337 from quantopian/margin_changes
Capital Changes Refactoring
2016-07-25 10:54:34 -04:00
Scott Sanderson 75b3dc6fe4 Merge pull request #1338 from quantopian/window-safe-filters
ENH: made filters window safe
2016-07-25 10:38:08 -04:00
Andrew Liang 0955515c46 TEST: Test capital changes using target values 2016-07-25 10:05:47 -04:00
Scott Sanderson 3cc1cf078a TEST: Parameterize over window_length. 2016-07-24 21:21:40 -04:00
Jean Bredeche 7418e893a9 BUG: Implement sessions property for PanelDailyBarReader
Also, renamed it from `_sessions_ to `sessions` and defined an
abstractproperty in `DailyBarReader`.
2016-07-24 21:08:11 -04:00
Gil Wassermann ea01fb074a STY: style changes 2016-07-22 16:08:33 -04:00
Gil Wassermann b4aa0aecbb STY: Flake8 2016-07-22 15:08:34 -04:00
Gil Wassermann 36a727f4af ENH: sum vs nansum cleared up 2016-07-22 14:56:59 -04:00
Gil Wassermann 5e991a16d3 ENH: Test added and runs without error 2016-07-22 14:30:35 -04:00
Jean Bredeche 63ef840363 ENH: Verify params passed to get_datetime 2016-07-21 20:42:28 -04:00
Gil Wassermann c31d3b7904 ENH: Test now works 2016-07-21 12:25:02 -04:00
Gil Wassermann 21b33f03f9 ENH: test filter up and running 2016-07-21 10:21:19 -04:00
Gil Wassermann 98be158c20 ENH: storing commits. test case added 2016-07-21 08:49:41 -04:00
Jean Bredeche adea192f02 BLD: Fix some imports. 2016-07-20 09:10:32 -04:00
Jean Bredeche 21aca754ba ENH: Reorganized internal calendar implementation.
Added tests for CME calendar.

Added ICE calendar (and tests).

Added CFE calendar (and tests).
2016-07-19 22:27:34 -04:00
Andrew Daniels 6cebf05417 BUG: Further corrections for days_at_time (#1334)
* 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
2016-07-19 13:19:40 -04:00
dmichalowicz a8486c5f6e ENH: Factor-to-factor correlations/regressions 2016-07-19 11:16:55 -04:00
Jean Bredeche 5a0f840917 Clean up daily bar reader/writer to take advantage of new trading calendar. The reader
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.
2016-07-15 15:13:57 -04:00
Scott Sanderson e0f6abda2e Merge pull request #1328 from quantopian/sample-event-utils-test
PERF: Speed up event utils test case.
2016-07-15 09:53:02 -04:00
Scott Sanderson 67f76e4d67 PERF: Speed up event utils test case.
Just take a sample of all 5000 permutations of 7 dates.
2016-07-14 17:38:58 -04:00
Samuel Woo 5756f2932d ENH: Adds LinearWeightedMovingAverage factor 2016-07-14 15:10:42 -04:00
Jean Bredeche e22108b7ef Merge pull request #1312 from quantopian/24-5-backtesting
Re-implemented the calendar API.
2016-07-14 10:05:18 -04:00
Richard Frank c9b0e4050d TST: Added more test cases for RateOfChangePercentage 2016-07-13 19:48:18 -04:00
Elizaveta239 8a32c2b7ce ENH: Add Rate of change Percentage indicator 2016-07-13 18:07:20 -04:00
Joe Jevnik 0f1c08024a ENH: Adds the ichimoku cloud factor 2016-07-12 18:49:24 -04:00
Joe Jevnik 958d455a7a ENH: Support default params for terms 2016-07-12 18:49:24 -04:00
Jean Bredeche 6fb4923cc7 Re-implemented the Calendar API.
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.
2016-07-12 13:13:50 -04:00
Eddie Hebert 4840e124af TST: Speed up TestMiscellaneousAPI
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`
2016-07-11 10:34:08 -04:00
dmichalowicz d8e9fa91bd Loader return column vector for no sids case 2016-07-01 12:18:32 -04:00
David Michalowicz d6c1c5fce9 Merge pull request #1309 from nathanwolfe/adv-fix
BUG: Correct AverageDollarVolume NaN handling
2016-06-30 14:04:43 -04:00
Eddie Hebert 51eda06323 MAINT: Add equity to naming of bar data classes.
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.)
2016-06-30 08:21:42 -04:00
Nathan Wolfe 985e6bafee DOC: Add comment explaining ADV NaN test expected result calculation. 2016-06-29 11:34:21 -04:00
Nathan Wolfe e67b5e5516 TST: Change AverageDollarVolume test to check case of partial NaNs 2016-06-29 11:16:39 -04:00
Nathan Wolfe ebbcca73e8 TST: Add NaN cases to AverageDollarVolume factor test. 2016-06-29 10:12:35 -04:00