Calculating 5 min charts for intraday

I am trying to write my own client API to execute orders from my desktop. For that i need some information, can you please let me know best way to implement 5, 15 and 1 hour ema into my graph. Ema calculation formula i know, where i am confusing is -> do i need to store tick by tick data while market runs and compute ema on the fly or is there any api method which gives candle details after candle close for example: say now time is 9:30, just fetch 9:25 to 9:30 candle details from kite api and from 9:30+ minutes calculate 5 ema from tick by tick data like that. for every candle close i want to fetch from api to maintain accuracy in case of connection issues in my server/web socket issues
Sign In or Register to comment.