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.
This commit is contained in:
Joe Jevnik
2014-11-17 13:16:30 -05:00
parent 7889f93522
commit e3d8b1034e
17 changed files with 427 additions and 904 deletions
-14
View File
@@ -81,7 +81,6 @@ from zipline.sources import (SpecificEquityTrades,
DataPanelSource,
RandomWalkSource)
from zipline.transforms import MovingAverage
from zipline.finance.execution import LimitOrder
from zipline.finance.trading import SimulationParameters
from zipline.utils.api_support import set_algo_instance
@@ -335,19 +334,6 @@ class TestTransformAlgorithm(TestCase):
np.testing.assert_array_equal(res1, res2)
def test_transform_registered(self):
algo = TestRegisterTransformAlgorithm(
sim_params=self.sim_params,
sids=[133]
)
algo.run(self.source)
assert 'mavg' in algo.registered_transforms
assert algo.registered_transforms['mavg']['args'] == (['price'],)
assert algo.registered_transforms['mavg']['kwargs'] == \
{'window_length': 2, 'market_aware': True}
assert algo.registered_transforms['mavg']['class'] is MovingAverage
def test_data_frequency_setting(self):
self.sim_params.data_frequency = 'daily'
algo = TestRegisterTransformAlgorithm(