mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-06 01:22:35 +08:00
Fixed odd bug that caused the first day not to get simulated. This triggered some changes to the batchtransform unittests.
This commit is contained in:
committed by
Eddie Hebert
parent
42c2a6b892
commit
c0b161287d
@@ -329,17 +329,17 @@ class BatchTransformTestCase(TestCase):
|
||||
for test_history in [algo.history_return_price_class,
|
||||
algo.history_return_price_decorator]:
|
||||
np.testing.assert_array_equal(
|
||||
range(4, 10),
|
||||
range(2, 8),
|
||||
test_history[2].values.flatten()
|
||||
)
|
||||
|
||||
np.testing.assert_array_equal(
|
||||
range(4, 10),
|
||||
range(2, 8),
|
||||
test_history[3].values.flatten()
|
||||
)
|
||||
|
||||
np.testing.assert_array_equal(
|
||||
range(6, 14),
|
||||
range(4, 12),
|
||||
test_history[4].values.flatten()
|
||||
)
|
||||
|
||||
@@ -352,4 +352,5 @@ class BatchTransformTestCase(TestCase):
|
||||
expected_item = ((1, ), {'kwarg': 'str'})
|
||||
self.assertEqual(
|
||||
algo.history_return_args,
|
||||
[None, None, expected_item, expected_item, expected_item])
|
||||
[None, None, expected_item, expected_item,
|
||||
expected_item, expected_item])
|
||||
|
||||
@@ -132,7 +132,9 @@ class AlgorithmSimulator(object):
|
||||
self.order_book = order_book
|
||||
|
||||
self.algo = algo
|
||||
self.algo_start = algo_start
|
||||
self.algo_start = algo_start.replace(hour=0, minute=0,
|
||||
second=0,
|
||||
microsecond=0)
|
||||
|
||||
# Monkey patch the user algorithm to place orders in the
|
||||
# TransactionSimulator's order book and use our logger.
|
||||
|
||||
Reference in New Issue
Block a user