feature(TrailingSL): only add indicator to custom_info in backtest/hyperopt

This commit is contained in:
Joe Schr
2021-03-04 19:30:51 +01:00
parent f606d90107
commit 909cb64ae1
+2 -1
View File
@@ -63,7 +63,8 @@ class TrailingSL(IStrategy):
def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
dataframe['atr'] = ta.ATR(dataframe)
self.custom_info[metadata['pair']] = dataframe[['date', 'atr']].copy().set_index('date')
if self.dp.runmode.value in ('backtest', 'hyperopt'):
self.custom_info[metadata['pair']] = dataframe[['date', 'atr']].copy().set_index('date')
return dataframe