bidir
This commit is contained in:
10
bot.py
10
bot.py
@@ -111,7 +111,15 @@ def on_trade(message: dict, orderman: OrderManager, state: StateManager):
|
|||||||
orderman.buy("VALE", p_vale + 1, -SZ)
|
orderman.buy("VALE", p_vale + 1, -SZ)
|
||||||
orderman.sell_convert("VALE", SZ)
|
orderman.sell_convert("VALE", SZ)
|
||||||
orderman.sell("VALBZ", p_valbz - 1, 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 ==============~~~~~
|
# ~~~~~============== PROVIDED CODE ==============~~~~~
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user