Candle Open price selection based on tickdata

YE3246
[{'instrument_token': 56336903, 'last_price': 3013.0, 'last_trade_time': datetime.datetime(2020, 10, 19, 9, 59, 59), 'timestamp': datetime.datetime(2020, 10, 19, 10, 0, 2)}
{'instrument_token': 56336903, 'last_price': 3015.0, 'last_trade_time': datetime.datetime(2020, 10, 19, 10, 0, 18), 'timestamp': datetime.datetime(2020, 10, 19, 10, 0, 20)}
]
For the above tick data, I want to calculate open price for one-minute candle at 10:00:00
The first trade that happened between 10:00:00 - 10:01:00 is at 10:00:18 -> 'last_price': 3015.0,
However, we received a tick at 10:00:02 due to a change in bid-ask qnty or whatever other reasons, But a transaction didn't happen at that time.

So what the open price for 10:00:00 1minute candle. 3015 or 3013 ?

Thanks in advance.
  • kiteapi
    kiteapi edited October 2020
    3015, for your OHLC consider LTT - last_trade_time, the timestamp is for any changes that occurs in the scrip, like bid/ask/bid/ask qty etc.
Sign In or Register to comment.