Working WebSocket Sample code to retrieve LTP - Python
-
is there any way to get low, high , ltp and volumes, & market watch (best 5 bids & ask)?
-
@lavly what's your sdk version ??
-
@James-Bond yes
-
-
you can look at the key value and its corresponding explanation here
-
@James-Bond this code is giving following errorrs
ReactorNotRestartable Traceback (most recent call last)
<ipython-input-71-f3a22d8e176e> in <module>()
21 ss.on_close = on_close
22
---> 23 ss.connect( )3 frames
/usr/local/lib/python3.7/dist-packages/twisted/internet/base.py in startRunning(self)
841 raise error.ReactorAlreadyRunning()
842 if self._startedBefore:
--> 843 raise error.ReactorNotRestartable()
844 self._started = True
845 self._stopped = FalseReactorNotRestartable:
-
def on_tick(ws, tick):
for i in tick:
for j, k in i.items():
if j == 'ltp':
print(j, k)
else:
passIf j is ltp and k is the value of ltp then Instead of just LTP, I want to print Open,Close,High,Low,Bid Price, Ask Price. Any idea how?
-
This post is deleted! -
-