mirror of
https://github.com/wassname/catalyst.git
synced 2026-09-10 11:50:32 +08:00
refactoring of algorithm to make it work for both batch style run method, and generator style consumption. removed the portfolio property from the data parameter. added set_slippage and set_commission methods to algorithm. removed timeout tracking.
This commit is contained in:
@@ -32,6 +32,7 @@ from zipline.gens.stddev import MovingStandardDev
|
||||
from zipline.gens.returns import Returns
|
||||
import zipline.utils.factory as factory
|
||||
|
||||
|
||||
from zipline.test_algorithms import BatchTransformAlgorithm
|
||||
|
||||
|
||||
@@ -315,7 +316,7 @@ class BatchTransformTestCase(TestCase):
|
||||
self.source, self.df = factory.create_test_df_source()
|
||||
|
||||
def test_event_window(self):
|
||||
algo = BatchTransformAlgorithm(sids=[0, 1])
|
||||
algo = BatchTransformAlgorithm()
|
||||
algo.run(self.source)
|
||||
|
||||
self.assertEqual(algo.history_return_price_class[:2],
|
||||
@@ -344,7 +345,7 @@ class BatchTransformTestCase(TestCase):
|
||||
)
|
||||
|
||||
def test_passing_of_args(self):
|
||||
algo = BatchTransformAlgorithm([0, 1], 1, kwarg='str')
|
||||
algo = BatchTransformAlgorithm(1, kwarg='str')
|
||||
self.assertEqual(algo.args, (1,))
|
||||
self.assertEqual(algo.kwargs, {'kwarg': 'str'})
|
||||
|
||||
|
||||
Reference in New Issue
Block a user