Two updates for the Lazy Backtest IDE this week.
A new addition to the API let's you reference previous trading history.
shows how much we weighted the S&P 500 in the previous period
gives us the previous return from the S&P 500, and
will result in the overall return in the previous period.
Just for fun, here's a Logistic Map strategy.
var w = null;
history.INDEX_GSPC_weight != null ? w = history.INDEX_GSPC_weight : w = 0.511;
weight.INDEX_GSPC = 4 * w * (1 - w);
Logistic Map has an initial weight of 0.511, but change it a little and the ensuing weights will change completely, they evolve in a completely chaotic way over time.
There are some interesting ways to use recursion in finance - but they revolve around backward induction and recursion into the future not the past - I should come up with any interesting strategy focusing on that idea.
Still a lot of polish to be applied, but beats having to create them manually.
Next big project - make them embeddable.