API documentation for tradeexecutor.visual.benchmark.visualise_vs_returns Python function.

visualise_vs_returns(returns, benchmark_indexes, name='Strategy returns multiplier vs. benchmark indices', height=800, skipped_benchmarks=('All cash', ), freq=<MonthBegin>)[source]#

Create a chart that shows the strategy returns direction vs. benchmark.

  • This will tell if the strategy is performing better or worse over time

  • returns (Series) –

    Strategy returns.

    Series.attrs can contain name and colour.

  • benchmark_indexes (DataFrame) –

    Benchmark buy and hold indexes.

    Assume starts with initial_cash like $10,000 and then moves with the price action.

    Each Series.attrs can have keys name and colour.

  • name – Figure title.

  • height – Chart height in pixels.

  • skipped_benchmarks – Benchmark indices we do not need to render.

  • freq (DateOffset) –

    Binning frequency for more readable charts.

    Choose between weekly, monthly, quaterly, yearly binning.

Return type: