포지션 완화
This commit is contained in:
4
bot.py
4
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)
|
||||
|
||||
Reference in New Issue
Block a user