pybit icon indicating copy to clipboard operation
pybit copied to clipboard

close_position() doesn't account for position_idx

Open dextertd opened this issue 2 years ago • 1 comments

Recently, position mode switch was released for USDT perp, which means position_idx is a required parameter when in single position mode. https://bybit-exchange.github.io/docs/linear/#2021-12-28

In pybit Custom Endpoints there is a command close_position(), but it seems need modification, it dosent accept 'position_idx' and without it returns error: pybit.exceptions.InvalidRequestError: Position idx not match position mode (ErrCode: 130001)

dextertd avatar Jan 10 '22 10:01 dextertd

It seems it doesn't work in Bybit one-way mode.

msjahan47 avatar Jan 28 '22 14:01 msjahan47