Try dropping the part (minute=15….) for starters. You have already forced the timeframe to M15, no need to check whether minute=n*15. And moreover, all calculations are made for the values at the end of a candle, and the end of the 10:15 candle is 10:30 etc.
We use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it.