@venus2005th This is because you are using candle ID 0, on 0 it can cross before it returns then the candle closes, if you use candle ID 1 it will wait for the candle to close but you will be a candle behind in time.
@venus2005th Bucket of trades block saving current value into a variable, condition block checking if value is above/below another variable, if so saving into another variable.