☰
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
14K
All Categories
0
Incidents
157
Node JS client
40
Go client
794
.Net API client
383
Kite Publisher
537
.Net / VBA / Excel (3rd party)
462
Algorithms and Strategies
1K
Java client
1.1K
API clients
405
PHP client
4K
Python client
349
Mobile and Desktop apps
1.4K
Market data (WebSockets)
3.4K
General
Websocket code in Python - returns local time in ticks
SahityaY
December 2024
edited December 2024
in
Python client
Hi Team,
I am trying to stream the ticks data. Streaming seems to work fine, but the timestamp is showing local time of machine.
The highlighted is the machine timestamp, but the actual time for the exchange should be 10:30+ AM.
35950594 : 28.5 : 2024-12-16 09:04:34
[['35950594', datetime.datetime(2024, 12, 16, 9, 4, 34), 28.5]]
Code snippet :
def on_ticks(ws, ticks):
for tick in ticks:
global streaming_data_list
instrument=str(tick['instrument_token'])
timestamp=tick['exchange_timestamp']
ltp=tick['last_price']
print(f"{instrument} : {ltp} : {timestamp}")
streaming_data_list.append([instrument,timestamp,ltp])
print(streaming_data_list)
the first and the 2nd ouput lines pasted above are related to the first and 2nd print statements respectively.
My understanding was, the ticks data will contain the exchange datetime.
Can someone please clarify?
Tagged:
Python Client
#TickTimestamp
image.png
15.4K
Sign In
or
Register
to comment.