Does Marketfeed works only during when the Market is Open?

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()
1 Like

Hello @jagadeesh_930

Welcome to MadeForTrade community!

Great to know you are working with Dhan APIs and Feeds. No question is amateur here so feel free to post your thoughts.

Yes, this can be because markets are closed. The last tick is always send from bucket which will be the closing tick. Also, Prev Close packet is sent if any instrument is subscribed, so that is intended.