Convert tick price to range bars ohlc data using python
Use the tick data and time module to create range bars.
for every 5mins or whatever timeframe get the open of the candle using the first tick data that comes in. Now monitor the high and lows using two variables.
The close will be the last tick that you get in the time frame.
now you have the OHLC for your plot.
I am getting tick price whenever trade is executed. Now i need to convert this tick data to ohlc data using python such that doji's (shadows) will not be missing when ohlc data is plotted. The plot must be similar to zerodha's range bar plot.
Initially, I tought that range bars are similar to renko bars except the doji is created when there is an trend reversal after the given time frame. After looking into zerodha's range bar plot, I have identified that there is an possibility for presence of 2 different trends in the same time frame and there will be multiple doji's created in these trends. Now, I completely stuck to create range bars.
Please help me out.