I am working on this particular code when the markets are Closed. While trying to get Ticker Data using Market Feed when the Markets were closed, I discovered I could get the output the first time I ran the code. But rerunning the same line {datafeed.get_data()} would result in the Previous Close, OI, and all other data. The data of Interest here is the LTP of the Input.
Another exciting thing is that the code gets stuck without output if I rerun the same line.
Is this happening because I am running this part of the code after markets are closed?
@Hardik .I would like to know your thoughts!
This is the first time I am posting, So apologies for the inconvenience caused if the question seems very amateur.
The Code is mentioned Below.
instruments = [(marketfeed.IDX,"442",marketfeed.Ticker)]
print(instruments)
datafeed = marketfeed.DhanFeed(client_id = client_id, access_token = access_token, instruments= instruments)
datafeed.run_forever()
datafeed.get_data()
datafeed.disconnect()
datafeed.close_connection()