fix convert

This commit is contained in:
2026-05-09 14:43:20 +09:00
parent d3d6ddeeb4
commit f46aeee181
2 changed files with 14 additions and 0 deletions

View File

@@ -81,6 +81,19 @@ class OrderManager:
price=price,
size=size,
)
def convert(self, symbol: str, size: int):
if symbol == "VALE":
target = "VALBZ"
self.future_positions["VALE"] -= 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,
dir="BUY",
size=size,
)
def buy(self, symbol: str, price: int, size: int):
return self._attempt_send(