From e499ba1aba52a1147a094b3e8e3fffdfd73367da Mon Sep 17 00:00:00 2001 From: Guillaume De Saint Martin Date: Sun, 29 Oct 2023 21:27:24 +0100 Subject: [PATCH] [ArbitrageTrading] handle error when creating order --- Trading/Mode/arbitrage_trading_mode/arbitrage_trading.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Trading/Mode/arbitrage_trading_mode/arbitrage_trading.py b/Trading/Mode/arbitrage_trading_mode/arbitrage_trading.py index cee3138b6..fb75f6ab6 100644 --- a/Trading/Mode/arbitrage_trading_mode/arbitrage_trading.py +++ b/Trading/Mode/arbitrage_trading_mode/arbitrage_trading.py @@ -190,9 +190,10 @@ async def _create_initial_arbitrage_order(self, arbitrage_container): quantity=order_quantity, price=order_price) created_order = await self.trading_mode.create_order(current_order) - created_orders.append(created_order) - arbitrage_container.initial_limit_order_id = created_order.order_id - self.open_arbitrages.append(arbitrage_container) + if created_order is not None: + created_orders.append(created_order) + arbitrage_container.initial_limit_order_id = created_order.order_id + self.open_arbitrages.append(arbitrage_container) # only create one order per arbitrage return created_orders