Commit Graph

1046 Commits

Author SHA1 Message Date
Eddie Hebert 87843e22fe MAINT: Remove unused module.
Remove module, last usage was removed during lazy access pattern
rewrite.
2016-06-21 09:50:00 -04:00
Scott Sanderson bc302beec9 MAINT: Rework event datasets.
- Refactored EventsLoader and BlazeEventsLoader to not require a
  subclass per dataset.  Instead, you now pass a map from columns to
  event fields directly to the EventsLoader constructor.

- Removed a large number of Quantopian-specific datasets and associated
  tests.

- Rewrote the core logic of EventsLoader and BlazeEventsLoader to share
  index calculations across multiple requested columns.

- Fixed a bug where event fields were incorrectly forward-filled when
  null values were present in an event.
2016-06-10 19:22:27 -04:00
Andrew Daniels 60cd4aab91 Use new API in tests/data/bundles/test_core.py 2016-06-08 16:24:36 -04:00
Jean Bredeche b5633aa87c DEV: Fix merge issues. 2016-06-08 14:16:17 -04:00
Andrew Daniels 02a91ec4ab MAINT: Removes the set_first_trading_day method of DataPortal
Since the first trading day is now passed directly to the DataPortal on
init, there's no need for a method that does this. Moves all the
additional logic/assignments into the init. Also corrects an issue where
we would never create certain attributes if self._first_trading_day was
None.

Adds the ability to specify the first trading day for a data portal in a
test case when using the WithDataPortal fixture.
2016-06-08 13:34:23 -04:00
Jean Bredeche b1428aaad1 DEV: Cleaned up trading_minute_window
Removed it from ExchangeCalendar.

Fixed TradingSchedule’s implementation to be much faster.  Removed the
`step` parameter.
2016-06-08 13:34:23 -04:00
jfkirk 39cc355066 TST: Finishes fixing fixes for the fixed fixtures 2016-06-08 13:34:23 -04:00
jfkirk d437a5d675 MAINT: Rebase fixes 2016-06-08 13:34:23 -04:00
jfkirk 2a8f69fc01 MAINT: DataPortal env -> asset_finder 2016-06-08 13:34:22 -04:00
jfkirk 0a6ad9ac9e STY: Your flake is on fleek 2016-06-08 13:34:22 -04:00
jfkirk 581e817603 MAINT: Rebase reconciliation 2016-06-08 13:34:22 -04:00
jfkirk 2a81c2066f ENH: Adds the option to force calendar registration 2016-06-08 13:34:21 -04:00
jfkirk da99cd6192 ENH: Adds BMF, LSE, and TSX exchange calendars 2016-06-08 13:34:21 -04:00
jfkirk 219f20989f BUG: Fixes after-hours behavior on session_date 2016-06-08 13:34:21 -04:00
jfkirk 10a118d94c MAINT: Removes references to tradingcalendar 2016-06-08 13:34:20 -04:00
jfkirk 75e0e4723d TST: Refactors more tests to use WithTradingSchedule 2016-06-08 13:34:20 -04:00
jfkirk d9fc514fa8 TST: Adds TradingSchedule test fixture 2016-06-08 13:34:20 -04:00
jfkirk 31f9f06c9a MAINT: Removes static calendar from schedule_function rules 2016-06-08 13:34:19 -04:00
jfkirk 705fb4e89f MAINT: Removes use of partials in schedule classes 2016-06-08 13:34:19 -04:00
jfkirk ddaf3d5b02 MAINT: Consolidates minute_window methods in schedule classes 2016-06-08 13:34:19 -04:00
jfkirk 26742dda67 MAINT: Removes obsolete tradingcalendar module 2016-06-08 13:34:19 -04:00
jfkirk 241abda2a5 STY: Flake8 2016-06-08 13:34:19 -04:00
jfkirk 4b7390ac81 WIP: Refactors tests to use TradingSchedule 2016-06-08 13:34:19 -04:00
jfkirk c8304e8601 ENH: Adds ExchangeCalendar, TradingSchedule, and implementations
Conflicts:
	tests/data/test_minute_bars.py
	tests/data/test_us_equity_pricing.py
	tests/finance/test_slippage.py
	tests/pipeline/test_engine.py
	tests/pipeline/test_us_equity_pricing_loader.py
	tests/serialization_cases.py
	tests/test_algorithm.py
	tests/test_assets.py
	tests/test_bar_data.py
	tests/test_benchmark.py
	tests/test_exception_handling.py
	tests/test_fetcher.py
	tests/test_finance.py
	tests/test_history.py
	tests/test_perf_tracking.py
	tests/test_security_list.py
	tests/utils/test_events.py
	zipline/algorithm.py
	zipline/data/data_portal.py
	zipline/data/us_equity_loader.py
	zipline/errors.py
	zipline/finance/trading.py
	zipline/testing/core.py
	zipline/utils/events.py
