From 67a9509a2f7f6443052d7f81e8d842205893f6cc Mon Sep 17 00:00:00 2001 From: Matthias Date: Wed, 9 Jun 2021 19:16:39 +0200 Subject: [PATCH] Remove missleading fallback hyperopt methods --- user_data/hyperopts/AverageHyperopt.py | 32 -------------- user_data/hyperopts/MACDStrategy_hyperopt.py | 30 ------------- .../ReinforcedSmoothScalp_hyperopt.py | 42 ------------------- 3 files changed, 104 deletions(-) diff --git a/user_data/hyperopts/AverageHyperopt.py b/user_data/hyperopts/AverageHyperopt.py index 9e1d5fa..d7410fd 100644 --- a/user_data/hyperopts/AverageHyperopt.py +++ b/user_data/hyperopts/AverageHyperopt.py @@ -132,35 +132,3 @@ class AverageHyperopt(IHyperOpt): return [ Categorical(sellTriggerList, name='sell-trigger') ] - - def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: - """ - Based on TA indicators. Should be a copy of from strategy - must align to populate_indicators in this file - Only used when --spaces does not include buy - """ - dataframe.loc[ - ( - qtpylib.crossed_above( - dataframe[f'maShort({shortRangeBegin})'], - dataframe[f'maMedium({mediumRangeBegin})']) - ), - 'buy'] = 1 - - return dataframe - - def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: - """ - Based on TA indicators. Should be a copy of from strategy - must align to populate_indicators in this file - Only used when --spaces does not include sell - """ - dataframe.loc[ - ( - qtpylib.crossed_above( - dataframe[f'maMedium({mediumRangeBegin})'], - dataframe[f'maShort({shortRangeBegin})']) - ), - 'sell'] = 1 - - return dataframe diff --git a/user_data/hyperopts/MACDStrategy_hyperopt.py b/user_data/hyperopts/MACDStrategy_hyperopt.py index 473e9c6..036836f 100644 --- a/user_data/hyperopts/MACDStrategy_hyperopt.py +++ b/user_data/hyperopts/MACDStrategy_hyperopt.py @@ -98,33 +98,3 @@ class MACDStrategy_hyperopt(IHyperOpt): return [ Integer(0, 700, name='sell-cci-value'), ] - - def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: - """ - Based on TA indicators. Should be a copy of from strategy - must align to populate_indicators in this file - Only used when --spaces does not include buy - """ - dataframe.loc[ - ( - (dataframe['macd'] > dataframe['macdsignal']) & - (dataframe['cci'] <= -50.0) - ), - 'buy'] = 1 - - return dataframe - - def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: - """ - Based on TA indicators. Should be a copy of from strategy - must align to populate_indicators in this file - Only used when --spaces does not include sell - """ - dataframe.loc[ - ( - (dataframe['macd'] < dataframe['macdsignal']) & - (dataframe['cci'] >= 100.0) - ), - 'sell'] = 1 - - return dataframe diff --git a/user_data/hyperopts/ReinforcedSmoothScalp_hyperopt.py b/user_data/hyperopts/ReinforcedSmoothScalp_hyperopt.py index fcdffa9..f205d8c 100644 --- a/user_data/hyperopts/ReinforcedSmoothScalp_hyperopt.py +++ b/user_data/hyperopts/ReinforcedSmoothScalp_hyperopt.py @@ -151,45 +151,3 @@ class ReinforcedSmoothScalp(IHyperOpt): # 'sell-macd_cross_signal', # 'sell-sar_reversal'], name='sell-trigger') ] - - def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: - dataframe.loc[ - ( - ( - (dataframe['open'] < dataframe['ema_low']) & - (dataframe['adx'] > 30) & - (dataframe['mfi'] < 30) & - ( - (dataframe['fastk'] < 30) & - (dataframe['fastd'] < 30) & - (qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd'])) - ) & - (dataframe['resample_sma'] < dataframe['close']) - ) - # | - # # try to get some sure things independent of resample - # ((dataframe['rsi'] - dataframe['mfi']) < 10) & - # (dataframe['mfi'] < 30) & - # (dataframe['cci'] < -200) - ), - 'buy'] = 1 - return dataframe - - def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: - dataframe.loc[ - ( - ( - ( - (dataframe['open'] >= dataframe['ema_high']) - - ) | - ( - (qtpylib.crossed_above(dataframe['fastk'], 70)) | - (qtpylib.crossed_above(dataframe['fastd'], 70)) - - ) - ) & (dataframe['cci'] > 100) - ) - , - 'sell'] = 1 - return dataframe