backtrader#

tradingstrategy.frameworks.backtrader module.

Module description#

Helper methods and classes to integrate Backtrader with Capitalgram based Pandas data.

Classes#

DEXFeed

A Pandas data feed with token metadata added.

DEXStrategy

A strategy base class with support for Trading Strategy DEX specific use cases.

TradeRecorder

Record all trades during the backtest run so that they can be analysed.

Functions#

add_dataframes_as_feeds(cerebro, ...[, plot])

Add Pandas candle data as source feed to Backtrader strategy tester.

analyse_strategy_trades(trades)

Build a trade analyzer from Backtrader executed portfolio.

convert_backtrader_timestamp(bt_time)

Convert traderader internal timestamps to Pandas.

prepare_candles_for_backtrader(candles)

Prepare DataFrame format so that Backtrader strategy can read it.

reindex_pandas_for_backtrader(df, start, ...)

Backtrader does not allow sparse data, but all data must be filled.