☰
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
15K
All Categories
0
Incidents
178
Node JS client
52
Go client
849
.Net API client
397
Kite Publisher
554
.Net / VBA / Excel (3rd party)
493
Algorithms and Strategies
1.1K
Java client
1.2K
API clients
410
PHP client
4.3K
Python client
358
Mobile and Desktop apps
1.5K
Market data (WebSockets)
3.6K
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.