How to find 15 minutes current candle close from historical data Code:z=kite.historical_data(11350786, "2020-08-01", "2020-08-13","15minute",0) za=pd.DataFrame(z)
@Snehan - I had the same question earlier too. Websockets give tick data and you have to construct the candle at your end. Not sure why the algo traders have to do all the coding themselves for the deficiencies in kiteConnect API. But this is what Zerodha provides. I continue to use historical data api for live market as it gives me the formed bar chart which is what I need.
just subscribed (couple of hours back) to Historical Data and saw this! We pay higher to Zerodha for API and historical data compared to any other brokers in the industry, I still do not understand why there are so many short falls? The API team rather than making an effort to make API's better/improve and fix these short comings, all we see is references and pointers to other threads, where the work around is usually for us to fix with additional code + hefty code processing on our end slowing up entire thing.
After I subscribed to API (couple of weeks back), I started seeing the short comings for the API like short falls/throttling/restrictions etc and now same with historical data
Then what is use of kite.historical_data function?
Historical data APIs as the name says suggest is designed for backtesting/fetching older data, not live candles. Though you can use it for the live candle, expect some delay in last candle formation for the reason stated here. As it's a data-heavy operation, continuous live polling of Historical data APIs can render a few Time-out instances as well. You need to handle those at your end. As for the above-stated reason, we better recommend using Websocket Streaming to form a candle at your end. If you want to go ahead for the live-polling of Historical Data, then you need to keep the factor of the above short-coming.
Thanks @rakeshr. Completely aware that historical api may have timeouts and may not be as fast as websocket streaming but you know our limitations too. I have added exception handling so program does not support in between.I am monitoring historical api timing in elasticsearch and grafana dashboard and I am happy with the performance so far. Thanks for your help as always.
@rakeshr - however I have a request. If the historical api can provide 5 minute candle for a period of 6 months then it will be really great. Currently I am able to query only 15 minute candle if the period is more than 2 months. 15 minute candle will be of no use if we want to back test for intraday algos.
We don't store 5minute candles. We make those candles using minute candles on the fly.
If we increase the number of candles then it may result in more frequent timeouts.
Thanks @sujith. In that case if you have minute candle for longer period (I don't know how long) then can you extend the 5 minute candle query interval for more than 100 days? Understand that historical api performance may slow down but at least it meets the purpose of back testing. Let me know your thoughts.
The historical data API is provided not only for API users but also for all the platforms that use historical data like charting. I am afraid we can't make modifications to the historical data API. You can dump all the data at your end aftermarket hours and use that as the source for your strategies.
Thank you Ganesh, But is dont know how to built RSI for 15 minutes time frame with ticks data..should u get ticks data and store somewhere and built candle? Thanks
hi Snehan, Not sure I understand fully. You can use historical API to query for 15minute candle and store them in pandas dataframe and then calculate the RSI using the function in the github page. This is what I am doing.
just subscribed (couple of hours back) to Historical Data and saw this! We pay higher to Zerodha for API and historical data compared to any other brokers in the industry, I still do not understand why there are so many short falls? The API team rather than making an effort to make API's better/improve and fix these short comings, all we see is references and pointers to other threads, where the work around is usually for us to fix with additional code + hefty code processing on our end slowing up entire thing.
After I subscribed to API (couple of weeks back), I started seeing the short comings for the API like short falls/throttling/restrictions etc and now same with historical data
Pleas let me kow
As for the above-stated reason, we better recommend using Websocket Streaming to form a candle at your end. If you want to go ahead for the live-polling of Historical Data, then you need to keep the factor of the above short-coming.
If we increase the number of candles then it may result in more frequent timeouts.
I am afraid we can't make modifications to the historical data API. You can dump all the data at your end aftermarket hours and use that as the source for your strategies.
Can you please provide Any sample code for how to calculate RSI,Triangular MA,PSAR with tick data on 15 minute cadle
https://github.com/arkochhar/Technical-Indicators/tree/master/indicator
But is dont know how to built RSI for 15 minutes time frame with ticks data..should u get ticks data and store somewhere and built candle?
Thanks