Commit Graph

1484 Commits

Author SHA1 Message Date
Eddie Hebert a645b2a86e MAINT: Fixes comment about returned performance types.
The simulator had been changed to return dictionary objects instead
of ndicts.
2013-03-19 20:56:56 -04:00
Eddie Hebert 50e0334b3d STY: Uses if/else for setting sim_params in algorithm.
Instead of checking 'if' and then 'if not', uses an if/else.
2013-03-19 20:53:44 -04:00
Eddie Hebert 1909a0576f MAINT: Removes unused frame_count member from algorithm class.
frame_count is only over incremented, but never read or otherwise
used.
2013-03-19 20:36:53 -04:00
Eddie Hebert 0b6e4650d9 MAINT: Removes unused flag from algorithm class.
The `self.done` member of TradingAlgorithm is never used.
2013-03-19 19:50:40 -04:00
Eddie Hebert 3e65980bda MAINT: Updates copyright of algorithm module to current year. 2013-03-19 19:06:54 -04:00
Eddie Hebert 351d5e8686 MAINT: Updates copyright to current year for returns module. 2013-03-19 17:14:01 -04:00
Eddie Hebert d17fb1c266 STY: Removes unused import. 2013-03-19 17:13:44 -04:00
Eddie Hebert ff991549b8 MAINT: Removes ipython related requirements.
Removes from requirements_dev.txt, since requirements_dev.txt is
used in various unit testing environments, ipython, pyzmq, etc.
is extra weight that is being unecessarily pulled in.
2013-03-19 14:38:55 -04:00
Tony Worm 086679c3d6 ENH: Adds new order types.
Adds the following order types:
- market
- limit
- stop
- stop limit
2013-03-19 14:32:11 -04:00
fawce dba86153d2 ENH: added a CUSTOM datasource type for custom data.
- perf modified to let non-performance related events flow through.
- changes to support streaming non-trading data through batch transforms
and for mixing in sids with just custom data.
- allowing CUSTOM events to flow through to transforms.
- Added logic to maintain pre-specified sid filter.
2013-03-19 11:39:23 -04:00
fawce 890762bde7 MAINT: added typed errors module
- added exceptions in place of asserts for expected fields for rolling
transforms.
- removed assertions with Messages in favor of typed exceptions.
2013-03-19 11:39:23 -04:00
Jonathan Kamens 9ad33ec941 MAINT: PyPI updates: six==1.3.0, delorean==0.2.0 2013-03-19 09:13:56 -04:00
Eddie Hebert 632cbf2e62 MAINT: Updates copyright for recently changed files. 2013-03-18 18:04:34 -04:00
Eddie Hebert 77bc821025 MAINT: Defines members of the Order object.
Instead of a loosely defined object for Order, explicitly
defines the parameters and corresponding members.

Clearing the way for adding more members to the Order object.
2013-03-18 17:59:14 -04:00
Jonathan Kamens 8f91711390 MAINT: New pytz version in requirements.txt 2013-03-15 13:31:29 -04:00
Thomas Wiecki 89ab65c413 REF: Import interface.
Makes TradingAlgorithm available at the top-level.
So that algorithms can do:
```
import zipline

class MyAlgo(zipline.TradingAlgorithm)
```

OR

```
from zipline import TradingAlgorithm

class MyAlgo(TradingAlgorithm)
```
2013-03-15 13:07:44 -04:00
Eddie Hebert ea11a43f68 MAINT: Removes unneeded assignment in slippage.
`direction` is set on each iteration of the loop,
making the initial assignment unneeded.
2013-03-12 20:37:36 -04:00
Eddie Hebert 43fac333a1 BUG: Fixes check reversal in slippage transact_stub.
Previous commit accidentally flipped the check when converting
to use `allclose`.
2013-03-12 20:34:16 -04:00
Eddie Hebert 2bf285b084 MAINT: More slippage comparison changes for floating point.
Continues conversion of floating point comparisons in slippage to
use numpy's allclose.
2013-03-12 20:28:47 -04:00
Eddie Hebert 27761f9dec MAINT: Uses copysign to extract order direction in FixedSlippage.
Uses copysign instead of division by fabs.
2013-03-12 19:47:01 -04:00
Eddie Hebert 080c54d4dc MAINT: Accounts for possible floating point rounding in slippage.
Uses numpy's allclose instead of straight comparison of floating
points, so that there is some tolerance of floating point rounding.
2013-03-12 19:40:24 -04:00
Eddie Hebert 39cfdaa7c9 MAINT: Updates copyright date of slippage module. 2013-03-12 19:18:52 -04:00
Eddie Hebert f7b4df4a09 MAINT: Uses copysign to extract direction of order.
Instead of using division of the amount by itself to extract
the direction, uses math's copysign.

Should be almost functionally equivalent,
but copysign won't have a possible floating point error leading
the direction to not be exactly 1.
2013-03-12 19:14:02 -04:00
Eddie Hebert 085eb040af MAINT: Updates pep8 from 1.4.4 -> 1.4.5 2013-03-09 17:32:55 -05:00
fawce 045773264b ENH: Adds a flag for optionally not serializing positions.
So that both computational and memory overhead is reduced,
this turns off serializing positions for cumulative performance.

Positions were essentially being doubled up by being stored
in both cumalative and daily.
2013-03-08 15:06:41 -05:00
Eddie Hebert a4e6520137 MAINT: Reverses polarity on keep transactions default.
So that transactions are kept by default.

This prepares for the addition of the serialize flag added by
@fawce.

