create_benchmark_equity_curves#

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

create_benchmark_equity_curves(strategy_universe, pairs, initial_cash, custom_colours={'AAVE': '#F289DA', 'ARB': 'red', 'All cash': 'black', 'BTC': 'orange', 'DOGE': 'darkorange', 'ETH': 'blue', 'MATIC': 'purple', 'MKR': '#1AAB9B', 'PEPE': 'darkmagenta', 'SOL': 'lightblue', 'Strategy': 'green'}, convert_to_daily=False)[source]#

Create data series of different buy-and-hold benchmarks.

  • Create different benchmark indexes to compare y our backtest results against

  • Has default colours set for BTC and ETH pair labels

See also

Example:

from tradeexecutor.analysis.grid_search import visualise_grid_search_equity_curves
from tradeexecutor.visual.benchmark import create_benchmark_equity_curves

# List of pair descriptions we used to look up pair metadata
our_pairs = [
    (ChainId.centralised_exchange, "binance", "BTC", "USDT"),
    (ChainId.centralised_exchange, "binance", "ETH", "USDT"),
]

benchmark_indexes = create_benchmark_equity_curves(
    strategy_universe,
    {"BTC": our_pairs[0], "ETH": our_pairs[1]},
    initial_cash=StrategyParameters.initial_cash,
)

fig = visualise_grid_search_equity_curves(
    grid_search_results,
    benchmark_indexes=benchmark_indexes,
)
fig.show()
Parameters:
Returns:

Pandas DataFrame.

DataFrame has series labelled “BTC”, “ETH”, “All cash”, etc.

DataFrame and its series’ attrs contains colour information for well-known pairs.

Return type:

DataFrame