How to get the last 15 Min Candle Data of the Day during market hours

abhidutta86
I wanted the last 15 Min Candle data during market hours. I thought that using something like would work. But it dosen't.

string today = DateTime.Today.ToString("yyyy-MM-dd");
List historical_timestamp = kite.GetHistorical(InstrumentToken.ToString(), today, today,"15minute");

I get an error "System.Collections.Generic.KeyNotFoundException: 'The given key was not present in the dictionary"

I understand that a candle may not have created but it should return an empty collection and not throw errors.

  • tonystark
    Can you try initializing your kite instance like

    Kite kite = new Kite(MyAPIKey, Debug: true);

    And try calling historical API. Please post the logs for that.
Sign In or Register to comment.