Skip to content
Discussion options

You must be logged in to vote

stats is a pandas.Series. Most entries are ordinary scalar performance metrics, and a few underscore-prefixed entries contain richer objects from the run.

The easiest way to inspect what is available is:

stats = bt.run()
print(stats.index.tolist())
print(stats)

The most useful ones for debugging are usually:

trades = stats['_trades']          # DataFrame: one row per closed trade
equity = stats['_equity_curve']    # DataFrame: equity/drawdown over time
strategy = stats['_strategy']      # the strategy instance used for the run

_trades is usually the first place to look when debugging entries, exits, SL/TP behavior, duration, P/L, etc. _equity_curve is useful when you want to understand dr…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by kernc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants