I can't create an order on the exchange bybit using python (pybit)

915 Views Asked by At

i need help

 from pybit.usdt_perpetual import HTTP
    session_auth_ = HTTP(
                endpoint='https://api.bybit.com',
                api_key=api_key,
                api_secret=secret_key
            )
     res=session_auth_.place_active_order(
            symbol='LTCUSDT',
            side='Sell',
            order_type='Limit',
            qty=1,
            price=56.01,
            time_in_force='GoodTillCancel',
            reduce_only=False,
            close_on_trigger=False
            )

Error:

  pybit.exceptions.InvalidRequestError: Oc_diff[568068600], new_oc[568068600] with ob[0]+ab[0] (ErrCode: 130021) (ErrTime: 20:24:51).
    Request → POST https://api.bybit.com/private/linear/order/create: {'api_key': '.........', 'close_on_trigger': False, 'order_type': 'Limit', 'price': 56.1, 'qty': 1, 'recv_window': 5000, 'reduce_only': False, 'side': 'Sell', 'symbol': 'LTCUSDT', 'time_in_force': 'GoodTillCancel', 'timestamp': 1666815890695, 'sign': 'cf8c055049303634c8c6aa17077689ddb6d8ca490302e392b0590b3dbd02ca19'}.

I tried to change the quantity, price, but the result was not received

1

There are 1 best solutions below

1
On

130021 : order cost not available

Not having enough funds can be an issue.