From 0d098403f16515111fef433a89874158a289eb92 Mon Sep 17 00:00:00 2001 From: yenru0 Date: Sat, 9 May 2026 14:52:02 +0900 Subject: [PATCH] =?UTF-8?q?=ED=8F=AC=EC=A7=80=EC=85=98=20=EC=99=84?= =?UTF-8?q?=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bot.py | 4 ++++ 1 file changed, 4 insertions(+) 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)