Commit Graph

1491 Commits

Author SHA1 Message Date
Conner Fromknecht bb17c171e5 General improvements 2017-07-01 18:26:57 -07:00
Conner Fromknecht 2770648acb Fixed catalyst tests except example tests 2017-06-19 14:43:10 -07:00
Scott Sanderson 78c2404e55 TEST: Add test for window_safe propagation. 2017-06-08 10:59:56 -04:00
Scott Sanderson 885698d50b Merge pull request #1833 from quantopian/labelarray-map
Add support for relabeling classifiers.
2017-06-07 17:57:18 -07:00
Scott Sanderson 8a042937d9 TST: Add test for missing values in relabel. 2017-06-07 18:21:13 -04:00
Scott Sanderson cbe52cea88 BUG: Fix NoneType comparisons in PY3. 2017-06-07 18:21:03 -04:00
Scott Sanderson e49f4c6149 ENH: Improve error message on bad return. 2017-06-07 17:07:19 -04:00
David Michalowicz 49a7b78b2e Fix weights calculation to use portfolio value as denominator 2017-06-07 15:46:45 -04:00
Scott Sanderson ad10349992 TEST: Test map returning None. 2017-06-07 15:28:15 -04:00
Scott Sanderson cfe4df8f2b TEST: Test map ignores missing with None. 2017-06-07 14:16:17 -04:00
Scott Sanderson e995e6f2ed ENH: Add relabel method to string classifiers.
- Adds a `map` method to `LabelArray` that maps a unary function over
  the categories of a LabelArray, shrinking the underyling codes if
  possible.

- Adds a new `.relabel` method to string-dtype classifiers that maps a
  unary function over the unique elements of the underlying LabelArray.
  This is useful for things like cleaning noisy label data.
2017-06-07 13:14:12 -04:00
David Michalowicz 94b1d5a40e ENH: Add method for computing current portfolio weights 2017-06-07 13:13:14 -04:00
Freddie Vargus 731e3a8678 TST: Updated modified time of market data in test_examples 2017-06-07 11:00:55 -04:00
Ana Ruelas 440ff4205b Merge pull request #1826 from quantopian/add-engine-docs
Add engine docs
2017-06-06 11:21:57 -04:00
Ana Ruelas e55a6078d6 DOC: Fix invalid sphinx sections 2017-06-05 15:52:57 -04:00
Freddie Vargus a40e5d932c Merge pull request #1812 from quantopian/google-finance-for-benchmarking
BUG/MAINT: Switch over to Google for benchmarking
2017-06-05 12:09:55 -04:00
Freddie Vargus c0c67340fe MAINT: Skip more rows to match change in treasury data format
I'm not sure what the raw csv pulled from the federal reserve looked like before, but when trying to download fresh treasure data (data not stored in `./zipline`), there is an error that says "Time Period not in list". After checking the raw csv now, it looks like there are 5 header rows rather than just 1, so skipping those rows removes that error.
2017-06-05 11:44:01 -04:00
Ana Ruelas ff1c673a9d ENH: Include sharedoc function 2017-06-02 16:48:26 -04:00
Ana Ruelas 2d56d253fa ENH: Add run_chunked_pipeline method to PipelineEngine 2017-06-02 16:48:09 -04:00
Ana Ruelas 69b632db37 ENH: Add function for running pipelines in chunks 2017-06-02 16:47:55 -04:00
Ana Ruelas c59518bbeb ENH: Add function to concatenate list of dataframes with categoricals
STY: Alphabetized import list
2017-06-02 16:47:37 -04:00
Freddie Vargus 26175180dc TST: Change start date to fit benchmark start date 2017-06-01 23:35:11 -04:00
Freddie Vargus d9d41e3bb7 TST: Sort test examples to debug more easily 2017-06-01 23:35:11 -04:00
Freddie Vargus 5c6fe19e8e BUG/MAINT: Switch over to Google for benchmarking
MAINT: Remove mentions of Yahoo & ^GSPC

MAINT: Fill in missing dates

