Commit Graph

2262 Commits

Author SHA1 Message Date
Delaney Granizo-Mackenzie 15f33d3e9d BUG: Exception will be raised when nan value sent to order()
Previously order was not checking for nan values sent as
limit or stop prices. It will now raise a runtime exception
in the event that an attempt to order with a nan price is made.
2014-08-25 11:23:28 -04:00
Joe Jevnik 16d15ed514 Merge pull request #384 from quantopian/q-or-zipline
get_environment api_method
2014-08-21 14:32:14 -04:00
llllllllll 7563124547 ENH: Adds a new api_method called get_environment so that users may
check if their algorithm is running in zipline or on Quantopian.
2014-08-14 11:48:19 -04:00
Scott Sanderson 4420e370ff MAINT: Move call to updated_portfolio in AlgorithmSimulator.
We guarantee that `TradingAlgorithm.updated_portfolio` is called at least once
between each perf message emission.  This change moves that guaranteed call
into `AlgorithmSimulator.get_message` and adds a comment to make it clear why
updated_portfolio is being called.
2014-08-13 13:00:03 -04:00
Scott Sanderson 3e978d0ebb MAINT: Remove unused methods from TradingAlgorithm.
Removes unused method `raw_positions` and `raw_orders` from `TradingAlgorithm`.
These methods existed to help support features in the Quantopian codebase,
which no longer use the existing interface.
2014-08-13 13:00:03 -04:00
Scott Sanderson d02dd972d5 BUG: Fix crash in transforms on malformed CUSTOM events.
Fixes a crash in various transforms when providing CUSTOM events whose fields
don't match the fields required for the transform.

This is fixed by requiring all `EventWindow` subclasses to supply a `fields`
property, which returns a list of strings that are required keys for any event
that can be processed by the window.  Any CUSTOM events the don't supply the
required fields for a transform window are ignored by that window.
2014-08-13 12:54:29 -04:00
Joe Jevnik f9b1fe6ff6 Merge pull request #383 from quantopian/welcome-to-the-family
symbol as an api_method
2014-08-06 18:43:33 -04:00
llllllllll 90405b1c99 MAINT: Adds symbol to the list of api_methods. 2014-08-06 18:18:56 -04:00
John Ricklefs d73d2336ac Merge pull request #380 from quantopian/broker_order_statuses
ENH: Add new order statuses for broker integration
2014-08-06 15:33:57 -04:00
John Ricklefs f13bbd5d76 ENH: Re-work the usage of _status on Order 2014-08-06 15:00:26 -04:00
John Ricklefs dd97292a94 TST: Add tests for behavior of rejected/held orders.
Also made a tweak to the handling of Order.status
for when a held order is filled (partial or full).
2014-08-06 15:00:26 -04:00
Brian Fink 65dea626a0 BUG: Clean up handling of reject() and hold() orders 2014-08-06 15:00:25 -04:00
John Ricklefs ec20b3be8a ENH: Add new order statuses for broker integration 2014-08-06 15:00:25 -04:00
Thomas Wiecki bb6e9c26c0 Merge pull request #382 from quantopian/talib_optional
Make talib an optional dependency.
2014-08-06 15:13:00 +02:00
Eddie Hebert 3c8363722e MAINT: Log more information on history update failure.
Log the field and algo datetime when the update of the return frame
fails; re-raise the error until the when and why of the value error is
understood.
2014-08-05 12:17:00 -04:00
Thomas Wiecki 3f1c3b39ad MAINT: Make talib an optional dependency. Fixes #362. 2014-08-04 13:25:46 +02:00
Thomas Wiecki e9b7209c13 MAINT: Factor talib tests out to separate file. 2014-08-04 13:17:21 +02:00
Thomas Wiecki c12304ce40 DOC: Updated dual moving average example to use symbol lookup. 2014-08-04 12:21:50 +02:00
Delaney Granizo-Mackenzie 79041df093 Created 0.7.1 release notes 2014-07-29 12:59:00 -04:00
Delaney Granizo-Mackenzie 3b9fa53719 Merge pull request #378 from quantopian/fixed-zero-last-sale-price
BUG: Fixed random dips in returns as shown to user.
2014-07-29 12:15:23 -04:00
Delaney Granizo-Mackenzie 0fd78cd54a BUG: Fixed random dips in returns as shown to user.
Previously the last sale price was not correctly being set on
positions when the transaction arrived before the trade event.
The last sale price was defaulted to zero and never updated. This resulted
in one holding stocks that were bough >>0 and now had value 0 from
the perspective of returns. The returns would display correctly again
when the next trade of that security happened. For most securities trading is
frequent enough that there's no issue, but for some illiquid ones it took
hours to fix itself.

