Hello Stack Overflow community, I hope you're all doing well and having a great day!
I'm having an issue with the pybit package in Python, and I was hoping that someone here might be able to help me out.
I am trying to edit the take profit and stop loss of an active position on Bybit futures markets. To do so, I'm using the official Python package identified by the Bybit exchange, pybit.
I'm specifically using the 'set_trading_stop' function, but I keep encountering an error message.
Here is the Python code that I am using to call the function:
session_auth.set_trading_stop(orderId=myorderid, symbol=crypto, stopLoss='25000', category='linear', positionIdx=0, slTriggerBy='MarkPrice')
The error message that I get is the following:
InvalidRequestError: Not modified (ErrCode: 130127) (ErrTime: 06:43:33).
Request → POST https://api.bybit.com/private/linear/position/trading-stop: {'api_key': 'xxx', 'category': 'linear', 'orderId': '67bf2151-1f30-4b33-b2b8-332023a33f2c', 'positionIdx': 0, 'recv_window': 5000, 'slTriggerBy': 'MarkPrice', 'stopLoss': '25000', 'symbol': 'BTCUSDT', 'timestamp': 1681886613451, 'sign': 'xxx'}.
I have searched on forums and Stack Overflow, but I have only found responses for the ccxt package. I would prefer to use the pybit package, as it is the official package identified by the Bybit exchange.
The pybit package is a public archive, so I am unable to create an issue on Github. Therefore, I am posting my issue here on Stack Overflow in the hopes of finding a solution.
If anyone has any ideas or suggestions, I would greatly appreciate it! Greg