Any insight into what is causing this error 10. It happened today for the first time when running my daily MOC backtest and exploration.
The error is related to this bit of code:
bi = BarIndex();
bi = bi – bi[0];
SelBar = SelectedValue(bi);
HV = IIf(bi >= SelBar && bi <= SelBar+5,SelectedValue(BuyLimit),Null);
I have the same code and it works fine. Did you try to use it for a shorter test duration? Test it from 2020 till today and check if it will work.
This error means you are trying to reference some bars that are out of range, maybe no data for it. At least this is my understanding.
I also had that issue come up at one stage, however it was just when running my orders. Was a pain in the arse. I ended up converting to Real Test before I ever got to the bottom of it.