I am struggling to get the following code to work with binance-connector:
params = {
‘symbol’: coin_name,
‘side’: ‘SELL’,
‘aboveType’:‘LIMIT_MAKER’,
‘belowType’:‘STOP_LOSS’,
‘abovePrice’: upper_price,
‘belowPrice’: stop_price,
‘belowStopPrice’:lower_price,
‘quantity’: qty_t,
‘belowTimeInForce’: ‘GTC’,
‘timestamp’: timestamp_t
}
profit_take_data = client.new_oco_order(**params)
i get the following error:
new_oco_order() missing 2 required positional arguments: ‘price’ and ‘stopPrice’
pip list says 3.6.0 The version on my hard drive is different to the latest version on github. Looks like i am using an old version of binance-connector, is this possibly why it does not work?
I have the correct version for github, i will try again, thanks for giving me the solution. Andrew
The new oco trade request has been updated on version 3.8.0. As you are using a former version, the request is made to the endpoint POST /api/v3/order/oco which requires the parameters price and stopPrice.