*looking for python expert to fix/finish existing code*

Job ID: 32129235

Budget: $30 – $250 USD

hi,

i have a python script that sends instructions to Deribit API.
the script is nearly finished, just needs some fixing here and there.

the script starts a popup window with some API instructions on hotkeys.

im running Windows 7 Pro.
installed Pycharm CE 2020.3.2 + Python 3.8 + PyQt 5.15.2

the window has an on/off toggle for setting always-on-top (i will request, if possible, for window to be always selected).
the window also has an on/off toggle for hotkeys override.

API instructions here: https://docs.deribit.com/?python#deribit-api-v2-0-1
(im familiar with all the API functions, so i can work alongside with you and guide you)

the window has an on/off toggle for websocket connection status (open/close websocket).
(need confirmation that this is working)

the window needs to display a ping reply from the API refreshed every 1s.

the window prints errors returned by the API.
(seems to be working so far)

the window has 3 boxes: 1) contract quantity, 2) trailing stop threshold, 3) trailing stop iterations.
(trailing stop has on/off toggle)

the hotkeys are the following:

F12) market buy + stop_market
(stop_market will automatically be set based on the market buy value and trailing stop threshold value)
(stop_market will be edited based on trailing stop iterations value)

F9) same as F12 but for sell instead of buy

Esc) close position (market)

F11) attempt to close position through limit sell (post only orders parameter) actively edited for chasing price
(stop_market will be edited to last_price + trailing stop threshold value)

F10) same as F11 but for buy instead of sell

[missing] F8/F5) limit buy/sell (using contract quantity value) actively edited for chasing price (post only orders parameter)
(stop_market will be edited based on trailing stop threshold value)

***come to think of it, i suppose we can combine F11/F10 with F8/F5...
the first step of "get_position" will need to be edited to react to when a position does not exist.
like, if position doesnt exist > use 'contract quantity' from the window instead.
(in this case Trailing Stop Iterations will need to be added)

there are 2 priority fixes needed:
1) the Trailing Stop Threshold is working on stop_market creation, stop_market editing, but not when the editing should occur.
when a stop_market is successfully edited the stop_market value should always be one Thrs. value away from last_price.
2) the 'post only order parameter' that is used for actively editing the order for price chasing isnt working. only works once for order creation.

also, the API Limiter display doesnt seem to allow to set a value lower than 0,20.

also noticed a couple errors like:
Exception in thread F11:
Traceback (most recent call last):
\AppData\Local\Programs\Python\Python38\lib\threading.py",
line 932, in _bootstrap_inner
self.run()
\AppData\Local\Programs\Python\Python38\lib\threading.py",
line 870, in run
self._target(*self._args, **self._kwargs)
\main.py", line 352, in f11_pressed
resultData = resp['result']['params']['data']
KeyError: 'params'

we are expected to work alongside with regular progress updates for testing until the program is complete.

prospect candidates will receive the code for inspection.

im open for any questions.
thanks.
Related categories: Python Software Architecture API