I would create a separate tree for the bucket and start with a bucket block, then move the comment above as the picture, buckets can be difficult in MT5:
@Bandito7 I dont know what your whole project is about. From the picture I can see the 2 lines correctly extend until the next candle, and that was your original question. So problem solved.