Hi everyone! I have found that when I try to get PnL history using session.get_closed_pnl(), I receive the following error stating that it's not available for demo trading:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Taran\Documents\venvs\trading\Lib\site-packages\pybit\_v5_position.py", line 264, in get_closed_pnl
return self._submit_request(
File "C:\Users\Taran\Documents\venvs\trading\Lib\site-packages\pybit\_http_manager.py", line 197, in _submit_request
return self._handle_response(response, method, path, req_params, recv_window, retries_attempted)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Taran\Documents\venvs\trading\Lib\site-packages\pybit\_http_manager.py", line 282, in _handle_response
raise InvalidRequestError(
pybit.exceptions.InvalidRequestError: Demo trading are not supported. (ErrCode: 10032) (ErrTime: 12:10:31).
Request → GET https://api-demo.bybit.com/v5/position/closed-pnl: .
When I use Postman, however, I can get the history without a problem:
So, I'm wondering whether this is a problem with pybit and could it be resolved?
Hi everyone! I have found that when I try to get PnL history using
session.get_closed_pnl(), I receive the following error stating that it's not available for demo trading:When I use Postman, however, I can get the history without a problem:
So, I'm wondering whether this is a problem with pybit and could it be resolved?