fix convert

This commit is contained in:
yenru0 committed 2026-05-09 14:57:57 +09:00
1 parent d5ae98a19f
commit fec41b18dd
2 files changed
+4 -4

No files matched your search

+1 -1
View File
@@ -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)
+3 -3
View File
@@ -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,