From 16bbd1f737db22b0d6a74b817dbed9df38f6a92a Mon Sep 17 00:00:00 2001 From: Joe Schr Date: Mon, 22 Mar 2021 11:20:57 +0100 Subject: [PATCH] fix(fixed_riskreward_loss): simplify example stoploss calculations just use classic 2 times ATR as a stoploss --- user_data/strategies/fixed_riskreward_loss.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/user_data/strategies/fixed_riskreward_loss.py b/user_data/strategies/fixed_riskreward_loss.py index b18e230..4e2a29f 100644 --- a/user_data/strategies/fixed_riskreward_loss.py +++ b/user_data/strategies/fixed_riskreward_loss.py @@ -87,9 +87,8 @@ class FixedRiskRewardLoss(IStrategy): return result def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: - dataframe['min'] = dataframe['low'].rolling(48).min() dataframe['atr'] = ta.ATR(dataframe) - dataframe['stoploss_rate'] = dataframe['min']-(dataframe['atr']) + dataframe['stoploss_rate'] = dataframe['close']-(dataframe['atr']*2) self.custom_info[metadata['pair']] = dataframe[['date', 'stoploss_rate']].copy().set_index('date') # all "normal" indicators: @@ -116,6 +115,6 @@ class FixedRiskRewardLoss(IStrategy): :return: DataFrame with buy column """ - # Always sells - dataframe.loc[:, 'sell'] = 1 + # Never sells + dataframe.loc[:, 'sell'] = 0 return dataframe