QUOTE:
there's an implementation logistics problem doing it the other way around
I have a prototype that does runs bar by bar for all symbols. You might be interested in the design. The key is to code the strategy as a class having three methods, Initialize, TradeOneBar, and Finalize. The design makes use of global storage. It runs as a multi-symbol backtest, letting WL sequentially present the symbols in the normal fashion.
1. On the first symbol, it sets up date variables to track the symbol having the most bars and its count, because not all symbols may have the same date range. These are stored to global.
2. For each symbol, it instantiates the strategy class, myclass, and runs myclass.Initialize. "Initialize" contains all the DataSeries development and other initialization typically done ahead of the bar loop. It stores the myclass object in global storage as _
symbol. If the symbol has the most timestamps, it updates the globals from 1.
3. Finally, at the last symbol, the work begins, handled by a custom PosSizer class. This class will hold signals from all symbols.
a. Gets the list of timestamps for the symbol having the most (per global)
b. For each timestamp (bar), for each symbol, retrieves the corresponding myclass from global and if its Bars contain the timestamp, runs its TradeOneBar method. The last active position is passed in so WLP "IsLastPositionActive" is replaced by check for lastPosition being not null. myclass is re-saved to global to keep its variables up-to-date.
c. At each bar, after the last symbol, PosSizer logic adjusts or removes signals per PosSizer rules.
d. After the last timestamp, each myclass is retrieved from global and its "Finalize" method is run
4. The null "Override in script" WLP PosSizer sets things up for the Visualizers, etc.
That's the pattern. There's overhead in casting myclass repeatedly, but the pattern can work for some percentage of strategies.