Skip to content

Commit

Permalink
remove copy() from custom_info example
Browse files Browse the repository at this point in the history
`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
  • Loading branch information
JoeSchr authored Apr 15, 2021
1 parent 862df2b commit c9c039d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/strategy-advanced.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```

Expand Down

0 comments on commit c9c039d

Please sign in to comment.