Scriptable technical analysis with portfolio and strategy backtesting