Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does this bot only work on Inverse perpetual? #9

Open
andy1245 opened this issue Jan 1, 2022 · 8 comments
Open

Does this bot only work on Inverse perpetual? #9

andy1245 opened this issue Jan 1, 2022 · 8 comments

Comments

@andy1245
Copy link

andy1245 commented Jan 1, 2022

Hi I try to use this bot for USDT Perpetual, but it seems not to work. In config I use SYMBOL = 'BTCUSDT'
COIN = 'BTC'

error is pybit.exceptions.InvalidRequestError: Param validation for 'qty' failed on the 'required' tag (ErrCode: 10001) (ErrTime: 17:57:04).
Request →

However using the Inverse perpetual BTCUSD works. Doesn't it work on USDT Perpetual?

@xbrandonx
Copy link

xbrandonx commented Jan 1, 2022 via email

@andy1245
Copy link
Author

andy1245 commented Jan 3, 2022

How to use the USDT-pairs? For me it only works in the USD-pairs.
Maybe this bot can only handel the USD Inverse perpetual coins?

@xbrandonx
Copy link

xbrandonx commented Jan 4, 2022 via email

@xbrandonx
Copy link

I started a new project and Bybit account and was getting the same error on testnet.
Then I opened a position manually on the Bybit website. And then ran this script. It then worked perfectly.

@andy1245
Copy link
Author

andy1245 commented Jan 5, 2022

Thank you for your help. Unfurtunatelly this doesn't work for me.
The bot cancels my open position and when it wants to place the new orders a get an error: Param validation for 'close_on_trigger' failed on the 'exists' tag (ErrCode: 10001)

2022-01-05 19:07:04.001225 - INFO - Checking last price.
2022-01-05 19:07:04.206856 - INFO - Generating order prices.
2022-01-05 19:07:04.207144 - INFO - Generating order quantities.
2022-01-05 19:07:04.412388 - INFO - Submitting orders.
Traceback (most recent call last):
File "run.py", line 126, in
responses = s.place_active_order_bulk(orders=orders)
File "/usr/local/lib/python3.8/dist-packages/pybit/init.py", line 515, in place_active_order_bulk
return [execution.result() for execution in executions]
File "/usr/local/lib/python3.8/dist-packages/pybit/init.py", line 515, in
return [execution.result() for execution in executions]
File "/usr/lib/python3.8/concurrent/futures/_base.py", line 437, in result
return self.__get_result()
File "/usr/lib/python3.8/concurrent/futures/_base.py", line 389, in __get_result
raise self._exception
File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/local/lib/python3.8/dist-packages/pybit/init.py", line 488, in place_active_order
return self._submit_request(
File "/usr/local/lib/python3.8/dist-packages/pybit/init.py", line 1882, in _submit_request
raise InvalidRequestError(
pybit.exceptions.InvalidRequestError: Param validation for 'close_on_trigger' failed on the 'exists' tag (ErrCode: 10001) (ErrTime: 19:07:04).
Request → POST https://api.bybit.com/private/linear/order/create: {'api_key': 'xxx', 'order_type': 'Limit', 'price': 44884, 'qty': 10899875, 'recv_window': 5000, 'side': 'Buy', 'symbol': 'BTCUSDT', 'time_in_force': 'GoodTillCancel', 'timestamp': 1641409624412, 'sign': '4ea54cb6faa768ac6804e305eedbe55e4143d87e326074cf81a4c0217d36a6f8'}.

@secp600k1
Copy link

secp600k1 commented Jan 18, 2022

got the same issue, I think it only works with Inverse Perps. I tried connecting linear perps on testnet, still gives the same error. I tried changing 'close_on_trigger' and 'reduce_only'. still the issue remains.

@xbrandonx tried creating positions beforehand. still the issue remains.

EDIT: @andy1245 I got it working for other orders like "place_active_order". I think the issue is with placing bulk orders on BTCUSDT perp market.

@xbrandonx
Copy link

xbrandonx commented Jan 18, 2022 via email

@xbrandonx
Copy link

xbrandonx commented Jan 18, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants