This will cause the intra-day range break out system with these functions to not work normally.
I have tried to do some fixes, it looks correct, but still not sure. Please check it.
We know the bar time on mulitcharts and mt4 is different, one is bar start time and another is bar end time.
Alos, you have the possibility to choose the type of bars also in SQ.
I think our implementation is OK, we include the TimeTo into the range and update the value on next bar.
We use the same algorithm for all platforms.
If you want to use your own implementation, don't forget to modify also the SQ snippet.
Best regards,
Tomas