osparamatrix / ks-orderapi-python

47 stars 59 forks source link

How to get Real time market data from KS API for trading? Seems that KS doesn't have websocket. #26

Open abhishektrivedi333 opened 3 years ago

tupe-aniket commented 3 years ago

checkout ks.quote api

kalilinux-png commented 3 years ago

what kind of real time date you want do you want ask price and bid price or open high low close prices

aquibchiniwala commented 3 years ago

Is there a way to get live ltp or depth by using websocket or something else?

aquibchiniwala commented 3 years ago

@booooozaa quote api doesn't have a websocket interface to get live ticker updates

kalilinux-png commented 3 years ago

@aquibchiniwala to get the live data try the following code while True: print(client.quote(instrument_code,'LTP'))

the above code will give you the live trading price with very little latency

aquibchiniwala commented 3 years ago

Yes but it will block a large amount of CPU. Any idea when will the Websocket be implemented as it is a basic requirements for any trading apis. It would be great if it is developed on a very high priority bases.

kalilinux-png commented 3 years ago

@aquibchiniwala I have no idea when it will be implement i think you should contact developers of this api

aquibchiniwala commented 3 years ago

@aquibchiniwala to get the live data try the following code while True: print(client.quote(instrument_code,'LTP'))

the above code will give you the live trading price with very little latency

The quote method inside a loop returns the following error after 3 successful API calls though the quota is set to 60 calls/Minute.

HTTP response body: {"fault":{"code":900807,"message":"Request quota reached","description":"You have surpassed the maximum number of requests for the minute, please wait until the next minute to start additional requests"}}

@kalilinux-png do you have a solution for this?

Also I am not able to update the quota settings in the API Manager.

kalilinux-png commented 3 years ago

@aquibchiniwala brother while adding api to your app you might have selected wrong please select the policy as unlimited if you still not able to get rid of this error : please watch the video given below from 1: 50 - 2: 50 please let me know if this does not solve you issue