mirror of
https://github.com/wassname/catalyst.git
synced 2026-09-10 11:50:32 +08:00
ENH: Renamed to batch_order and added batch_order_target_percent
This commit is contained in:
@@ -123,6 +123,7 @@ from zipline.test_algorithms import (
|
||||
TestTargetAlgorithm,
|
||||
TestTargetPercentAlgorithm,
|
||||
TestTargetValueAlgorithm,
|
||||
TestBatchTargetPercentAlgorithm,
|
||||
SetLongOnlyAlgorithm,
|
||||
SetAssetDateBoundsAlgorithm,
|
||||
SetMaxPositionSizeAlgorithm,
|
||||
@@ -905,14 +906,15 @@ def before_trading_start(context, data):
|
||||
self.assertEqual(algo.sim_params.data_frequency, 'minute')
|
||||
|
||||
@parameterized.expand([
|
||||
(TestOrderAlgorithm,),
|
||||
(TestOrderValueAlgorithm,),
|
||||
(TestTargetAlgorithm,),
|
||||
(TestOrderPercentAlgorithm,),
|
||||
(TestTargetPercentAlgorithm,),
|
||||
(TestTargetValueAlgorithm,),
|
||||
('order', TestOrderAlgorithm,),
|
||||
('order_value', TestOrderValueAlgorithm,),
|
||||
('order_target', TestTargetAlgorithm,),
|
||||
('order_percent', TestOrderPercentAlgorithm,),
|
||||
('order_target_percent', TestTargetPercentAlgorithm,),
|
||||
('order_target_value', TestTargetValueAlgorithm,),
|
||||
('batch_order_target_percent', TestBatchTargetPercentAlgorithm,),
|
||||
])
|
||||
def test_order_methods(self, algo_class):
|
||||
def test_order_methods(self, test_name, algo_class):
|
||||
algo = algo_class(
|
||||
sim_params=self.sim_params,
|
||||
env=self.env,
|
||||
|
||||
@@ -330,7 +330,7 @@ class BlotterTestCase(WithCreateBarData,
|
||||
|
||||
blotter.prune_orders([other_order])
|
||||
|
||||
def test_order_batch_matches_multi_order(self):
|
||||
def test_batch_order_matches_multiple_orders(self):
|
||||
"""
|
||||
Ensure the effect of order_batch is the same as multiple calls to
|
||||
order.
|
||||
@@ -345,7 +345,7 @@ class BlotterTestCase(WithCreateBarData,
|
||||
(self.asset_25, i * 100, LimitOrder(i * 100 + 1)),
|
||||
]
|
||||
|
||||
order_batch_ids = blotter1.order_batch(order_arg_lists)
|
||||
order_batch_ids = blotter1.batch_order(order_arg_lists)
|
||||
order_ids = []
|
||||
for order_args in order_arg_lists:
|
||||
order_ids.append(blotter2.order(*order_args))
|
||||
|
||||
Reference in New Issue
Block a user