mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-19 11:22:06 +08:00
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:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user