Refresh Frequency : Historical data

kiran
kiran edited August 2017 in Python client
At what intervals are the historical data refreshed?? based on few post it was said it is refreshed as soon as the bar is complete: (Here is the sample log of data)

2017-08-02 13:20:06,009 DEBUG: https://api.kite.trade:443 "GET /instruments/historical/348929/5minute?from=2017-07-28&access_token=590kj3oh9qhvzzg7fd7lobqcwfnqi0ig&interval=5minute&to=2017-08-02&instrument_token=348929&api_key=w93q0599w5363xdu HTTP/1.1" 200 None

2017-08-02 13:20:06,107 DEBUG: HINDALCO Data:

date open high low close volume token kst signal ma_3 ma_5 upperband middleband lowerband vol_20
269 2017-08-02 12:55:00 224.80 224.95 224.70 224.85 19214 348929 4.466632 1.924590 224.966667 224.99 225.437540 224.2750 223.112460 57985.80
270 2017-08-02 13:00:00 224.85 225.00 224.75 224.75 24026 348929 4.663185 2.562213 224.883333 224.97 225.443135 224.3450 223.246865 56180.90
271 2017-08-02 13:05:00 224.75 224.95 224.70 224.85 15249 348929 4.856265 3.136175 224.800000 224.90 225.420741 224.4250 223.429259 56306.15
272 2017-08-02 13:10:00 224.85 225.65 224.75 225.55 48220 348929 5.346883 3.681750 224.816667 224.85 225.496870 224.5400 223.583130 57669.05
273 2017-08-02 13:15:00 225.55 225.60 225.40 225.45 31442 348929 5.583253 4.156859 225.050000 224.96 225.594341 224.6225 223.650659 54747.30

As you can see, the API was invoked 6 seconds after the 2017-08-02 13:15 bar is complete and OHLC data doesn't match with actual data

Here is the actual data, obtained through historical API when invoked at later point of time:

273 2017-08-02 13:15:00 225.55 225.95 225.40 225.80 88304 348929

This is the case for other scripts as well and it causes false signal to be generated..
Tagged:
  • sujith
    Hi @kiran,
    5minute candles are generated using minute candles.
    In the above scenario, 13:15 candle might be giving value from only 4 candles.
    Since it involves DB insert, there is no guarantee for the interval. Also writing these minute candle will be happening simultaneously for all the scrips. Hence you never know, if one insert is delayed by 1 second then all the candles will be delayed by 1 second.

    I would suggest building your own candles based on websocket data.
Sign In or Register to comment.