Error with closing opposite position with CCXT for bybit

752 views Asked by At

i trying to make my CCXT bot to close old opposite trade with new trade coming from trading view but i have problem , it gives me this error:

ccxt.base.errors.ExchangeError: bybit {"ret_code":130125,"ret_msg":"current position is zero, cannot fix reduce-only order qty","result":{},"ext_code":"","ext_info":"","time_now":"1667916970.497041","rate_limit_status":99,"rate_limit_reset_ms":1667916970484,"rate_limit":100}

I use create_order function with param reduce only true the code :

bybitX.create_order(symbol=symbol,type='Market', side='sell',amount=0.01,price=None, params={'reduce_only': True})
bybitX.create_order(symbol=symbol,type='Market',side='Buy',amount=amount_Buy,price=None,
       params={
    'leverage': leverage,
},)

same for opposite

I tried to change the volume and I use the 'reduce only' mode for it

0

There are 0 answers