If there are many people interested in generating candles stick data from web socket ticks, I am willing to share the architecture and code, which instantly generates candle files on completion of the candle time. So it is like instant
I can give a session on the architecture, what tech stack to be deployed and the code
Let us say we are talking about 1 minute candle then less than half a second after the time candle time finishes
Let us say time is HH:MM:SS:mmm, where mmm is milli second
So a 10:15:00:000 candles finishes at 10:16:00:000 and you get the data by like 10:16:00:0100
which is like 100 milli second. And this is pure Python code. This can be brought down to like 1-2ms if a core component is modified and written in C or let us say Rust or Golang
But anyway, who is a billion dollar HFT trader here ? No one, so no point to get into over killing things
I do trade a medium latency code, and the candle formation time is pretty much the same. There is no harm in improving the code even though we are not a billion dollar HFT.
I think there is code in this forum to do this, to create bars from WS data.
Also, why do you want to use your system time to form/create the candle/bar, use the time from the received WS ticks, that way there is no issue even ms levels, as these are timestamps from the exchange itself.
@kiteapi If there is then fine, no need for me to share the code. Also, I never stated time as my system time
@srinidhihebbar This thread is about code that am planning to share. I stated from cost benefit analysis. The discussion is not about improving your code, you are free to do whatever you want to with your code
@Tusar369 even kite takes time to save data to database and make candles so historical data is pretty much useless in live market for medium or low latency strategies , it is faster to do it on your end historical data is just useful for backtesting.
Let us say we are talking about 1 minute candle then less than half a second after the time candle time finishes
Let us say time is HH:MM:SS:mmm, where mmm is milli second
So a 10:15:00:000 candles finishes at 10:16:00:000 and you get the data by like 10:16:00:0100
which is like 100 milli second. And this is pure Python code. This can be brought down to like 1-2ms if a core component is modified and written in C or let us say Rust or Golang
But anyway, who is a billion dollar HFT trader here ? No one, so no point to get into over killing things
Also, why do you want to use your system time to form/create the candle/bar, use the time from the received WS ticks, that way there is no issue even ms levels, as these are timestamps from the exchange itself.
@srinidhihebbar This thread is about code that am planning to share. I stated from cost benefit analysis. The discussion is not about improving your code, you are free to do whatever you want to with your code
https://github.com/tahseenjamal/kite_candles