Strategy analyzers provide an extensible way to attach different calculations to strategy executions.
quantworks.stratanalyzer
quantworks.stratanalyzer.returns
quantworks.stratanalyzer.sharpe
quantworks.stratanalyzer.drawdown
quantworks.stratanalyzer.trades
Save this code as sma_crossover.py:
../samples/sma_crossover.py
and save this code in a different file:
../samples/sample-strategy-analyzer.py
The output should look like this:
../samples/sample-strategy-analyzer.output