bot.py order.py

This commit is contained in:
2026-05-09 14:56:20 +09:00
parent 0d098403f1
commit f480e23717
2 changed files with 15 additions and 2 deletions

View File

@@ -82,7 +82,7 @@ class OrderManager:
size=size,
)
def convert(self, symbol: str, size: int):
def buy_convert(self, symbol: str, size: int):
if symbol == "VALE":
self.future_positions["VALE"] -= size
self.future_positions["VALBZ"] += size
@@ -95,6 +95,19 @@ class OrderManager:
size=size,
)
def sell_convert(self, symbol: str, size: int):
if symbol == "VALBZ":
self.future_positions["VALBZ"] -= size
self.future_positions["VALE"] += size
self.positions["VALBZ"] -= size
self.positions["VALE"] += size
return self.exchange.send_convert_message(
order_id=self._next_order(),
symbol=symbol,
dir="SELL",
size=size,
)
def buy(self, symbol: str, price: int, size: int):
return self._attempt_send(
"add",