From fec41b18dd3a89cd475d722200e06a11ff9744b7 Mon Sep 17 00:00:00 2001 From: yenru0 Date: Sat, 9 May 2026 14:57:53 +0900 Subject: [PATCH] fix convert --- bot.py | 2 +- order.py | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bot.py b/bot.py index 1bd0165..e3f5e35 100644 --- a/bot.py +++ b/bot.py @@ -109,7 +109,7 @@ def on_trade(message: dict, orderman: OrderManager, state: StateManager): return orderman.buy("VALE", p_vale + 1, -SZ) - orderman.convert("VALE", SZ) + orderman.sell_convert("VALE", SZ) orderman.sell("VALBZ", p_valbz - 1, SZ) diff --git a/order.py b/order.py index 6a21914..53b1828 100644 --- a/order.py +++ b/order.py @@ -96,11 +96,11 @@ class OrderManager: ) def sell_convert(self, symbol: str, size: int): - if symbol == "VALBZ": - self.future_positions["VALBZ"] -= size + if symbol == "VALE": self.future_positions["VALE"] += size - self.positions["VALBZ"] -= size + self.future_positions["VALBZ"] -= size self.positions["VALE"] += size + self.positions["VALBZ"] -= size return self.exchange.send_convert_message( order_id=self._next_order(), symbol=symbol,