I am working on a strategy that scores a set of issues for every bar (or couple bars) then buys or sells accordingly to hold the top ranked issues. I need a way to execute some code once per Backtest run, then use the results each time Execute is called in the WealthScript. I can't use a static class variable as this will persist until the code is recompiled and an instance variable will cause the code to needlessly execute for each symbol.
The following is the code I have so far (it currently unnecessarily executes the common code in IndicesSet every time Execute is called). Is there a better way to do this?
CODE:
Please log in to see this code.