MAINT/BLD: Rebuild example data to match new benchmark
2017-06-01 23:35:10 -04:00
Eddie Hebert 912165da06 MAINT: Remove environment as an argument to benchmark source. (#1816)
MAINT: Remove environment as an argument to benchmark source.

To allow the BenchmarkSource class to be more easily used in contexts other than
a TradingAlgorithm, remove the TradingEnvironment as an argument to the
benchmark source.

Instead:
- Pass a benchmark Asset, instead of a bencmark sid; so that the asset_finder
does not need to be passed to the benchmark source.
- Pass the pre-calculated benchmark_returns instead of an env,
which contains the benchmark_returns; a consumer can let the benchmark_returns
stay as the default of `None` when using an asset.

We may want to further refactor and make two different classes, instead of
relying on a combination of existence/non-existence of benchmark_asset and
benchmark_returns. That refactoring should be easier to do with this change.
2017-05-25 16:11:25 -04:00
Samantha Klonaris 0d3ba78177 ENH: Add get_range to BenchmarkSource 2017-05-25 10:14:40 -04:00
dmichalowicz c9351d4c18 BUG: Some futures prices need more precision when rounding 2017-05-24 08:18:52 -04:00
Andrew Liang 8d5a2dd0ce MAINT: Remove __eq__ implementation from slippage 2017-05-22 23:00:24 -04:00
Miguel Sánchez de León Peque 35143c3e1b Fix bug in TradingCalendar initialization
A TypeError exception was raised with message "Cannot join tz-naive with
tz-aware DatetimeIndex". Removing old unnecessary workaround in
`holidays_at_time` function (Pandas already fixed that before 0.18)
fixes this issue.
2017-05-22 13:27:01 +02:00
Richard Frank ec396bd1ea TST: Use testing market data with run_algorithm
so env doesn't need to download it
2017-05-18 12:54:06 -04:00
Richard Frank 0f6dbcef3c TST: Use fixture's data with tmp_trading_env
instead of env needing to download it
2017-05-18 12:54:05 -04:00
Richard Frank c5b3ceecc1 TST: Use fixture's trading env for FakeDataPortal or TradingAlgo
to avoid a new trading env needing to download data unnecessarily
2017-05-18 11:55:48 -04:00
Scott Sanderson dde4974705 Merge pull request #1791 from quantopian/cleanup-latest-flake8
MAINT/STY: Upgrade flake8 and fix new failures.
2017-05-15 11:39:51 -07:00
Scott Sanderson 616f6e5e5d MAINT/STY: Upgrade flake8 and fix new failures. 2017-05-15 11:45:04 -04:00
David Michalowicz 5678d2d37b MAINT: Refactor commission model class hierarchies 2017-05-12 12:31:36 -04:00
Scott Sanderson 86fa28f9e8 MAINT: batch_order_target_percent -> batch_market_order.
The only downstream contex that was using batch_order_target_percent
already had all necessary prices, so calling batch_order_target_percent
was wasteful.
2017-05-09 13:52:57 -04:00
dmichalowicz 5327fc9a05 MAINT: Various futures slippage model fixes and cleanup
- Handle history lookback error before start date
- Adjust default futures slippage volume limit
- Allow subclassing EquitySlippageModel and FutureSlippageModel together.
2017-05-09 11:47:55 -04:00
Andrew Daniels a416662a9c MAINT: Pass data_frequency to get_history_window
This allows us to remove the check for whether the provided dt had a
time of midnight, which was a flimsy way to infer if the data frequency
was 'daily'. Besides the explicit check being preferable, this method
was broken on the futures calendar, since midnight is a valid market
minute.
2017-05-09 09:34:39 -04:00
Andrew Daniels bffb4bfea5 TST: Adds MinuteEquityHistoryFuturesCalendarTestCase
Added as a subclass of MinuteEquityHistoryTestCase, where the primary
calendar is 'us_futures'.

Notes on modifications to MinuteEquityHistoryTestCase:

- To work on generic calendars, many tests now use set minutes for
  window start and end, and check the values on active equity minutes.
- test_minute_regular should test against active equity minutes
- Adapts test_minute_midnight to work with futures calendar
  - Use a method of getting the last open minute that works with
    calendars that are open at midnight
  - Test against Sunday at midnight, since the real intention of this
    test is to check that given a non-open minute, we fall back to the
    last open minute.
2017-05-09 09:34:38 -04:00
Andrew Daniels 78ae3474ad TST: Adds DailyEquityHistoryOnFuturesCalendarTestCase
Added as a minimal subclass of DailyEquityHistoryTestCase, swapping out
just the primary calendar. This requires significant modifications to
DailyEquityHistoryTestCase, to allow for a generic primary calendar.
2017-05-09 09:34:38 -04:00
Andrew Daniels da63a117e0 MAINT: Modify ReindexBarReader.get_value to handle missing data
Instead of raising an exception, return 0.0 for volume, and nan for
everything else.
2017-05-09 09:34:37 -04:00
Freddie Vargus 18ee06f0d4 Merge pull request #1746 from quantopian/update-transaction-repr
MAINT: Add better repr for transactions
2017-05-08 14:54:24 -04:00
Richard Frank 56a993bfc6 BUG: Fixed abstractness of MarketImpactBase 2017-05-05 14:09:02 -04:00
Andrew Daniels 560ff3cacf MAINT: Display diff if input to daily bar writer has gaps/extra bars 2017-05-04 10:19:09 -04:00
Andrew Daniels 52667b4a90 MAINT: Handle gaps in input to daily bars writer (#1778)
Previously, a dataframe passed into BcolzDailyBarWriter.write that was
missing an expected session between its first and last sessions would be
written incorrectly. Upon converting the dataframe to a ctable, the
values for all days following the gap would be shifted backwards, and
nans would be shifted in at the end.

This commit handles the issue by asserting that the number of rows in
the input table matches the number of sessions in the calendar between
the table's first and last sessions.

Also fixes a test that was mistakenly using minutes_in_range where it
should have been using sessions_in_range (uncovered by this change).
2017-05-03 20:49:22 -04:00
Freddie Vargus 9095b241f2 MAINT: Add better repr for transactions
Flake8
2017-04-28 11:13:40 -04:00
dmichalowicz 3ff281079a BUG: Futures slippage model could have zero transaction volume 2017-04-26 13:35:00 -04:00
Jean Bredeche 04cf61d03d BUG: Python3 compatibility. 2017-04-26 10:47:27 -04:00
Jean Bredeche dead9651b2 BUG: Add backwards compatibility for position lookup by int. 2017-04-26 09:55:05 -04:00
dmichalowicz fa0594555c API: Add slippage and commission models for futures 2017-04-25 17:29:41 -04:00