mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-13 15:33:45 +08:00
Fixed an issue with failed orders
This commit is contained in:
@@ -401,8 +401,9 @@ class ExchangeTradingAlgorithm(TradingAlgorithm):
|
||||
if order_id is not None:
|
||||
order = self.portfolio.open_orders[order_id]
|
||||
self.perf_tracker.process_order(order)
|
||||
|
||||
return order
|
||||
return order
|
||||
else:
|
||||
return None
|
||||
|
||||
def round_order(self, amount):
|
||||
"""
|
||||
|
||||
@@ -531,10 +531,11 @@ class Exchange:
|
||||
)
|
||||
)
|
||||
order = self.create_order(asset, amount, is_buy, style)
|
||||
|
||||
self._portfolio.create_order(order)
|
||||
|
||||
return order.id
|
||||
if order:
|
||||
self._portfolio.create_order(order)
|
||||
return order.id
|
||||
else:
|
||||
return None
|
||||
|
||||
@abstractmethod
|
||||
def get_open_orders(self, asset):
|
||||
|
||||
Reference in New Issue
Block a user