I am trying to create chart of NIFTY 50 index using zerodha api(python) but that particular data is always empty in database. I can subscribe to other stocks and plot them and store them. Here storing is not happening.Please help me if i am doing anything wrong?
Seriously?? Ok,let me make it clear . Just subscribe to nifty and print ticks. If you're receiving the ticks,it means the problem is somewhere in your program. And,we don't provide support for programming. If you don't receive the ticks when just plain subscribing to nifty 50,you can tell.
I am very sorry Srijan. This is a very complex application based on django and i only manage a part of it so i really donno whaere to search for that code ur looking for. I just need a confirmation that this particular index "NIFTY50" can be subscribed by the instrument token 256265 using kite connect api (live data only)
def on_ticks(self, ws, ticks):
tick_models = [TickStore(**tick) for tick in ticks]
TickStore.objects.bulk_create(tick_models)
self.update_status(True, "Started ticker")
logging.info("stored %d ticks", len(tick_models))