Get historical data for multiple stocks

Sashank_Chittipeddi
Hello,
@sujith
I was trying to get historical data for multiple stocks. Is there a way to do this?

The kite.historical seems to work for one stock only & I'm unable to create a loop to iterate.
  • tonystark
    Hi @Sashank_Chittipeddi,

    Historical API gives only one stock data in a single call. You might be unable use it in a loop due to the rate limiting. To solve this you can put a delay of 300 milliseconds in the loop.
  • Jegan
    While calling kite.GetHistorical() method, sometimes it throws System.Collections.Generic.KeyNotFoundException exception

    I have tried with several instrument types and several time periods , but still the errors is same ,

    below is my code (tried with INFY)

    List historical = kite.GetHistorical("4578305", "2017-12-01", "2017-12-01", "minute");

    List historical = kite.GetHistorical("4578305", "2016-01-01 11:00:00", "2016-01-01 11:10:00", "minute");

    List historical = kite.GetHistorical("5633", "2016-12-28", "2017-01-01", "minute", Continuous: true);

    All the results are same :neutral:
  • Sashank_Chittipeddi
    @tonystark Thank you for the response. I added a 0.04 sec pause for every 3 loops
  • MAG
    This is a late response. But its a bad idea to use historical api in a loop to get a bunch of instrument data. You will use up your 3 calls per second for just getting the data and will not be able to do anything else like get status / place orders etc.
    Ping me your contact details I will help you out on how I go about it using tickdata from websockets
  • conquistadorjd
    @MAG
    Can you please share the details here as well ? I am also facing same issue and need to know if there is any alternative
Sign In or Register to comment.