fix convert

This commit is contained in:
2026-05-09 14:57:53 +09:00
parent d5ae98a19f
commit fec41b18dd
2 changed files with 4 additions and 4 deletions

2
bot.py
View File

@@ -109,7 +109,7 @@ def on_trade(message: dict, orderman: OrderManager, state: StateManager):
return return
orderman.buy("VALE", p_vale + 1, -SZ) orderman.buy("VALE", p_vale + 1, -SZ)
orderman.convert("VALE", SZ) orderman.sell_convert("VALE", SZ)
orderman.sell("VALBZ", p_valbz - 1, SZ) orderman.sell("VALBZ", p_valbz - 1, SZ)

View File

@@ -96,11 +96,11 @@ class OrderManager:
) )
def sell_convert(self, symbol: str, size: int): def sell_convert(self, symbol: str, size: int):
if symbol == "VALBZ": if symbol == "VALE":
self.future_positions["VALBZ"] -= size
self.future_positions["VALE"] += size self.future_positions["VALE"] += size
self.positions["VALBZ"] -= size self.future_positions["VALBZ"] -= size
self.positions["VALE"] += size self.positions["VALE"] += size
self.positions["VALBZ"] -= size
return self.exchange.send_convert_message( return self.exchange.send_convert_message(
order_id=self._next_order(), order_id=self._next_order(),
symbol=symbol, symbol=symbol,