I write code for backtesting, but I use plenty of static variables within code both StaticVarGet and StaticVarSet
In addition, I use lots of StaticVarGet in a custom backtest as well.
The figure below I show some part of my code with StaticVarGet/StaticVarSet along with user them in CBT.
The big problem is that I can often backtest successfully, but in many times my backtest appears no result despite the same code.
My Workaround has a few ways.
For example I try to change robotname variable as above figure , Backtest is ok again but not every time.
The other way, I try to close program and reopen again and run backtest again. sometime is ok but sometime show no result.
In a strange case, I take a break 10-15 minute from Amibroker , after that I try clicking back test again , I can backtest, the result show absolutely.
However, I notice that If there is no StaticVarGet/StaticVarSet in alf code, I always run backtest correctly every time. this problem doesn't occure certainly.
I suspect that many StaticVarGet/StaticVarSet cause no result in backtest in many times.
What is the cause for this issue??
This problem is hardly driving me crazy because I don't have any solution to deal with it.
Thank you for any help.