fix convert
This commit is contained in:
2
bot.py
2
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)
|
||||
|
||||
|
||||
|
||||
6
order.py
6
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,
|
||||
|
||||
Reference in New Issue
Block a user