FRENESDE

Reading the results

After cerebro.run(), cerebro.broker.getvalue() gives the final value. Return = (final value − starting capital) / starting capital.
That figure says nothing about the path taken. The maximum drawdown, the largest fall from a peak, shows the pain you would have had to endure along the way.
Analyzers compute these statistics: cerebro.addanalyzer(bt.analyzers.DrawDown, _name='dd') before run(), then strat.analyzers.dd.get_analysis() afterwards.
Always compare with a benchmark: if the market made +40% and your strategy +15%, buying and holding would have done better over that period.

Examples

Key terms

Return
Gain or loss as a percentage of starting capital
Drawdown
Fall in capital from its last peak
Analyzer
Module that computes statistics on the backtest
Buy and hold
Buying at the start and holding to the end, as a benchmark
Take the mission on Doji Academy

← Back to the index