79418959

Date: 2025-02-06 18:17:54
Score: 1
Natty:
Report link

Ok, I found a solution. Instead an otoco trade, I needed an oto one

response = requests.post(f"{base_url}/sapi/v1/margin/order/oto", headers=headers, params=params)

where there is no need to provide a stop loss. So the params would look like this:

params = {
        "symbol": "BTCUSDT",
        "isIsolated": "FALSE",
        "sideEffectType": "MARGIN_BUY",
        "workingType": "LIMIT",
        "workingSide": "BUY",
        "workingPrice": 80000,
        "workingQuantity": 0.0002,
        "workingTimeInForce": "GTC",
        "pendingType": "LIMIT",
        "pendingSide": "SELL",
        "pendingQuantity": 0.0002,
        "pendingPrice": 110000,
        "pendingimeInForce": "GTC",
        'timestamp': int(time.time() * 1000), 
    }

This allows a limit-type as a follow-up order.

Reasons:
  • Blacklisted phrase (0.5): I need
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: user2635886