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.
To help us continually offer you the best experience on ProRealCode, we use cookies. By clicking on "Continue" you are agreeing to our use of them. You can also check our "privacy policy" page for more information.Continue