ENH: Renamed to batch_order and added batch_order_target_percent

This commit is contained in:
Richard Frank
2016-12-20 11:58:05 -05:00
parent 74a3247892
commit 8ea3226a5c
5 changed files with 58 additions and 12 deletions
+9 -7
View File
@@ -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,
+2 -2
View File
@@ -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))