pybit
pybit copied to clipboard
close_position() doesn't account for position_idx
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)
It seems it doesn't work in Bybit one-way mode.