I tried to explain here the problem with the moment when candle closes: https://fxdreema.com/documentation/work ... e%20closes
In short, it's not a good idea to think about "when candle close". When the new candle opens - this is almost the same thing and it's much easier to work like this.