Commit Graph

2349 Commits

Author SHA1 Message Date
Mete Atamel 9d8bb3dfa9 DEV: Add quantopian_dual_ema_talib.py
This file is identical to dual_ema_talib.py but it's in Quantopian syntax for easy copy/paste to Quantopian.
2014-12-19 14:04:27 +01:00
Delaney Granizo-Mackenzie a0c041dca6 Merge pull request #451 from quantopian/risk-metrics-float-cast
BUG: Assigned dtypes to the cumulative risk metrics DataFrame.
2014-12-17 15:13:11 -05:00
Delaney Granizo-Mackenzie bed1ff3bce BUG: Miniconda was breaking the travis build. Updated version. 2014-12-17 14:22:31 -05:00
Delaney Granizo-Mackenzie 05903a2031 BUG: Assigned dtypes to the cumulative risk metrics DataFrame. 2014-12-17 13:56:42 -05:00
fawce cd976ee2dd Merge pull request #449 from quantopian/bug_5089
expand get_environment
2014-12-12 17:42:58 -05:00
Scott Sanderson 51e43e3d61 BUG: Use string_types instead of basestring for py3 compat. 2014-12-09 11:17:28 -05:00
Scott Sanderson a701d0c47c DEV: Explicitly convert string to timezones in get_datetime. 2014-12-09 11:17:28 -05:00
Scott Sanderson 44f993c64e BUG: Use astimezone instead of tz_convert.
Makes get_datetime agnostic as to whether its input is a datetime or a
Timestamp.  (astimezone is an alias to tz_convert when the input is a
Timestamp).
2014-12-09 11:17:28 -05:00
fawce 34647ec6c4 added tests to confirm the full environment returns as expected. 2014-12-08 16:47:11 -05:00
fawce 0411627169 Modified get_environment to provide multiple fields. 2014-12-07 08:26:13 -05:00
Eddie Hebert eaea8e5317 Remove bottleneck caused by unnecessary check of the position index.
Instead of checking the positions indexes every time either
`_position_amounts` or `_position_last_sale_prices` is updated, check
and grow the individual Series on each update.

This gain with this patch is by reducing the following bottlenecks:
- Checking both vectors when only one is updated.
- Using try/except to trigger the growth, instead of incurring the cost
of checking the Index contains on every update.

In testing this change results in about a 33% speedup of the
`update_last_sale` algorithm when run with a buy and hold algorithm with
160 equities, resulting in a 20% speedup overall.
2014-12-04 12:08:00 -05:00
David Edwards 17dd0d207d MAINT: Refactored RandomWalkSource
This makes the drift and standard deviation used in RandomWalkSource
keyword args to give the user more control over the price series that
are emitted.

The standard deviation of prices is very different at different frequencies,
users should have the ability to specify the standard deviation used.

The drift term should also be configurable to give the user more control.
2014-11-22 15:21:43 -08:00
Joe Jevnik e7a5e097c4 BUG: Explicitly guard against empty bar data in history container
contstruction.

BarData can be falsey. in create_buffer_panel, the intention of the
check against bar_data was to see if it was passed at all, not if it was
truthey. In order to make that check more explicit, the check now
asserts that bar_data is not None.
2014-11-19 11:55:13 -05:00
Joe Jevnik fcea785b01 MAINT: Makes RandomWalkSource emit midnight UTC events in daily mode. 2014-11-19 11:55:13 -05:00
Joe Jevnik f7b4d3100d ENH: Makes the offset of market_close relative to 20:00 UTC
Changed from relative to 20:01 UTC.
2014-11-19 11:38:26 -05:00
Luke Schiefelbein 1542b41fbd BUG: Fix price caching for tickers with '/' char
On Ubuntu (assume this is true for all posix) tickers containing a slash char ("CRD/A", "BRK/A", both valid tickers with yahoo api accessible timeseries) lead to a path error in loader.py line 286.
2014-11-19 11:26:27 +01:00
Thomas Wiecki 8dd74b15b2 DOC: Fix tutorial import. Closes #430. 2014-11-19 11:18:30 +01:00
Joe Jevnik 68e44353ce MAINT: Make RandomWalkSource accept the standard daily instead of day for the frequency 2014-11-18 15:23:10 -05:00
Joe Jevnik aac87ada5d BUG: Ensure that the bar count is an integer in minutely mode simple
transforms

total_seconds can return a float, which when divided by `60` would
still yield a float causing a value error when passed to range.
2014-11-18 11:25:23 -05:00
Joe Jevnik 9e94193d4b BUG: Off by one error in runtime construction of digest panel
When a history minute digest panel was constructed at runtime, there
would be 1 minute missing between the current minute at iloc[-1] and the
next prior minute at iloc[-2].
2014-11-18 11:22:17 -05:00
Joe Jevnik 39eb80ef0c DOC: Adds the new transform work to the release notes. 2014-11-17 13:16:30 -05:00
Joe Jevnik 25c3297c9d BUG: Fixes a bug in the test date_gen for non-daily timedeltas 2014-11-17 13:16:30 -05:00
Joe Jevnik a2fb729c00 DOC: Updates the comments around the caching in siddata 2014-11-17 13:16:30 -05:00
Joe Jevnik 82dffe8360 MAINT: Updates the add_trading_days to use the index of the date for a
more efficient means of jumping larger gaps of dates.

