visualise_single_grid_search_result_benchmark#

API documentation for tradeexecutor.visual.grid_search.visualise_single_grid_search_result_benchmark Python function.

visualise_single_grid_search_result_benchmark(result, strategy_universe, initial_cash=None, name='Picked search result', log_y=False, asset_count=3)[source]#

Draw one equity curve from grid search results.

  • Compare the equity curve againt buy and hold assets from the trading universe

  • Used to plot “the best” equity curve

  • Use find_best_grid_search_results() to find some equity curves.

See also

Example:

from tradeexecutor.analysis.grid_search import find_best_grid_search_results
from tradeexecutor.visual.grid_search import visualise_single_grid_search_result_benchmark

# Show the equity curve of the best grid search performer
best_results = find_best_grid_search_results(grid_search_results)
fig = visualise_single_grid_search_result_benchmark(best_results.cagr[0], strategy_universe)
fig.show()
Parameters:
  • result (GridSearchResult) – Picked grid search result

  • strategy_universe (TradingStrategyUniverse) – Used to get benechmark indexes

  • name – Chart title

  • initial_cash (float | None) –

    Not needed. Automatically filled in by grid search.

    Legacy param.

  • asset_count – Draw this many comparison buy-and-hold curves from well-known assets.

Returns:

Plotly figure

Return type:

Figure