Getting Started with the Python library
@tarun but there is no facility to place cover orders from amibroker bridge. I checked the documentation of that product and there is no mention of cover order. So what is the semi automated solution for cover order?
@shrini.viswanath: It dosent work. The wheel file still downloads enum and tries to use it, even if I force it not to used cached downloads.
I tried it with python 3.6 - I have the same issue. On two machines. Are you able to reproduce the issue at your end ?
@abbanerjee Tried it on Mac OS and Linux on 3.x and it works fine... The library was built on 3.x!
Okay then but it still does not work fine for me. So not sure if you can help further. I am out of tricks.
Found the fix - updated in the original question.
@abbanerjee Please update here also. It will be very helpful. Thanks in advance.
Here are the steps to workarround
Download the git zip file and extract it locally.
Go to upstox-python-master folder and edit setup.py
Change enum in line 10 for install_requires to enum34. Save this file.
Open folder upstox-python-master in command prompt.
Run >pip install .
Also copy service_config.json from upstox-python-master/upstox_api to <HOME>\Local\Programs\Python\Python35-32\Lib\site-packages\upstox_api
Finally i am able to login to my account. I found there are mistakes in document which are misleading and taking time. One perfect exmple is missing from Upstox. They should freely extend the period of API access for 1 month to all user. Its like we are paying to find the bugs in API for Upstoxs.
The access response time is very slow. Why? I am using Python 3.6 Shell.
How to resolve this error?
@sacjan2002 this was fixed in last weeks release. Can you force uninstall and reinstall the latest version of the library from pip?
Instructions on doing it is in the Git Readme.
Why does the Python SDK return the LiveFeed event object with dict values as strings/unicode/byte buffers, where those should either be float/int (e.g., values of the keys 'atp', 'ltp', timestamp etc.)? The SDK should just convert such values to respective proper types, as shown in the API doc json response example, here: https://upstox.com/developer/api/v1/docs/#live-feed
Not that it matters now, as I had to write a specific schema for conversion. The "custom" named-tuple "Instrument" adds to the woes -- 'instrument' key can just have a dict object as value. Simplicity should cut down on your and my burden. Yes?!
@112763 yeah right now it just pulls the values off the wire and pops them into an object. We don't do any conversion ATM. Added an issue - https://github.com/upstox/upstox-python/issues/5. You can add more here.
After placing order to get the execprice and execTime and quantity. What is the method should I use
a. using return value of placeorder and then calling get_trades as a synchronous call
b. Save trades from trade_update callback and make use of it. How will I know all the trades of the a particular order have be delivered via callback.
Do we have API method call to get position for one symbol instead of all positions
How should we take into account messages from error, and on_disconnect callback. Should we stop sending orders or we should implement a retry logic
Is there possibility of order_update and trade_update sending repeat messages. Or it is only once called
To confirm where stoploss is it hit which method should be used, referring the saved order_update events or a synchoronous method call to get_trades.
The questions were answered in the below link