Open finithejernigan opened 11 months ago
This is partly private API, but so far stable ... I think you can use (untested):
indicators = {ind.name: ind
for ind in stats['_strategy']._indicators}
entry_bars = stats['_trades']['EntryBar']
indicators_df = pd.DataFrame(indicators).iloc[entry_bars]
We might want to include these values in the stats['_trades']
df by default ...
But what about exit_bars
... those values might be relevant for some too. 🤔
Hey I would like to work on this issue as well. I have written this feature on my forked repo for 1D array indicators to be included in the '_trades' dataframe.
Hi,
Great package for backtesting! One question - is it possible to add additional columns to the output of the backtest (such as the indicator values) at the time of the trades? Alternatively, getting the indicator values output for each bar would also be helpful. I could hack it to do it but wondered if there was an easy way.
For example, adding additional columns for each trade with the value of each indicator?
Thanks so much for the great package,