Lazy Backtest IDE Update

Two updates for the Lazy Backtest IDE this week.

First

A new addition to the API let's you reference previous trading history.

E.g.

history.INDEX_GSPC_weight[0]

shows how much we weighted the S&P 500 in the previous period

history.INDEX_GSPC_return[0]

gives us the previous return from the S&P 500, and

history.STRATEGY_return[0]

will result in the overall return in the previous period.

I love the idea of recursion in programming (if only Javascript and Python supported recursion!) but looking backward at previous decision outcomes doesn't have much place in trading (feel free to correct me). Perhaps later I will remove this feature.

Just for fun, here's a Logistic Map strategy.

var w = null;

history.INDEX_GSPC_weight != null ? w = history.INDEX_GSPC_weight[0] : 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.

Utterly pointless.

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.

Second

Sharpe Trajectories!

Still a lot of polish to be applied, but beats having to create them manually.

Next big project - make them embeddable.