Thanks for your reply.
Please add the current bar check I previously advised and make sure that the bar check matches your longest bars ago reference.
if (CurrentBar < 10) return; // prevent code below this line from running until first 10 bars loaded.
Leave a comment: