Closed Karlheinzniebuhr closed 2 years ago
Managed to create an order using the OCO function, didn't realize it was already supported as it isn't mentioned in the docmentation
oco_order = cls.client.create_margin_oco_order(
symbol=SYMBOL_TO_TRADE,
side=tp_sl_side,
quantity=quantity,
price=tp_price,
stopPrice=sl_price,
stopLimitPrice=sl_price,
stopLimitTimeInForce=TIME_IN_FORCE_GTC,
isIsolated=isIsolated,
sideEffectType="MARGIN_BUY")
I've tried two methods of posting a margin OCO order.
This one gives me the following error
And this one also gives an error
How can I manage to place the order correctly?
The content of the json looks like this:
{'symbol': 'BTCUSDT', 'side': 'BUY', 'quantity': '0.001', 'price': '18988.1', 'stopPrice': '20043.0', 'stopLimitPrice': '22152.8', 'stopLimitTimeInForce': 'GTC', 'isIsolated': 'TRUE', 'sideEffectType': 'MARGIN_BUY', 'timestamp': 1657923917979, 'signature': '9b6e1b6851c6dcb497d2...fc5dc19dcb'}