Adds a docstring to explain the usage of the function.
2014-11-17 13:16:30 -05:00
Joe Jevnik df3af31fc1 MAINT: Makes the date_gen skip non-market times. 2014-11-17 13:16:30 -05:00
Joe Jevnik e3d8b1034e ENH: Replaces the simple transforms with history calls. Switches
transforms to quantopian syntax.

Adds the sid attribute to the siddata so it is aware of which security
it represents.
2014-11-17 13:16:30 -05:00
Philipp Kosel 7889f93522 BUG: Fix ta-lib url in vagrant init shell script. 2014-11-12 18:22:29 -05:00
Joe Jevnik c2aae2e0f4 BUG: rolling panel data became misaligned after extend_back 2014-11-12 16:47:44 -05:00
Joe Jevnik 8df1a49031 BUG: When increasing the length dynamically, the rolling panel was
getting filled with the wrong datetimes and causing errors.

Updates the logic for addressing missing datetimes and adds unit tests
for the 2 main cases (no missing datetimes, and some missing datetimes).
2014-11-11 13:29:57 -05:00
Joe Jevnik 54b1f15983 STY: Removes unused import in run_algo.py 2014-11-10 10:21:43 -05:00
Joe Jevnik e56457c671 ENH: Makes breakpoints work in algoscripts started with the run_algo.py
script.

Adds an option kwarg to TradingAlgorithm named 'algo_filename' that
represents the file where the algoscript came from (if any). The
run_algo.py script will pass this argument with the value passed to the
'-f' flag. The default name is '<string>' to represent that the script
is coming from a string in python and not a file. This matches the
behavior of exec and the python convention for compiling code objects.
2014-11-10 10:14:56 -05:00
Joe Jevnik ca59abcc43 ENH: Makes schedule_function work in daily mode. 2014-11-06 10:49:49 -05:00
Joe Jevnik 93429d69f5 BUG: HistoryContainer creation at runtime did not work as intended. 2014-11-05 18:31:11 -05:00
llllllllll 9ddb033e67 ENH: Changes the default offset for time_rules.market_open to 1, and
makes it an offset from 13:30 UTC.

This is to be more consistent with the market_close, which is an offset
from 20:00 UTC.

This also makes market_open and market_close cache the dt to offset from
for each day.
2014-11-05 14:59:48 -05:00
Joe Jevnik e1a55131ec DOC: Updates the release notes to include information about the dynamic
history update.
2014-11-04 00:08:19 -05:00
Joe Jevnik ca1569f22a ENH: Adds a closes_in_range and opens_in_range. 2014-11-03 16:26:40 -05:00
Joe Jevnik f8f7f2fc4c ENH: Allows history to be dynamic and grow the container at runtime.
Previously, all specs had to be pre-allocated by using the 'add_history'
function. This is now no longer required and instead serves as a hint to
the HistoryContainer to pre-allocate the space for the given spec.

History can grow by increasing the length for a frequency, adding a
frequency, or adding a field. It can grow with any combination of
these.

HistoryContainer now is aware of the data_frequency of the algorithm,
and no longer uses the daily_at_midnight flag; instead, this is the
default behavior.
2014-11-03 15:57:44 -05:00
Delaney Granizo-Mackenzie 1c08f60f7c MAINT: Updated the naming scheme from reconstruct to set_state 2014-10-29 14:30:26 -04:00
Delaney Granizo-Mackenzie 589c014f73 ENH: Updated naming scheme of serialization methods. 2014-10-29 14:15:04 -04:00
Brian Fink 677f5ecde0 BUG: Hide account methods from repr 2014-10-29 13:41:15 -04:00
Brian Fink 287023498e BUG: Fix flake8 2014-10-28 22:10:28 -04:00
Brian Fink 93296d7ef5 ENH: Add serialization to account 2014-10-28 21:54:14 -04:00
Scott Sanderson affeb2afbc DEV: Add tz kwarg to get_datetime. 2014-10-23 00:59:50 -04:00
Thomas Wiecki 820115f7be MAINT: Replace iterkv with iteritems.
iterkv is being deprecated as of pandas 0.14.
2014-10-22 17:25:37 +02:00
Thomas Wiecki 18ad02f6a4 MAINT: Make len check for ffillable explicit. 2014-10-22 17:25:37 +02:00
Joe Jevnik c6e85d08f0 ENH: Does value checking for time offsets for market_open and market_close 2014-10-20 17:17:34 -04:00
Joe Jevnik 69124cb6ab BUG: Fixed a bug with offsets in week_start and week_end 2014-10-20 17:17:34 -04:00
Joe Jevnik 615228b272 ENH: Changes the default time_rule for schedule_function to market_open() 2014-10-20 17:17:34 -04:00
Joe Jevnik ad25f29b7b ENH: Provides aliases for the (Date|Time)RuleFactory classes for better Quantopian/Zipline interoperability 2014-10-20 17:17:34 -04:00
Joe Jevnik d360b9d9bd ENH: Provides a more descriptive error if market_open or market_close are provided a non-keyword argument that is not a datetime.timedelta 2014-10-20 17:17:34 -04:00