Thanks for your notes.
Please review the help guide documentation linked in post # 14 and try making the modifications yourself first.
You would need to add a CurrentBars check at the top of your OnBarUpdate() logic for the primary series and secondary series the script is using.
For example:
if (CurrentBars[0] < 10 || CurrentBars[1] < 10)
return;
For example:
if (Bars == null)
return;
For example:
if (barsType == null)
return;

Comment