Script/Indicator to convert data to standard higher time frames?

 

Is there a script or indicator that converts the current time frame data (can be from M1 do D1) to a higher time frame (H1, H4, D1, W1, MN1) ?

I searched and found existing scripts that either require M1 as current time frame, or convert only to a multiple of the current time frame, which is not desired as stated in my question above.