Hello Community,

I am trying to consolidate 1-minute data into 5-minute bars and then use those to create a rolling window. to calculate swing high. I have read community posts on Consolidation but there is a gap in my understanding. I have implemented the following algo. Please comment if it is the right approach.

Thanks for your support.