mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-21 12:30:16 +08:00
BUG: Normalize dates in AssetDateBounds control checks
Assumes that if a given asset's end_date is e.g. 9/17/2015 00:00:00 UTC that it means the asset is still tradeable on 9/17/2015 during the market day.
This commit is contained in:
@@ -1573,6 +1573,19 @@ class TestTradingControls(TestCase):
|
||||
with self.assertRaises(TradingControlViolation):
|
||||
algo.run(df_source)
|
||||
|
||||
# Run the algorithm with a sid that starts on the first day and
|
||||
# ends on the last day of the algorithm's parameters (*not* an error).
|
||||
temp_env = TradingEnvironment()
|
||||
df_source, _ = factory.create_test_df_source(self.sim_params, temp_env)
|
||||
metadata = {0: {'start_date': '2006-01-03',
|
||||
'end_date': '2006-01-06'}}
|
||||
algo = SetAssetDateBoundsAlgorithm(
|
||||
equities_metadata=metadata,
|
||||
sim_params=self.sim_params,
|
||||
env=temp_env,
|
||||
)
|
||||
algo.run(df_source)
|
||||
|
||||
|
||||
class TestAccountControls(TestCase):
|
||||
|
||||
|
||||
Reference in New Issue
Block a user