To create 5min candle, From websocket ticker I m collecting all the LTPs in a bucket for 5 minutes and then computing/taking the OHLC from that 5minute bucket. Is this right way or do i need to collect LTPs in 1 minute each and then take OHLC from the collection of 5 candles (each of 1 minute)?
Both the ways will give you same result end of the day. You can use any of these methods.