diff --git a/bot.py b/bot.py index 8862a55..58218c0 100644 --- a/bot.py +++ b/bot.py @@ -104,6 +104,10 @@ def on_trade(message: dict, orderman: OrderManager, state: StateManager): if 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.buy("VALE", p_vale + 1, -SZ) orderman.convert("VALE", SZ) orderman.sell("VALBZ", p_valbz - 1, SZ)