QUOTE:
... could you clarify what's the point in doing this?
This is a really polite way of saying, "Partial DataSeries computations have little practical value in WL simulations."
In order for WL to simulate all trades across the entire data range, values for
all bars (except those before the "start bar") have to be known. Now you can redefine the start bar of the simulation to be somewhere inside the data range. Is this what you're actually wanting to do?
---
For non-simulation--display only--purposes, I have defined a linear regression fit equation, which I solve with MathNet on the last ten bars of a DataSeries: y = beta0 + beta1*(1/x) + beta2*(x). I do that by passing the transformed DataSeries of interest into my own routine that removes the last 10 bar values and places them in a MathNet Vector data type, which is then passed into its regression fitting routine. The fit leads to an extrapolated
price gain for the off-the-chart bar, which is displayed on the chart.
POINT: The problem with this approach is that it's only good for the off-the-chart bar, and not for the WL simulation itself. So it only works for interactive trade evaluation (
single value displayed on chart), not WL trade simulations--major limitation.
I have thought about transforming this implementation into a WL indicator, for employing in WL simulations, but that would mean performing the 10-bar regression fit for every bar in the chart. Not exactly CPU efficient since the regression fit employs "indirect" (iterative approximation) numerical methods. So I'm kind of stuck
not using this all-bars indicator approach for "production" WL simulations, although I could use it for model-optimization research purposes on a few select stocks.