Updated test_perf_tracking:TestPerformanceTracker.test_minute_tracker
This test was based on assuming that last_sale_price was zero,
allowing the sharpe ratio to be calculated. The sharpe ratio can no longer
be calculated for this specific tested scenario and the test has been changed
accordingly.
2014-07-29 11:07:13 -04:00
Thomas Wiecki 2a71f8353a DOC: Fix readme example and update dependency doc. 2014-07-26 09:28:44 +02:00
Thomas Wiecki 97781dc39e BLD: Update md5 sum in meta.yaml. 2014-07-25 19:37:17 +02:00
Thomas Wiecki a7de02176b Bump version: 0.7.0rc1 → 0.7.0 2014-07-25 19:34:49 +02:00
Thomas Wiecki 6dc9c1b8ae BUG: Fix comparison for pandas 0.14. Closes #377. 2014-07-25 19:31:25 +02:00
Thomas Wiecki d4d0477eb5 BLD: Add Python as a conda dependency. 2014-07-22 11:09:49 +02:00
Delaney Granizo-Mackenzie 62c9b96674 Merge pull request #372 from quantopian/moved-perf-tracker-assignment
BUG: Put initialization of perf_tracker back in __init__
2014-07-21 13:48:22 -04:00
Delaney Granizo-Mackenzie 97c88c3c30 BUG: Put initialization of perf_tracker back in __init__
The initialization of perf_tracker had been moved from __init__
in TradingAlgorithm to _create_generator. This caused perf_tracker
to not be ready when portfolio requested it. portfolio was consequently
not ready for access in init. portfolio can now be accessed in init
again, assuming valid sim_params are passed. Otherwise it will be
available in handle_data() after _create_generator() is called.
2014-07-21 12:17:07 -04:00
Thomas Wiecki 0ff6a1cc1b BLD: Update md5 sum. 2014-07-21 15:05:29 +02:00
Thomas Wiecki 5b1afe166b DOC: Update release notes for 0.7 2014-07-21 14:31:40 +02:00
Scott Sanderson d610ea0a3b DOC: Rename 'guid' to 'id' in dividend tracking logic. 2014-07-18 15:04:20 -04:00
Scott Sanderson 1039919340 STY: In test_perf_tracking, import datetime/timedelta via from-import. 2014-07-18 15:04:20 -04:00
Scott Sanderson 4712891e88 ENH: Remove dividends from the event stream.
Removes support for handling dividends as part of the algorithm
simulation stream, replacing it with an API in `TradingAlgorithm` for
supplying dividends as a DataFrame.
2014-07-18 15:04:20 -04:00
Scott Sanderson a8431944aa MAINT: Add comments and rename methods in PerformanceTracker.
The function that handles a market close for daily frequency changed from
`handle_market_close` to `handle_market_close_daily`.

The function that is called at on the closing minute each day when running
minutely changed from `handle_intraday_close` to
`handle_intraday_market_close`.
2014-07-18 15:04:20 -04:00
Scott Sanderson 0176279404 MAINT: Refactor AlgorithmSimulator.transform.
Breaks out the main snapshot processing loop into its own function, and does
some minor variable renaming-shuffling.

Adds `TradingAlgorithm.on_dt_changed`, a function to be called when the
simulation dt changes, prior to processing any events.

There should be no difference in behavior as a result of this change.
2014-07-18 15:04:20 -04:00
Thomas Wiecki 8d16efc5c4 Bump version: 0.7.0 → 0.7.0rc1 2014-07-18 15:38:30 +02:00
Thomas Wiecki d6f26274ac Bump version: 0.6.1 → 0.7.0 2014-07-18 15:38:20 +02:00
Thomas Wiecki 5199031b68 BLD: Update .bumpversion.cfg to new config file specs. 2014-07-18 15:36:08 +02:00
Thomas Wiecki e139294551 DOC: Typos in release announcements. 2014-07-17 17:29:54 +02:00
Thomas Wiecki 0bfb18f23b DOC: Update release notes for 0.7. Add tutorial link to README. 2014-07-17 17:23:30 +02:00
Thomas Wiecki eae41b8e7a DOC: Add tutorial and update examples to use history. 2014-07-16 17:30:23 +02:00
Thomas Wiecki 443bc718f4 Merge branch 'history_support_daily_input' 2014-07-16 17:22:32 +02:00
Thomas Wiecki 78d2a7ef9a TST: Add unittest for daily history with midnight dt. 2014-07-16 15:17:02 +02:00
Thomas Wiecki 845712e5eb MAINT: Factor out column conversion in HistoryContainer.
We can't be sure that security identifiers can be converted
to int. In fact, most of the times they are strings. This
adds an identity function that can be overwritten if such
a conversion is necessary (as on Quantopian).
2014-07-16 15:17:02 +02:00
Thomas Wiecki 6de4d32ee1 ENH: Change open and close to midnight if using daily input data. 2014-07-16 15:16:57 +02:00
Eddie Hebert 4980928394 MAINT: Remove redundant perf_tracker member.
The perf_tracker member of TradingMember was set to None twice
during __init__.

Remove one of those instances.
2014-07-12 00:06:09 -04:00
Delaney Granizo-Mackenzie 9b01d78f5d ENH: Implemented AUTO_INITIALIZE feature.
Created a new flag in TradingAlgorithm that enables subclasses to
decide if they want to handle setting self.initialized = True.
Before it was the responsibility of an overriding subclass to set
initalized = True. This was causing problems because it's easy to
forget this. Now it is the responsibility of TradingAlgorithm
unless explicity stated otherwise.
2014-07-08 14:03:53 -04:00
Delaney Granizo-Mackenzie 3521a11ed4 ENH: Added informative message for calling order in init.
Previously, calling order() in initalize resulted in a weird
stack trace. It now returns a well formulated error that is
readable to the user through the API. Adding a slippage
kwarg to test_algorithm and simfactor was necessary because
slippage can only be called during init. Previously initaliazed
was never set to true and calls to init-only function were sprinkled
around the code in non-init sections. Code changes were to enforce
init-only rules.
2014-07-08 14:03:53 -04:00
Delaney Granizo-Mackenzie 6baabc5975 Update zipline-0.6.2.md 2014-07-02 11:20:12 -04:00
Delaney Granizo-Mackenzie 3a48eb9bc2 Update zipline-0.6.2.md 2014-07-02 11:03:17 -04:00