☰
Login
Signup
Home
›
Python client
Howdy, Stranger!
It looks like you're new here. If you want to get involved, click one of these buttons!
Sign In
Register
Categories
Recent Discussions
Activity
Categories
13.8K
All Categories
0
Incidents
152
Node JS client
39
Go client
792
.Net API client
378
Kite Publisher
537
.Net / VBA / Excel (3rd party)
457
Algorithms and Strategies
992
Java client
1.1K
API clients
402
PHP client
4K
Python client
346
Mobile and Desktop apps
1.4K
Market data (WebSockets)
3.3K
General
In this Discussion
January 2018
sujith
January 2018
Sudheer
January 2018
rakeshr
Streaming data output shows only one iteration data and does not stream
Sudheer
January 2018
in
Python client
I run the below code in pycharm and anaconda and both ways I just get a single iteration output, please help me as to what I'm I missing on.
from kiteconnect import KiteConnect
from kiteconnect import WebSocket
api_key = "XXX"
public_token = 'XXX'
user_id = "XXX"
tokens = (14607362, 533155)
kws = WebSocket(api_key, public_token, user_id)
def on_tick(tick,ws):
# import sys
# sys.stdout=open("XXX.txt","w")
print(tick), "\n"
# sys.stdout.close()
def on_connect(ws):
ws.subscribe(tokens)
ws.set_mode(ws.MODE_FULL,tokens)
kws.on_tick = on_tick
kws.on_connect = on_connect
kws.connect()
@sujith
@botany02
@Kailash
please address my query.
Tagged:
live streaming
streaming
WebSocket streaming data
anaconda
pycharm
rakeshr
January 2018
Hi
@Sudheer
,
For second scrip JUBLFOOD, you are entering exchange token instead of instrument token.Change second token parameter from 533155 to 4632577.You can download entire instrument list dump(go through
this documentation
) and check
Sudheer
January 2018
@rakeshr
thank you for your response, I changed it.. and I still got just one iteration of data and the prompt doesn't move any further.
I have attached the screenshot of it, the prompt just stays there forever with no new data being updated.
image.png
54.2K
sujith
January 2018
@Sudheer
,
Markets are closed on weekends. You will get only one cached tick for each instrument. Try tomorrow after the market opens.
Sudheer
January 2018
@sujith
- I tried now, it worked
thanks
This discussion has been closed.
For second scrip JUBLFOOD, you are entering exchange token instead of instrument token.Change second token parameter from 533155 to 4632577.You can download entire instrument list dump(go through this documentation) and check
I have attached the screenshot of it, the prompt just stays there forever with no new data being updated.
Markets are closed on weekends. You will get only one cached tick for each instrument. Try tomorrow after the market opens.