mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-24 13:00:57 +08:00
BUG: can_trade was true for assets after their auto close date
This commit is contained in:
@@ -1348,10 +1348,10 @@ class TradingAlgorithm(object):
|
||||
if asset.auto_close_date:
|
||||
day = normalize_date(self.get_datetime())
|
||||
|
||||
if asset.end_date < day < asset.auto_close_date:
|
||||
# we are between the asset's end date and auto close date,
|
||||
# so warn the user that they can't place an order for this
|
||||
# asset, and return None.
|
||||
if day > min(asset.end_date, asset.auto_close_date):
|
||||
# If we are after the asset's end date or auto close date, warn
|
||||
# the user that they can't place an order for this asset, and
|
||||
# return None.
|
||||
log.warn("Cannot place order for {0}, as it has de-listed. "
|
||||
"Any existing positions for this asset will be "
|
||||
"liquidated on "
|
||||
|
||||
Reference in New Issue
Block a user