The below script works fine in "Hedge Mode". However, if I change the Position Mode to "One-Way Mode", I got an error, "position idx not match position mode". I've googled for a while and still cannot find the solution, please kindly help, thanks!
import ccxt
import config
asset_symbol = 'BTC/USDT:USDT'
order_size = 0.001
ex = ccxt.bybit(
{'enableRateLimit': True,
'apiKey': config.api_keys[asset_symbol],
'secret': config.api_secrets[asset_symbol]}
)
response = ex.create_market_buy_order(symbol=asset_symbol, amount=order_size)