remove copy() from custom_info example

`set_index` automatically copies if not stated otherwise with `inplace=True`
> inplacebool, default False
If True, modifies the DataFrame in place (do not create a new object).

from: https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.set_index.html?highlight=set_index#pandas.DataFrame.set_index
This commit is contained in:
JoeSchr 2021-04-15 15:21:28 +02:00 committed by GitHub
parent 862df2b431
commit c9c039d640
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,7 +57,7 @@ class AwesomeStrategy(IStrategy):
dataframe['atr'] = ta.ATR(dataframe)
if self.dp.runmode.value in ('backtest', 'hyperopt'):
# 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
```