Setting the default to True, so that the flags will be aligned.
2013-03-08 15:00:12 -05:00
Thomas Wiecki 0113765f70 Merge pull request #103 from mdengler/for-quantopian
README.md: update "Dependencies" section from setup.py
2013-03-07 11:29:30 -08:00
Martin Dengler 66fb0c583c README.md: update "Dependencies" section from setup.py 2013-03-07 01:08:21 +00:00
fawce 6a3e402a32 Merge pull request #101 from quantopian/fix_1516
Fix 1516
2013-03-06 14:26:33 -08:00
fawce a12eeb2383 incorporating feedback from @richafrank 2013-03-06 16:49:31 -05:00
Eddie Hebert e53622c930 MAINT: Changes unittest use of ndict to use specific objects.
Instead of using ndict, changing over to using the objects that
are created used when an algorithm is run.
2013-03-06 15:48:01 -05:00
Jeremiah Lowin 2095679a1d ENH: Adjust OHLC when loading bars to remove split/dividend noise
The adjustment is optional so that previous unadjusted values
can be compared to adjusted.
2013-03-06 11:04:24 -05:00
fawce b8144cea2a added tests to ensure:
- repeated calls with the same data window do not update batch transform
    windows.
    - repeated calls with the same data and same supplemental parameters do
    not update batch transform results
    - repeated calls with the same data and different supplemental params
    do update batch transform results
2013-03-05 22:59:31 -05:00
fawce 530f1cce55 added checks for change in optional parameters to trigger transform
recalculation.
2013-03-04 22:33:30 -05:00
Eddie Hebert 718ce0270a ENH: Improves handling of edge case in data update.
If the trading_days end date is not greater than the date being
tested, (this can happen if the algorithm's end date is set to a date
that is before the latest date available saved in the msgpacks),
then trying to get the location will fail, instead searchsorted
will get the lastest date available in the trading day map to use
as a test date.
2013-03-04 21:54:11 -05:00
Ryan Day 4170c05fb6 ENH: Update msgpack files if new data is available. 2013-03-04 21:54:05 -05:00
fawce a47143099c refining the batch transform interface:
- removed use_panel
  - default for refresh_period is now 0
  - refresh_period will only affect the recreation of the datapanel
  - user's transform method is invoked on every call to batch transform
2013-03-04 21:08:15 -05:00
Eddie Hebert 3e21ea52bc DEV: Adds a script to test data saved as msgpacks.
The loader_tool currently facilitates:
- Finding the last date in each source
- Forcing a complete reload of benchmark and treasury.
- Manipulating the msgpacks so that trailing dates are dropped,
  so that the condition for an update can be recreated.

This is intended to make it easier to test the update logic added
by @rday in PR #88
2013-03-04 17:07:36 -05:00
Eddie Hebert 092af814b8 MAINT: Adds license to treasuries module. 2013-03-04 11:11:57 -05:00
fawce 6329f477b8 removed data_panel option from BatchTransform.
- the underlying dequeue shouldn't be modified, so forwarding to the
user function is a bit misleading
- if we want to provide a dequeue we should consider another class
or an EventWindow decorator.
2013-03-04 06:26:41 -05:00
Jonathan Kamens 95e702ac84 MAINT: Update pyzmq version in dev requirements 2013-03-03 16:03:02 -05:00
Eddie Hebert e901e06f39 Changes the API for recording variables.
Uses a method called 'record' that provides a key value,
instead of providing keys to extract from context.

The variables are stored internally to the algorithm in a dictionary,
and not just stared as a property of the algorithm.

Main intent behind this change is to make the API more user friendly,
since the previous recorded_variables relies on the value to be set
in the algorithms context/self, the hope is that only having to use
the `record` method means less moving pieces and a more understandable
API.

i.e., instead of:

```
def initialize(self):
    recorded_variables('foo', bar')

def handle_data(self, data):
    self.foo = 1
    self.bar = 2
```

The API is now:

```
def initialize(self):
    pass

def handle_data(self, data):
    self.record(foo=1, bar=2)
```
2013-03-02 18:28:35 -05:00
Richard Frank ebdb5429aa MAINT: Moved DailyReturn to protocol module to break circular references
and removed code that solved that same problem with conditional imports.
2013-03-01 16:05:39 -05:00
Thomas Wiecki f1ff9cee0d ENH: New example algorithm OLMAR. 2013-03-01 15:33:12 -05:00
Richard Frank 7696abb169 MAINT: Removed unused prior_day_open from SimulationParameters 2013-03-01 13:21:28 -05:00
Eddie Hebert 414e12ecc9 BUG: Fixes error due to floating point rounding in stddev calc.
Adds a check to see if the s_squared value is near 0.

When the number was very near 0, a very small negative floating
point, the sqrt throws a 'math domain error', this prevents that
case.
2013-02-28 22:20:45 -05:00
Thomas Wiecki 46104fcd7c BUG: DataPanelSource was looping in the incorrect order. 2013-02-28 21:33:49 -05:00
Jonathan Kamens f38ed47773 DEV: List mccabe, pep8, pyflakes (used by flake8) in dev requirements 2013-02-26 11:11:23 -05:00
Jonathan Kamens cfd0fa507b MAINT: Upgrade dev requirements to flake8 2.0 2013-02-25 11:22:48 -05:00
Thomas Wiecki bea325f25a Merge pull request #95 from sender/delorean-fix
Add Delorean to dependency list in setup.py
2013-02-24 06:26:20 -08:00