Hi all!
I have been several days testing the possible combinations and I am not able to put an oco order.
Basically, after adjusting the quantities to meet the MIN_NOTIONAL, STEP_SIZE and similar filters for testing, it all boils down to this:
Test 1 vars:
side=SELL, stopPrice=1.619, price=1.535, stopLimitPrice=1.629, stopLimitTimeInForce=GTC.
Error obtained:
binance.exceptions.BinanceAPIException: APIError(code=-1013): The relationship of the prices for the orders is not correct.
Test 2 vars:
side=SELL, stopPrice=1.629, price=1.535, stopLimitPrice=1.619, stopLimitTimeInForce=GTC.
Error obtained:
binance.exceptions.BinanceAPIException: APIError(code=-1013): The relationship of the prices for the orders is not correct.
I do not understand the reason for the error, if I am complying with the parameters indicated here on the test 1 (if I am not wrong…)
Price Restrictions:
SELL: Limit Price > Last Price > Stop Price
BUY: Limit Price < Last Price < Stop Price
I’m working with binance-python api framework and the involved code is:
TPOrder = binance.create_oco_order(
symbol=symbol,
side=Client.SIDE_SELL,
stopPrice=TP_price_adjusted,
quantity=qty,
price=actualPrice,
stopLimitPrice=TP_price,
stopLimitTimeInForce=Client.TIME_IN_FORCE_GTC,
)
Can someone, help me? What am I ignoring, missing or understanding?