2016-06-08 13:34:18 -04:00
Eddie Hebert b450ab841f BUG: Apply latest adjustment for minute 1d
Fix behavior in minute mode history with frequency `1d`, where on the
day immediately following an adjustment action, the overnight adjustment
would not apply. (However the adjustment would be applied after a 1 day
lag.)

The root cause of the bug was that the history data for minute mode when
using `1d` stitches together a sliding window of the daily data for
previous  and the current minute. That daily data sliding window and
corresponding adjustments was being read as if the data was being viewed
from on the last day of the window; however in this case the data is
being viewed from the day after the window has completed. The difference
in view points requires the adjustments to popped and applied by the
adjusted array one index earlier. The fix uses the `extra_slot` value as
signifier on whether the data is being viewed on the following day and
then accordingly adjusts the index of the mulitpy object.

Also, change the split and merger test data ratios to have different values,
to ensure that different adjustment values are applied; as opposed to
doubling up on just one of the values.
2016-06-07 10:41:18 -04:00
Jonny Elliott 6979ae8d6a ENH: fast stochastic oscillator added (#1255)
ENH: fast stochastic oscillator added.

A fast stochastic oscillator has been added to the technical
factors. This is the simplest of the stochastic oscillators,
and can be used to build the others.

Tests have been added that compare against the values expected
from that of ta-lib STOCHF.

FastStochasticOscillator is marked as window_safe=True to allow taking
moving averages for smoothing.
2016-06-06 17:06:34 -04:00
Eric Batalden 696e81b911 ENH: Add Aroon indicator. 2016-06-03 16:28:13 -07:00
Andrew Liang 7d1c79715d Merge pull request #1221 from quantopian/schedule_func_args
Support the passing of a time rule positionally on the date_rule arg
2016-06-03 17:44:28 -04:00
Andrew Liang 1056501b27 MAINT: Support the passing of a time rule positionally on the date_rule arg
But log a warning to the user
2016-06-03 15:28:53 -04:00
Richard Frank bcc187605c MAINT: Break reference cycle between algorithm and simulator
when simulation finishes, so that resources are cleaned up
deterministically.
2016-06-03 11:24:43 -07:00
Eddie Hebert 4ba7412a01 Merge pull request #1247 from quantopian/move-minute-history-tests
TST: Move tests that use minute data.
2016-06-02 15:15:45 -04:00
Andrew Daniels 1cf8e46ae6 Merge pull request #1245 from quantopian/daily-bars-first-day-attr
BUG: Fixes reading and writing of daily bars first_trading_day attr
2016-06-02 15:09:12 -04:00
Eddie Hebert 27d7b9aabb TST: Move tests that use minute data.
Make the delineation between `DailyEquityHistoryTestCase` and
`MinuteEquityHistoryTestCase` whether or not minute dts or daily dts are
used as the query timestamp, instead of whether the frequency is `1d`
vs. `1m`.

Preparing for adding a repro case for where using `1d` with minute data
fails when there is an adjustment occuring the day before the query
minute dt.
2016-06-02 14:39:43 -04:00
Andrew Daniels 8e6c98e9aa BUG: Fixes reading and writing of daily bars first_trading_day attr
When writing first_trading_day, it is already in the correct frame of
reference (seconds since epoch) and does not need to be transformed
further. Adjusts the reader to expect this value.
2016-06-02 13:41:09 -04:00
Andrew Daniels 71f12ec272 MAINT: Adds first_trading_day arg to DataPortal
Instead of inferring it from the minute/daily writer, we now require the
first trading day to be passed explicitly, so the creator of the
DataPortal controls what is used as the first trading day.
2016-06-02 13:16:43 -04:00
Eddie Hebert 2f80e94203 TST: Enable sourcing daily data from minute data.
Allow `WithBcolzDailyBarData` to opt-in to reading data defined by
`WithBcolzMinuteBarData`, so that the daily and minute test for the same
asset and dts correlate between the two readers.
The correlation is relevant for history tests which blend daily and
minute data.

Also, make the test data for the split and mergers assets in the minute
suite align at the thousands place if the adjustmets are applied
correctly, by starting the prices with a base of 4000 and then halving
the start value each day.
2016-06-02 12:28:53 -04:00
Stewart Douglas 17c20da026 TST: Add test to append minutely data 2016-05-26 09:38:25 -04:00
Scott Sanderson 5caccaeed5 Merge pull request #1230 from quantopian/pipeline-example
DOC/TEST: Add example algo using Pipeline.
2016-05-25 22:35:59 -04:00
Scott Sanderson 5e87bf2496 HACK: Call gc.collect in test_examples.
We need to call gc.collect before tearing down our class because we have
a cycle between TradingAlgorithm and AlgorithmSimulator which ultimately
holds a reference to the pipeline engine passed to the tests here.

This means that we're not guaranteed to have deleted our disk-backed
resource readers (e.g. SQLiteAdjustmentReader) before trying to delete
the tempdir, which causes failures on Windows because Windows doesn't
allow you to delete a file if someone still has an open handle to that
file.

The real fix for this is to break the cycle between TradingAlgorithm and
AlgorithmSimulator, but that requires significant breaking API changes.
2016-05-25 17:09:30 -04:00
dmichalowicz 86486803b6 BUG: custom factor outputs naming collisions 2016-05-25 15:41:16 -04:00
Andrew Daniels f1cfe1f2db BUG: Fixes bcolz padding to not always pad 390 minutes
If minutes already exist for the last existing day, adjust the number of
minutes padded to account for them. Previously we would always pad 390,
leading to a mismatch in the number of rows.
2016-05-25 14:26:16 -04:00
Scott Sanderson 392ac2f9d6 DOC/TEST: Add example algo using Pipeline. 2016-05-24 22:34:05 -04:00
Scott Sanderson 244664b6a3 MAINT: Clean up default handling in TradingAlgorithm. 2016-05-24 22:17:01 -04:00
Andrew Liang 40f42b43f5 DEV: Adjust performance calculations for capital changes
Refactor PerformancePeriod so that it creates a sub-period every
time a capital change happens within the period
2016-05-24 17:23:36 -04:00
Jean Bredeche 39bf1dbd7b DEV: Re-implement commission models to return correct results in the case of multiple fills. 2016-05-23 21:19:06 -04:00
Maya Tydykov e5039a43b0 TST: add tests to ensure no forward filling of non-missing values
STY: fix indentation

DOC: add docs to clarify test input/output
2016-05-23 16:48:52 -04:00
Maya Tydykov c0eb798cc6 TST: modify test class to use WithAssetFinder fixture.
BUG: assign result to var

TST: remove obsolete assertion

STY: fix line length
2016-05-23 15:53:55 -04:00
Maya Tydykov c94f3d0c9b BUG: fix replacement of NaN with None
TST: finish test with expected data

STY: alphabetize imports

MAINT: simplify condition - remove unnecessary statement
2016-05-23 15:53:55 -04:00
Maya Tydykov 8e630bff77 TST: remove obsolete test and update test 2016-05-23 15:53:55 -04:00
Joe Jevnik a0f9915290 Merge pull request #1218 from quantopian/datareader-replace
MAINT: replace usages of pandas.io.data.DataReader with pandas_datare…
2016-05-20 12:36:00 -04:00