This commit is contained in:
2026-05-09 14:59:25 +09:00
parent fec41b18dd
commit e3cc9fc4d8

10
bot.py
View File

@@ -111,7 +111,15 @@ def on_trade(message: dict, orderman: OrderManager, state: StateManager):
orderman.buy("VALE", p_vale + 1, -SZ)
orderman.sell_convert("VALE", SZ)
orderman.sell("VALBZ", p_valbz - 1, SZ)
elif p_vale - 1 > p_valbz + 1:
print("Good")
if (p_vale - 1) * SZ - FEE > (p_valbz + 1) * SZ:
if abs(orderman.positions["VALE"] - SZ) > orderman.POSITIONS_LIMIT["VALE"] or abs(orderman.positions["VALBZ"] + SZ) > orderman.POSITIONS_LIMIT["VALBZ"]:
print("포지션 제한으로 인해 주문이 무시되었습니다.")
return
orderman.sell("VALE", p_vale - 1, -SZ)
orderman.buy_convert("VALE", SZ)
orderman.buy("VALBZ", p_valbz + 1, SZ)
# ~~~~~============== PROVIDED CODE ==============~~~~~