I am using StatVars for storing stops etc for later use in low-level CBT. Naming convention is along the lines of "Text" + Symbol + BarDateTime.
This issue has been driving me crazy for weeks now and I've finally come to the conclusion that the problem seems to be when different afl's are run consecutively, the old variables are hanging around and therefore giving unexpected results in subsequent backtests. The CBT code is in an "Include" file so I need to use generic names for the StatVars. Is there a way of removing all static variables at the end of an afl? Or, another solution? Graham