Merge pull request #4743 from JoeSchr/patch-1

remove `copy()` from `custom_info` example
This commit is contained in:
Matthias
2021-04-15 15:34:50 +02:00
committed by GitHub

View File

@@ -57,7 +57,7 @@ class AwesomeStrategy(IStrategy):
dataframe['atr'] = ta.ATR(dataframe) dataframe['atr'] = ta.ATR(dataframe)
if self.dp.runmode.value in ('backtest', 'hyperopt'): if self.dp.runmode.value in ('backtest', 'hyperopt'):
# add indicator mapped to correct DatetimeIndex to custom_info # add indicator mapped to correct DatetimeIndex to custom_info
self.custom_info[metadata['pair']] = dataframe[['date', 'atr']].copy().set_index('date') self.custom_info[metadata['pair']] = dataframe[['date', 'atr']].set_index('date')
return dataframe return dataframe
``` ```