diff --git a/strategies/BigZ06.py b/strategies/BigZ06.py
new file mode 100755
index 0000000..8f424da
--- /dev/null
+++ b/strategies/BigZ06.py
@@ -0,0 +1,566 @@
+import freqtrade.vendor.qtpylib.indicators as qtpylib
+import numpy as np
+import talib.abstract as ta
+from freqtrade.persistence import Trade
+from freqtrade.strategy.interface import IStrategy
+from pandas import DataFrame
+from datetime import datetime, timedelta
+from freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter
+from functools import reduce
+
+
+###########################################################################################################
+## BigZ06 by ilya ##
+## ##
+## https://github.com/i1ya/freqtrade-strategies ##
+## The stratagy most inspired by iterativ (authors of the CombinedBinHAndClucV6) ##
+## ## ##
+###########################################################################################################
+## The main point of this strat is: ##
+## - make drawdown as low as possible ##
+## - buy at dip ##
+## - sell quick as fast as you can (release money for the next buy) ##
+## - soft check if market if rising ##
+## - hard check is market if fallen ##
+## - 14 buy signals ##
+## - stoploss function preventing from big fall ##
+## - no sell signal. Whether ROI or stoploss =) ##
+## ##
+###########################################################################################################
+## GENERAL RECOMMENDATIONS ##
+## ##
+## For optimal performance, suggested to use between 3 and 5 open trades. ##
+## ##
+## As a pairlist you can use VolumePairlist. ##
+## ##
+## Ensure that you don't override any variables in your config.json. Especially ##
+## the timeframe (must be 5m). ##
+## ##
+## sell_profit_only: ##
+## True - risk more (gives you higher profit and higher Drawdown) ##
+## False (default) - risk less (gives you less ~10-15% profit and much lower Drawdown) ##
+## ##
+## BigZ06 using market orders. ##
+## Ensure you're familar with https://www.freqtrade.io/en/stable/configuration/#market-order-pricing ##
+## ##
+###########################################################################################################
+## DONATIONS 2 @iterativ (author of the original strategy) ##
+## ##
+## Absolutely not required. However, will be accepted as a token of appreciation. ##
+## ##
+## BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk ##
+## ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91 ##
+## ##
+###########################################################################################################
+
+
+class BigZ06(IStrategy):
+ INTERFACE_VERSION = 2
+
+ minimal_roi = {
+ "0": 0.028, # I feel lucky!
+ "10": 0.018,
+ "40": 0.005,
+ "180": 0.018, # We're going up?
+ }
+
+
+ stoploss = -0.99 # effectively disabled.
+
+ timeframe = '5m'
+ inf_1h = '1h'
+
+ # Sell signal
+ use_exit_signal = True
+ exit_profit_only = False
+ exit_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.
+ ignore_roi_if_entry_signal = False
+
+ # Trailing stoploss
+ trailing_stop = False
+ trailing_only_offset_is_reached = False
+ trailing_stop_positive = 0.01
+ trailing_stop_positive_offset = 0.025
+
+ # Custom stoploss
+ use_custom_stoploss = True
+
+ # Run "populate_indicators()" only for new candle.
+ process_only_new_candles = True
+
+ # Number of candles the strategy requires before producing valid signals
+ startup_candle_count: int = 200
+
+ # Optional order type mapping.
+ order_types = {
+ 'entry': 'market',
+ 'exit': 'market',
+ 'stoploss': 'market',
+ 'stoploss_on_exchange': False
+ }
+
+
+ buy_params = {
+ #############
+ # Enable/Disable conditions
+ "buy_condition_0_enable": True,
+ "buy_condition_1_enable": True,
+ "buy_condition_2_enable": True,
+ "buy_condition_3_enable": True,
+ "buy_condition_4_enable": True,
+ "buy_condition_5_enable": True,
+ "buy_condition_6_enable": True,
+ "buy_condition_7_enable": True,
+ "buy_condition_8_enable": True,
+ "buy_condition_9_enable": True,
+ "buy_condition_10_enable": True,
+ "buy_condition_11_enable": True,
+ "buy_condition_12_enable": True,
+ "buy_condition_13_enable": True,
+ }
+
+ ############################################################################
+
+ # Buy
+
+ buy_condition_0_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+
+ buy_bb20_close_bblowerband_safe_1 = DecimalParameter(0.7, 1.1, default=0.989, space='buy', optimize=False, load=True)
+ buy_bb20_close_bblowerband_safe_2 = DecimalParameter(0.7, 1.1, default=0.982, space='buy', optimize=False, load=True)
+
+ buy_volume_pump_1 = DecimalParameter(0.1, 0.9, default=0.4, space='buy', decimals=1, optimize=False, load=True)
+ buy_volume_drop_1 = DecimalParameter(1, 10, default=3.8, space='buy', decimals=1, optimize=False, load=True)
+ buy_volume_drop_2 = DecimalParameter(1, 10, default=3, space='buy', decimals=1, optimize=False, load=True)
+ buy_volume_drop_3 = DecimalParameter(1, 10, default=2.7, space='buy', decimals=1, optimize=False, load=True)
+
+ buy_rsi_1h_1 = DecimalParameter(10.0, 40.0, default=16.5, space='buy', decimals=1, optimize=False, load=True)
+ buy_rsi_1h_2 = DecimalParameter(10.0, 40.0, default=15.0, space='buy', decimals=1, optimize=False, load=True)
+ buy_rsi_1h_3 = DecimalParameter(10.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)
+ buy_rsi_1h_4 = DecimalParameter(10.0, 40.0, default=35.0, space='buy', decimals=1, optimize=False, load=True)
+ buy_rsi_1h_5 = DecimalParameter(10.0, 60.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)
+
+ buy_rsi_1 = DecimalParameter(10.0, 40.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)
+ buy_rsi_2 = DecimalParameter(7.0, 40.0, default=10.0, space='buy', decimals=1, optimize=False, load=True)
+ buy_rsi_3 = DecimalParameter(7.0, 40.0, default=14.2, space='buy', decimals=1, optimize=False, load=True)
+
+ buy_macd_1 = DecimalParameter(0.01, 0.09, default=0.02, space='buy', decimals=2, optimize=False, load=True)
+ buy_macd_2 = DecimalParameter(0.01, 0.09, default=0.03, space='buy', decimals=2, optimize=False, load=True)
+
+ def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,
+ rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:
+
+ return True
+
+
+ def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,
+ current_profit: float, **kwargs):
+
+ return False
+
+ dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)
+ last_candle = dataframe.iloc[-1].squeeze()
+ last_candle_2 = dataframe.iloc[-2].squeeze()
+
+ if (last_candle is not None):
+ if (last_candle['high'] > last_candle['bb_upperband']) & (last_candle['volume'] > (last_candle_2['volume'] * 1.5)):
+ return 'sell_signal_1'
+
+ return False
+
+
+ def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,
+ current_rate: float, current_profit: float, **kwargs) -> float:
+ # Manage losing trades and open room for better ones.
+
+ if (current_profit > 0):
+ return 0.99
+ else:
+ trade_time_50 = trade.open_date_utc + timedelta(minutes=50)
+
+ # Trade open more then 60 minutes. For this strategy it's means -> loss
+ # Let's try to minimize the loss
+
+ if (current_time > trade_time_50):
+
+ try:
+ number_of_candle_shift = int((current_time - trade_time_50).total_seconds() / 300)
+ dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)
+ candle = dataframe.iloc[-number_of_candle_shift].squeeze()
+
+ # We are at bottom. Wait...
+ if candle['rsi_1h'] < 40:
+ return 0.99
+
+ # Are we still sinking?
+ if candle['close'] > candle['ema_200']:
+ if current_rate * 1.035 < candle['open']:
+ return 0.01
+
+ if current_rate * 1.025 < candle['open']:
+ return 0.01
+
+ except IndexError as error:
+
+ # Whoops, set stoploss at 10%
+ return 0.1
+
+ return 0.99
+
+ def informative_pairs(self):
+ pairs = self.dp.current_whitelist()
+ informative_pairs = [(pair, '1h') for pair in pairs]
+ return informative_pairs
+
+ def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ assert self.dp, "DataProvider is required for multiple timeframes."
+ # Get the informative pair
+ informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)
+ # EMA
+ informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)
+ informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)
+ # RSI
+ informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)
+
+ bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)
+ informative_1h['bb_lowerband'] = bollinger['lower']
+ informative_1h['bb_middleband'] = bollinger['mid']
+ informative_1h['bb_upperband'] = bollinger['upper']
+
+ return informative_1h
+
+ def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+
+ bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)
+ dataframe['bb_lowerband'] = bollinger['lower']
+ dataframe['bb_middleband'] = bollinger['mid']
+ dataframe['bb_upperband'] = bollinger['upper']
+
+ dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=48).mean()
+
+ # EMA
+ dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)
+
+ dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)
+ dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)
+
+ # MACD
+ dataframe['macd'], dataframe['signal'], dataframe['hist'] = ta.MACD(dataframe['close'], fastperiod=12, slowperiod=26, signalperiod=9)
+
+ # SMA
+ dataframe['sma_5'] = ta.EMA(dataframe, timeperiod=5)
+
+ # RSI
+ dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)
+
+ # Chaikin A/D Oscillator
+ dataframe['mfv'] = MFV(dataframe)
+ dataframe['cmf'] = dataframe['mfv'].rolling(20).sum()/dataframe['volume'].rolling(20).sum()
+
+ return dataframe
+
+
+ def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ # The indicators for the 1h informative timeframe
+ informative_1h = self.informative_1h_indicators(dataframe, metadata)
+ dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)
+
+ # The indicators for the normal (5m) timeframe
+ dataframe = self.normal_tf_indicators(dataframe, metadata)
+
+ return dataframe
+
+ def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+
+ conditions = []
+
+ conditions.append(
+ (
+ self.buy_condition_13_enable.value &
+
+ (dataframe['close'] > dataframe['ema_200_1h']) &
+
+ (dataframe['cmf'] < -0.435) &
+ (dataframe['rsi'] < 22) &
+
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &
+ (dataframe['volume'] > 0)
+ )
+ )
+
+
+ conditions.append(
+ (
+ self.buy_condition_12_enable.value &
+
+ (dataframe['close'] > dataframe['ema_200']) &
+ (dataframe['close'] > dataframe['ema_200_1h']) &
+
+ (dataframe['close'] < dataframe['bb_lowerband'] * 0.993) &
+ (dataframe['low'] < dataframe['bb_lowerband'] * 0.985) &
+ (dataframe['close'].shift() > dataframe['bb_lowerband']) &
+ (dataframe['rsi_1h'] < 72.8) &
+ (dataframe['open'] > dataframe['close']) &
+
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &
+ ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &
+
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_11_enable.value &
+
+ (dataframe['close'] > dataframe['ema_200']) &
+
+ (dataframe['hist'] > 0) &
+ (dataframe['hist'].shift() > 0) &
+ (dataframe['hist'].shift(2) > 0) &
+ (dataframe['hist'].shift(3) > 0) &
+ (dataframe['hist'].shift(5) > 0) &
+
+ (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(5) > dataframe['close']/200) &
+ (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(10) > dataframe['close']/100) &
+ ((dataframe['bb_upperband'] - dataframe['bb_lowerband']) < (dataframe['close']*0.1)) &
+ ((dataframe['open'].shift() - dataframe['close'].shift()) < (dataframe['close'] * 0.018)) &
+ (dataframe['rsi'] > 51) &
+
+ (dataframe['open'] < dataframe['close']) &
+ (dataframe['open'].shift() > dataframe['close'].shift()) &
+
+ (dataframe['close'] > dataframe['bb_middleband']) &
+ (dataframe['close'].shift() < dataframe['bb_middleband'].shift()) &
+ (dataframe['low'].shift(2) > dataframe['bb_middleband'].shift(2)) &
+
+ (dataframe['volume'] > 0) # Make sure Volume is not 0
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_0_enable.value &
+
+ (dataframe['close'] > dataframe['ema_200']) &
+
+ (dataframe['rsi'] < 30) &
+ (dataframe['close'] * 1.024 < dataframe['open'].shift(3)) &
+ (dataframe['rsi_1h'] < 71) &
+
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &
+ (dataframe['volume'] > 0) # Make sure Volume is not 0
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_1_enable.value &
+
+ (dataframe['close'] > dataframe['ema_200']) &
+ (dataframe['close'] > dataframe['ema_200_1h']) &
+
+ (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb20_close_bblowerband_safe_1.value) &
+ (dataframe['rsi_1h'] < 69) &
+ (dataframe['open'] > dataframe['close']) &
+
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &
+ ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &
+
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_2_enable.value &
+
+ (dataframe['close'] > dataframe['ema_200']) &
+
+ (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb20_close_bblowerband_safe_2.value) &
+
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &
+ (dataframe['open'] - dataframe['close'] < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_3_enable.value &
+
+ (dataframe['close'] > dataframe['ema_200_1h']) &
+
+ (dataframe['close'] < dataframe['bb_lowerband']) &
+ (dataframe['rsi'] < self.buy_rsi_3.value) &
+
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_3.value)) &
+
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_4_enable.value &
+
+ (dataframe['rsi_1h'] < self.buy_rsi_1h_1.value) &
+
+ (dataframe['close'] < dataframe['bb_lowerband']) &
+
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_5_enable.value &
+
+ (dataframe['close'] > dataframe['ema_200']) &
+ (dataframe['close'] > dataframe['ema_200_1h']) &
+
+ (dataframe['ema_26'] > dataframe['ema_12']) &
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &
+ ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &
+ (dataframe['close'] < (dataframe['bb_lowerband'])) &
+
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &
+ (dataframe['volume'] > 0) # Make sure Volume is not 0
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_6_enable.value &
+
+ (dataframe['rsi_1h'] < self.buy_rsi_1h_5.value) &
+
+ (dataframe['ema_26'] > dataframe['ema_12']) &
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_2.value)) &
+ ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &
+ (dataframe['close'] < (dataframe['bb_lowerband'])) &
+
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_7_enable.value &
+
+ (dataframe['rsi_1h'] < self.buy_rsi_1h_2.value) &
+
+ (dataframe['ema_26'] > dataframe['ema_12']) &
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &
+ ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &
+
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &
+ (dataframe['volume'] > 0)
+ )
+ )
+
+
+ conditions.append(
+ (
+
+ self.buy_condition_8_enable.value &
+
+ (dataframe['rsi_1h'] < self.buy_rsi_1h_3.value) &
+ (dataframe['rsi'] < self.buy_rsi_1.value) &
+
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &
+
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ conditions.append(
+ (
+
+ self.buy_condition_9_enable.value &
+
+ (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &
+ (dataframe['rsi'] < self.buy_rsi_2.value) &
+
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ conditions.append(
+ (
+
+ self.buy_condition_10_enable.value &
+
+ (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &
+ (dataframe['close_1h'] < dataframe['bb_lowerband_1h']) &
+
+ (dataframe['hist'] > 0) &
+ (dataframe['hist'].shift(2) < 0) &
+ (dataframe['rsi'] < 40.5) &
+ (dataframe['hist'] > dataframe['close'] * 0.0012) &
+ (dataframe['open'] < dataframe['close']) &
+
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ if conditions:
+ dataframe.loc[
+ reduce(lambda x, y: x | y, conditions),
+ 'buy'
+ ] = 1
+
+ return dataframe
+
+ def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ dataframe.loc[
+ (
+ (dataframe['close'] > dataframe['bb_middleband'] * 1.01) & # Don't be gready, sell fast
+ (dataframe['volume'] > 0) # Make sure Volume is not 0
+ )
+ ,
+ 'sell'
+ ] = 0
+ return dataframe
+
+# Chaikin Money Flow Volume
+def MFV(dataframe):
+ df = dataframe.copy()
+ N = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])
+ M = N * df['volume']
+ return M
diff --git a/strategies/BigZ07.py b/strategies/BigZ07.py
new file mode 100755
index 0000000..89e1a88
--- /dev/null
+++ b/strategies/BigZ07.py
@@ -0,0 +1,596 @@
+import freqtrade.vendor.qtpylib.indicators as qtpylib
+import numpy as np
+import talib.abstract as ta
+from freqtrade.persistence import Trade
+from freqtrade.strategy.interface import IStrategy
+from pandas import DataFrame
+from datetime import datetime, timedelta
+from freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter
+from functools import reduce
+
+
+###########################################################################################################
+## BigZ07 by ilya ##
+## ##
+## https://github.com/i1ya/freqtrade-strategies ##
+## The stratagy most inspired by iterativ (authors of the CombinedBinHAndClucV6) ##
+## ## ##
+###########################################################################################################
+## The main point of this strat is: ##
+## - make drawdown as low as possible ##
+## - buy at dip ##
+## - sell quick as fast as you can (release money for the next buy) ##
+## - soft check if market if rising ##
+## - hard check is market if fallen ##
+## - 14 buy signals ##
+## - stoploss function preventing from big fall ##
+## - no sell signal. Whether ROI or stoploss =) ##
+## ##
+###########################################################################################################
+## GENERAL RECOMMENDATIONS ##
+## ##
+## For optimal performance, suggested to use between 3 and 5 open trades. ##
+## ##
+## As a pairlist you can use VolumePairlist. ##
+## ##
+## Ensure that you don't override any variables in your config.json. Especially ##
+## the timeframe (must be 5m). ##
+## ##
+## sell_profit_only: ##
+## True - risk more (gives you higher profit and higher Drawdown) ##
+## False (default) - risk less (gives you less ~10-15% profit and much lower Drawdown) ##
+## ##
+## BigZ06 using market orders. ##
+## Ensure you're familar with https://www.freqtrade.io/en/stable/configuration/#market-order-pricing ##
+## ##
+###########################################################################################################
+## DONATIONS 2 @iterativ (author of the original strategy) ##
+## ##
+## Absolutely not required. However, will be accepted as a token of appreciation. ##
+## ##
+## BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk ##
+## ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91 ##
+## ##
+###########################################################################################################
+
+
+class BigZ07(IStrategy):
+ INTERFACE_VERSION = 2
+
+ minimal_roi = {
+ "0": 0.028, # I feel lucky!
+ "10": 0.018,
+ "40": 0.005,
+ "180": 0.018, # We're going up?
+ }
+
+ stoploss = -0.99 # effectively disabled.
+
+ timeframe = '5m'
+ inf_1h = '1h'
+
+ # Sell signal
+ use_sell_signal = True
+ sell_profit_only = False
+ sell_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.
+ ignore_roi_if_buy_signal = False
+
+ # Trailing stoploss
+ trailing_stop = False
+ trailing_only_offset_is_reached = False
+ trailing_stop_positive = 0.01
+ trailing_stop_positive_offset = 0.025
+
+ # Custom stoploss
+ use_custom_stoploss = True
+
+ # Run "populate_indicators()" only for new candle.
+ process_only_new_candles = True
+
+ # Number of candles the strategy requires before producing valid signals
+ startup_candle_count: int = 200
+
+ # Optional order type mapping.
+ order_types = {
+ 'buy': 'market',
+ 'sell': 'market',
+ 'stoploss': 'market',
+ 'stoploss_on_exchange': False
+ }
+
+ buy_params = {
+ #############
+ # Enable/Disable conditions
+ "buy_condition_0_enable": True,
+ "buy_condition_1_enable": True,
+ "buy_condition_2_enable": True,
+ "buy_condition_3_enable": True,
+ "buy_condition_4_enable": True,
+ "buy_condition_5_enable": True,
+ "buy_condition_6_enable": True,
+ "buy_condition_7_enable": True,
+ "buy_condition_8_enable": True,
+ "buy_condition_9_enable": True,
+ "buy_condition_10_enable": True,
+ "buy_condition_11_enable": True,
+ "buy_condition_12_enable": True,
+ "buy_condition_13_enable": True,
+ }
+
+ ############################################################################
+
+ # Buy
+
+ buy_condition_0_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+
+ buy_bb20_close_bblowerband_safe_1 = DecimalParameter(0.7, 1.1, default=0.989, space='buy', optimize=False,
+ load=True)
+ buy_bb20_close_bblowerband_safe_2 = DecimalParameter(0.7, 1.1, default=0.982, space='buy', optimize=False,
+ load=True)
+
+ buy_volume_pump_1 = DecimalParameter(0.1, 0.9, default=0.4, space='buy', decimals=1, optimize=False, load=True)
+ buy_volume_drop_1 = DecimalParameter(1, 10, default=3.8, space='buy', decimals=1, optimize=False, load=True)
+ buy_volume_drop_2 = DecimalParameter(1, 10, default=3, space='buy', decimals=1, optimize=False, load=True)
+ buy_volume_drop_3 = DecimalParameter(1, 10, default=2.7, space='buy', decimals=1, optimize=False, load=True)
+
+ buy_rsi_1h_1 = DecimalParameter(10.0, 40.0, default=16.5, space='buy', decimals=1, optimize=False, load=True)
+ buy_rsi_1h_2 = DecimalParameter(10.0, 40.0, default=15.0, space='buy', decimals=1, optimize=False, load=True)
+ buy_rsi_1h_3 = DecimalParameter(10.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)
+ buy_rsi_1h_4 = DecimalParameter(10.0, 40.0, default=35.0, space='buy', decimals=1, optimize=False, load=True)
+ buy_rsi_1h_5 = DecimalParameter(10.0, 60.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)
+
+ buy_rsi_1 = DecimalParameter(10.0, 40.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)
+ buy_rsi_2 = DecimalParameter(7.0, 40.0, default=10.0, space='buy', decimals=1, optimize=False, load=True)
+ buy_rsi_3 = DecimalParameter(7.0, 40.0, default=14.2, space='buy', decimals=1, optimize=False, load=True)
+
+ buy_macd_1 = DecimalParameter(0.01, 0.09, default=0.02, space='buy', decimals=2, optimize=False, load=True)
+ buy_macd_2 = DecimalParameter(0.01, 0.09, default=0.03, space='buy', decimals=2, optimize=False, load=True)
+
+ def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,
+ rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:
+
+ return True
+
+ dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)
+ last_candle = dataframe.iloc[-1].squeeze()
+ last_candle_1 = dataframe.iloc[-2].squeeze()
+
+ if (sell_reason == 'roi'):
+ # Looks like we can get a little have more
+ if (last_candle['cmf'] < -0.1) & (last_candle['close'] > last_candle['ema_200_1h']):
+ return False
+
+ return True
+
+ def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,
+ current_profit: float, **kwargs):
+
+ return False
+
+ dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)
+ last_candle = dataframe.iloc[-1].squeeze()
+ last_candle_2 = dataframe.iloc[-2].squeeze()
+
+ if (last_candle is not None):
+ if (last_candle['high'] > last_candle['bb_upperband']) & (
+ last_candle['volume'] > (last_candle_2['volume'] * 1.5)):
+ return 'sell_signal_1'
+
+ return False
+
+ def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,
+ current_rate: float, current_profit: float, **kwargs) -> float:
+ # Manage losing trades and open room for better ones.
+
+ if (current_profit > 0):
+ return 0.99
+ else:
+ trade_time_50 = trade.open_date_utc + timedelta(minutes=50)
+
+ # Trade open more then 60 minutes. For this strategy it's means -> loss
+ # Let's try to minimize the loss
+
+ if (current_time > trade_time_50):
+
+ try:
+ number_of_candle_shift = int((current_time - trade_time_50).total_seconds() / 300)
+ dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)
+ candle = dataframe.iloc[-number_of_candle_shift].squeeze()
+
+ # We are at bottom. Wait...
+ if candle['rsi_1h'] < 40:
+ return 0.99
+
+ if candle['open_1h'] > candle['ema_200_1h']:
+ return 0.1
+
+ # Are we still sinking?
+ if current_rate * 1.025 < candle['open']:
+ return 0.01
+
+ except IndexError as error:
+
+ # Whoops, set stoploss at 10%
+ return 0.1
+
+ return 0.99
+
+ def informative_pairs(self):
+ pairs = self.dp.current_whitelist()
+ informative_pairs = [(pair, '1h') for pair in pairs]
+ return informative_pairs
+
+ def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ assert self.dp, "DataProvider is required for multiple timeframes."
+ # Get the informative pair
+ informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)
+ # EMA
+ informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)
+ informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)
+ # RSI
+ informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)
+
+ bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)
+ informative_1h['bb_lowerband'] = bollinger['lower']
+ informative_1h['bb_middleband'] = bollinger['mid']
+ informative_1h['bb_upperband'] = bollinger['upper']
+
+ return informative_1h
+
+ def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+
+ bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)
+ dataframe['bb_lowerband'] = bollinger['lower']
+ dataframe['bb_middleband'] = bollinger['mid']
+ dataframe['bb_upperband'] = bollinger['upper']
+
+ dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=48).mean()
+
+ # EMA
+ dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)
+
+ dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)
+ dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)
+
+ # MACD
+ dataframe['macd'], dataframe['signal'], dataframe['hist'] = ta.MACD(dataframe['close'], fastperiod=12,
+ slowperiod=26, signalperiod=9)
+
+ # RSI
+ dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)
+
+ # Chaikin A/D Oscillator
+ dataframe['mfv'] = MFV(dataframe)
+ dataframe['cmf'] = dataframe['mfv'].rolling(20).sum() / dataframe['volume'].rolling(20).sum()
+
+ return dataframe
+
+ def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ # The indicators for the 1h informative timeframe
+ informative_1h = self.informative_1h_indicators(dataframe, metadata)
+ dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)
+
+ # The indicators for the normal (5m) timeframe
+ dataframe = self.normal_tf_indicators(dataframe, metadata)
+
+ return dataframe
+
+ def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+
+ conditions = []
+
+ conditions.append(
+ (
+ self.buy_condition_13_enable.value &
+
+ (dataframe['close'] > dataframe['ema_200_1h']) &
+
+ (dataframe['cmf'] < -0.435) &
+ (dataframe['rsi'] < 22) &
+
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(
+ 48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(
+ 48)) &
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_12_enable.value &
+
+ (dataframe['close'] > dataframe['ema_200']) &
+ (dataframe['close'] > dataframe['ema_200_1h']) &
+
+ (dataframe['close'] < dataframe['bb_lowerband'] * 0.993) &
+ (dataframe['low'] < dataframe['bb_lowerband'] * 0.985) &
+ (dataframe['close'].shift() > dataframe['bb_lowerband']) &
+ (dataframe['rsi_1h'] < 72.8) &
+ (dataframe['open'] > dataframe['close']) &
+
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(
+ 48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(
+ 48)) &
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &
+ ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe[
+ 'bb_lowerband'].shift(2)) &
+
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_11_enable.value &
+
+ (dataframe['close'] > dataframe['ema_200']) &
+
+ (dataframe['hist'] > 0) &
+ (dataframe['hist'].shift() > 0) &
+ (dataframe['hist'].shift(2) > 0) &
+ (dataframe['hist'].shift(3) > 0) &
+ (dataframe['hist'].shift(5) > 0) &
+
+ (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(5) > dataframe['close'] / 200) &
+ (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(10) > dataframe['close'] / 100) &
+ ((dataframe['bb_upperband'] - dataframe['bb_lowerband']) < (dataframe['close'] * 0.1)) &
+ ((dataframe['open'].shift() - dataframe['close'].shift()) < (dataframe['close'] * 0.018)) &
+ (dataframe['rsi'] > 51) &
+
+ (dataframe['open'] < dataframe['close']) &
+ (dataframe['open'].shift() > dataframe['close'].shift()) &
+
+ (dataframe['close'] > dataframe['bb_middleband']) &
+ (dataframe['close'].shift() < dataframe['bb_middleband'].shift()) &
+ (dataframe['low'].shift(2) > dataframe['bb_middleband'].shift(2)) &
+
+ (dataframe['volume'] > 0) # Make sure Volume is not 0
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_0_enable.value &
+
+ (dataframe['close'] > dataframe['ema_200']) &
+
+ (dataframe['rsi'] < 30) &
+ (dataframe['close'] * 1.024 < dataframe['open'].shift(3)) &
+ (dataframe['rsi_1h'] < 71) &
+
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(
+ 48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(
+ 48)) &
+ (dataframe['volume'] > 0) # Make sure Volume is not 0
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_1_enable.value &
+
+ (dataframe['close'] > dataframe['ema_200']) &
+ (dataframe['close'] > dataframe['ema_200_1h']) &
+
+ (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb20_close_bblowerband_safe_1.value) &
+ (dataframe['rsi_1h'] < 69) &
+ (dataframe['open'] > dataframe['close']) &
+
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(
+ 48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(
+ 48)) &
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &
+ ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe[
+ 'bb_lowerband'].shift(2)) &
+
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_2_enable.value &
+
+ (dataframe['close'] > dataframe['ema_200']) &
+
+ (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb20_close_bblowerband_safe_2.value) &
+
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(
+ 48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(
+ 48)) &
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &
+ (dataframe['open'] - dataframe['close'] < dataframe['bb_upperband'].shift(2) - dataframe[
+ 'bb_lowerband'].shift(2)) &
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_3_enable.value &
+
+ (dataframe['close'] > dataframe['ema_200_1h']) &
+
+ (dataframe['close'] < dataframe['bb_lowerband']) &
+ (dataframe['rsi'] < self.buy_rsi_3.value) &
+
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(
+ 48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(
+ 48)) &
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_3.value)) &
+
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_4_enable.value &
+
+ (dataframe['rsi_1h'] < self.buy_rsi_1h_1.value) &
+
+ (dataframe['close'] < dataframe['bb_lowerband']) &
+
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(
+ 48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(
+ 48)) &
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_5_enable.value &
+
+ (dataframe['close'] > dataframe['ema_200']) &
+ (dataframe['close'] > dataframe['ema_200_1h']) &
+
+ (dataframe['ema_26'] > dataframe['ema_12']) &
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &
+ ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &
+ (dataframe['close'] < (dataframe['bb_lowerband'])) &
+
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(
+ 48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(
+ 48)) &
+ (dataframe['volume'] > 0) # Make sure Volume is not 0
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_6_enable.value &
+
+ (dataframe['rsi_1h'] < self.buy_rsi_1h_5.value) &
+
+ (dataframe['ema_26'] > dataframe['ema_12']) &
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_2.value)) &
+ ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &
+ (dataframe['close'] < (dataframe['bb_lowerband'])) &
+
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(
+ 48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(
+ 48)) &
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_7_enable.value &
+
+ (dataframe['rsi_1h'] < self.buy_rsi_1h_2.value) &
+
+ (dataframe['ema_26'] > dataframe['ema_12']) &
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &
+ ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100)) &
+
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(
+ 48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(
+ 48)) &
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ conditions.append(
+ (
+
+ self.buy_condition_8_enable.value &
+
+ (dataframe['rsi_1h'] < self.buy_rsi_1h_3.value) &
+ (dataframe['rsi'] < self.buy_rsi_1.value) &
+
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &
+
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ conditions.append(
+ (
+
+ self.buy_condition_9_enable.value &
+
+ (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &
+ (dataframe['rsi'] < self.buy_rsi_2.value) &
+
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(
+ 48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(
+ 48)) &
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ conditions.append(
+ (
+
+ self.buy_condition_10_enable.value &
+
+ (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &
+ (dataframe['close_1h'] < dataframe['bb_lowerband_1h']) &
+
+ (dataframe['hist'] > 0) &
+ (dataframe['hist'].shift(2) < 0) &
+ (dataframe['rsi'] < 40.5) &
+ (dataframe['hist'] > dataframe['close'] * 0.0012) &
+ (dataframe['open'] < dataframe['close']) &
+
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ if conditions:
+ dataframe.loc[
+ reduce(lambda x, y: x | y, conditions),
+ 'buy'
+ ] = 1
+
+ return dataframe
+
+ def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ dataframe.loc[
+ (
+ (dataframe['close'] > dataframe['bb_middleband'] * 1.01) & # Don't be gready, sell fast
+ (dataframe['volume'] > 0) # Make sure Volume is not 0
+ )
+ ,
+ 'sell'
+ ] = 0
+ return dataframe
+
+
+# Chaikin Money Flow Volume
+def MFV(dataframe):
+ df = dataframe.copy()
+ N = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])
+ M = N * df['volume']
+ return M
\ No newline at end of file
diff --git a/strategies/E0V1E.py b/strategies/E0V1E.py
new file mode 100755
index 0000000..31be805
--- /dev/null
+++ b/strategies/E0V1E.py
@@ -0,0 +1,2617 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ freqtrade_strs/E0V1E.py at main · ssssi/freqtrade_strs · GitHub
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Permalink
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
+
+
+
+
+
+
+
+
+
Go to file
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1
+
+ contributor
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
+ Learn more about bidirectional Unicode characters
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ from datetime import datetime , timedelta
+
+
+
+ from typing import Optional , Union
+
+
+
+ import freqtrade .vendor .qtpylib .indicators as qtpylib
+
+
+
+ import talib .abstract as ta
+
+
+
+ import pandas_ta as pta
+
+
+
+ from freqtrade .persistence import Trade
+
+
+
+ from freqtrade .strategy .interface import IStrategy
+
+
+
+ from pandas import DataFrame
+
+
+
+ from freqtrade .strategy import DecimalParameter , IntParameter
+
+
+
+ from functools import reduce
+
+
+
+
+
+
+
+
+
+
+
+
+
+ def ewo (dataframe , ema_length = 5 , ema2_length = 35 ):
+
+
+
+ df = dataframe .copy ()
+
+
+
+ ema1 = ta .EMA (df , timeperiod = ema_length )
+
+
+
+ ema2 = ta .EMA (df , timeperiod = ema2_length )
+
+
+
+ emadif = (ema1 - ema2 ) / df ['low' ] * 100
+
+
+
+ return emadif
+
+
+
+
+
+
+
+
+
+
+
+
+
+ class E0V1E (IStrategy ):
+
+
+
+ minimal_roi = {
+
+
+
+ "0" : 10
+
+
+
+ }
+
+
+
+
+
+
+
+
+ # Optimal timeframe for the strategy
+
+
+
+ timeframe = '5m'
+
+
+
+
+
+
+
+
+ # Run "populate_indicators()" only for new candle.
+
+
+
+ process_only_new_candles = True
+
+
+
+ startup_candle_count = 20
+
+
+
+
+
+
+
+
+ order_types = {
+
+
+
+ 'entry' : 'market' ,
+
+
+
+ 'exit' : 'market' ,
+
+
+
+ 'emergency_exit' : 'market' ,
+
+
+
+ 'force_entry' : 'market' ,
+
+
+
+ 'force_exit' : "market" ,
+
+
+
+ 'stoploss' : 'market' ,
+
+
+
+ 'stoploss_on_exchange' : False ,
+
+
+
+
+
+
+
+
+ 'stoploss_on_exchange_interval' : 60 ,
+
+
+
+ 'stoploss_on_exchange_market_ratio' : 0.99
+
+
+
+ }
+
+
+
+
+
+
+
+
+ # Disabled
+
+
+
+ stoploss = - 0.99
+
+
+
+
+
+
+
+
+ # Custom stoploss
+
+
+
+ use_custom_stoploss = True
+
+
+
+
+
+
+
+
+ is_optimize_ewo = True
+
+
+
+ buy_rsi_fast = IntParameter (35 , 50 , default = 45 , space = 'buy' , optimize = is_optimize_ewo )
+
+
+
+ buy_rsi = IntParameter (15 , 35 , default = 35 , space = 'buy' , optimize = is_optimize_ewo )
+
+
+
+ buy_ewo = DecimalParameter (- 6.0 , 5 , default = - 5.585 , space = 'buy' , optimize = is_optimize_ewo )
+
+
+
+ buy_ema_low = DecimalParameter (0.9 , 0.99 , default = 0.942 , space = 'buy' , optimize = is_optimize_ewo )
+
+
+
+ buy_ema_high = DecimalParameter (0.95 , 1.2 , default = 1.084 , space = 'buy' , optimize = is_optimize_ewo )
+
+
+
+
+
+
+
+
+ is_optimize_32 = True
+
+
+
+ buy_rsi_fast_32 = IntParameter (20 , 70 , default = 46 , space = 'buy' , optimize = is_optimize_32 )
+
+
+
+ buy_rsi_32 = IntParameter (15 , 50 , default = 19 , space = 'buy' , optimize = is_optimize_32 )
+
+
+
+ buy_sma15_32 = DecimalParameter (0.900 , 1 , default = 0.942 , decimals = 3 , space = 'buy' , optimize = is_optimize_32 )
+
+
+
+ buy_cti_32 = DecimalParameter (- 1 , 0 , default = - 0.86 , decimals = 2 , space = 'buy' , optimize = is_optimize_32 )
+
+
+
+
+
+
+
+
+ is_optimize_deadfish = True
+
+
+
+ sell_deadfish_bb_width = DecimalParameter (0.03 , 0.75 , default = 0.05 , space = 'sell' , optimize = is_optimize_deadfish )
+
+
+
+ sell_deadfish_profit = DecimalParameter (- 0.15 , - 0.05 , default = - 0.05 , space = 'sell' , optimize = is_optimize_deadfish )
+
+
+
+ sell_deadfish_bb_factor = DecimalParameter (0.90 , 1.20 , default = 1.0 , space = 'sell' , optimize = is_optimize_deadfish )
+
+
+
+ sell_deadfish_volume_factor = DecimalParameter (1 , 2.5 , default = 1.0 , space = 'sell' , optimize = is_optimize_deadfish )
+
+
+
+
+
+
+
+
+ sell_fastx = IntParameter (50 , 100 , default = 75 , space = 'sell' , optimize = True )
+
+
+
+ delay_time = IntParameter (90 , 1440 , default = 300 , space = 'sell' , optimize = True )
+
+
+
+ fask_trailing = DecimalParameter (0.001 , 0.02 , default = 0.001 , space = 'sell' , optimize = True )
+
+
+
+
+
+
+
+
+ def populate_indicators (self , dataframe : DataFrame , metadata : dict ) -> DataFrame :
+
+
+
+
+
+
+
+
+ # buy_1 indicators
+
+
+
+ dataframe ['sma_15' ] = ta .SMA (dataframe , timeperiod = 15 )
+
+
+
+ dataframe ['cti' ] = pta .cti (dataframe ["close" ], length = 20 )
+
+
+
+ dataframe ['rsi' ] = ta .RSI (dataframe , timeperiod = 14 )
+
+
+
+ dataframe ['rsi_fast' ] = ta .RSI (dataframe , timeperiod = 4 )
+
+
+
+ dataframe ['rsi_slow' ] = ta .RSI (dataframe , timeperiod = 20 )
+
+
+
+
+
+
+
+
+ # ewo indicators
+
+
+
+ dataframe ['ema_8' ] = ta .EMA (dataframe , timeperiod = 8 )
+
+
+
+ dataframe ['ema_16' ] = ta .EMA (dataframe , timeperiod = 16 )
+
+
+
+ dataframe ['EWO' ] = ewo (dataframe , 50 , 200 )
+
+
+
+
+
+
+
+
+ # profit sell indicators
+
+
+
+ stoch_fast = ta .STOCHF (dataframe , 5 , 3 , 0 , 3 , 0 )
+
+
+
+ dataframe ['fastd' ] = stoch_fast ['fastd' ]
+
+
+
+ dataframe ['fastk' ] = stoch_fast ['fastk' ]
+
+
+
+
+
+
+
+
+ # loss sell indicators
+
+
+
+ bollinger2 = qtpylib .bollinger_bands (qtpylib .typical_price (dataframe ), window = 20 , stds = 2 )
+
+
+
+ dataframe ['bb_lowerband2' ] = bollinger2 ['lower' ]
+
+
+
+ dataframe ['bb_middleband2' ] = bollinger2 ['mid' ]
+
+
+
+ dataframe ['bb_upperband2' ] = bollinger2 ['upper' ]
+
+
+
+
+
+
+
+
+ dataframe ['bb_width' ] = (
+
+
+
+ (dataframe ['bb_upperband2' ] - dataframe ['bb_lowerband2' ]) / dataframe ['bb_middleband2' ])
+
+
+
+
+
+
+
+
+ dataframe ['volume_mean_12' ] = dataframe ['volume' ].rolling (12 ).mean ().shift (1 )
+
+
+
+ dataframe ['volume_mean_24' ] = dataframe ['volume' ].rolling (24 ).mean ().shift (1 )
+
+
+
+
+
+
+
+
+ return dataframe
+
+
+
+
+
+
+
+
+ def populate_entry_trend (self , dataframe : DataFrame , metadata : dict ) -> DataFrame :
+
+
+
+
+
+
+
+
+ conditions = []
+
+
+
+ dataframe .loc [:, 'enter_tag' ] = ''
+
+
+
+
+
+
+
+
+ is_ewo = (
+
+
+
+ (dataframe ['rsi_fast' ] < self .buy_rsi_fast .value ) &
+
+
+
+ (dataframe ['close' ] < dataframe ['ema_8' ] * self .buy_ema_low .value ) &
+
+
+
+ (dataframe ['EWO' ] > self .buy_ewo .value ) &
+
+
+
+ (dataframe ['close' ] < dataframe ['ema_16' ] * self .buy_ema_high .value ) &
+
+
+
+ (dataframe ['rsi' ] < self .buy_rsi .value )
+
+
+
+ )
+
+
+
+
+
+
+
+
+ buy_1 = (
+
+
+
+ (dataframe ['rsi_slow' ] < dataframe ['rsi_slow' ].shift (1 )) &
+
+
+
+ (dataframe ['rsi_fast' ] < self .buy_rsi_fast_32 .value ) &
+
+
+
+ (dataframe ['rsi' ] > self .buy_rsi_32 .value ) &
+
+
+
+ (dataframe ['close' ] < dataframe ['sma_15' ] * self .buy_sma15_32 .value ) &
+
+
+
+ (dataframe ['cti' ] < self .buy_cti_32 .value )
+
+
+
+ )
+
+
+
+
+
+
+
+
+ conditions .append (is_ewo )
+
+
+
+ dataframe .loc [is_ewo , 'enter_tag' ] += 'ewo'
+
+
+
+
+
+
+
+
+ conditions .append (buy_1 )
+
+
+
+ dataframe .loc [buy_1 , 'enter_tag' ] += 'buy_1'
+
+
+
+
+
+
+
+
+ if conditions :
+
+
+
+ dataframe .loc [
+
+
+
+ reduce (lambda x , y : x | y , conditions ),
+
+
+
+ 'enter_long' ] = 1
+
+
+
+
+
+
+
+
+ return dataframe
+
+
+
+
+
+
+
+
+ def custom_stoploss (self , pair : str , trade : Trade , current_time : datetime , current_rate : float ,
+
+
+
+ current_profit : float , ** kwargs ) -> float :
+
+
+
+
+
+
+
+
+ dataframe , _ = self .dp .get_analyzed_dataframe (pair , self .timeframe )
+
+
+
+ current_candle = dataframe .iloc [- 1 ].squeeze ()
+
+
+
+
+
+
+
+
+ if current_time - timedelta (minutes = int (self .delay_time .value )) > trade .open_date_utc :
+
+
+
+ if current_profit >= - 0.01 :
+
+
+
+ return - 0.003
+
+
+
+
+
+
+
+
+ if current_time - timedelta (minutes = int (self .delay_time .value ) * 2 ) > trade .open_date_utc :
+
+
+
+ if current_profit >= - 0.02 :
+
+
+
+ return - 0.006
+
+
+
+
+
+
+
+
+ # if hold > 1 day.sell in stoploss -0.05
+
+
+
+ if current_time - timedelta (days = 1 ) > trade .open_date_utc :
+
+
+
+ if current_profit >= - 0.05 :
+
+
+
+ return - 0.001
+
+
+
+
+
+
+
+
+ enter_tag = ''
+
+
+
+ if hasattr (trade , 'enter_tag' ) and trade .enter_tag is not None :
+
+
+
+ enter_tag = trade .enter_tag
+
+
+
+ enter_tags = enter_tag .split ()
+
+
+
+
+
+
+
+
+ if "ewo" in enter_tags :
+
+
+
+ if current_profit >= 0.05 :
+
+
+
+ return - 0.015
+
+
+
+
+
+
+
+
+ if current_profit > 0 :
+
+
+
+ if current_candle ["fastk" ] > self .sell_fastx .value :
+
+
+
+ return self .fask_trailing .value
+
+
+
+
+
+
+
+
+ return self .stoploss
+
+
+
+
+
+
+
+
+ def custom_exit (self , pair : str , trade : Trade , current_time : datetime , current_rate : float ,
+
+
+
+ current_profit : float , ** kwargs ) -> Optional [Union [str , bool ]]:
+
+
+
+
+
+
+
+
+ dataframe , _ = self .dp .get_analyzed_dataframe (pair , self .timeframe )
+
+
+
+ current_candle = dataframe .iloc [- 1 ].squeeze ()
+
+
+
+
+
+
+
+
+ # stoploss - deadfish
+
+
+
+ if ((current_profit < self .sell_deadfish_profit .value )
+
+
+
+ and (current_candle ['bb_width' ] < self .sell_deadfish_bb_width .value )
+
+
+
+ and (current_candle ['close' ] > current_candle ['bb_middleband2' ] * self .sell_deadfish_bb_factor .value )
+
+
+
+ and (current_candle ['volume_mean_12' ] < current_candle [
+
+
+
+ 'volume_mean_24' ] * self .sell_deadfish_volume_factor .value )):
+
+
+
+ return "sell_stoploss_deadfish"
+
+
+
+
+
+
+
+
+ def populate_exit_trend (self , dataframe : DataFrame , metadata : dict ) -> DataFrame :
+
+
+
+
+
+
+
+
+ dataframe .loc [(), ['exit_long' , 'exit_tag' ]] = (0 , 'long_out' )
+
+
+
+
+
+
+
+
+ return dataframe
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ You can’t perform that action at this time.
+
+
+
+
+
+
+
You signed in with another tab or window. Reload to refresh your session.
+
You signed out in another tab or window. Reload to refresh your session.
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/strategies/NostalgiaForInfinityX.py b/strategies/NostalgiaForInfinityX.py
new file mode 100755
index 0000000..13efdd5
--- /dev/null
+++ b/strategies/NostalgiaForInfinityX.py
@@ -0,0 +1,23206 @@
+import copy
+import logging
+import pathlib
+import rapidjson
+import freqtrade.vendor.qtpylib.indicators as qtpylib
+import numpy as np
+import talib.abstract as ta
+import pandas as pd
+from freqtrade.strategy.interface import IStrategy
+from freqtrade.strategy import merge_informative_pair, timeframe_to_minutes
+from freqtrade.exchange import timeframe_to_prev_date
+from pandas import DataFrame, Series, concat
+from functools import reduce
+import math
+from typing import Dict, Optional
+from freqtrade.persistence import Trade, LocalTrade
+from datetime import datetime, timedelta
+from technical.util import resample_to_interval, resampled_merge
+from technical.indicators import RMI, zema, VIDYA, ichimoku
+import time
+import warnings
+import re
+
+log = logging.getLogger(__name__)
+leverage_pattern = ".*(_PREMIUM|BEAR|BULL|DOWN|HALF|HEDGE|UP|[1235][SL]|-PERP|BVOL|IBVOL)/.*"
+leverage_pattern_long = ".*(BULL|UP|[1235]L)/.*"
+#log.setLevel(logging.DEBUG)
+warnings.simplefilter(action='ignore', category=pd.errors.PerformanceWarning)
+
+
+try:
+ import pandas_ta as pta
+except ImportError:
+ log.error(
+ "IMPORTANT - please install the pandas_ta python module which is needed for this strategy. "
+ "If you're running Docker, add RUN pip install pandas_ta to your Dockerfile, otherwise run: "
+ "pip install pandas_ta"
+ )
+else:
+ log.info("pandas_ta successfully imported")
+
+
+#############################################################################################################
+## NostalgiaForInfinityX by iterativ ##
+## https://github.com/iterativv/NostalgiaForInfinity ##
+## ##
+## Strategy for Freqtrade https://github.com/freqtrade/freqtrade ##
+## ##
+#############################################################################################################
+## GENERAL RECOMMENDATIONS ##
+## ##
+## For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake. ##
+## A pairlist with 40 to 80 pairs. Volume pairlist works well. ##
+## Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs. ##
+## Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc). ##
+## Ensure that you don't override any variables in you config.json. Especially ##
+## the timeframe (must be 5m). ##
+## use_exit_signal must set to true (or not set at all). ##
+## exit_profit_only must set to false (or not set at all). ##
+## ignore_roi_if_entry_signal must set to true (or not set at all). ##
+## ##
+#############################################################################################################
+## HOLD SUPPORT ##
+## ##
+## -------- SPECIFIC TRADES ------------------------------------------------------------------------------ ##
+## In case you want to have SOME of the trades to only be sold when on profit, add a file named ##
+## "nfi-hold-trades.json" in the user_data directory ##
+## ##
+## The contents should be similar to: ##
+## ##
+## {"trade_ids": [1, 3, 7], "profit_ratio": 0.005} ##
+## ##
+## Or, for individual profit ratios(Notice the trade ID's as strings: ##
+## ##
+## {"trade_ids": {"1": 0.001, "3": -0.005, "7": 0.05}} ##
+## ##
+## NOTE: ##
+## * `trade_ids` is a list of integers, the trade ID's, which you can get from the logs or from the ##
+## output of the telegram status command. ##
+## * Regardless of the defined profit ratio(s), the strategy MUST still produce a SELL signal for the ##
+## HOLD support logic to run ##
+## * This feature can be completely disabled with the holdSupportEnabled class attribute ##
+## ##
+## -------- SPECIFIC PAIRS ------------------------------------------------------------------------------- ##
+## In case you want to have some pairs to always be on held until a specific profit, using the same ##
+## "nfi-hold-trades.json" file add something like: ##
+## ##
+## {"trade_pairs": {"BTC/USDT": 0.001, "ETH/USDT": -0.005}} ##
+## ##
+## -------- SPECIFIC TRADES AND PAIRS -------------------------------------------------------------------- ##
+## It is also valid to include specific trades and pairs on the holds file, for example: ##
+## ##
+## {"trade_ids": {"1": 0.001}, "trade_pairs": {"BTC/USDT": 0.001}} ##
+#############################################################################################################
+## DONATIONS ##
+## ##
+## BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk ##
+## ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91 ##
+## BEP20/BSC (USDT, ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe ##
+## TRC20/TRON (USDT, TRON, ...): TTAa9MX6zMLXNgWMhg7tkNormVHWCoq8Xk ##
+## ##
+## REFERRAL LINKS ##
+## ##
+## Binance: https://accounts.binance.com/en/register?ref=C68K26A9 (20% discount on trading fees) ##
+## Kucoin: https://www.kucoin.com/r/af/QBSSS5J2 (20% lifetime discount on trading fees) ##
+## Gate.io: https://www.gate.io/signup/8054544 (20% discount on trading fees) ##
+## OKX: https://www.okx.com/join/11749725931 (20% discount on trading fees) ##
+## ByBit: https://partner.bybit.com/b/nfi ##
+## Huobi: https://www.huobi.com/en-us/v/register/double-invite/?inviter_id=11345710&invite_code=ubpt2223 ##
+## (20% discount on trading fees) ##
+## Bitvavo: https://account.bitvavo.com/create?a=D22103A4BC (no fees for the first € 1000) ##
+#############################################################################################################
+
+
+class NostalgiaForInfinityX(IStrategy):
+
+ INTERFACE_VERSION = 3
+
+ def version(self) -> str:
+ return "v11.3.107"
+
+
+ # ROI table:
+ minimal_roi = {
+ "0": 100.0,
+ }
+
+ stoploss = -0.99
+
+ # Trailing stoploss (not used)
+ trailing_stop = False
+ trailing_only_offset_is_reached = True
+ trailing_stop_positive = 0.01
+ trailing_stop_positive_offset = 0.03
+
+ use_custom_stoploss = False
+
+ # Optimal timeframe for the strategy.
+ timeframe = '5m'
+ res_timeframe = 'none'
+ info_timeframe_1d = '1d'
+ info_timeframe_1h = '1h'
+ info_timeframe_15m = '15m'
+
+ # BTC informative
+ has_BTC_base_tf = True
+ has_BTC_info_tf = True
+ has_BTC_daily_tf = False
+
+ # Backtest Age Filter emulation
+ has_bt_agefilter = False
+ bt_min_age_days = 3
+
+ # Exchange Downtime protection
+ has_downtime_protection = False
+
+ # Do you want to use the hold feature? (with hold-trades.json)
+ holdSupportEnabled = True
+
+ # Coin Metrics
+ coin_metrics = {'top_traded_enabled': False,
+ 'top_traded_updated': False,
+ 'top_traded_len': 10,
+ 'tt_dataframe': DataFrame(),
+ 'top_grossing_enabled': False,
+ 'top_grossing_updated': False,
+ 'top_grossing_len': 20,
+ 'tg_dataframe': DataFrame(),
+ 'current_whitelist': []}
+
+ # Rebuy feature
+ position_adjustment_enable = True
+ nfi_automatic_rebuys_enable = False
+ rebuy_mode = 0
+ max_rebuy_orders_0 = 4
+ max_rebuy_orders_1 = 2
+ max_rebuy_orders_2 = 4
+ max_rebuy_orders_2_alt = 2
+ max_rebuy_orders_3 = 1
+ max_rebuy_orders_4 = 3
+ max_rebuy_orders_5 = 2
+ max_rebuy_multiplier_lev = 0.5 # for leveraged tokens
+ max_rebuy_multiplier_0 = 1.0
+ max_rebuy_multiplier_1 = 1.0
+ max_rebuy_multiplier_2 = 0.8
+ max_rebuy_multiplier_3 = 1.0
+ max_rebuy_multiplier_4 = 0.1
+ max_rebuy_multiplier_5 = 0.35
+ rebuy_pcts_n_0 = (-0.04, -0.06, -0.09, -0.12)
+ rebuy_pcts_n_1 = (-0.06, -0.12)
+ rebuy_pcts_n_2 = (-0.03, -0.04, -0.06, -0.09)
+ rebuy_pcts_n_2_alt = (-0.03, -0.08)
+ rebuy_pcts_p_2 = (0.02, 0.025, 0.025, 0.03, 0.07, 0.075, 0.08, 0.085, 0.09, 0.095)
+ rebuy_pcts_n_3 = (-0.06, -0.12)
+ rebuy_pcts_n_4 = (-0.02, -0.06, -0.1)
+ rebuy_pcts_n_5 = (-0.05, -0.08)
+ rebuy_multi_0 = 0.15
+ rebuy_multi_1 = 0.3
+ rebuy_multi_2 = 0.15
+ rebuy_multi_2_alt = 0.35
+ rebuy_multi_3 = 0.5
+ rebuy_multi_4 = 1.0
+ rebuy_multi_5 = 1.0
+
+ # BTC/ETH stakes
+ btc_stakes = ['BTC','ETH']
+
+ # Stop thresholds
+ # 1 entry, more than 1, leveraged
+ stop_thresholds_stable = [-0.2, -0.2, -0.2]
+ stop_thresholds_btc = [-0.2, -0.2, -0.2]
+
+ # Additional vigorous dump checks
+ insanity_dump_checks = False
+
+ # Profit maximizer
+ profit_max_enabled = True
+
+ # Maximizer threshold
+ profit_max_threshold = 0.03
+
+ # Rapid more tags
+ rapid_mode_tags = ['66', '67', '68', '69', '70', '71', '72']
+
+ # Half mode tags
+ half_mode_tags = ['73', '74']
+
+ # Half mode minimum number of free slots
+ half_mode_min_free_slots = 2
+
+ # Run "populate_indicators()" only for new candle.
+ process_only_new_candles = True
+
+ # Exit options
+ use_exit_signal = True
+ exit_profit_only = False
+ exit_profit_offset = 0.01
+ ignore_roi_if_entry_signal = True
+
+ # Number of candles the strategy requires before producing valid signals
+ startup_candle_count: int = 480
+
+ #############################################################
+
+ buy_params = {
+ #############
+ # Enable/Disable conditions
+ "buy_condition_1_enable": True,
+ "buy_condition_2_enable": True,
+ "buy_condition_3_enable": True,
+ "buy_condition_4_enable": True,
+ "buy_condition_5_enable": True,
+ "buy_condition_6_enable": True,
+ "buy_condition_7_enable": True,
+ "buy_condition_8_enable": True,
+ "buy_condition_9_enable": True,
+ "buy_condition_10_enable": True,
+ "buy_condition_11_enable": True,
+ "buy_condition_12_enable": True,
+ "buy_condition_13_enable": True,
+ "buy_condition_14_enable": True,
+ "buy_condition_15_enable": True,
+ "buy_condition_16_enable": True,
+ "buy_condition_17_enable": True,
+ "buy_condition_18_enable": True,
+ "buy_condition_19_enable": True,
+ "buy_condition_20_enable": True,
+ "buy_condition_21_enable": True,
+ "buy_condition_22_enable": True,
+ "buy_condition_23_enable": True,
+ "buy_condition_24_enable": True,
+ "buy_condition_25_enable": True,
+ "buy_condition_26_enable": True,
+ "buy_condition_27_enable": True,
+ "buy_condition_28_enable": True,
+ "buy_condition_29_enable": True,
+ "buy_condition_30_enable": True,
+ "buy_condition_31_enable": True,
+ "buy_condition_32_enable": True,
+ "buy_condition_33_enable": True,
+ "buy_condition_34_enable": True,
+ "buy_condition_35_enable": True,
+ "buy_condition_36_enable": True,
+ "buy_condition_37_enable": True,
+ "buy_condition_38_enable": True,
+ "buy_condition_39_enable": True,
+ "buy_condition_40_enable": True,
+ "buy_condition_41_enable": True,
+ "buy_condition_42_enable": True,
+ "buy_condition_43_enable": True,
+ "buy_condition_44_enable": True,
+ "buy_condition_45_enable": True,
+ "buy_condition_46_enable": True,
+ "buy_condition_47_enable": True,
+ "buy_condition_48_enable": True,
+ "buy_condition_49_enable": True,
+ "buy_condition_50_enable": True,
+ "buy_condition_51_enable": True,
+ "buy_condition_52_enable": True,
+ "buy_condition_53_enable": True,
+ "buy_condition_54_enable": True,
+ "buy_condition_55_enable": True,
+ "buy_condition_56_enable": True,
+ "buy_condition_57_enable": True,
+ "buy_condition_58_enable": True,
+ "buy_condition_59_enable": True,
+ "buy_condition_60_enable": True,
+ "buy_condition_61_enable": True,
+ "buy_condition_62_enable": True,
+ "buy_condition_63_enable": True,
+ "buy_condition_64_enable": True,
+ "buy_condition_65_enable": True,
+
+ "buy_condition_66_enable": True,
+ "buy_condition_67_enable": True,
+ "buy_condition_68_enable": True,
+ "buy_condition_69_enable": True,
+ "buy_condition_70_enable": True,
+ "buy_condition_71_enable": True,
+ "buy_condition_72_enable": True,
+
+ "buy_condition_73_enable": True,
+ "buy_condition_74_enable": True,
+ #############
+ }
+
+ sell_params = {
+ #############
+ # Enable/Disable conditions
+ "sell_condition_1_enable": True,
+ #############
+ }
+
+ #############################################################
+ buy_protection_params = {
+ 1: {
+ "ema_fast" : False,
+ "ema_fast_len" : "26",
+ "ema_slow" : True,
+ "ema_slow_len" : "50",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "28",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : None,
+ "safe_dips_threshold_2" : 0.06,
+ "safe_dips_threshold_12" : 0.24,
+ "safe_dips_threshold_144" : None,
+ "safe_pump_6h_threshold" : 0.36,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 1.2,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 2.0,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.6
+ },
+ 2: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : False,
+ "ema_slow_len" : "20",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "28",
+ "sma200_1h_rising" : True,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.06,
+ "safe_dips_threshold_12" : 0.18,
+ "safe_dips_threshold_144" : 0.32,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.75,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.8,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 3: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : False,
+ "ema_slow_len" : "20",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "28",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.08,
+ "safe_dips_threshold_12" : 0.24,
+ "safe_dips_threshold_144" : 0.44,
+ "safe_pump_6h_threshold" : 0.4,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.5,
+ "safe_pump_36h_threshold" : 0.7,
+ "safe_pump_48h_threshold" : 0.8,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.4
+ },
+ 4: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "28",
+ "sma200_1h_rising" : True,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.24,
+ "safe_dips_threshold_144" : 0.44,
+ "safe_pump_6h_threshold" : 0.6,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : 0.7,
+ "safe_pump_48h_threshold" : 1.0,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.8
+ },
+ 5: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "28",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.3,
+ "safe_dips_threshold_144" : 0.9,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.68,
+ "safe_pump_36h_threshold" : 0.74,
+ "safe_pump_48h_threshold" : 1.0,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.25
+ },
+ 6: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "28",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "36",
+ "safe_dips_threshold_0" : 0.03,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.24,
+ "safe_dips_threshold_144" : 0.44,
+ "safe_pump_6h_threshold" : 0.4,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.78,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.3,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.6
+ },
+ 7: {
+ "ema_fast" : False,
+ "ema_fast_len" : "26",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "28",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "36",
+ "safe_dips_threshold_0" : 0.028,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.3,
+ "safe_dips_threshold_144" : 0.9,
+ "safe_pump_6h_threshold" : 0.4,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : 0.65,
+ "safe_pump_48h_threshold" : 1.2,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.8
+ },
+ 8: {
+ "ema_fast" : False,
+ "ema_fast_len" : "26",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "28",
+ "sma200_1h_rising" : True,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.028,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.28,
+ "safe_dips_threshold_144" : 0.3,
+ "safe_pump_6h_threshold" : 0.4,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : 0.74,
+ "safe_pump_48h_threshold" : None,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.2
+ },
+ 9: {
+ "ema_fast" : False,
+ "ema_fast_len" : "26",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "28",
+ "sma200_1h_rising" : True,
+ "sma200_1h_rising_val" : "24",
+ "safe_dips_threshold_0" : 0.028,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.3,
+ "safe_dips_threshold_144" : 0.9,
+ "safe_pump_6h_threshold" : 0.4,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : 0.9,
+ "safe_pump_48h_threshold" : 0.88,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 10: {
+ "ema_fast" : False,
+ "ema_fast_len" : "26",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "30",
+ "sma200_1h_rising" : True,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.24,
+ "safe_dips_threshold_144" : 0.9,
+ "safe_pump_6h_threshold" : 0.4,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : 0.8,
+ "safe_pump_48h_threshold" : 1.0,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.6
+ },
+ 11: {
+ "ema_fast" : False,
+ "ema_fast_len" : "26",
+ "ema_slow" : False,
+ "ema_slow_len" : "50",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "30",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.24,
+ "safe_dips_threshold_144" : 0.44,
+ "safe_pump_6h_threshold" : 0.4,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : 0.88,
+ "safe_pump_48h_threshold" : 1.1,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.6
+ },
+ 12: {
+ "ema_fast" : False,
+ "ema_fast_len" : "26",
+ "ema_slow" : False,
+ "ema_slow_len" : "50",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "30",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.24,
+ "safe_dips_threshold_144" : 0.44,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : 0.5,
+ "safe_pump_24h_threshold" : 0.75,
+ "safe_pump_36h_threshold" : 1.8,
+ "safe_pump_48h_threshold" : 1.2,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.6
+ },
+ 13: {
+ "ema_fast" : False,
+ "ema_fast_len" : "26",
+ "ema_slow" : False,
+ "ema_slow_len" : "50",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "30",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.028,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.48,
+ "safe_dips_threshold_144" : 0.9,
+ "safe_pump_6h_threshold" : 0.4,
+ "safe_pump_12h_threshold" : 0.52,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : 0.9,
+ "safe_pump_48h_threshold" : 0.88,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 14: {
+ "ema_fast" : False,
+ "ema_fast_len" : "100",
+ "ema_slow" : False,
+ "ema_slow_len" : "50",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "44",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "72",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.48,
+ "safe_dips_threshold_144" : 0.9,
+ "safe_pump_6h_threshold" : 0.4,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : 0.8,
+ "safe_pump_48h_threshold" : None,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 15: {
+ "ema_fast" : False,
+ "ema_fast_len" : "100",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "24",
+ "sma200_1h_rising" : True,
+ "sma200_1h_rising_val" : "48",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.48,
+ "safe_dips_threshold_144" : 0.9,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.5,
+ "safe_pump_36h_threshold" : 0.9,
+ "safe_pump_48h_threshold" : None,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.35
+ },
+ 16: {
+ "ema_fast" : False,
+ "ema_fast_len" : "100",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "24",
+ "sma200_1h_rising" : True,
+ "sma200_1h_rising_val" : "36",
+ "safe_dips_threshold_0" : 0.02,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.26,
+ "safe_dips_threshold_144" : 0.44,
+ "safe_pump_6h_threshold" : 0.4,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : 0.9,
+ "safe_pump_48h_threshold" : None,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 17: {
+ "ema_fast" : False,
+ "ema_fast_len" : "100",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "24",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "36",
+ "safe_dips_threshold_0" : 0.028,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.25,
+ "safe_dips_threshold_144" : 0.44,
+ "safe_pump_6h_threshold" : 0.4,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : 0.25,
+ "safe_pump_48h_threshold" : None,
+ "btc_1h_not_downtrend" : True,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 18: {
+ "ema_fast" : False,
+ "ema_fast_len" : "100",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "24",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "36",
+ "safe_dips_threshold_0" : 0.03,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.14,
+ "safe_dips_threshold_144" : 0.44,
+ "safe_pump_6h_threshold" : 0.35,
+ "safe_pump_12h_threshold" : 0.45,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : 0.6,
+ "safe_pump_48h_threshold" : None,
+ "btc_1h_not_downtrend" : True,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 19: {
+ "ema_fast" : False,
+ "ema_fast_len" : "100",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "24",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "36",
+ "safe_dips_threshold_0" : 0.026,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.26,
+ "safe_dips_threshold_144" : 0.36,
+ "safe_pump_6h_threshold" : 0.35,
+ "safe_pump_12h_threshold" : 0.45,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : 0.65,
+ "safe_pump_48h_threshold" : 1.4,
+ "btc_1h_not_downtrend" : True,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 20: {
+ "ema_fast" : False,
+ "ema_fast_len" : "12",
+ "ema_slow" : True,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "30",
+ "sma200_1h_rising" : None,
+ "sma200_1h_rising_val" : "24",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.26,
+ "safe_dips_threshold_144" : 0.44,
+ "safe_pump_6h_threshold" : 0.4,
+ "safe_pump_12h_threshold" : 0.35,
+ "safe_pump_24h_threshold" : 0.55,
+ "safe_pump_36h_threshold" : 0.6,
+ "safe_pump_48h_threshold" : 1.2,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.6
+ },
+ 21: {
+ "ema_fast" : False,
+ "ema_fast_len" : "12",
+ "ema_slow" : True,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "30",
+ "sma200_1h_rising" : None,
+ "sma200_1h_rising_val" : "24",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.26,
+ "safe_dips_threshold_144" : 0.3,
+ "safe_pump_6h_threshold" : 0.6,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.95,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : None,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 22: {
+ "ema_fast" : False,
+ "ema_fast_len" : "12",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "30",
+ "sma200_1h_rising" : True,
+ "sma200_1h_rising_val" : "48",
+ "safe_dips_threshold_0" : 0.028,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.26,
+ "safe_dips_threshold_144" : 0.44,
+ "safe_pump_6h_threshold" : 0.6,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : None,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 23: {
+ "ema_fast" : False,
+ "ema_fast_len" : "12",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "30",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "24",
+ "safe_dips_threshold_0" : 0.028,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.26,
+ "safe_dips_threshold_144" : 0.38,
+ "safe_pump_6h_threshold" : 0.4,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.7,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 0.95,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 24: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : True,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "30",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "24",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.12,
+ "safe_dips_threshold_144" : 0.44,
+ "safe_pump_6h_threshold" : 0.4,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.5,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.6,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.1
+ },
+ 25: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "30",
+ "sma200_1h_rising" : True,
+ "sma200_1h_rising_val" : "36",
+ "safe_dips_threshold_0" : 0.028,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.26,
+ "safe_dips_threshold_144" : 0.44,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.8,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 26: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "30",
+ "sma200_1h_rising" : True,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.12,
+ "safe_dips_threshold_144" : 0.44,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : 1.0,
+ "safe_pump_48h_threshold" : 1.8,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.6
+ },
+ 27: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "30",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.28,
+ "safe_dips_threshold_144" : 0.18,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : 0.5,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.8,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "sup2", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res2", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 28: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "30",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.028,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.26,
+ "safe_dips_threshold_144" : 0.44,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : 1.9,
+ "safe_pump_48h_threshold" : None,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 29: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "30",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.26,
+ "safe_dips_threshold_144" : 0.32,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 0.6,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 30: {
+ "ema_fast" : True,
+ "ema_fast_len" : "50",
+ "ema_slow" : True,
+ "ema_slow_len" : "50",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "30",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.03,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.26,
+ "safe_dips_threshold_144" : 0.28,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : None,
+ "btc_1h_not_downtrend" : True,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 31: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : False,
+ "ema_slow_len" : "50",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "30",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.028,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.26,
+ "safe_dips_threshold_144" : 0.44,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.25,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 32: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : False,
+ "ema_slow_len" : "50",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "30",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.26,
+ "safe_dips_threshold_144" : 0.3,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.78,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : None,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.1
+ },
+ 33: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : False,
+ "ema_slow_len" : "50",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "30",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.028,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : None,
+ "safe_dips_threshold_144" : None,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : 0.8,
+ "safe_pump_48h_threshold" : None,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.1
+ },
+ 34: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : True,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "30",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.066,
+ "safe_dips_threshold_12" : 0.16,
+ "safe_dips_threshold_144" : 0.44,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.75,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.8,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.3
+ },
+ 35: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "30",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.18,
+ "safe_dips_threshold_144" : 0.3,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.8,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.0,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 36: {
+ "ema_fast" : True,
+ "ema_fast_len" : "16",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "30",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.14,
+ "safe_dips_threshold_144" : None,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.6,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.45
+ },
+ 37: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "30",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.14,
+ "safe_dips_threshold_144" : 0.22,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.8,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.1
+ },
+ 38: {
+ "ema_fast" : False,
+ "ema_fast_len" : "16",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "30",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.13,
+ "safe_dips_threshold_144" : None,
+ "safe_pump_6h_threshold" : 0.45,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 1.0,
+ "safe_pump_36h_threshold" : 2.0,
+ "safe_pump_48h_threshold" : 1.5,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.25
+ },
+ 39: {
+ "ema_fast" : False,
+ "ema_fast_len" : "12",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "30",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.24,
+ "safe_dips_threshold_144" : None,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : 0.54,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.8,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.25
+ },
+ 40: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "30",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.012,
+ "safe_dips_threshold_2" : None,
+ "safe_dips_threshold_12" : 0.3,
+ "safe_dips_threshold_144" : None,
+ "safe_pump_6h_threshold" : 0.55,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.67,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : None,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.25
+ },
+ 41: {
+ "ema_fast" : False,
+ "ema_fast_len" : "12",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "42",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.08,
+ "safe_dips_threshold_12" : 0.16,
+ "safe_dips_threshold_144" : 0.22,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : 0.9,
+ "safe_pump_48h_threshold" : 3.2,
+ "btc_1h_not_downtrend" : True,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 42: {
+ "ema_fast" : False,
+ "ema_fast_len" : "12",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "42",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : None,
+ "safe_dips_threshold_144" : 0.2,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.1,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 43: {
+ "ema_fast" : False,
+ "ema_fast_len" : "12",
+ "ema_slow" : False,
+ "ema_slow_len" : "50",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "42",
+ "sma200_1h_rising" : True,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.03,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : None,
+ "safe_dips_threshold_144" : None,
+ "safe_pump_6h_threshold" : None,
+ "safe_pump_12h_threshold" : 0.9,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.0,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "sup3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 0.99,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 44: {
+ "ema_fast" : False,
+ "ema_fast_len" : "12",
+ "ema_slow" : False,
+ "ema_slow_len" : "50",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : True,
+ "sma200_rising_val" : "24",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "24",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.16,
+ "safe_dips_threshold_144" : None,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : 1.2,
+ "safe_pump_48h_threshold" : 1.4,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.6
+ },
+ 45: {
+ "ema_fast" : False,
+ "ema_fast_len" : "12",
+ "ema_slow" : False,
+ "ema_slow_len" : "50",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "42",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "24",
+ "safe_dips_threshold_0" : 0.03,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.4,
+ "safe_dips_threshold_144" : 0.8,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.35,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 46: {
+ "ema_fast" : False,
+ "ema_fast_len" : "12",
+ "ema_slow" : False,
+ "ema_slow_len" : "50",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : True,
+ "sma200_rising_val" : "48",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "24",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.32,
+ "safe_dips_threshold_144" : 0.34,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.6,
+ "safe_pump_36h_threshold" : 1.0,
+ "safe_pump_48h_threshold" : 1.4,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 47: {
+ "ema_fast" : False,
+ "ema_fast_len" : "12",
+ "ema_slow" : False,
+ "ema_slow_len" : "50",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "42",
+ "sma200_1h_rising" : True,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.03,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : None,
+ "safe_dips_threshold_144" : 0.24,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : 0.9,
+ "safe_pump_48h_threshold" : 1.4,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 48: {
+ "ema_fast" : False,
+ "ema_fast_len" : "12",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "42",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : None,
+ "safe_dips_threshold_144" : 0.26,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.8,
+ "safe_pump_36h_threshold" : 1.3,
+ "safe_pump_48h_threshold" : 1.4,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.2
+ },
+ 49: {
+ "ema_fast" : False,
+ "ema_fast_len" : "12",
+ "ema_slow" : True,
+ "ema_slow_len" : "50",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "42",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.03,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.26,
+ "safe_dips_threshold_144" : 0.38,
+ "safe_pump_6h_threshold" : 0.4,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.6,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.4,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.6
+ },
+ 50: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : False,
+ "ema_slow_len" : "50",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "42",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.03,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : None,
+ "safe_dips_threshold_144" : None,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.56,
+ "safe_pump_36h_threshold" : 1.0,
+ "safe_pump_48h_threshold" : None,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.8
+ },
+ 51: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : False,
+ "ema_slow_len" : "50",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "42",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.03,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : None,
+ "safe_dips_threshold_144" : 0.3,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : 0.58,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 0.8,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.8
+ },
+ 52: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : False,
+ "ema_slow_len" : "50",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "42",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.18,
+ "safe_dips_threshold_144" : 0.34,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.62,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 0.95,
+ "btc_1h_not_downtrend" : True,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.8
+ },
+ 53: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : False,
+ "ema_slow_len" : "50",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "42",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.16,
+ "safe_dips_threshold_144" : 0.23,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : 0.7,
+ "safe_pump_48h_threshold" : 0.7,
+ "btc_1h_not_downtrend" : True,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 54: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : False,
+ "ema_slow_len" : "50",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "42",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.24,
+ "safe_dips_threshold_144" : 0.34,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : 0.95,
+ "safe_pump_48h_threshold" : 1.05,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.6
+ },
+ 55: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : False,
+ "ema_slow_len" : "50",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "42",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : None,
+ "safe_dips_threshold_144" : None,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : 0.7,
+ "safe_pump_48h_threshold" : 0.7,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.6
+ },
+ 56: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : False,
+ "ema_slow_len" : "50",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "42",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : None,
+ "safe_dips_threshold_144" : 0.3,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.8,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "sup3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 0.84,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.6
+ },
+ 57: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : False,
+ "ema_slow_len" : "50",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "42",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.28,
+ "safe_dips_threshold_144" : None,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.1,
+ "btc_1h_not_downtrend" : True,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.6
+ },
+ 58: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : False,
+ "ema_slow_len" : "50",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "42",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : None,
+ "safe_dips_threshold_144" : 0.34,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : 0.75,
+ "safe_pump_48h_threshold" : 1.0,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.6
+ },
+ 59: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : False,
+ "ema_slow_len" : "50",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "42",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.35,
+ "safe_dips_threshold_144" : 0.28,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.52,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.0,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "sup3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 0.75,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.6
+ },
+ 60: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : False,
+ "ema_slow_len" : "50",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "42",
+ "sma200_1h_rising" : True,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.16,
+ "safe_dips_threshold_144" : 0.3,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : None,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.0,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.6
+ },
+ 62: {
+ "ema_fast" : False,
+ "ema_fast_len" : "50",
+ "ema_slow" : False,
+ "ema_slow_len" : "50",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "42",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "50",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.18,
+ "safe_dips_threshold_144" : 0.23,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.6,
+ "safe_pump_36h_threshold" : 0.64,
+ "safe_pump_48h_threshold" : 1.4,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.6
+ },
+ 63: {
+ "ema_fast" : False,
+ "ema_fast_len" : "12",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "24",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "48",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.13,
+ "safe_dips_threshold_144" : 0.24,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.5,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 0.65,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.2
+ },
+ 64: {
+ "ema_fast" : False,
+ "ema_fast_len" : "12",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "24",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "48",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.18,
+ "safe_dips_threshold_144" : 0.19,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.75,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.4,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.6
+ },
+ 65: {
+ "ema_fast" : False,
+ "ema_fast_len" : "26",
+ "ema_slow" : True,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "24",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "48",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.24,
+ "safe_dips_threshold_144" : 0.36,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.6,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.25,
+ "btc_1h_not_downtrend" : True,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "res3", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.6
+ },
+
+ 66: {
+ "ema_fast" : False,
+ "ema_fast_len" : "26",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "48",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "48",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.24,
+ "safe_dips_threshold_144" : 0.36,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.5,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.0,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 67: {
+ "ema_fast" : False,
+ "ema_fast_len" : "26",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "48",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "48",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.24,
+ "safe_dips_threshold_144" : 0.36,
+ "safe_pump_6h_threshold" : 0.5,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.5,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.0,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.25
+ },
+ 68: {
+ "ema_fast" : False,
+ "ema_fast_len" : "26",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "48",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "48",
+ "safe_dips_threshold_0" : None,
+ "safe_dips_threshold_2" : 0.12,
+ "safe_dips_threshold_12" : 0.36,
+ "safe_dips_threshold_144" : 0.48,
+ "safe_pump_6h_threshold" : 0.6,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.8,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.8,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 69: {
+ "ema_fast" : False,
+ "ema_fast_len" : "26",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "48",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "48",
+ "safe_dips_threshold_0" : None,
+ "safe_dips_threshold_2" : 0.12,
+ "safe_dips_threshold_12" : 0.44,
+ "safe_dips_threshold_144" : 0.9,
+ "safe_pump_6h_threshold" : None,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.8,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.8,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 70: {
+ "ema_fast" : False,
+ "ema_fast_len" : "26",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "48",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "48",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.09,
+ "safe_dips_threshold_12" : 0.36,
+ "safe_dips_threshold_144" : 0.48,
+ "safe_pump_6h_threshold" : 0.6,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.8,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.2,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 71: {
+ "ema_fast" : False,
+ "ema_fast_len" : "26",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "48",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "48",
+ "safe_dips_threshold_0" : None,
+ "safe_dips_threshold_2" : 0.12,
+ "safe_dips_threshold_12" : 0.36,
+ "safe_dips_threshold_144" : 0.48,
+ "safe_pump_6h_threshold" : 0.6,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.8,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.2,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 72: {
+ "ema_fast" : False,
+ "ema_fast_len" : "26",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "48",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "48",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.12,
+ "safe_dips_threshold_12" : 0.36,
+ "safe_dips_threshold_144" : 0.48,
+ "safe_pump_6h_threshold" : 0.6,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.8,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.2,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+
+ 73: {
+ "ema_fast" : False,
+ "ema_fast_len" : "26",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "48",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "48",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.12,
+ "safe_dips_threshold_12" : 0.36,
+ "safe_dips_threshold_144" : 0.48,
+ "safe_pump_6h_threshold" : 0.6,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.8,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.2,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ },
+ 74: {
+ "ema_fast" : False,
+ "ema_fast_len" : "26",
+ "ema_slow" : False,
+ "ema_slow_len" : "12",
+ "close_above_ema_fast" : False,
+ "close_above_ema_fast_len" : "200",
+ "close_above_ema_slow" : False,
+ "close_above_ema_slow_len" : "200",
+ "sma200_rising" : False,
+ "sma200_rising_val" : "48",
+ "sma200_1h_rising" : False,
+ "sma200_1h_rising_val" : "48",
+ "safe_dips_threshold_0" : 0.032,
+ "safe_dips_threshold_2" : 0.12,
+ "safe_dips_threshold_12" : 0.36,
+ "safe_dips_threshold_144" : 0.48,
+ "safe_pump_6h_threshold" : 0.6,
+ "safe_pump_12h_threshold" : None,
+ "safe_pump_24h_threshold" : 0.8,
+ "safe_pump_36h_threshold" : None,
+ "safe_pump_48h_threshold" : 1.2,
+ "btc_1h_not_downtrend" : False,
+ "close_over_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_over_pivot_offset" : 1.0,
+ "close_under_pivot_type" : "none", # pivot, sup1, sup2, sup3, res1, res2, res3
+ "close_under_pivot_offset" : 1.0
+ }
+ }
+
+ # Sell
+ sell_condition_1_enable = True
+
+ #############################################################
+ # CACHES
+
+ hold_trades_cache = None
+ target_profit_cache = None
+ #############################################################
+
+ def __init__(self, config: dict) -> None:
+ super().__init__(config)
+ if ('nfi_automatic_rebuys_enable' in self.config):
+ nfi_automatic_rebuys_enable = self.config['nfi_automatic_rebuys_enable']
+ if ('stop_thresholds_stable' in self.config):
+ self.stop_thresholds_stable = self.config['stop_thresholds_stable']
+ if ('stop_thresholds_btc' in self.config):
+ self.stop_thresholds_btc = self.config['stop_thresholds_btc']
+ if ('insanity_dump_checks' in self.config):
+ self.insanity_dump_checks = self.config['insanity_dump_checks']
+ if ('profit_max_threshold' in self.config):
+ self.profit_max_threshold = self.config['profit_max_threshold']
+ if self.target_profit_cache is None:
+ bot_name = ""
+ if ('bot_name' in self.config):
+ bot_name = self.config["bot_name"] + "-"
+ self.target_profit_cache = Cache(
+ self.config["user_data_dir"] / ("nfi-profit_maximizer-" + bot_name + self.config["exchange"]["name"] + "-" + self.config["stake_currency"] + ("-(backtest)" if (self.config['runmode'].value == 'backtest') else "") + ".json")
+ )
+
+ # If the cached data hasn't changed, it's a no-op
+ self.target_profit_cache.save()
+
+ def get_hold_trades_config_file(self):
+ proper_holds_file_path = self.config["user_data_dir"].resolve() / "nfi-hold-trades.json"
+ if proper_holds_file_path.is_file():
+ return proper_holds_file_path
+
+ strat_file_path = pathlib.Path(__file__)
+ hold_trades_config_file_resolve = strat_file_path.resolve().parent / "hold-trades.json"
+ if hold_trades_config_file_resolve.is_file():
+ log.warning(
+ "Please move %s to %s which is now the expected path for the holds file",
+ hold_trades_config_file_resolve,
+ proper_holds_file_path,
+ )
+ return hold_trades_config_file_resolve
+
+ # The resolved path does not exist, is it a symlink?
+ hold_trades_config_file_absolute = strat_file_path.absolute().parent / "hold-trades.json"
+ if hold_trades_config_file_absolute.is_file():
+ log.warning(
+ "Please move %s to %s which is now the expected path for the holds file",
+ hold_trades_config_file_absolute,
+ proper_holds_file_path,
+ )
+ return hold_trades_config_file_absolute
+
+ def load_hold_trades_config(self):
+ if self.hold_trades_cache is None:
+ hold_trades_config_file = self.get_hold_trades_config_file()
+ if hold_trades_config_file:
+ log.warning("Loading hold support data from %s", hold_trades_config_file)
+ self.hold_trades_cache = HoldsCache(hold_trades_config_file)
+
+ if self.hold_trades_cache:
+ self.hold_trades_cache.load()
+
+ def whitelist_tracker(self):
+ if sorted(self.coin_metrics['current_whitelist']) != sorted(self.dp.current_whitelist()):
+ log.info("Whitelist has changed...")
+ self.coin_metrics['top_traded_updated'] = False
+ self.coin_metrics['top_grossing_updated'] = False
+
+ # Update pairlist
+ self.coin_metrics['current_whitelist'] = self.dp.current_whitelist()
+
+ # Move up BTC for largest data footprint
+ self.coin_metrics['current_whitelist'].insert(0, self.coin_metrics['current_whitelist'].pop(self.coin_metrics['current_whitelist'].index(f"BTC/{self.config['stake_currency']}")))
+
+ def top_traded_list(self):
+ log.info("Updating top traded pairlist...")
+ tik = time.perf_counter()
+
+ self.coin_metrics['tt_dataframe'] = DataFrame()
+
+ # Build traded volume dataframe
+ for coin_pair in self.coin_metrics['current_whitelist']:
+ coin = coin_pair.split('/')[0]
+
+ # Get the volume for the daily informative timeframe and name the column for the coin
+ pair_dataframe = self.dp.get_pair_dataframe(pair=coin_pair, timeframe=self.info_timeframe_1d)
+ pair_dataframe.set_index('date')
+
+ if self.config['runmode'].value in ('live', 'dry_run'):
+ pair_dataframe = pair_dataframe.iloc[-7:,:]
+
+ # Set the date index of the self.coin_metrics['tt_dataframe'] once
+ if not 'date' in self.coin_metrics['tt_dataframe']:
+ self.coin_metrics['tt_dataframe']['date'] = pair_dataframe['date']
+ self.coin_metrics['tt_dataframe'].set_index('date')
+
+ # Calculate daily traded volume
+ pair_dataframe[coin] = pair_dataframe['volume'] * qtpylib.typical_price(pair_dataframe)
+
+ # Drop the columns we don't need
+ pair_dataframe.drop(columns=['open', 'high', 'low', 'close', 'volume'], inplace=True)
+
+ # Merge it in on the date key
+ self.coin_metrics['tt_dataframe'] = self.coin_metrics['tt_dataframe'].merge(pair_dataframe, on='date', how='left')
+
+ # Forward fill empty cells (due to different df shapes)
+ self.coin_metrics['tt_dataframe'].fillna(0, inplace=True)
+
+ # Store and drop date column for value sorting
+ pair_dates = self.coin_metrics['tt_dataframe']['date']
+ self.coin_metrics['tt_dataframe'].drop(columns=['date'], inplace=True)
+
+ # Build columns and top traded coins
+ column_names = [f"Coin #{i}" for i in range(1, self.coin_metrics['top_traded_len'] + 1)]
+ self.coin_metrics['tt_dataframe'][column_names] = self.coin_metrics['tt_dataframe'].apply(lambda x: x.nlargest(self.coin_metrics['top_traded_len']).index.values, axis=1, result_type='expand')
+ self.coin_metrics['tt_dataframe'].drop(columns=[col for col in self.coin_metrics['tt_dataframe'] if col not in column_names], inplace=True)
+
+ # Re-add stored date column
+ self.coin_metrics['tt_dataframe'].insert(loc = 0, column = 'date', value = pair_dates)
+ self.coin_metrics['tt_dataframe'].set_index('date')
+ self.coin_metrics['top_traded_updated'] = True
+ log.info("Updated top traded pairlist (tail-5):")
+ log.info(f"\n{self.coin_metrics['tt_dataframe'].tail(5)}")
+
+ tok = time.perf_counter()
+ log.info(f"Updating top traded pairlist took {tok - tik:0.4f} seconds...")
+
+ def top_grossing_list(self):
+ log.info("Updating top grossing pairlist...")
+ tik = time.perf_counter()
+
+ self.coin_metrics['tg_dataframe'] = DataFrame()
+
+ # Build grossing volume dataframe
+ for coin_pair in self.coin_metrics['current_whitelist']:
+ coin = coin_pair.split('/')[0]
+
+ # Get the volume for the daily informative timeframe and name the column for the coin
+ pair_dataframe = self.dp.get_pair_dataframe(pair=coin_pair, timeframe=self.info_timeframe_1d)
+ pair_dataframe.set_index('date')
+
+ if self.config['runmode'].value in ('live', 'dry_run'):
+ pair_dataframe = pair_dataframe.iloc[-7:,:]
+
+ # Set the date index of the self.coin_metrics['tg_dataframe'] once
+ if not 'date' in self.coin_metrics['tg_dataframe']:
+ self.coin_metrics['tg_dataframe']['date'] = pair_dataframe['date']
+ self.coin_metrics['tg_dataframe'].set_index('date')
+
+ # Calculate daily grossing rate
+ pair_dataframe[coin] = pair_dataframe['close'].pct_change() * 100
+
+ # Drop the columns we don't need
+ pair_dataframe.drop(columns=['open', 'high', 'low', 'close', 'volume'], inplace=True)
+
+ # Merge it in on the date key
+ self.coin_metrics['tg_dataframe'] = self.coin_metrics['tg_dataframe'].merge(pair_dataframe, on='date', how='left')
+
+ # Forward fill empty cells (due to different df shapes)
+ self.coin_metrics['tg_dataframe'].fillna(0, inplace=True)
+
+ # Store and drop date column for value sorting
+ pair_dates = self.coin_metrics['tg_dataframe']['date']
+ self.coin_metrics['tg_dataframe'].drop(columns=['date'], inplace=True)
+
+ # Build columns and top grossing coins
+ column_names = [f"Coin #{i}" for i in range(1, self.coin_metrics['top_grossing_len'] + 1)]
+ self.coin_metrics['tg_dataframe'][column_names] = self.coin_metrics['tg_dataframe'].apply(lambda x: x.nlargest(self.coin_metrics['top_grossing_len']).index.values, axis=1, result_type='expand')
+ self.coin_metrics['tg_dataframe'].drop(columns=[col for col in self.coin_metrics['tg_dataframe'] if col not in column_names], inplace=True)
+
+ # Re-add stored date column
+ self.coin_metrics['tg_dataframe'].insert(loc = 0, column = 'date', value = pair_dates)
+ self.coin_metrics['tg_dataframe'].set_index('date')
+ self.coin_metrics['top_grossing_updated'] = True
+ log.info("Updated top grossing pairlist (tail-5):")
+ log.info(f"\n{self.coin_metrics['tg_dataframe'].tail(5)}")
+
+ tok = time.perf_counter()
+ log.info(f"Updating top grossing pairlist took {tok - tik:0.4f} seconds...")
+
+ def is_top_coin(self, coin_pair, row_data, top_length) -> bool:
+ return coin_pair.split('/')[0] in row_data.loc['Coin #1':f"Coin #{top_length}"].values
+
+
+ def bot_loop_start(self, **kwargs) -> None:
+ """
+ Called at the start of the bot iteration (one loop).
+ Might be used to perform pair-independent tasks
+ (e.g. gather some remote resource for comparison)
+ :param **kwargs: Ensure to keep this here so updates to this won't break your strategy.
+ """
+
+ # Coin metrics mechanism
+ if self.coin_metrics['top_traded_enabled'] or self.coin_metrics['top_grossing_enabled']:
+ self.whitelist_tracker()
+ if self.coin_metrics['top_traded_enabled'] and not self.coin_metrics['top_traded_updated']:
+ self.top_traded_list()
+ if self.coin_metrics['top_grossing_enabled'] and not self.coin_metrics['top_grossing_updated']:
+ self.top_grossing_list()
+
+ if self.config["runmode"].value not in ("live", "dry_run"):
+ return super().bot_loop_start(**kwargs)
+
+ if self.holdSupportEnabled:
+ self.load_hold_trades_config()
+
+ return super().bot_loop_start(**kwargs)
+
+ def get_ticker_indicator(self):
+ return int(self.timeframe[:-1])
+
+ def custom_stake_amount(self, pair: str, current_time: datetime, current_rate: float,
+ proposed_stake: float, min_stake: Optional[float], max_stake: float,
+ entry_tag: Optional[str], side: str, **kwargs) -> float:
+ if self.position_adjustment_enable and self.nfi_automatic_rebuys_enable:
+ use_mode = self.rebuy_mode
+ if ('rebuy_mode' in self.config):
+ use_mode = self.config['rebuy_mode']
+ if ('use_alt_rebuys' in self.config and self.config['use_alt_rebuys']):
+ use_mode = 1
+ enter_tags = entry_tag.split()
+ if all(c in self.rapid_mode_tags for c in enter_tags):
+ use_mode = 2
+ if all(c in self.half_mode_tags for c in enter_tags):
+ use_mode = 5
+ if 0 <= use_mode <= 5:
+ return proposed_stake * self.__getattribute__(f'max_rebuy_multiplier_{use_mode}')
+
+ return proposed_stake
+
+ def adjust_trade_position(self, trade: Trade, current_time: datetime,
+ current_rate: float, current_profit: float, min_stake: float,
+ max_stake: float, **kwargs):
+ # Don't rebuy for trades on hold
+ if self._should_hold_trade(trade, current_rate, 'none'):
+ return None
+
+ is_backtest = self.dp.runmode.value == 'backtest'
+ if (trade.open_date_utc.replace(tzinfo=None) < datetime(2022, 12, 1) and not is_backtest):
+ return None
+
+ if (self.position_adjustment_enable == False) or (self.nfi_automatic_rebuys_enable == False) or (current_profit > -0.02):
+ return None
+
+ enter_tag = 'empty'
+ if hasattr(trade, 'enter_tag') and trade.enter_tag is not None:
+ enter_tag = trade.enter_tag
+ enter_tags = enter_tag.split()
+
+ dataframe, _ = self.dp.get_analyzed_dataframe(trade.pair, self.timeframe)
+ if(len(dataframe) < 2):
+ return None
+ last_candle = dataframe.iloc[-1].squeeze()
+ previous_candle = dataframe.iloc[-2].squeeze()
+
+ count_of_entries = 0
+ if (hasattr(trade, 'enter_side')):
+ filled_entries = trade.select_filled_orders(trade.enter_side)
+ count_of_entries = trade.nr_of_successful_entries
+ else:
+ filled_entries = trade.select_filled_orders('buy')
+ count_of_entries = len(filled_entries)
+
+ if (count_of_entries == 0):
+ return None
+
+ use_mode = self.rebuy_mode
+ is_leverage = bool(re.match(leverage_pattern, trade.pair))
+ if (is_leverage) and ('do_not_use_leverage_rebuys' in self.config and self.config['do_not_use_leverage_rebuys']):
+ return None
+
+ # if to use alternate rebuy scheme
+ use_alt = False
+ use_alt_2 = False
+ if (use_mode == 0) and ((filled_entries[0].cost * (self.rebuy_multi_0 + (count_of_entries * 0.005))) < min_stake):
+ use_alt = True
+ if (use_mode == 2) and ((filled_entries[0].cost * (self.rebuy_multi_2 + (count_of_entries * 0.005))) < min_stake):
+ use_alt_2 = True
+ if (use_mode == 3) and ((filled_entries[0].cost * (self.rebuy_multi_3 + (count_of_entries * 0.005))) < min_stake):
+ use_alt = True
+ if (use_mode == 4) and ((filled_entries[0].cost * (self.rebuy_multi_4 + (count_of_entries * 0.005))) < min_stake):
+ use_alt = True
+
+ if ('use_alt_rebuys' in self.config and self.config['use_alt_rebuys']):
+ use_alt = True
+
+ if use_alt:
+ use_mode = 1
+
+ if all(c in self.rapid_mode_tags for c in enter_tags):
+ use_mode = 2
+ if all(c in self.half_mode_tags for c in enter_tags):
+ use_mode = 5
+
+ is_rebuy = False
+
+ if (use_mode == 0):
+ if (1 <= count_of_entries <= 1):
+ if (
+ (current_profit < self.rebuy_pcts_n_0[count_of_entries - 1])
+ and (last_candle['close_max_48'] < (last_candle['close'] * 1.05))
+ and (last_candle['btc_pct_close_max_72_5m'] < 1.02)
+ ):
+ is_rebuy = True
+ elif (2 <= count_of_entries <= self.max_rebuy_orders_0):
+ if (
+ (current_profit < self.rebuy_pcts_n_0[count_of_entries - 1])
+ and (last_candle['close_max_48'] < (last_candle['close'] * 1.04))
+ and (last_candle['btc_pct_close_max_72_5m'] < 1.02)
+ ):
+ is_rebuy = True
+ elif (use_mode == 1):
+ if (count_of_entries == 1):
+ if (
+ (current_profit < self.rebuy_pcts_n_1[0])
+ and (last_candle['close_max_48'] < (last_candle['close'] * 1.05))
+ and (last_candle['btc_pct_close_max_72_5m'] < 1.02)
+ ):
+ is_rebuy = True
+ elif (count_of_entries == 2):
+ if (
+ (current_profit < self.rebuy_pcts_n_1[1])
+ and (last_candle['close_max_48'] < (last_candle['close'] * 1.05))
+ and (last_candle['btc_pct_close_max_72_5m'] < 1.02)
+ ):
+ is_rebuy = True
+ elif (use_mode == 2):
+ if (use_alt_2):
+ if (1 <= count_of_entries <= 1):
+ if (
+ (current_profit < self.rebuy_pcts_n_2_alt[count_of_entries - 1])
+ ):
+ is_rebuy = True
+ elif (2 <= count_of_entries <= self.max_rebuy_orders_2_alt):
+ if (
+ (current_profit < self.rebuy_pcts_n_2_alt[count_of_entries - 1])
+ and (last_candle['close_max_48'] < (last_candle['close'] * 1.04))
+ and (last_candle['btc_pct_close_max_72_5m'] < 1.02)
+ ):
+ is_rebuy = True
+ else:
+ if (1 <= count_of_entries <= 2):
+ if (
+ (current_profit < self.rebuy_pcts_n_2[count_of_entries - 1])
+ ):
+ is_rebuy = True
+ elif (3 <= count_of_entries <= self.max_rebuy_orders_2):
+ if (
+ (current_profit < self.rebuy_pcts_n_2[count_of_entries - 1])
+ and (last_candle['close_max_48'] < (last_candle['close'] * 1.04))
+ and (last_candle['btc_pct_close_max_72_5m'] < 1.02)
+ ):
+ is_rebuy = True
+ elif (use_mode == 3):
+ if (
+ (current_profit < self.rebuy_pcts_n_3[count_of_entries - 1])
+ and (
+ (last_candle['crsi'] > 10.0)
+ and (last_candle['rsi_14'] < 40.0)
+ and (last_candle['crsi_1h'] > 20.0)
+ and (last_candle['close_max_48'] < (last_candle['close'] * 1.06))
+ and (last_candle['btc_pct_close_max_72_5m'] < 1.03)
+ )
+ ):
+ is_rebuy = True
+ elif (5 <= count_of_entries <= self.max_rebuy_orders_3):
+ if (
+ (current_profit < self.rebuy_pcts_n_3[count_of_entries - 1])
+ and (
+ (last_candle['crsi'] > 10.0)
+ and (last_candle['crsi_1h'] > 10.0)
+ )
+ ):
+ is_rebuy = True
+ elif (use_mode == 4):
+ if (1 <= count_of_entries <= 1):
+ if (
+ (current_profit < self.rebuy_pcts_n_4[count_of_entries - 1])
+ and (
+ (last_candle['crsi'] > 12.0)
+ and (last_candle['crsi_1h'] > 10.0)
+ )
+ ):
+ is_rebuy = True
+ elif (2 <= count_of_entries <= self.max_rebuy_orders_4):
+ if (
+ (current_profit < self.rebuy_pcts_n_4[count_of_entries - 1])
+ and (
+ (last_candle['crsi'] > 10.0)
+ and (last_candle['crsi_1h'] > 12.0)
+ and (last_candle['crsi_1h'] > 10.0) and (last_candle['btc_not_downtrend_1h'] == True)
+ )
+ ):
+ is_rebuy = True
+ elif (use_mode == 5):
+ if (count_of_entries == 1):
+ if (
+ (current_profit < self.rebuy_pcts_n_5[count_of_entries - 1])
+ and (last_candle['close_max_48'] < (last_candle['close'] * 1.05))
+ and (last_candle['btc_pct_close_max_72_5m'] < 1.03)
+ ):
+ is_rebuy = True
+ elif (2 <= count_of_entries <= self.max_rebuy_orders_5):
+ if (
+ (current_profit < self.rebuy_pcts_n_5[count_of_entries - 1])
+ and (last_candle['close_max_48'] < (last_candle['close'] * 1.05))
+ and (last_candle['btc_pct_close_max_72_5m'] < 1.03)
+ ):
+ is_rebuy = True
+
+ if not is_rebuy:
+ return None
+
+ # Log if the last candle triggered a buy signal, even if max rebuys reached
+ if (('buy' in last_candle and last_candle['buy'] == 1) or ('enter_long' in last_candle and last_candle['enter_long'] == 1)) and self.dp.runmode.value in ('backtest','dry_run'):
+ log.info(f"Rebuy: a buy tag found for pair {trade.pair}")
+
+ # Calculate the new stake.
+ if 0 < count_of_entries <= (self.max_rebuy_orders_0 if use_mode == 0 else self.max_rebuy_orders_1 if use_mode == 1 else self.max_rebuy_orders_2 if use_mode == 2 else self.max_rebuy_orders_3 if use_mode == 3 else self.max_rebuy_orders_4 if use_mode == 4 else self.max_rebuy_orders_5):
+ try:
+ # This returns first order stake size
+ stake_amount = filled_entries[0].cost
+ # This then calculates current safety order size
+ if (use_mode == 0):
+ stake_amount = stake_amount * (self.rebuy_multi_0 + (count_of_entries * 0.005))
+ elif (use_mode == 1) or (use_alt):
+ stake_amount = stake_amount * (self.rebuy_multi_1 + (count_of_entries * 0.005))
+ if (stake_amount < min_stake):
+ stake_amount = min_stake
+ elif (use_mode == 2):
+ if (use_alt_2) and (count_of_entries > self.max_rebuy_orders_2_alt):
+ return None
+ stake_amount = stake_amount * (self.rebuy_multi_2_alt if use_alt_2 else self.rebuy_multi_2)
+ elif use_mode == 3 and 1 <= count_of_entries <= 8:
+ stake_amount = stake_amount * self.rebuy_multi_3 * math.ceil(count_of_entries/2)
+ elif (use_mode == 4):
+ stake_amount = stake_amount + (stake_amount * (self.rebuy_multi_4 * (count_of_entries - 1)))
+ elif (use_mode == 5):
+ stake_amount = stake_amount * self.rebuy_multi_5
+ return stake_amount
+ except Exception as exception:
+ return None
+
+ return None
+
+ def sell_signals(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', enter_tag) -> tuple:
+ # Sell signal 1
+ if (last_candle['rsi_14'] > 79.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) and (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']) and (previous_candle_5['close'] > previous_candle_5['bb20_2_upp']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'sell_signal_1_1_1'
+ elif (current_profit > 0.0) and (max_loss > 0.14):
+ return True, 'sell_signal_1_1_2'
+ else:
+ if (current_profit > 0.01):
+ return True, 'sell_signal_1_2_1'
+ elif (current_profit > 0.0) and (max_loss > 0.14):
+ return True, 'sell_signal_1_2_2'
+
+ # Sell signal 2
+ elif (last_candle['rsi_14'] > 80.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'sell_signal_2_1_1'
+ elif (current_profit > 0.0) and (max_loss > 0.14):
+ return True, 'sell_signal_2_1_2'
+ else:
+ if (current_profit > 0.01):
+ return True, 'sell_signal_2_2_1'
+ elif (current_profit > 0.0) and (max_loss > 0.14):
+ return True, 'sell_signal_2_2_2'
+
+ # Sell signal 3
+ elif (last_candle['rsi_14'] > 83.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'sell_signal_3_1_1'
+ elif (current_profit > 0.0) and (max_loss > 0.14):
+ return True, 'sell_signal_3_1_2'
+ else:
+ if (current_profit > 0.01):
+ return True, 'sell_signal_3_2_1'
+ elif (current_profit > 0.0) and (max_loss > 0.14):
+ return True, 'sell_signal_3_2_2'
+
+ # Sell signal 4
+ elif (last_candle['rsi_14'] > 78.0) and (last_candle['rsi_14_1h'] > 78.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'sell_signal_4_1_1'
+ elif (current_profit > 0.0) and (max_loss > 0.14):
+ return True, 'sell_signal_4_1_2'
+ else:
+ if (current_profit > 0.01):
+ return True, 'sell_signal_4_2_1'
+ elif (current_profit > 0.0) and (max_loss > 0.14):
+ return True, 'sell_signal_4_2_2'
+
+ # Sell signal 6
+ elif (last_candle['close'] < last_candle['ema_200']) and (last_candle['close'] > last_candle['ema_50']) and (last_candle['rsi_14'] > 79.5):
+ if (current_profit > 0.01):
+ return True, 'sell_signal_6_1'
+ elif (current_profit > 0.0) and (max_loss > 0.14):
+ return True, 'sell_signal_6_2'
+
+ # Sell signal 7
+ elif (last_candle['rsi_14_1h'] > 80.0) and (last_candle['crossed_below_ema_12_26']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'sell_signal_7_1_1'
+ elif (current_profit > 0.0) and (max_loss > 0.14):
+ return True, 'sell_signal_7_1_2'
+ else:
+ if (current_profit > 0.01):
+ return True, 'sell_signal_7_2_1'
+ elif (current_profit > 0.0) and (max_loss > 0.14):
+ return True, 'sell_signal_7_2_2'
+
+ # Sell signal 8
+ elif (last_candle['close'] > last_candle['bb20_2_upp_1h'] * 1.08):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'sell_signal_8_1_1'
+ elif (current_profit > 0.0) and (max_loss > 0.14):
+ return True, 'sell_signal_8_1_2'
+ else:
+ if (current_profit > 0.01):
+ return True, 'sell_signal_8_2_1'
+ elif (current_profit > 0.0) and (max_loss > 0.14):
+ return True, 'sell_signal_8_2_2'
+
+ return False, None
+
+ def sell_stoploss(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:
+ is_backtest = self.dp.runmode.value == 'backtest'
+
+ count_of_buys = 1
+ if hasattr(trade, 'select_filled_orders'):
+ filled_buys = trade.select_filled_orders('buy')
+ count_of_buys = len(filled_buys)
+ # If 2 rebuys or more
+ is_rebuy = count_of_buys > 2
+ is_leverage = bool(re.match(leverage_pattern,trade.pair))
+ stop_index = 0 if is_rebuy and not is_leverage else 1 if not is_rebuy and not is_leverage else 2
+ is_btc_stake = self.config['stake_currency'] in self.btc_stakes
+
+ # Absolute limit, just in case...
+ if (
+ (current_profit < [-0.5, -0.5, -0.5][stop_index])
+ and (current_time - timedelta(hours=1) > trade.open_date_utc)
+ # temporary
+ and (trade.open_date_utc.replace(tzinfo=None) > datetime(2022, 5, 25) or is_backtest)
+ ):
+ return True, 'sell_stoploss_stop_1'
+
+ if not is_btc_stake:
+ if (
+ (current_profit < [-0.35, -0.35, -0.35][stop_index])
+ and (current_time - timedelta(hours=1) > trade.open_date_utc)
+ # temporary
+ and (trade.open_date_utc.replace(tzinfo=None) >= datetime(2022, 8, 28) or is_backtest)
+ ):
+ return True, 'sell_stoploss_stop_2'
+
+ if (
+ (current_profit < self.stop_thresholds_stable[stop_index])
+ # temporary
+ and (trade.open_date_utc.replace(tzinfo=None) >= datetime(2022, 9, 21) or is_backtest)
+ ):
+ return True, 'sell_stoploss_stop_2'
+ else:
+ # BTC/ETH stake
+ if (
+ (current_profit < [-0.25, -0.25, -0.35][stop_index])
+ and (current_time - timedelta(hours=1) > trade.open_date_utc)
+ # temporary
+ and (trade.open_date_utc.replace(tzinfo=None) > datetime(2022, 6, 13) or is_backtest)
+ ):
+ return True, 'sell_stoploss_stop_2'
+
+ if (
+ (current_profit < self.stop_thresholds_btc[stop_index])
+ # temporary
+ and (trade.open_date_utc.replace(tzinfo=None) > datetime(2022, 9, 21) or is_backtest)
+ ):
+ return True, 'sell_stoploss_stop_2'
+
+ return False, None
+
+ def sell_over_main(self, current_profit: float, last_candle) -> tuple:
+ if last_candle['close'] > last_candle['ema_200']:
+ if (last_candle['ema_vwma_osc_96']):
+ if current_profit >= 0.20:
+ if (last_candle['rsi_14'] < 39.0):
+ return True, 'sell_profit_o_bull_12_1'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_o_bull_12_2'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_12_3'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_12_4'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_o_bull_12_5'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_o_bull_12_6'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_12_7'
+ elif 0.20 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 41.0):
+ return True, 'sell_profit_o_bull_11_1'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_o_bull_11_2'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_11_3'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_11_4'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_o_bull_11_5'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_o_bull_11_6'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_11_7'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 43.0):
+ return True, 'sell_profit_o_bull_10_1'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_o_bull_10_2'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_10_3'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_10_4'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_o_bull_10_5'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_o_bull_10_6'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_10_7'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 45.0):
+ return True, 'sell_profit_o_bull_9_1'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_o_bull_9_2'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_9_3'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_9_4'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_o_bull_9_5'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_o_bull_9_6'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_9_7'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 47.0):
+ return True, 'sell_profit_o_bull_8_1'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_o_bull_8_2'
+ elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_8_3'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_8_4'
+ elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_o_bull_8_5'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_o_bull_8_6'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_8_7'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 45.0):
+ return True, 'sell_profit_o_bull_7_1'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_o_bull_7_2'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_7_3'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_7_4'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_o_bull_7_5'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_o_bull_7_6'
+ elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_7_7'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 43.0):
+ return True, 'sell_profit_o_bull_6_1'
+ elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_o_bull_6_2'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_6_3'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_6_4'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_o_bull_6_5'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_o_bull_6_6'
+ elif (last_candle['rsi_14'] < 55.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_6_7'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 41.0):
+ return True, 'sell_profit_o_bull_5_1'
+ elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_o_bull_5_2'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_5_3'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_5_4'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_o_bull_5_5'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_o_bull_5_6'
+ elif (last_candle['rsi_14'] < 59.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_5_7'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 39.0):
+ return True, 'sell_profit_o_bull_4_1'
+ elif (last_candle['rsi_14'] < 62.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_o_bull_4_2'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_4_3'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_4_4'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_o_bull_4_5'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_o_bull_4_6'
+ elif (last_candle['rsi_14'] < 63.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_4_7'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 37.0):
+ return True, 'sell_profit_o_bull_3_1'
+ elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_o_bull_3_2'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_3_3'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_3_4'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_o_bull_3_5'
+ elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_o_bull_3_6'
+ elif (last_candle['rsi_14'] < 57.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_3_7'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 34.0):
+ return True, 'sell_profit_o_bull_2_1'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_o_bull_2_2'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_2_3'
+ elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_2_4'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_o_bull_2_5'
+ elif (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_o_bull_2_6'
+ elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_2_7'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 33.0):
+ return True, 'sell_profit_o_bull_1_1'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_o_bull_1_2'
+ elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_1_3'
+ elif (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_1_4'
+ elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_o_bull_1_5'
+ elif (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_o_bull_1_6'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bull_1_7'
+ else:
+ if current_profit >= 0.20:
+ if (last_candle['rsi_14'] < 40.0):
+ return True, 'sell_profit_o_bear_12_1'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_o_bear_12_2'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_12_3'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_12_4'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_o_bear_12_5'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_o_bear_12_6'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_12_7'
+ elif 0.20 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'sell_profit_o_bear_11_1'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_o_bear_11_2'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_11_3'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_11_4'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_o_bear_11_5'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_o_bear_11_6'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_11_7'
+ elif 0.12 > current_profit >= 0.10:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'sell_profit_o_bear_10_1'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_o_bear_10_2'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_10_3'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_10_4'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_o_bear_10_5'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_o_bear_10_6'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_10_7'
+ elif 0.10 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'sell_profit_o_bear_9_1'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_o_bear_9_2'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_9_3'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_9_4'
+ elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_o_bear_9_5'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_o_bear_9_6'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_9_7'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'sell_profit_o_bear_8_1'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_o_bear_8_2'
+ elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_8_3'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_8_4'
+ elif (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_o_bear_8_5'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_o_bear_8_6'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_8_7'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'sell_profit_o_bear_7_1'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_o_bear_7_2'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_7_3'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_7_4'
+ elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_o_bear_7_5'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_o_bear_7_6'
+ elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_7_7'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'sell_profit_o_bear_6_1'
+ elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_o_bear_6_2'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_6_3'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_6_4'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_o_bear_6_5'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_o_bear_6_6'
+ elif (last_candle['rsi_14'] < 55.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_6_7'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'sell_profit_o_bear_5_1'
+ elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_o_bear_5_2'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_5_3'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_5_4'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_o_bear_5_5'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_o_bear_5_6'
+ elif (last_candle['rsi_14'] < 59.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_5_7'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 40.0):
+ return True, 'sell_profit_o_bear_4_1'
+ elif (last_candle['rsi_14'] < 62.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_o_bear_4_2'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_4_3'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_4_4'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_o_bear_4_5'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_o_bear_4_6'
+ elif (last_candle['rsi_14'] < 63.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_4_7'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 38.0):
+ return True, 'sell_profit_o_bear_3_1'
+ elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_o_bear_3_2'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_3_3'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_3_4'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_o_bear_3_5'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_o_bear_3_6'
+ elif (last_candle['rsi_14'] < 57.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_3_7'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 35.0):
+ return True, 'sell_profit_o_bear_2_1'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_o_bear_2_2'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_2_3'
+ elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_2_4'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_o_bear_2_5'
+ elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_o_bear_2_6'
+ elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_2_7'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 34.0):
+ return True, 'sell_profit_o_bear_1_1'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_o_bear_1_2'
+ elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_1_3'
+ elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_1_4'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_o_bear_1_5'
+ elif (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_o_bear_1_6'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_o_bear_1_7'
+
+ return False, None
+
+ def sell_under_main(self, current_profit: float, last_candle) -> tuple:
+ if last_candle['close'] < last_candle['ema_200']:
+ if (last_candle['ema_vwma_osc_96'] > 0.0):
+ if current_profit >= 0.20:
+ if (last_candle['rsi_14'] < 41.0):
+ return True, 'sell_profit_u_bull_12_1'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_u_bull_12_2'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_12_3'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_12_4'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_u_bull_12_5'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_u_bull_12_6'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_12_7'
+ elif 0.20 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 43.0):
+ return True, 'sell_profit_u_bull_11_1'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_o_bull_11_2'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_11_3'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_11_4'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_u_bull_11_5'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_u_bull_11_6'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_11_7'
+ elif 0.12 > current_profit >= 0.10:
+ if (last_candle['rsi_14'] < 45.0):
+ return True, 'sell_profit_u_bull_10_1'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_u_bull_10_2'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_10_3'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_10_4'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_u_bull_10_5'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_u_bull_10_6'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_10_7'
+ elif 0.10 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 47.0):
+ return True, 'sell_profit_u_bull_9_1'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_u_bull_9_2'
+ elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_9_3'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_9_4'
+ elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_u_bull_9_5'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_u_bull_9_6'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_9_7'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 49.0):
+ return True, 'sell_profit_u_bull_8_1'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_u_bull_8_2'
+ elif (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_8_3'
+ elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_8_4'
+ elif (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_u_bull_8_5'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_u_bull_8_6'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_8_7'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 47.0):
+ return True, 'sell_profit_u_bull_7_1'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_u_bull_7_2'
+ elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_7_3'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_7_4'
+ elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_u_bull_7_5'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_u_bull_7_6'
+ elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_7_7'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 45.0):
+ return True, 'sell_profit_u_bull_6_1'
+ elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_u_bull_6_2'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_6_3'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_6_4'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_u_bull_6_5'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_u_bull_6_6'
+ elif (last_candle['rsi_14'] < 55.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_6_7'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 43.0):
+ return True, 'sell_profit_u_bull_5_1'
+ elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_u_bull_5_2'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_5_3'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_5_4'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_u_bull_5_5'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_u_bull_5_6'
+ elif (last_candle['rsi_14'] < 59.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_5_7'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 41.0):
+ return True, 'sell_profit_u_bull_4_1'
+ elif (last_candle['rsi_14'] < 62.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_u_bull_4_2'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_4_3'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_4_4'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_u_bull_4_5'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_u_bull_4_6'
+ elif (last_candle['rsi_14'] < 63.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_4_7'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 39.0):
+ return True, 'sell_profit_u_bull_3_1'
+ elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_u_bull_3_2'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_3_3'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_3_4'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_u_bull_3_5'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_u_bull_3_6'
+ elif (last_candle['rsi_14'] < 57.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_3_7'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 36.0):
+ return True, 'sell_profit_u_bull_2_1'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_u_bull_2_2'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_2_3'
+ elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_2_4'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_u_bull_2_5'
+ elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_u_bull_2_6'
+ elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_2_7'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 35.0):
+ return True, 'sell_profit_u_bull_1_1'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_u_bull_1_2'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_1_3'
+ elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_1_4'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_u_bull_1_5'
+ elif (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_u_bull_1_6'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bull_1_7'
+ else:
+ if current_profit >= 0.20:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'sell_profit_u_bear_12_1'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_u_bear_12_2'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_12_3'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_12_4'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_u_bear_12_5'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_u_bear_12_6'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_12_7'
+ elif 0.20 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'sell_profit_u_bear_11_1'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_u_bear_11_2'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_11_3'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_11_4'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_u_bear_11_5'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_u_bear_11_6'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_11_7'
+ elif 0.12 > current_profit >= 0.10:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'sell_profit_u_bear_10_1'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_u_bear_10_2'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_10_3'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_10_4'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_u_bear_10_5'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_u_bear_10_6'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_10_7'
+ elif 0.10 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'sell_profit_u_bear_9_1'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_u_bear_9_2'
+ elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_9_3'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_9_4'
+ elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_u_bear_9_5'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_u_bear_9_6'
+ elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_9_7'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 50.0):
+ return True, 'sell_profit_u_bear_8_1'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_u_bear_8_2'
+ elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_8_3'
+ elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_8_4'
+ elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_u_bear_8_5'
+ elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_u_bear_8_6'
+ elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_8_7'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'sell_profit_u_bear_7_1'
+ elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_u_bear_7_2'
+ elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_7_3'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_7_4'
+ elif (last_candle['rsi_14'] < 52.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_u_bear_7_5'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_u_bear_7_6'
+ elif (last_candle['rsi_14'] < 53.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_7_7'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'sell_profit_u_bear_6_1'
+ elif (last_candle['rsi_14'] < 54.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_u_bear_6_2'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_6_3'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_6_4'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_u_bear_6_5'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_u_bear_6_6'
+ elif (last_candle['rsi_14'] < 55.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_6_7'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'sell_profit_u_bear_5_1'
+ elif (last_candle['rsi_14'] < 58.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_u_bear_5_2'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_5_3'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_5_4'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_u_bear_5_5'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_u_bear_5_6'
+ elif (last_candle['rsi_14'] < 59.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_5_7'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'sell_profit_u_bear_4_1'
+ elif (last_candle['rsi_14'] < 62.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_u_bear_4_2'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_4_3'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_4_4'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_u_bear_4_5'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_u_bear_4_6'
+ elif (last_candle['rsi_14'] < 63.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_4_7'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 40.0):
+ return True, 'sell_profit_u_bear_3_1'
+ elif (last_candle['rsi_14'] < 56.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_u_bear_3_2'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_3_3'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_3_4'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_u_bear_3_5'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_u_bear_3_6'
+ elif (last_candle['rsi_14'] < 57.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_3_7'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 39.0):
+ return True, 'sell_profit_u_bear_2_1'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_u_bear_2_2'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_2_3'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_2_4'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_u_bear_2_5'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_u_bear_2_6'
+ elif (last_candle['rsi_14'] < 51.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_2_7'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 38.0):
+ return True, 'sell_profit_u_bear_1_1'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.4):
+ return True, 'sell_profit_u_bear_1_2'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_1_3'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_1_4'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_u_bear_1_5'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2):
+ return True, 'sell_profit_u_bear_1_6'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_u_bear_1_7'
+
+ return False, None
+
+ def sell_recover(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:
+ if (max_loss > 0.09):
+ if 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] > 78.0):
+ return True, 'sell_profit_rc_1_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] > 78.0):
+ return True, 'sell_profit_rc_2_1'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] > 78.0):
+ return True, 'sell_profit_rc_3_1'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] > 78.0):
+ return True, 'sell_profit_rc_4_1'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] > 78.0):
+ return True, 'sell_profit_rc_5_1'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] > 78.0):
+ return True, 'sell_profit_rc_6_1'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] > 78.0):
+ return True, 'sell_profit_rc_7_1'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] > 78.0):
+ return True, 'sell_profit_rc_8_1'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] > 78.0):
+ return True, 'sell_profit_rc_9_1'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] > 78.0):
+ return True, 'sell_profit_rc_10_1'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] > 78.0):
+ return True, 'sell_profit_rc_11_1'
+ elif current_profit >= 0.2:
+ if (last_candle['rsi_14'] > 78.0):
+ return True, 'sell_profit_rc_12_1'
+
+ return False, None
+
+ def sell_r(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:
+ if 0.02 > current_profit >= 0.01:
+ if (last_candle['r_480'] > -0.4):
+ return True, 'sell_profit_w_1_1'
+ elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 75.0):
+ return True, 'sell_profit_w_1_2'
+ elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 44.0):
+ return True, 'sell_profit_w_1_3'
+ elif (last_candle['r_14'] >= -2.5) and (last_candle['rsi_14'] > 74.0):
+ return True, 'sell_profit_w_1_4'
+ elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 73.0):
+ return True, 'sell_profit_w_1_5'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 360.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_1_6'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_1_7'
+ elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9):
+ return True, 'sell_profit_w_1_8'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 74.0):
+ return True, 'sell_profit_w_1_9'
+ elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):
+ return True, 'sell_profit_w_1_10'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 320.0):
+ return True, 'sell_profit_w_1_11'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 260.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_1_12'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_1_13'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 70.0):
+ return True, 'sell_profit_w_1_14'
+ elif (last_candle['r_14'] > -0.1) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_1_15'
+ elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 300.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_1_16'
+ elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_w_1_17'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_1_18'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_1_19'
+ elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.8) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_1_20'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_1_21'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_1_22'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_1_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['r_64_15m'] > -5.0):
+ return True, 'sell_profit_w_1_24'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_w_1_25'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_1_26'
+ elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_1_27'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 75.0):
+ return True, 'sell_profit_w_1_28'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_1_29'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85):
+ return True, 'sell_profit_w_1_30'
+ elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 280.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_1_31'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_1_32'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_1_33'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_1_34'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['r_480_1h'] > -15.0):
+ return True, 'sell_profit_w_1_35'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):
+ return True, 'sell_profit_w_1_36'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):
+ return True, 'sell_profit_w_1_37'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):
+ return True, 'sell_profit_w_1_38'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_1_39'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_64'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_1_40'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):
+ return True, 'sell_profit_w_1_41'
+ elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):
+ return True, 'sell_profit_w_1_42'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_1_43'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_1_44'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_1_45'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_1_46'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_1_47'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_1_48'
+ elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):
+ return True, 'sell_profit_w_1_49'
+ elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_1_50'
+ elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_1_51'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_w_1_52'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_1_53'
+ elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_1_54'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['r_14_15m'] > -20.0):
+ return True, 'sell_profit_w_1_55'
+ elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_1_56'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):
+ return True, 'sell_profit_w_1_57'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_1_58'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_1_59'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -6.0) and (last_candle['r_64'] > -6.0) and (last_candle['r_96'] > -6.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] > -30.0):
+ return True, 'sell_profit_w_1_60'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_1_61'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 200.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_1_62'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['r_480_1h'] > -25.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_w_1_63'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_1_64'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_1_65'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_1_66'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_1_67'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_1_68'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_1_69'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['r_96'] < -70.0) and (last_candle['r_14'] > -75.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_96_15m'] < -60.0):
+ return True, 'sell_profit_w_1_70'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_1_71'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_1_72'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 250.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_1_73'
+ elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_1_74'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_1_75'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_1_76'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_1_77'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_1_78'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_1_79'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_1_80'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_1_81'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_1_82'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0):
+ return True, 'sell_profit_w_1_83'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_1_84'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_1_85'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['r_480'] < -75.0) and (last_candle['r_96_15m'] < -75.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_1_86'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_1_87'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_1_88'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_1_89'
+ elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_1_90'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cmf_15m'] < -0.25):
+ return True, 'sell_profit_w_1_91'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_1_92'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_1_93'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['r_32'] > -14.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_1_94'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_96'] > -14.0) and (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['cmf_1h'] > 0.3):
+ return True, 'sell_profit_w_1_95'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3):
+ return True, 'sell_profit_w_1_96'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['r_64'] > -8.0) and (last_candle['r_96'] > -8.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['rsi_14_1h'] < 60.0):
+ return True, 'sell_profit_w_1_97'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']):
+ return True, 'sell_profit_w_1_98'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0):
+ return True, 'sell_profit_w_1_99'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25):
+ return True, 'sell_profit_w_1_100'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_1_101'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_1_102'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_1_103'
+ elif (last_candle['r_96'] > -50.0) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -50.0):
+ return True, 'sell_profit_w_1_104'
+ elif (last_candle['r_14'] > -40.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_1_105'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_1_106'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['r_96'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['rsi_14_1h'] > 65.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_1_107'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_480'] > -30.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_15m'] < -0.1):
+ return True, 'sell_profit_w_1_108'
+ elif (last_candle['r_480'] > -16.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_1_109'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_1_110'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_1_111'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_1_112'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 59.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_1_113'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['r_480'] > -0.5):
+ return True, 'sell_profit_w_2_1'
+ elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 74.0):
+ return True, 'sell_profit_w_2_2'
+ elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 46.0):
+ return True, 'sell_profit_w_2_3'
+ elif (last_candle['r_14'] >= -2.5) and (last_candle['rsi_14'] > 73.0):
+ return True, 'sell_profit_w_2_4'
+ elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 72.0):
+ return True, 'sell_profit_w_2_5'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 350.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_2_6'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_2_7'
+ elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9):
+ return True, 'sell_profit_w_2_8'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 72.0):
+ return True, 'sell_profit_w_2_9'
+ elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):
+ return True, 'sell_profit_w_2_10'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 300.0):
+ return True, 'sell_profit_w_2_11'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 250.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_2_12'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_2_13'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 69.0):
+ return True, 'sell_profit_w_2_14'
+ elif (last_candle['r_14'] > -0.1) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_2_15'
+ elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 290.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_2_16'
+ elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_w_2_17'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_2_18'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_2_19'
+ elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.8) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_2_20'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_2_21'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_2_22'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_2_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['r_64_15m'] > -5.0):
+ return True, 'sell_profit_w_2_24'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_w_2_25'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_2_26'
+ elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_2_27'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 74.0):
+ return True, 'sell_profit_w_2_28'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_2_29'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85):
+ return True, 'sell_profit_w_2_30'
+ elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_2_31'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_2_32'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_2_33'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_2_34'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['r_480_1h'] > -15.0):
+ return True, 'sell_profit_w_2_35'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):
+ return True, 'sell_profit_w_2_36'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):
+ return True, 'sell_profit_w_2_37'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):
+ return True, 'sell_profit_w_2_38'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_2_39'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_64'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_2_40'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):
+ return True, 'sell_profit_w_2_41'
+ elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):
+ return True, 'sell_profit_w_2_42'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_2_43'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_2_44'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_2_45'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_2_46'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_2_47'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_2_48'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):
+ return True, 'sell_profit_w_2_49'
+ elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_2_50'
+ elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_2_51'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_w_2_52'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_2_53'
+ elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_2_54'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['r_14_15m'] > -20.0):
+ return True, 'sell_profit_w_2_55'
+ elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_2_56'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):
+ return True, 'sell_profit_w_2_57'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_2_58'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_2_59'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -6.0) and (last_candle['r_64'] > -6.0) and (last_candle['r_96'] > -6.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] > -30.0):
+ return True, 'sell_profit_w_2_60'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_2_61'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 200.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_2_62'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['r_480_1h'] > -25.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_w_2_63'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_2_64'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_2_65'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_2_66'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_2_67'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_2_68'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_2_69'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['r_96'] < -70.0) and (last_candle['r_14'] > -75.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_96_15m'] < -60.0):
+ return True, 'sell_profit_w_2_70'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_2_71'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_2_72'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 250.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_2_73'
+ elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_2_74'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_2_75'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_2_76'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_2_77'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_2_78'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_2_79'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_2_80'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_2_81'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_2_82'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0):
+ return True, 'sell_profit_w_2_83'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_2_84'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_2_85'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['r_480'] < -75.0) and (last_candle['r_96_15m'] < -75.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_2_86'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_2_87'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_2_88'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_2_89'
+ elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_2_90'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cmf_15m'] < -0.25):
+ return True, 'sell_profit_w_2_91'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_2_92'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_2_93'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['r_32'] > -14.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_2_94'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_96'] > -14.0) and (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['cmf_1h'] > 0.3):
+ return True, 'sell_profit_w_2_95'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3):
+ return True, 'sell_profit_w_2_96'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['r_64'] > -8.0) and (last_candle['r_96'] > -8.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['rsi_14_1h'] < 60.0):
+ return True, 'sell_profit_w_2_97'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20_15m']):
+ return True, 'sell_profit_w_2_98'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0):
+ return True, 'sell_profit_w_2_99'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25):
+ return True, 'sell_profit_w_2_100'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_2_101'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_2_102'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_2_103'
+ elif (last_candle['r_96'] > -50.0) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -50.0):
+ return True, 'sell_profit_w_2_104'
+ elif (last_candle['r_14'] > -40.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_2_105'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_2_106'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['r_96'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['rsi_14_1h'] > 65.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_2_107'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_480'] > -30.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cmf_15m'] < -0.1):
+ return True, 'sell_profit_w_2_108'
+ elif (last_candle['r_480'] > -16.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_2_109'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_2_110'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_2_111'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_2_112'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_2_113'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['r_480'] > -0.6):
+ return True, 'sell_profit_w_3_1'
+ elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 73.0):
+ return True, 'sell_profit_w_3_2'
+ elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 48.0):
+ return True, 'sell_profit_w_3_3'
+ elif (last_candle['r_14'] >= -2.5) and (last_candle['rsi_14'] > 72.0):
+ return True, 'sell_profit_w_3_4'
+ elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 71.0):
+ return True, 'sell_profit_w_3_5'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 340.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_3_6'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_3_7'
+ elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85):
+ return True, 'sell_profit_w_3_8'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 68.0):
+ return True, 'sell_profit_w_3_9'
+ elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):
+ return True, 'sell_profit_w_3_10'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 290.0):
+ return True, 'sell_profit_w_3_11'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 240.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_3_12'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_3_13'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 68.0):
+ return True, 'sell_profit_w_3_14'
+ elif (last_candle['r_14'] > -0.1) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_3_15'
+ elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 280.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_3_16'
+ elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_w_3_17'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_3_18'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_3_19'
+ elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.8) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_3_20'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_3_21'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_3_22'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_3_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_64_15m'] > -5.0):
+ return True, 'sell_profit_w_3_24'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_w_3_25'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_3_26'
+ elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_3_27'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 73.0):
+ return True, 'sell_profit_w_3_28'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_3_29'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.85):
+ return True, 'sell_profit_w_3_30'
+ elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_3_31'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_3_32'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_3_33'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_3_34'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['r_480_1h'] > -15.0):
+ return True, 'sell_profit_w_3_35'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):
+ return True, 'sell_profit_w_3_36'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):
+ return True, 'sell_profit_w_3_37'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):
+ return True, 'sell_profit_w_3_38'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_3_39'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_64'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_3_40'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 59.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):
+ return True, 'sell_profit_w_3_41'
+ elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):
+ return True, 'sell_profit_w_3_42'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_3_43'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_3_44'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_3_45'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_3_46'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_3_47'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_3_48'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):
+ return True, 'sell_profit_w_3_49'
+ elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_3_50'
+ elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_3_51'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_w_3_52'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_3_53'
+ elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_3_54'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['r_14_15m'] > -20.0):
+ return True, 'sell_profit_w_3_55'
+ elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_3_56'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):
+ return True, 'sell_profit_w_3_57'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_3_58'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_3_59'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -6.0) and (last_candle['r_64'] > -6.0) and (last_candle['r_96'] > -6.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] > -30.0):
+ return True, 'sell_profit_w_3_60'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_3_61'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 200.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_3_62'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['r_480_1h'] > -25.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_w_3_63'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_3_64'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_3_65'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_3_66'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_3_67'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_3_68'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_3_69'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['r_96'] < -70.0) and (last_candle['r_14'] > -75.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_96_15m'] < -60.0):
+ return True, 'sell_profit_w_3_70'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_3_71'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_3_72'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 250.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_3_73'
+ elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_3_74'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_3_75'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_3_76'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_3_77'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_3_78'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_3_79'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_3_80'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_3_81'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_3_82'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0):
+ return True, 'sell_profit_w_3_83'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_3_84'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_3_85'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['r_480'] < -75.0) and (last_candle['r_96_15m'] < -75.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_3_86'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_3_87'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_3_88'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_3_89'
+ elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_3_90'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cmf_15m'] < -0.25):
+ return True, 'sell_profit_w_3_91'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_3_92'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_3_93'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['r_32'] > -14.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_3_94'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_96'] > -14.0) and (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['cmf_1h'] > 0.3):
+ return True, 'sell_profit_w_3_95'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3):
+ return True, 'sell_profit_w_3_96'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['r_64'] > -8.0) and (last_candle['r_96'] > -8.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['rsi_14_1h'] < 60.0):
+ return True, 'sell_profit_w_3_97'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20_15m']):
+ return True, 'sell_profit_w_3_98'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0):
+ return True, 'sell_profit_w_3_99'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25):
+ return True, 'sell_profit_w_3_100'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_3_101'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_3_102'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_3_103'
+ elif (last_candle['r_96'] > -50.0) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -50.0):
+ return True, 'sell_profit_w_3_104'
+ elif (last_candle['r_14'] > -40.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_3_105'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_3_106'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['r_96'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] > 65.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_3_107'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_480'] > -30.0) and (last_candle['rsi_14'] > 59.0) and (last_candle['cmf_15m'] < -0.1):
+ return True, 'sell_profit_w_3_108'
+ elif (last_candle['r_480'] > -16.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_3_109'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_3_110'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_3_111'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_3_112'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 57.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_3_113'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['r_480'] > -0.7):
+ return True, 'sell_profit_w_4_1'
+ elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 72.0):
+ return True, 'sell_profit_w_4_2'
+ elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 50.0):
+ return True, 'sell_profit_w_4_3'
+ elif (last_candle['r_14'] >= -2.5) and (last_candle['rsi_14'] > 71.0):
+ return True, 'sell_profit_w_4_4'
+ elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 70.0):
+ return True, 'sell_profit_w_4_5'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 330.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_4_6'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_4_7'
+ elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85):
+ return True, 'sell_profit_w_4_8'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 66.0):
+ return True, 'sell_profit_w_4_9'
+ elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):
+ return True, 'sell_profit_w_4_10'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 280.0):
+ return True, 'sell_profit_w_4_11'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 230.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_4_12'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_4_13'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 67.0):
+ return True, 'sell_profit_w_4_14'
+ elif (last_candle['r_14'] > -0.1) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_4_15'
+ elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 270.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_4_16'
+ elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_w_4_17'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_4_18'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_4_19'
+ elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.8) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_4_20'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_4_21'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_4_22'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_4_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['r_64_15m'] > -5.0):
+ return True, 'sell_profit_w_4_24'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_w_4_25'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_4_26'
+ elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_4_27'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 72.0):
+ return True, 'sell_profit_w_4_28'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_4_29'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85):
+ return True, 'sell_profit_w_4_30'
+ elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_4_31'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_4_32'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_4_33'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_4_34'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['r_480_1h'] > -15.0):
+ return True, 'sell_profit_w_4_35'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):
+ return True, 'sell_profit_w_4_36'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):
+ return True, 'sell_profit_w_4_37'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):
+ return True, 'sell_profit_w_4_38'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_4_39'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_64'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_4_40'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):
+ return True, 'sell_profit_w_4_41'
+ elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):
+ return True, 'sell_profit_w_4_42'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_4_43'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_4_44'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_4_45'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_4_46'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_4_47'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_4_48'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):
+ return True, 'sell_profit_w_4_49'
+ elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_4_50'
+ elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_4_51'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_w_4_52'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_4_53'
+ elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_4_54'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['r_14_15m'] > -20.0):
+ return True, 'sell_profit_w_4_55'
+ elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_4_56'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):
+ return True, 'sell_profit_w_4_57'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_4_58'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_4_59'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -6.0) and (last_candle['r_64'] > -6.0) and (last_candle['r_96'] > -6.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] > -30.0):
+ return True, 'sell_profit_w_4_60'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_4_61'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 200.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_4_62'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['r_480_1h'] > -25.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_w_4_63'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_4_64'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_4_65'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_4_66'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_4_67'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_4_68'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_4_69'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['r_96'] < -70.0) and (last_candle['r_14'] > -75.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_96_15m'] < -60.0):
+ return True, 'sell_profit_w_4_70'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_4_71'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_4_72'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 250.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_4_73'
+ elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_4_74'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_4_75'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_4_76'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_4_77'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_4_78'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_4_79'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_4_80'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_4_81'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_4_82'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0):
+ return True, 'sell_profit_w_4_83'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_4_84'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_4_85'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['r_480'] < -75.0) and (last_candle['r_96_15m'] < -75.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_4_86'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_4_87'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_4_88'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_4_89'
+ elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_4_90'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cmf_15m'] < -0.25):
+ return True, 'sell_profit_w_4_91'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_4_92'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_4_93'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['r_32'] > -14.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_4_94'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_96'] > -14.0) and (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['cmf_1h'] > 0.3):
+ return True, 'sell_profit_w_4_95'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3):
+ return True, 'sell_profit_w_4_96'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['r_64'] > -8.0) and (last_candle['r_96'] > -8.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['rsi_14_1h'] < 60.0):
+ return True, 'sell_profit_w_4_97'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_15m']):
+ return True, 'sell_profit_w_4_98'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0):
+ return True, 'sell_profit_w_4_99'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25):
+ return True, 'sell_profit_w_4_100'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_4_101'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_4_102'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_4_103'
+ elif (last_candle['r_96'] > -50.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -50.0):
+ return True, 'sell_profit_w_4_104'
+ elif (last_candle['r_14'] > -40.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_4_105'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['rsi_14'] > 59.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_4_106'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['r_96'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] > 65.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_4_107'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_480'] > -30.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['cmf_15m'] < -0.1):
+ return True, 'sell_profit_w_4_108'
+ elif (last_candle['r_480'] > -16.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_4_109'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_4_110'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_4_111'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_4_112'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 56.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_4_113'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['r_480'] > -0.8):
+ return True, 'sell_profit_w_5_1'
+ elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 71.0):
+ return True, 'sell_profit_w_5_2'
+ elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 54.0):
+ return True, 'sell_profit_w_5_3'
+ elif (last_candle['r_14'] >= -2.5) and (last_candle['rsi_14'] > 70.0):
+ return True, 'sell_profit_w_5_4'
+ elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 69.0):
+ return True, 'sell_profit_w_5_5'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 320.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_5_6'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_5_7'
+ elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85):
+ return True, 'sell_profit_w_5_8'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 64.0):
+ return True, 'sell_profit_w_5_9'
+ elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):
+ return True, 'sell_profit_w_5_10'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 270.0):
+ return True, 'sell_profit_w_5_11'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 220.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_5_12'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_5_13'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 66.0):
+ return True, 'sell_profit_w_5_14'
+ elif (last_candle['r_14'] > -0.1) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_5_15'
+ elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_5_16'
+ elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_w_5_17'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_5_18'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 63.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_5_19'
+ elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_5_20'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_5_21'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_5_22'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_5_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_64_15m'] > -5.0):
+ return True, 'sell_profit_w_5_24'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_w_5_25'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 47.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_5_26'
+ elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_5_27'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 71.0):
+ return True, 'sell_profit_w_5_28'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_5_29'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.85):
+ return True, 'sell_profit_w_5_30'
+ elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 200.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_5_31'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_5_32'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_5_33'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_5_34'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['r_480_1h'] > -15.0):
+ return True, 'sell_profit_w_5_35'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):
+ return True, 'sell_profit_w_5_36'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):
+ return True, 'sell_profit_w_5_37'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):
+ return True, 'sell_profit_w_5_38'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_5_39'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_64'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_5_40'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 57.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):
+ return True, 'sell_profit_w_5_41'
+ elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):
+ return True, 'sell_profit_w_5_42'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_5_43'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_5_44'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_5_45'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_5_46'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_5_47'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_5_48'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):
+ return True, 'sell_profit_w_5_49'
+ elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_5_50'
+ elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_5_51'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_w_5_52'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_5_53'
+ elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_5_54'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['r_14_15m'] > -20.0):
+ return True, 'sell_profit_w_5_55'
+ elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_5_56'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):
+ return True, 'sell_profit_w_5_57'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_5_58'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_5_59'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -6.0) and (last_candle['r_64'] > -6.0) and (last_candle['r_96'] > -6.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] > -30.0):
+ return True, 'sell_profit_w_5_60'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_5_61'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 200.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_5_62'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['r_480_1h'] > -25.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_w_5_63'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_5_64'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_5_65'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_5_66'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_5_67'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_5_68'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_5_69'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['r_96'] < -70.0) and (last_candle['r_14'] > -75.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_96_15m'] < -60.0):
+ return True, 'sell_profit_w_5_70'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_5_71'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_5_72'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 250.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_5_73'
+ elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_5_74'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_5_75'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_5_76'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_5_77'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_5_78'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_5_79'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_5_80'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_5_81'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_5_82'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0):
+ return True, 'sell_profit_w_5_83'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_5_84'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_5_85'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['r_480'] < -75.0) and (last_candle['r_96_15m'] < -75.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_5_86'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_5_87'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_5_88'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_5_89'
+ elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_5_90'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cmf_15m'] < -0.25):
+ return True, 'sell_profit_w_5_91'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_5_92'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_5_93'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['r_32'] > -14.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_5_94'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_96'] > -14.0) and (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['cmf_1h'] > 0.3):
+ return True, 'sell_profit_w_5_95'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3):
+ return True, 'sell_profit_w_5_96'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['r_64'] > -8.0) and (last_candle['r_96'] > -8.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['rsi_14_1h'] < 60.0):
+ return True, 'sell_profit_w_5_97'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20_15m']):
+ return True, 'sell_profit_w_5_98'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0):
+ return True, 'sell_profit_w_5_99'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25):
+ return True, 'sell_profit_w_5_100'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_5_101'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_5_102'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_5_103'
+ elif (last_candle['r_96'] > -50.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -50.0):
+ return True, 'sell_profit_w_5_104'
+ elif (last_candle['r_14'] > -40.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_5_105'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_5_106'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['r_96'] > -10.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['rsi_14_1h'] > 65.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_5_107'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_480'] > -30.0) and (last_candle['rsi_14'] > 57.0) and (last_candle['cmf_15m'] < -0.1):
+ return True, 'sell_profit_w_5_108'
+ elif (last_candle['r_480'] > -16.0) and (last_candle['rsi_14'] > 59.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_5_109'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_5_110'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_5_111'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_5_112'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 55.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_5_113'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['r_480'] > -0.9):
+ return True, 'sell_profit_w_6_1'
+ elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 72.0):
+ return True, 'sell_profit_w_6_2'
+ elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 52.0):
+ return True, 'sell_profit_w_6_3'
+ elif (last_candle['r_14'] >= -2.5) and (last_candle['rsi_14'] > 71.0):
+ return True, 'sell_profit_w_6_4'
+ elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 70.0):
+ return True, 'sell_profit_w_6_5'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 310.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_6_6'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_6_7'
+ elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85):
+ return True, 'sell_profit_w_6_8'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 66.0):
+ return True, 'sell_profit_w_6_9'
+ elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):
+ return True, 'sell_profit_w_6_10'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 260.0):
+ return True, 'sell_profit_w_6_11'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 230.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_6_12'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_6_13'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 67.0):
+ return True, 'sell_profit_w_6_14'
+ elif (last_candle['r_14'] > -0.1) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_6_15'
+ elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 270.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_6_16'
+ elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_w_6_17'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_6_18'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_6_19'
+ elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.8) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_6_20'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_6_21'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_6_22'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_6_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['r_64_15m'] > -5.0):
+ return True, 'sell_profit_w_6_24'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_w_6_25'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_6_26'
+ elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_6_27'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 72.0):
+ return True, 'sell_profit_w_6_28'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_6_29'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85):
+ return True, 'sell_profit_w_6_30'
+ elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_6_31'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_6_32'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_6_33'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_6_34'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['r_480_1h'] > -15.0):
+ return True, 'sell_profit_w_6_35'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):
+ return True, 'sell_profit_w_6_36'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):
+ return True, 'sell_profit_w_6_37'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):
+ return True, 'sell_profit_w_6_38'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_6_39'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_64'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_6_40'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):
+ return True, 'sell_profit_w_6_41'
+ elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):
+ return True, 'sell_profit_w_6_42'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_6_43'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_6_44'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_6_45'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_6_46'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_6_47'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_6_48'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):
+ return True, 'sell_profit_w_6_49'
+ elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_6_50'
+ elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_6_51'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_w_6_52'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_6_53'
+ elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_6_54'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_14_15m'] > -20.0):
+ return True, 'sell_profit_w_6_55'
+ elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_6_56'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):
+ return True, 'sell_profit_w_6_57'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_6_58'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_6_59'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -6.0) and (last_candle['r_64'] > -6.0) and (last_candle['r_96'] > -6.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] > -30.0):
+ return True, 'sell_profit_w_6_60'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_6_61'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 200.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_6_62'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['r_480_1h'] > -25.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_w_6_63'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_6_64'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_6_65'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_6_66'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_6_67'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_6_68'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_6_69'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['r_96'] < -70.0) and (last_candle['r_14'] > -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_96_15m'] < -60.0):
+ return True, 'sell_profit_w_6_70'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_6_71'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_6_72'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 250.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_6_73'
+ elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_6_74'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_6_75'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_6_76'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_6_77'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_6_78'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_6_79'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_6_80'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_6_81'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_6_82'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0):
+ return True, 'sell_profit_w_6_83'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_6_84'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_6_85'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['r_480'] < -75.0) and (last_candle['r_96_15m'] < -75.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_6_86'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_6_87'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_6_88'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_6_89'
+ elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_6_90'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_15m'] < -0.25):
+ return True, 'sell_profit_w_6_91'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_6_92'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_6_93'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['r_32'] > -14.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_6_94'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_96'] > -14.0) and (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['cmf_1h'] > 0.3):
+ return True, 'sell_profit_w_6_95'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3):
+ return True, 'sell_profit_w_6_96'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['r_64'] > -8.0) and (last_candle['r_96'] > -8.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['rsi_14_1h'] < 60.0):
+ return True, 'sell_profit_w_6_97'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_15m']):
+ return True, 'sell_profit_w_6_98'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0):
+ return True, 'sell_profit_w_6_99'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25):
+ return True, 'sell_profit_w_6_100'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_6_101'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_6_102'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_6_103'
+ elif (last_candle['r_96'] > -50.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -50.0):
+ return True, 'sell_profit_w_6_104'
+ elif (last_candle['r_14'] > -40.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_6_105'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['rsi_14'] > 59.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_6_106'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['r_96'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] > 65.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_6_107'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_480'] > -30.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['cmf_15m'] < -0.1):
+ return True, 'sell_profit_w_6_108'
+ elif (last_candle['r_480'] > -16.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_6_109'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_6_110'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_6_111'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_6_112'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 56.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_6_113'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['r_480'] > -1.0):
+ return True, 'sell_profit_w_7_1'
+ elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 73.0):
+ return True, 'sell_profit_w_7_2'
+ elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 50.0):
+ return True, 'sell_profit_w_7_3'
+ elif (last_candle['r_14'] >= -2.5) and (last_candle['rsi_14'] > 72.0):
+ return True, 'sell_profit_w_7_4'
+ elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 71.0):
+ return True, 'sell_profit_w_7_5'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 300.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_7_6'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_7_7'
+ elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85):
+ return True, 'sell_profit_w_7_8'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 68.0):
+ return True, 'sell_profit_w_7_9'
+ elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):
+ return True, 'sell_profit_w_7_10'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 270.0):
+ return True, 'sell_profit_w_7_11'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 240.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_7_12'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_7_13'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 68.0):
+ return True, 'sell_profit_w_7_14'
+ elif (last_candle['r_14'] > -0.1) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_7_15'
+ elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 280.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_7_16'
+ elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_w_7_17'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_7_18'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_7_19'
+ elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_7_20'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_7_21'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_7_22'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_7_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_64_15m'] > -5.0):
+ return True, 'sell_profit_w_7_24'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_w_7_25'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_7_26'
+ elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_7_27'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 73.0):
+ return True, 'sell_profit_w_7_28'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_7_29'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.85):
+ return True, 'sell_profit_w_7_30'
+ elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_7_31'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_7_32'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_7_33'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_7_34'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['r_480_1h'] > -15.0):
+ return True, 'sell_profit_w_7_35'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):
+ return True, 'sell_profit_w_7_36'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):
+ return True, 'sell_profit_w_7_37'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):
+ return True, 'sell_profit_w_7_38'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_7_39'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_64'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_7_40'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 59.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):
+ return True, 'sell_profit_w_7_41'
+ elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):
+ return True, 'sell_profit_w_7_42'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_7_43'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_7_44'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_7_45'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_7_46'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_7_47'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_7_48'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):
+ return True, 'sell_profit_w_7_49'
+ elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_7_50'
+ elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_7_51'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_w_7_52'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_7_53'
+ elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_7_54'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['r_14_15m'] > -20.0):
+ return True, 'sell_profit_w_7_55'
+ elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_7_56'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):
+ return True, 'sell_profit_w_7_57'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_7_58'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_7_59'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -6.0) and (last_candle['r_64'] > -6.0) and (last_candle['r_96'] > -6.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] > -30.0):
+ return True, 'sell_profit_w_7_60'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_7_61'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 200.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_7_62'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['r_480_1h'] > -25.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_w_7_63'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_7_64'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_7_65'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_7_66'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_7_67'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_7_68'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_7_69'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['r_96'] < -70.0) and (last_candle['r_14'] > -75.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_96_15m'] < -60.0):
+ return True, 'sell_profit_w_7_70'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_7_71'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_7_72'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 250.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_7_73'
+ elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_7_74'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_7_75'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_7_76'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_7_77'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_7_78'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_7_79'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_7_80'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_7_81'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_7_82'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0):
+ return True, 'sell_profit_w_7_83'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_7_84'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_7_85'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['r_480'] < -75.0) and (last_candle['r_96_15m'] < -75.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_7_86'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_7_87'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_7_88'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_7_89'
+ elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_7_90'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cmf_15m'] < -0.25):
+ return True, 'sell_profit_w_7_91'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_7_92'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_7_93'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['r_32'] > -14.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_7_94'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_96'] > -14.0) and (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['cmf_1h'] > 0.3):
+ return True, 'sell_profit_w_7_95'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3):
+ return True, 'sell_profit_w_7_96'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['r_64'] > -8.0) and (last_candle['r_96'] > -8.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['rsi_14_1h'] < 60.0):
+ return True, 'sell_profit_w_7_97'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20_15m']):
+ return True, 'sell_profit_w_7_98'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0):
+ return True, 'sell_profit_w_7_99'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25):
+ return True, 'sell_profit_w_7_100'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_7_101'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_7_102'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_7_103'
+ elif (last_candle['r_96'] > -50.0) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -50.0):
+ return True, 'sell_profit_w_7_104'
+ elif (last_candle['r_14'] > -40.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_7_105'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_7_106'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['r_96'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] > 65.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_7_107'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_480'] > -30.0) and (last_candle['rsi_14'] > 59.0) and (last_candle['cmf_15m'] < -0.1):
+ return True, 'sell_profit_w_7_108'
+ elif (last_candle['r_480'] > -16.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_7_109'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_7_110'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_7_111'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_7_112'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 57.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_7_113'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['r_480'] > -1.2):
+ return True, 'sell_profit_w_8_1'
+ elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 74.0):
+ return True, 'sell_profit_w_8_2'
+ elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 48.0):
+ return True, 'sell_profit_w_8_3'
+ elif (last_candle['r_14'] >= -2.5) and (last_candle['rsi_14'] > 73.0):
+ return True, 'sell_profit_w_8_4'
+ elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 72.0):
+ return True, 'sell_profit_w_8_5'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 310.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_8_6'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_8_7'
+ elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.85):
+ return True, 'sell_profit_w_8_8'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 70.0):
+ return True, 'sell_profit_w_8_9'
+ elif (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):
+ return True, 'sell_profit_w_8_10'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 280.0):
+ return True, 'sell_profit_w_8_11'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 250.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_8_12'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_8_13'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 69.0):
+ return True, 'sell_profit_w_8_14'
+ elif (last_candle['r_14'] > -0.1) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_8_15'
+ elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 290.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_8_16'
+ elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_w_8_17'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_8_18'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_8_19'
+ elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.85) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_8_20'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_8_21'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_8_22'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_8_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['r_64_15m'] > -5.0):
+ return True, 'sell_profit_w_8_24'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_w_8_25'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_8_26'
+ elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_8_27'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 74.0):
+ return True, 'sell_profit_w_8_28'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_8_29'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85):
+ return True, 'sell_profit_w_8_30'
+ elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_8_31'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_8_32'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_8_33'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_8_34'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['r_480_1h'] > -15.0):
+ return True, 'sell_profit_w_8_35'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):
+ return True, 'sell_profit_w_8_36'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):
+ return True, 'sell_profit_w_8_37'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):
+ return True, 'sell_profit_w_8_38'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_8_39'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_64'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_8_40'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):
+ return True, 'sell_profit_w_8_41'
+ elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):
+ return True, 'sell_profit_w_8_42'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_8_43'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_8_44'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_8_45'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_8_46'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_8_47'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_8_48'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):
+ return True, 'sell_profit_w_8_49'
+ elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_8_50'
+ elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_8_51'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_w_8_52'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_8_53'
+ elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_8_54'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_14_15m'] > -20.0):
+ return True, 'sell_profit_w_8_55'
+ elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_8_56'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):
+ return True, 'sell_profit_w_8_57'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_8_58'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_8_59'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -6.0) and (last_candle['r_64'] > -6.0) and (last_candle['r_96'] > -6.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] > -30.0):
+ return True, 'sell_profit_w_8_60'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_8_61'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 200.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_8_62'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['r_480_1h'] > -25.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_w_8_63'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_8_64'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_8_65'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_8_66'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_8_67'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_8_68'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_8_69'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['r_96'] < -70.0) and (last_candle['r_14'] > -75.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_96_15m'] < -60.0):
+ return True, 'sell_profit_w_8_70'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_8_71'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_8_72'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 250.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_8_73'
+ elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_8_74'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_8_75'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_8_76'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_8_77'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_8_78'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_8_79'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_8_80'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_8_81'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_8_82'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0):
+ return True, 'sell_profit_w_8_83'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_8_84'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_8_85'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['r_480'] < -75.0) and (last_candle['r_96_15m'] < -75.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_8_86'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_8_87'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_8_88'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_8_89'
+ elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_8_90'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cmf_15m'] < -0.25):
+ return True, 'sell_profit_w_8_91'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_8_92'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_8_93'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['r_32'] > -14.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_8_94'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_96'] > -14.0) and (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['cmf_1h'] > 0.3):
+ return True, 'sell_profit_w_8_95'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3):
+ return True, 'sell_profit_w_8_96'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['r_64'] > -8.0) and (last_candle['r_96'] > -8.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['rsi_14_1h'] < 60.0):
+ return True, 'sell_profit_w_8_97'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20_15m']):
+ return True, 'sell_profit_w_8_98'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0):
+ return True, 'sell_profit_w_8_99'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25):
+ return True, 'sell_profit_w_8_100'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_8_101'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_8_102'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_8_103'
+ elif (last_candle['r_96'] > -50.0) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -50.0):
+ return True, 'sell_profit_w_8_104'
+ elif (last_candle['r_14'] > -40.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_8_105'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_8_106'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['r_96'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['rsi_14_1h'] > 65.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_8_107'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_480'] > -30.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cmf_15m'] < -0.1):
+ return True, 'sell_profit_w_8_108'
+ elif (last_candle['r_480'] > -16.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_8_109'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_8_110'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_8_111'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_8_112'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_8_113'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['r_480'] > -1.2):
+ return True, 'sell_profit_w_9_1'
+ elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 75.0):
+ return True, 'sell_profit_w_9_2'
+ elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 46.0):
+ return True, 'sell_profit_w_9_3'
+ elif (last_candle['r_14'] >= -2.5) and (last_candle['rsi_14'] > 74.0):
+ return True, 'sell_profit_w_9_4'
+ elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 73.0):
+ return True, 'sell_profit_w_9_5'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 320.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_9_6'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_9_7'
+ elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.85):
+ return True, 'sell_profit_w_9_8'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 72.0):
+ return True, 'sell_profit_w_9_9'
+ elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 220.0):
+ return True, 'sell_profit_w_9_10'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 290.0):
+ return True, 'sell_profit_w_9_11'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 260.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_9_12'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_9_13'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 70.0):
+ return True, 'sell_profit_w_9_14'
+ elif (last_candle['r_14'] > -0.1) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_9_15'
+ elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 300.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_9_16'
+ elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_w_9_17'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_9_18'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_9_19'
+ elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_9_20'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_9_21'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_9_22'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_9_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['r_64_15m'] > -5.0):
+ return True, 'sell_profit_w_9_24'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_w_9_25'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_9_26'
+ elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_9_27'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 75.0):
+ return True, 'sell_profit_w_9_28'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_9_29'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85):
+ return True, 'sell_profit_w_9_30'
+ elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 280.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_9_31'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_9_32'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_9_33'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_9_34'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['r_480_1h'] > -15.0):
+ return True, 'sell_profit_w_9_35'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):
+ return True, 'sell_profit_w_9_36'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):
+ return True, 'sell_profit_w_9_37'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):
+ return True, 'sell_profit_w_9_38'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_9_39'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_64'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_9_40'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):
+ return True, 'sell_profit_w_9_41'
+ elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):
+ return True, 'sell_profit_w_9_42'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_9_43'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_9_44'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_9_45'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_9_46'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_9_47'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_9_48'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):
+ return True, 'sell_profit_w_9_49'
+ elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_9_50'
+ elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_9_51'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_w_9_52'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_9_53'
+ elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_9_54'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['r_14_15m'] > -20.0):
+ return True, 'sell_profit_w_9_55'
+ elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_9_56'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):
+ return True, 'sell_profit_w_9_57'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_9_58'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_9_59'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -6.0) and (last_candle['r_64'] > -6.0) and (last_candle['r_96'] > -6.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] > -30.0):
+ return True, 'sell_profit_w_9_60'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_9_61'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 200.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_9_62'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['r_480_1h'] > -25.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_w_9_63'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_9_64'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_9_65'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_9_66'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_9_67'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_9_68'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_9_69'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['r_96'] < -70.0) and (last_candle['r_14'] > -75.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_96_15m'] < -60.0):
+ return True, 'sell_profit_w_9_70'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_9_71'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_9_72'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 250.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_9_73'
+ elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_9_74'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_9_75'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_9_76'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_9_77'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_9_78'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_9_79'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_9_80'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_9_81'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_9_82'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0):
+ return True, 'sell_profit_w_9_83'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_9_84'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_9_85'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['r_480'] < -75.0) and (last_candle['r_96_15m'] < -75.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_9_86'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_9_87'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_9_88'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_9_89'
+ elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_9_90'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cmf_15m'] < -0.25):
+ return True, 'sell_profit_w_9_91'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_9_92'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_9_93'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['r_32'] > -14.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_9_94'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_96'] > -14.0) and (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 59.0) and (last_candle['cmf_1h'] > 0.3):
+ return True, 'sell_profit_w_9_95'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3):
+ return True, 'sell_profit_w_9_96'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['r_64'] > -8.0) and (last_candle['r_96'] > -8.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['rsi_14_1h'] < 60.0):
+ return True, 'sell_profit_w_9_97'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_15m']):
+ return True, 'sell_profit_w_9_98'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0):
+ return True, 'sell_profit_w_9_99'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25):
+ return True, 'sell_profit_w_9_100'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_9_101'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_9_102'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_9_103'
+ elif (last_candle['r_96'] > -50.0) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -50.0):
+ return True, 'sell_profit_w_9_104'
+ elif (last_candle['r_14'] > -40.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_9_105'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_9_106'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['r_96'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['rsi_14_1h'] > 65.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_9_107'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_480'] > -30.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_15m'] < -0.1):
+ return True, 'sell_profit_w_9_108'
+ elif (last_candle['r_480'] > -16.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_9_109'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_9_110'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_9_111'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_9_112'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 59.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_9_113'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['r_480'] > -1.0):
+ return True, 'sell_profit_w_10_1'
+ elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 76.0):
+ return True, 'sell_profit_w_10_2'
+ elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 44.0):
+ return True, 'sell_profit_w_10_3'
+ elif (last_candle['r_14'] >= -2.5) and (last_candle['rsi_14'] > 75.0):
+ return True, 'sell_profit_w_10_4'
+ elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 74.0):
+ return True, 'sell_profit_w_10_5'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 330.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_10_6'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_10_7'
+ elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9):
+ return True, 'sell_profit_w_10_8'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 74.0):
+ return True, 'sell_profit_w_10_9'
+ elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 240.0):
+ return True, 'sell_profit_w_10_10'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 300.0):
+ return True, 'sell_profit_w_10_11'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 270.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_10_12'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_10_13'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 71.0):
+ return True, 'sell_profit_w_10_14'
+ elif (last_candle['r_14'] > -0.1) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_10_15'
+ elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 310.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_10_16'
+ elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_w_10_17'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_10_18'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_10_19'
+ elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_10_20'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_10_21'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_10_22'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_10_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['r_64_15m'] > -5.0):
+ return True, 'sell_profit_w_10_24'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_w_10_25'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_10_26'
+ elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_10_27'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 76.0):
+ return True, 'sell_profit_w_10_28'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_10_29'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.85):
+ return True, 'sell_profit_w_10_30'
+ elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 300.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_10_31'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_10_32'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_10_33'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_10_34'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_480_1h'] > -15.0):
+ return True, 'sell_profit_w_10_35'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):
+ return True, 'sell_profit_w_10_36'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):
+ return True, 'sell_profit_w_10_37'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):
+ return True, 'sell_profit_w_10_38'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_10_39'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_64'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_10_40'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):
+ return True, 'sell_profit_w_10_41'
+ elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):
+ return True, 'sell_profit_w_10_42'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_10_43'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_10_44'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_10_45'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_10_46'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_10_47'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_10_48'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):
+ return True, 'sell_profit_w_10_49'
+ elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_10_50'
+ elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_10_51'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_w_10_52'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_10_53'
+ elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_10_54'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_14_15m'] > -20.0):
+ return True, 'sell_profit_w_10_55'
+ elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_10_56'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):
+ return True, 'sell_profit_w_10_57'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_10_58'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_10_59'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -6.0) and (last_candle['r_64'] > -6.0) and (last_candle['r_96'] > -6.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] > -30.0):
+ return True, 'sell_profit_w_10_60'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_10_61'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 200.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_10_62'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['r_480_1h'] > -25.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_w_10_63'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_10_64'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_10_65'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_10_66'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_10_67'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_10_68'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_10_69'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['r_96'] < -70.0) and (last_candle['r_14'] > -75.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_96_15m'] < -60.0):
+ return True, 'sell_profit_w_10_70'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_10_71'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_10_72'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 250.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_10_73'
+ elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_10_74'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_10_75'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_10_76'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_10_77'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_10_78'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_10_79'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_10_80'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_10_81'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_10_82'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0):
+ return True, 'sell_profit_w_10_83'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_10_84'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_10_85'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['r_480'] < -75.0) and (last_candle['r_96_15m'] < -75.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_10_86'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_10_87'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_10_88'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_10_89'
+ elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_10_90'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cmf_15m'] < -0.25):
+ return True, 'sell_profit_w_10_91'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_10_92'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_10_93'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['r_32'] > -14.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_10_94'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_96'] > -14.0) and (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cmf_1h'] > 0.3):
+ return True, 'sell_profit_w_10_95'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3):
+ return True, 'sell_profit_w_10_96'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['r_64'] > -8.0) and (last_candle['r_96'] > -8.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['rsi_14_1h'] < 60.0):
+ return True, 'sell_profit_w_10_97'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20_15m']):
+ return True, 'sell_profit_w_10_98'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0):
+ return True, 'sell_profit_w_10_99'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25):
+ return True, 'sell_profit_w_10_100'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_10_101'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_10_102'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_10_103'
+ elif (last_candle['r_96'] > -50.0) and (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -50.0):
+ return True, 'sell_profit_w_10_104'
+ elif (last_candle['r_14'] > -40.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_10_105'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_10_106'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['r_96'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['rsi_14_1h'] > 65.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_10_107'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_480'] > -30.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cmf_15m'] < -0.1):
+ return True, 'sell_profit_w_10_108'
+ elif (last_candle['r_480'] > -16.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_10_109'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_10_110'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_10_111'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_10_112'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_10_113'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['r_480'] > -0.5):
+ return True, 'sell_profit_w_11_1'
+ elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 77.0):
+ return True, 'sell_profit_w_11_2'
+ elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 42.0):
+ return True, 'sell_profit_w_11_3'
+ elif (last_candle['r_14'] >= -2.5) and (last_candle['rsi_14'] > 76.0):
+ return True, 'sell_profit_w_11_4'
+ elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 75.0):
+ return True, 'sell_profit_w_11_5'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 340.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_11_6'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_11_7'
+ elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):
+ return True, 'sell_profit_w_11_8'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 75.0):
+ return True, 'sell_profit_w_11_9'
+ elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 260.0):
+ return True, 'sell_profit_w_11_10'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 310.0):
+ return True, 'sell_profit_w_11_11'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 280.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_11_12'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_11_13'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 71.0):
+ return True, 'sell_profit_w_11_14'
+ elif (last_candle['r_14'] > -0.1) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_11_15'
+ elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 320.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_11_16'
+ elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_w_11_17'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_11_18'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_11_19'
+ elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.85) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_11_20'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_11_21'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_11_22'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_11_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['r_64_15m'] > -5.0):
+ return True, 'sell_profit_w_11_24'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_w_11_25'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_11_26'
+ elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_11_27'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 77.0):
+ return True, 'sell_profit_w_11_28'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_11_29'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.85):
+ return True, 'sell_profit_w_11_30'
+ elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 320.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_11_31'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_11_32'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_11_33'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_11_34'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['r_480_1h'] > -15.0):
+ return True, 'sell_profit_w_11_35'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):
+ return True, 'sell_profit_w_11_36'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):
+ return True, 'sell_profit_w_11_37'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -10.0):
+ return True, 'sell_profit_w_11_38'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_11_39'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_64'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_11_40'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):
+ return True, 'sell_profit_w_11_41'
+ elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):
+ return True, 'sell_profit_w_11_42'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_11_43'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_11_44'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_11_45'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_11_46'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_11_47'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_11_48'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):
+ return True, 'sell_profit_w_11_49'
+ elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_11_50'
+ elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_11_51'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_w_11_52'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_11_53'
+ elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_11_54'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['r_14_15m'] > -20.0):
+ return True, 'sell_profit_w_11_55'
+ elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_11_56'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):
+ return True, 'sell_profit_w_11_57'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_11_58'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_11_59'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -6.0) and (last_candle['r_64'] > -6.0) and (last_candle['r_96'] > -6.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] > -30.0):
+ return True, 'sell_profit_w_11_60'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_11_61'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 200.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_11_62'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['r_480_1h'] > -25.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_w_11_63'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_11_64'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_11_65'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_11_66'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_11_67'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_11_68'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_11_69'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['r_96'] < -70.0) and (last_candle['r_14'] > -75.0) and (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_96_15m'] < -60.0):
+ return True, 'sell_profit_w_11_70'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_11_71'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_11_72'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 250.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_11_73'
+ elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_11_74'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_11_75'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_11_76'
+ elif (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_11_77'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_11_78'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_11_79'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_11_80'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_11_81'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_11_82'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0):
+ return True, 'sell_profit_w_11_83'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_11_84'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_11_85'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['r_480'] < -75.0) and (last_candle['r_96_15m'] < -75.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_11_86'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_11_87'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_11_88'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_11_89'
+ elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_11_90'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cmf_15m'] < -0.25):
+ return True, 'sell_profit_w_11_91'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_11_92'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_11_93'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['r_32'] > -14.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_11_94'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_96'] > -14.0) and (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_1h'] > 0.3):
+ return True, 'sell_profit_w_11_95'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3):
+ return True, 'sell_profit_w_11_96'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['r_64'] > -8.0) and (last_candle['r_96'] > -8.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['rsi_14_1h'] < 60.0):
+ return True, 'sell_profit_w_11_97'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20_15m']):
+ return True, 'sell_profit_w_11_98'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0):
+ return True, 'sell_profit_w_11_99'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25):
+ return True, 'sell_profit_w_11_100'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_11_101'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_11_102'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_11_103'
+ elif (last_candle['r_96'] > -50.0) and (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -50.0):
+ return True, 'sell_profit_w_11_104'
+ elif (last_candle['r_14'] > -40.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_11_105'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_11_106'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['r_96'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['rsi_14_1h'] > 65.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_11_107'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_480'] > -30.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cmf_15m'] < -0.1):
+ return True, 'sell_profit_w_11_108'
+ elif (last_candle['r_480'] > -16.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_11_109'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_11_110'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_11_111'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_11_112'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_11_113'
+ elif current_profit >= 0.2:
+ if (last_candle['r_480'] > -0.4):
+ return True, 'sell_profit_w_12_1'
+ elif (last_candle['r_14'] >= -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 78.0):
+ return True, 'sell_profit_w_12_2'
+ elif (last_candle['r_14'] >= -2.0) and (last_candle['rsi_14'] < 40.0):
+ return True, 'sell_profit_w_12_3'
+ elif (last_candle['r_14'] >= -2.5) and (last_candle['rsi_14'] > 77.0):
+ return True, 'sell_profit_w_12_4'
+ elif (last_candle['r_14'] >= -2.0) and (last_candle['r_32'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 76.0):
+ return True, 'sell_profit_w_12_5'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 360.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_12_6'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_12_7'
+ elif (last_candle['r_14'] >= -5.0) and (last_candle['r_96'] >= -3.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9):
+ return True, 'sell_profit_w_12_8'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_24'] == 0.0) and (last_candle['rsi_14'] > 76.0):
+ return True, 'sell_profit_w_12_9'
+ elif (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.85) and (last_candle['cci'] > 280.0):
+ return True, 'sell_profit_w_12_10'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 320.0):
+ return True, 'sell_profit_w_12_11'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 290.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_12_12'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_12_13'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 71.0):
+ return True, 'sell_profit_w_12_14'
+ elif (last_candle['r_14'] > -0.1) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_12_15'
+ elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 330.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_12_16'
+ elif (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_w_12_17'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.96) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_12_18'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_12_19'
+ elif (last_candle['r_64'] > -20.0) and (last_candle['r_96'] > -15.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.85) and (last_candle['r_64_15m'] > -15.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_12_20'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['btc_not_downtrend_1h'] == False) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_12_21'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] < -55.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_12_22'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_12_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['r_64_15m'] > -5.0):
+ return True, 'sell_profit_w_12_24'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_w_12_25'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_12_26'
+ elif (last_candle ['r_14'] > -3.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_12_27'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] == 0.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 78.0):
+ return True, 'sell_profit_w_12_28'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_12_29'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.85):
+ return True, 'sell_profit_w_12_30'
+ elif (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 340.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_12_31'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 260.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_12_32'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_12_33'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['r_64'] > -4.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 220.0) and (last_candle['r_14_15m'] > -4.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_12_34'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['r_480_1h'] > -15.0):
+ return True, 'sell_profit_w_12_35'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_64'] > -4.0) and (last_candle['r_96'] > -4.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):
+ return True, 'sell_profit_w_12_36'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cti'] > 0.9) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20']):
+ return True, 'sell_profit_w_12_37'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.9) and (last_candle['r_64_15m'] > -5.0):
+ return True, 'sell_profit_w_12_38'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cti'] > 0.85) and (last_candle['cmf_1h'] < -0.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_12_39'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_64'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_12_40'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0) and (last_candle['close'] < last_candle['ema_200']):
+ return True, 'sell_profit_w_12_41'
+ elif (last_candle['r_480'] < -75.0) and (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -85.0):
+ return True, 'sell_profit_w_12_42'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_12_43'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 200.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_12_44'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_12_45'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_12_46'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_14_15m'] > -5.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_12_47'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_64'] > -12.0) and (last_candle['r_96'] > -12.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_12_48'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -20.0) and (last_candle['ema_vwma_osc_96'] < -0.0):
+ return True, 'sell_profit_w_12_49'
+ elif (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_12_50'
+ elif (last_candle['r_96'] < -75.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_12_51'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_w_12_52'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_12_53'
+ elif (last_candle['r_96'] > -25.0) and (last_candle['rsi_14'] > 79.0) and (last_candle['cci'] > 280.0) and (last_candle['sma_200_dec_20']) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_12_54'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['r_96'] > -1.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['r_14_15m'] > -20.0):
+ return True, 'sell_profit_w_12_55'
+ elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['rsi_14_1h'] > 70.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_12_56'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] > -20.0) and (last_candle['rsi_14_1h'] > 50.0):
+ return True, 'sell_profit_w_12_57'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.8) and (last_candle['cmf_1h'] < -0.2) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_12_58'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_32'] > -1.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_12_59'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -6.0) and (last_candle['r_64'] > -6.0) and (last_candle['r_96'] > -6.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] > -30.0):
+ return True, 'sell_profit_w_12_60'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_32'] > -3.0) and (last_candle['r_96'] > -3.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_12_61'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 200.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_12_62'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['r_32'] > -4.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['r_480_1h'] > -25.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_w_12_63'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_12_64'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0):
+ return True, 'sell_profit_w_12_65'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_12_66'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_w_12_67'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_12_68'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_12_69'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['r_96'] < -70.0) and (last_candle['r_14'] > -75.0) and (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3) and (last_candle['r_96_15m'] < -60.0):
+ return True, 'sell_profit_w_12_70'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_12_71'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_w_12_72'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['r_32'] > -5.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cci'] > 250.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_12_73'
+ elif (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_12_74'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 77.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_w_12_75'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['r_64'] > -1.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_12_76'
+ elif (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_12_77'
+ elif (last_candle['r_14'] > -6.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.2) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_12_78'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_12_79'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_12_80'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_12_81'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_12_82'
+ elif (last_candle['r_14'] > -2.0) and (last_candle['r_64'] > -2.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0):
+ return True, 'sell_profit_w_12_83'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_12_84'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_12_85'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['r_480'] < -75.0) and (last_candle['r_96_15m'] < -75.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_12_86'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_w_12_87'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['cci'] > 240.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_w_12_88'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_12_89'
+ elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_12_90'
+ elif (last_candle['r_14'] == 0.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cmf_15m'] < -0.25):
+ return True, 'sell_profit_w_12_91'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_w_12_92'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_w_12_93'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['r_32'] > -14.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_12_94'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['r_96'] > -14.0) and (last_candle['r_480'] > -10.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cmf_1h'] > 0.3):
+ return True, 'sell_profit_w_12_95'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.3):
+ return True, 'sell_profit_w_12_96'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['r_64'] > -8.0) and (last_candle['r_96'] > -8.0) and (last_candle['rsi_14'] > 81.0) and (last_candle['rsi_14_1h'] < 60.0):
+ return True, 'sell_profit_w_12_97'
+ elif (last_candle['r_14'] > -5.0) and (last_candle['r_64'] > -5.0) and (last_candle['r_96'] > -5.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20_15m']):
+ return True, 'sell_profit_w_12_98'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['r_480'] > -25.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] > 60.0):
+ return True, 'sell_profit_w_12_99'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25):
+ return True, 'sell_profit_w_12_100'
+ elif (last_candle['r_14'] > -14.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_12_101'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['rsi_14'] > 76.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_12_102'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['r_64'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_w_12_103'
+ elif (last_candle['r_96'] > -50.0) and (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] > -50.0):
+ return True, 'sell_profit_w_12_104'
+ elif (last_candle['r_14'] > -40.0) and (last_candle['rsi_14'] > 81.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_w_12_105'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_12_106'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_64'] > -10.0) and (last_candle['r_96'] > -10.0) and (last_candle['rsi_14'] > 78.0) and (last_candle['rsi_14_1h'] > 65.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_12_107'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_480'] > -30.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cmf_15m'] < -0.1):
+ return True, 'sell_profit_w_12_108'
+ elif (last_candle['r_480'] > -16.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.1) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_12_109'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_96'] > -20.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_12_110'
+ elif (last_candle['r_14'] > -1.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_w_12_111'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_w_12_112'
+ elif (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_w_12_113'
+
+ return False, None
+
+ def sell_trail(self, current_profit: float, max_profit: float, max_loss: float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:
+ if 0.02 > current_profit >= 0.01:
+ if (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 50.0) and (last_candle['rsi_14'] < previous_candle_1['rsi_14']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_t_1_1'
+ elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 50.0):
+ return True, 'sell_profit_t_1_2'
+ elif 0.03 > current_profit >= 0.02:
+ if (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 50.0) and (last_candle['rsi_14'] < previous_candle_1['rsi_14']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_t_2_1'
+ elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 50.0):
+ return True, 'sell_profit_t_2_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 50.0) and (last_candle['rsi_14'] < previous_candle_1['rsi_14']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_t_3_1'
+ elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 50.0):
+ return True, 'sell_profit_t_3_2'
+ elif 0.05 > current_profit >= 0.04:
+ if (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 50.0) and (last_candle['rsi_14'] < previous_candle_1['rsi_14']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_t_4_1'
+ elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 50.0):
+ return True, 'sell_profit_t_4_2'
+ elif 0.06 > current_profit >= 0.05:
+ if (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 50.0) and (last_candle['rsi_14'] < previous_candle_1['rsi_14']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_t_5_1'
+ elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 50.0):
+ return True, 'sell_profit_t_5_2'
+ elif 0.07 > current_profit >= 0.06:
+ if (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 50.0) and (last_candle['rsi_14'] < previous_candle_1['rsi_14']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_t_6_1'
+ elif (max_profit > (current_profit + 0.04)) and (last_candle['rsi_14'] < 50.0):
+ return True, 'sell_profit_t_6_2'
+ elif 0.08 > current_profit >= 0.07:
+ if (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 50.0) and (last_candle['rsi_14'] < previous_candle_1['rsi_14']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_t_7_1'
+ elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 50.0):
+ return True, 'sell_profit_t_7_2'
+ elif 0.09 > current_profit >= 0.08:
+ if (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 50.0) and (last_candle['rsi_14'] < previous_candle_1['rsi_14']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_t_8_1'
+ elif (max_profit > (current_profit + 0.05)) and (last_candle['rsi_14'] < 50.0):
+ return True, 'sell_profit_t_8_2'
+ elif 0.1 > current_profit >= 0.09:
+ if (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 50.0) and (last_candle['rsi_14'] < previous_candle_1['rsi_14']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_t_9_1'
+ elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 50.0):
+ return True, 'sell_profit_t_9_2'
+ elif 0.12 > current_profit >= 0.1:
+ if (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 50.0) and (last_candle['rsi_14'] < previous_candle_1['rsi_14']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_t_10_1'
+ elif (max_profit > (current_profit + 0.06)) and (last_candle['rsi_14'] < 50.0):
+ return True, 'sell_profit_t_10_2'
+ elif 0.2 > current_profit >= 0.12:
+ if (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 50.0) and (last_candle['rsi_14'] < previous_candle_1['rsi_14']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_t_11_1'
+ elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 50.0):
+ return True, 'sell_profit_t_11_2'
+ elif current_profit >= 0.2:
+ if (max_profit > (current_profit + 0.03)) and (last_candle['rsi_14'] < 50.0) and (last_candle['rsi_14'] < previous_candle_1['rsi_14']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_t_12_1'
+ elif (max_profit > (current_profit + 0.07)) and (last_candle['rsi_14'] < 50.0):
+ return True, 'sell_profit_t_12_2'
+
+ return False, None
+
+ def sell_dec_main(self, current_profit: float, last_candle) -> tuple:
+ if (last_candle['close'] > last_candle['ema_200']):
+ if 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cti'] < -0.75):
+ return True, 'sell_profit_d_o_1_1'
+ elif (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_o_1_2'
+ elif (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_o_1_3'
+ elif (last_candle['rsi_14'] > 78.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_o_1_4'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):
+ return True, 'sell_profit_d_o_1_5'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_15m'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_1_6'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_1_7'
+ elif (last_candle['rsi_14'] > 70.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):
+ return True, 'sell_profit_d_o_1_8'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):
+ return True, 'sell_profit_d_o_1_9'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):
+ return True, 'sell_profit_d_o_1_10'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_d_o_1_11'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_d_o_1_12'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):
+ return True, 'sell_profit_d_o_1_13'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_o_1_14'
+ elif (last_candle['rsi_14'] > 66.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_o_1_15'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_o_1_16'
+ elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_d_o_1_17'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_d_o_1_18'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_1_19'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_1_20'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_1_21'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_1_22'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 30.0):
+ return True, 'sell_profit_d_o_1_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_1_24'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_d_o_1_25'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_1_26'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):
+ return True, 'sell_profit_d_o_1_27'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_o_1_28'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_o_1_29'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_1_30'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):
+ return True, 'sell_profit_d_o_1_31'
+ elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):
+ return True, 'sell_profit_d_o_1_32'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_o_1_33'
+ elif (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_d_o_1_34'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_o_1_35'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_1_36'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_1_37'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] > last_candle['pivot_1d']) and (last_candle['r_96_15m'] > -40.0):
+ return True, 'sell_profit_d_o_1_38'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_1_39'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_o_1_40'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['hl_pct_change_48_1h'] > 1.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_d_o_1_41'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cti'] > 0.5):
+ return True, 'sell_profit_d_o_2_1'
+ elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_2_2'
+ elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_o_2_3'
+ elif (last_candle['rsi_14'] > 77.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_o_2_4'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):
+ return True, 'sell_profit_d_o_2_5'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_2_6'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_2_7'
+ elif (last_candle['rsi_14'] > 65.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):
+ return True, 'sell_profit_d_o_2_8'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):
+ return True, 'sell_profit_d_o_2_9'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):
+ return True, 'sell_profit_d_o_2_10'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_d_o_2_11'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_d_o_2_12'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):
+ return True, 'sell_profit_d_o_2_13'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_o_2_14'
+ elif (last_candle['rsi_14'] > 65.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_o_2_15'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_o_2_16'
+ elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_d_o_2_17'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_d_o_2_18'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_2_19'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_2_20'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_2_21'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_2_22'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 30.0):
+ return True, 'sell_profit_d_o_2_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_2_24'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_d_o_2_25'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_2_26'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):
+ return True, 'sell_profit_d_o_2_27'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_o_2_28'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_o_2_29'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_2_30'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):
+ return True, 'sell_profit_d_o_2_31'
+ elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):
+ return True, 'sell_profit_d_o_2_32'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_o_2_33'
+ elif (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_d_o_2_34'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_o_2_35'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_2_36'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_2_37'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] > last_candle['pivot_1d']) and (last_candle['r_96_15m'] > -40.0):
+ return True, 'sell_profit_d_o_2_38'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_2_39'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_o_2_40'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['hl_pct_change_48_1h'] > 1.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_d_o_2_41'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cti'] > 0.4):
+ return True, 'sell_profit_d_o_3_1'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 42.0):
+ return True, 'sell_profit_d_u_3_2'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_o_3_3'
+ elif (last_candle['rsi_14'] > 76.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_o_3_4'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):
+ return True, 'sell_profit_d_o_3_5'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_3_6'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_3_7'
+ elif (last_candle['rsi_14'] > 64.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):
+ return True, 'sell_profit_d_o_3_8'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):
+ return True, 'sell_profit_d_o_3_9'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):
+ return True, 'sell_profit_d_o_3_10'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_d_o_3_11'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_d_o_3_12'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):
+ return True, 'sell_profit_d_o_3_13'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_o_3_14'
+ elif (last_candle['rsi_14'] > 64.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_o_3_15'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_o_3_16'
+ elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_d_o_3_17'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_d_o_3_18'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_3_19'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_3_20'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_3_21'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_3_22'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 32.0):
+ return True, 'sell_profit_d_o_3_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_3_24'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_d_o_3_25'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_3_26'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):
+ return True, 'sell_profit_d_o_3_27'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_o_3_28'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_o_3_29'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_3_30'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):
+ return True, 'sell_profit_d_o_3_31'
+ elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):
+ return True, 'sell_profit_d_o_3_32'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_o_3_33'
+ elif (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_d_o_3_34'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_o_3_35'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_3_36'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_3_37'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] > last_candle['pivot_1d']) and (last_candle['r_96_15m'] > -40.0):
+ return True, 'sell_profit_d_o_3_38'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_3_39'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_o_3_40'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['hl_pct_change_48_1h'] > 1.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_d_o_3_41'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < 0.05) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['cti'] > 0.3):
+ return True, 'sell_profit_d_o_4_1'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 44.0):
+ return True, 'sell_profit_d_o_4_2'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_o_4_3'
+ elif (last_candle['rsi_14'] > 75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_o_4_4'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):
+ return True, 'sell_profit_d_o_4_5'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_4_6'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_4_7'
+ elif (last_candle['rsi_14'] > 63.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):
+ return True, 'sell_profit_d_o_4_8'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):
+ return True, 'sell_profit_d_o_4_9'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):
+ return True, 'sell_profit_d_o_4_10'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_d_o_4_11'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_d_o_4_12'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):
+ return True, 'sell_profit_d_o_4_13'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_o_4_14'
+ elif (last_candle['rsi_14'] > 63.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_o_4_15'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_o_4_16'
+ elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_d_o_4_17'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_d_o_4_18'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_4_19'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_4_20'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_4_21'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_4_22'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 32.0):
+ return True, 'sell_profit_d_o_4_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_4_24'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_d_o_4_25'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_4_26'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):
+ return True, 'sell_profit_d_o_4_27'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_o_4_28'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_o_4_29'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_4_30'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):
+ return True, 'sell_profit_d_o_4_31'
+ elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):
+ return True, 'sell_profit_d_o_4_32'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_o_4_33'
+ elif (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_d_o_4_34'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_o_4_35'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_4_36'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_4_37'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] > last_candle['pivot_1d']) and (last_candle['r_96_15m'] > -40.0):
+ return True, 'sell_profit_d_o_4_38'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_4_39'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_o_4_40'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['hl_pct_change_48_1h'] > 1.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_d_o_4_41'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['cti'] > 0.4):
+ return True, 'sell_profit_d_o_5_1'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 46.0):
+ return True, 'sell_profit_d_o_5_2'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_o_5_3'
+ elif (last_candle['rsi_14'] > 74.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_o_5_4'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):
+ return True, 'sell_profit_d_o_5_5'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_5_6'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_5_7'
+ elif (last_candle['rsi_14'] > 62.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):
+ return True, 'sell_profit_d_o_5_8'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):
+ return True, 'sell_profit_d_o_5_9'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):
+ return True, 'sell_profit_d_o_5_10'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_d_o_5_11'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_d_o_5_12'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):
+ return True, 'sell_profit_d_o_5_13'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_o_5_14'
+ elif (last_candle['rsi_14'] > 62.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_o_5_15'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_o_5_16'
+ elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_d_o_5_17'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_d_o_5_18'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_5_19'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_5_20'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_5_21'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_5_22'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_5_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_5_24'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_d_o_5_25'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_5_26'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):
+ return True, 'sell_profit_d_o_5_27'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_o_5_28'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_o_5_29'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_5_30'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):
+ return True, 'sell_profit_d_o_5_31'
+ elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):
+ return True, 'sell_profit_d_o_5_32'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_o_5_33'
+ elif (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_d_o_5_34'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_o_5_35'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_5_36'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_5_37'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] > last_candle['pivot_1d']) and (last_candle['r_96_15m'] > -40.0):
+ return True, 'sell_profit_d_o_5_38'
+ elif (last_candle['rsi_14'] < 51.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_5_39'
+ elif (last_candle['rsi_14'] < 51.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_o_5_40'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['hl_pct_change_48_1h'] > 1.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_d_o_5_41'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 48.0) and (last_candle['cti'] > 0.5):
+ return True, 'sell_profit_d_o_6_1'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 44.0):
+ return True, 'sell_profit_d_o_6_2'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_o_6_3'
+ elif (last_candle['rsi_14'] > 75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_o_6_4'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):
+ return True, 'sell_profit_d_o_6_5'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_6_6'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_6_7'
+ elif (last_candle['rsi_14'] > 63.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):
+ return True, 'sell_profit_d_o_6_8'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):
+ return True, 'sell_profit_d_o_6_9'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):
+ return True, 'sell_profit_d_o_6_10'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_d_o_6_11'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_d_o_6_12'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):
+ return True, 'sell_profit_d_o_6_13'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_o_6_14'
+ elif (last_candle['rsi_14'] > 63.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_o_6_15'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_o_6_16'
+ elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_d_o_6_17'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_d_o_6_18'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_6_19'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_6_20'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_6_21'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_6_22'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_6_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_6_24'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_d_o_6_25'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_6_26'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):
+ return True, 'sell_profit_d_o_6_27'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_o_6_28'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_o_6_29'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_6_30'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):
+ return True, 'sell_profit_d_o_6_31'
+ elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):
+ return True, 'sell_profit_d_o_6_32'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_o_6_33'
+ elif (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_d_o_6_34'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_o_6_35'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_6_36'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_6_37'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] > last_candle['pivot_1d']) and (last_candle['r_96_15m'] > -40.0):
+ return True, 'sell_profit_d_o_6_38'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_6_39'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_o_6_40'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['hl_pct_change_48_1h'] > 1.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_d_o_6_41'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 46.0) and (last_candle['cti'] > 0.5):
+ return True, 'sell_profit_d_o_7_1'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 42.0):
+ return True, 'sell_profit_d_o_7_2'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_o_7_3'
+ elif (last_candle['rsi_14'] > 76.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_o_7_4'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):
+ return True, 'sell_profit_d_o_7_5'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_7_6'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_7_7'
+ elif (last_candle['rsi_14'] > 64.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):
+ return True, 'sell_profit_d_o_7_8'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):
+ return True, 'sell_profit_d_o_7_9'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):
+ return True, 'sell_profit_d_o_7_10'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_d_o_7_11'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_d_o_7_12'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):
+ return True, 'sell_profit_d_o_7_13'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_o_7_14'
+ elif (last_candle['rsi_14'] > 64.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_o_7_15'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_o_7_16'
+ elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_d_o_7_17'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_d_o_7_18'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_7_19'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_7_20'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_7_21'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_7_22'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_7_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_7_24'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_d_o_7_25'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_7_26'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):
+ return True, 'sell_profit_d_o_7_27'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_o_7_28'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_o_7_29'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_7_30'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):
+ return True, 'sell_profit_d_o_7_31'
+ elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):
+ return True, 'sell_profit_d_o_7_32'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_o_7_33'
+ elif (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_d_o_7_34'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_o_7_35'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_7_36'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_7_37'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] > last_candle['pivot_1d']) and (last_candle['r_96_15m'] > -40.0):
+ return True, 'sell_profit_d_o_7_38'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_7_39'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_o_7_40'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['hl_pct_change_48_1h'] > 1.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_d_o_7_41'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 44.0) and (last_candle['cti_1h'] > 0.5):
+ return True, 'sell_profit_d_o_8_1'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_8_2'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_o_8_3'
+ elif (last_candle['rsi_14'] > 77.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_o_8_4'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):
+ return True, 'sell_profit_d_o_8_5'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_8_6'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_8_7'
+ elif (last_candle['rsi_14'] > 65.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):
+ return True, 'sell_profit_d_o_8_8'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):
+ return True, 'sell_profit_d_o_8_9'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):
+ return True, 'sell_profit_d_o_8_10'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_d_o_8_11'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_d_o_8_12'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):
+ return True, 'sell_profit_d_o_8_13'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_o_8_14'
+ elif (last_candle['rsi_14'] > 65.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_o_8_15'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_o_8_16'
+ elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_d_o_8_17'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_d_o_8_18'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_8_19'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_8_20'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_8_21'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_8_22'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_8_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_8_24'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_d_o_8_25'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_8_26'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):
+ return True, 'sell_profit_d_o_8_27'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_o_8_28'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_o_8_29'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_8_30'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):
+ return True, 'sell_profit_d_o_8_31'
+ elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):
+ return True, 'sell_profit_d_o_8_32'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_o_8_33'
+ elif (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_d_o_8_34'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_o_8_35'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_8_36'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_8_37'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] > last_candle['pivot_1d']) and (last_candle['r_96_15m'] > -40.0):
+ return True, 'sell_profit_d_o_8_38'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_8_39'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_o_8_40'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['hl_pct_change_48_1h'] > 1.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_d_o_8_41'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 42.0) and (last_candle['cti'] > 0.5):
+ return True, 'sell_profit_d_o_9_1'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_o_9_2'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_o_9_3'
+ elif (last_candle['rsi_14'] > 78.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_o_9_4'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):
+ return True, 'sell_profit_d_o_9_5'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_15m'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_9_6'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_9_7'
+ elif (last_candle['rsi_14'] > 66.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):
+ return True, 'sell_profit_d_o_9_8'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):
+ return True, 'sell_profit_d_o_9_9'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):
+ return True, 'sell_profit_d_o_9_10'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_d_o_9_11'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_d_o_9_12'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):
+ return True, 'sell_profit_d_o_9_13'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_o_9_14'
+ elif (last_candle['rsi_14'] > 66.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_o_9_15'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_o_9_16'
+ elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_d_o_9_17'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_d_o_9_18'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_9_19'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_9_20'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_9_21'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_9_22'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_9_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_9_24'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_d_o_9_25'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_9_26'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):
+ return True, 'sell_profit_d_o_9_27'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_o_9_28'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_o_9_29'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_9_30'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):
+ return True, 'sell_profit_d_o_9_31'
+ elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):
+ return True, 'sell_profit_d_o_9_32'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_o_9_33'
+ elif (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_d_o_9_34'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_o_9_35'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_9_36'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_9_37'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] > last_candle['pivot_1d']) and (last_candle['r_96_15m'] > -40.0):
+ return True, 'sell_profit_d_o_9_38'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_9_39'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_o_9_40'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['hl_pct_change_48_1h'] > 1.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_d_o_9_41'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['cti'] > 0.5):
+ return True, 'sell_profit_d_o_10_1'
+ elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 36.0):
+ return True, 'sell_profit_d_o_10_2'
+ elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_o_10_3'
+ elif (last_candle['rsi_14'] > 79.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_o_10_4'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):
+ return True, 'sell_profit_d_o_10_5'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_10_6'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_10_7'
+ elif (last_candle['rsi_14'] > 67.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):
+ return True, 'sell_profit_d_o_10_8'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):
+ return True, 'sell_profit_d_o_10_9'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):
+ return True, 'sell_profit_d_o_10_10'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_d_o_10_11'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_d_o_10_12'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):
+ return True, 'sell_profit_d_o_10_13'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_o_10_14'
+ elif (last_candle['rsi_14'] > 67.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_o_10_15'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_o_10_16'
+ elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_d_o_10_17'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_d_o_10_18'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_10_19'
+ elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_10_20'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_10_21'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_10_22'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_10_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_10_24'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_d_o_10_25'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_10_26'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):
+ return True, 'sell_profit_d_o_10_27'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_o_10_28'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_o_10_29'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_10_30'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):
+ return True, 'sell_profit_d_o_10_31'
+ elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):
+ return True, 'sell_profit_d_o_10_32'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_o_10_33'
+ elif (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_d_o_10_34'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_o_10_35'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_10_36'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_10_37'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] > last_candle['pivot_1d']) and (last_candle['r_96_15m'] > -40.0):
+ return True, 'sell_profit_d_o_10_38'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_10_39'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_o_10_40'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['hl_pct_change_48_1h'] > 1.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_d_o_10_41'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['cti'] > 0.5):
+ return True, 'sell_profit_d_o_11_1'
+ elif (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 34.0):
+ return True, 'sell_profit_d_o_11_2'
+ elif (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 33.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_o_11_3'
+ elif (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_o_11_4'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):
+ return True, 'sell_profit_d_o_11_5'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['rsi_14_15m'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_11_6'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_15m'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_11_7'
+ elif (last_candle['rsi_14'] > 68.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):
+ return True, 'sell_profit_d_o_11_8'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):
+ return True, 'sell_profit_d_o_11_9'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):
+ return True, 'sell_profit_d_o_11_10'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_d_o_11_11'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_d_o_11_12'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):
+ return True, 'sell_profit_d_o_11_13'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_o_11_14'
+ elif (last_candle['rsi_14'] > 68.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_o_11_15'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_o_11_16'
+ elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_d_o_11_17'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_d_o_11_18'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_11_19'
+ elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_11_20'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_11_21'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_11_22'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_11_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_11_24'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_d_o_11_25'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_11_26'
+ elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):
+ return True, 'sell_profit_d_o_11_27'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_o_11_28'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_o_11_29'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_11_30'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):
+ return True, 'sell_profit_d_o_11_31'
+ elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):
+ return True, 'sell_profit_d_o_11_32'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_o_11_33'
+ elif (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_d_o_11_34'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_o_11_35'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_11_36'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_11_37'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] > last_candle['pivot_1d']) and (last_candle['r_96_15m'] > -40.0):
+ return True, 'sell_profit_d_o_11_38'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_11_39'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_o_11_40'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['hl_pct_change_48_1h'] > 1.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_d_o_11_41'
+ elif current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['cti'] > 0.5):
+ return True, 'sell_profit_d_o_12_1'
+ elif (last_candle['rsi_14'] < 35.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 32.0):
+ return True, 'sell_profit_d_o_12_2'
+ elif (last_candle['rsi_14'] < 35.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 32.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_o_12_3'
+ elif (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_o_12_4'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):
+ return True, 'sell_profit_d_o_12_5'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['rsi_14_15m'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_12_6'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_15m'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_12_7'
+ elif (last_candle['rsi_14'] > 69.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):
+ return True, 'sell_profit_d_o_12_8'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):
+ return True, 'sell_profit_d_o_12_9'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):
+ return True, 'sell_profit_d_o_12_10'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_d_o_12_11'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_d_o_12_12'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):
+ return True, 'sell_profit_d_o_12_13'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_o_12_14'
+ elif (last_candle['rsi_14'] > 69.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_o_12_15'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_o_12_16'
+ elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_d_o_12_17'
+ elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_d_o_12_18'
+ elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_o_12_19'
+ elif (last_candle['rsi_14'] < 36.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_12_20'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 75.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_12_21'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_12_22'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_o_12_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_12_24'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_d_o_12_25'
+ elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_12_26'
+ elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):
+ return True, 'sell_profit_d_o_12_27'
+ elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_o_12_28'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 74.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_o_12_29'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_o_12_30'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):
+ return True, 'sell_profit_d_o_12_31'
+ elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):
+ return True, 'sell_profit_d_o_12_32'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_o_12_33'
+ elif (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_d_o_12_34'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_o_12_35'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_12_36'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_12_37'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] > last_candle['pivot_1d']) and (last_candle['r_96_15m'] > -40.0):
+ return True, 'sell_profit_d_o_12_38'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_o_12_39'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_o_12_40'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['hl_pct_change_48_1h'] > 1.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_d_o_12_41'
+ else:
+ if 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 35.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['cti_1h'] < -0.85):
+ return True, 'sell_profit_d_u_1_1'
+ elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 42.0):
+ return True, 'sell_profit_d_u_1_2'
+ elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_u_1_3'
+ elif (last_candle['rsi_14'] > 77.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_u_1_4'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):
+ return True, 'sell_profit_d_u_1_5'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_1_6'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_1_7'
+ elif (last_candle['rsi_14'] > 68.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):
+ return True, 'sell_profit_d_u_1_8'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):
+ return True, 'sell_profit_d_u_1_9'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):
+ return True, 'sell_profit_d_u_1_10'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_d_u_1_11'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 59.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_d_u_1_12'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):
+ return True, 'sell_profit_d_u_1_13'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_u_1_14'
+ elif (last_candle['rsi_14'] > 63.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_u_1_15'
+ elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_u_1_16'
+ elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_d_u_1_17'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_d_u_1_18'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_1_19'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_1_20'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_1_21'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_1_22'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 30.0):
+ return True, 'sell_profit_d_u_1_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_1_24'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_d_u_1_25'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_1_26'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):
+ return True, 'sell_profit_d_u_1_27'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_u_1_28'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_u_1_29'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_1_30'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):
+ return True, 'sell_profit_d_u_1_31'
+ elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):
+ return True, 'sell_profit_d_u_1_32'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_u_1_33'
+ elif (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_d_u_1_34'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_u_1_35'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_1_36'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_1_37'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] > last_candle['pivot_1d']) and (last_candle['r_96_15m'] > -40.0):
+ return True, 'sell_profit_d_u_1_38'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_1_39'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_u_1_40'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['hl_pct_change_48_1h'] > 1.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_d_u_1_41'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['cti_1h'] < -0.85):
+ return True, 'sell_profit_d_u_2_1'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 44.0):
+ return True, 'sell_profit_d_u_2_2'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_u_2_3'
+ elif (last_candle['rsi_14'] > 76.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_u_2_4'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):
+ return True, 'sell_profit_d_u_2_5'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_2_6'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_2_7'
+ elif (last_candle['rsi_14'] > 62.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):
+ return True, 'sell_profit_d_u_2_8'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):
+ return True, 'sell_profit_d_u_2_9'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):
+ return True, 'sell_profit_d_u_2_10'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_d_u_2_11'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_d_u_2_12'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):
+ return True, 'sell_profit_d_u_2_13'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_u_2_14'
+ elif (last_candle['rsi_14'] > 62.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_u_2_15'
+ elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_u_2_16'
+ elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_d_u_2_17'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_d_u_2_18'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_2_19'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_2_20'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_2_21'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_2_22'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 30.0):
+ return True, 'sell_profit_d_u_2_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_2_24'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_d_u_2_25'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_2_26'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):
+ return True, 'sell_profit_d_u_2_27'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_u_2_28'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_u_2_29'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_2_30'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):
+ return True, 'sell_profit_d_u_2_31'
+ elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):
+ return True, 'sell_profit_d_u_2_32'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_u_2_33'
+ elif (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_d_u_2_34'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_u_2_35'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_2_36'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_2_37'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] > last_candle['pivot_1d']) and (last_candle['r_96_15m'] > -40.0):
+ return True, 'sell_profit_d_u_2_38'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_2_39'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_u_2_40'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['hl_pct_change_48_1h'] > 1.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_d_u_2_41'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 39.5) and (last_candle['cti_1h'] < -0.85):
+ return True, 'sell_profit_d_u_3_1'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 46.0):
+ return True, 'sell_profit_d_u_3_2'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_u_3_3'
+ elif (last_candle['rsi_14'] > 75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_u_3_4'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):
+ return True, 'sell_profit_d_u_3_5'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_3_6'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_3_7'
+ elif (last_candle['rsi_14'] > 61.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):
+ return True, 'sell_profit_d_u_3_8'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):
+ return True, 'sell_profit_d_u_3_9'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):
+ return True, 'sell_profit_d_u_3_10'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_d_u_3_11'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 57.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_d_u_3_12'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):
+ return True, 'sell_profit_d_u_3_13'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_u_3_14'
+ elif (last_candle['rsi_14'] > 61.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_u_3_15'
+ elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_u_3_16'
+ elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_d_u_3_17'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_d_u_3_18'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_3_19'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_3_20'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_3_21'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_3_22'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 32.0):
+ return True, 'sell_profit_d_u_3_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_3_24'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_d_u_3_25'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_3_26'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):
+ return True, 'sell_profit_d_u_3_27'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_u_3_28'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_u_3_29'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_3_30'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):
+ return True, 'sell_profit_d_u_3_31'
+ elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):
+ return True, 'sell_profit_d_u_3_32'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_u_3_33'
+ elif (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_d_u_3_34'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_u_3_35'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_3_36'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_3_37'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] > last_candle['pivot_1d']) and (last_candle['r_96_15m'] > -40.0):
+ return True, 'sell_profit_d_u_3_38'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_3_39'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_u_3_40'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['hl_pct_change_48_1h'] > 1.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_d_u_3_41'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 40.0) and (last_candle['cti_1h'] < -0.85):
+ return True, 'sell_profit_d_u_4_1'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 46.0):
+ return True, 'sell_profit_d_u_4_2'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_u_4_3'
+ elif (last_candle['rsi_14'] > 74.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_u_4_4'
+ elif (last_candle['rsi_14'] < 51.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):
+ return True, 'sell_profit_d_u_4_5'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_4_6'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_4_7'
+ elif (last_candle['rsi_14'] > 60.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):
+ return True, 'sell_profit_d_u_4_8'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):
+ return True, 'sell_profit_d_u_4_9'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):
+ return True, 'sell_profit_d_u_4_10'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_d_u_4_11'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 56.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_d_u_4_12'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):
+ return True, 'sell_profit_d_u_4_13'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_u_4_14'
+ elif (last_candle['rsi_14'] > 60.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_u_4_15'
+ elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_u_4_16'
+ elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_d_u_4_17'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_d_u_4_18'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_4_19'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_4_20'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_4_21'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_4_22'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 32.0):
+ return True, 'sell_profit_d_u_4_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_4_24'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_d_u_4_25'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_4_26'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):
+ return True, 'sell_profit_d_u_4_27'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_u_4_28'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_u_4_29'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_4_30'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):
+ return True, 'sell_profit_d_u_4_31'
+ elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):
+ return True, 'sell_profit_d_u_4_32'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_u_4_33'
+ elif (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_d_u_4_34'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_u_4_35'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_4_36'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_4_37'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] > last_candle['pivot_1d']) and (last_candle['r_96_15m'] > -40.0):
+ return True, 'sell_profit_d_u_4_38'
+ elif (last_candle['rsi_14'] < 51.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_4_39'
+ elif (last_candle['rsi_14'] < 51.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_u_4_40'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['hl_pct_change_48_1h'] > 1.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_d_u_4_41'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 39.5) and (last_candle['cti_1h'] < -0.85):
+ return True, 'sell_profit_d_u_5_1'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 50.0):
+ return True, 'sell_profit_d_u_5_2'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_u_5_3'
+ elif (last_candle['rsi_14'] > 73.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_u_5_4'
+ elif (last_candle['rsi_14'] < 52.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):
+ return True, 'sell_profit_d_u_5_5'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['rsi_14_15m'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_5_6'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['rsi_14_15m'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_5_7'
+ elif (last_candle['rsi_14'] > 59.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):
+ return True, 'sell_profit_d_u_5_8'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):
+ return True, 'sell_profit_d_u_5_9'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):
+ return True, 'sell_profit_d_u_5_10'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_d_u_5_11'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 55.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_d_u_5_12'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):
+ return True, 'sell_profit_d_u_5_13'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_u_5_14'
+ elif (last_candle['rsi_14'] > 59.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_u_5_15'
+ elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_u_5_16'
+ elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_d_u_5_17'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_d_u_5_18'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_5_19'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_5_20'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_5_21'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_5_22'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_5_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_5_24'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_d_u_5_25'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_5_26'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):
+ return True, 'sell_profit_d_u_5_27'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_u_5_28'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_u_5_29'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_5_30'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):
+ return True, 'sell_profit_d_u_5_31'
+ elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):
+ return True, 'sell_profit_d_u_5_32'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_u_5_33'
+ elif (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_d_u_5_34'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_u_5_35'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_5_36'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_5_37'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] > last_candle['pivot_1d']) and (last_candle['r_96_15m'] > -40.0):
+ return True, 'sell_profit_d_u_5_38'
+ elif (last_candle['rsi_14'] < 52.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_5_39'
+ elif (last_candle['rsi_14'] < 52.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_u_5_40'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['hl_pct_change_48_1h'] > 1.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_d_u_5_41'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 39.0) and (last_candle['cti_1h'] < -0.85):
+ return True, 'sell_profit_d_u_6_1'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 48.0):
+ return True, 'sell_profit_d_u_6_2'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_u_6_3'
+ elif (last_candle['rsi_14'] > 74.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_u_6_4'
+ elif (last_candle['rsi_14'] < 51.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):
+ return True, 'sell_profit_d_u_6_5'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_6_6'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['rsi_14_15m'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_6_7'
+ elif (last_candle['rsi_14'] > 60.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):
+ return True, 'sell_profit_d_u_6_8'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):
+ return True, 'sell_profit_d_u_6_9'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):
+ return True, 'sell_profit_d_u_6_10'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_d_u_6_11'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 56.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_d_u_6_12'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):
+ return True, 'sell_profit_d_u_6_13'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_u_6_14'
+ elif (last_candle['rsi_14'] > 60.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_u_6_15'
+ elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_u_6_16'
+ elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_d_u_6_17'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_d_u_6_18'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_6_19'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_6_20'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_6_21'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_6_22'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_6_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_6_24'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_d_u_6_25'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_6_26'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):
+ return True, 'sell_profit_d_u_6_27'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_u_6_28'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_u_6_29'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_6_30'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):
+ return True, 'sell_profit_d_u_6_31'
+ elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):
+ return True, 'sell_profit_d_u_6_32'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_u_6_33'
+ elif (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_d_u_6_34'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_u_6_35'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_6_36'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_6_37'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] > last_candle['pivot_1d']) and (last_candle['r_96_15m'] > -40.0):
+ return True, 'sell_profit_d_u_6_38'
+ elif (last_candle['rsi_14'] < 51.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_6_39'
+ elif (last_candle['rsi_14'] < 51.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_u_6_40'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['hl_pct_change_48_1h'] > 1.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_d_u_6_41'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 38.5) and (last_candle['cti_1h'] < -0.85):
+ return True, 'sell_profit_d_u_7_1'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 46.0):
+ return True, 'sell_profit_d_u_7_2'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_u_7_3'
+ elif (last_candle['rsi_14'] > 75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_u_7_4'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):
+ return True, 'sell_profit_d_u_7_5'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_7_6'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_15m'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_7_7'
+ elif (last_candle['rsi_14'] > 61.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):
+ return True, 'sell_profit_d_u_7_8'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):
+ return True, 'sell_profit_d_u_7_9'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):
+ return True, 'sell_profit_d_u_7_10'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_d_u_7_11'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 57.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_d_u_7_12'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):
+ return True, 'sell_profit_d_u_7_13'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_u_7_14'
+ elif (last_candle['rsi_14'] > 61.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_u_7_15'
+ elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_u_7_16'
+ elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_d_u_7_17'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_d_u_7_18'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_7_19'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_7_20'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_7_21'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_7_22'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_7_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_7_24'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_d_u_7_25'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_7_26'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):
+ return True, 'sell_profit_d_u_7_27'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_u_7_28'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_u_7_29'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_7_30'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):
+ return True, 'sell_profit_d_u_7_31'
+ elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):
+ return True, 'sell_profit_d_u_7_32'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_u_7_33'
+ elif (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_d_u_7_34'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_u_7_35'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_7_36'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_7_37'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] > last_candle['pivot_1d']) and (last_candle['r_96_15m'] > -40.0):
+ return True, 'sell_profit_d_u_7_38'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_7_39'
+ elif (last_candle['rsi_14'] < 50.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_u_7_40'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['hl_pct_change_48_1h'] > 1.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_d_u_7_41'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 38.0) and (last_candle['cti_1h'] < -0.85):
+ return True, 'sell_profit_d_u_8_1'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 44.0):
+ return True, 'sell_profit_d_u_8_2'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_u_8_3'
+ elif (last_candle['rsi_14'] > 76.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_u_8_4'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):
+ return True, 'sell_profit_d_u_8_5'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_8_6'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_15m'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_8_7'
+ elif (last_candle['rsi_14'] > 62.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):
+ return True, 'sell_profit_d_u_8_8'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):
+ return True, 'sell_profit_d_u_8_9'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):
+ return True, 'sell_profit_d_u_8_10'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_d_u_8_11'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 58.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_d_u_8_12'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):
+ return True, 'sell_profit_d_u_8_13'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_u_8_14'
+ elif (last_candle['rsi_14'] > 62.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_u_8_15'
+ elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_u_8_16'
+ elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_d_u_8_17'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_d_u_8_18'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_8_19'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_8_20'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_8_21'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_8_22'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_8_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_8_24'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_d_u_8_25'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_8_26'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):
+ return True, 'sell_profit_d_u_8_27'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_u_8_28'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_u_8_29'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_8_30'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):
+ return True, 'sell_profit_d_u_8_31'
+ elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):
+ return True, 'sell_profit_d_u_8_32'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_u_8_33'
+ elif (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_d_u_8_34'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_u_8_35'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_8_36'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_8_37'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] > last_candle['pivot_1d']) and (last_candle['r_96_15m'] > -40.0):
+ return True, 'sell_profit_d_u_8_38'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_8_39'
+ elif (last_candle['rsi_14'] < 49.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_u_8_40'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['hl_pct_change_48_1h'] > 1.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_d_u_8_41'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 37.0) and (last_candle['cti_1h'] < -0.85):
+ return True, 'sell_profit_d_u_9_1'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 42.0):
+ return True, 'sell_profit_d_u_9_2'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_u_9_3'
+ elif (last_candle['rsi_14'] > 77.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_u_9_4'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):
+ return True, 'sell_profit_d_u_9_5'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_9_6'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_15m'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_9_7'
+ elif (last_candle['rsi_14'] > 63.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):
+ return True, 'sell_profit_d_u_9_8'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):
+ return True, 'sell_profit_d_u_9_9'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):
+ return True, 'sell_profit_d_u_9_10'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_d_u_9_11'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 59.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_d_u_9_12'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):
+ return True, 'sell_profit_d_u_9_13'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_u_9_14'
+ elif (last_candle['rsi_14'] > 63.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_u_9_15'
+ elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_u_9_16'
+ elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_d_u_9_17'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_d_u_9_18'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_9_19'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_9_20'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_9_21'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_9_22'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_9_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_9_24'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_d_u_9_25'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_9_26'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):
+ return True, 'sell_profit_d_u_9_27'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_u_9_28'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_u_9_29'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_9_30'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):
+ return True, 'sell_profit_d_u_9_31'
+ elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):
+ return True, 'sell_profit_d_u_9_32'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_u_9_33'
+ elif (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_d_u_9_34'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_u_9_35'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_9_36'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_9_37'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] > last_candle['pivot_1d']) and (last_candle['r_96_15m'] > -40.0):
+ return True, 'sell_profit_d_u_9_38'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_9_39'
+ elif (last_candle['rsi_14'] < 48.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_u_9_40'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['hl_pct_change_48_1h'] > 1.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_d_u_9_41'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 36.0) and (last_candle['cti_1h'] < -0.85):
+ return True, 'sell_profit_d_u_10_1'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_10_2'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_u_10_3'
+ elif (last_candle['rsi_14'] > 78.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_u_10_4'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):
+ return True, 'sell_profit_d_u_10_5'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_15m'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_10_6'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_15m'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_10_7'
+ elif (last_candle['rsi_14'] > 64.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):
+ return True, 'sell_profit_d_u_10_8'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):
+ return True, 'sell_profit_d_u_10_9'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):
+ return True, 'sell_profit_d_u_10_10'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_d_u_10_11'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_d_u_10_12'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):
+ return True, 'sell_profit_d_u_10_13'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_u_10_14'
+ elif (last_candle['rsi_14'] > 64.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_u_10_15'
+ elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_u_10_16'
+ elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_d_u_10_17'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_d_u_10_18'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_10_19'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_10_20'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_10_21'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_10_22'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_10_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_10_24'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_d_u_10_25'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_10_26'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):
+ return True, 'sell_profit_d_u_10_27'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_u_10_28'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_u_10_29'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_10_30'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):
+ return True, 'sell_profit_d_u_10_31'
+ elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):
+ return True, 'sell_profit_d_u_10_32'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_u_10_33'
+ elif (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_d_u_10_34'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_u_10_35'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_10_36'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_10_37'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] > last_candle['pivot_1d']) and (last_candle['r_96_15m'] > -40.0):
+ return True, 'sell_profit_d_u_10_38'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_10_39'
+ elif (last_candle['rsi_14'] < 47.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_u_10_40'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['hl_pct_change_48_1h'] > 1.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_d_u_10_41'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 35.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 35.0) and (last_candle['cti_1h'] < -0.85):
+ return True, 'sell_profit_d_u_11_1'
+ elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_u_11_2'
+ elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 33.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_u_11_3'
+ elif (last_candle['rsi_14'] > 79.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_u_11_4'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):
+ return True, 'sell_profit_d_u_11_5'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_11_6'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_11_7'
+ elif (last_candle['rsi_14'] > 65.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):
+ return True, 'sell_profit_d_u_11_8'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):
+ return True, 'sell_profit_d_u_11_9'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):
+ return True, 'sell_profit_d_u_11_10'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_d_u_11_11'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_d_u_11_12'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):
+ return True, 'sell_profit_d_u_11_13'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_u_11_14'
+ elif (last_candle['rsi_14'] > 65.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_u_11_15'
+ elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_u_11_16'
+ elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_d_u_11_17'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_d_u_11_18'
+ elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_11_19'
+ elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_11_20'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_11_21'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_11_22'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_11_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_11_24'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_d_u_11_25'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_11_26'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):
+ return True, 'sell_profit_d_u_11_27'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_u_11_28'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_u_11_29'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_11_30'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):
+ return True, 'sell_profit_d_u_11_31'
+ elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):
+ return True, 'sell_profit_d_u_11_32'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_u_11_33'
+ elif (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_d_u_11_34'
+ elif (last_candle['rsi_14'] < 44.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_u_11_35'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_11_36'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_11_37'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] > last_candle['pivot_1d']) and (last_candle['r_96_15m'] > -40.0):
+ return True, 'sell_profit_d_u_11_38'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_11_39'
+ elif (last_candle['rsi_14'] < 46.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_u_11_40'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['hl_pct_change_48_1h'] > 1.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_d_u_11_41'
+ elif current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 33.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.05) and (last_candle['rsi_14_1h'] < 34.0) and (last_candle['cti_1h'] < -0.85):
+ return True, 'sell_profit_d_u_12_1'
+ elif (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 36.0):
+ return True, 'sell_profit_d_u_12_2'
+ elif (last_candle['rsi_14'] < 34.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['rsi_14_1h'] < 32.0) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_u_12_3'
+ elif (last_candle['rsi_14'] > 80.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_1h']):
+ return True, 'sell_profit_d_u_12_4'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['rsi_14_1h'] < 47.0):
+ return True, 'sell_profit_d_u_12_5'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['rsi_14_15m'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.25) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_12_6'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['rsi_14_15m'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.4) and (last_candle['cmf_15m'] < -0.25) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_12_7'
+ elif (last_candle['rsi_14'] > 66.0) and (last_candle['r_480'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -90.0):
+ return True, 'sell_profit_d_u_12_8'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.25) and (last_candle['cti_1h'] > 0.9):
+ return True, 'sell_profit_d_u_12_9'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96'] < -75.0):
+ return True, 'sell_profit_d_u_12_10'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1):
+ return True, 'sell_profit_d_u_12_11'
+ elif (last_candle['r_14'] > -15.0) and (last_candle['r_32'] > -25.0) and (last_candle['r_480'] > -20.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 50.0) and (last_candle['rsi_14_1h'] < 55.0) and (last_candle['r_96_15m'] > -50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_d_u_12_12'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_15m'] < 40.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] < -70.0):
+ return True, 'sell_profit_d_u_12_13'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['r_96'] < -75.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_u_12_14'
+ elif (last_candle['rsi_14'] > 65.0) and (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_u_12_15'
+ elif (last_candle['r_14'] > -30.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_u_12_16'
+ elif (last_candle['r_14'] > -25.0) and (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -85.0) and (last_candle['r_480_1h'] > -25.0):
+ return True, 'sell_profit_d_u_12_17'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -80.0) and (last_candle['r_480_1h'] > -30.0):
+ return True, 'sell_profit_d_u_12_18'
+ elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.1) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_d_u_12_19'
+ elif (last_candle['rsi_14'] < 37.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_12_20'
+ elif (last_candle['r_14'] > -8.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] < -75.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_12_21'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_12_22'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 35.0):
+ return True, 'sell_profit_d_u_12_23'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cti'] > 0.85) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_12_24'
+ elif (last_candle['r_14'] > -10.0) and (last_candle['r_32'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cti'] > 0.8) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_96_15m'] < -75.0):
+ return True, 'sell_profit_d_u_12_25'
+ elif (last_candle['rsi_14'] < 39.0) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['cmf_15m'] < -0.2) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_12_26'
+ elif (last_candle['rsi_14'] < 38.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.2) and (last_candle['rsi_14_1h'] < 55.0):
+ return True, 'sell_profit_d_u_12_27'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['rsi_14_15m'] < 34.0) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_u_12_28'
+ elif (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -80.0):
+ return True, 'sell_profit_d_u_12_29'
+ elif (last_candle['r_14'] > -20.0) and (last_candle['r_480'] < -50.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['rsi_14_1h'] < 41.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -75.0):
+ return True, 'sell_profit_d_u_12_30'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_15m'] < -0.15) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] < -45.0) and (last_candle['r_480_1h'] > -30.0) and (last_candle['rsi_14_15m'] < 45.0):
+ return True, 'sell_profit_d_u_12_31'
+ elif (last_candle['r_480'] < -70.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 220.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -70.0) and (last_candle['cti_1h'] < -0.75):
+ return True, 'sell_profit_d_u_12_32'
+ elif (last_candle['rsi_14'] < 40.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0) and(last_candle['r_96_15m'] < -85.0):
+ return True, 'sell_profit_d_u_12_33'
+ elif (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 45.0):
+ return True, 'sell_profit_d_u_12_34'
+ elif (last_candle['rsi_14'] < 43.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 45.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_d_u_12_35'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['r_96_15m'] < -50.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_12_36'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_12_37'
+ elif (last_candle['rsi_14'] < 41.0) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['r_480_1h'] < -50.0) and (last_candle['close'] > last_candle['pivot_1d']) and (last_candle['r_96_15m'] > -40.0):
+ return True, 'sell_profit_d_u_12_38'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.2) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 40.0):
+ return True, 'sell_profit_d_u_12_39'
+ elif (last_candle['rsi_14'] < 45.0) and (last_candle['sma_200_dec_20']) and (last_candle['sma_200_dec_20_15m']) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.1) and (last_candle['rsi_14_1h'] < 38.0):
+ return True, 'sell_profit_d_u_12_40'
+ elif (last_candle['rsi_14'] < 42.0) and (last_candle['sma_200_dec_20']) and (last_candle['hl_pct_change_48_1h'] > 1.0) and (last_candle['btc_not_downtrend_1h'] == False):
+ return True, 'sell_profit_d_u_12_41'
+
+ return False, None
+
+ def sell_pump_main(self, current_profit: float, last_candle) -> tuple:
+ if (last_candle['hl_pct_change_48_1h'] > 0.9):
+ if (last_candle['ema_vwma_osc_96'] > 0.0):
+ if current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'sell_profit_p_bull_48_1_12_1'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'sell_profit_p_bull_48_1_11_1'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'sell_profit_p_bull_48_1_10_1'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 50.0):
+ return True, 'sell_profit_p_bull_48_1_9_1'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 49.0):
+ return True, 'sell_profit_p_bull_48_1_8_1'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'sell_profit_p_bull_48_1_7_1'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 47.0):
+ return True, 'sell_profit_p_bull_48_1_6_1'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'sell_profit_p_bull_48_1_5_1'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 45.0):
+ return True, 'sell_profit_p_bull_48_1_4_1'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 41.0):
+ return True, 'sell_profit_p_bull_48_1_3_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 37.0):
+ return True, 'sell_profit_p_bull_48_1_2_1'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 35.0):
+ return True, 'sell_profit_p_bull_48_1_1_1'
+ else:
+ if current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 43.0):
+ return True, 'sell_profit_p_bear_48_1_12_1'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 45.0):
+ return True, 'sell_profit_p_bear_48_1_11_1'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 47.0):
+ return True, 'sell_profit_p_bear_48_1_10_1'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 51.0):
+ return True, 'sell_profit_p_bear_48_1_9_1'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 50.0):
+ return True, 'sell_profit_p_bear_48_1_8_1'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 49.0):
+ return True, 'sell_profit_p_bear_48_1_7_1'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'sell_profit_p_bear_48_1_6_1'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 47.0):
+ return True, 'sell_profit_p_bear_48_1_5_1'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'sell_profit_p_bear_48_1_4_1'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'sell_profit_p_bear_48_1_3_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 39.0):
+ return True, 'sell_profit_p_bear_48_1_2_1'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 36.0):
+ return True, 'sell_profit_p_bear_48_1_1_1'
+
+ if (last_candle['hl_pct_change_48_1h'] > 0.8):
+ if (last_candle['ema_vwma_osc_96'] > 0.0):
+ if current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 32.0) and (last_candle['cmf'] < -0.35):
+ return True, 'sell_profit_p_bull_48_2_12_1'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.35):
+ return True, 'sell_profit_p_bull_48_2_11_1'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.35):
+ return True, 'sell_profit_p_bull_48_2_10_1'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.3):
+ return True, 'sell_profit_p_bull_48_2_9_1'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.25):
+ return True, 'sell_profit_p_bull_48_2_8_1'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.25):
+ return True, 'sell_profit_p_bull_48_2_7_1'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.25):
+ return True, 'sell_profit_p_bull_48_2_6_1'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2):
+ return True, 'sell_profit_p_bull_48_2_5_1'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2):
+ return True, 'sell_profit_p_bull_48_2_4_1'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.25):
+ return True, 'sell_profit_p_bull_48_2_3_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.25):
+ return True, 'sell_profit_p_bull_48_2_2_1'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.25):
+ return True, 'sell_profit_p_bull_48_2_1_1'
+ else:
+ if current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.35):
+ return True, 'sell_profit_p_bear_48_2_12_1'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.35):
+ return True, 'sell_profit_p_bear_48_2_11_1'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.35):
+ return True, 'sell_profit_p_bear_48_2_10_1'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.2):
+ return True, 'sell_profit_p_bear_48_2_9_1'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2):
+ return True, 'sell_profit_p_bear_48_2_8_1'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1):
+ return True, 'sell_profit_p_bear_48_2_7_1'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.1):
+ return True, 'sell_profit_p_bear_48_2_6_1'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.1):
+ return True, 'sell_profit_p_bear_48_2_5_1'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.1):
+ return True, 'sell_profit_p_bear_48_2_4_1'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.1):
+ return True, 'sell_profit_p_bear_48_2_3_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.1):
+ return True, 'sell_profit_p_bear_48_2_2_1'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.15):
+ return True, 'sell_profit_p_bear_48_2_1_1'
+
+ if (last_candle['hl_pct_change_48_1h'] > 0.5):
+ if (last_candle['ema_vwma_osc_96'] > 0.0):
+ if current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 32.0) and (last_candle['cmf'] < -0.35):
+ return True, 'sell_profit_p_bull_48_3_12_1'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_p_bull_48_3_12_2'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.35):
+ return True, 'sell_profit_p_bull_48_3_11_1'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_p_bull_48_3_11_2'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 35.0) and (last_candle['cmf'] < -0.35):
+ return True, 'sell_profit_p_bull_48_3_10_1'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_p_bull_48_3_10_2'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.3):
+ return True, 'sell_profit_p_bull_48_3_9_1'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_p_bull_48_3_9_2'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.25):
+ return True, 'sell_profit_p_bull_48_3_8_1'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_p_bull_48_3_8_2'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.25):
+ return True, 'sell_profit_p_bull_48_3_7_1'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_p_bull_48_3_7_2'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf'] < -0.25):
+ return True, 'sell_profit_p_bull_48_3_6_1'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_p_bull_48_3_6_2'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf'] < -0.2):
+ return True, 'sell_profit_p_bull_48_3_5_1'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 59.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_p_bull_48_3_5_2'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf'] < -0.2):
+ return True, 'sell_profit_p_bull_48_3_4_1'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_p_bull_48_3_4_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 41.0) and (last_candle['cmf'] < -0.25):
+ return True, 'sell_profit_p_bull_48_3_3_1'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_p_bull_48_3_3_2'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 39.0) and (last_candle['cmf'] < -0.25):
+ return True, 'sell_profit_p_bull_48_3_2_1'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_p_bull_48_3_2_2'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 37.0) and (last_candle['cmf'] < -0.25):
+ return True, 'sell_profit_p_bull_48_3_1_1'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_p_bull_48_3_1_2'
+ else:
+ if current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 33.0) and (last_candle['cmf'] < -0.35):
+ return True, 'sell_profit_p_bear_48_3_12_1'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_p_bear_48_3_12_2'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 34.0) and (last_candle['cmf'] < -0.35):
+ return True, 'sell_profit_p_bear_48_3_11_1'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_p_bear_48_3_11_2'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 36.0) and (last_candle['cmf'] < -0.35):
+ return True, 'sell_profit_p_bear_48_3_10_1'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_p_bear_48_3_10_2'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.3):
+ return True, 'sell_profit_p_bear_48_3_9_1'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_p_bear_48_3_9_2'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.25):
+ return True, 'sell_profit_p_bear_48_3_8_1'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_p_bear_48_3_8_2'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.25):
+ return True, 'sell_profit_p_bear_48_3_7_1'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_p_bear_48_3_7_2'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 48.0) and (last_candle['cmf'] < -0.25):
+ return True, 'sell_profit_p_bear_48_3_6_1'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_p_bear_48_3_6_2'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf'] < -0.2):
+ return True, 'sell_profit_p_bear_48_3_5_1'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 59.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_p_bear_48_3_5_2'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf'] < -0.2):
+ return True, 'sell_profit_p_bear_48_3_4_1'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_p_bear_48_3_4_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 42.0) and (last_candle['cmf'] < -0.25):
+ return True, 'sell_profit_p_bear_48_3_3_1'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_p_bear_48_3_3_2'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf'] < -0.25):
+ return True, 'sell_profit_p_bear_48_3_2_1'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_p_bear_48_3_2_2'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 38.0) and (last_candle['cmf'] < -0.25):
+ return True, 'sell_profit_p_bear_48_3_1_1'
+ elif (last_candle['r_14'] > -12.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cmf_1h'] < -0.0) and (last_candle['rsi_14_1h'] < 50.0) and (last_candle['r_480_1h'] > -20.0):
+ return True, 'sell_profit_p_bear_48_3_1_2'
+
+ if (last_candle['hl_pct_change_36_1h'] > 0.72):
+ if (last_candle['ema_vwma_osc_96'] > 0.0):
+ if current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 32.0):
+ return True, 'sell_profit_p_bull_36_1_12_1'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 34.0):
+ return True, 'sell_profit_p_bull_36_1_11_1'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'sell_profit_p_bull_36_1_10_1'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 50.0):
+ return True, 'sell_profit_p_bull_36_1_9_1'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 49.0):
+ return True, 'sell_profit_p_bull_36_1_8_1'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'sell_profit_p_bull_36_1_7_1'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 47.0):
+ return True, 'sell_profit_p_bull_36_1_6_1'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'sell_profit_p_bull_36_1_5_1'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'sell_profit_p_bull_36_1_4_1'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 40.0):
+ return True, 'sell_profit_p_bull_36_1_3_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 36.0):
+ return True, 'sell_profit_p_bull_36_1_2_1'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 34.0):
+ return True, 'sell_profit_p_bull_36_1_1_1'
+ else:
+ if current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 33.0):
+ return True, 'sell_profit_p_bear_36_1_12_1'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 35.0):
+ return True, 'sell_profit_p_bear_36_1_11_1'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 43.0):
+ return True, 'sell_profit_p_bear_36_1_10_1'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 51.0):
+ return True, 'sell_profit_p_bear_36_1_9_1'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 50.0):
+ return True, 'sell_profit_p_bear_36_1_8_1'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 49.0):
+ return True, 'sell_profit_p_bear_36_1_7_1'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'sell_profit_p_bear_36_1_6_1'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 47.0):
+ return True, 'sell_profit_p_bear_36_1_5_1'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 45.0):
+ return True, 'sell_profit_p_bear_36_1_4_1'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 41.0):
+ return True, 'sell_profit_p_bear_36_1_3_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 37.0):
+ return True, 'sell_profit_p_bear_36_1_2_1'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 35.0):
+ return True, 'sell_profit_p_bear_36_1_1_1'
+
+ if (last_candle['hl_pct_change_24_1h'] > 0.68):
+ if (last_candle['ema_vwma_osc_96'] > 0.0):
+ if current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 41.0):
+ return True, 'sell_profit_p_bull_24_1_12_1'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 43.0):
+ return True, 'sell_profit_p_bull_24_1_11_1'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 47.0):
+ return True, 'sell_profit_p_bull_24_1_10_1'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 51.0):
+ return True, 'sell_profit_p_bull_24_1_9_1'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 49.0):
+ return True, 'sell_profit_p_bull_24_1_8_1'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 47.0):
+ return True, 'sell_profit_p_bull_24_1_7_1'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 45.0):
+ return True, 'sell_profit_p_bull_24_1_6_1'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 43.0):
+ return True, 'sell_profit_p_bull_24_1_5_1'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 41.0):
+ return True, 'sell_profit_p_bull_24_1_4_1'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 39.0):
+ return True, 'sell_profit_p_bull_24_1_3_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 37.0):
+ return True, 'sell_profit_p_bull_24_1_2_1'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 35.0):
+ return True, 'sell_profit_p_bull_24_1_1_1'
+ else:
+ if current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'sell_profit_p_bear_24_1_12_1'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'sell_profit_p_bear_24_1_11_1'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'sell_profit_p_bear_24_1_10_1'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 52.0):
+ return True, 'sell_profit_p_bear_24_1_9_1'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 50.0):
+ return True, 'sell_profit_p_bear_24_1_8_1'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'sell_profit_p_bear_24_1_7_1'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'sell_profit_p_bear_24_1_6_1'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'sell_profit_p_bear_24_1_5_1'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'sell_profit_p_bear_24_1_4_1'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 40.0):
+ return True, 'sell_profit_p_bear_24_1_3_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 38.0):
+ return True, 'sell_profit_p_bear_24_1_2_1'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 36.0):
+ return True, 'sell_profit_p_bear_24_1_1_1'
+
+ if (last_candle['hl_pct_change_24_1h'] > 0.5):
+ if (last_candle['ema_vwma_osc_96'] > 0.0):
+ if current_profit >= 0.2:
+ if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_p_bull_24_2_12_1'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_p_bull_24_2_12_2'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_p_bull_24_2_11_1'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_p_bull_24_2_11_2'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_p_bull_24_2_10_1'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_p_bull_24_2_10_2'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_p_bull_24_2_9_1'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_p_bull_24_2_9_2'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_p_bull_24_2_8_1'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_p_bull_24_2_8_2'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_p_bull_24_2_7_1'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_p_bull_24_2_7_2'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_p_bull_24_2_6_1'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_p_bull_24_2_6_2'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_p_bull_24_2_5_1'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_p_bull_24_2_5_2'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_p_bull_24_2_4_1'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_p_bull_24_2_4_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_p_bull_24_2_3_1'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_p_bull_24_2_3_2'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_p_bull_24_2_2_1'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_p_bull_24_2_2_2'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_p_bull_24_2_1_1'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_p_bull_24_2_1_2'
+ else:
+ if current_profit >= 0.2:
+ if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_p_bear_24_2_12_1'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_p_bear_24_2_12_2'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_p_bear_24_2_11_1'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_p_bear_24_2_11_2'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_p_bear_24_2_10_1'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_p_bear_24_2_10_2'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_p_bear_24_2_9_1'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_p_bear_24_2_9_2'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_p_bear_24_2_8_1'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_p_bear_24_2_8_2'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_p_bear_24_2_7_1'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_p_bear_24_2_7_2'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_p_bear_24_2_6_1'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_p_bear_24_2_6_2'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_p_bear_24_2_5_1'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 60.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_p_bear_24_2_5_2'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_p_bear_24_2_4_1'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_p_bear_24_2_4_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_p_bear_24_2_3_1'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_p_bear_24_2_3_2'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_p_bear_24_2_2_1'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_p_bear_24_2_2_2'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['r_14'] > -4.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 240.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['cmf_1h'] < -0.0):
+ return True, 'sell_profit_p_bear_24_2_1_1'
+ elif (last_candle['r_14'] > -18.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cti'] > 0.9) and (last_candle['sma_200_dec_20_15m']) and (last_candle['sma_200_dec_20_1h']) and (last_candle['cmf'] < -0.0) and (last_candle['cmf_15m'] < -0.0) and (last_candle['r_96_15m'] < -50.0) and (last_candle['r_480_1h'] < -50.0):
+ return True, 'sell_profit_p_bear_24_2_1_2'
+
+ return False, None
+
+ def sell_pivot(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, trade: 'Trade', current_time: 'datetime') -> tuple:
+ if (last_candle['close'] > (last_candle['res3_1d'] * 1.2)):
+ if (0.02 > current_profit >= 0.01):
+ if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):
+ return True, 'sell_profit_pv_1_1_1'
+ elif (0.03 > current_profit >= 0.02):
+ if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):
+ return True, 'sell_profit_pv_1_2_1'
+ elif (0.04 > current_profit >= 0.03):
+ if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):
+ return True, 'sell_profit_pv_1_3_1'
+ elif (0.05 > current_profit >= 0.04):
+ if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):
+ return True, 'sell_profit_pv_1_4_1'
+ elif (0.06 > current_profit >= 0.05):
+ if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):
+ return True, 'sell_profit_pv_1_5_1'
+ elif (0.07 > current_profit >= 0.06):
+ if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):
+ return True, 'sell_profit_pv_1_6_1'
+ elif (0.08 > current_profit >= 0.07):
+ if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):
+ return True, 'sell_profit_pv_1_7_1'
+ elif (0.09 > current_profit >= 0.08):
+ if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 69.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):
+ return True, 'sell_profit_pv_1_8_1'
+ elif (0.1 > current_profit >= 0.09):
+ if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 70.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):
+ return True, 'sell_profit_pv_1_9_1'
+ elif (0.12 > current_profit >= 0.1):
+ if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 71.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):
+ return True, 'sell_profit_pv_1_10_1'
+ elif (0.2 > current_profit >= 0.12):
+ if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 72.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):
+ return True, 'sell_profit_pv_1_11_1'
+ elif (current_profit >= 0.2):
+ if (last_candle['r_14'] > -10.0) and (last_candle['rsi_14'] > 73.0) and (last_candle['cci'] > 260.0) and (last_candle['cmf_15m'] < -0.1):
+ return True, 'sell_profit_pv_1_12_1'
+
+ if (last_candle['close'] > (last_candle['res3_1d'] * 1.1)):
+ if (0.02 > current_profit >= 0.01):
+ if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_2_1_1'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] > -35.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_2_1_2'
+ elif (0.03 > current_profit >= 0.02):
+ if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_2_2_1'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] > -35.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_2_2_2'
+ elif (0.04 > current_profit >= 0.03):
+ if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_2_3_1'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] > -35.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_2_3_2'
+ elif (0.05 > current_profit >= 0.04):
+ if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_2_4_1'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] > -35.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_2_4_2'
+ elif (0.06 > current_profit >= 0.05):
+ if (last_candle['rsi_14'] < 47.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_2_5_1'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 61.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] > -35.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_2_5_2'
+ elif (0.07 > current_profit >= 0.06):
+ if (last_candle['rsi_14'] < 46.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_2_6_1'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 62.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] > -35.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_2_6_2'
+ elif (0.08 > current_profit >= 0.07):
+ if (last_candle['rsi_14'] < 45.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_2_7_1'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 63.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] > -35.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_2_7_2'
+ elif (0.09 > current_profit >= 0.08):
+ if (last_candle['rsi_14'] < 44.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_2_8_1'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 64.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] > -35.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_2_8_2'
+ elif (0.1 > current_profit >= 0.09):
+ if (last_candle['rsi_14'] < 43.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_2_9_1'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 65.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] > -35.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_2_9_2'
+ elif (0.12 > current_profit >= 0.1):
+ if (last_candle['rsi_14'] < 42.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_2_10_1'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 66.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] > -35.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_2_10_2'
+ elif (0.2 > current_profit >= 0.12):
+ if (last_candle['rsi_14'] < 41.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_2_11_1'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 67.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] > -35.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_2_11_2'
+ elif (current_profit >= 0.2):
+ if (last_candle['rsi_14'] < 40.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_2_12_1'
+ elif (last_candle['r_14'] > -3.0) and (last_candle['rsi_14'] > 68.0) and (last_candle['cmf_15m'] < -0.1) and (last_candle['cmf_1h'] < -0.0) and (last_candle['r_96_15m'] > -35.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_2_12_2'
+
+ if (last_candle['close'] > (last_candle['res1_1d'] * 1.0)):
+ if (0.02 > current_profit >= 0.01):
+ if (last_candle['rsi_14'] < 37.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):
+ return True, 'sell_profit_pv_3_1_1'
+ elif (0.03 > current_profit >= 0.02):
+ if (last_candle['rsi_14'] < 38.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):
+ return True, 'sell_profit_pv_3_2_1'
+ elif (0.04 > current_profit >= 0.03):
+ if (last_candle['rsi_14'] < 39.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):
+ return True, 'sell_profit_pv_3_3_1'
+ elif (0.05 > current_profit >= 0.04):
+ if (last_candle['rsi_14'] < 40.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):
+ return True, 'sell_profit_pv_3_4_1'
+ elif (0.06 > current_profit >= 0.05):
+ if (last_candle['rsi_14'] < 41.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):
+ return True, 'sell_profit_pv_3_5_1'
+ elif (0.07 > current_profit >= 0.06):
+ if (last_candle['rsi_14'] < 40.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):
+ return True, 'sell_profit_pv_3_6_1'
+ elif (0.08 > current_profit >= 0.07):
+ if (last_candle['rsi_14'] < 39.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):
+ return True, 'sell_profit_pv_3_7_1'
+ elif (0.09 > current_profit >= 0.08):
+ if (last_candle['rsi_14'] < 38.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):
+ return True, 'sell_profit_pv_3_8_1'
+ elif (0.1 > current_profit >= 0.09):
+ if (last_candle['rsi_14'] < 37.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):
+ return True, 'sell_profit_pv_3_9_1'
+ elif (0.12 > current_profit >= 0.1):
+ if (last_candle['rsi_14'] < 36.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):
+ return True, 'sell_profit_pv_3_10_1'
+ elif (0.2 > current_profit >= 0.12):
+ if (last_candle['rsi_14'] < 35.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):
+ return True, 'sell_profit_pv_3_11_1'
+ elif (current_profit >= 0.2):
+ if (last_candle['rsi_14'] < 34.0) and (last_candle['r_480_1h'] > -50.0) and (last_candle['rsi_14_1h'] > 60.0):
+ return True, 'sell_profit_pv_3_12_1'
+
+ if (last_candle['close'] > (last_candle['res3_1d'] * 1.8)):
+ if (0.02 > current_profit >= 0.01):
+ if (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_1h'] > 50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_4_1_1'
+ elif (0.03 > current_profit >= 0.02):
+ if (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_1h'] > 50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_4_2_1'
+ elif (0.04 > current_profit >= 0.03):
+ if (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_1h'] > 50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_4_3_1'
+ elif (0.05 > current_profit >= 0.04):
+ if (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['rsi_14_1h'] > 50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_4_4_1'
+ elif (0.06 > current_profit >= 0.05):
+ if (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] < 48.0) and (last_candle['rsi_14_1h'] > 50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_4_5_1'
+ elif (0.07 > current_profit >= 0.06):
+ if (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] < 47.0) and (last_candle['rsi_14_1h'] > 50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_4_6_1'
+ elif (0.08 > current_profit >= 0.07):
+ if (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] < 46.0) and (last_candle['rsi_14_1h'] > 50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_4_7_1'
+ elif (0.09 > current_profit >= 0.08):
+ if (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] < 45.0) and (last_candle['rsi_14_1h'] > 50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_4_8_1'
+ elif (0.1 > current_profit >= 0.09):
+ if (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] < 44.0) and (last_candle['rsi_14_1h'] > 50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_4_9_1'
+ elif (0.12 > current_profit >= 0.1):
+ if (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] < 43.0) and (last_candle['rsi_14_1h'] > 50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_4_10_1'
+ elif (0.2 > current_profit >= 0.12):
+ if (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] < 42.0) and (last_candle['rsi_14_1h'] > 50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_4_11_1'
+ elif (current_profit >= 0.2):
+ if (last_candle['r_480'] > -35.0) and (last_candle['rsi_14'] < 41.0) and (last_candle['rsi_14_1h'] > 50.0) and (last_candle['r_480_1h'] > -35.0):
+ return True, 'sell_profit_pv_4_12_1'
+
+ return False, None
+
+ def sell_long_mode(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', enter_tag) -> tuple:
+ # Original sell signals
+ sell, signal_name = self.sell_long_signals(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tag)
+ if sell and (signal_name is not None):
+ return True, signal_name
+
+ # Stoplosses
+ sell, signal_name = self.sell_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)
+ if sell and (signal_name is not None):
+ return True, signal_name
+
+ if (0.001 < current_profit <= 0.02) and (max_profit - current_profit > 0.014):
+ return True, 'sell_long_t_0'
+ elif (0.02 < current_profit <= 0.04) and (max_profit - current_profit > 0.03):
+ return True, 'sell_long_t_1'
+ elif (0.04 < current_profit <= 0.06) and (max_profit - current_profit > 0.035):
+ return True, 'sell_long_t_2'
+ elif (0.06 < current_profit <= 0.08) and (max_profit - current_profit > 0.04):
+ return True, 'sell_long_t_3'
+ elif (0.08 < current_profit <= 0.1) and (max_profit - current_profit > 0.045):
+ return True, 'sell_long_t_4'
+ elif (0.1 < current_profit <= 0.12) and (max_profit - current_profit > 0.05):
+ return True, 'sell_long_t_5'
+ elif (0.12 < current_profit <= 0.14) and (max_profit - current_profit > 0.055):
+ return True, 'sell_long_t_6'
+ elif (0.14 < current_profit <= 0.16) and (max_profit - current_profit > 0.06):
+ return True, 'sell_long_t_7'
+ elif (0.16 < current_profit <= 0.18) and (max_profit - current_profit > 0.065):
+ return True, 'sell_long_t_8'
+ elif (0.18 < current_profit <= 0.2) and (max_profit - current_profit > 0.07):
+ return True, 'sell_long_t_8'
+ elif (0.2 < current_profit <= 0.3) and (max_profit - current_profit > 0.075):
+ return True, 'sell_long_t_9'
+ elif (0.3 < current_profit <= 0.4) and (max_profit - current_profit > 0.08):
+ return True, 'sell_long_t_10'
+ elif (0.4 < current_profit <= 0.5) and (max_profit - current_profit > 0.085):
+ return True, 'sell_long_t_11'
+ elif (0.5 < current_profit <= 1.0) and (max_profit - current_profit > 0.09):
+ return True, 'sell_long_t_12'
+
+ return False, None
+
+ def sell_long_signals(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', enter_tag) -> tuple:
+ # Sell signal 1
+ if (last_candle['rsi_14'] > 78.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) and (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'sell_long_1_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'sell_long_1_2_1'
+
+ # Sell signal 2
+ elif (last_candle['rsi_14'] > 79.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'sell_long_2_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'sell_long_2_2_1'
+
+ # Sell signal 3
+ elif (last_candle['rsi_14'] > 81.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'sell_long_3_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'sell_long_3_2_1'
+
+ # Sell signal 4
+ elif (last_candle['rsi_14'] > 77.0) and (last_candle['rsi_14_1h'] > 77.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'sell_long_4_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'sell_long_4_2_1'
+
+ # Sell signal 6
+ elif (last_candle['close'] < last_candle['ema_200']) and (last_candle['close'] > last_candle['ema_50']) and (last_candle['rsi_14'] > 78.5):
+ if (current_profit > 0.01):
+ return True, 'sell_long_6_1'
+
+ # Sell signal 7
+ elif (last_candle['rsi_14_1h'] > 79.0) and (last_candle['crossed_below_ema_12_26']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'sell_long_7_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'sell_long_7_2_1'
+
+ # Sell signal 8
+ elif (last_candle['close'] > last_candle['bb20_2_upp_1h'] * 1.07):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'sell_long_8_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'sell_long_8_2_1'
+
+ return False, None
+
+ def sell_quick_mode(self, current_profit: float, max_profit:float, last_candle, previous_candle_1) -> tuple:
+ if (0.09 > current_profit > 0.02) and (last_candle['rsi_14'] > 78.0):
+ return True, 'sell_profit_q_1'
+
+ if (0.09 > current_profit > 0.02) and (last_candle['cti'] > 0.95):
+ return True, 'sell_profit_q_2'
+
+ if (0.09 > current_profit > 0.02) and (last_candle['r_14'] >= -1.0):
+ return True, 'sell_profit_q_3'
+
+ return False, None
+
+ def sell_rapid_mode(self, trade: Trade, current_time: datetime, current_profit: float, max_profit:float, last_candle, previous_candle_1) -> tuple:
+ if (0.04 > current_profit > 0.01) and (last_candle['rsi_14'] > 80.0):
+ return True, 'sell_profit_rpd_1'
+
+ if (0.04 > current_profit > 0.01) and (last_candle['cti'] > 0.95):
+ return True, 'sell_profit_rpd_2'
+
+ if (0.04 > current_profit > 0.01) and (last_candle['r_14'] >= -0.1):
+ return True, 'sell_profit_rpd_3'
+
+ is_leverage = bool(re.match(leverage_pattern, trade.pair))
+ stop_index = 0 if not is_leverage else 1
+ if (
+ (current_profit < [-0.35, -0.35][stop_index])
+ ):
+ return True, 'sell_stoploss_rpd_stop_1'
+
+ return False, None
+
+ def sell_half_mode(self, trade: Trade, current_time: datetime, current_profit: float, max_profit:float, last_candle, previous_candle_1) -> tuple:
+ is_leverage = bool(re.match(leverage_pattern, trade.pair))
+ stop_index = 0 if not is_leverage else 1
+ if (
+ (current_profit < [-0.35, -0.35][stop_index])
+ ):
+ return True, 'sell_stoploss_hlf_stop_1'
+
+ return False, None
+
+ def mark_profit_target(self, pair: str, sell: bool, signal_name: str, trade: Trade, current_time: datetime, current_rate: float, current_profit: float, last_candle, previous_candle_1) -> tuple:
+ if self.profit_max_enabled:
+ if sell and (signal_name is not None):
+ return pair, signal_name
+
+ return None, None
+
+ def sell_profit_target(self, pair: str, trade: Trade, current_time: datetime, current_rate: float, current_profit: float, last_candle, previous_candle_1, previous_rate, previous_profit, previous_sell_reason, previous_time_profit_reached, enter_tags) -> tuple:
+ if self.profit_max_enabled:
+ if (previous_sell_reason in ["sell_stoploss_u_e_1"]):
+ if (current_profit < (previous_profit - 0.005)):
+ return True, previous_sell_reason
+ elif (previous_sell_reason in ["sell_stoploss_stop_2"]):
+ if (current_profit > 0.04):
+ # profit is over the threshold, don't exit
+ self._remove_profit_target(pair)
+ return False, None
+ if (current_profit < -0.18):
+ if (current_profit < (previous_profit - 0.06)):
+ return True, previous_sell_reason
+ elif (current_profit < -0.1):
+ if (current_profit < (previous_profit - 0.055)):
+ return True, previous_sell_reason
+ elif (current_profit < -0.04):
+ if (current_profit < (previous_profit - 0.05)):
+ return True, previous_sell_reason
+ else:
+ if (current_profit < (previous_profit - 0.045)):
+ return True, previous_sell_reason
+ elif (previous_sell_reason in ["sell_stoploss_doom_1", "sell_stoploss_stop_1", "sell_stoploss_rpd_stop_1", "sell_stoploss_hlf_stop_1"]):
+ if (current_profit < (previous_profit - 0.005)):
+ return True, previous_sell_reason
+ elif all(c in self.rapid_mode_tags for c in enter_tags):
+ if (current_profit < 0.01):
+ if ((current_profit < (previous_profit - 0.005)) or (last_candle['rsi_14'] > 90.0)):
+ return True, previous_sell_reason
+ elif (0.01 <= current_profit < 0.02):
+ if ((current_profit < (previous_profit - 0.01)) or (last_candle['rsi_14'] > 90.0)):
+ return True, previous_sell_reason
+ elif (0.02 <= current_profit < 0.03):
+ if ((current_profit < (previous_profit - 0.02)) or (last_candle['rsi_14'] > 90.0)):
+ return True, previous_sell_reason
+ elif (0.03 <= current_profit < 0.05):
+ if ((current_profit < (previous_profit - 0.025)) or (last_candle['rsi_14'] > 90.0)):
+ return True, previous_sell_reason
+ elif (0.05 <= current_profit < 0.08):
+ if ((current_profit < (previous_profit - 0.025)) or (last_candle['rsi_14'] > 90.0)):
+ return True, previous_sell_reason
+ elif (0.08 <= current_profit < 0.12):
+ if ((current_profit < (previous_profit - 0.025)) or (last_candle['rsi_14'] > 90.0)):
+ return True, previous_sell_reason
+ elif (0.12 <= current_profit):
+ if ((current_profit < (previous_profit - 0.03)) or (last_candle['rsi_14'] > 90.0)):
+ return True, previous_sell_reason
+ elif all(c in self.half_mode_tags for c in enter_tags):
+ if (0.001 <= current_profit < 0.01):
+ if ((current_profit < (previous_profit - 0.005)) or (last_candle['rsi_14'] > 90.0)):
+ return True, previous_sell_reason
+ elif (0.01 <= current_profit < 0.02):
+ if ((current_profit < (previous_profit - 0.01)) or (last_candle['rsi_14'] > 90.0)):
+ return True, previous_sell_reason
+ elif (0.02 <= current_profit < 0.03):
+ if ((current_profit < (previous_profit - 0.02)) or (last_candle['rsi_14'] > 90.0)):
+ return True, previous_sell_reason
+ elif (0.03 <= current_profit < 0.05):
+ if ((current_profit < (previous_profit - 0.025)) or (last_candle['rsi_14'] > 90.0)):
+ return True, previous_sell_reason
+ elif (0.05 <= current_profit < 0.08):
+ if ((current_profit < (previous_profit - 0.025)) or (last_candle['rsi_14'] > 90.0)):
+ return True, previous_sell_reason
+ elif (0.08 <= current_profit < 0.12):
+ if ((current_profit < (previous_profit - 0.025)) or (last_candle['rsi_14'] > 90.0)):
+ return True, previous_sell_reason
+ elif (0.12 <= current_profit):
+ if ((current_profit < (previous_profit - 0.03)) or (last_candle['rsi_14'] > 90.0)):
+ return True, previous_sell_reason
+ elif (previous_sell_reason in ["sell_profit_maximizer_01"]) and (current_profit >= 0.01):
+ if (0.001 <= current_profit < 0.01):
+ if ((current_profit < (previous_profit - 0.01)) or (last_candle['rsi_14'] > 90.0)):
+ return True, previous_sell_reason
+ elif (0.01 <= current_profit < 0.02):
+ if ((current_profit < (previous_profit - 0.01)) or (last_candle['rsi_14'] > 90.0)):
+ return True, previous_sell_reason
+ elif (0.02 <= current_profit < 0.03):
+ if ((current_profit < (previous_profit - 0.02)) or (last_candle['rsi_14'] > 90.0)):
+ return True, previous_sell_reason
+ elif (0.03 <= current_profit < 0.05):
+ if ((current_profit < (previous_profit - 0.03)) or (last_candle['rsi_14'] > 90.0)):
+ return True, previous_sell_reason
+ elif (0.05 <= current_profit < 0.08):
+ if ((current_profit < (previous_profit - 0.04)) or (last_candle['rsi_14'] > 90.0)):
+ return True, previous_sell_reason
+ elif (0.08 <= current_profit < 0.12):
+ if ((current_profit < (previous_profit - 0.05)) or (last_candle['rsi_14'] > 90.0)):
+ return True, previous_sell_reason
+ elif (0.12 <= current_profit):
+ if ((current_profit < (previous_profit - 0.06)) or (last_candle['rsi_14'] > 90.0)):
+ return True, previous_sell_reason
+ else:
+ if (0.001 <= current_profit < 0.01):
+ if ((current_profit < (previous_profit - 0.005)) or (last_candle['rsi_14'] > 90.0)):
+ return True, previous_sell_reason
+ elif (0.01 <= current_profit < 0.02):
+ if ((current_profit < (previous_profit - 0.01)) or (last_candle['rsi_14'] > 90.0)):
+ return True, previous_sell_reason
+ elif (0.02 <= current_profit < 0.03):
+ if ((current_profit < (previous_profit - 0.02)) or (last_candle['rsi_14'] > 90.0)):
+ return True, previous_sell_reason
+ elif (0.03 <= current_profit < 0.05):
+ if ((current_profit < (previous_profit - 0.025)) or (last_candle['rsi_14'] > 90.0)):
+ return True, previous_sell_reason
+ elif (0.05 <= current_profit < 0.08):
+ if ((current_profit < (previous_profit - 0.03)) or (last_candle['rsi_14'] > 90.0)):
+ return True, previous_sell_reason
+ elif (0.08 <= current_profit < 0.12):
+ if ((current_profit < (previous_profit - 0.035)) or (last_candle['rsi_14'] > 90.0)):
+ return True, previous_sell_reason
+ elif (0.12 <= current_profit):
+ if ((current_profit < (previous_profit - 0.04)) or (last_candle['rsi_14'] > 90.0)):
+ return True, previous_sell_reason
+
+ return False, None
+
+ def custom_exit(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,
+ current_profit: float, **kwargs):
+ dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)
+ if(len(dataframe) < 6):
+ return None
+ last_candle = dataframe.iloc[-1].squeeze()
+ previous_candle_1 = dataframe.iloc[-2].squeeze()
+ previous_candle_2 = dataframe.iloc[-3].squeeze()
+ previous_candle_3 = dataframe.iloc[-4].squeeze()
+ previous_candle_4 = dataframe.iloc[-5].squeeze()
+ previous_candle_5 = dataframe.iloc[-6].squeeze()
+
+ enter_tag = 'empty'
+ if hasattr(trade, 'enter_tag') and trade.enter_tag is not None:
+ enter_tag = trade.enter_tag
+ enter_tags = enter_tag.split()
+
+ max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)
+ max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)
+
+ if hasattr(trade, 'select_filled_orders'):
+ count_of_entries = 1
+ if (hasattr(trade, 'enter_side')):
+ filled_entries = trade.select_filled_orders(trade.enter_side)
+ count_of_entries = trade.nr_of_successful_entries
+ else:
+ filled_entries = trade.select_filled_orders('buy')
+ count_of_entries = len(filled_entries)
+ if count_of_entries > 1:
+ initial_entry = filled_entries[0]
+ if (initial_entry is not None and initial_entry.average is not None):
+ max_profit = ((trade.max_rate - initial_entry.average) / initial_entry.average)
+ max_loss = ((initial_entry.average - trade.min_rate) / trade.min_rate)
+
+ sell = False
+ signal_name = None
+ is_long_mode = all(c in ['31', '32', '33', '34', '35', '36'] for c in enter_tags)
+
+ # Long mode
+ if is_long_mode:
+ sell, signal_name = self.sell_long_mode(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tag)
+
+ # Quick sell mode
+ if not sell and not is_long_mode:
+ if all(c in ['empty', '58', '59', '60', '61', '62', '63', '64', '65'] for c in enter_tags):
+ sell, signal_name = self.sell_quick_mode(current_profit, max_profit, last_candle, previous_candle_1)
+
+ # Rapid sell mode
+ if not sell and not is_long_mode:
+ if all(c in self.rapid_mode_tags for c in enter_tags):
+ sell, signal_name = self.sell_rapid_mode(trade, current_time, current_profit, max_profit, last_candle, previous_candle_1)
+
+ # Half mode sells
+ if not sell and not is_long_mode:
+ if all(c in self.half_mode_tags for c in enter_tags):
+ sell, signal_name = self.sell_half_mode(trade, current_time, current_profit, max_profit, last_candle, previous_candle_1)
+
+ # Original sell signals
+ if not sell and not is_long_mode:
+ sell, signal_name = self.sell_signals(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tag)
+
+ # Stoplosses
+ if not sell and not is_long_mode:
+ sell, signal_name = self.sell_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)
+
+ # Over EMA200, main profit targets
+ if not sell and not is_long_mode:
+ sell, signal_name = self.sell_over_main(current_profit, last_candle)
+
+ # Under EMA200, main profit targets
+ if not sell and not is_long_mode:
+ sell, signal_name = self.sell_under_main(current_profit, last_candle)
+
+ # Recover
+ if not sell and not is_long_mode:
+ sell, signal_name = self.sell_recover(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)
+
+ # Williams %R based sells
+ if not sell and not is_long_mode:
+ sell, signal_name = self.sell_r(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)
+
+ # Trailing
+ if not sell and not is_long_mode:
+ sell, signal_name = self.sell_trail(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)
+
+ # The pair is descending
+ if not sell and not is_long_mode:
+ sell, signal_name = self.sell_dec_main(current_profit, last_candle)
+
+ # Sell logic for pumped pairs
+ if not sell and not is_long_mode:
+ sell, signal_name = self.sell_pump_main(current_profit, last_candle)
+
+ # Pivot points based sells
+ if not sell and not is_long_mode:
+ sell, signal_name = self.sell_pivot(current_profit, max_profit, max_loss, last_candle, previous_candle_1, trade, current_time)
+
+ # Profit Target Signal
+ # Check if pair exist on target_profit_cache
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_rate = self.target_profit_cache.data[pair]['rate']
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ previous_sell_reason = self.target_profit_cache.data[pair]['sell_reason']
+ previous_time_profit_reached = datetime.fromisoformat(self.target_profit_cache.data[pair]['time_profit_reached'])
+
+ sell_max, signal_name_max = self.sell_profit_target(pair, trade, current_time, current_rate, current_profit, last_candle, previous_candle_1, previous_rate, previous_profit, previous_sell_reason, previous_time_profit_reached, enter_tags)
+ if sell_max and signal_name_max is not None:
+ return f"{signal_name_max}_m ( {enter_tag})"
+ if (current_profit > (previous_profit + 0.03)) and (previous_sell_reason not in ["sell_stoploss_stop_2"]):
+ # Update the target, raise it.
+ mark_pair, mark_signal = self.mark_profit_target(pair, True, previous_sell_reason, trade, current_time, current_rate, current_profit, last_candle, previous_candle_1)
+ if mark_pair:
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+
+ # Add the pair to the list, if a sell triggered and conditions met
+ if sell and signal_name is not None:
+ previous_profit = None
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ if (
+ (previous_profit is None)
+ or (previous_profit < current_profit)
+ ):
+ mark_pair, mark_signal = self.mark_profit_target(pair, sell, signal_name, trade, current_time, current_rate, current_profit, last_candle, previous_candle_1)
+ if mark_pair:
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+ else:
+ # Just sell it, without maximize
+ return f"{signal_name} ( {enter_tag})"
+ else:
+ if (
+ (current_profit >= self.profit_max_threshold)
+ ):
+ previous_profit = None
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ if (previous_profit is None) or (previous_profit < current_profit):
+ mark_signal = "sell_profit_maximizer_01"
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+
+ if (
+ (not self.profit_max_enabled)
+ # Enable profit maximizer for the stoplosses
+ or (
+ (signal_name not in ["sell_profit_maximizer_01", "sell_stoploss_u_e_1", "sell_stoploss_doom_1", "sell_stoploss_stop_1", "sell_stoploss_stop_2", "sell_stoploss_rpd_stop_1", "sell_stoploss_hlf_stop_1"])
+ #and (not all(c in self.half_mode_tags for c in enter_tags))
+ )
+ ):
+ if sell and (signal_name is not None):
+ return f"{signal_name} ( {enter_tag})"
+
+ return None
+
+ def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:
+ """
+ Rolling Percentage Change Maximum across interval.
+
+ :param dataframe: DataFrame The original OHLC dataframe
+ :param method: High to Low / Open to Close
+ :param length: int The length to look back
+ """
+ if method == 'HL':
+ return (dataframe['high'].rolling(length).max() - dataframe['low'].rolling(length).min()) / dataframe['low'].rolling(length).min()
+ elif method == 'OC':
+ return (dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()) / dataframe['close'].rolling(length).min()
+ else:
+ raise ValueError(f"Method {method} not defined!")
+
+ def top_percent_change(self, dataframe: DataFrame, length: int) -> float:
+ """
+ Percentage change of the current close from the range maximum Open price
+
+ :param dataframe: DataFrame The original OHLC dataframe
+ :param length: int The length to look back
+ """
+ if length == 0:
+ return (dataframe['open'] - dataframe['close']) / dataframe['close']
+ else:
+ return (dataframe['open'].rolling(length).max() - dataframe['close']) / dataframe['close']
+
+ def informative_pairs(self):
+ # get access to all pairs available in whitelist.
+ pairs = self.dp.current_whitelist()
+ # Assign tf to each pair so they can be downloaded and cached for strategy.
+ informative_pairs = [(pair, self.info_timeframe_1h) for pair in pairs]
+ informative_pairs.extend([(pair, self.info_timeframe_1d) for pair in pairs])
+ informative_pairs.extend([(pair, self.info_timeframe_15m) for pair in pairs])
+
+ if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP', 'TRY', 'BRL']:
+ btc_info_pair = f"BTC/{self.config['stake_currency']}"
+ else:
+ btc_info_pair = "BTC/USDT"
+
+ informative_pairs.append((btc_info_pair, self.timeframe))
+ informative_pairs.append((btc_info_pair, self.info_timeframe_1d))
+ informative_pairs.append((btc_info_pair, self.info_timeframe_1h))
+ informative_pairs.append((btc_info_pair, self.info_timeframe_15m))
+ return informative_pairs
+
+ def informative_1d_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ tik = time.perf_counter()
+ assert self.dp, "DataProvider is required for multiple timeframes."
+ # Get the informative pair
+ informative_1d = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe_1d)
+
+ # Top traded coins
+ if self.coin_metrics['top_traded_enabled']:
+ informative_1d = informative_1d.merge(self.coin_metrics['tt_dataframe'], on='date', how='left')
+ informative_1d['is_top_traded'] = informative_1d.apply(lambda row: self.is_top_coin(metadata['pair'], row, self.coin_metrics['top_traded_len']), axis=1)
+ column_names = [f"Coin #{i}" for i in range(1, self.coin_metrics['top_traded_len'] + 1)]
+ informative_1d.drop(columns = column_names, inplace=True)
+ # Top grossing coins
+ if self.coin_metrics['top_grossing_enabled']:
+ informative_1d = informative_1d.merge(self.coin_metrics['tg_dataframe'], on='date', how='left')
+ informative_1d['is_top_grossing'] = informative_1d.apply(lambda row: self.is_top_coin(metadata['pair'], row, self.coin_metrics['top_grossing_len']), axis=1)
+ column_names = [f"Coin #{i}" for i in range(1, self.coin_metrics['top_grossing_len'] + 1)]
+ informative_1d.drop(columns = column_names, inplace=True)
+
+ # Pivots
+ informative_1d['pivot'], informative_1d['res1'], informative_1d['res2'], informative_1d['res3'], informative_1d['sup1'], informative_1d['sup2'], informative_1d['sup3'] = pivot_points(informative_1d, mode='fibonacci')
+
+ # Smoothed Heikin-Ashi
+ informative_1d['open_sha'], informative_1d['close_sha'], informative_1d['low_sha'] = heikin_ashi(informative_1d, smooth_inputs=True, smooth_outputs=False, length=10)
+
+ # S/R
+ res_series = informative_1d['high'].rolling(window = 5, center=True).apply(lambda row: is_resistance(row), raw=True).shift(2)
+ sup_series = informative_1d['low'].rolling(window = 5, center=True).apply(lambda row: is_support(row), raw=True).shift(2)
+ informative_1d['res_level'] = Series(np.where(res_series, np.where(informative_1d['close'] > informative_1d['open'], informative_1d['close'], informative_1d['open']), float('NaN'))).ffill()
+ informative_1d['res_hlevel'] = Series(np.where(res_series, informative_1d['high'], float('NaN'))).ffill()
+ informative_1d['sup_level'] = Series(np.where(sup_series, np.where(informative_1d['close'] < informative_1d['open'], informative_1d['close'], informative_1d['open']), float('NaN'))).ffill()
+
+ tok = time.perf_counter()
+ log.debug(f"[{metadata['pair']}] informative_1d_indicators took: {tok - tik:0.4f} seconds.")
+
+ return informative_1d
+
+ def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ tik = time.perf_counter()
+ assert self.dp, "DataProvider is required for multiple timeframes."
+ # Get the informative pair
+ informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe_1h)
+
+ # RSI
+ informative_1h['rsi_14'] = ta.RSI(informative_1h, timeperiod=14)
+
+ # EMAs
+ informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)
+ informative_1h['ema_20'] = ta.EMA(informative_1h, timeperiod=20)
+ informative_1h['ema_25'] = ta.EMA(informative_1h, timeperiod=25)
+ informative_1h['ema_35'] = ta.EMA(informative_1h, timeperiod=35)
+ informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)
+ informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)
+ informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)
+
+ # SMA
+ informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)
+
+ informative_1h['sma_200_dec_20'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(20)
+ informative_1h['sma_200_dec_24'] = informative_1h['sma_200'] < informative_1h['sma_200'].shift(24)
+
+ # BB
+ bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)
+ informative_1h['bb20_2_low'] = bollinger['lower']
+ informative_1h['bb20_2_mid'] = bollinger['mid']
+ informative_1h['bb20_2_upp'] = bollinger['upper']
+
+ informative_1h['bb20_width'] = ((informative_1h['bb20_2_upp'] - informative_1h['bb20_2_low']) / informative_1h['bb20_2_mid'])
+
+ # CMF
+ informative_1h['cmf'] = chaikin_money_flow(informative_1h, 20)
+
+ # CTI
+ informative_1h['cti'] = pta.cti(informative_1h["close"], length=20)
+
+ # CRSI (3, 2, 100)
+ crsi_closechange = informative_1h['close'] / informative_1h['close'].shift(1)
+ crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))
+ informative_1h['crsi'] = (ta.RSI(informative_1h['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(informative_1h['close'], 100)) / 3
+
+ # Williams %R
+ informative_1h['r_14'] = williams_r(informative_1h, period=14)
+ informative_1h['r_480'] = williams_r(informative_1h, period=480)
+
+ # EWO
+ informative_1h['ewo'] = ewo(informative_1h, 50, 200)
+
+ # ROC
+ informative_1h['roc_9'] = ta.ROC(informative_1h, timeperiod=9)
+
+ # T3 Average
+ informative_1h['t3_avg'] = t3_average(informative_1h)
+
+ # S/R
+ res_series = informative_1h['high'].rolling(window = 5, center=True).apply(lambda row: is_resistance(row), raw=True).shift(2)
+ sup_series = informative_1h['low'].rolling(window = 5, center=True).apply(lambda row: is_support(row), raw=True).shift(2)
+ informative_1h['res_level'] = Series(np.where(res_series, np.where(informative_1h['close'] > informative_1h['open'], informative_1h['close'], informative_1h['open']), float('NaN'))).ffill()
+ informative_1h['res_hlevel'] = Series(np.where(res_series, informative_1h['high'], float('NaN'))).ffill()
+ informative_1h['sup_level'] = Series(np.where(sup_series, np.where(informative_1h['close'] < informative_1h['open'], informative_1h['close'], informative_1h['open']), float('NaN'))).ffill()
+
+ # Pump protections
+ informative_1h['hl_pct_change_48'] = self.range_percent_change(informative_1h, 'HL', 48)
+ informative_1h['hl_pct_change_36'] = self.range_percent_change(informative_1h, 'HL', 36)
+ informative_1h['hl_pct_change_24'] = self.range_percent_change(informative_1h, 'HL', 24)
+ informative_1h['hl_pct_change_12'] = self.range_percent_change(informative_1h, 'HL', 12)
+ informative_1h['hl_pct_change_6'] = self.range_percent_change(informative_1h, 'HL', 6)
+
+ # 1h not strong downtrend
+ informative_1h['not_downtrend'] = ((informative_1h['close'] > informative_1h['close'].shift(2)) | (informative_1h['rsi_14'] > 50.0))
+
+ tok = time.perf_counter()
+ log.debug(f"[{metadata['pair']}] informative_1h_indicators took: {tok - tik:0.4f} seconds.")
+
+ return informative_1h
+
+ def informative_15m_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ tik = time.perf_counter()
+ assert self.dp, "DataProvider is required for multiple timeframes."
+ # Get the informative pair
+ informative_15m = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.info_timeframe_15m)
+
+ # RSI
+ informative_15m['rsi_14'] = ta.RSI(informative_15m, timeperiod=14)
+
+ # EMAs
+ informative_15m['ema_12'] = ta.EMA(informative_15m, timeperiod=12)
+ informative_15m['ema_16'] = ta.EMA(informative_15m, timeperiod=16)
+ informative_15m['ema_20'] = ta.EMA(informative_15m, timeperiod=20)
+ informative_15m['ema_26'] = ta.EMA(informative_15m, timeperiod=25)
+ informative_15m['ema_50'] = ta.EMA(informative_15m, timeperiod=50)
+ informative_15m['ema_100'] = ta.EMA(informative_15m, timeperiod=100)
+ informative_15m['ema_200'] = ta.EMA(informative_15m, timeperiod=200)
+
+ # SMA
+ informative_15m['sma_15'] = ta.SMA(informative_15m, timeperiod=15)
+ informative_15m['sma_30'] = ta.SMA(informative_15m, timeperiod=30)
+ informative_15m['sma_200'] = ta.SMA(informative_15m, timeperiod=200)
+
+ informative_15m['sma_200_dec_20'] = informative_15m['sma_200'] < informative_15m['sma_200'].shift(20)
+
+ # BB
+ bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_15m), window=20, stds=2)
+ informative_15m['bb20_2_low'] = bollinger['lower']
+ informative_15m['bb20_2_mid'] = bollinger['mid']
+ informative_15m['bb20_2_upp'] = bollinger['upper']
+
+ # BB 40 - STD2
+ bb_40_std2 = qtpylib.bollinger_bands(informative_15m['close'], window=40, stds=2)
+ informative_15m['bb40_2_low'] = bb_40_std2['lower']
+ informative_15m['bb40_2_mid'] = bb_40_std2['mid']
+ informative_15m['bb40_2_delta'] = (bb_40_std2['mid'] - informative_15m['bb40_2_low']).abs()
+ informative_15m['closedelta'] = (informative_15m['close'] - informative_15m['close'].shift()).abs()
+ informative_15m['tail'] = (informative_15m['close'] - informative_15m['bb40_2_low']).abs()
+
+ # CMF
+ informative_15m['cmf'] = chaikin_money_flow(informative_15m, 20)
+
+ # CTI
+ informative_15m['cti'] = pta.cti(informative_15m["close"], length=20)
+
+ # Williams %R
+ informative_15m['r_14'] = williams_r(informative_15m, period=14)
+ informative_15m['r_64'] = williams_r(informative_15m, period=64)
+ informative_15m['r_96'] = williams_r(informative_15m, period=96)
+
+ # EWO
+ informative_15m['ewo'] = ewo(informative_15m, 50, 200)
+
+ # CCI
+ informative_15m['cci'] = ta.CCI(informative_15m, source='hlc3', timeperiod=20)
+
+ # CRSI (3, 2, 100)
+ crsi_closechange = informative_15m['close'] / informative_15m['close'].shift(1)
+ crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))
+ informative_15m['crsi'] = (ta.RSI(informative_15m['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(informative_15m['close'], 100)) / 3
+
+ tok = time.perf_counter()
+ log.debug(f"[{metadata['pair']}] informative_1h_indicators took: {tok - tik:0.4f} seconds.")
+
+ return informative_15m
+
+ def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ tik = time.perf_counter()
+
+ # RSI
+ dataframe['rsi_4'] = ta.RSI(dataframe, timeperiod=4)
+ dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)
+ dataframe['rsi_84'] = ta.RSI(dataframe, timeperiod=84)
+ dataframe['rsi_112'] = ta.RSI(dataframe, timeperiod=112)
+
+ # EMAs
+ dataframe['ema_8'] = ta.EMA(dataframe, timeperiod=8)
+ dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)
+ dataframe['ema_13'] = ta.EMA(dataframe, timeperiod=13)
+ dataframe['ema_16'] = ta.EMA(dataframe, timeperiod=16)
+ dataframe['ema_20'] = ta.EMA(dataframe, timeperiod=20)
+ dataframe['ema_25'] = ta.EMA(dataframe, timeperiod=25)
+ dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)
+ dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)
+ dataframe['ema_100'] = ta.EMA(dataframe, timeperiod=100)
+ dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)
+
+ dataframe['ema_200_pct_change_144'] = ((dataframe['ema_200'] - dataframe['ema_200'].shift(144)) / dataframe['ema_200'].shift(144))
+ dataframe['ema_200_pct_change_288'] = ((dataframe['ema_200'] - dataframe['ema_200'].shift(288)) / dataframe['ema_200'].shift(288))
+
+ # SMA
+ dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15)
+ dataframe['sma_28'] = ta.SMA(dataframe, timeperiod=28)
+ dataframe['sma_30'] = ta.SMA(dataframe, timeperiod=30)
+ dataframe['sma_75'] = ta.SMA(dataframe, timeperiod=75)
+ dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)
+
+ dataframe['sma_200_dec_20'] = dataframe['sma_200'] < dataframe['sma_200'].shift(20)
+ dataframe['sma_200_dec_24'] = dataframe['sma_200'] < dataframe['sma_200'].shift(24)
+
+ # BB 40 - STD2
+ bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)
+ dataframe['bb40_2_low'] = bb_40_std2['lower']
+ dataframe['bb40_2_mid'] = bb_40_std2['mid']
+ dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()
+ dataframe['closedelta'] = (dataframe['close'] - dataframe['close'].shift()).abs()
+ dataframe['tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()
+
+ # BB 20 - STD2
+ bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)
+ dataframe['bb20_2_low'] = bb_20_std2['lower']
+ dataframe['bb20_2_mid'] = bb_20_std2['mid']
+ dataframe['bb20_2_upp'] = bb_20_std2['upper']
+
+ # BB 20 - STD3
+ bb_20_std3 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=3)
+ dataframe['bb20_3_low'] = bb_20_std3['lower']
+ dataframe['bb20_3_mid'] = bb_20_std3['mid']
+ dataframe['bb20_3_upp'] = bb_20_std3['upper']
+
+ dataframe['bb20_width'] = ((dataframe['bb20_2_upp'] - dataframe['bb20_2_low']) / dataframe['bb20_2_mid'])
+ dataframe['bb20_delta'] = ((dataframe['bb20_2_low'] - dataframe['bb20_3_low']) / dataframe['bb20_2_low'])
+
+ # CMF
+ dataframe['cmf'] = chaikin_money_flow(dataframe, 20)
+
+ # Williams %R
+ dataframe['r_14'] = williams_r(dataframe, period=14)
+ dataframe['r_24'] = williams_r(dataframe, period=24)
+ dataframe['r_32'] = williams_r(dataframe, period=32)
+ dataframe['r_64'] = williams_r(dataframe, period=64)
+ dataframe['r_96'] = williams_r(dataframe, period=96)
+ dataframe['r_480'] = williams_r(dataframe, period=480)
+
+ # CTI
+ dataframe['cti'] = pta.cti(dataframe["close"], length=20)
+
+ # CRSI (3, 2, 100)
+ crsi_closechange = dataframe['close'] / dataframe['close'].shift(1)
+ crsi_updown = np.where(crsi_closechange.gt(1), 1.0, np.where(crsi_closechange.lt(1), -1.0, 0.0))
+ dataframe['crsi'] = (ta.RSI(dataframe['close'], timeperiod=3) + ta.RSI(crsi_updown, timeperiod=2) + ta.ROC(dataframe['close'], 100)) / 3
+
+ # EMA of VWMA Oscillator
+ dataframe['ema_vwma_osc_32'] = ema_vwma_osc(dataframe, 32)
+ dataframe['ema_vwma_osc_64'] = ema_vwma_osc(dataframe, 64)
+ dataframe['ema_vwma_osc_96'] = ema_vwma_osc(dataframe, 96)
+
+ # EWO
+ dataframe['ewo'] = ewo(dataframe, 50, 200)
+
+ # CCI
+ dataframe['cci'] = ta.CCI(dataframe, source='hlc3', timeperiod=20)
+ dataframe['cci_25'] = ta.CCI(dataframe, source='hlc3', timeperiod=25)
+
+ # MFI
+ dataframe['mfi'] = ta.MFI(dataframe)
+
+ # RMI
+ dataframe['rmi_17'] = RMI(dataframe, length=17, mom=4)
+
+ # Stochastic fast
+ stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0)
+ dataframe['fastd'] = stoch_fast['fastd']
+ dataframe['fastk'] = stoch_fast['fastk']
+
+ # ADX
+ dataframe['adx'] = ta.ADX(dataframe)
+
+ # STOCHRSI
+ stoch = ta.STOCHRSI(dataframe, 15, 20, 2, 2)
+ dataframe['srsi_fk'] = stoch['fastk']
+ dataframe['srsi_fd'] = stoch['fastd']
+
+ # Close delta
+ dataframe['close_delta'] = (dataframe['close'] - dataframe['close'].shift(1)).abs()
+
+ # T3 Average
+ dataframe['t3_avg'] = t3_average(dataframe)
+
+ # Heiken Ashi
+ heikinashi = qtpylib.heikinashi(dataframe)
+ dataframe['ha_open'] = heikinashi['open']
+ dataframe['ha_close'] = heikinashi['close']
+ dataframe['ha_high'] = heikinashi['high']
+ dataframe['ha_low'] = heikinashi['low']
+
+ dataframe['ha_closedelta'] = (dataframe['ha_close'] - dataframe['ha_close'].shift()).abs()
+ dataframe['ha_tail'] = (dataframe['ha_close'] - dataframe['ha_low']).abs()
+
+ # True range
+ dataframe['trange'] = ta.TRANGE(dataframe)
+
+ # KC
+ dataframe['range_ma_28'] = ta.SMA(dataframe['trange'], 28)
+ dataframe['kc_upperband_28_1'] = dataframe['sma_28'] + dataframe['range_ma_28']
+ dataframe['kc_lowerband_28_1'] = dataframe['sma_28'] - dataframe['range_ma_28']
+
+ # Linreg
+ dataframe['hh_20'] = ta.MAX(dataframe['high'], 20)
+ dataframe['ll_20'] = ta.MIN(dataframe['low'], 20)
+ dataframe['avg_hh_ll_20'] = (dataframe['hh_20'] + dataframe['ll_20']) / 2.0
+ dataframe['avg_close_20'] = ta.SMA(dataframe['close'], 20)
+ dataframe['avg_val_20'] = (dataframe['avg_hh_ll_20'] + dataframe['avg_close_20']) / 2.0
+ dataframe['linreg_val_20'] = ta.LINEARREG(dataframe['close'] - dataframe['avg_val_20'], 20, 0)
+
+ # MAMA, FAMA, KAMA
+ dataframe['hl2'] = (dataframe['high'] + dataframe['low']) / 2.0
+ dataframe['mama'], dataframe['fama'] = ta.MAMA(dataframe['hl2'], 0.25, 0.025)
+ dataframe['mama_diff'] = ((dataframe['mama'] - dataframe['fama']) / dataframe['hl2'])
+ dataframe['kama'] = ta.KAMA(dataframe['close'], 84)
+
+ # Close max
+ dataframe['close_max_48'] = dataframe['close'].rolling(48).max()
+ dataframe['close_max_288'] = dataframe['close'].rolling(288).max()
+
+ # VWAP
+ vwap_low, vwap, vwap_high = vwap_bands(dataframe, 20, 1)
+ dataframe['vwap_upperband'] = vwap_high
+ dataframe['vwap_middleband'] = vwap
+ dataframe['vwap_lowerband'] = vwap_low
+ dataframe['vwap_width'] = ((dataframe['vwap_upperband'] - dataframe['vwap_lowerband']) / dataframe['vwap_middleband']) * 100
+
+ # ATR
+ dataframe['atr'] = ta.ATR(dataframe, timeperiod=14)
+
+ # For sell checks
+ dataframe['crossed_below_ema_12_26'] = qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26'])
+
+ # Volume
+ dataframe['vma_10'] = ta.SMA(dataframe['volume'], timeperiod=10)
+ dataframe['vma_20'] = ta.SMA(dataframe['volume'], timeperiod=20)
+ dataframe['vol_osc'] = (dataframe['vma_10'] - dataframe['vma_20']) / dataframe['vma_20'] * 100
+ dataframe['volume_mean_4'] = dataframe['volume'].rolling(4).mean().shift(1)
+ dataframe['volume_mean_12'] = dataframe['volume'].rolling(12).mean().shift(1)
+ dataframe['volume_mean_24'] = dataframe['volume'].rolling(24).mean().shift(1)
+
+ # Dip protection
+ dataframe['tpct_change_0'] = self.top_percent_change(dataframe,0)
+ dataframe['tpct_change_2'] = self.top_percent_change(dataframe,2)
+ dataframe['tpct_change_12'] = self.top_percent_change(dataframe,12)
+ dataframe['tpct_change_144'] = self.top_percent_change(dataframe,144)
+ # 3 hours, protect against wicks
+ dataframe['hl_pct_change_36'] = self.range_percent_change(dataframe, 'HL', 36)
+
+ if not self.config['runmode'].value in ('live', 'dry_run'):
+ # Backtest age filter
+ dataframe['bt_agefilter_ok'] = False
+ dataframe.loc[dataframe.index > (12 * 24 * self.bt_min_age_days),'bt_agefilter_ok'] = True
+ else:
+ # Exchange downtime protection
+ dataframe['live_data_ok'] = (dataframe['volume'].rolling(window=72, min_periods=72).min() > 0)
+
+ tok = time.perf_counter()
+ log.debug(f"[{metadata['pair']}] normal_tf_indicators took: {tok - tik:0.4f} seconds.")
+
+ return dataframe
+
+ def resampled_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ # Indicators
+ # -----------------------------------------------------------------------------------------
+ dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)
+
+ return dataframe
+
+ def base_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ tik = time.perf_counter()
+ # Indicators
+ # -----------------------------------------------------------------------------------------
+
+ # Dip protection
+ dataframe['tpct_change_144'] = self.top_percent_change(dataframe, 144)
+
+ # Close max
+ dataframe['close_max_24'] = dataframe['close'].rolling(24).max()
+ dataframe['close_max_72'] = dataframe['close'].rolling(72).max()
+
+ dataframe['pct_close_max_24'] = dataframe['close_max_24'] / dataframe['close']
+ dataframe['pct_close_max_72'] = dataframe['close_max_72'] / dataframe['close']
+
+ # Add prefix
+ # -----------------------------------------------------------------------------------------
+ ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']
+ dataframe.rename(columns=lambda s: f"btc_{s}" if s not in ignore_columns else s, inplace=True)
+
+ tok = time.perf_counter()
+ log.debug(f"[{metadata['pair']}] base_tf_btc_indicators took: {tok - tik:0.4f} seconds.")
+
+ return dataframe
+
+ def info_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ tik = time.perf_counter()
+ # Indicators
+ # -----------------------------------------------------------------------------------------
+ dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)
+ dataframe['not_downtrend'] = ((dataframe['close'] > dataframe['close'].shift(2)) | (dataframe['rsi_14'] > 50))
+
+ # Add prefix
+ # -----------------------------------------------------------------------------------------
+ ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']
+ dataframe.rename(columns=lambda s: f"btc_{s}" if s not in ignore_columns else s, inplace=True)
+
+ tok = time.perf_counter()
+ log.debug(f"[{metadata['pair']}] info_tf_btc_indicators took: {tok - tik:0.4f} seconds.")
+
+ return dataframe
+
+ def daily_tf_btc_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ tik = time.perf_counter()
+ # Indicators
+ # -----------------------------------------------------------------------------------------
+ dataframe['pivot'], dataframe['res1'], dataframe['res2'], dataframe['res3'], dataframe['sup1'], dataframe['sup2'], dataframe['sup3'] = pivot_points(dataframe, mode='fibonacci')
+
+ # Add prefix
+ # -----------------------------------------------------------------------------------------
+ ignore_columns = ['date', 'open', 'high', 'low', 'close', 'volume']
+ dataframe.rename(columns=lambda s: f"btc_{s}" if s not in ignore_columns else s, inplace=True)
+
+ tok = time.perf_counter()
+ log.debug(f"[{metadata['pair']}] daily_tf_btc_indicators took: {tok - tik:0.4f} seconds.")
+
+ return dataframe
+
+ def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ tik = time.perf_counter()
+ '''
+ --> BTC informative (5m/1h)
+ ___________________________________________________________________________________________
+ '''
+ if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP', 'TRY','BRL']:
+ btc_info_pair = f"BTC/{self.config['stake_currency']}"
+ else:
+ btc_info_pair = "BTC/USDT"
+
+ if self.has_BTC_daily_tf:
+ btc_daily_tf = self.dp.get_pair_dataframe(btc_info_pair, '1d')
+ btc_daily_tf = self.daily_tf_btc_indicators(btc_daily_tf, metadata)
+ dataframe = merge_informative_pair(dataframe, btc_daily_tf, self.timeframe, '1d', ffill=True)
+ drop_columns = [f"{s}_1d" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]
+ dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)
+
+ if self.has_BTC_info_tf:
+ btc_info_tf = self.dp.get_pair_dataframe(btc_info_pair, self.info_timeframe_1h)
+ btc_info_tf = self.info_tf_btc_indicators(btc_info_tf, metadata)
+ dataframe = merge_informative_pair(dataframe, btc_info_tf, self.timeframe, self.info_timeframe_1h, ffill=True)
+ drop_columns = [f"{s}_{self.info_timeframe_1h}" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]
+ dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)
+
+ if self.has_BTC_base_tf:
+ btc_base_tf = self.dp.get_pair_dataframe(btc_info_pair, self.timeframe)
+ btc_base_tf = self.base_tf_btc_indicators(btc_base_tf, metadata)
+ dataframe = merge_informative_pair(dataframe, btc_base_tf, self.timeframe, self.timeframe, ffill=True)
+ drop_columns = [f"{s}_{self.timeframe}" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]
+ dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)
+
+ '''
+ --> Informative timeframe
+ ___________________________________________________________________________________________
+ '''
+ if self.info_timeframe_1d != 'none':
+ informative_1d = self.informative_1d_indicators(dataframe, metadata)
+ dataframe = merge_informative_pair(dataframe, informative_1d, self.timeframe, self.info_timeframe_1d, ffill=True)
+ drop_columns = [f"{s}_{self.info_timeframe_1d}" for s in ['date','open', 'high', 'low', 'close', 'volume']]
+ dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)
+
+ if self.info_timeframe_1h != 'none':
+ informative_1h = self.informative_1h_indicators(dataframe, metadata)
+ dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.info_timeframe_1h, ffill=True)
+ drop_columns = [f"{s}_{self.info_timeframe_1h}" for s in ['date']]
+ dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)
+
+ if self.info_timeframe_15m != 'none':
+ informative_15m = self.informative_15m_indicators(dataframe, metadata)
+ dataframe = merge_informative_pair(dataframe, informative_15m, self.timeframe, self.info_timeframe_15m, ffill=True)
+ drop_columns = [f"{s}_{self.info_timeframe_15m}" for s in ['date']]
+ dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)
+
+ '''
+ --> Resampled to another timeframe
+ ___________________________________________________________________________________________
+ '''
+ if self.res_timeframe != 'none':
+ resampled = resample_to_interval(dataframe, timeframe_to_minutes(self.res_timeframe))
+ resampled = self.resampled_tf_indicators(resampled, metadata)
+ # Merge resampled info dataframe
+ dataframe = resampled_merge(dataframe, resampled, fill_na=True)
+ dataframe.rename(columns=lambda s: f"{s}_{self.res_timeframe}" if "resample_" in s else s, inplace=True)
+ dataframe.rename(columns=lambda s: s.replace("resample_{}_".format(self.res_timeframe.replace("m","")), ""), inplace=True)
+ drop_columns = [f"{s}_{self.res_timeframe}" for s in ['date']]
+ dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)
+
+ '''
+ --> The indicators for the normal (5m) timeframe
+ ___________________________________________________________________________________________
+ '''
+ dataframe = self.normal_tf_indicators(dataframe, metadata)
+
+ tok = time.perf_counter()
+ log.debug(f"[{metadata['pair']}] Populate indicators took a total of: {tok - tik:0.4f} seconds.")
+
+ return dataframe
+
+ def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ conditions = []
+ dataframe.loc[:, 'enter_tag'] = ''
+
+ # the number of free slots
+ current_free_slots = self.config["max_open_trades"] - len(LocalTrade.get_trades_proxy(is_open=True))
+
+ for index in self.buy_protection_params:
+ item_buy_protection_list = [True]
+ global_buy_protection_params = self.buy_protection_params[index]
+
+ if self.buy_params[f"buy_condition_{index}_enable"]:
+ # Standard protections - Common to every condition
+ # -----------------------------------------------------------------------------------------
+ if global_buy_protection_params["ema_fast"]:
+ item_buy_protection_list.append(dataframe[f"ema_{global_buy_protection_params['ema_fast_len']}"] > dataframe['ema_200'])
+ if global_buy_protection_params["ema_slow"]:
+ item_buy_protection_list.append(dataframe[f"ema_{global_buy_protection_params['ema_slow_len']}_1h"] > dataframe['ema_200_1h'])
+ if global_buy_protection_params["close_above_ema_fast"]:
+ item_buy_protection_list.append(dataframe['close'] > dataframe[f"ema_{global_buy_protection_params['close_above_ema_fast_len']}"])
+ if global_buy_protection_params["close_above_ema_slow"]:
+ item_buy_protection_list.append(dataframe['close'] > dataframe[f"ema_{global_buy_protection_params['close_above_ema_slow_len']}_1h"])
+ if global_buy_protection_params["sma200_rising"]:
+ item_buy_protection_list.append(dataframe['sma_200'] > dataframe['sma_200'].shift(int(global_buy_protection_params['sma200_rising_val'])))
+ if global_buy_protection_params["sma200_1h_rising"]:
+ item_buy_protection_list.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(int(global_buy_protection_params['sma200_1h_rising_val'])))
+ if global_buy_protection_params["safe_dips_threshold_0"] is not None:
+ item_buy_protection_list.append(dataframe['tpct_change_0'] < global_buy_protection_params["safe_dips_threshold_0"])
+ if global_buy_protection_params["safe_dips_threshold_2"] is not None:
+ item_buy_protection_list.append(dataframe['tpct_change_2'] < global_buy_protection_params["safe_dips_threshold_2"])
+ if global_buy_protection_params["safe_dips_threshold_12"] is not None:
+ item_buy_protection_list.append(dataframe['tpct_change_12'] < global_buy_protection_params["safe_dips_threshold_12"])
+ if global_buy_protection_params["safe_dips_threshold_144"] is not None:
+ item_buy_protection_list.append(dataframe['tpct_change_144'] < global_buy_protection_params["safe_dips_threshold_144"])
+ if global_buy_protection_params["safe_pump_6h_threshold"] is not None:
+ item_buy_protection_list.append(dataframe['hl_pct_change_6_1h'] < global_buy_protection_params["safe_pump_6h_threshold"])
+ if global_buy_protection_params["safe_pump_12h_threshold"] is not None:
+ item_buy_protection_list.append(dataframe['hl_pct_change_12_1h'] < global_buy_protection_params["safe_pump_12h_threshold"])
+ if global_buy_protection_params["safe_pump_24h_threshold"] is not None:
+ item_buy_protection_list.append(dataframe['hl_pct_change_24_1h'] < global_buy_protection_params["safe_pump_24h_threshold"])
+ if global_buy_protection_params["safe_pump_36h_threshold"] is not None:
+ item_buy_protection_list.append(dataframe['hl_pct_change_36_1h'] < global_buy_protection_params["safe_pump_36h_threshold"])
+ if global_buy_protection_params["safe_pump_48h_threshold"] is not None:
+ item_buy_protection_list.append(dataframe['hl_pct_change_48_1h'] < global_buy_protection_params["safe_pump_48h_threshold"])
+ if global_buy_protection_params['btc_1h_not_downtrend']:
+ item_buy_protection_list.append(dataframe['btc_not_downtrend_1h'])
+ if global_buy_protection_params['close_over_pivot_type'] != 'none':
+ item_buy_protection_list.append(dataframe['close'] > dataframe[f"{global_buy_protection_params['close_over_pivot_type']}_1d"] * global_buy_protection_params['close_over_pivot_offset'])
+ if global_buy_protection_params['close_under_pivot_type'] != 'none':
+ item_buy_protection_list.append(dataframe['close'] < dataframe[f"{global_buy_protection_params['close_under_pivot_type']}_1d"] * global_buy_protection_params['close_under_pivot_offset'])
+ if not self.config['runmode'].value in ('live', 'dry_run'):
+ if self.has_bt_agefilter:
+ item_buy_protection_list.append(dataframe['bt_agefilter_ok'])
+ else:
+ if self.has_downtime_protection:
+ item_buy_protection_list.append(dataframe['live_data_ok'])
+
+ # Buy conditions
+ # -----------------------------------------------------------------------------------------
+ item_buy_logic = []
+ item_buy_logic.append(reduce(lambda x, y: x & y, item_buy_protection_list))
+
+ # Condition #1 - Semi swing mode. Increase in the last candles & relative local dip.
+ if index == 1:
+ # Non-Standard protections
+
+ # Logic
+ item_buy_logic.append(((dataframe['close'] - dataframe['open'].rolling(12).min()) /
+ dataframe['open'].rolling(12).min()) > 0.027)
+ item_buy_logic.append(dataframe['rsi_14'] < 36.0)
+ item_buy_logic.append(dataframe['mfi'] < 36.0)
+ item_buy_logic.append(dataframe['r_480_1h'] > -99.0)
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['rsi_14'] < 33.0)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['ewo'] > 1.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['ha_close'] > dataframe['ha_open'])
+ | (dataframe['close'] < dataframe['sma_30'] * 0.95)
+ )
+ item_buy_logic.append(
+ (dataframe['r_32'] < -75.0)
+ | (dataframe['rsi_14'] < 33.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['ewo'] > 1.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['crsi_1h'] > 25.0)
+ | (dataframe['r_480_1h'] < -30.0)
+ | (dataframe['close'] < dataframe['sma_30'] * 0.95)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.1)
+ | (dataframe['rsi_14'] < 24.0)
+ | (dataframe['r_64'] < -90.0)
+ | (dataframe['r_96'] < -85.0)
+ | (dataframe['ewo'] > 1.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['crsi_1h'] > 25.0)
+ | (dataframe['close'] < dataframe['sma_30'] * 0.9)
+ )
+ item_buy_logic.append(
+ (dataframe['r_96'] < -85.0)
+ | (dataframe['ewo'] > 5.0)
+ | (dataframe['cti_1h'] < 0.25)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['ha_close'] > dataframe['ha_open'])
+ | (dataframe['close'] < dataframe['sma_30'] * 0.95)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.1)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['r_96'] < -85.0)
+ | (dataframe['ewo'] > 8.0)
+ | ((dataframe['rsi_14_1h'] < 40.0) & (dataframe['ha_close'] > dataframe['ha_open']))
+ | ((dataframe['cti_1h'] < -0.9) & (dataframe['r_480_1h'] < -20.0) & (dataframe['crsi_1h'] > 20.0))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.92)
+ )
+ item_buy_logic.append(
+ ((dataframe['btc_not_downtrend_1h'] == True) & (dataframe['cmf'] > 0.2))
+ | (dataframe['rsi_14'] < 28.0)
+ | (dataframe['r_96'] < -95.0)
+ | (dataframe['ewo'] > 2.0)
+ |
+ (
+ (dataframe['cti_1h'] < 0.5)
+ & (dataframe['crsi_1h'] > 20.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ )
+ | (dataframe['tpct_change_144'] < 0.16)
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.25)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ )
+ | (dataframe['close'] < dataframe['sma_30'] * 0.8)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 29.0)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['crsi_1h'] > 6.0)
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.94)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['rsi_14'] < 33.0)
+ | (dataframe['r_96'] < -90.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < dataframe['sma_30'] * 0.93)
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ )
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 40.0)
+ | (dataframe['rsi_14'] < 33.0)
+ | (dataframe['r_96'] < -90.0)
+ | (dataframe['cti_1h'] < 0.0)
+ |
+ (
+ (dataframe['crsi_1h'] > 20.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ )
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.96)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.2)
+ |
+ (
+ (dataframe['mfi'] > 30.0)
+ & (dataframe['hl_pct_change_48_1h'] < 0.9)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.26))
+ )
+ | (dataframe['rsi_14'] < 16.0)
+ | (dataframe['cti'] < -0.95)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['r_14_1h'] < -90.0)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ & (dataframe['hl_pct_change_48_1h'] < 0.9)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.26))
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ & (dataframe['hl_pct_change_48_1h'] < 0.9)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.26))
+ )
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.96))
+ & (dataframe['hl_pct_change_48_1h'] < 0.9)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.26))
+ )
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > 0.2)
+ & (dataframe['hl_pct_change_36'] < 0.22)
+ )
+ |
+ (
+ (dataframe['mfi'] > 30.0)
+ & (dataframe['hl_pct_change_36'] < 0.25)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ | (dataframe['rsi_14'] < 22.0)
+ |
+ (
+ (dataframe['cti'] < -0.93)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.3))
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ & (dataframe['hl_pct_change_36'] < 0.24)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['cti_1h'] < -0.5)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.04)
+ & (dataframe['hl_pct_change_48_1h'] < 0.6)
+ & (dataframe['hl_pct_change_36'] < 0.22)
+ )
+ | (dataframe['rsi_14_1h'] < 30.0)
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.12)
+ & (dataframe['close_max_48'] > (dataframe['close'] * 1.05))
+ )
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ & (dataframe['hl_pct_change_48_1h'] < 0.6)
+ & (dataframe['close_max_48'] > (dataframe['close'] * 1.05))
+ & (dataframe['hl_pct_change_36'] < 0.22)
+ )
+ |
+ (
+ (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['close_max_48'] > (dataframe['close'] * 1.05))
+ )
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.3)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['close_max_48'] > (dataframe['close'] * 1.05))
+ & (dataframe['hl_pct_change_36'] < 0.24)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['hl_pct_change_36'] < 0.25)
+ & (dataframe['close_max_48'] > (dataframe['close'] * 1.05))
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ |
+ (
+ (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.3))
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ & (dataframe['cti_1h'] < 0.85)
+ & (dataframe['ema_200_pct_change_144'] < 0.2)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['sma_30'] * 0.86)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.3))
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.89)
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.988)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.05))
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.3))
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ )
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.92))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ )
+ |
+ (
+ ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.034))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_6_1h'] < 0.3)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ )
+ |
+ (
+ (dataframe['rsi_14_15m'] < 12.0)
+ & (dataframe['close_max_48'] > (dataframe['close'] * 1.05))
+ & (dataframe['hl_pct_change_36'] < 0.24)
+ & (dataframe['not_downtrend_1h'])
+ )
+ | (dataframe['cti_15m'] < -0.95)
+ )
+
+ # Condition #2 - Semi swing. Local dip.
+ elif index == 2:
+ # Non-Standard protections
+
+ # Logic
+ item_buy_logic.append(dataframe['rsi_14'] < (dataframe['rsi_14_1h'] - 51.0))
+ item_buy_logic.append(dataframe['mfi'] < 46.0)
+ item_buy_logic.append(dataframe['cti'] < -0.9)
+ item_buy_logic.append(dataframe['r_14'] < -80.0)
+ item_buy_logic.append(dataframe['r_480'] > -95.0)
+ item_buy_logic.append(dataframe['cti_1h'] < 0.88)
+ item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_12'] * 1.0))
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.25)
+ & (dataframe['close_max_48'] >= (dataframe['close'] * 1.05))
+ )
+ |
+ (
+ (dataframe['cti_1h'] < 0.78)
+ & (dataframe['close_max_48'] >= (dataframe['close'] * 1.05))
+ )
+ | (dataframe['close'] < (dataframe['res2_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.938)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['close'] < dataframe['sma_30'] * 0.938)
+ | (dataframe['rsi_14'] < (dataframe['rsi_14_1h'] - 52.0))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.0)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ |
+ (
+ (dataframe['mfi'] > 20.0)
+ & (dataframe['close_max_48'] >= (dataframe['close'] * 1.06))
+ )
+ |
+ (
+ (dataframe['rsi_14'] < 15.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ )
+ | (dataframe['r_480'] > -30.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ | (dataframe['r_480_1h'] > -20.0)
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.16)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ & (dataframe['close_max_48'] >= (dataframe['close'] * 1.06))
+ )
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ & (dataframe['close_max_48'] >= (dataframe['close'] * 1.06))
+ )
+ |
+ (
+ (dataframe['hl_pct_change_36'] < 0.12)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ & (dataframe['close_max_48'] >= (dataframe['close'] * 1.06))
+ )
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.3)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ & (dataframe['close_max_48'] >= (dataframe['close'] * 1.06))
+ )
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ & (dataframe['close_max_48'] >= (dataframe['close'] * 1.06))
+ )
+ |
+ (
+ (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ | (dataframe['close'] < dataframe['sma_30'] * 0.93)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ & (dataframe['close_max_48'] >= (dataframe['close'] * 1.06))
+ )
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.999))
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ & (dataframe['close_max_48'] >= (dataframe['close'] * 1.06))
+ )
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+
+ # Condition #3 - Semi swing. Local dip.
+ elif index == 3:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))
+ item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.04))
+ item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * 0.02))
+ item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.4))
+ item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))
+ item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))
+ item_buy_logic.append(dataframe['cti_1h'] < 0.9)
+ item_buy_logic.append(dataframe['r_480_1h'] < -0.0)
+ item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_4'] * 3.2))
+ item_buy_logic.append(dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.1))
+ item_buy_logic.append(
+ (dataframe['crsi'] > 25.0)
+ | (dataframe['r_480'] > -50.0)
+ | (dataframe['crsi_1h'] > 18.0)
+ | (dataframe['r_480_1h'] > -50.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['ema_20'] > dataframe['ema_50'])
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.924)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.044))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['rsi_14'] < 10.0)
+ | (dataframe['crsi'] > 25.0)
+ | (dataframe['rsi_14_1h'] < 15.0)
+ | (dataframe['crsi_1h'] > 9.0)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.06))
+ | (dataframe['hl_pct_change_48_1h'] < 0.2)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ | (dataframe['ema_20'] > dataframe['ema_50'])
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.916)
+ | (dataframe['close'] > (dataframe['pivot_1d'] * 1.0))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['r_14_1h'] < -80.0)
+ | (dataframe['crsi_1h'] > 30.0)
+ | (dataframe['tpct_change_0'] < 0.025)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.02)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.934)
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.98))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ )
+ item_buy_logic.append(
+ (dataframe['rsi_14'] < 15.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['rsi_14_1h'] < 25.0)
+ |
+ (
+ (dataframe['cti'] < -0.8)
+ & (dataframe['crsi_1h'] > 25.0)
+ & (dataframe['hl_pct_change_48_1h'] < 0.6)
+ )
+ | (dataframe['crsi_1h'] > 50.0)
+ | (dataframe['tpct_change_0'] < 0.02)
+ | (dataframe['tpct_change_144'] < 0.14)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['ema_20'] > dataframe['ema_50'])
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.934)
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.96))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.05))
+ | (dataframe['close'] > (dataframe['pivot_1d'] * 1.0))
+ )
+ item_buy_logic.append(
+ (dataframe['cti_1h'] < -0.8)
+ | ((dataframe['cti'] < -0.8) & (dataframe['crsi_1h'] > 14.0))
+ | (dataframe['ema_20'] > dataframe['ema_50'])
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['close'] < dataframe['ema_20'] * 0.938)
+ | (dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.07))
+ | (dataframe['closedelta'].gt(dataframe['close'] * 0.024))
+ | (dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.12))
+ )
+ item_buy_logic.append(
+ ((dataframe['btc_not_downtrend_1h'] == True) & (dataframe['crsi_1h'] > 16.0))
+ | (dataframe['tpct_change_0'] < 0.02)
+ | (dataframe['tpct_change_144'] < 0.08)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.06))
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.946)
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.97))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.04))
+ | (dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.062))
+ | (dataframe['closedelta'].gt(dataframe['close'] * 0.03))
+ | (dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.02))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['r_480'] > -30.0)
+ | (dataframe['crsi'] > 20.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 20.0)
+ | (dataframe['tpct_change_0'] < 0.02)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.936)
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.98))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ | (dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.08))
+ | (dataframe['closedelta'].gt(dataframe['close'] * 0.024))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cti'] < -0.8)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['tpct_change_0'] < 0.02)
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['close'] < dataframe['ema_20'] * 0.964)
+ | (dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.06))
+ | (dataframe['closedelta'].gt(dataframe['close'] * 0.022))
+ | (dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.01))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ )
+ |
+ (
+ (dataframe['cmf'] > 0.0)
+ & (dataframe['rsi_14'] < 36.0)
+ )
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['crsi'] > 25.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['r_14_1h'] < -95.0)
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.16)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ & (dataframe['rsi_14'] < 36.0)
+ )
+ | (dataframe['tpct_change_144'] < 0.08)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.06))
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.3)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ & (dataframe['rsi_14'] < 36.0)
+ )
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['rsi_14'] < 36.0)
+ )
+ |
+ (
+ (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ & (dataframe['rsi_14'] < 36.0)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['ema_20'] > dataframe['ema_50'])
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low'] * 0.985))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.97))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.04))
+ |
+ (
+ (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ & (dataframe['rsi_14'] < 36.0)
+ )
+ )
+ item_buy_logic.append(
+ (dataframe['rsi_14'] < 20.0)
+ |
+ (
+ (dataframe['cti'] < -0.8)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ )
+ | (dataframe['crsi'] > 25.0)
+ | (dataframe['cti_1h'] < 0.25)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['tpct_change_144'] < 0.08)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.06))
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.938)
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.98))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ | ((dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.056)) & (dataframe['closedelta'].gt(dataframe['close'] * 0.024)))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.938)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ | ((dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.048)) & (dataframe['closedelta'].gt(dataframe['close'] * 0.021)))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti_1h'] < -0.95)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['r_14_1h'] < -95.0)
+ | (dataframe['tpct_change_144'] < 0.06)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.06))
+ | (dataframe['hl_pct_change_48_1h'] < 0.16)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.938)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ | ((dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.048)) & (dataframe['closedelta'].gt(dataframe['close'] * 0.021)))
+ )
+ item_buy_logic.append(
+ (dataframe['rsi_14'] < 20.0)
+ | (dataframe['crsi'] > 20.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['r_14_1h'] < -95.0)
+ | (dataframe['crsi_1h'] > 14.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ )
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['ema_20'] > dataframe['ema_50'])
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.94))
+ | (dataframe['close'] > (dataframe['sup2_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.98))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03))
+ | ((dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.048)) & (dataframe['closedelta'].gt(dataframe['close'] * 0.023)))
+ )
+ item_buy_logic.append(
+ (dataframe['rsi_14'] < 20.0)
+ | (dataframe['crsi'] > 25.0)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['r_14_1h'] < -90.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['ema_20'] > dataframe['ema_50'])
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.926)
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.975))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ | ((dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.065)) & (dataframe['closedelta'].gt(dataframe['close'] * 0.026)) & (dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.15)))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['crsi'] > 20.0)
+ | (dataframe['rsi_14_1h'] < 20.0)
+ | (dataframe['crsi_1h'] > 8.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['r_480'] > -30.0)
+ | (dataframe['crsi'] > 20.0)
+ | (dataframe['rsi_14_1h'] < 20.0)
+ | (dataframe['r_14_1h'] < -90.0)
+ | (dataframe['crsi_1h'] > 10.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['ema_20'] > dataframe['ema_50'])
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.8))
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.946)
+ |
+ (
+ (dataframe['close'] > (dataframe['sup2_1d'] * 1.0))
+ & (dataframe['close'] > (dataframe['sma_200_1h'] * 0.7))
+ )
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.999))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03))
+ | (dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.074))
+ | (dataframe['closedelta'].gt(dataframe['close'] * 0.032))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['crsi'] > 20.0)
+ | (dataframe['rsi_14_1h'] < 45.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['r_14_1h'] < -90.0)
+ | (dataframe['hl_pct_change_48_1h'] < 0.2)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.98))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ | (dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.06))
+ | (dataframe['closedelta'].gt(dataframe['close'] * 0.024))
+ | (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.4))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.1)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['r_480'] > -30.0)
+ | (dataframe['crsi'] > 20.0)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['crsi_1h'] > 16.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.999))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ | (dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.066))
+ | (dataframe['closedelta'].gt(dataframe['close'] * 0.028))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.1)
+ | (dataframe['r_480'] > -30.0)
+ | (dataframe['crsi'] > 20.0)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['hl_pct_change_48_1h'] < 0.2)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.03))
+ | (dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.09))
+ | (dataframe['closedelta'].gt(dataframe['close'] * 0.024))
+ | (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.2))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['r_480'] > -30.0)
+ | (dataframe['crsi'] > 20.0)
+ |
+ (
+ (dataframe['rsi_14_1h'] < 20.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ )
+ | (dataframe['r_14_1h'] < -98.0)
+ | (dataframe['crsi_1h'] > 12.0)
+ | (dataframe['tpct_change_0'] < 0.02)
+ | (dataframe['tpct_change_144'] < 0.14)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['ema_20'] > dataframe['ema_50'])
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ | (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.06))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.91))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['rsi_14'] < 24.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['tpct_change_0'] < 0.02)
+ | (dataframe['tpct_change_12'] < 0.1)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ | (dataframe['ema_20'] > dataframe['ema_50'])
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['ema_50'] > dataframe['ema_200'])
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.975)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 24.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['r_14'] < -90.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['tpct_change_0'] < 0.02)
+ | (dataframe['tpct_change_12'] < 0.06)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['ema_20'] > dataframe['ema_50'])
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['ema_50'] > dataframe['ema_200'])
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 15.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['crsi_1h'] > 10.0)
+ | (dataframe['tpct_change_12'] < 0.08)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['ema_20'] > dataframe['ema_50'])
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['ema_50'] > dataframe['ema_200'])
+ | (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ & (dataframe['tpct_change_144'] < 0.26)
+ )
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ )
+ item_buy_logic.append(
+ (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['r_14'] < -75.0)
+ | (dataframe['ewo'] > 1.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_12'] < 0.08)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['ema_20'] > dataframe['ema_50'])
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['ema_50'] > dataframe['ema_200'])
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < dataframe['sma_30'] * 0.9)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | (dataframe['closedelta'].gt(dataframe['close'] * 0.04))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['r_480'] > -30.0)
+ | (dataframe['crsi'] > 20.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.97))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03))
+ )
+ item_buy_logic.append(
+ (dataframe['rsi_14'] < 36.0)
+ | (dataframe['cti'] < -0.5)
+ | (dataframe['r_480'] > -30.0)
+ | (dataframe['crsi'] > 20.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['r_14_1h'] < -90.0)
+ | (dataframe['crsi_1h'] > 10.0)
+ | (dataframe['tpct_change_144'] < 0.05)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.96)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.999))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.014))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['crsi_1h'] > 10.0)
+ | (dataframe['tpct_change_0'] < 0.024)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_0'] < 0.02)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.14))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > 0.2)
+ & (dataframe['ema_200_pct_change_144'] > -0.1)
+ )
+ |
+ (
+ (dataframe['mfi'] > 36.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ )
+ |
+ (
+ (dataframe['rsi_14'] < 28.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['cti'] < -0.9)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['cti_1h'] < -0.8)
+ & (dataframe['rsi_14'] < 36.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['ema_200_pct_change_144'] > -0.1)
+ )
+ |
+ (
+ (dataframe['rsi_14_1h'] < 30.0)
+ & (dataframe['rsi_14'] < 36.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['ema_200_pct_change_144'] > -0.1)
+ )
+ |
+ (
+ (dataframe['crsi_1h'] > 25.0)
+ & (dataframe['hl_pct_change_48_1h'] < 0.45)
+ & (dataframe['rsi_14'] < 36.0)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ & (dataframe['btc_pct_close_max_24_5m'] < 1.04)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ )
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.08)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ )
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.04)
+ & (dataframe['rsi_14'] < 36.0)
+ )
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.25)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['rsi_14'] < 36.0)
+ & (dataframe['btc_pct_close_max_24_5m'] < 1.04)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ & (dataframe['hl_pct_change_48_1h'] < 0.45)
+ & (dataframe['rsi_14'] < 36.0)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ |
+ (
+ (dataframe['close'] > (dataframe['sma_200'] * 0.95))
+ & (dataframe['crsi_1h'] > 16.0)
+ & (dataframe['hl_pct_change_48_1h'] < 0.45)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['btc_pct_close_max_24_5m'] < 1.04)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ )
+ |
+ (
+ (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ & (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ & (dataframe['hl_pct_change_48_1h'] < 0.45)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ & (dataframe['btc_pct_close_max_24_5m'] < 1.04)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['ema_200_pct_change_288'] < 0.25)
+ & (dataframe['r_480_1h'] < -12.0)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.978)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ |
+ (
+ (dataframe['rsi_14_15m'] < 28.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['ema_200_pct_change_144'] > -0.1)
+ & (dataframe['not_downtrend_1h'])
+ )
+ | (dataframe['cti_15m'] < -0.92)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 50.0)
+ | (dataframe['rsi_14'] < 30.0)
+ |
+ (
+ (dataframe['cti'] < -0.8)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.04)
+ )
+ |
+ (
+ (dataframe['cti_1h'] < -0.9)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ )
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['crsi_1h'] > 40.0)
+ |
+ (
+ (dataframe['tpct_change_0'] < 0.02)
+ & (dataframe['crsi_1h'] > 10.0)
+ )
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.08)
+ & (dataframe['crsi_1h'] > 16.0)
+ )
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ & (dataframe['crsi_1h'] > 16.0)
+ )
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.2)
+ & (dataframe['crsi_1h'] > 10.0)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ |
+ (
+ (dataframe['close'] > (dataframe['sma_200'] * 0.95))
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['crsi_1h'] > 10.0)
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.985)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 16.0)
+ | (dataframe['cti'] < -0.95)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['r_14_1h'] < -90.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.87)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.07))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.96))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 25.0)
+ | (dataframe['rsi_14'] < 12.0)
+ | (dataframe['cti'] < -0.96)
+ | (dataframe['ewo'] > 1.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['rsi_14_1h'] < 10.0)
+ | (dataframe['crsi_1h'] > 10.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.02)
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.048))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.95))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.06))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti'] < -0.95)
+ | (dataframe['crsi'] > 20.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['r_14_1h'] < -95.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.94)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.98))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03))
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 40.0)
+ | (dataframe['rsi_14'] < 16.0)
+ | (dataframe['cti'] < -0.95)
+ | (dataframe['crsi'] > 16.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['rsi_14_1h'] < 20.0)
+ | (dataframe['r_14_1h'] < -95.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.85)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.88)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.06))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.935))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.05))
+ | (dataframe['cti_15m'] < -0.95)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ |
+ (
+ (dataframe['mfi'] > 20.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.1)
+ )
+ | (dataframe['rsi_14'] < 12.0)
+ |
+ (
+ (dataframe['cti'] < -0.9)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.24))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.02)
+ & (dataframe['tpct_change_144'] < 0.16)
+ )
+ | (dataframe['r_480'] > -30.0)
+ | (dataframe['crsi'] > 20.0)
+ | (dataframe['cti_1h'] < -0.0)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['r_14_1h'] < -95.0)
+ | (dataframe['tpct_change_0'] < 0.016)
+ | (dataframe['tpct_change_144'] < 0.08)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['ema_100'] > (dataframe['ema_200'] * 1.05))
+ |
+ (
+ (dataframe['close'] < dataframe['sma_30'] * 0.9)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.24))
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.24))
+ )
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.05))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.93))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03))
+ | (dataframe['rsi_14_15m'] < 20.0)
+ | (dataframe['cti_15m'] < -0.9)
+ |
+ (
+ (dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.05))
+ & (dataframe['closedelta'].gt(dataframe['close'] * 0.026))
+ & (dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.2))
+ )
+ | (dataframe['close_delta'] > dataframe['close'] * 32.0 / 1000)
+ | (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 2.0))
+ )
+
+ # Condition #4 - Semi swing. Local dip.
+ elif index == 4:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.75))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 1.0)
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])
+ item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))
+ item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.995))
+ item_buy_logic.append(dataframe['cti_1h'] < 0.82)
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['rsi_14'] < 22.0)
+ | (dataframe['cti'] < -0.95)
+ | (dataframe['r_14'] < -95.0)
+ | (dataframe['rsi_14_1h'] < 20.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['tpct_change_144'] < 0.3)
+ )
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ |
+ (
+ (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ & (dataframe['tpct_change_144'] < 0.3)
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.038))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.036))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 40.0)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.022))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.0)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.95))
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.95)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 40.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['crsi'] > 40.0)
+ |
+ (
+ (dataframe['cti_1h'] < -0.9)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ )
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.95))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | (dataframe['close'] < dataframe['sma_30'] * 0.9)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.03))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 40.0)
+ | (dataframe['rsi_14'] < 10.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['crsi'] > 30.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.14))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.96)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > 0.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['crsi_1h'] > 14.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.98))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 8.0)
+ | (dataframe['ewo'] < -10.0)
+ | (dataframe['mfi'] > 24.0)
+ | (dataframe['crsi'] > 40.0)
+ | (dataframe['cti_1h'] < -0.95)
+ | (dataframe['rsi_14_1h'] < 25.0)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.88)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.96))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.93))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.034))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 5.0)
+ | (dataframe['ewo'] < -10.0)
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['rsi_14'] < 15.0)
+ | (dataframe['cti'] < -0.95)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['tpct_change_144'] < 0.14)
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.985))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['r_480_1h'] < -14.0)
+ & (dataframe['volume'] < (dataframe['volume_mean_4'] * 5.0))
+ )
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.985)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 25.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['rsi_14_1h'] < 20.0)
+ | (dataframe['crsi_1h'] > 30.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.85)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.94)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.048))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.1)
+ | (dataframe['mfi'] > 46.0)
+ |
+ (
+ (dataframe['rsi_14'] < 12.0)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ | (dataframe['cti'] < -0.95)
+ |
+ (
+ (dataframe['cti_1h'] < -0.8)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['btc_pct_close_max_24_5m'] < 1.04)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ & (dataframe['not_downtrend_1h'])
+ )
+ | (dataframe['rsi_14_1h'] < 20.0)
+ |
+ (
+ (dataframe['r_14_1h'] < -97.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['crsi_1h'] > 20.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ & (dataframe['tpct_change_144'] < 0.3)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.25))
+ & (dataframe['btc_pct_close_max_24_5m'] < 1.04)
+ )
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.16)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['hl_pct_change_48_1h'] < 0.16)
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['tpct_change_144'] < 0.25)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ |
+ (
+ (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.25))
+ & (dataframe['btc_pct_close_max_24_5m'] < 1.04)
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.88)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.955)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.05))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.89))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.04))
+ |
+ (
+ (dataframe['rsi_14_15m'] < 15.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ )
+
+ # Condition #5 - Semi swing. Local dip. Uptrend.
+ elif index == 5:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))
+ item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.934)
+ item_buy_logic.append(dataframe['ewo'] > 2.4)
+ item_buy_logic.append(dataframe['cti'] < -0.9)
+ item_buy_logic.append(dataframe['r_14'] < -90.0)
+ item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > 0.0)
+ | (dataframe['mfi'] > 40.0)
+ | (dataframe['ewo'] > 5.0)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['crsi_1h'] > 30.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.96)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 25.0)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.995)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.024))
+ | (dataframe['rsi_14_15m'] < 30.0)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 50.0)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ & (dataframe['hl_pct_change_24_1h'] < 0.5)
+ )
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.044))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['mfi'] > 36.0)
+ |
+ (
+ (dataframe['rsi_14'] < 18.0)
+ & (dataframe['hl_pct_change_48_1h'] < 0.7)
+ )
+ | (dataframe['crsi'] > 20.0)
+ |
+ (
+ (dataframe['cti_1h'] < 0.8)
+ & (dataframe['hl_pct_change_48_1h'] < 0.7)
+ & (dataframe['ema_200_pct_change_144'] < 0.12)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['not_downtrend_1h'])
+ )
+ | (dataframe['rsi_14_1h'] < 40.0)
+ |
+ (
+ (dataframe['r_14_1h'] < -75.0)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ )
+ |
+ (
+ (dataframe['crsi_1h'] > 40.0)
+ & (dataframe['ema_200_pct_change_144'] < 0.1)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['cti_1h'] < 0.8)
+ )
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.4)
+ & (dataframe['ema_200_pct_change_144'] < 0.1)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.89)
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.97))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ |
+ (
+ (dataframe['rsi_14_15m'] < 30.0)
+ & (dataframe['hl_pct_change_48_1h'] < 0.7)
+ )
+ )
+
+ # Condition #6 - Semi swing. Local dip.
+ elif index == 6:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.8))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 1.0)
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < dataframe['sma_15'] * 0.938)
+ item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))
+ item_buy_logic.append(dataframe['r_480_1h'] < -1.0)
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 36.0)
+ | (dataframe['cti_1h'] < -0.95)
+ | (dataframe['rsi_14_1h'] < 20.0)
+ | (dataframe['crsi_1h'] > 25.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | ((dataframe['btc_pct_close_max_72_5m'] < 1.03) & (dataframe['btc_not_downtrend_1h'] == True))
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.95))
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.89)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.95)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.1)
+ | (dataframe['mfi'] > 10.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.975)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.038))
+ | (dataframe['rsi_14_15m'] < 20.0)
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.2)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.08)
+ )
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 10.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['rsi_14_1h'] < 20.0)
+ | (dataframe['crsi_1h'] > 25.0)
+ | (dataframe['tpct_change_144'] < 0.14)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.044))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.2)
+ | (dataframe['mfi'] > 10.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['rsi_14_1h'] < 20.0)
+ | (dataframe['crsi_1h'] > 10.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 50.0)
+ | (dataframe['cti_1h'] < -0.95)
+ | (dataframe['rsi_14_1h'] < 20.0)
+ | (dataframe['crsi_1h'] > 16.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(48))
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.95)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.036))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 25.0)
+ | (dataframe['rsi_14_1h'] < 20.0)
+ | (dataframe['crsi_1h'] > 10.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(48))
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.89)
+ & (dataframe['btc_pct_close_max_24_5m'] < 1.05)
+ )
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.96)
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.044))
+ & (dataframe['btc_pct_close_max_24_5m'] < 1.05)
+ )
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > 0.3)
+ & (dataframe['mfi'] > 30.0)
+ )
+ | (dataframe['rsi_14'] < 5.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < -0.95)
+ | (dataframe['rsi_14_1h'] < 6.0)
+ | (dataframe['tpct_change_144'] < 0.08)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.028))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.87)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.955)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.05))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.0)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 15.0)
+ | (dataframe['cti_1h'] < -0.95)
+ |
+ (
+ (dataframe['rsi_14_1h'] < 25.0)
+ & (dataframe['crsi_1h'] > 4.0)
+ )
+ |
+ (
+ (dataframe['r_14_1h'] < -98.0)
+ & (dataframe['crsi_1h'] > 4.0)
+ )
+ | (dataframe['crsi_1h'] > 30.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['hl_pct_change_48_1h'] < 0.2)
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ & (dataframe['crsi_1h'] > 5.0)
+ )
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.044))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 50.0)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.89)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.044))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 10.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ |
+ (
+ (dataframe['crsi_1h'] > 25.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.04)
+ )
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.88)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.96)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.054))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['mfi'] > 30.0)
+ |
+ (
+ (dataframe['rsi_14'] < 20.0)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ )
+ | (dataframe['crsi'] > 10.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -90.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['hl_pct_change_48_1h'] < 0.2)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.87)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.95)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.04))
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99))
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ )
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.012))
+ |
+ (
+ (dataframe['rsi_14_15m'] < 30.0)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ )
+ | (dataframe['cti_15m'] < -0.9)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 20.0)
+ |
+ (
+ (dataframe['rsi_14'] < 30.0)
+ & (dataframe['ema_200_pct_change_144'] < 0.25)
+ )
+ | (dataframe['cti'] < -0.95)
+ |
+ (
+ (dataframe['crsi'] > 20.0)
+ & (dataframe['ema_200_pct_change_144'] < 0.25)
+ )
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.14))
+ & (dataframe['ema_200_pct_change_144'] < 0.25)
+ )
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ |
+ (
+ (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ & (dataframe['ema_200_pct_change_144'] < 0.25)
+ )
+ | (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ |
+ (
+ (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ & (dataframe['ema_200_pct_change_144'] < 0.25)
+ )
+ | (dataframe['close'] < dataframe['sma_30'] * 0.92)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.985)
+ & (dataframe['ema_200_pct_change_144'] < 0.25)
+ )
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.999))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > 0.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ & (dataframe['hl_pct_change_36'] < 0.14)
+ )
+ |
+ (
+ (dataframe['mfi'] > 25.0)
+ & (dataframe['hl_pct_change_36'] < 0.14)
+ )
+ |
+ (
+ (dataframe['rsi_14'] < 15.0)
+ & (dataframe['crsi_1h'] > 2.0)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ |
+ (
+ (dataframe['cti'] < -0.9)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ & (dataframe['crsi_1h'] > 2.0)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['crsi_1h'] > 20.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ & (dataframe['tpct_change_2'] < 0.06)
+ )
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.16)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ & (dataframe['tpct_change_2'] < 0.06)
+ )
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ & (dataframe['tpct_change_2'] < 0.06)
+ )
+ |
+ (
+ (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ & (dataframe['hl_pct_change_36'] < 0.14)
+ )
+ |
+ (
+ (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(48))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ & (dataframe['tpct_change_2'] < 0.06)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ |
+ (
+ (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ & (dataframe['hl_pct_change_36'] < 0.14)
+ & (dataframe['tpct_change_2'] < 0.06)
+ )
+ |
+ (
+ (dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ & (dataframe['tpct_change_2'] < 0.06)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['sma_30'] * 0.88)
+ & (dataframe['hl_pct_change_36'] < 0.24)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ & (dataframe['hl_pct_change_36'] < 0.24)
+ )
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.96)
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.04))
+ & (dataframe['hl_pct_change_36'] < 0.24)
+ )
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.93))
+ & (dataframe['hl_pct_change_36'] < 0.24)
+ )
+ |
+ (
+ ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.04))
+ & (dataframe['crsi_1h'] > 5.0)
+ & (dataframe['hl_pct_change_36'] < 0.24)
+ )
+ )
+
+ # Condition #7 - Semi swing. Local dip.
+ elif index == 7:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * 0.94)
+ item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * 0.998)
+ item_buy_logic.append(dataframe['cti'] < -0.9)
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.2)
+ | (dataframe['mfi'] > 46.0)
+ | (dataframe['crsi'] > 20.0)
+ | (dataframe['cmf_1h'] > 0.1)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['rsi_14_1h'] < 20.0)
+ | (dataframe['tpct_change_144'] < 0.08)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ | (dataframe['hl_pct_change_48_1h'] < 0.12)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.044))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 40.0)
+ | (dataframe['rsi_14'] < 12.0)
+ |
+ (
+ (dataframe['cti_1h'] < -0.9)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ )
+ | (dataframe['rsi_14_1h'] < 30.0)
+ |
+ (
+ (dataframe['r_14_1h'] < -95.0)
+ & (dataframe['tpct_change_144'] < 0.25)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ )
+ | (dataframe['tpct_change_144'] < 0.08)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ |
+ (
+ (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ & (dataframe['hl_pct_change_36'] < 0.14)
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.044))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.94))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.048))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > 0.1)
+ & (dataframe['cti_1h'] < -0.0)
+ )
+ |
+ (
+ (dataframe['mfi'] > 25.0)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ |
+ (
+ (dataframe['crsi'] > 10.0)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ | (dataframe['cmf_1h'] > 0.2)
+ |
+ (
+ (dataframe['cti_1h'] < -0.8)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['crsi'] > 5.0)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['rsi_14_1h'] < 30.0)
+ & (dataframe['crsi'] > 5.0)
+ )
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['cti_1h'] < 0.8)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['crsi'] > 5.0)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.98))
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ & (dataframe['not_downtrend_1h'])
+ )
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['crsi_1h'] > 16.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.995)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.024))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.1)
+ | (dataframe['mfi'] > 36.0)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['crsi_1h'] > 36.0)
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.14)
+ & (dataframe['ema_200_pct_change_288'] < 0.1)
+ )
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.88)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+
+ # Condition #8 - Semi swing. Local deeper dip. Uptrend.
+ elif index == 8:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+ item_buy_logic.append(dataframe['ema_200_pct_change_144'] < 0.2)
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * 0.938)
+ item_buy_logic.append(dataframe['ewo'] > 2.0)
+ item_buy_logic.append(dataframe['rsi_14'] < 36.0)
+ item_buy_logic.append(
+ (
+ (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['close'] < (dataframe['res2_1d'] * 1.0))
+ )
+ | (dataframe['ewo'] > 8.0)
+ |
+ (
+ (dataframe['cmf'] > -0.1)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ )
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['r_480'] > -30.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['r_14_1h'] < -90.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.995)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.985))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 6.0)
+ | (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 10.0)
+ | (dataframe['r_480'] > -30.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ |
+ (
+ (dataframe['r_14_1h'] < -90.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ )
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ | (dataframe['hl_pct_change_48_1h'] < 0.2)
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.986)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.975))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 9.4)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['r_480'] > -30.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['r_14_1h'] < -95.0)
+ | (dataframe['tpct_change_144'] < 0.14)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.96))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 10.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['r_480'] > -25.0)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['hl_pct_change_48_1h'] < 0.22)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.97))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 8.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['rsi_14'] < 15.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.926)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.22))
+ )
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.96)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 7.0)
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 12.0)
+ | (dataframe['cmf'] > -0.1)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti'] < -0.95)
+ |
+ (
+ (dataframe['r_480'] > -50.0)
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ )
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ |
+ (
+ (dataframe['r_480_1h'] < -5.0)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ )
+ |
+ (
+ (dataframe['r_480_1h'] > -50.0)
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ )
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.014))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.975)
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.95))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['ewo'] > 7.0)
+ | (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 40.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['crsi_1h'] > 40.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > 0.1)
+ | (dataframe['mfi'] > 40.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['ewo'] > 3.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['crsi_1h'] > 40.0)
+ | (dataframe['tpct_change_144'] < 0.14)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.024))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 10.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['crsi_1h'] > 30.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['hl_pct_change_48_1h'] < 0.2)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.96)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 50.0)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.044))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 16.0)
+ | (dataframe['cti'] < -0.95)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['r_14_1h'] < -90.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.87)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.07))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.96))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.1)
+ | (dataframe['mfi'] > 40.0)
+ | (dataframe['rsi_14'] < 30.0)
+ |
+ (
+ (dataframe['cti'] < -0.8)
+ & (dataframe['cti_1h'] < 0.88)
+ )
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.999))
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > 0.1)
+ & (dataframe['cti_1h'] < 0.85)
+ )
+ |
+ (
+ (dataframe['mfi'] > 46.0)
+ & (dataframe['cti_1h'] < 0.85)
+ )
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['crsi'] > 40.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -90.0)
+ |
+ (
+ (dataframe['crsi_1h'] > 45.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.08)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ )
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ )
+ | (dataframe['hl_pct_change_48_1h'] < 0.26)
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.965)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.04))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.965))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.2)
+ | (dataframe['mfi'] > 40.0)
+ | (dataframe['rsi_14'] < 28.0)
+ | (dataframe['r_480'] > -30.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ | (dataframe['r_480_1h'] > -20.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['hl_pct_change_36'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.89)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ & (dataframe['ema_200_pct_change_144'] < 0.1)
+ )
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.985))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.1)
+ & (dataframe['ema_200_pct_change_288'] < 0.18)
+ & (dataframe['hl_pct_change_6_1h'] < 0.25)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ & (dataframe['tpct_change_2'] < 0.06)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['mfi'] > 40.0)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ |
+ (
+ (dataframe['rsi_14'] < 20.0)
+ & (dataframe['hl_pct_change_6_1h'] < 0.25)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ & (dataframe['tpct_change_2'] < 0.06)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ |
+ (
+ (dataframe['r_480'] > -30.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ |
+ (
+ (dataframe['ewo'] > 6.0)
+ & (dataframe['hl_pct_change_6_1h'] < 0.25)
+ )
+ |
+ (
+ (dataframe['cti_1h'] < 0.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ )
+ | (dataframe['rsi_14_1h'] < 40.0)
+ |
+ (
+ (dataframe['r_14_1h'] < -90.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.2)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ )
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.1)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ & (dataframe['tpct_change_2'] < 0.06)
+ )
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ & (dataframe['tpct_change_2'] < 0.06)
+ )
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.3)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.04)
+ & (dataframe['cmf'] > -0.3)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['cti_1h'] < 0.8)
+ & (dataframe['cmf'] > -0.3)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ & (dataframe['crsi_1h'] > 10.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ |
+ (
+ (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ | (dataframe['close'] < dataframe['sma_30'] * 0.88)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ & (dataframe['tpct_change_2'] < 0.06)
+ )
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.98))
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['crsi_1h'] > 10.0)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ & (dataframe['ema_200_pct_change_288'] < 0.2)
+ )
+ | (dataframe['rsi_14_15m'] < 20.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+
+ # Condition #9 - Semi swing. Local dip. Downtrend.
+ elif index == 9:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_100_1h'])
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < dataframe['sma_30'] * 0.97)
+ item_buy_logic.append(dataframe['ewo'] < -2.0)
+ item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * 0.995)
+ item_buy_logic.append(dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.75))
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['ewo'] < -9.0)
+ | (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['tpct_change_144'] < 0.14)
+ | (dataframe['ema_50'] > dataframe['ema_200'])
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['ewo'] < -4.8)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] < -3.8)
+ | (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['ema_50'] > dataframe['ema_200'])
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['tpct_change_144'] < 0.26)
+ | (dataframe['ewo'] < -3.0)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 16.0)
+ | (dataframe['ewo'] < -7.4)
+ | (dataframe['crsi_1h'] > 16.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.985)
+ )
+ item_buy_logic.append(
+ (dataframe['cti'] < -0.9)
+ | (dataframe['ewo'] < -13.0)
+ | (dataframe['cti_1h'] < -0.98)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] < -5.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 10.0)
+ | (dataframe['ewo'] < -6.0)
+ | ((dataframe['cti_1h'] < -0.0) & (dataframe['cti_1h'] > -0.9))
+ | (dataframe['crsi_1h'] > 30.0)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.96)
+ | (dataframe['close'] < dataframe['sma_30'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 36.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['ewo'] < -6.0)
+ | (dataframe['crsi_1h'] > 30.0)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.05))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.02)
+ | (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['ewo'] < -6.0)
+ | (dataframe['cti_1h'] < -0.95)
+ | (dataframe['rsi_14_1h'] < 20.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.08)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.05))
+ | (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.95)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['mfi'] > 40.0)
+ | (dataframe['rsi_14'] < 20.0)
+ |
+ (
+ (dataframe['cti'] < -0.95)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ )
+ | (dataframe['crsi'] > 20.0)
+ |
+ (
+ (dataframe['cti_1h'] < -0.9)
+ & (dataframe['rsi_14'] < 30.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ )
+ | (dataframe['rsi_14_1h'] < 30.0)
+ |
+ (
+ (dataframe['crsi_1h'] > 25.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ & (dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ & (dataframe['rsi_14'] < 30.0)
+ )
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.16)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ )
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.06))
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.3)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['sma_30'] * 0.9)
+ & (dataframe['btc_pct_close_max_24_5m'] < 1.05)
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ & (dataframe['btc_pct_close_max_24_5m'] < 1.05)
+ )
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ )
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.05))
+ | (dataframe['rsi_14_15m'] < 20.0)
+ | (dataframe['cti_15m'] < -0.95)
+ )
+
+ # Condition #10 - Semi swing. Local dip.
+ elif index == 10:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.8))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])
+ item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.0145))
+ item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))
+ item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.994))
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ |(dataframe['cmf'] > 0.1)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['r_480'] > -30.0)
+ | (dataframe['rsi_14_1h'] < 20.0)
+ | (dataframe['crsi_1h'] > 22.0)
+ | (dataframe['tpct_change_144'] < 0.08)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.04))
+ |
+ (
+ ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03))
+ & (dataframe['tpct_change_144'] < 0.3)
+ )
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['r_480'] > -30.0)
+ | (dataframe['crsi'] > 20.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.986))
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.942)
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.97))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.75)
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.016))
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.99))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['rsi_14'] < 15.0)
+ | (dataframe['r_480'] > -30.0)
+ | (dataframe['crsi'] > 20.0)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.04))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.95))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['r_480'] > -30.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.04))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.95))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.2)
+ & (dataframe['cti_1h'] < 0.8)
+ )
+ | (dataframe['r_480'] > -30.0)
+ | (dataframe['crsi'] > 20.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['r_14_1h'] < -96.0)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ | (dataframe['hl_pct_change_48_1h'] < 0.2)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.024))
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.985))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.96))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['r_480'] > -30.0)
+ | (dataframe['crsi'] > 20.0)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ | (dataframe['crsi_1h'] > 30.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['hl_pct_change_24_1h'] < 0.5)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.975))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03))
+ )
+ item_buy_logic.append(
+ (dataframe['cti'] < -0.9)
+ | (dataframe['r_480'] > -16.0)
+ | (dataframe['cti_1h'] < -0.95)
+ | (dataframe['rsi_14_1h'] < 18.0)
+ | (dataframe['tpct_change_144'] < 0.06)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.06))
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.046))
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.955))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.91))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.06))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 15.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['ewo'] > 1.0)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_12'] < 0.08)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['ema_20'] > dataframe['ema_50'])
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['ema_50'] > dataframe['ema_200'])
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.05))
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.98))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 25.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti'] < -0.95)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['crsi_1h'] > 36.0)
+ | (dataframe['tpct_change_12'] < 0.05)
+ | (dataframe['tpct_change_144'] < 0.08)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ | (dataframe['hl_pct_change_48_1h'] < 0.2)
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['cti_1h'] < 0.8)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.99))
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.2)
+ & (dataframe['hl_pct_change_48_1h'] < 0.7)
+ & (dataframe['crsi_1h'] > 2.0)
+ )
+ |
+ (
+ (dataframe['mfi'] > 30.0)
+ & ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.0155))
+ )
+ |
+ (
+ (dataframe['rsi_14'] < 10.0)
+ & (dataframe['tpct_change_144'] < 0.22)
+ )
+ |
+ (
+ (dataframe['cti'] < -0.92)
+ & (dataframe['hl_pct_change_48_1h'] < 0.7)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['cmf'] > -0.4)
+ & (dataframe['tpct_change_144'] < 0.22)
+ & (dataframe['crsi_1h'] > 2.0)
+ )
+ | (dataframe['r_480'] > -30.0)
+ | (dataframe['crsi'] > 30.0)
+ |
+ (
+ (dataframe['cti_1h'] < -0.5)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['cmf'] > -0.4)
+ & (dataframe['tpct_change_144'] < 0.22)
+ & (dataframe['hl_pct_change_36'] < 0.1)
+ & (dataframe['crsi_1h'] > 2.0)
+ )
+ |
+ (
+ (dataframe['rsi_14_1h'] < 30.0)
+ & (dataframe['crsi_1h'] > 2.0)
+ & (dataframe['crsi'] > 10.0)
+ & (dataframe['crsi_1h'] > 16.0)
+ )
+ |
+ (
+ (dataframe['r_14_1h'] < -95.0)
+ & ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.0155))
+ & (dataframe['tpct_change_144'] < 0.22)
+ )
+ |
+ (
+ (dataframe['crsi_1h'] > 30.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_36'] < 0.1)
+ )
+ | (dataframe['tpct_change_144'] < 0.08)
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ & (dataframe['cmf'] > -0.4)
+ )
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['hl_pct_change_48_1h'] < 0.7)
+ & ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.0155))
+ & (dataframe['tpct_change_144'] < 0.22)
+ & (dataframe['hl_pct_change_36'] < 0.1)
+ & (dataframe['crsi'] > 10.0)
+ & (dataframe['crsi_1h'] > 16.0)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ |
+ (
+ (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ & (dataframe['hl_pct_change_48_1h'] < 0.7)
+ )
+ |
+ (
+ (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ & (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ & (dataframe['hl_pct_change_48_1h'] < 0.7)
+ & ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.0155))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['cti_1h'] < 0.8)
+ )
+ | (dataframe['close'] < dataframe['sma_30'] * 0.85)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.88)
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ & (dataframe['cmf'] > -0.5)
+ )
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.05))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.91))
+ |
+ (
+ ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ )
+ | (dataframe['cti_15m'] < -0.9)
+ )
+
+ # Condition #11 - Semi swing. Local dip.
+ elif index == 11:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])
+ item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.018))
+ item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))
+ item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.934)
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['crsi_1h'] > 4.0)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.9))
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ )
+ item_buy_logic.append(
+ (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ | (dataframe['crsi_1h'] > 25.0)
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.78))
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.15))
+ )
+ item_buy_logic.append(
+ (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['ema_50'] > dataframe['ema_200'])
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.95))
+ | (dataframe['mfi'] > 8.0)
+ | (dataframe['crsi'] > 16.0)
+ | (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.9))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['crsi_1h'] > 16.0)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.95))
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.94))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.024))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['crsi_1h'] > 16.0)
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.94))
+ | (dataframe['close'] > (dataframe['sup2_1d'] * 1.0))
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.9))
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.94))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.024))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ | (dataframe['close'] > (dataframe['sup2_1d'] * 1.0))
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.032))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.3)
+ | (dataframe['ewo'] > 1.0)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['ewo'] > 2.0)
+ | (dataframe['cti_1h'] < 0.0)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['ewo'] > 3.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 8.0)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['crsi_1h'] > 25.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 6.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close'] > dataframe['ema_200_1h'])
+ | (dataframe['ema_50_1h'] > dataframe['ema_200_1h'])
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 4.0)
+ | (dataframe['mfi'] > 36.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 8.0)
+ | (dataframe['mfi'] > 36.0)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['r_480_1h'] < -16.0)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.2)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.036))
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 6.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['tpct_change_12'] < 0.16)
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.044))
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 1.0)
+ |
+ (
+ (dataframe['cmf'] > -0.1)
+ & (dataframe['hl_pct_change_48_1h'] < 0.8)
+ )
+ | (dataframe['mfi'] > 46.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti_1h'] < -0.92)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.04))
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['ewo'] > 2.0)
+ | (dataframe['cti'] < -0.5)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.022))
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > 0.0)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['ewo'] > 2.0)
+ | (dataframe['cti'] < -0.8)
+ | (dataframe['cti_1h'] < - 0.5)
+ | (dataframe['tpct_change_12'] < 0.12)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.038))
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 10.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['crsi_1h'] > 30.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.024))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 50.0)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ |
+ (
+ (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['tpct_change_144'] < 0.2)
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.965)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.044))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > 0.0)
+ & (dataframe['cti_1h'] < 0.85)
+ )
+ |
+ (
+ (dataframe['mfi'] > 30.0)
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ )
+ | (dataframe['rsi_14'] < 16.0)
+ |
+ (
+ (dataframe['cti'] < -0.95)
+ & (dataframe['cti_1h'] < 0.85)
+ )
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['r_14_1h'] < -90.0)
+ | (dataframe['tpct_change_144'] < 0.14)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.14))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.87)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.975)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.07))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.96))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > 0.0)
+ & (dataframe['ema_200_pct_change_144'] < 0.2)
+ )
+ |
+ (
+ (dataframe['mfi'] > 30.0)
+ & (dataframe['cti_1h'] < 0.85)
+ & (dataframe['ema_200_pct_change_144'] < 0.3)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ |
+ (
+ (dataframe['rsi_14'] < 15.0)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ | (dataframe['cti_1h'] < -0.9)
+ |
+ (
+ (dataframe['rsi_14_1h'] < 40.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['r_14_1h'] < -90.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ )
+ |
+ (
+ (dataframe['crsi_1h'] > 40.0)
+ & (dataframe['cti_1h'] < 0.85)
+ & (dataframe['ema_200_pct_change_144'] < 0.3)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ |
+ (
+ (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ & (dataframe['hl_pct_change_48_1h'] < 0.7)
+ & (dataframe['close'] > (dataframe['sma_200'] * 0.95))
+ )
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.4)
+ & (dataframe['close'] > (dataframe['sma_200'] * 0.95))
+ )
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['hl_pct_change_48_1h'] < 0.8)
+ & (dataframe['close'] > (dataframe['sma_200'] * 0.95))
+ & (dataframe['ema_200_pct_change_144'] < 0.2)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.88)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.985)
+ & (dataframe['cti_1h'] < 0.85)
+ & (dataframe['ema_200_pct_change_144'] < 0.3)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.044))
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.955))
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03))
+ |
+ (
+ (dataframe['rsi_14_15m'] < 20.0)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ | (dataframe['cti_15m'] < -0.9)
+ )
+
+ # Condition #12 - Semi swing. Local deeper dip. Uptrend.
+ elif index == 12:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.8))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.934)
+ item_buy_logic.append(dataframe['ewo'] > 0.1)
+ item_buy_logic.append(dataframe['rsi_14'] < 40.0)
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['ewo'] > 2.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['crsi_1h'] > 16.0)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['ewo'] > 6.0)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.97))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['ewo'] > 6.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['crsi_1h'] > 16.0)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['ewo'] > 13.0)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 10.0)
+ | (dataframe['rsi_14'] < 12.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.955)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_12'] < 0.1)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > 0.0)
+ | (dataframe['rsi_14'] < 15.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['r_96'] < -80.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['tpct_change_12'] < 0.12)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.96)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.02)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.96))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.0)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 16.0)
+ |
+ (
+ (dataframe['cti'] < -0.95)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ )
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['r_14_1h'] < -94.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.87)
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.22))
+ )
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.07))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.95))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['rsi_14'] < 8.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['r_14_1h'] < -95.0)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.94))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['rsi_14'] < 8.0)
+ | (dataframe['cti'] < -0.95)
+ | (dataframe['crsi'] > 10.0)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['hl_pct_change_36'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ | ((dataframe['btc_pct_close_max_72_5m'] < 1.01) & (dataframe['btc_not_downtrend_1h'] == True))
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.85)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.88)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.95)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.044))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.94))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ | (dataframe['cti_15m'] < -0.9)
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > 0.0)
+ & (dataframe['tpct_change_2'] < 0.06)
+ & (dataframe['rsi_14_1h'] < 80.0)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ )
+ | (dataframe['mfi'] > 40.0)
+ |
+ (
+ (dataframe['rsi_14'] < 20.0)
+ & (dataframe['tpct_change_2'] < 0.06)
+ )
+ |
+ (
+ (dataframe['cti'] < -0.9)
+ & (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['crsi'] > 30.0)
+ & (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ )
+ |
+ (
+ (dataframe['cti_1h'] < 0.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['cmf'] > -0.4)
+ )
+ | (dataframe['rsi_14_1h'] < 30.0)
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.16)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['tpct_change_2'] < 0.06)
+ )
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['tpct_change_2'] < 0.06)
+ )
+ |
+ (
+ (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['tpct_change_2'] < 0.06)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ | (dataframe['hl_pct_change_48_1h'] < 0.2)
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['cti_1h'] < 0.5)
+ & (dataframe['tpct_change_144'] < 0.26)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['cmf'] > -0.4)
+ )
+ |
+ (
+ (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ & (dataframe['ema_200_pct_change_144'] < 0.2)
+ & (dataframe['rsi_14_1h'] < 80.0)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ )
+ |
+ (
+ (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ & (dataframe['tpct_change_2'] < 0.06)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ | (dataframe['close'] < dataframe['sma_30'] * 0.86)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.89)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.95)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.038))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.92))
+ |
+ (
+ ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ )
+ | (dataframe['rsi_14_15m'] < 20.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+
+ # Condition #13 - Semi swing. Downtrend. Local dip.
+ elif index == 13:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.999)
+ item_buy_logic.append(dataframe['ewo'] < -3.6)
+ item_buy_logic.append(dataframe['cti'] < -0.97)
+ item_buy_logic.append(dataframe['crsi_1h'] > 6.0)
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['crsi_1h'] > 12.0)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] < -6.2)
+ | (dataframe['crsi_1h'] > 12.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ | (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24))
+ | (dataframe['cmf'] > 0.0)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] < -8.2)
+ | (dataframe['crsi_1h'] > 12.0)
+ | (dataframe['tpct_change_144'] < 0.25)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ | (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24))
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.7))
+ | (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ | (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.0))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] < -6.6)
+ | (dataframe['crsi_1h'] > 8.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ | (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24))
+ | (dataframe['cmf'] > 0.0)
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.75))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.944)
+ )
+ item_buy_logic.append(
+ (
+ ((dataframe['ewo'] < -7.6) | (dataframe['close'] > (dataframe['sup3_1d'] * 1.0)))
+ & ((dataframe['ewo'] < -8.0) | (dataframe['close'] > (dataframe['sup2_1d'] * 1.0)))
+ & ((dataframe['ewo'] < -6.6) | (dataframe['close'] > (dataframe['sup1_1d'] * 1.0)))
+ & ((dataframe['ewo'] < -9.0) | (dataframe['close'] > (dataframe['sup1_1d'] * 1.0)) | (dataframe['cmf'] > -0.2))
+ )
+ | (dataframe['crsi_1h'] > 14.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ | (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24))
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.85))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.954)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] < -6.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ | (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24))
+ | (dataframe['close'] > (dataframe['sup2_1d'] * 1.0))
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.85))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.944)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['ewo'] < -12.0)
+ | (dataframe['crsi_1h'] > 25.0)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ | (dataframe['close'] > (dataframe['sup2_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.934)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] < -5.0)
+ | (dataframe['cmf'] > -0.1)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.944)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.985)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] < -6.0)
+ | (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.944)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.985)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] < -12.0)
+ | (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.928)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.992)
+ | (dataframe['btc_tpct_change_144_5m'] < 0.02)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] < -12.0)
+ |
+ (
+ (dataframe['cmf'] > -0.1)
+ & (dataframe['crsi_1h'] > 8.0)
+ & (dataframe['ema_200_pct_change_288'] > -0.16)
+ )
+ |
+ (
+ (dataframe['mfi'] > 30.0)
+ & (dataframe['crsi_1h'] > 8.0)
+ & (dataframe['ema_200_pct_change_288'] > -0.16)
+ )
+ |
+ (
+ (dataframe['cti_1h'] < -0.8)
+ & (dataframe['ema_200_pct_change_288'] > -0.16)
+ )
+ | (dataframe['crsi_1h'] > 25.0)
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.2)
+ & (dataframe['crsi_1h'] > 8.0)
+ & (dataframe['ema_200_pct_change_288'] > -0.16)
+ )
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['crsi_1h'] > 8.0)
+ & (dataframe['ema_200_pct_change_288'] > -0.16)
+ )
+ |
+ (
+ (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ & (dataframe['crsi_1h'] > 8.0)
+ & (dataframe['ema_200_pct_change_288'] > -0.16)
+ )
+ |
+ (
+ (dataframe['close'] > (dataframe['sma_200_1h'] * 0.9))
+ & (dataframe['tpct_change_144'] < 0.25)
+ & (dataframe['crsi_1h'] > 8.0)
+ & (dataframe['ema_200_pct_change_288'] > -0.16)
+ )
+ |
+ (
+ (dataframe['close'] > (dataframe['sup2_1d'] * 1.0))
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['tpct_change_144'] < 0.25)
+ & (dataframe['crsi_1h'] > 8.0)
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] < -6.0)
+ | (dataframe['cmf'] > 0.0)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ )
+
+ # Condition #14 - Semi swing. Strong uptrend. Local dip.
+ elif index == 14:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['ema_100_1h'] > dataframe['ema_100_1h'].shift(12))
+ item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(36))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.985))
+ item_buy_logic.append(dataframe['ewo'] > 2.4)
+ item_buy_logic.append(dataframe['rsi_14'] < 36.0)
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['ewo'] > 4.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 11.0)
+ | ((dataframe['cmf'] > -0.1) & (dataframe['mfi'] > 30.0))
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | ((dataframe['tpct_change_144'] < 0.2)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['cti_1h'] < 0.5)
+ & (dataframe['r_480_1h'] < -20.0)
+ & (dataframe['rsi_14'] < 30.0))
+ | ((dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['rsi_14'] < 30.0)
+ & (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ & (dataframe['cti_1h'] < 0.8)
+ & (dataframe['crsi_1h'] > 20.0)
+ & (dataframe['r_480_1h'] < -20.0)
+ & (dataframe['tpct_change_144'] < 0.2)
+ & (dataframe['hl_pct_change_48_1h'] < 0.3))
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.02))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.96)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 7.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | ((dataframe['cmf'] > -0.2)
+ & (dataframe['mfi'] > 10.0)
+ & (dataframe['cti'] < -0.5))
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | ((dataframe['tpct_change_144'] < 0.12)
+ & (dataframe['hl_pct_change_48_1h'] < 0.3)
+ & (dataframe['cti_1h'] < 0.5))
+ | ((dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ & (dataframe['cti_1h'] < 0.5)
+ & (dataframe['cti'] < -0.5))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 4.0)
+ | (dataframe['rsi_14'] < 28.0)
+ | (dataframe['cti'] < -0.8)
+ | (dataframe['cti_1h'] < 0.75)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_480_1h'] < -20.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.96)
+ | (dataframe['close'] < dataframe['sma_30'] * 0.96)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 9.0)
+ | (dataframe['rsi_14'] < 34.0)
+ | (dataframe['cti'] < -0.5)
+ | (dataframe['cti_1h'] < 0.75)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.96)
+ | (dataframe['close'] < dataframe['sma_30'] * 0.96)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 4.0)
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['cti'] < -0.8)
+ | (dataframe['r_96'] < -70.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.96)
+ | (dataframe['close'] < dataframe['sma_30'] * 0.96)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ )
+ |
+ (
+ (dataframe['cmf'] > 0.0)
+ & (dataframe['cti_1h'] < 0.75)
+ )
+ |
+ (
+ (dataframe['mfi'] > 40.0)
+ & (dataframe['cti_1h'] < 0.75)
+ )
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti'] < -0.95)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['crsi_1h'] > 30.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.1)
+ | (dataframe['mfi'] > 50.0)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ | (dataframe['tpct_change_144'] < 0.08)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.044))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.1)
+ | (dataframe['mfi'] > 36.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti'] < -0.8)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.999))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.2)
+ |
+ (
+ (dataframe['rsi_14'] < 20.0)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['cti_1h'] < 0.8)
+ )
+ |
+ (
+ (dataframe['cti'] < -0.8)
+ & (dataframe['cmf'] > -0.3)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ )
+ |
+ (
+ (dataframe['ewo'] > 3.4)
+ & (dataframe['cti_1h'] < 0.9)
+ & (dataframe['hl_pct_change_48_1h'] < 0.6)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.02)
+ & (dataframe['ema_200_pct_change_144'] < 0.16)
+ & (dataframe['cmf'] > -0.3)
+ & (dataframe['ema_200_pct_change_288'] < 0.1)
+ )
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ |
+ (
+ (dataframe['r_14_1h'] < -75.0)
+ & (dataframe['cti_1h'] < 0.5)
+ )
+ | (dataframe['tpct_change_144'] < 0.05)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.05))
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.26)
+ & (dataframe['ema_200_pct_change_288'] < 0.1)
+ )
+ |
+ (
+ (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ & (dataframe['cti_1h'] < 0.5)
+ & (dataframe['cmf'] > -0.3)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.945)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['ema_200_pct_change_288'] < 0.25)
+ & (dataframe['r_480_1h'] < -12.0)
+ )
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.975)
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.01))
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['ema_200_pct_change_288'] < 0.25)
+ & (dataframe['r_480_1h'] < -12.0)
+ )
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.999))
+ & (dataframe['ema_200_pct_change_144'] < 0.12)
+ )
+ |
+ (
+ ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ & (dataframe['ema_200_pct_change_144'] < 0.12)
+ )
+ | (dataframe['rsi_14_15m'] < 30.0)
+ |
+ (
+ (dataframe['cti_15m'] < -0.9)
+ & (dataframe['ema_200_pct_change_144'] < 0.12)
+ )
+ )
+
+ # Condition #15 - Semi swing. Uptrend. Local dip.
+ elif index == 15:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.992))
+ item_buy_logic.append(dataframe['ewo'] > 3.0)
+ item_buy_logic.append(dataframe['rsi_14'] < 36.0)
+ item_buy_logic.append(
+ (dataframe['ewo'] > 13.0)
+ | (dataframe['cti'] < -0.8)
+ | (dataframe['cti_1h'] < 0.0)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 6.0)
+ | (dataframe['cmf'] > 0.0)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 9.0)
+ | (dataframe['rsi_14'] < 31.0)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.985))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 8.0)
+ | (dataframe['cmf'] > -0.1)
+ | (dataframe['rsi_14'] < 15.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['r_480_1h'] < -18.0)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.98))
+ | (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.5))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 5.0)
+ | (dataframe['rsi_14'] < 15.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.97))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 8.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['r_480_1h'] < -18.0)
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.97)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.99))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 8.0)
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['crsi_1h'] > 30.0)
+ |
+ (
+ (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.965))
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 10.0)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['crsi_1h'] > 40.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 40.0)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -90.0)
+ | (dataframe['tpct_change_144'] < 0.08)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.06))
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.24))
+ )
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.975)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.97))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > 0.1)
+ & (dataframe['cti_1h'] < 0.96)
+ )
+ | (dataframe['mfi'] > 40.0)
+ |
+ (
+ (dataframe['rsi_14'] < 25.0)
+ & (dataframe['cti_1h'] < 0.96)
+ )
+ | (dataframe['cti'] < -0.95)
+ |
+ (
+ (dataframe['cti_1h'] < 0.8)
+ & (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.85))
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ )
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ | (dataframe['tpct_change_144'] < 0.05)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.05))
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.4)
+ & (dataframe['cti_1h'] < 0.96)
+ & (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.85))
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ )
+ |
+ (
+ (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ & (dataframe['cti_1h'] < 0.9)
+ & (dataframe['hl_pct_change_48_1h'] < 0.6)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ & (dataframe['ema_200_pct_change_144'] < 0.16)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.999))
+ & (dataframe['cti_1h'] < 0.96)
+ & (dataframe['ema_200_pct_change_144'] < 0.16)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ & (dataframe['hl_pct_change_48_1h'] < 0.6)
+ )
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+
+ # Condition #16 - Semi swing. Cross above.
+ elif index == 16:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))
+ item_buy_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])
+ item_buy_logic.append(dataframe['cmf_1h'].shift(12) < 0.0)
+ item_buy_logic.append(dataframe['cmf_1h'] > 0.0)
+ item_buy_logic.append(dataframe['rsi_14'] < 50.0)
+ item_buy_logic.append(dataframe['rsi_14_1h'] > 64.0)
+ item_buy_logic.append(dataframe['cti_1h'] < 0.25)
+ item_buy_logic.append(
+ (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.05))
+ | (dataframe['cmf'] > 0.1)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.1)
+ | (dataframe['cmf_1h'] > 0.2)
+ | (dataframe['rsi_14'] < 48.0)
+ | (dataframe['cti_1h'] < -0.25)
+ | (dataframe['rsi_14_1h'] > 70.0)
+ |
+ (
+ (dataframe['close'] < (dataframe['res2_1d'] * 1.0))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ )
+ )
+ item_buy_logic.append(
+ (dataframe['rsi_14'] < 40.0)
+ | (dataframe['cti'] < -0.0)
+ | (dataframe['cti_1h'] < -0.25)
+ |
+ (
+ (dataframe['rsi_14_1h'] > 70.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['r_480_1h'] < -2.0)
+ )
+ |
+ (
+ (dataframe['cmf_1h'] > 0.3)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ |
+ (
+ (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['rsi_14'] < 36.0)
+ )
+ | (dataframe['close'] < dataframe['sma_30'] * 0.99)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.01))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.999))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ )
+
+ # Condition #17 - Semi swing. Deep buy.
+ elif index == 17:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['r_480'] < -90.0)
+ item_buy_logic.append(dataframe['r_14'] < -99.0)
+ item_buy_logic.append(dataframe['r_480_1h'] < -93.0)
+ item_buy_logic.append(dataframe['rsi_14_1h'] + dataframe['rsi_14'] < 33.0)
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 5.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['crsi_1h'] > 4.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.90))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 5.0)
+ | (dataframe['crsi_1h'] > 4.0)
+ | (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.98)
+ )
+ item_buy_logic.append(
+ (dataframe['crsi'] > 25.0)
+ | (dataframe['cti_1h'] < -0.95)
+ | (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.96)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['cti_1h'] < -0.95)
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.95))
+ | (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.3)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['crsi'] > 20.0)
+ | (dataframe['cti_1h'] < -0.99)
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.9))
+ | (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.95)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.018))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.1)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['rsi_14'] < 10.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['crsi'] > 20.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['rsi_14_1h'] < 20.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.9)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['cti'] < -0.95)
+ | (dataframe['crsi'] > 30.0)
+ |
+ (
+ (dataframe['cti_1h'] < -0.9)
+ & (dataframe['crsi_1h'] > 8.0)
+ )
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.95)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.028))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > 0.1)
+ & (dataframe['close'] < dataframe['bb20_2_low'] * 0.998)
+ )
+ |
+ (
+ (dataframe['mfi'] > 20.0)
+ & (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ )
+ | (dataframe['crsi'] > 40.0)
+ |
+ (
+ (dataframe['cti_1h'] < -0.95)
+ & (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ & (dataframe['close'] < dataframe['bb20_2_low'] * 0.998)
+ )
+ |
+ (
+ (dataframe['rsi_14_1h'] < 8.0)
+ & (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ & (dataframe['close'] < dataframe['bb20_2_low'] * 0.998)
+ )
+ |
+ (
+ (dataframe['r_14_1h'] < -97.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ & (dataframe['close'] < dataframe['bb20_2_low'] * 0.998)
+ )
+ |
+ (
+ (dataframe['crsi_1h'] > 10.0)
+ & (dataframe['close'] < dataframe['bb20_2_low'] * 0.998)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ |
+ (
+ (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ & (dataframe['close'] < dataframe['bb20_2_low'] * 0.998)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['sma_30'] * 0.93)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ )
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.985)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.985))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['crsi_1h'] > 4.0)
+ )
+ |
+ (
+ ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ & (dataframe['crsi_1h'] > 4.0)
+ )
+ |
+ (
+ (dataframe['cti_15m'] < -0.95)
+ & (dataframe['close'] < dataframe['bb20_2_low'] * 0.998)
+ )
+ )
+
+ # Condition #18 - Semi swing. Local dip. BTC not negative.
+ elif index == 18:
+ # Non-Standard protections (add below)
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))
+ item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))
+ item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])
+ item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.018))
+ item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))
+ item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.992))
+ item_buy_logic.append(dataframe['crsi_1h'] > 20.0)
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ |
+ (
+ (dataframe['rsi_14'] < 25.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ )
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.024))
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.985))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.18)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.985))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ |
+ (
+ (dataframe['crsi_1h'] > 45.0)
+ & (dataframe['tpct_change_144'] < 0.26)
+ )
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ |
+ (
+ (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.3))
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.975)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.024))
+ | (dataframe['cmf_15m'] > 0.0)
+ | (dataframe['rsi_14_15m'] < 30.0)
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.1)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ |
+ (
+ (dataframe['mfi'] > 20.0)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.25))
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ )
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti_1h'] < -0.0)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ |
+ (
+ (dataframe['crsi_1h'] > 30.0)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.25))
+ )
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.25))
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ |
+ (
+ (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.25))
+ )
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.25))
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.986)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.25))
+ )
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.024))
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.25))
+ )
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.98))
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.25))
+ )
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+
+ # Condition #19 - Semi swing. Uptrend. Local dip. BTC not downtrend.
+ elif index == 19:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+ item_buy_logic.append(dataframe['ema_200_pct_change_144'] < 0.12)
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))
+ item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))
+ item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))
+ item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.046))
+ item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * 0.02))
+ item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.4))
+ item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))
+ item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))
+ item_buy_logic.append(dataframe['cti'] < -0.9)
+ item_buy_logic.append(dataframe['cti_1h'] < 0.86)
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.964))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['r_480_1h'] < -18.0)
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.1)
+ & (dataframe['cti_1h'] < 0.7)
+ )
+ |
+ (
+ (dataframe['rsi_14'] < 20.0)
+ & (dataframe['hl_pct_change_48_1h'] < 0.7)
+ )
+ | (dataframe['cti'] < -0.95)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['r_14_1h'] < -95.0)
+ | (dataframe['tpct_change_144'] < 0.1)
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ & (dataframe['ema_200_pct_change_144'] < 0.1)
+ )
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ |
+ (
+ (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ & (dataframe['cti_1h'] < 0.7)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ |
+ (
+ (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.98))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03))
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+
+ # Condition #20 - Semi swing. Uptrend. Local dip.
+ elif index == 20:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['close'].shift(1) < (dataframe['sma_15'].shift(1) * 0.958))
+ item_buy_logic.append(dataframe['close'] > (dataframe['open'].shift(1)))
+ item_buy_logic.append(dataframe['ewo'] > 2.8)
+ item_buy_logic.append(dataframe['cti'] < -0.9)
+ item_buy_logic.append(dataframe['r_14'].shift(1) < -97.0)
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['ewo'] > 6.4)
+ | (dataframe['cmf'] > 0.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.956)
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['cti_1h'] < 0.5)
+ )
+ |
+ (
+ (dataframe['rsi_14'] < 30.0)
+ & (dataframe['ema_200_pct_change_144'] < 0.16)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ |
+ (
+ (dataframe['r_14'] < -90.0)
+ & (dataframe['ema_200_pct_change_144'] < 0.16)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ |
+ (
+ (dataframe['r_96'] < -80.0)
+ & (dataframe['ema_200_pct_change_144'] < 0.16)
+ )
+ |
+ (
+ (dataframe['ewo'] > 5.8)
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.1))
+ )
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ |
+ (
+ (dataframe['crsi_1h'] > 20.0)
+ & (dataframe['cti_1h'] < 0.8)
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.3)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ | (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ )
+
+ # Condition #21 - Semi swing. Deep local dip. Mild uptrend.
+ elif index == 21:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close_1h'] < (dataframe['res_level_1d'] * 1.12))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 1.0)
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.947)
+ item_buy_logic.append(dataframe['ewo'] > 1.0)
+ item_buy_logic.append(dataframe['cti'] < -0.9)
+ item_buy_logic.append(dataframe['r_14'] < -97.0)
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['crsi'] > 12.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['cmf'] > 0.0)
+ | (dataframe['mfi'] > 6.0)
+ | (dataframe['ewo'] > 3.5)
+ | (dataframe['ema_20'] > dataframe['ema_50'])
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['close'] < dataframe['sma_30'] * 0.924)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ |(dataframe['cti_1h'] < 0.75)
+ | (dataframe['tpct_change_144'] < 0.18)
+ | (dataframe['hl_pct_change_48_1h'] < 0.75)
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['close'] < dataframe['sma_30'] * 0.912)
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.4))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 6.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['tpct_change_144'] < 0.18)
+ | (dataframe['hl_pct_change_48_1h'] < 0.75)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.936)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.0)
+ | (dataframe['mfi'] > 6.0)
+ | (dataframe['ewo'] > 12.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['tpct_change_144'] < 0.18)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.936)
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 7.0)
+ | (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 25.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['tpct_change_144'] < 0.14)
+ | (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(48))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.934)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.99))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.14)
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.1)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ |
+ (
+ (dataframe['mfi'] > 30.0)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ |
+ (
+ (dataframe['rsi_14'] < 25.0)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ |
+ (
+ (dataframe['ewo'] > 8.0)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ )
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ |
+ (
+ (dataframe['crsi_1h'] > 30.0)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ )
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.3)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ |
+ (
+ (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.994)
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.1)
+ | (dataframe['mfi'] > 40.0)
+ | (dataframe['rsi_14'] < 28.0)
+ | (dataframe['cti'] < -0.95)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < (dataframe['res2_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.9)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.97))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+
+ # Condition #22 - Swing. Uptrend. Bounce from daily support level
+ elif index == 22:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close_1h'] > dataframe['sup_level_1d'])
+ item_buy_logic.append(dataframe['close_1h'] < dataframe['sup_level_1d'] * 1.046)
+ item_buy_logic.append(dataframe['low_1h'] < dataframe['sup_level_1d'] * 0.982)
+ item_buy_logic.append(dataframe['close_1h'] < dataframe['res_level_1h'])
+ item_buy_logic.append(dataframe['res_level_1d'] > dataframe['sup_level_1d'])
+ item_buy_logic.append(dataframe['rsi_14'] < 36.0)
+ item_buy_logic.append(dataframe['rsi_14_1h'] > 48.0)
+ # Confirm uptrend - Heikin-Ashi
+ item_buy_logic.append(dataframe['open_sha_1d'] < dataframe['close_sha_1d'])
+ item_buy_logic.append(dataframe['open_sha_1d'].shift(288) < dataframe['close_sha_1d'].shift(288))
+ item_buy_logic.append(dataframe['pivot_1d'] > dataframe['pivot_1d'].shift(288) * 0.95)
+
+ item_buy_logic.append(
+ (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.75))
+ | (dataframe['crsi'] > 15.0)
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['cmf'] > -0.2)
+ )
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti_1h'] < 0.5)
+ |
+ (
+ (dataframe['crsi_1h'] > 12.0)
+ & (dataframe['cti_1h'] < 0.8)
+ )
+ |
+ (
+ (dataframe['rsi_14_1h'] > 60.0)
+ & (dataframe['cti_1h'] < 0.8)
+ )
+ )
+
+ # Condition #23 - Semi swing. Downtrend. Local dip.
+ elif index == 23:
+ # Non-Standard protections (add below)
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['ewo'].shift(1) < -5.4)
+ item_buy_logic.append(dataframe['cti'].shift(1).rolling(5).max() < -0.86)
+ item_buy_logic.append(dataframe['r_14'].shift(1) < -96.5)
+ item_buy_logic.append(dataframe['close'] > (dataframe['open'].shift(1)))
+ item_buy_logic.append(dataframe['crsi_1h'] > 14.0)
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['ewo'].shift(1) < -6.8)
+ | (dataframe['cmf'] > 0.0)
+ | (dataframe['crsi_1h'] > 22.0)
+ | (dataframe['tpct_change_144'] < 0.22)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ | (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.948)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['ewo'].shift(1) < -6.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['crsi_1h'] > 22.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ | (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.96)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.8))
+ | (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.95)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.7))
+ | (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.95)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 16.0)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['crsi_1h'] > 30.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.05))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > 0.0)
+ & (dataframe['hl_pct_change_48_1h'] < 0.9)
+ )
+ | (dataframe['rsi_14'] < 30.0)
+ |
+ (
+ (dataframe['cti'] < -0.9)
+ & (dataframe['hl_pct_change_48_1h'] < 0.9)
+ )
+ |
+ (
+ (dataframe['ewo'].shift(1) < -6.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.04)
+ )
+ | (dataframe['cti_1h'] < -0.95)
+ |
+ (
+ (dataframe['rsi_14_1h'] < 20.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.04)
+ )
+ | (dataframe['r_14_1h'] < -95.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ )
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.95)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.04)
+ )
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.999))
+ |
+ (
+ ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.04)
+ )
+ | (dataframe['rsi_14_15m'] < 20.0)
+ |
+ (
+ (dataframe['cti_15m'] < -0.95)
+ & (dataframe['hl_pct_change_48_1h'] < 0.9)
+ )
+ )
+
+ # Condition #24 - Semi swing. Uptrend. 1h uptrend. Local dip.
+ elif index == 24:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+ item_buy_logic.append(dataframe['ema_200_pct_change_288'] < 0.3)
+
+ # Logic
+ item_buy_logic.append(dataframe['ewo'] > 3.4)
+ item_buy_logic.append(dataframe['r_14'] < -97.0)
+ item_buy_logic.append(dataframe['r_96'] < -80.0)
+ item_buy_logic.append(dataframe['ewo_1h'] > 2.7)
+ item_buy_logic.append(dataframe['cti_1h'] < 0.9)
+ item_buy_logic.append(dataframe['r_480_1h'] < -25.0)
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.0))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 4.2)
+ | (dataframe['ewo_1h'] > 4.2)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.998))
+ | (dataframe['close_1h'] < dataframe['res_level_1h'])
+ | (dataframe['ema_20'] > dataframe['ema_50'])
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['close'] < dataframe['sma_30'] * 0.968)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 4.2)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ | (dataframe['ema_20'] > dataframe['ema_50'])
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['close'] < dataframe['sma_30'] * 0.934)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 5.2)
+ | (dataframe['cmf'] > 0.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.14)
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ | (dataframe['close'] < dataframe['sma_30'] * 0.934)
+ | (dataframe['close'] < (dataframe['res2_1d'] * 1.0))
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 4.0)
+ | (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['crsi_1h'] > 25.0)
+ | (dataframe['close'] < dataframe['sma_30'] * 0.934)
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 5.6)
+ | (dataframe['rsi_14'] < 36.0)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ | (dataframe['close'] < dataframe['sma_30'] * 0.97)
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 4.0)
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.05)
+ | (dataframe['close'] < (dataframe['res2_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.96)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.985)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] > 4.0)
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 40.0)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['crsi_1h'] > 40.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['ewo'] > 4.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ )
+ | (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ |
+ (
+ (dataframe['crsi_1h'] > 30.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ )
+ | (dataframe['tpct_change_144'] < 0.08)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.06))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.3)
+ & (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.9))
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['mfi'] > 30.0)
+ & (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.9))
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ )
+ |
+ (
+ (dataframe['rsi_14'] < 30.0)
+ & (dataframe['ema_200_pct_change_144'] < 0.12)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['cti'] < -0.9)
+ & (dataframe['ema_200_pct_change_144'] < 0.12)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['ewo'] > 4.4)
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ & (dataframe['ema_200_pct_change_144'] < 0.12)
+ )
+ |
+ (
+ (dataframe['cti_1h'] < 0.75)
+ & (dataframe['ema_200_pct_change_288'] < 0.25)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ | (dataframe['tpct_change_144'] < 0.06)
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.3)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ )
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.012))
+ & (dataframe['ema_200_pct_change_144'] < 0.12)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99))
+ & (dataframe['ema_200_pct_change_144'] < 0.12)
+ )
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.8)
+ )
+ item_buy_logic.append(dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.86))
+
+ # Condition #25 - Semi swing. CMF 1h cross.
+ elif index == 25:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_12_1h'].shift(12) < dataframe['ema_35_1h'].shift(12))
+ item_buy_logic.append(dataframe['ema_12_1h'] > dataframe['ema_35_1h'])
+ item_buy_logic.append(dataframe['cmf_1h'].shift(12) < 0.0)
+ item_buy_logic.append(dataframe['cmf_1h'] > 0.0)
+ item_buy_logic.append(dataframe['rsi_14'] < 34.0)
+ item_buy_logic.append(
+ (dataframe['cti'] < -0.5)
+ | (dataframe['rsi_14'] < 30.0)
+ |
+ (
+ (dataframe['rsi_14_1h'] < 60.0)
+ & (dataframe['cti_1h'] < 0.7)
+ )
+ | (dataframe['cti_1h'] < 0.5)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['cti'] < -0.8)
+ | (dataframe['rsi_14'] < 28.0)
+ | (dataframe['cmf_1h'] > 0.1)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['rsi_14'] < 26.0)
+ | (dataframe['cmf_1h'] > 0.3)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ )
+ item_buy_logic.append(
+ (dataframe['mfi'] > 20.0)
+ | (dataframe['rsi_14'] < 32.0)
+ | (dataframe['cmf_1h'] > 0.3)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 32.0)
+ | (dataframe['cmf_1h'] > 0.1)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.02)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cmf_1h'] > 0.1)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > 0.0)
+ & (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.5))
+ & (dataframe['rsi_14_1h'] < 60.0)
+ )
+ | (dataframe['rsi_14'] < 15.0)
+ | (dataframe['cti'] < -0.9)
+ |
+ (
+ (dataframe['cmf_1h'] > 0.1)
+ & (dataframe['btc_pct_close_max_24_5m'] < 1.03)
+ )
+ |
+ (
+ (dataframe['cti_1h'] < 0.5)
+ & (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.5))
+ & (dataframe['sma_200_dec_20'] == False)
+ )
+ | (dataframe['rsi_14_1h'] < 50.0)
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.5))
+ & (dataframe['rsi_14_1h'] < 60.0)
+ & (dataframe['sma_200_dec_20'] == False)
+ )
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.01))
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.999))
+ & (dataframe['sma_200_dec_20'] == False)
+ & (dataframe['btc_pct_close_max_24_5m'] < 1.03)
+ )
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ )
+
+ # Condition #26 - Semi swing. Local deep dip.
+ elif index == 26:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_25_1h'])
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.8))
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < dataframe['sma_15'] * 0.958)
+ item_buy_logic.append(dataframe['cti'] < -0.9)
+ item_buy_logic.append(dataframe['ha_close'] > dataframe['ha_open'])
+ item_buy_logic.append(
+ (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.1))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.1)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['crsi_1h'] > 12.0)
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.2)
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.25))
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.26))
+ & (dataframe['ema_200_pct_change_144'] < 0.16)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ )
+ |
+ (
+ (dataframe['mfi'] > 30.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.1)
+ )
+ | (dataframe['rsi_14'] < 15.0)
+ |
+ (
+ (dataframe['cti_1h'] < 0.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ )
+ | (dataframe['rsi_14_1h'] < 20.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.25))
+ & (dataframe['ema_200_pct_change_144'] < 0.16)
+ )
+ |
+ (
+ (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ & (dataframe['cti_1h'] < 0.5)
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.06))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.94))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.04))
+ )
+
+ # Condition #27 - Semi swing. Local deep. Uptrend.
+ elif index == 27:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.938)
+ item_buy_logic.append(dataframe['ewo'] > 2.4)
+ item_buy_logic.append(dataframe['rsi_14'] < 36.0)
+ item_buy_logic.append(dataframe['cti'] < -0.9)
+ item_buy_logic.append(dataframe['r_14'] < -96.0)
+ item_buy_logic.append(dataframe['r_480_1h'] < -5.0)
+ item_buy_logic.append(
+ (dataframe['ewo'] > 4.0)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['crsi_1h'] > 10.0)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.936)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > 0.0)
+ | (dataframe['ewo'] > 3.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.936)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['ewo'] > 3.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['crsi_1h'] > 15.0)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < dataframe['sma_75'] * 0.93)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.2)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ )
+ | (dataframe['mfi'] > 36.0)
+ |
+ (
+ (dataframe['crsi'] > 20.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ )
+ |
+ (
+ (dataframe['ewo'] > 3.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ )
+ |
+ (
+ (dataframe['cti_1h'] < 0.5)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ )
+ | (dataframe['rsi_14_1h'] < 40.0)
+ |
+ (
+ (dataframe['r_14_1h'] < -90.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ )
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.12)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ )
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ )
+ | (dataframe['hl_pct_change_48_1h'] < 0.2)
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['cti_1h'] < 0.8)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.91)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.03))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.97))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > 0.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ )
+ |
+ (
+ (dataframe['mfi'] > 20.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['not_downtrend_1h'])
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['rsi_14'] < 16.0)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['crsi'] > 16.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ | (dataframe['ewo'] > 4.4)
+ |
+ (
+ (dataframe['cti_1h'] < 0.75)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.04)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['rsi_14_1h'] < 50.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.04)
+ )
+ |
+ (
+ (dataframe['r_14_1h'] < -75.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.04)
+ )
+ |
+ (
+ (dataframe['crsi_1h'] > 20.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ & (dataframe['not_downtrend_1h'])
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.12)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ & (dataframe['not_downtrend_1h'])
+ )
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ & (dataframe['not_downtrend_1h'])
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ |
+ (
+ (dataframe['close'] > (dataframe['sma_200_1h'] * 0.9))
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ & (dataframe['not_downtrend_1h'])
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ | (dataframe['close'] < dataframe['sma_30'] * 0.9)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.04)
+ )
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.98))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ | (dataframe['rsi_14_15m'] < 30.0)
+ |
+ (
+ (dataframe['cti_15m'] < -0.9)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ )
+ )
+
+ # Condition #28 - Semi swing. Downtrend. Local deep.
+ elif index == 28:
+ # Non-Standard protections (add below)
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < dataframe['sma_75'] * 0.967)
+ item_buy_logic.append(dataframe['ewo'] < -5.75)
+ item_buy_logic.append(dataframe['cti'] < -0.9)
+ item_buy_logic.append(dataframe['ha_close'] > dataframe['ha_open'])
+ item_buy_logic.append(dataframe['crsi_1h'] > 16.0)
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.92))
+ | (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.05))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.98))
+ | (dataframe['tpct_change_144'] < 0.24)
+ | (dataframe['crsi_1h'] > 22.0)
+ | (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.05))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['ewo'] < -5.9)
+ | (dataframe['ema_50'] > dataframe['ema_200'])
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['cmf'] > 0.0)
+ | (dataframe['hl_pct_change_48_1h'] < 0.75)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.95))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] < -10.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['hl_pct_change_48_1h'] < 0.8)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24))
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.9))
+ | (dataframe['close'] < dataframe['sma_75'] * 0.922)
+ | (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.1))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['ewo'] < -6.6)
+ | (dataframe['cmf'] > 0.0)
+ | (dataframe['crsi_1h'] > 22.0)
+ | (dataframe['tpct_change_144'] < 0.22)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ | (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.958)
+ )
+ item_buy_logic.append(
+ (((dataframe['ewo'] < -7.0) | (dataframe['tpct_change_144'] < 0.25))
+ & ((dataframe['ewo'] < -8.0) | (dataframe['cmf'] > -0.2) | (dataframe['tpct_change_144'] < 0.2)))
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['hl_pct_change_48_1h'] < 0.75)
+ | (dataframe['close'] < dataframe['sma_30'] * 0.958)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['rsi_14'] < 36.0)
+ | (dataframe['r_14'] < -90.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.75)
+ |
+ (
+ (dataframe['close'] > (dataframe['sma_200_1h'] * 0.7))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ )
+ | (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.95)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.1)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ & (dataframe['ema_200_pct_change_288'] > -0.18)
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ )
+ |
+ (
+ (dataframe['mfi'] > 30.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ )
+ |
+ (
+ (dataframe['rsi_14'] < 36.0)
+ & (dataframe['ema_200_pct_change_288'] > -0.18)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ |
+ (
+ (dataframe['cti_1h'] < -0.9)
+ & (dataframe['ema_200_pct_change_288'] > -0.18)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ )
+ |
+ (
+ (dataframe['crsi_1h'] > 30.0)
+ & (dataframe['ema_200_pct_change_288'] > -0.2)
+ & (dataframe['hl_pct_change_48_1h'] < 0.9)
+ )
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.16)
+ & (dataframe['hl_pct_change_48_1h'] < 0.9)
+ )
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.05))
+ |
+ (
+ (dataframe['close'] < dataframe['sma_30'] * 0.95)
+ & (dataframe['ema_200_pct_change_288'] > -0.18)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ )
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ )
+
+ # Condition #29 - Semi swing. Downtrend. Local deep.
+ elif index == 29:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.8))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < (dataframe['ema_16'] * 0.982))
+ item_buy_logic.append(dataframe['ewo'] < -9.8)
+ item_buy_logic.append(dataframe['cti'] < -0.9)
+ item_buy_logic.append(
+ (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['crsi_1h'] > 6.0)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] < -10.8)
+ | (dataframe['crsi_1h'] > 15.0)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.7))
+ | (dataframe['close'] > (dataframe['sup3_1d'] * 0.9))
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.996))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] < -10.2)
+ | (dataframe['crsi_1h'] > 10.0)
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.8))
+ | (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.99))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] < -12.0)
+ | (dataframe['cmf'] > -0.2)
+ | ((dataframe['mfi'] > 30.0) & (dataframe['btc_not_downtrend_1h'] == True))
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['crsi_1h'] > 12.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.75))
+ | (dataframe['close'] > (dataframe['sup2_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.93)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))
+ )
+
+ # Condition #30 - Semi swing. Local dip. BTC not downtrend.
+ elif index == 30:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])
+ item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.018))
+ item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))
+ item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.98))
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.022))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['cti'] < -0.8)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['crsi_1h'] > 16.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.96)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 50.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -90.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.044))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.2)
+ & (dataframe['ema_200_pct_change_144'] < 0.16)
+ )
+ |
+ (
+ (dataframe['mfi'] > 25.0)
+ & (dataframe['ema_200_pct_change_144'] < 0.16)
+ )
+ | (dataframe['rsi_14'] < 10.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['crsi'] > 16.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['r_14_1h'] < -94.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['hl_pct_change_36'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.22))
+ & (dataframe['hl_pct_change_48_1h'] < 0.6)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ |
+ (
+ (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ & (dataframe['cti_1h'] < 0.5)
+ )
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ |
+ (
+ (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ )
+ | (dataframe['close'] < dataframe['sma_30'] * 0.86)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.88)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.95)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.95))
+ |
+ (
+ ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ & (dataframe['ema_200_pct_change_144'] < 0.16)
+ )
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+
+ # Condition #31 - Long mode. Local dip.
+ elif index == 31:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))
+ item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.045))
+ item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * 0.028))
+ item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.25))
+ item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))
+ item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))
+ item_buy_logic.append(dataframe['cti'] < -0.25)
+ item_buy_logic.append(dataframe['crsi_1h'] > 14.0)
+ item_buy_logic.append(
+ (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ item_buy_logic.append(
+ (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ |
+ (
+ (dataframe['crsi_1h'] > 20.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ )
+ | (dataframe['tpct_change_144'] < 0.08)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.985)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.98))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.1)
+ |
+ (
+ (dataframe['mfi'] > 36.0)
+ & (dataframe['hl_pct_change_36'] < 0.1)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['rsi_14'] < 25.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ )
+ | (dataframe['cti'] < -0.95)
+ | (dataframe['crsi'] > 20.0)
+ |
+ (
+ (dataframe['cti_1h'] < -0.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_36'] < 0.1)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['rsi_14_1h'] < 50.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_36'] < 0.1)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['r_14_1h'] < -75.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_36'] < 0.1)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.16)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_36'] < 0.1)
+ )
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_36'] < 0.1)
+ )
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_36'] < 0.1)
+ )
+ |
+ (
+ (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ & (dataframe['hl_pct_change_36'] < 0.1)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['sma_30'] * 0.92)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ )
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ )
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ | (dataframe['rsi_14_15m'] < 30.0)
+ |
+ (
+ (dataframe['cti_15m'] < -0.9)
+ & (dataframe['hl_pct_change_36'] < 0.1)
+ & (dataframe['not_downtrend_1h'])
+ )
+ )
+
+ # Condition #32 - Long mode. Local dip.
+ elif index == 32:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.93))
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])
+ item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))
+ item_buy_logic.append(dataframe['cti'] < -0.9)
+ item_buy_logic.append(dataframe['r_480_1h'] < -20.0)
+ item_buy_logic.append(dataframe['crsi_1h'] > 14.0)
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['cti_1h'] < 0.25)
+ | (dataframe['tpct_change_144'] < 0.14)
+ | (dataframe['hl_pct_change_48_1h'] < 0.7)
+ | (dataframe['ema_20'] > dataframe['ema_50'])
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['close'] < dataframe['sma_30'] * 0.916)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.04))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.2)
+ & (dataframe['ema_200_pct_change_288'] < 0.25)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_36'] < 0.25)
+ )
+ | (dataframe['mfi'] > 50.0)
+ |
+ (
+ (dataframe['cti_1h'] < 0.8)
+ & (dataframe['ema_200_pct_change_288'] < 0.25)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_36'] < 0.25)
+ )
+ |
+ (
+ (dataframe['rsi_14_1h'] < 50.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.25)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_36'] < 0.25)
+ )
+ |
+ (
+ (dataframe['r_14_1h'] < -75.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.25)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_36'] < 0.25)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.16)
+ & (dataframe['hl_pct_change_36'] < 0.25)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ & (dataframe['hl_pct_change_36'] < 0.25)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['ema_200_pct_change_144'] < 0.16)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_36'] < 0.25)
+ & (dataframe['not_downtrend_1h'])
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.044))
+ )
+
+ # Condition #33 - Long mode. Local dip. Uptrend.
+ elif index == 33:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.4)
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < (dataframe['ema_16'] * 0.93))
+ item_buy_logic.append(dataframe['ewo'] > 2.5)
+ item_buy_logic.append(dataframe['rsi_14'] < 46.0)
+ item_buy_logic.append(dataframe['r_14'] < -97.0)
+ item_buy_logic.append(dataframe['ewo_1h'] > 0.1)
+ item_buy_logic.append(
+ (dataframe['rsi_14'] < 36.0)
+ | (dataframe['cti'] < 0.0)
+ | (dataframe['ewo'] > 6.0)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['ewo_1h'] > 4.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] < dataframe['sma_30'] * 0.9)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.3)
+ & (dataframe['ema_200_pct_change_144'] < 0.2)
+ )
+ | (dataframe['mfi'] > 50.0)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ |
+ (
+ (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ & (dataframe['ema_200_pct_change_144'] < 0.2)
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.044))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.2)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ )
+ |
+ (
+ (dataframe['mfi'] > 20.0)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ & (dataframe['ema_200_pct_change_288'] < 0.2)
+ )
+ | (dataframe['rsi_14'] < 30.0)
+ |
+ (
+ (dataframe['cti'] < -0.8)
+ & (dataframe['ema_200_pct_change_288'] < 0.2)
+ )
+ |
+ (
+ (dataframe['crsi'] > 10.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.2)
+ )
+ |
+ (
+ (dataframe['cti_1h'] < 0.5)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ & (dataframe['ema_200_pct_change_288'] < 0.2)
+ )
+ |
+ (
+ (dataframe['rsi_14_1h'] < 50.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.2)
+ )
+ |
+ (
+ (dataframe['r_14_1h'] < -75.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.2)
+ )
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.4)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ )
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ & (dataframe['ema_200_pct_change_288'] < 0.2)
+ )
+ | (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ |
+ (
+ (dataframe['close'] < dataframe['sma_30'] * 0.91)
+ & (dataframe['ema_200_pct_change_288'] < 0.2)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ & (dataframe['ema_200_pct_change_288'] < 0.2)
+ )
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ & (dataframe['ema_200_pct_change_288'] < 0.2)
+ )
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.999))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+
+ # Condition #34 - Long mode. Local dip.
+ elif index == 34:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.92))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < dataframe['ema_50'])
+ item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.982))
+ item_buy_logic.append(dataframe['cti'] < -0.9)
+ item_buy_logic.append(dataframe['cti_1h'] < 0.9)
+ item_buy_logic.append(dataframe['crsi_1h'] > 18.0)
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['crsi_1h'] > 25.0)
+ | (dataframe['r_480_1h'] < -30.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.975))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.3)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ )
+ | (dataframe['r_480'] > -30.0)
+ | (dataframe['crsi'] > 20.0)
+ |
+ (
+ (dataframe['cti_1h'] < 0.8)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ )
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ |
+ (
+ (dataframe['crsi_1h'] > 30.0)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['cti_1h'] < 0.8)
+ )
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.2)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ )
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ )
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['hl_pct_change_24_1h'] < 0.5)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['cti_1h'] < 0.8)
+ )
+ |
+ (
+ (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['cti_1h'] < 0.8)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.975))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.98))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ )
+
+ # Condition #35 - Long mode. Local deep dip.
+ elif index == 35:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < dataframe['ema_25'] * 0.9)
+ item_buy_logic.append(dataframe['close'] > dataframe['open'])
+ item_buy_logic.append(dataframe['rsi_14'] < 36.0)
+ item_buy_logic.append(dataframe['mfi'] < 36.0)
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 16.0)
+ | (dataframe['cti'] < -0.95)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['r_14_1h'] < -90.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.87)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.982)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.07))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.955))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ )
+
+ # Condition #36 - Long mode. Uptrend. Local dip.
+ elif index == 36:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['ema_200'] > (dataframe['ema_200'].shift(36) * 1.035))
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < dataframe['ema_20'] * 0.97)
+ item_buy_logic.append(dataframe['rsi_14'] < 34.0)
+ item_buy_logic.append(dataframe['r_14'] < -90.0)
+ item_buy_logic.append(dataframe['r_64'] < -80.0)
+ item_buy_logic.append(dataframe['cti'] < -0.9)
+ item_buy_logic.append(dataframe['r_480_1h'] < -30.0)
+ item_buy_logic.append(dataframe['crsi_1h'] > 16.0)
+ item_buy_logic.append(dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.9))
+ item_buy_logic.append(
+ (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.946)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.95)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 40.0)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['tpct_change_144'] < 0.2)
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.044))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.985))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['crsi'] > 20.0)
+ | (dataframe['cti_1h'] < -0.0)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ | (dataframe['hl_pct_change_36'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.88)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.044))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.1)
+ |
+ (
+ (dataframe['mfi'] > 30.0)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ )
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['crsi'] > 20.0)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ |
+ (
+ (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ )
+ | (dataframe['close'] < dataframe['sma_30'] * 0.89)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.04))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.96))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+
+ # Condition #37 - Semi swing. Uptrend. Local dip.
+ elif index == 37:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.99))
+ item_buy_logic.append(dataframe['r_14'] < -94.0)
+ item_buy_logic.append(dataframe['r_64'] < -75.0)
+ item_buy_logic.append(dataframe['r_480_1h'] < -21.0)
+ item_buy_logic.append(dataframe['rsi_14_1h'] < 80.0)
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['cti_1h'] < 0.9)
+ | (dataframe['crsi_1h'] > 14.0)
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['close'] < dataframe['sma_30'] * 0.948)
+ | (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.05))
+ )
+ item_buy_logic.append(
+ (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti'] < -0.5)
+ | (dataframe['crsi'] > 20.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.011))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 10.0)
+ | (dataframe['rsi_14'] < 15.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['crsi'] > 20.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.012))
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.94)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti'] < -0.95)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['crsi_1h'] > 30.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ |
+ (
+ (dataframe['rsi_14'] < 30.0)
+ & (dataframe['ema_200_pct_change_144'] < 0.2)
+ )
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ |
+ (
+ (dataframe['crsi_1h'] > 30.0)
+ & (dataframe['cti_1h'] < 0.85)
+ & (dataframe['ema_200_pct_change_144'] < 0.12)
+ )
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.08)
+ & (dataframe['ema_200_pct_change_144'] < 0.12)
+ )
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ & (dataframe['ema_200_pct_change_144'] < 0.12)
+ )
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.4)
+ & (dataframe['ema_200_pct_change_144'] < 0.12)
+ )
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['ema_200_pct_change_144'] < 0.12)
+ )
+ |
+ (
+ (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ & (dataframe['cti_1h'] < 0.85)
+ & (dataframe['ema_200_pct_change_144'] < 0.12)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ & (dataframe['ema_200_pct_change_144'] < 0.12)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ & (dataframe['ema_200_pct_change_144'] < 0.2)
+ )
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.999))
+ & (dataframe['ema_200_pct_change_144'] < 0.2)
+ )
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ )
+
+ # Condition #38 - Semi swing. Uptrend. Local dip.
+ elif index == 38:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.0118))
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])
+ item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.0192))
+ item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))
+ item_buy_logic.append(dataframe['r_480_1h'] < -1.0)
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.2))
+ )
+ item_buy_logic.append(
+ (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14'] < 36.0)
+ | (dataframe['r_14'] < -90.0)
+ | (dataframe['hl_pct_change_48_1h'] < 0.7)
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.05))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.958)
+ | (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.2))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > 0.0)
+ | (dataframe['mfi'] > 6.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['tpct_change_144'] < 0.18)
+ | (dataframe['hl_pct_change_48_1h'] < 0.75)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.946)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['r_14'] < -90.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 40.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['crsi_1h'] > 40.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.024))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ |
+ (
+ (dataframe['mfi'] > 36.0)
+ & (dataframe['ema_200_pct_change_144'] < 0.25)
+ & (dataframe['cti_1h'] < 0.8)
+ & (dataframe['hl_pct_change_36'] < 0.24)
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ )
+ |
+ (
+ (dataframe['rsi_14'] < 30.0)
+ & (dataframe['ema_200_pct_change_144'] < 0.25)
+ )
+ |
+ (
+ (dataframe['cti'] < -0.8)
+ & (dataframe['ema_200_pct_change_144'] < 0.16)
+ & (dataframe['hl_pct_change_36'] < 0.24)
+ )
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ |
+ (
+ (dataframe['crsi_1h'] > 20.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.02)
+ & (dataframe['ema_200_pct_change_144'] < 0.16)
+ & (dataframe['hl_pct_change_36'] < 0.24)
+ & (dataframe['rsi_14_1h'] < 70.0)
+ & (dataframe['hl_pct_change_12_1h'] < 0.3)
+ )
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ & (dataframe['rsi_14_1h'] < 70.0)
+ & (dataframe['hl_pct_change_12_1h'] < 0.3)
+ )
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.024))
+ & (dataframe['ema_200_pct_change_144'] < 0.25)
+ & (dataframe['rsi_14_1h'] < 70.0)
+ & (dataframe['hl_pct_change_12_1h'] < 0.3)
+ )
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.999))
+ & (dataframe['ema_200_pct_change_144'] < 0.25)
+ )
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+
+ # Condition #39 - Semi swing. Uptrend. Local dip.
+ elif index == 39:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+ item_buy_logic.append(dataframe['ema_200_pct_change_144'] < 0.12)
+
+ # Logic
+ item_buy_logic.append(dataframe['bb40_2_low'].shift().gt(0))
+ item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.05))
+ item_buy_logic.append(dataframe['closedelta'].gt(dataframe['close'] * 0.01))
+ item_buy_logic.append(dataframe['tail'].lt(dataframe['bb40_2_delta'] * 0.5))
+ item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))
+ item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))
+ item_buy_logic.append(dataframe['r_480_1h'] < -5.0)
+ item_buy_logic.append(dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.0))
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close_1h'] < dataframe['res_level_1h'])
+ | (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.944)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.016))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['cti'] < -0.8)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.94)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))
+ | (dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.06))
+ | (dataframe['closedelta'].gt(dataframe['close'] * 0.02))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.1)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.02)
+ & (dataframe['tpct_change_144'] < 0.2)
+ & (dataframe['cti_1h'] < 0.85)
+ )
+ | (dataframe['cti'] < -0.95)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close'] < dataframe['sma_30'] * 0.89)
+ |
+ (
+ (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.015))
+ & (dataframe['cti_1h'] < 0.85)
+ )
+ |
+ (
+ (dataframe['close'] < (dataframe['bb20_2_low'] * 0.99))
+ & (dataframe['rsi_14'] < 36.0)
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.2))
+ )
+ | (dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.12))
+ |
+ (
+ (dataframe['closedelta'].gt(dataframe['close'] * 0.02))
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.2))
+ & (dataframe['cti_1h'] < 0.85)
+ )
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['hl_pct_change_48_1h'] < 0.6)
+ )
+ | (dataframe['cmf'] > 0.1)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti'] < -0.8)
+ | (dataframe['cti_1h'] < 0.75)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ |
+ (
+ (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ & (dataframe['hl_pct_change_48_1h'] < 0.6)
+ )
+ | (dataframe['close'] < dataframe['sma_30'] * 0.94)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.98))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.999))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ )
+
+ # Condition #40 - Semi swing. Uptrend. Local dip.
+ elif index == 40:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+ item_buy_logic.append(dataframe['ema_200_pct_change_144'] < 0.1)
+
+ # Logic
+ item_buy_logic.append(dataframe['rsi_14'] < 32.0)
+ item_buy_logic.append(dataframe['r_14'] < -90.0)
+ item_buy_logic.append(dataframe['cmf'] > -0.5)
+ item_buy_logic.append(dataframe['r_480_1h'] < -15.0)
+ item_buy_logic.append(
+ (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.15))
+ | (dataframe['crsi'] > 5.0)
+ )
+ item_buy_logic.append(
+ (dataframe['cti_1h'] < 0.9)
+ | (dataframe['crsi_1h'] > 15.0)
+ | (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.2))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['cti_1h'] < 0.9)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['hl_pct_change_48_1h'] < 0.9)
+ | (dataframe['close_1h'] < dataframe['res_level_1h'])
+ | (dataframe['close'] < dataframe['sma_30'] * 0.976)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti_1h'] < 0.9)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] > dataframe['ema_26'])
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.944)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.016))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > 0.0)
+ | (dataframe['rsi_14'] < 28.0)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.91)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.016))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.0)
+ | (dataframe['rsi_14'] < 28.0)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['close'] < dataframe['sma_30'] * 0.944)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.012))
+ | (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.95))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.08)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.012))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.94)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 10.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['crsi_1h'] > 30.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['hl_pct_change_48_1h'] < 0.2)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.96)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.08)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.015))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti'] < -0.95)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['cmf_1h'] > 0.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.985)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 24.0)
+ | (dataframe['cti'] < -0.8)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ | (dataframe['tpct_change_144'] < 0.08)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.05))
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.98))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti'] < -0.8)
+ | (dataframe['crsi'] > 20.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ | (dataframe['crsi_1h'] > 30.0)
+ | (dataframe['tpct_change_144'] < 0.06)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.06))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] < (dataframe['res2_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.95)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.2)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti'] < -0.95)
+ | (dataframe['crsi'] > 16.0)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ | (dataframe['crsi_1h'] > 30.0)
+ | (dataframe['tpct_change_144'] < 0.08)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.95)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.999))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.1)
+ | (dataframe['mfi'] > 36.0)
+ |
+ (
+ (dataframe['rsi_14'] < 30.0)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ )
+ |
+ (
+ (dataframe['cti_1h'] < 0.75)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ & (dataframe['hl_pct_change_24_1h'] < 0.5)
+ )
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ |
+ (
+ (dataframe['crsi_1h'] > 30.0)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ & (dataframe['hl_pct_change_24_1h'] < 0.5)
+ )
+ | (dataframe['tpct_change_144'] < 0.06)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.06))
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ & (dataframe['hl_pct_change_24_1h'] < 0.5)
+ )
+ | (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ |
+ (
+ (dataframe['close'] < dataframe['sma_30'] * 0.95)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.985)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ )
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.999))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+
+ # Condition #41 - 15m. Semi swing. Local dip. BTC not downtrend.
+ elif index == 41:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['ema_12_15m'] > dataframe['ema_200_1h'])
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_26_15m'] > dataframe['ema_12_15m'])
+ item_buy_logic.append((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.025))
+ item_buy_logic.append((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100))
+ item_buy_logic.append(dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 1.0))
+ item_buy_logic.append(dataframe['r_14'] < -75.0)
+ item_buy_logic.append(
+ (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['ema_50'] > dataframe['ema_200'])
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.88))
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.95))
+ | (dataframe['mfi'] > 12.0)
+ | (dataframe['crsi_1h'] > 2.0)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.029))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.985))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 30.0)
+ |
+ (
+ (dataframe['rsi_14'] < 25.0)
+ & (dataframe['ema_200_pct_change_288'] > -0.1)
+ )
+ |
+ (
+ (dataframe['cti'] < -0.8)
+ & (dataframe['ema_200_pct_change_288'] > -0.1)
+ )
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.028))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.985))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 10.0)
+ | (dataframe['cmf_1h'] > 0.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.95))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.2)
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ )
+ |
+ (
+ (dataframe['rsi_14'] < 30.0)
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ & (dataframe['cmf'] > -0.5)
+ )
+ |
+ (
+ (dataframe['cti'] < -0.9)
+ & (dataframe['cmf'] > -0.5)
+ )
+ |
+ (
+ (dataframe['cti_1h'] < -0.8)
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ )
+ | (dataframe['rsi_14_1h'] < 30.0)
+ |
+ (
+ (dataframe['r_14_1h'] < -90.0)
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ & (dataframe['cmf'] > -0.5)
+ )
+ |
+ (
+ (dataframe['crsi_1h'] > 20.0)
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ )
+ | (dataframe['tpct_change_144'] < 0.16)
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ & (dataframe['cmf'] > -0.5)
+ )
+ |
+ (
+ (dataframe['hl_pct_change_36'] < 0.12)
+ & (dataframe['cmf'] > -0.5)
+ )
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ |
+ (
+ (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ & (dataframe['cmf'] > -0.5)
+ )
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.93)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ )
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99))
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ )
+ |
+ (
+ ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03))
+ & (dataframe['cmf'] > -0.5)
+ )
+ )
+
+ # Condition #42 - 15m. Semi swing. Local dip. 15m uptrend.
+ elif index == 42:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.92))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['ewo_15m'] > 5.4)
+ item_buy_logic.append(dataframe['rsi_14_15m'] < 33.6)
+ item_buy_logic.append(dataframe['cti_15m'] < -0.9)
+ item_buy_logic.append(dataframe['r_14_15m'] < -90.0)
+ item_buy_logic.append(dataframe['r_14'] < -94.0)
+ item_buy_logic.append(dataframe['crsi_1h'] > 20.0)
+ item_buy_logic.append(
+ (dataframe['ewo_15m'] > 5.6)
+ | (dataframe['cmf'] > 0.0)
+ | (dataframe['cti_1h'] < 0.25)
+ | (dataframe['r_480_1h'] < -25.0)
+ | (dataframe['tpct_change_12'] < 0.02)
+ | (dataframe['tpct_change_144'] < 0.036)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.98)
+ | (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo_15m'] > 5.6)
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.98)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.97)
+ | (dataframe['close'] < dataframe['sma_30'] * 0.96)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close'] < (dataframe['res2_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.96)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | (dataframe['rsi_14_15m'] < 30.0)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.2)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['rsi_14'] < 15.0)
+ |
+ (
+ (dataframe['cti_1h'] < 0.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ )
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['r_14_1h'] < -90.0)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.995)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > 0.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.1)
+ )
+ |
+ (
+ (dataframe['mfi'] > 40.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.1)
+ )
+ |
+ (
+ (dataframe['rsi_14'] < 25.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ & (dataframe['tpct_change_144'] < 0.16)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ |
+ (
+ (dataframe['crsi'] > 20.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ & (dataframe['cmf'] > -0.4)
+ )
+ |
+ (
+ (dataframe['cti_1h'] < 0.5)
+ & (dataframe['ema_200_pct_change_288'] < 0.1)
+ & (dataframe['cmf'] > -0.4)
+ )
+ |
+ (
+ (dataframe['rsi_14_1h'] < 50.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.1)
+ & (dataframe['cmf'] > -0.4)
+ )
+ |
+ (
+ (dataframe['r_14_1h'] < -90.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.1)
+ & (dataframe['cmf'] > -0.4)
+ )
+ | (dataframe['tpct_change_144'] < 0.06)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.04))
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ |
+ (
+ (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ & (dataframe['close'] < (dataframe['res2_1d'] * 1.0))
+ )
+ | (dataframe['close'] < dataframe['sma_30'] * 0.95)
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.97)
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99))
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ )
+ |
+ (
+ ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ )
+ |
+ (
+ (dataframe['rsi_14_15m'] < 30.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ & (dataframe['cmf'] > -0.4)
+ )
+ |
+ (
+ (dataframe['ewo_15m'] > 7.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ )
+
+ # Condition #43 - 15m. Semi swing. Local dip. 1h uptrend.
+ elif index == 43:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.84))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['bb40_2_low_15m'].shift().gt(0))
+ item_buy_logic.append(dataframe['bb40_2_delta_15m'].gt(dataframe['close_15m'] * 0.045))
+ item_buy_logic.append(dataframe['closedelta_15m'].gt(dataframe['close_15m'] * 0.034))
+ item_buy_logic.append(dataframe['tail_15m'].lt(dataframe['bb40_2_delta_15m'] * 0.18))
+ item_buy_logic.append(dataframe['close_15m'].lt(dataframe['bb40_2_low_15m'].shift()))
+ item_buy_logic.append(dataframe['close_15m'].le(dataframe['close_15m'].shift()))
+ item_buy_logic.append(dataframe['rsi_14_15m'] < 31.0)
+ item_buy_logic.append(dataframe['cti_15m'] < -0.85)
+ item_buy_logic.append(dataframe['rsi_14'] < 44.0)
+ item_buy_logic.append(
+ (dataframe['crsi_1h'] > 12.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.9))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > 0.0)
+ | (dataframe['mfi'] > 30.0)
+ |
+ (
+ (dataframe['rsi_14'] < 20.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ )
+ | (dataframe['cti'] < -0.9)
+ |
+ (
+ (dataframe['cti_1h'] < -0.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.04)
+ )
+ | (dataframe['tpct_change_144'] < 0.18)
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.90)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.955))
+ |
+ (
+ (dataframe['rsi_14_15m'] < 25.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ )
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.1)
+ | (dataframe['rsi_14'] < 36.0)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.96)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.2)
+ |
+ (
+ (dataframe['mfi'] > 20.0)
+ & (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.8))
+ )
+ | (dataframe['rsi_14'] < 15.0)
+ |
+ (
+ (dataframe['cti_1h'] < -0.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.8))
+ )
+ |
+ (
+ (dataframe['rsi_14_1h'] < 40.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.8))
+ )
+ |
+ (
+ (dataframe['r_14_1h'] < -90.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ )
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.12)
+ & (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.8))
+ )
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.4)
+ & (dataframe['tpct_change_144'] < 0.18)
+ & (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.8))
+ )
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ & (dataframe['crsi_1h'] > 12.0)
+ )
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.2)
+ |
+ (
+ (dataframe['rsi_14'] < 30.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ & (dataframe['btc_pct_close_max_24_5m'] < 1.05)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['cti_1h'] < -0.8)
+ & (dataframe['crsi_1h'] > 2.0)
+ )
+ |
+ (
+ (dataframe['rsi_14_1h'] < 30.0)
+ & (dataframe['crsi_1h'] > 2.0)
+ )
+ |
+ (
+ (dataframe['r_14_1h'] < -90.0)
+ & (dataframe['crsi_1h'] > 2.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ & (dataframe['not_downtrend_1h'])
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ |
+ (
+ (dataframe['crsi_1h'] > 30.0)
+ & (dataframe['btc_pct_close_max_24_5m'] < 1.05)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.2)
+ & (dataframe['crsi_1h'] > 4.0)
+ & (dataframe['btc_pct_close_max_24_5m'] < 1.05)
+ & (dataframe['not_downtrend_1h'])
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ & (dataframe['btc_pct_close_max_24_5m'] < 1.05)
+ )
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['crsi_1h'] > 4.0)
+ & (dataframe['btc_pct_close_max_24_5m'] < 1.05)
+ )
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ )
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ |
+ (
+ (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['sma_30'] * 0.95)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ & (dataframe['crsi_1h'] > 4.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ & (dataframe['btc_pct_close_max_24_5m'] < 1.05)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ & (dataframe['not_downtrend_1h'])
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99))
+ & (dataframe['btc_pct_close_max_24_5m'] < 1.05)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.04))
+ |
+ (
+ (dataframe['rsi_14_15m'] < 30.0)
+ & (dataframe['crsi_1h'] > 4.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ & (dataframe['btc_pct_close_max_24_5m'] < 1.05)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ & (dataframe['not_downtrend_1h'])
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ |
+ (
+ (dataframe['cti_15m'] < -0.9)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ & (dataframe['not_downtrend_1h'])
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ )
+
+ # Condition #44 - 15m. Semi swing. Local deeper dip. 15m uptrend.
+ elif index == 44:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['ema_200_15m'] > (dataframe['ema_200_15m'].shift(36) * 1.01))
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.952))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['close_15m'] < dataframe['ema_26_15m'] * 0.99)
+ item_buy_logic.append(dataframe['rsi_14_15m'] < 28.2)
+ item_buy_logic.append(dataframe['r_14_15m'] < -70.0)
+ item_buy_logic.append(dataframe['crsi_1h'] > 18.0)
+ item_buy_logic.append(
+ (dataframe['close'] < (dataframe['res3_1d'] * 1.05))
+ | (dataframe['cti_1h'] < 0.5)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.2))
+ | (dataframe['tpct_change_144'] < 0.18)
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ & (dataframe['cti_1h'] < 0.9)
+ )
+ |
+ (
+ (dataframe['cmf'] > 0.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ )
+ |
+ (
+ (dataframe['cti_1h'] < 0.8)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ )
+ | (dataframe['r_480_1h'] < -30.0)
+ |
+ (
+ (dataframe['crsi_1h'] > 30.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ & (dataframe['cti_1h'] < 0.9)
+ )
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.08)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ )
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.25)
+ & (dataframe['cti_1h'] < 0.9)
+ )
+ | (dataframe['ema_20'] > dataframe['ema_50'])
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['close'] < dataframe['sma_30'] * 0.9)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['cti_1h'] < 0.25)
+ | (dataframe['tpct_change_144'] < 0.14)
+ | (dataframe['hl_pct_change_48_1h'] < 0.7)
+ | (dataframe['ema_20'] > dataframe['ema_50'])
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['close'] < dataframe['sma_30'] * 0.916)
+ )
+ item_buy_logic.append(
+ (dataframe['cti_1h'] < 0.5)
+ | (dataframe['tpct_change_144'] < 0.14)
+ | (dataframe['ema_20'] > dataframe['ema_50'])
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['close'] < dataframe['sma_30'] * 0.956)
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ | (dataframe['rsi_14_15m'] < 25.0)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['ema_20'] > dataframe['ema_50'])
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['close'] < dataframe['sma_30'] * 0.956)
+ | (dataframe['rsi_14_15m'] < 25.0)
+ )
+ item_buy_logic.append(
+ (dataframe['rsi_14'] < 10.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] < dataframe['sma_30'] * 0.92)
+ | (dataframe['rsi_14_15m'] < 25.0)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.08)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] < dataframe['sma_30'] * 0.95)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] < (dataframe['res2_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.95)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))
+ | (dataframe['rsi_14_15m'] < 25.0)
+ )
+ item_buy_logic.append(dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.95))
+
+ # Condition #45 - 15m. Semi swing. Local deeper dip. 15m uptrend.
+ elif index == 45:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['ema_50_15m'] > dataframe['ema_200_1h'])
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.94))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['ewo_15m'] > 3.5)
+ item_buy_logic.append(dataframe['cci_15m'] < -190.0)
+ item_buy_logic.append(dataframe['r_14_15m'] < -96.0)
+ item_buy_logic.append((dataframe['rsi_14_1h'] + dataframe['rsi_14_15m']) < 69.5)
+ item_buy_logic.append(dataframe['crsi_1h'] > 18.0)
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['ewo_15m'] > 4.0)
+ | (dataframe['cci_15m'] < -220.0)
+ | ((dataframe['rsi_14_1h'] + dataframe['rsi_14_15m']) < 60.0)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.97)
+ | (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.1)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['crsi_1h'] > 30.0)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.96)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ | (dataframe['ewo_15m'] > 4.0)
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.2)
+ & (dataframe['tpct_change_144'] < 0.2)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['mfi'] > 20.0)
+ & (dataframe['tpct_change_144'] < 0.2)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['crsi'] > 25.0)
+ & (dataframe['tpct_change_144'] < 0.2)
+ & (dataframe['not_downtrend_1h'])
+ )
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['crsi_1h'] > 30.0)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.06))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ |
+ (
+ (dataframe['close'] < dataframe['sma_30'] * 0.94)
+ & (dataframe['cmf'] > -0.4)
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ & (dataframe['tpct_change_144'] < 0.2)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ & (dataframe['cmf'] > -0.4)
+ )
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.98))
+ & (dataframe['cmf'] > -0.4)
+ )
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ |
+ (
+ (dataframe['rsi_14_15m'] < 20.0)
+ & (dataframe['cmf'] > -0.4)
+ )
+ | (dataframe['cti_15m'] < -0.9)
+ |
+ (
+ (dataframe['ewo_15m'] > 5.0)
+ & (dataframe['cmf'] > -0.4)
+ )
+ )
+
+ # Condition #46 - 15m. Semi swing. 1h uptrend.
+ elif index == 46:
+ # Non-Standard protections (add below)
+ item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))
+ item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.94))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_26_15m'] > dataframe['ema_12_15m'])
+ item_buy_logic.append((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ item_buy_logic.append((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100))
+ item_buy_logic.append(dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.999))
+ item_buy_logic.append(dataframe['r_14'] < -72.0)
+ item_buy_logic.append(dataframe['crsi_1h'] > 22.0)
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.2))
+ | (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(48))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['r_480_1h'] < -5.0)
+ | (dataframe['tpct_change_144'] < 0.26)
+ | (dataframe['hl_pct_change_48_1h'] < 0.75)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['tpct_change_144'] < 0.26)
+ | (dataframe['hl_pct_change_48_1h'] < 0.75)
+ | (dataframe['close'] < (dataframe['res2_1d'] * 1.0))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.1)
+ & (dataframe['cmf_1h'] > -0.1)
+ )
+ |(dataframe['cti_1h'] < 0.0)
+ | (dataframe['tpct_change_144'] < 0.22)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.028))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.985))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.2)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ |
+ (
+ (dataframe['mfi'] > 30.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.3)
+ )
+ | (dataframe['rsi_14'] < 8.0)
+ |
+ (
+ (dataframe['cti_1h'] < 0.5)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.99))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.028))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.92))
+ )
+
+ # Condition #47 - 15m. Semi swing. Local dip. 1h minor dip.
+ elif index == 47:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['rsi_14_15m'] < dataframe['rsi_14_15m'].shift(3))
+ item_buy_logic.append(dataframe['ema_20_1h'] > dataframe['ema_25_1h'])
+ item_buy_logic.append(dataframe['close_15m'] < (dataframe['sma_15_15m'] * 0.95))
+ item_buy_logic.append(
+ ((dataframe['open_15m'] < dataframe['ema_20_1h']) & (dataframe['low_15m'] < dataframe['ema_20_1h'])) |
+ ((dataframe['open_15m'] > dataframe['ema_20_1h']) & (dataframe['low_15m'] > dataframe['ema_20_1h'])))
+ item_buy_logic.append(dataframe['cti_15m'] < -0.9)
+ item_buy_logic.append(dataframe['r_14_15m'] < -90.0)
+ item_buy_logic.append(dataframe['r_14'] < -97.0)
+ item_buy_logic.append(dataframe['cti_1h'] < 0.1)
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['crsi_1h'] > 15.0)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 25.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['tpct_change_144'] < 0.18)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ | (dataframe['close_15m'] < (dataframe['sma_15_15m'] * 0.94))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ |
+ (
+ (dataframe['cti_1h'] < 0.0)
+ & (dataframe['hl_pct_change_36'] < 0.1)
+ )
+ |
+ (
+ (dataframe['crsi_1h'] > 20.0)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ | (dataframe['close'] < dataframe['ema_13'] * 0.96)
+ | (dataframe['close_15m'] < (dataframe['sma_15_15m'] * 0.93))
+ )
+ item_buy_logic.append(dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.95))
+
+ # Condition #48 - 15m. Semi swing. Local deep. 15m uptrend.
+ elif index == 48:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.85))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['close_15m'].shift(3) < (dataframe['sma_15_15m'].shift(3) * 0.95))
+ item_buy_logic.append(dataframe['close_15m'] > (dataframe['open_15m'].shift(3)))
+ item_buy_logic.append(dataframe['ewo_15m'] > 2.8)
+ item_buy_logic.append(dataframe['cti_15m'] < -0.75)
+ item_buy_logic.append(dataframe['r_14_15m'].shift(3) < -94.0)
+ item_buy_logic.append(dataframe['cti'] < -0.5)
+ item_buy_logic.append(dataframe['cti_1h'] < 0.1)
+ item_buy_logic.append(dataframe['crsi_1h'] > 18.0)
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cti_1h'] < 0.0)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['ewo_15m'] > 3.2)
+ | (dataframe['cti'] < -0.8)
+ | (dataframe['cti_1h'] < -0.75)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ |
+ (
+ (dataframe['ewo_15m'] > 4.4)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ )
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti'] < -0.8)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ |
+ (
+ (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.968)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['rsi_14'] < 30.0)
+ |
+ (
+ (dataframe['cti'] < -0.8)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.14))
+ )
+ | (dataframe['cti_1h'] < -0.5)
+ |
+ (
+ (dataframe['r_480_1h'] < -30.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ )
+ | (dataframe['tpct_change_144'] < 0.16)
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ )
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.968)
+ | (dataframe['ewo_15m'] > 8.0)
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > 0.1)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ |
+ (
+ (dataframe['mfi'] > 36.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['ema_200_pct_change_288'] < 0.18)
+ & (dataframe['hl_pct_change_48_1h'] < 0.6)
+ & (dataframe['rsi_14'] < 40.0)
+ )
+ | (dataframe['rsi_14'] < 20.0)
+ |
+ (
+ (dataframe['cti'] < -0.9)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ )
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ |
+ (
+ (dataframe['r_14_1h'] < -99.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['ema_200_pct_change_288'] < 0.18)
+ )
+ |
+ (
+ (dataframe['crsi_1h'] > 30.0)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ & (dataframe['hl_pct_change_48_1h'] < 0.6)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['rsi_14'] < 40.0)
+ )
+ | (dataframe['tpct_change_144'] < 0.08)
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.06))
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ )
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.36)
+ & (dataframe['rsi_14'] < 40.0)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ |
+ (
+ (dataframe['close'] < dataframe['sma_30'] * 0.95)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.038))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.05))
+ |
+ (
+ (dataframe['rsi_14_15m'] < 20.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ )
+ )
+
+ # Condition #49 - 15m. Semi swing. Local deeper dip.
+ elif index == 49:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.89))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+ item_buy_logic.append(dataframe['ema_200_pct_change_288'] < 0.4)
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_26_15m'] > dataframe['ema_12_15m'])
+ item_buy_logic.append((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.025))
+ item_buy_logic.append((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100))
+ item_buy_logic.append(dataframe['close_15m'] < dataframe['ema_20_15m'] * 0.93)
+ item_buy_logic.append(dataframe['rsi_14_15m'] < 28.0)
+ item_buy_logic.append(dataframe['crsi_15m'] > 18.0)
+ item_buy_logic.append(
+ (dataframe['rsi_14'] < 15.0)
+ |
+ (
+ (dataframe['cti_1h'] < -0.9)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ )
+ | (dataframe['rsi_14_1h'] < 20.0)
+ |
+ (
+ (dataframe['crsi_1h'] > 16.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.08)
+ )
+ | (dataframe['tpct_change_144'] < 0.12)
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.08)
+ )
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['tpct_change_144'] < 0.2)
+ & (dataframe['crsi_1h'] > 12.0)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.9)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.04))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.96))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.05))
+ | (dataframe['rsi_14_15m'] < 15.0)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.28)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['ema_20'] > dataframe['ema_50'])
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['crsi_1h'] > 16.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.032))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] < dataframe['ema_13'] * 0.96)
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.042))
+ | (dataframe['close_15m'] < dataframe['ema_20_15m'] * 0.92)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 40.0)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.04))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.038))
+ )
+ item_buy_logic.append(
+ (dataframe['cti_1h'] < -0.5)
+ | (dataframe['rsi_14_1h'] < 20.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ | (dataframe['hl_pct_change_36'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ | ((dataframe['btc_pct_close_max_72_5m'] < 1.01) & (dataframe['btc_not_downtrend_1h'] == True))
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.86)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.98))
+ )
+
+ # Condition #50 - 15m. Semi swing. Deep local dip. Mild 15m uptrend.
+ elif index == 50:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+ item_buy_logic.append(dataframe['ema_200_pct_change_144'] < 0.12)
+
+ # Logic
+ item_buy_logic.append(dataframe['close_15m'] < dataframe['ema_20_15m'] * 0.948)
+ item_buy_logic.append(dataframe['ewo_15m'] > 1.8)
+ item_buy_logic.append(dataframe['cti_15m'] < -0.9)
+ item_buy_logic.append(dataframe['r_14_15m'] < -97.0)
+ item_buy_logic.append(dataframe['r_96_15m'] < -75.0)
+ item_buy_logic.append(dataframe['rsi_14'] < 31.4)
+ item_buy_logic.append(dataframe['crsi'] > 13.0)
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > 0.0)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['crsi_1h'] > 16.0)
+ | (dataframe['ewo_15m'] > 2.4)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ | (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.968)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['ewo_15m'] > 9.5)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.968)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > 0.0)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['ewo_15m'] > 4.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.968)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti_1h'] < -0.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['ewo_15m'] > 4.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.968)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.99))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['rsi_14'] < 28.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.96)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.99))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 36.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['crsi_1h'] > 16.0)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ | (dataframe['hl_pct_change_48_1h'] < 0.2)
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['tpct_change_144'] < 0.2)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ |
+ (
+ (dataframe['close'] < (dataframe['res2_1d'] * 1.0))
+ & (dataframe['tpct_change_144'] < 0.2)
+ )
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.95)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.985)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.98))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03))
+ | (dataframe['rsi_14_15m'] < 10.0)
+ )
+
+ # Condition #51 - 15m. Semi swing. Downtrend. Dip.
+ elif index == 51:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 1.0)
+
+ # Logic
+ item_buy_logic.append(dataframe['close_15m'] < (dataframe['ema_16_15m'] * 0.944))
+ item_buy_logic.append(dataframe['ewo_15m'] < -1.0)
+ item_buy_logic.append(dataframe['rsi_14_15m'] > 29.0)
+ item_buy_logic.append(dataframe['cti_15m'] < -0.8)
+ item_buy_logic.append(dataframe['r_14_15m'] < -94.0)
+ item_buy_logic.append(dataframe['rsi_14'] > 30.0)
+ item_buy_logic.append(
+ (
+ (dataframe['cti_1h'] < -0.8)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ )
+ | (dataframe['tpct_change_144'] < 0.08)
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ )
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['cmf'] > -0.4)
+ & (dataframe['ema_200_pct_change_144'] > -0.1)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ |
+ (
+ (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ )
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.95))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.94)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ |
+ (
+ (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ )
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ & (dataframe['cmf'] > -0.4)
+ & (dataframe['ema_200_pct_change_144'] > -0.1)
+ )
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.98))
+ & (dataframe['ema_200_pct_change_144'] > -0.1)
+ )
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.04))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['close'] > (dataframe['sup3_1d'] * 0.99))
+ )
+ item_buy_logic.append(
+ ((dataframe['cmf'] > -0.0) & (dataframe['hl_pct_change_36_1h'] < 0.25))
+ | (dataframe['crsi_1h'] > 18.0)
+ | (dataframe['hl_pct_change_48_1h'] < 0.2)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.97))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.99))
+ )
+ item_buy_logic.append(
+ (dataframe['cti_1h'] < -0.5)
+ | (dataframe['hl_pct_change_36_1h'] < 0.3)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.99))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.99))
+ )
+
+ # Condition #52 - 15m Semi swing. Local dip. BTC not downtrend.
+ elif index == 52:
+ # Non-Standard protections (add below)
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.89))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+ item_buy_logic.append(dataframe['ema_200_pct_change_144'] < 0.12)
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_26_15m'] > dataframe['ema_12_15m'])
+ item_buy_logic.append((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.023))
+ item_buy_logic.append((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100))
+ item_buy_logic.append(dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.998))
+ item_buy_logic.append(dataframe['crsi_1h'] > 15.0)
+ item_buy_logic.append(
+ (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['close'] > (dataframe['ema_200_1h'] * 0.6))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['tpct_change_144'] < 0.3)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['ema_20'] > dataframe['ema_50'])
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ | (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.944)
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.7))
+ | (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.2))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['cti_1h'] < 0.75)
+ | (dataframe['tpct_change_144'] < 0.28)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['ema_20'] > dataframe['ema_50'])
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['tpct_change_144'] < 0.26)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.028))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.975))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.028))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['r_14'] < -80.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.028))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['rsi_14'] < 36.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.024))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.985))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['rsi_14'] < 28.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ | (dataframe['ema_50_1h'] > dataframe['ema_200_1h'])
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.8))
+ | (dataframe['close'] > (dataframe['sup2_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.042))
+ )
+ item_buy_logic.append(
+ (dataframe['cti'] < -0.9)
+ | (dataframe['rsi_14'] < 36.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.026))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['ewo'] > 1.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['ema_20'] > dataframe['ema_50'])
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['ema_50_1h'] > dataframe['ema_200_1h'])
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.7))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.032))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.97))
+ )
+ item_buy_logic.append(
+ (dataframe['cti'] < -0.9)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['ewo'] > 1.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['tpct_change_12'] < 0.1)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['ema_50_1h'] > dataframe['ema_200_1h'])
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.8))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.04))
+ )
+ item_buy_logic.append(
+ (dataframe['cti'] < -0.9)
+ | (dataframe['rsi_14'] < 15.0)
+ | (dataframe['ewo'] > 1.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_12'] < 0.06)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.028))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.96))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['ewo'] > 1.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.96)
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.034))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.1)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['ewo'] > 1.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.05))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.028))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.98))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 16.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.044))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > 0.1)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ |
+ (
+ (dataframe['rsi_14'] < 30.0)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ | (dataframe['cti'] < -0.95)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['rsi_14_1h'] < 20.0)
+ |
+ (
+ (dataframe['crsi_1h'] > 40.0)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ | (dataframe['tpct_change_144'] < 0.1)
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ | (dataframe['hl_pct_change_48_1h'] < 0.16)
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ & (dataframe['tpct_change_144'] < 0.26)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.9)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ |
+ (
+ (dataframe['close'] > (dataframe['sup_level_1h'] * 0.96))
+ & (dataframe['hl_pct_change_36'] < 0.1)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.975)
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ )
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.95))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.05))
+ | (dataframe['rsi_14_15m'] < 20.0)
+ )
+
+ # Condition #53 - 15m. Semi swing. BTC not negative. Local dip.
+ elif index == 53:
+ # Non-Standard protections (add below)
+ item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(12))
+ item_buy_logic.append(dataframe['ema_200_1h'].shift(12) > dataframe['ema_200_1h'].shift(24))
+ item_buy_logic.append(dataframe['ema_200_1h'].shift(24) > dataframe['ema_200_1h'].shift(36))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_26_15m'] > dataframe['ema_12_15m'])
+ item_buy_logic.append((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ item_buy_logic.append((dataframe['ema_26_15m'].shift(3) - dataframe['ema_12_15m'].shift(3)) > (dataframe['open_15m'] / 100))
+ item_buy_logic.append(dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99))
+ item_buy_logic.append(dataframe['r_14'] < -75.0)
+ item_buy_logic.append(
+ (dataframe['crsi_1h'] > 16.0)
+ | (dataframe['cmf'] > -0.1)
+ | (dataframe['ema_50'] > dataframe['ema_200'])
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.95))
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.95))
+ | (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.1))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.022))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.985))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.022))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.97))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.022))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.96))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 25.0)
+ | (dataframe['rsi_14'] < 10.0)
+ | (dataframe['cti_1h'] < -0.85)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['tpct_change_144'] < 0.18)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.97))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.038))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ |
+ (
+ (dataframe['rsi_14'] < 20.0)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ |
+ (
+ (dataframe['cti'] < -0.95)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['cti_1h'] < -0.8)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['crsi_1h'] > 50.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ & (dataframe['not_downtrend_1h'])
+ )
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['crsi_1h'] > 20.0)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ |
+ (
+ (dataframe['close'] < dataframe['sma_30'] * 0.94)
+ & (dataframe['crsi_1h'] > 10.0)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ & (dataframe['crsi_1h'] > 10.0)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ |
+ (
+ (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ & (dataframe['tpct_change_144'] < 0.16)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ & (dataframe['crsi_1h'] > 10.0)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.97))
+ & (dataframe['crsi_1h'] > 10.0)
+ & (dataframe['tpct_change_144'] < 0.16)
+ )
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03))
+ |
+ (
+ (dataframe['rsi_14_15m'] < 20.0)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ | (dataframe['cti_15m'] < -0.9)
+ )
+
+ # Condition #54 - 15m Semi swing. Uptrend. Local dip.
+ elif index == 54:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['ema_12_15m'] > dataframe['ema_200_15m'])
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['ewo_15m'] > 5.4)
+ item_buy_logic.append(dataframe['r_14_15m'] < -96.0)
+ item_buy_logic.append(dataframe['r_96_15m'] < -94.0)
+ item_buy_logic.append(dataframe['r_14'] < -96.0)
+ item_buy_logic.append(dataframe['r_480_1h'] < -16.0)
+ item_buy_logic.append(
+ (dataframe['rsi_14'] < 12.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.12)
+ & (dataframe['cmf_1h'] > -0.25)
+ & (dataframe['hl_pct_change_48_1h'] < 0.6)
+ )
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ |
+ (
+ (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ & (dataframe['cmf_1h'] > -0.25)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.1))
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ & (dataframe['cmf_1h'] > -0.25)
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ & (dataframe['hl_pct_change_48_1h'] < 0.6)
+ )
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.96))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['tpct_change_144'] < 0.18)
+ | (dataframe['ewo_15m'] > 6.0)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['ewo_15m'] > 7.0)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.9))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['tpct_change_144'] < 0.24)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['ewo_15m'] > 8.0)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.99))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['tpct_change_12'] < 0.18)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.99))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < (dataframe['res2_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.99))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.99))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.75)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 15.0)
+ | (dataframe['cti'] < -0.95)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['r_14_1h'] < -98.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.05))
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.975)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.95))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.024))
+ )
+
+ # Condition #55 - 15m. Semi swing. Uptrend. Local dip.
+ elif index == 55:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['ewo_15m'] > 5.9)
+ item_buy_logic.append(dataframe['close_15m'] > (dataframe['close_15m'].shift(3)))
+ item_buy_logic.append(dataframe['close_15m'].shift(3) < (dataframe['bb20_2_low_15m'].shift(3) * 0.992))
+ item_buy_logic.append(dataframe['r_14_15m'].shift(3) < -95.0)
+ item_buy_logic.append(dataframe['r_96_15m'].shift(3) < -86.0)
+ item_buy_logic.append(dataframe['close'] < dataframe['open'])
+ item_buy_logic.append(dataframe['r_480_1h'] < -16.0)
+ item_buy_logic.append(
+ (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(36))
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.1))
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.96)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.999))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['crsi_1h'] > 30.0)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.05))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.96)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.2)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['rsi_14'] < 40.0)
+ )
+ |
+ (
+ (dataframe['mfi'] > 36.0)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ | (dataframe['rsi_14'] < 22.0)
+ | (dataframe['cti_1h'] < -0.5)
+ |
+ (
+ (dataframe['rsi_14_1h'] < 40.0)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ )
+ |
+ (
+ (dataframe['crsi_1h'] > 25.0)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.16)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['rsi_14'] < 30.0)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ |
+ (
+ (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['sma_30'] * 0.94)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ )
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.024))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.98))
+ |
+ (
+ ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ )
+ | (dataframe['rsi_14_15m'] < 20.0)
+ )
+
+ # Condition #56 - 15m. Semi swing. Downtrend. Local dip.
+ elif index == 56:
+ # Non-Standard protections (add below)
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.84))
+
+ # Logic
+ item_buy_logic.append(dataframe['ewo_15m'].shift(3) < -14.8)
+ item_buy_logic.append(dataframe['cti_15m'].shift(3).rolling(15).max() < -0.9)
+ item_buy_logic.append(dataframe['r_14_15m'].shift(3) < -90.0)
+ item_buy_logic.append(dataframe['r_14'] < -65.0)
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['crsi_1h'] > 0.0)
+ )
+ item_buy_logic.append(
+ (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['r_480_1h'] > -95.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ )
+
+ # Condition #57 - 15m. Semi swing. Strong uptrend. Local dip. BTC not downtrend.
+ elif index == 57:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.92))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['ewo_15m'].shift(3) > 5.0)
+ item_buy_logic.append(dataframe['close_15m'].shift(3) < (dataframe['sma_30_15m'].shift(3) * 0.988))
+ item_buy_logic.append(dataframe['close_15m'].shift(3) < (dataframe['bb20_2_low_15m'].shift(3) * 0.996))
+ item_buy_logic.append(dataframe['rsi_14_15m'].shift(3) < 31.2)
+ item_buy_logic.append(dataframe['r_14_15m'].shift(3) < -94.0)
+ item_buy_logic.append(dataframe['r_96_15m'].shift(3) < -80.0)
+ item_buy_logic.append(dataframe['close'] < dataframe['open'])
+ item_buy_logic.append(dataframe['r_480_1h'] < -24.0)
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['r_14_1h'] < -95.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.96)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.03))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ )
+ item_buy_logic.append(
+ (dataframe['cti_1h'] < -0.5)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.948)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24))
+ | (dataframe['close'] < (dataframe['res2_1d'] * 1.0))
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.948)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['ewo_15m'].shift(3) > 8.0)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['crsi_1h'] > 25.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.96)
+ | (dataframe['close_15m'].shift(3) < (dataframe['bb20_2_low_15m'].shift(3) * 0.98))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > 0.0)
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.1))
+ )
+ | (dataframe['mfi'] > 50.0)
+ |
+ (
+ (dataframe['rsi_14'] < 30.0)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ |
+ (
+ (dataframe['cti'] < -0.8)
+ & (dataframe['ema_200_pct_change_144'] < 0.05)
+ & (dataframe['rsi_14'] < 36.0)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ |
+ (
+ (dataframe['cti_1h'] < -0.5)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ | (dataframe['rsi_14_1h'] < 40.0)
+ |
+ (
+ (dataframe['r_14_1h'] < -90.0)
+ & (dataframe['rsi_14'] < 36.0)
+ )
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.12)
+ & (dataframe['rsi_14'] < 36.0)
+ )
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.1))
+ & (dataframe['ema_200_pct_change_144'] < 0.05)
+ & (dataframe['rsi_14'] < 36.0)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.36)
+ & (dataframe['rsi_14'] < 36.0)
+ )
+ |
+ (
+ (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ & (dataframe['ema_200_pct_change_144'] < 0.05)
+ & (dataframe['rsi_14'] < 36.0)
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.96)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.024))
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.99))
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.04))
+ | (dataframe['rsi_14_15m'] < 20.0)
+ |
+ (
+ (dataframe['cti_15m'] < -0.9)
+ & (dataframe['ema_200_pct_change_144'] < 0.05)
+ )
+ )
+
+ # Condition #58 - Semi swing. Local dip.
+ elif index == 58:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.88))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['rmi_17'] < 49.0)
+ item_buy_logic.append(dataframe['cci_25'] < -116.0)
+ item_buy_logic.append(dataframe['srsi_fk'] < 32.0)
+ item_buy_logic.append(dataframe['bb20_delta'] > 0.026)
+ item_buy_logic.append(dataframe['bb20_width'] > 0.095)
+ item_buy_logic.append(dataframe['close_delta'] > dataframe['close'] * 12.0 / 1000.0 )
+ item_buy_logic.append(dataframe['close'] < (dataframe['bb20_3_low'] * 0.999))
+ item_buy_logic.append(
+ (dataframe['cti_1h'] < 0.88)
+ | (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.1))
+ )
+ item_buy_logic.append(
+ (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.3))
+ )
+ item_buy_logic.append(
+ (dataframe['tpct_change_12'] < 0.1)
+ | (dataframe['rsi_14'] > 18.0)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ |
+ (
+ (dataframe['mfi'] > 20.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ )
+ | (dataframe['rsi_14'] < 15.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.95)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.03))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['rsi_14'] < 22.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['crsi'] > 16.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ | (dataframe['tpct_change_144'] < 0.08)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ | (dataframe['hl_pct_change_36'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.2)
+ |
+ (
+ (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.2))
+ )
+ |
+ (
+ (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.2))
+ )
+ | (dataframe['close'] < dataframe['sma_30'] * 0.89)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.95)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.965))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+
+ # Condition #59 - Semi swing. Local dip.
+ elif index == 59:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.89))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_100'] < (dataframe['ema_200'] * 1.054))
+ item_buy_logic.append(dataframe['bb20_width'] > 0.3)
+ item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_mid'] * 1.014))
+ item_buy_logic.append(dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.0))
+ item_buy_logic.append(dataframe['cti'] < -0.115)
+ item_buy_logic.append(dataframe['r_14'] < -45.0)
+ item_buy_logic.append(dataframe['crsi_1h'] > 10.0)
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['cti'] < -0.8)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.7)
+ | (dataframe['ema_20'] > dataframe['ema_50'])
+ | (dataframe['close'] > dataframe['ema_26'])
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ | (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24))
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.7))
+ )
+ item_buy_logic.append(
+ (dataframe['cti'] < -0.9)
+ | (dataframe['rsi_14'] < 36.0)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.24))
+ )
+ | (dataframe['cmf'] > 0.0)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['r_14'] < -95.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ |
+ (
+ (dataframe['cti_1h'] < -0.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ )
+ | (dataframe['rsi_14_1h'] < 20.0)
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.2)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ | (dataframe['hl_pct_change_36'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ | ((dataframe['btc_pct_close_max_72_5m'] < 1.01) & (dataframe['btc_not_downtrend_1h'] == True))
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ |
+ (
+ (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.26))
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ | (dataframe['close'] < dataframe['sma_30'] * 0.86)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.94))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ )
+ )
+
+ # Condition #60 - Semi swing. Local dip.
+ elif index == 60:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['roc_9_1h'] < 86.0)
+ item_buy_logic.append(dataframe['bb20_width_1h'] < 0.954)
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.85))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['rsi_4'] < 44.0)
+ item_buy_logic.append(dataframe['close'] < dataframe['ema_8'] * 0.948)
+ item_buy_logic.append(dataframe['ewo'] > -5.0)
+ item_buy_logic.append(dataframe['close'] < dataframe['ema_16'] * 0.988)
+ item_buy_logic.append(dataframe['rsi_14'] < 24.0)
+ item_buy_logic.append(
+ (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['close'] > (dataframe['ema_200_1h'] * 0.82))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['crsi_1h'] > 12.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] > (dataframe['sup2_1d'] * 1.0))
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.96))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['rsi_14'] < 15.0)
+ | (dataframe['cti'] < -0.8)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.96)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.3)
+ |
+ (
+ (dataframe['mfi'] > 20.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ )
+ | (dataframe['rsi_14'] < 12.0)
+ | (dataframe['cti'] < -0.9)
+ |
+ (
+ (dataframe['cti_1h'] < -0.8)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ )
+ | (dataframe['rsi_14_1h'] < 20.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['cmf'] > -0.5)
+ & (dataframe['crsi_1h'] > 4.0)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ & (dataframe['cmf'] > -0.5)
+ & (dataframe['crsi_1h'] > 4.0)
+ )
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.024))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.2)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['tpct_change_2'] < 0.06)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ | (dataframe['mfi'] > 50.0)
+ |
+ (
+ (dataframe['cti_1h'] < 0.8)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['tpct_change_2'] < 0.06)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['rsi_14_1h'] < 50.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ |
+ (
+ (dataframe['r_14_1h'] < -90.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.16)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['tpct_change_2'] < 0.06)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ & (dataframe['hl_pct_change_36'] < 0.25)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['tpct_change_2'] < 0.06)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['tpct_change_2'] < 0.06)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['tpct_change_2'] < 0.06)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['tpct_change_2'] < 0.06)
+ )
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.044))
+ )
+
+ # Condition #61 - Semi swing. Local dip. Stochastic fast cross.
+ elif index == 61:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['open'] < dataframe['ema_8'] * 1.147)
+ item_buy_logic.append(qtpylib.crossed_above(dataframe['fastk'], dataframe['fastd']))
+ item_buy_logic.append(dataframe['fastk'] < 39.0)
+ item_buy_logic.append(dataframe['fastd'] < 28.0)
+ item_buy_logic.append(dataframe['adx'] > 13.0)
+ item_buy_logic.append(dataframe['ewo'] > 3.4)
+ item_buy_logic.append(dataframe['cti'] < -0.9)
+ item_buy_logic.append(dataframe['cti_1h'] < 0.0)
+ item_buy_logic.append(dataframe['r_480_1h'] < -25.0)
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | (dataframe['adx'] > 20.0)
+ )
+
+ # Condition #62 - Semi swing. Local dip. Downtrend.
+ elif index == 62:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['ewo'] < -7.6)
+ item_buy_logic.append(dataframe['bb20_2_mid_1h'] >= dataframe['t3_avg_1h'])
+ item_buy_logic.append(dataframe['t3_avg'] <= dataframe['ema_8'] * 1.121)
+ item_buy_logic.append(dataframe['cti'] < -0.9)
+ item_buy_logic.append(dataframe['r_14'] < -78.0)
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['crsi_1h'] > 4.0)
+ )
+ item_buy_logic.append(
+ (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['crsi_1h'] > 4.0)
+ | (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.2))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['crsi_1h'] > 6.0)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(48))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.964)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] < -8.4)
+ | (dataframe['crsi_1h'] > 8.0)
+ | (dataframe['tpct_change_144'] < 0.18)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(48))
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.75))
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ | (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ | (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.25))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] < -8.6)
+ | (dataframe['crsi_1h'] > 16.0)
+ | (dataframe['tpct_change_144'] < 0.18)
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(48))
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.75))
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ | (dataframe['close'] > (dataframe['sup2_1d'] * 1.0))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['ewo'] < -8.0)
+ | (dataframe['cti_1h'] < -0.75)
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.75))
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ | (dataframe['close'] > (dataframe['sup2_1d'] * 1.0))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] < -10.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['crsi_1h'] > 6.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(48))
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.80))
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.90))
+ | (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] < -8.0)
+ | (dataframe['crsi_1h'] > 8.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(48))
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.80))
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.90))
+ | (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ )
+ item_buy_logic.append(
+ (
+ (
+ (dataframe['ewo'] < -8.0)
+ | (dataframe['crsi_1h'] > 8.0)
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.80))
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.90))
+ | (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ )
+ &
+ (
+ (dataframe['ewo'] < -9.0)
+ | (dataframe['crsi_1h'] > 10.0)
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.70))
+ | (dataframe['close'] > (dataframe['sup2_1d'] * 1.0))
+ )
+ )
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(48))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] < -8.8)
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['crsi_1h'] > 12.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] < -10.0)
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['crsi_1h'] > 12.0)
+ | (dataframe['tpct_change_144'] < 0.18)
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] < -10.0)
+ | (dataframe['cmf'] > -0.1)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['crsi_1h'] > 12.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ | (dataframe['close'] > (dataframe['sup2_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['ewo'] < -10.0)
+ | (dataframe['cmf'] > -0.3)
+ | (dataframe['crsi_1h'] > 12.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > 0.0)
+ | (dataframe['mfi'] > 40.0)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.024))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.1)
+ | (dataframe['rsi_14'] < 36.0)
+ | (dataframe['cti'] < -0.95)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['rsi_14'] < 28.0)
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ )
+ |
+ (
+ (dataframe['cti'] < -0.95)
+ & (dataframe['crsi_1h'] > 2.0)
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ )
+ |
+ (
+ (dataframe['cti_1h'] < -0.95)
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ )
+ |
+ (
+ (dataframe['rsi_14_1h'] < 20.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ )
+ |
+ (
+ (dataframe['crsi_1h'] > 10.0)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.2)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ )
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['crsi_1h'] > 2.0)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ | (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.024))
+ )
+
+ # Condition #63 - Semi swing. Local dip. ClucHA.
+ elif index == 63:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ item_buy_logic.append(dataframe['close'] > (dataframe['ema_200_1h'] * 0.7))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['bb40_2_delta'] > dataframe['ha_close'] * 0.042)
+ item_buy_logic.append(dataframe['ha_closedelta'] > dataframe['ha_close'] * 0.017)
+ item_buy_logic.append(dataframe['ha_tail'] < dataframe['bb40_2_delta'] * 1.14)
+ item_buy_logic.append(dataframe['ha_close'] < dataframe['bb40_2_low'].shift())
+ item_buy_logic.append(dataframe['ha_close'] < dataframe['ha_close'].shift())
+ item_buy_logic.append(dataframe['roc_9_1h'] > 0.526)
+ item_buy_logic.append(dataframe['r_480_1h'] < -12.0)
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['crsi_1h'] > 5.0)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['close'] > (dataframe['ema_200_1h'] * 0.76))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.95))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['r_480_1h'] < -18.0)
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.95))
+ | (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.5))
+ )
+ item_buy_logic.append(
+ (dataframe['cti'] < -0.8)
+ | (dataframe['rsi_14'] < 36.0)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.97)
+ )
+ item_buy_logic.append(
+ (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['bb40_2_delta'] > dataframe['ha_close'] * 0.056)
+ | (dataframe['ha_closedelta'] > dataframe['ha_close'] * 0.03)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['cti'] < -0.8)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['bb40_2_delta'] > dataframe['ha_close'] * 0.05)
+ | (dataframe['ha_closedelta'] > dataframe['ha_close'] * 0.02)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['rsi_14'] < 22.0)
+ | (dataframe['cti'] < -0.8)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['bb40_2_delta'] > dataframe['ha_close'] * 0.05)
+ | (dataframe['ha_closedelta'] > dataframe['ha_close'] * 0.04)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.1)
+ | (dataframe['rsi_14'] < 28.0)
+ | (dataframe['cti'] < 0.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['bb40_2_delta'] > dataframe['ha_close'] * 0.05)
+ | (dataframe['ha_closedelta'] > dataframe['ha_close'] * 0.04)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['ewo'] > 4.0)
+ | (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['cti'] < -0.8)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.97))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['ewo'] > 4.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.9))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.97))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['ewo'] > 4.0)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 15.0)
+ | (dataframe['cti'] < -0.8)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.9))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.97))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['rsi_14'] < 15.0)
+ | (dataframe['cti'] < -0.8)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.96)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 36.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti'] < -0.96)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['crsi_1h'] > 30.0)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.0)
+ & (dataframe['ema_200_pct_change_144'] < 0.12)
+ )
+ |
+ (
+ (dataframe['rsi_14'] < 18.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ )
+ |
+ (
+ (dataframe['cti'] < -0.9)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ )
+ | (dataframe['cti_1h'] < -0.8)
+ |
+ (
+ (dataframe['rsi_14_1h'] < 50.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ )
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ |
+ (
+ (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ )
+ |
+ (
+ (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ & (dataframe['cmf'] > -0.5)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ )
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.024))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ )
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.96))
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ |
+ (
+ ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ & (dataframe['ema_200_pct_change_144'] < 0.12)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ | (dataframe['rsi_14_15m'] < 20.0)
+ |
+ (
+ (dataframe['cti_15m'] < -0.9)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ )
+ item_buy_logic.append(dataframe['volume'] < (dataframe['volume_mean_12'] * 1.4))
+ item_buy_logic.append(dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.8))
+
+ # Condition #64 - Semi swing. Squeeze momentum.
+ elif index == 64:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.8))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['bb20_2_low'] < dataframe['kc_lowerband_28_1'])
+ item_buy_logic.append(dataframe['bb20_2_upp'] > dataframe['kc_upperband_28_1'])
+ item_buy_logic.append(dataframe['linreg_val_20'].shift(2) > dataframe['linreg_val_20'].shift(1))
+ item_buy_logic.append(dataframe['linreg_val_20'].shift(1) < dataframe['linreg_val_20'])
+ item_buy_logic.append(dataframe['linreg_val_20'] < 0.0)
+ item_buy_logic.append(dataframe['close'] < dataframe['ema_13'] * 0.976)
+ item_buy_logic.append(dataframe['ewo'] < -3.92)
+ item_buy_logic.append(dataframe['r_14'] < -46.0)
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.9))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['crsi_1h'] > 8.0)
+ )
+ item_buy_logic.append(
+ (dataframe['crsi_1h'] > 2.0)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(48))
+ | (dataframe['close'] > (dataframe['sup3_1d'] * 0.8))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] < -7.0)
+ | (dataframe['r_14'] < -90.0)
+ | (dataframe['crsi_1h'] > 6.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < dataframe['ema_13'] * 0.96)
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] < -6.0)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['crsi_1h'] > 6.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(48))
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.7))
+ | (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_13'] * 0.96)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.99))
+ )
+ item_buy_logic.append(
+ ((dataframe['cmf'] > -0.2) & (dataframe['ewo'] < -6.0))
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['crsi_1h'] > 6.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.7))
+ | (dataframe['close'] > (dataframe['sup2_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.96)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.2)
+ |
+ (
+ (dataframe['mfi'] > 20.0)
+ & (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.5))
+ & (dataframe['ema_200_pct_change_288'] > -0.2)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ )
+ |
+ (
+ (dataframe['rsi_14'] < 20.0)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ | (dataframe['cti_1h'] < -0.9)
+ |
+ (
+ (dataframe['crsi_1h'] > 16.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['ema_200_pct_change_288'] > -0.12)
+ )
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.16)
+ & (dataframe['ema_200_pct_change_288'] > -0.2)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['crsi_1h'] > 4.0)
+ )
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.4)
+ & (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.5))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['close'] > (dataframe['sma_200_1h'] * 0.7))
+ & (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 0.5))
+ & (dataframe['ema_200_pct_change_288'] > -0.12)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.95))
+ |
+ (
+ (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ & (dataframe['ema_200_pct_change_288'] > -0.12)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.995)
+ )
+
+ # Condition #65 - Semi swing. Local deep.
+ elif index == 65:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close'] > (dataframe['sup_level_1h'] * 0.88))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['kama'] > dataframe['fama'])
+ item_buy_logic.append(dataframe['fama'] > (dataframe['mama'] * 0.96))
+ item_buy_logic.append(dataframe['mama_diff'] < -0.025)
+ item_buy_logic.append(dataframe['r_14'] < -90.0)
+ item_buy_logic.append(dataframe['rsi_14'] < 31.5)
+ item_buy_logic.append(dataframe['cti_1h'] < 0.25)
+ item_buy_logic.append(dataframe['crsi_1h'] > 22.0)
+ item_buy_logic.append(dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.25))
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['mfi'] > 28.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.96)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.96)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ )
+ item_buy_logic.append(
+ (dataframe['rsi_14'] < 20.0)
+ | (dataframe['r_14'] < -95.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.96)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.0)
+ | (dataframe['mfi'] > 28.0)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(48))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.1)
+ & (dataframe['hl_pct_change_48_1h'] < 0.6)
+ )
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['rsi_14'] < 12.0)
+ |
+ (
+ (dataframe['cti'] < -0.9)
+ & (dataframe['ema_200_pct_change_288'] < 0.26)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['not_downtrend_1h'])
+ )
+ | (dataframe['cti_1h'] < -0.95)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.12)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.1))
+ )
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.1))
+ )
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.2)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.05)
+ )
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['close'] > (dataframe['sup2_1d'] * 1.0))
+ & (dataframe['ema_200_pct_change_288'] > -0.18)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['close'] > (dataframe['sma_200'] * 0.95))
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['not_downtrend_1h'])
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.024))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.96))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ )
+
+ # Condition #66 - Rapid mode.
+ elif index == 66:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close_max_48'] >= (dataframe['close'] * 1.125 ))
+ item_buy_logic.append(dataframe['close_max_288'] >= (dataframe['close'] * 1.225 ))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['kama'] > dataframe['fama'])
+ item_buy_logic.append(dataframe['fama'] > (dataframe['mama'] * 0.981))
+ item_buy_logic.append(dataframe['r_14'] < -61.0)
+ item_buy_logic.append(dataframe['mama_diff'] < -0.025)
+ item_buy_logic.append(dataframe['cti'] < -0.715)
+ item_buy_logic.append(dataframe['rsi_84'] < 60.0)
+ item_buy_logic.append(dataframe['rsi_112'] < 60.0)
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['rsi_14'] < 28.0)
+ | (dataframe['crsi_1h'] > 10.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.8))
+ | (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ )
+ item_buy_logic.append(
+ (dataframe['rsi_14'] < 35.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['r_14'] < -90.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ | (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.022))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['tpct_change_144'] < 0.14)
+ | (dataframe['btc_tpct_change_144_5m'] < 0.02)
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.044))
+ )
+ item_buy_logic.append(
+ (dataframe['mfi'] > 20.0)
+ | (dataframe['rsi_14'] < 15.0)
+ | (dataframe['cti_1h'] < -0.95)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.99))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.038))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['tpct_change_144'] < 0.12)
+ & (dataframe['mfi'] > 30.0)
+ )
+ | (dataframe['rsi_14'] < 16.0)
+ | (dataframe['ewo'] > 1.0)
+ | (dataframe['crsi_1h'] > 30.0)
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.95))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.038))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['tpct_change_144'] < 0.26)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ | (dataframe['cmf'] > 0.0)
+ | (dataframe['mfi'] > 60.0)
+ | (dataframe['rsi_14'] < 14.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['rsi_14_1h'] < 25.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.024))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['tpct_change_144'] < 0.36)
+ & (dataframe['hl_pct_change_48_1h'] < 0.6)
+ )
+ | (dataframe['cmf'] > 0.1)
+ | (dataframe['mfi'] > 25.0)
+ | (dataframe['rsi_14'] < 14.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['crsi_1h'] > 45.0)
+ | (dataframe['tpct_change_144'] < 0.14)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.022))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['tpct_change_144'] < 0.2)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ |
+ (
+ (dataframe['cmf'] > -0.2)
+ & (dataframe['mfi'] > 10.0)
+ & (dataframe['crsi_1h'] > 30.0)
+ )
+ | (dataframe['rsi_14'] < 22.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['rsi_14_1h'] < 25.0)
+ | (dataframe['crsi_1h'] > 40.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.965)
+ & (dataframe['cmf'] > -0.3)
+ )
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.965)
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ & (dataframe['cmf'] > -0.3)
+ )
+ | (dataframe['volume_mean_12'] > (dataframe['volume_mean_24'] * 1.8))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.1)
+ & (dataframe['ema_200_pct_change_144'] < 0.1)
+ )
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['cti_1h'] < 0.5)
+ |
+ (
+ (dataframe['crsi_1h'] > 20.0)
+ & (dataframe['ema_200_pct_change_144'] < 0.1)
+ )
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ & (dataframe['ema_200_pct_change_144'] < 0.1)
+ )
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ )
+ item_buy_logic.append(
+ (dataframe['mfi'] > 40.0)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ |
+ (
+ (dataframe['crsi_1h'] > 16.0)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.26))
+ )
+ | (dataframe['tpct_change_144'] < 0.2)
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.3)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.26))
+ )
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.048))
+ | (dataframe['rsi_112'] < 40.0)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['crsi_1h'] > 10.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.8))
+ | (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.96)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 40.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['crsi_1h'] > 30.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ )
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.8))
+ | (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.024))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.8))
+ | (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.2)
+ | (dataframe['mfi'] > 40.0)
+ |
+ (
+ (dataframe['rsi_14'] < 18.0)
+ & (dataframe['crsi_1h'] > 10.0)
+ )
+ | (dataframe['cti'] < -0.95)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ |
+ (
+ (dataframe['crsi_1h'] > 50.0)
+ & (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ )
+ | (dataframe['tpct_change_144'] < 0.14)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ |
+ (
+ (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ )
+ |
+ (
+ (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ & (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ & (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ & (dataframe['ema_200_pct_change_144'] < 0.12)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.3))
+ & (dataframe['ema_200_pct_change_144'] < 0.12)
+ )
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.026))
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ & (dataframe['close'] > (dataframe['sup_level_1h'] * 0.85))
+ )
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 40.0)
+ | (dataframe['rsi_14'] < 10.0)
+ | (dataframe['cti_1h'] < -0.95)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['crsi_1h'] > 10.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] > (dataframe['sup2_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.955)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.04))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.1)
+ | (dataframe['rsi_14'] < 33.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['crsi'] > 30.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ )
+ item_buy_logic.append(
+ (dataframe['rsi_14'] < 36.0)
+ | (dataframe['cti'] < -0.8)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.048))
+ | (dataframe['rsi_14_15m'] < 25.0)
+ | (dataframe['cti_15m'] < -0.95)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 36.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['tpct_change_144'] < 0.25)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | (dataframe['rsi_14_15m'] < 30.0)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ |
+ (
+ (dataframe['mfi'] > 16.0)
+ & (dataframe['crsi_1h'] > 4.0)
+ )
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.048))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 10.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['crsi_1h'] > 25.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 25.0)
+ | (dataframe['r_14'] < -95.0)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 36.0)
+ | (dataframe['rsi_14'] < 16.0)
+ |
+ (
+ (dataframe['cti'] < -0.95)
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ )
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ |
+ (
+ (dataframe['r_14_1h'] < -97.0)
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ )
+ | (dataframe['tpct_change_144'] < 0.16)
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.87)
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.07))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.96))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.05))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.2)
+ & (dataframe['rsi_14'] < 36.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ |
+ (
+ (dataframe['mfi'] > 25.0)
+ & (dataframe['ema_200_pct_change_144'] < 0.12)
+ & (dataframe['hl_pct_change_36'] < 0.24)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['rsi_14'] < 33.0)
+ )
+ | (dataframe['rsi_14'] < 15.0)
+ |
+ (
+ (dataframe['cti'] < -0.9)
+ & (dataframe['tpct_change_144'] < 0.26)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ | (dataframe['r_480'] > -50.0)
+ |
+ (
+ (dataframe['crsi'] > 30.0)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ & (dataframe['rsi_14'] < 30.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ )
+ | (dataframe['cti_1h'] < -0.9)
+ |
+ (
+ (dataframe['rsi_14_1h'] < 33.0)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ )
+ |
+ (
+ (dataframe['r_14_1h'] < -95.0)
+ & (dataframe['tpct_change_144'] < 0.22)
+ )
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.16)
+ & (dataframe['rsi_14'] < 36.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ | (dataframe['close'] < dataframe['sma_30'] * 0.86)
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.06)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.044))
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ )
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.96))
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ |
+ (
+ ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.03))
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ )
+ )
+
+ # Condition #67 - Rapid mode.
+ elif index == 67:
+ # Non-Standard protections
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])
+ item_buy_logic.append(dataframe['ema_26'] - dataframe['ema_12'] > dataframe['open'] * 0.022)
+ item_buy_logic.append(dataframe['ema_26'].shift() - dataframe['ema_12'].shift() > dataframe['open'] / 100)
+ item_buy_logic.append(dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ item_buy_logic.append(dataframe['closedelta'] > dataframe['close'] * 12.0 / 1000 )
+ item_buy_logic.append(dataframe['ewo'] > -2.5)
+ item_buy_logic.append(dataframe['ewo'] < 4.0)
+ item_buy_logic.append(
+ (
+ (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ )
+ |
+ (
+ (dataframe['rsi_14'] < 18.0)
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ )
+ | (dataframe['cti'] < -0.95)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['crsi_1h'] > 40.0)
+ | (dataframe['tpct_change_144'] < 0.14)
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ )
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ )
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.98))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 25.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['crsi_1h'] > 50.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.88)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.048))
+ |
+ (
+ (dataframe['close'] < (dataframe['bb20_2_low'] * 0.97))
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.22))
+ )
+ )
+ item_buy_logic.append(
+ ((dataframe['btc_not_downtrend_1h'] == True) & (dataframe['cmf'] > -0.3))
+ | (dataframe['mfi'] > 35.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | ((dataframe['close'] > (dataframe['sup_level_1h'] * 0.9)) & (dataframe['cmf'] > -0.3))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.032))
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.955))
+ )
+ item_buy_logic.append(
+ (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < -0.75)
+ | (dataframe['tpct_change_144'] < 0.14)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.14))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.95))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.98))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 25.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti_1h'] < -0.75)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['btc_tpct_change_144_5m'] < 0.03)
+ | (dataframe['btc_pct_close_max_24_5m'] < 1.03)
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.95))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.99))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['mfi'] > 40.0)
+ | (dataframe['rsi_14'] < 15.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.965)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ | (dataframe['rsi_112'] < 40.0)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.2)
+ |
+ (
+ (dataframe['mfi'] > 25.0)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['rsi_14'] < 20.0)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ )
+ |
+ (
+ (dataframe['cti'] < -0.9)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ )
+ |
+ (
+ (dataframe['cti_1h'] < -0.0)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ )
+ |
+ (
+ (dataframe['rsi_14_1h'] < 40.0)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['crsi_1h'] > 20.0)
+ & (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ )
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.2)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ )
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.95))
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ & (dataframe['crsi_1h'] > 4.0)
+ )
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['rsi_14_15m'] < 30.0)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['cti_15m'] < -0.9)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['r_14'] < -90.0)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ )
+
+ # Condition #68 - Rapid mode.
+ elif index == 68:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close_max_48'] >= (dataframe['close'] * 1.125))
+ item_buy_logic.append(dataframe['close_max_288'] >= (dataframe['close'] * 1.225))
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 1.03)
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < dataframe['vwap_lowerband'])
+ item_buy_logic.append(dataframe['vwap_width'] > 1.31)
+ item_buy_logic.append(dataframe['close_delta'] > dataframe['close'] * 27.0 / 1000)
+ item_buy_logic.append(dataframe['cti'] < -0.1)
+ item_buy_logic.append(dataframe['rsi_84'] < 60.0)
+ item_buy_logic.append(dataframe['rsi_112'] < 60.0)
+ item_buy_logic.append(
+ (dataframe['ewo'] > 8.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | ((dataframe['rsi_14'] < 20.0) & (dataframe['btc_pct_close_max_24_5m'] < 1.001))
+ | ((dataframe['close'] > dataframe['ema_20'] * 0.89) & (dataframe['close'] < dataframe['ema_20'] * 0.9))
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.95))
+ | (dataframe['close_delta'] > dataframe['close'] * 80.0 / 1000)
+ )
+ item_buy_logic.append(
+ (dataframe['cti'] < -0.9)
+ | (dataframe['tpct_change_144'] < 0.24)
+ | (dataframe['btc_pct_close_max_24_5m'] < 1.005)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['cti_1h'] < -0.9)
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['cmf'] > -0.3)
+ & (dataframe['mfi'] > 20.0)
+ )
+ | (dataframe['cti_1h'] < -0.9)
+ |
+ (
+ (dataframe['ewo'] > 8.0)
+ & (dataframe['cti_1h'] < 0.8)
+ & (dataframe['crsi_1h'] > 10.0)
+ )
+ |
+ (
+ (dataframe['ewo'] > 8.0)
+ & (dataframe['crsi_1h'] > 20.0)
+ & (dataframe['tpct_change_144'] < 0.24)
+ )
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ |
+ (
+ (dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))
+ & ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ )
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['cmf'] > -0.1)
+ & (dataframe['mfi'] > 10.0)
+ & (dataframe['ema_200_pct_change_144'] < 0.22)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ |
+ (
+ (dataframe['ewo'] > 8.0)
+ & (dataframe['cti_1h'] < 0.5)
+ & (dataframe['crsi_1h'] > 10.0)
+ )
+ |
+ (
+ (dataframe['cti_1h'] < -0.9)
+ & (dataframe['rsi_14_1h'] < 20.0)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['crsi_1h'] > 5.0)
+ & (dataframe['ema_200_pct_change_288'] > -0.24)
+ )
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ |
+ (
+ (dataframe['close'] < dataframe['sma_30'] * 0.93)
+ & (dataframe['cmf'] > 0.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ )
+ |
+ (
+ (dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))
+ & ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.036))
+ & (dataframe['cmf'] > -0.25)
+ & (dataframe['tpct_change_144'] < 0.34)
+ )
+ )
+ item_buy_logic.append(
+ (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['crsi_1h'] > 10.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.89)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.09))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.05))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.2)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti'] < -0.8)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ | (dataframe['hl_pct_change_36'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ |
+ (
+ (dataframe['close'] < (dataframe['res1_1d'] * 1.0))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ )
+ | (dataframe['close'] < dataframe['sma_30'] * 0.87)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.95))
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+
+ # Condition #69 - Rapid mode.
+ elif index == 69:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close_max_48'] >= (dataframe['close'] * 1.125))
+ item_buy_logic.append(dataframe['close_max_288'] >= (dataframe['close'] * 1.225))
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 1.03)
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+ item_buy_logic.append(dataframe['ema_200_pct_change_288'] < 0.3)
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < dataframe['vwap_lowerband'])
+ item_buy_logic.append(dataframe['vwap_width'] > 3.212)
+ item_buy_logic.append(dataframe['close_delta'] > dataframe['close'] * 20.1 / 1000)
+ item_buy_logic.append(dataframe['cti'] < -0.748)
+ item_buy_logic.append(dataframe['rsi_84'] < 60.0)
+ item_buy_logic.append(dataframe['rsi_112'] < 60.0)
+ item_buy_logic.append(dataframe['ewo'] > 4.0)
+ item_buy_logic.append(dataframe['ewo'] < 8.0)
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['mfi'] > 25.0)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['crsi_1h'] > 40.0)
+ | (dataframe['tpct_change_144'] < 0.24)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.14))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.99))
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 40.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.14))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.975))
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.04))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.24)
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.14))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.98))
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['mfi'] > 50.0)
+ | (dataframe['rsi_14'] < 30.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['crsi_1h'] > 40.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.2)
+ & (dataframe['hl_pct_change_48_1h'] < 0.9)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.26))
+ )
+ | (dataframe['mfi'] > 50.0)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['r_14_1h'] < -75.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ |
+ (
+ (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ & (dataframe['tpct_change_144'] < 0.2)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ & (dataframe['hl_pct_change_48_1h'] < 0.9)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.26))
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ & (dataframe['hl_pct_change_48_1h'] < 0.9)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.26))
+ )
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.044))
+ & (dataframe['hl_pct_change_48_1h'] < 0.9)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.26))
+ )
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > 0.0)
+ & (dataframe['ema_200_pct_change_144'] < 0.16)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.24))
+ )
+ |
+ (
+ (dataframe['mfi'] > 40.0)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.24))
+ & (dataframe['not_downtrend_1h'])
+ )
+ | (dataframe['rsi_14'] < 22.0)
+ |
+ (
+ (dataframe['crsi'] > 25.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['rsi_14'] < 36.0)
+ & (dataframe['ema_200_pct_change_144'] < 0.1)
+ )
+ | (dataframe['cti_1h'] < -0.0)
+ |
+ (
+ (dataframe['rsi_14_1h'] < 40.0)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.24))
+ )
+ |
+ (
+ (dataframe['r_14_1h'] < -90.0)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.24))
+ & (dataframe['not_downtrend_1h'])
+ )
+ | (dataframe['tpct_change_144'] < 0.2)
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ & (dataframe['ema_200_pct_change_144'] < 0.1)
+ )
+ |
+ (
+ (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['ema_200_pct_change_144'] < 0.1)
+ )
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.4)
+ & (dataframe['hl_pct_change_36'] < 0.26)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.014))
+ |
+ (
+ (dataframe['close'] < dataframe['sma_30'] * 0.86)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.24))
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.89)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.24))
+ & (dataframe['not_downtrend_1h'])
+ )
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.048))
+ & (dataframe['ema_200_pct_change_144'] < 0.16)
+ & (dataframe['close_max_48'] < (dataframe['close'] * 1.24))
+ )
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.98))
+ & (dataframe['cti_1h'] < 0.75)
+ & (dataframe['hl_pct_change_48_1h'] < 0.75)
+ & (dataframe['not_downtrend_1h'])
+ )
+ | ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.02))
+ | (dataframe['rsi_14_15m'] < 30.0)
+ | (dataframe['cti_15m'] < -0.9)
+ )
+
+ # Condition #70 - Rapid mode.
+ elif index == 70:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close_max_48'] >= (dataframe['close'] * 1.05))
+ item_buy_logic.append(dataframe['close_max_288'] >= (dataframe['close'] * 1.125))
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 1.03)
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < dataframe['vwap_lowerband'])
+ item_buy_logic.append(dataframe['vwap_width'] > 0.5)
+ item_buy_logic.append(dataframe['close_delta'] > dataframe['close'] * 27.66 / 1000)
+ item_buy_logic.append(dataframe['cti'] < -0.2)
+ item_buy_logic.append(dataframe['rsi_84'] < 60.0)
+ item_buy_logic.append(dataframe['rsi_112'] < 60.0)
+ item_buy_logic.append(dataframe['ewo'] > -2.5)
+ item_buy_logic.append(dataframe['ewo'] < 4.0)
+ item_buy_logic.append(dataframe['rsi_14_1h'] < 40.0)
+ item_buy_logic.append(
+ ((dataframe['btc_not_downtrend_1h'] == True) & (dataframe['cmf'] > -0.3))
+ | (dataframe['mfi'] > 40.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['crsi_1h'] > 30.0)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.95))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > 0.1)
+ & (dataframe['ema_200_pct_change_288'] > -0.16)
+ )
+ |
+ (
+ (dataframe['rsi_14'] < 6.0)
+ & (dataframe['crsi_1h'] > 10.0)
+ & (dataframe['ema_200_pct_change_288'] > -0.16)
+ )
+ | (dataframe['cti_1h'] < -0.8)
+ |
+ (
+ (dataframe['rsi_14_1h'] < 25.0)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['crsi_1h'] > 2.0)
+ )
+ | (dataframe['crsi_1h'] > 40.0)
+ | (dataframe['tpct_change_144'] < 0.06)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.05))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ )
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.96))
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.022))
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['crsi_1h'] > 2.0)
+ )
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 40.0)
+ | (dataframe['rsi_14'] < 15.0)
+ | (dataframe['crsi_1h'] > 35.0)
+ | (dataframe['tpct_change_144'] < 0.08)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.05))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.95))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.98))
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ )
+ item_buy_logic.append(
+ (dataframe['mfi'] > 20.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti_1h'] < -0.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.99))
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ )
+
+ # Condition #71 - Rapid mode.
+ elif index == 71:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 1.03)
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < dataframe['vwap_lowerband'])
+ item_buy_logic.append(dataframe['tpct_change_0'] > 0.04)
+ item_buy_logic.append(dataframe['cti'] < -0.9)
+ item_buy_logic.append(dataframe['rsi_14'] < 35.0)
+ item_buy_logic.append(dataframe['rsi_84'] < 60.0)
+ item_buy_logic.append(dataframe['rsi_112'] < 60.0)
+ item_buy_logic.append(
+ (dataframe['mfi'] > 50.0)
+ | (dataframe['crsi_1h'] > 10.0)
+ | (dataframe['tpct_change_144'] < 0.24)
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.87)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 40.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['rsi_14_1h'] < 35.0)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.02)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.89)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 35.0)
+ | (dataframe['crsi_1h'] > 30.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 40.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.965)
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 6.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['crsi_1h'] > 30.0)
+ | (dataframe['tpct_change_0'] > 0.08)
+ | (dataframe['tpct_change_144'] < 0.08)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.02)
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sup1_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.96)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ |
+ (
+ (dataframe['mfi'] > 16.0)
+ & (dataframe['crsi_1h'] > 5.0)
+ )
+ | (dataframe['cmf_1h'] > 0.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['rsi_14_1h'] < 20.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['crsi_1h'] > 6.0)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.95))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.87)
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.975)
+ & (dataframe['crsi_1h'] > 6.0)
+ )
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.066))
+ )
+ item_buy_logic.append(
+ (dataframe['rsi_14'] < 20.0)
+ |
+ (
+ (dataframe['cti_1h'] < 0.25)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ |
+ (
+ (dataframe['rsi_14_1h'] < 50.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ |
+ (
+ (dataframe['r_14_1h'] < -75.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ |
+ (
+ (dataframe['crsi_1h'] > 40.0)
+ & (dataframe['ema_200_pct_change_288'] < 0.2)
+ )
+ |
+ (
+ (dataframe['cmf_1h'] > 0.0)
+ & (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ & (dataframe['cti_1h'] < 0.8)
+ )
+ | (dataframe['tpct_change_144'] < 0.14)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['hl_pct_change_36'] < 0.16)
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.45)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ & (dataframe['cti_1h'] < 0.85)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['sma_30'] * 0.87)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.89)
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ )
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.03))
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ )
+ |
+ (
+ (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.98))
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ )
+ |
+ (
+ ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.01))
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ )
+ )
+
+ # Condition #72 - Rapid mode.
+ elif index == 72:
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 1.03)
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+ item_buy_logic.append(dataframe['ema_200_pct_change_288'] < 0.4)
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])
+ item_buy_logic.append(dataframe['ema_26'] - dataframe['ema_12'] > dataframe['open'] * 0.024)
+ item_buy_logic.append(dataframe['ema_26'].shift() - dataframe['ema_12'].shift() > dataframe['open'] / 100)
+ item_buy_logic.append(dataframe['cti'] < -0.9)
+ item_buy_logic.append(dataframe['r_14'] < -44.0)
+ item_buy_logic.append(dataframe['rsi_84'] < 60.0)
+ item_buy_logic.append(dataframe['rsi_112'] < 60.0)
+ item_buy_logic.append(dataframe['ewo'] > -5.585)
+ item_buy_logic.append(dataframe['ewo'] < -2.0)
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 35.0)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.95))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.038))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.0)
+ & (dataframe['mfi'] > 30.0)
+ )
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.95))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.044))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['mfi'] > 40.0)
+ & (dataframe['cmf'] > 0.1)
+ )
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['crsi_1h'] > 25.0)
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.18)
+ & (dataframe['crsi_1h'] > 10.0)
+ )
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.3)
+ & (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ )
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.14))
+ & (dataframe['crsi_1h'] > 10.0)
+ )
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.91))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.985))
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.042))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['crsi_1h'] > 10.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.95))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.99))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 14.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['crsi_1h'] > 25.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.14))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.995))
+ )
+ item_buy_logic.append(
+ (dataframe['ewo'] < -4.0)
+ | ((dataframe['btc_not_downtrend_1h'] == True) & (dataframe['cmf'] > -0.3))
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ | (dataframe['close'] < (dataframe['bb20_2_low'] * 0.98))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['cti_1h'] < -0.8)
+ | (dataframe['crsi_1h'] > 10.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ )
+ item_buy_logic.append(
+ (dataframe['btc_not_downtrend_1h'] == True)
+ | (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 10.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['crsi_1h'] > 10.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] > (dataframe['sup3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.1)
+ | (dataframe['mfi'] > 50.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['rsi_14_1h'] < 30.0)
+ | (dataframe['crsi_1h'] > 30.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.9))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.054))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['ema_200_pct_change_288'] < 0.2)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ )
+ |
+ (
+ (dataframe['cmf'] > -0.2)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ )
+ |
+ (
+ (dataframe['mfi'] > 20.0)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ )
+ |
+ (
+ (dataframe['rsi_14'] < 10.0)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['cti_1h'] < -0.5)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ | (dataframe['rsi_14_1h'] < 25.0)
+ | (dataframe['r_14_1h'] < -98.0)
+ |
+ (
+ (dataframe['crsi_1h'] > 16.0)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ )
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.2)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.04)
+ )
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.25)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ |
+ (
+ (dataframe['close'] < dataframe['sma_30'] * 0.81)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.87)
+ & (dataframe['hl_pct_change_36'] < 0.3)
+ )
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.999)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.08))
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.89))
+ |
+ (
+ ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.05))
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ )
+ | (dataframe['cti_15m'] < -0.9)
+ )
+
+ # Condition #73 - Half mode.
+ elif index == 73:
+ item_buy_logic.append(current_free_slots >= self.half_mode_min_free_slots)
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 1.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < dataframe['vwap_lowerband'])
+ item_buy_logic.append(dataframe['bb20_width_1h'] > 0.15)
+ item_buy_logic.append(dataframe['r_14'] < -50.0)
+ item_buy_logic.append(dataframe['r_96'] < -50.0)
+ item_buy_logic.append(dataframe['cti'] < -0.8)
+ item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.985))
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.1)
+ | (dataframe['mfi'] > 40.0)
+ | (dataframe['rsi_14'] < 15.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['rsi_14_1h'] < 25.0)
+ | (dataframe['crsi_1h'] > 16.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.2)
+ & (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ )
+ | (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (dataframe['sma_200'] > dataframe['sma_200'].shift(24))
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.95))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.975)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.016))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.2)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['cti'] < -0.95)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['rsi_14_1h'] < 20.0)
+ | (dataframe['crsi_1h'] > 40.0)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.04))
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.978)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.012))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.1)
+ | (dataframe['mfi'] > 46.0)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti'] < -0.9)
+ | (dataframe['cti_1h'] < -0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ |
+ (
+ (dataframe['crsi_1h'] > 50.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ )
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.05))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.95)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.982)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.01))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.3)
+ & (dataframe['crsi_1h'] > 8.0)
+ & (dataframe['ema_200_pct_change_144'] > -0.1)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['ema_200_pct_change_288'] > -0.1)
+ & (dataframe['crsi'] > 4.0)
+ )
+ |
+ (
+ (dataframe['mfi'] > 40.0)
+ & (dataframe['crsi_1h'] > 8.0)
+ )
+ |
+ (
+ (dataframe['rsi_14'] < 10.0)
+ & (dataframe['ema_200_pct_change_288'] > -0.1)
+ & (dataframe['tpct_change_144'] < 0.2)
+ & (dataframe['not_downtrend_1h'])
+ )
+ | (dataframe['cti_1h'] < -0.95)
+ |
+ (
+ (dataframe['rsi_14_1h'] < 30.0)
+ & (dataframe['crsi_1h'] > 5.0)
+ & (dataframe['ema_200_pct_change_144'] > -0.1)
+ & (dataframe['ema_200_pct_change_288'] > -0.1)
+ )
+ |
+ (
+ (dataframe['r_14_1h'] < -94.0)
+ & (dataframe['tpct_change_144'] < 0.2)
+ )
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.08)
+ & (dataframe['hl_pct_change_48_1h'] < 0.7)
+ )
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.06))
+ | (dataframe['hl_pct_change_48_1h'] < 0.16)
+ |
+ (
+ (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['bb20_width_1h'] > 0.18)
+ & (dataframe['cmf'] > -0.5)
+ & (dataframe['hl_pct_change_48_1h'] < 0.5)
+ )
+ |
+ (
+ (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ & (dataframe['cmf'] > -0.5)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ & (dataframe['not_downtrend_1h'])
+ )
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ & (dataframe['not_downtrend_1h'])
+ )
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.02))
+ )
+
+ # Condition #74 - Half mode.
+ elif index == 74:
+ item_buy_logic.append(current_free_slots >= self.half_mode_min_free_slots)
+ # Non-Standard protections
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 1.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 1.03)
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.5)
+ item_buy_logic.append(dataframe['ema_200_pct_change_144'] < 0.12)
+
+ # Logic
+ item_buy_logic.append(dataframe['rsi_14'] < dataframe['rsi_14'].shift(1))
+ item_buy_logic.append(dataframe['rsi_4'] < 46.0)
+ item_buy_logic.append(dataframe['rsi_14'] > 19.0)
+ item_buy_logic.append(dataframe['rsi_14'] < 32.0)
+ item_buy_logic.append(dataframe['close'] < dataframe['sma_15'] * 0.956)
+ item_buy_logic.append(dataframe['cti'] < -0.9)
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 30.0)
+ | (dataframe['rsi_14'] < 22.0)
+ | (dataframe['cti_1h'] < -0.9)
+ | (dataframe['rsi_14_1h'] < 20.0)
+ | (dataframe['crsi_1h'] > 20.0)
+ | (dataframe['tpct_change_144'] < 0.12)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ | (dataframe['hl_pct_change_48_1h'] < 0.25)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.95))
+ | (dataframe['close'] > (dataframe['sma_200_1h'] * 0.9))
+ | (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.03))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.2)
+ & (dataframe['rsi_14'] < 22.0)
+ )
+ |
+ (
+ (dataframe['cti_1h'] < -0.9)
+ & (dataframe['rsi_14_1h'] < 20.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ )
+ | (dataframe['crsi_1h'] > 30.0)
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.5)
+ & (dataframe['rsi_14_1h'] < 50.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ |
+ (
+ (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ )
+ |
+ (
+ (dataframe['close'] > (dataframe['sup_level_1h'] * 0.95))
+ & (dataframe['crsi_1h'] > 10.0)
+ & (dataframe['close'] > (dataframe['sma_200'] * 0.95))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.042))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ | (dataframe['mfi'] > 50.0)
+ |
+ (
+ (dataframe['cti_1h'] < -0.9)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ )
+ |
+ (
+ (dataframe['rsi_14_1h'] < 30.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ )
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ |
+ (
+ (dataframe['close'] > (dataframe['sma_200'] * 0.8))
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ )
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.03))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.2)
+ |
+ (
+ (dataframe['mfi'] > 40.0)
+ & (dataframe['crsi_1h'] > 10.0)
+ & (dataframe['tpct_change_144'] < 0.2)
+ )
+ | (dataframe['rsi_14'] < 18.0)
+ |
+ (
+ (dataframe['cti_1h'] < -0.9)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ )
+ |
+ (
+ (dataframe['rsi_14_1h'] < 30.0)
+ & (dataframe['close'] > (dataframe['sma_200'] * 0.9))
+ )
+ | (dataframe['tpct_change_144'] < 0.1)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ |
+ (
+ (dataframe['hl_pct_change_48_1h'] < 0.3)
+ & (dataframe['crsi_1h'] > 10.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.02)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.94)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.98)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.028))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.0)
+ |
+ (
+ (dataframe['cmf'] > -0.1)
+ & (dataframe['mfi'] > 20.0)
+ )
+ |
+ (
+ (dataframe['cti_1h'] < -0.9)
+ & (dataframe['rsi_14_1h'] < 20.0)
+ )
+ | (dataframe['crsi_1h'] > 36.0)
+ | (dataframe['tpct_change_144'] < 0.08)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['crsi_1h'] > 10.0)
+ & (dataframe['cmf'] > -0.2)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.87)
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ & (dataframe['cmf'] > -0.5)
+ )
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.034))
+ & (dataframe['crsi_1h'] > 10.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ )
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 16.0)
+ | (dataframe['rsi_14'] < 25.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['crsi_1h'] > 30.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.92)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.03))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.2)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ |
+ (
+ (dataframe['crsi_1h'] > 40.0)
+ & (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ )
+ | (dataframe['tpct_change_144'] < 0.08)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.08))
+ | (dataframe['hl_pct_change_48_1h'] < 0.2)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.014))
+ & (dataframe['tpct_change_144'] < 0.3)
+ )
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 10.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['crsi_1h'] > 40.0)
+ | (dataframe['tpct_change_144'] < 0.24)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.044))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > -0.3)
+ | (dataframe['mfi'] > 20.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti_1h'] < 0.0)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['crsi_1h'] > 30.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['hl_pct_change_48_1h'] < 0.3)
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.93)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.044))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > 0.1)
+ & (dataframe['cti_1h'] < 0.85)
+ )
+ | (dataframe['mfi'] > 50.0)
+ | (dataframe['cti_1h'] < 0.8)
+ | (dataframe['rsi_14_1h'] < 40.0)
+ | (dataframe['r_14_1h'] < -90.0)
+ | (dataframe['tpct_change_144'] < 0.16)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['hl_pct_change_48_1h'] < 0.4)
+ | (dataframe['close'] < (dataframe['res3_1d'] * 1.0))
+ | (dataframe['close'] < dataframe['ema_20'] * 0.91)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.97)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.044))
+ )
+ item_buy_logic.append(
+ (dataframe['cmf'] > 0.1)
+ | (dataframe['mfi'] > 50.0)
+ | (dataframe['rsi_14'] < 20.0)
+ | (dataframe['cti'] < -0.97)
+ | (dataframe['cti_1h'] < -0.9)
+ |
+ (
+ (dataframe['crsi_1h'] > 10.0)
+ & (dataframe['cti_1h'] < 0.5)
+ )
+ | (dataframe['tpct_change_144'] < 0.2)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ | (dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.88)
+ | (dataframe['close'] < dataframe['bb20_2_low'] * 0.992)
+ | ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.1))
+ )
+ item_buy_logic.append(
+ (
+ (dataframe['cmf'] > -0.1)
+ & (dataframe['hl_pct_change_48_1h'] < 0.9)
+ & (dataframe['tpct_change_144'] < 0.3)
+ & (dataframe['ema_200_pct_change_288'] > -0.18)
+ & (dataframe['ema_200_pct_change_288'] < 0.08)
+ & (dataframe['crsi_1h'] > 6.0)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ )
+ |
+ (
+ (dataframe['mfi'] > 30.0)
+ & (dataframe['crsi_1h'] > 5.0)
+ )
+ |
+ (
+ (dataframe['rsi_14'] < 20.0)
+ & (dataframe['crsi_1h'] > 6.0)
+ & (dataframe['hl_pct_change_36'] < 0.16)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ )
+ | (dataframe['crsi'] > 20.0)
+ |
+ (
+ (dataframe['cti_1h'] < -0.0)
+ & (dataframe['tpct_change_144'] < 0.26)
+ & (dataframe['ema_200_pct_change_288'] > -0.1)
+ & (dataframe['ema_200_pct_change_288'] < 0.22)
+ & (dataframe['crsi_1h'] > 6.0)
+ )
+ |
+ (
+ (dataframe['rsi_14_1h'] < 30.0)
+ & (dataframe['ema_200_pct_change_288'] > -0.18)
+ & (dataframe['tpct_change_144'] < 0.22)
+ & (dataframe['crsi_1h'] > 6.0)
+ )
+ |
+ (
+ (dataframe['r_14_1h'] < -94.0)
+ & (dataframe['tpct_change_144'] < 0.22)
+ )
+ |
+ (
+ (dataframe['tpct_change_144'] < 0.1)
+ & (dataframe['sma_200_dec_20_1h'] == False)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ )
+ |
+ (
+ (dataframe['close_max_48'] < (dataframe['close'] * 1.1))
+ & (dataframe['tpct_change_144'] < 0.3)
+ & (dataframe['sma_200_dec_20_1h'] == False)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ )
+ |
+ (
+ (dataframe['hl_pct_change_36'] < 0.1)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ )
+ | (dataframe['hl_pct_change_48_1h'] < 0.16)
+ |
+ (
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ & (dataframe['btc_not_downtrend_1h'] == True)
+ & (dataframe['hl_pct_change_48_1h'] < 0.8)
+ & (dataframe['crsi_1h'] > 10.0)
+ & (dataframe['ema_200_pct_change_288'] > -0.12)
+ & (dataframe['ema_200_pct_change_288'] < 0.08)
+ & (dataframe['cmf'] > -0.3)
+ )
+ | (dataframe['ema_200'] > (dataframe['ema_200'].shift(12) * 1.01))
+ |
+ (
+ (dataframe['close'] > (dataframe['sma_200'] * 0.99))
+ & (dataframe['hl_pct_change_48_1h'] < 0.9)
+ & (dataframe['ema_200_pct_change_288'] < 0.16)
+ & (dataframe['cmf'] > -0.3)
+ & (dataframe['hl_pct_change_36'] < 0.12)
+ )
+ | (dataframe['close'] < dataframe['sma_30'] * 0.85)
+ | (dataframe['close'] < dataframe['ema_20'] * 0.9)
+ |
+ (
+ (dataframe['close'] < dataframe['bb20_2_low'] * 0.99)
+ & (dataframe['ema_200_pct_change_288'] < 0.12)
+ & (dataframe['ema_200_pct_change_288'] > -0.2)
+ )
+ |
+ (
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.05))
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['crsi_1h'] > 5.0)
+ & (dataframe['ema_200_pct_change_288'] > -0.24)
+ )
+ | (dataframe['close_15m'] < (dataframe['bb20_2_low_15m'] * 0.93))
+ |
+ (
+ ((dataframe['ema_26_15m'] - dataframe['ema_12_15m']) > (dataframe['open_15m'] * 0.038))
+ & (dataframe['hl_pct_change_36'] < 0.2)
+ & (dataframe['crsi_1h'] > 5.0)
+ & (dataframe['ema_200_pct_change_288'] > -0.24)
+ )
+ |
+ (
+ (dataframe['rsi_14_15m'] < 20.0)
+ & (dataframe['crsi_1h'] > 5.0)
+ & (dataframe['ema_200_pct_change_288'] > -0.24)
+ )
+ | (dataframe['cti_15m'] < -0.9)
+ )
+
+ item_buy_logic.append(dataframe['volume'] > 0)
+ # for leveraged long pairs
+ is_leverage_long = bool(re.match(leverage_pattern_long, metadata['pair']))
+ item_buy_logic.append(
+ (dataframe['btc_pct_close_max_72_5m'] < 1.01)
+ | (not is_leverage_long)
+ )
+ # Extra dump check
+ if (self.insanity_dump_checks):
+ item_buy_logic.append((dataframe['btc_pct_close_max_24_5m'] < 1.025))
+ item_buy_logic.append(dataframe['hl_pct_change_36'] < 0.3)
+ item_buy_logic.append(dataframe['ema_200_pct_change_288'] < 0.3)
+ item_buy_logic.append(dataframe['ema_200_pct_change_144'] < 0.25)
+ item_buy_logic.append(dataframe['hl_pct_change_48_1h'] < 0.75)
+ item_buy = reduce(lambda x, y: x & y, item_buy_logic)
+ dataframe.loc[item_buy, 'enter_tag'] += f"{index} "
+ conditions.append(item_buy)
+ dataframe.loc[:, 'enter_long'] = item_buy
+
+ if conditions:
+ dataframe.loc[:, 'enter_long'] = reduce(lambda x, y: x | y, conditions)
+
+ return dataframe
+
+ def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ dataframe.loc[:, 'exit_long'] = 0
+ dataframe.loc[:, 'exit_short'] = 0
+
+ return dataframe
+
+ def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float,
+ time_in_force: str, current_time: datetime, entry_tag: Optional[str],
+ side: str, **kwargs) -> bool:
+ # allow force entries
+ if (entry_tag == 'force_entry'):
+ return True
+
+ dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)
+
+ if(len(dataframe) < 1):
+ return True
+
+ dataframe = dataframe.iloc[-1].squeeze()
+
+ if ((rate > dataframe['close'])):
+ slippage = ((rate / dataframe['close']) - 1.0)
+
+ if slippage < 0.0075:
+ return True
+ else:
+ log.warning(
+ "Cancelling buy for %s due to slippage %s",
+ pair, slippage
+ )
+ return False
+
+ return True
+
+ def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,
+ rate: float, time_in_force: str, exit_reason: str,
+ current_time: datetime, **kwargs) -> bool:
+ # Allow force exits
+ if exit_reason != 'force_exit':
+ if self._should_hold_trade(trade, rate, exit_reason):
+ return False
+ if (exit_reason == 'stop_loss'):
+ return False
+ if (('exit_profit_only' in self.config and self.config['exit_profit_only'])
+ or ('sell_profit_only' in self.config and self.config['sell_profit_only'])):
+ current_profit = ((rate - trade.open_rate) / trade.open_rate)
+ if (current_profit < self.exit_profit_offset):
+ return False
+
+ self._remove_profit_target(pair)
+
+ return True
+
+ def _set_profit_target(self, pair: str, sell_reason: str, rate: float, current_profit: float, current_time: datetime):
+ self.target_profit_cache.data[pair] = {
+ "rate": rate,
+ "profit": current_profit,
+ "sell_reason": sell_reason,
+ "time_profit_reached": current_time.isoformat()
+ }
+ self.target_profit_cache.save()
+
+ def _remove_profit_target(self, pair: str):
+ if self.target_profit_cache is not None:
+ self.target_profit_cache.data.pop(pair, None)
+ self.target_profit_cache.save()
+
+ def _should_hold_trade(self, trade: "Trade", rate: float, sell_reason: str) -> bool:
+ if self.config['runmode'].value not in ('live', 'dry_run'):
+ return False
+
+ if not self.holdSupportEnabled:
+ return False
+
+ # Just to be sure our hold data is loaded, should be a no-op call after the first bot loop
+ self.load_hold_trades_config()
+
+ if not self.hold_trades_cache:
+ # Cache hasn't been setup, likely because the corresponding file does not exist, sell
+ return False
+
+ if not self.hold_trades_cache.data:
+ # We have no pairs we want to hold until profit, sell
+ return False
+
+ # By default, no hold should be done
+ hold_trade = False
+
+ trade_ids: dict = self.hold_trades_cache.data.get("trade_ids")
+ if trade_ids and trade.id in trade_ids:
+ trade_profit_ratio = trade_ids[trade.id]
+ current_profit_ratio = trade.calc_profit_ratio(rate)
+ if sell_reason == "force_sell":
+ formatted_profit_ratio = f"{trade_profit_ratio * 100}%"
+ formatted_current_profit_ratio = f"{current_profit_ratio * 100}%"
+ log.warning(
+ "Force selling %s even though the current profit of %s < %s",
+ trade, formatted_current_profit_ratio, formatted_profit_ratio
+ )
+ return False
+ elif current_profit_ratio >= trade_profit_ratio:
+ # This pair is on the list to hold, and we reached minimum profit, sell
+ formatted_profit_ratio = f"{trade_profit_ratio * 100}%"
+ formatted_current_profit_ratio = f"{current_profit_ratio * 100}%"
+ log.warning(
+ "Selling %s because the current profit of %s >= %s",
+ trade, formatted_current_profit_ratio, formatted_profit_ratio
+ )
+ return False
+
+ # This pair is on the list to hold, and we haven't reached minimum profit, hold
+ hold_trade = True
+
+ trade_pairs: dict = self.hold_trades_cache.data.get("trade_pairs")
+ if trade_pairs and trade.pair in trade_pairs:
+ trade_profit_ratio = trade_pairs[trade.pair]
+ current_profit_ratio = trade.calc_profit_ratio(rate)
+ if sell_reason == "force_sell":
+ formatted_profit_ratio = f"{trade_profit_ratio * 100}%"
+ formatted_current_profit_ratio = f"{current_profit_ratio * 100}%"
+ log.warning(
+ "Force selling %s even though the current profit of %s < %s",
+ trade, formatted_current_profit_ratio, formatted_profit_ratio
+ )
+ return False
+ elif current_profit_ratio >= trade_profit_ratio:
+ # This pair is on the list to hold, and we reached minimum profit, sell
+ formatted_profit_ratio = f"{trade_profit_ratio * 100}%"
+ formatted_current_profit_ratio = f"{current_profit_ratio * 100}%"
+ log.warning(
+ "Selling %s because the current profit of %s >= %s",
+ trade, formatted_current_profit_ratio, formatted_profit_ratio
+ )
+ return False
+
+ # This pair is on the list to hold, and we haven't reached minimum profit, hold
+ hold_trade = True
+
+ return hold_trade
+
+# Elliot Wave Oscillator
+def ewo(dataframe, sma1_length=5, sma2_length=35):
+ sma1 = ta.EMA(dataframe, timeperiod=sma1_length)
+ sma2 = ta.EMA(dataframe, timeperiod=sma2_length)
+ smadif = (sma1 - sma2) / dataframe['close'] * 100
+ return smadif
+
+# Chaikin Money Flow
+def chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:
+ """Chaikin Money Flow (CMF)
+ It measures the amount of Money Flow Volume over a specific period.
+ http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf
+ Args:
+ dataframe(pandas.Dataframe): dataframe containing ohlcv
+ n(int): n period.
+ fillna(bool): if True, fill nan values.
+ Returns:
+ pandas.Series: New feature generated.
+ """
+ mfv = ((dataframe['close'] - dataframe['low']) - (dataframe['high'] - dataframe['close'])) / (dataframe['high'] - dataframe['low'])
+ mfv = mfv.fillna(0.0) # float division by zero
+ mfv *= dataframe['volume']
+ cmf = (mfv.rolling(n, min_periods=0).sum()
+ / dataframe['volume'].rolling(n, min_periods=0).sum())
+ if fillna:
+ cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)
+ return Series(cmf, name='cmf')
+
+# Williams %R
+def williams_r(dataframe: DataFrame, period: int = 14) -> Series:
+ """Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low
+ of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.
+ Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,
+ of its recent trading range.
+ The oscillator is on a negative scale, from −100 (lowest) up to 0 (highest).
+ """
+
+ highest_high = dataframe["high"].rolling(center=False, window=period).max()
+ lowest_low = dataframe["low"].rolling(center=False, window=period).min()
+
+ WR = Series(
+ (highest_high - dataframe["close"]) / (highest_high - lowest_low),
+ name=f"{period} Williams %R",
+ )
+
+ return WR * -100
+
+# Volume Weighted Moving Average
+def vwma(dataframe: DataFrame, length: int = 10):
+ """Indicator: Volume Weighted Moving Average (VWMA)"""
+ # Calculate Result
+ pv = dataframe['close'] * dataframe['volume']
+ vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))
+ vwma = vwma.fillna(0, inplace=True)
+ return vwma
+
+# Exponential moving average of a volume weighted simple moving average
+def ema_vwma_osc(dataframe, len_slow_ma):
+ slow_ema = Series(ta.EMA(vwma(dataframe, len_slow_ma), len_slow_ma))
+ return ((slow_ema - slow_ema.shift(1)) / slow_ema.shift(1)) * 100
+
+# VWAP bands
+def vwap_bands(dataframe, window_size=20, num_of_std=1):
+ df = dataframe.copy()
+ df['vwap'] = qtpylib.rolling_vwap(df,window=window_size)
+ rolling_std = df['vwap'].rolling(window=window_size).std()
+ df['vwap_low'] = df['vwap'] - (rolling_std * num_of_std)
+ df['vwap_high'] = df['vwap'] + (rolling_std * num_of_std)
+ return df['vwap_low'], df['vwap'], df['vwap_high']
+
+def t3_average(dataframe, length=5):
+ """
+ T3 Average by HPotter on Tradingview
+ https://www.tradingview.com/script/qzoC9H1I-T3-Average/
+ """
+ df = dataframe.copy()
+
+ df['xe1'] = ta.EMA(df['close'], timeperiod=length)
+ df['xe1'].fillna(0, inplace=True)
+ df['xe2'] = ta.EMA(df['xe1'], timeperiod=length)
+ df['xe2'].fillna(0, inplace=True)
+ df['xe3'] = ta.EMA(df['xe2'], timeperiod=length)
+ df['xe3'].fillna(0, inplace=True)
+ df['xe4'] = ta.EMA(df['xe3'], timeperiod=length)
+ df['xe4'].fillna(0, inplace=True)
+ df['xe5'] = ta.EMA(df['xe4'], timeperiod=length)
+ df['xe5'].fillna(0, inplace=True)
+ df['xe6'] = ta.EMA(df['xe5'], timeperiod=length)
+ df['xe6'].fillna(0, inplace=True)
+ b = 0.7
+ c1 = -b * b * b
+ c2 = 3 * b * b + 3 * b * b * b
+ c3 = -6 * b * b - 3 * b - 3 * b * b * b
+ c4 = 1 + 3 * b + b * b * b + 3 * b * b
+ df['T3Average'] = c1 * df['xe6'] + c2 * df['xe5'] + c3 * df['xe4'] + c4 * df['xe3']
+
+ return df['T3Average']
+
+def pivot_points(dataframe: DataFrame, mode = 'fibonacci') -> Series:
+ if mode == 'simple':
+ hlc3_pivot = (dataframe['high'] + dataframe['low'] + dataframe['close']).shift(1) / 3
+ res1 = hlc3_pivot * 2 - dataframe['low'].shift(1)
+ sup1 = hlc3_pivot * 2 - dataframe['high'].shift(1)
+ res2 = hlc3_pivot + (dataframe['high'] - dataframe['low']).shift()
+ sup2 = hlc3_pivot - (dataframe['high'] - dataframe['low']).shift()
+ res3 = hlc3_pivot * 2 + (dataframe['high'] - 2 * dataframe['low']).shift()
+ sup3 = hlc3_pivot * 2 - (2 * dataframe['high'] - dataframe['low']).shift()
+ return hlc3_pivot, res1, res2, res3, sup1, sup2, sup3
+ elif mode == 'fibonacci':
+ hlc3_pivot = (dataframe['high'] + dataframe['low'] + dataframe['close']).shift(1) / 3
+ hl_range = (dataframe['high'] - dataframe['low']).shift(1)
+ res1 = hlc3_pivot + 0.382 * hl_range
+ sup1 = hlc3_pivot - 0.382 * hl_range
+ res2 = hlc3_pivot + 0.618 * hl_range
+ sup2 = hlc3_pivot - 0.618 * hl_range
+ res3 = hlc3_pivot + 1 * hl_range
+ sup3 = hlc3_pivot - 1 * hl_range
+ return hlc3_pivot, res1, res2, res3, sup1, sup2, sup3
+ elif mode == 'DeMark':
+ demark_pivot_lt = (dataframe['low'] * 2 + dataframe['high'] + dataframe['close'])
+ demark_pivot_eq = (dataframe['close'] * 2 + dataframe['low'] + dataframe['high'])
+ demark_pivot_gt = (dataframe['high'] * 2 + dataframe['low'] + dataframe['close'])
+ demark_pivot = np.where((dataframe['close'] < dataframe['open']), demark_pivot_lt, np.where((dataframe['close'] > dataframe['open']), demark_pivot_gt, demark_pivot_eq))
+ dm_pivot = demark_pivot / 4
+ dm_res = demark_pivot / 2 - dataframe['low']
+ dm_sup = demark_pivot / 2 - dataframe['high']
+ return dm_pivot, dm_res, dm_sup
+
+def heikin_ashi(dataframe, smooth_inputs = False, smooth_outputs = False, length = 10):
+ df = dataframe[['open','close','high','low']].copy().fillna(0)
+ if smooth_inputs:
+ df['open_s'] = ta.EMA(df['open'], timeframe = length)
+ df['high_s'] = ta.EMA(df['high'], timeframe = length)
+ df['low_s'] = ta.EMA(df['low'], timeframe = length)
+ df['close_s'] = ta.EMA(df['close'],timeframe = length)
+
+ open_ha = (df['open_s'].shift(1) + df['close_s'].shift(1)) / 2
+ high_ha = df.loc[:, ['high_s', 'open_s', 'close_s']].max(axis=1)
+ low_ha = df.loc[:, ['low_s', 'open_s', 'close_s']].min(axis=1)
+ close_ha = (df['open_s'] + df['high_s'] + df['low_s'] + df['close_s'])/4
+ else:
+ open_ha = (df['open'].shift(1) + df['close'].shift(1)) / 2
+ high_ha = df.loc[:, ['high', 'open', 'close']].max(axis=1)
+ low_ha = df.loc[:, ['low', 'open', 'close']].min(axis=1)
+ close_ha = (df['open'] + df['high'] + df['low'] + df['close'])/4
+
+ open_ha = open_ha.fillna(0)
+ high_ha = high_ha.fillna(0)
+ low_ha = low_ha.fillna(0)
+ close_ha = close_ha.fillna(0)
+
+ if smooth_outputs:
+ open_sha = ta.EMA(open_ha, timeframe = length)
+ high_sha = ta.EMA(high_ha, timeframe = length)
+ low_sha = ta.EMA(low_ha, timeframe = length)
+ close_sha = ta.EMA(close_ha, timeframe = length)
+
+ return open_sha, close_sha, low_sha
+ else:
+ return open_ha, close_ha, low_ha
+
+# Range midpoint acts as Support
+def is_support(row_data) -> bool:
+ conditions = []
+ for row in range(len(row_data)-1):
+ if row < len(row_data)//2:
+ conditions.append(row_data[row] > row_data[row+1])
+ else:
+ conditions.append(row_data[row] < row_data[row+1])
+ result = reduce(lambda x, y: x & y, conditions)
+ return result
+
+# Range midpoint acts as Resistance
+def is_resistance(row_data) -> bool:
+ conditions = []
+ for row in range(len(row_data)-1):
+ if row < len(row_data)//2:
+ conditions.append(row_data[row] < row_data[row+1])
+ else:
+ conditions.append(row_data[row] > row_data[row+1])
+ result = reduce(lambda x, y: x & y, conditions)
+ return result
+
+
+class Cache:
+
+ def __init__(self, path):
+ self.path = path
+ self.data = {}
+ self._mtime = None
+ self._previous_data = {}
+ try:
+ self.load()
+ except FileNotFoundError:
+ pass
+
+ @staticmethod
+ def rapidjson_load_kwargs():
+ return {"number_mode": rapidjson.NM_NATIVE}
+
+ @staticmethod
+ def rapidjson_dump_kwargs():
+ return {"number_mode": rapidjson.NM_NATIVE}
+
+ def load(self):
+ if not self._mtime or self.path.stat().st_mtime_ns != self._mtime:
+ self._load()
+
+ def save(self):
+ if self.data != self._previous_data:
+ self._save()
+
+ def process_loaded_data(self, data):
+ return data
+
+ def _load(self):
+ # This method only exists to simplify unit testing
+ with self.path.open("r") as rfh:
+ try:
+ data = rapidjson.load(
+ rfh,
+ **self.rapidjson_load_kwargs()
+ )
+ except rapidjson.JSONDecodeError as exc:
+ log.error("Failed to load JSON from %s: %s", self.path, exc)
+ else:
+ self.data = self.process_loaded_data(data)
+ self._previous_data = copy.deepcopy(self.data)
+ self._mtime = self.path.stat().st_mtime_ns
+
+ def _save(self):
+ # This method only exists to simplify unit testing
+ rapidjson.dump(
+ self.data,
+ self.path.open("w"),
+ **self.rapidjson_dump_kwargs()
+ )
+ self._mtime = self.path.stat().st_mtime
+ self._previous_data = copy.deepcopy(self.data)
+
+
+class HoldsCache(Cache):
+
+ @staticmethod
+ def rapidjson_load_kwargs():
+ return {
+ "number_mode": rapidjson.NM_NATIVE,
+ "object_hook": HoldsCache._object_hook,
+ }
+
+ @staticmethod
+ def rapidjson_dump_kwargs():
+ return {
+ "number_mode": rapidjson.NM_NATIVE,
+ "mapping_mode": rapidjson.MM_COERCE_KEYS_TO_STRINGS,
+ }
+
+ def save(self):
+ raise RuntimeError("The holds cache does not allow programatical save")
+
+ def process_loaded_data(self, data):
+ trade_ids = data.get("trade_ids")
+ trade_pairs = data.get("trade_pairs")
+
+ if not trade_ids and not trade_pairs:
+ return data
+
+ open_trades = {}
+ for trade in Trade.get_trades_proxy(is_open=True):
+ open_trades[trade.id] = open_trades[trade.pair] = trade
+
+ r_trade_ids = {}
+ if trade_ids:
+ if isinstance(trade_ids, dict):
+ # New syntax
+ for trade_id, profit_ratio in trade_ids.items():
+ if not isinstance(trade_id, int):
+ log.error(
+ "The trade_id(%s) defined under 'trade_ids' in %s is not an integer",
+ trade_id, self.path
+ )
+ continue
+ if not isinstance(profit_ratio, float):
+ log.error(
+ "The 'profit_ratio' config value(%s) for trade_id %s in %s is not a float",
+ profit_ratio,
+ trade_id,
+ self.path
+ )
+ if trade_id in open_trades:
+ formatted_profit_ratio = f"{profit_ratio * 100}%"
+ log.warning(
+ "The trade %s is configured to HOLD until the profit ratio of %s is met",
+ open_trades[trade_id],
+ formatted_profit_ratio
+ )
+ r_trade_ids[trade_id] = profit_ratio
+ else:
+ log.warning(
+ "The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s",
+ trade_id,
+ self.path
+ )
+ else:
+ # Initial Syntax
+ profit_ratio = data.get("profit_ratio")
+ if profit_ratio:
+ if not isinstance(profit_ratio, float):
+ log.error(
+ "The 'profit_ratio' config value(%s) in %s is not a float",
+ profit_ratio,
+ self.path
+ )
+ else:
+ profit_ratio = 0.005
+ formatted_profit_ratio = f"{profit_ratio * 100}%"
+ for trade_id in trade_ids:
+ if not isinstance(trade_id, int):
+ log.error(
+ "The trade_id(%s) defined under 'trade_ids' in %s is not an integer",
+ trade_id, self.path
+ )
+ continue
+ if trade_id in open_trades:
+ log.warning(
+ "The trade %s is configured to HOLD until the profit ratio of %s is met",
+ open_trades[trade_id],
+ formatted_profit_ratio
+ )
+ r_trade_ids[trade_id] = profit_ratio
+ else:
+ log.warning(
+ "The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s",
+ trade_id,
+ self.path
+ )
+
+ r_trade_pairs = {}
+ if trade_pairs:
+ for trade_pair, profit_ratio in trade_pairs.items():
+ if not isinstance(trade_pair, str):
+ log.error(
+ "The trade_pair(%s) defined under 'trade_pairs' in %s is not a string",
+ trade_pair, self.path
+ )
+ continue
+ if "/" not in trade_pair:
+ log.error(
+ "The trade_pair(%s) defined under 'trade_pairs' in %s does not look like "
+ "a valid '/' formatted pair.",
+ trade_pair, self.path
+ )
+ continue
+ if not isinstance(profit_ratio, float):
+ log.error(
+ "The 'profit_ratio' config value(%s) for trade_pair %s in %s is not a float",
+ profit_ratio,
+ trade_pair,
+ self.path
+ )
+ formatted_profit_ratio = f"{profit_ratio * 100}%"
+ if trade_pair in open_trades:
+ log.warning(
+ "The trade %s is configured to HOLD until the profit ratio of %s is met",
+ open_trades[trade_pair],
+ formatted_profit_ratio
+ )
+ else:
+ log.warning(
+ "The trade pair %s is configured to HOLD until the profit ratio of %s is met",
+ trade_pair,
+ formatted_profit_ratio
+ )
+ r_trade_pairs[trade_pair] = profit_ratio
+
+ r_data = {}
+ if r_trade_ids:
+ r_data["trade_ids"] = r_trade_ids
+ if r_trade_pairs:
+ r_data["trade_pairs"] = r_trade_pairs
+ return r_data
+
+ @staticmethod
+ def _object_hook(data):
+ _data = {}
+ for key, value in data.items():
+ try:
+ key = int(key)
+ except ValueError:
+ pass
+ _data[key] = value
+ return _data
diff --git a/strategies/NostalgiaForInfinityX2.py b/strategies/NostalgiaForInfinityX2.py
new file mode 100755
index 0000000..98b058b
--- /dev/null
+++ b/strategies/NostalgiaForInfinityX2.py
@@ -0,0 +1,8390 @@
+import copy
+import logging
+import pathlib
+import rapidjson
+import freqtrade.vendor.qtpylib.indicators as qtpylib
+import numpy as np
+import talib.abstract as ta
+import pandas as pd
+import pandas_ta as pta
+from freqtrade.strategy.interface import IStrategy
+from freqtrade.strategy import merge_informative_pair
+from pandas import DataFrame, Series
+from functools import reduce, partial
+from freqtrade.persistence import Trade, LocalTrade
+from datetime import datetime, timedelta
+import time
+from typing import Optional
+import warnings
+
+log = logging.getLogger(__name__)
+#log.setLevel(logging.DEBUG)
+warnings.simplefilter(action='ignore', category=pd.errors.PerformanceWarning)
+
+#############################################################################################################
+## NostalgiaForInfinityX2 by iterativ ##
+## https://github.com/iterativv/NostalgiaForInfinity ##
+## ##
+## Strategy for Freqtrade https://github.com/freqtrade/freqtrade ##
+## ##
+#############################################################################################################
+## GENERAL RECOMMENDATIONS ##
+## ##
+## For optimal performance, suggested to use between 4 and 6 open trades, with unlimited stake. ##
+## A pairlist with 40 to 80 pairs. Volume pairlist works well. ##
+## Prefer stable coin (USDT, BUSDT etc) pairs, instead of BTC or ETH pairs. ##
+## Highly recommended to blacklist leveraged tokens (*BULL, *BEAR, *UP, *DOWN etc). ##
+## Ensure that you don't override any variables in you config.json. Especially ##
+## the timeframe (must be 5m). ##
+## use_exit_signal must set to true (or not set at all). ##
+## exit_profit_only must set to false (or not set at all). ##
+## ignore_roi_if_entry_signal must set to true (or not set at all). ##
+## ##
+#############################################################################################################
+## DONATIONS ##
+## ##
+## BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk ##
+## ETH (ERC20): 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91 ##
+## BEP20/BSC (USDT, ETH, BNB, ...): 0x86A0B21a20b39d16424B7c8003E4A7e12d78ABEe ##
+## TRC20/TRON (USDT, TRON, ...): TTAa9MX6zMLXNgWMhg7tkNormVHWCoq8Xk ##
+## ##
+## REFERRAL LINKS ##
+## ##
+## Binance: https://accounts.binance.com/en/register?ref=C68K26A9 (20% discount on trading fees) ##
+## Kucoin: https://www.kucoin.com/r/af/QBSSS5J2 (20% lifetime discount on trading fees) ##
+## Gate.io: https://www.gate.io/signup/8054544 (20% discount on trading fees) ##
+## OKX: https://www.okx.com/join/11749725931 (20% discount on trading fees) ##
+## ByBit: https://partner.bybit.com/b/nfi ##
+## Huobi: https://www.huobi.com/en-us/v/register/double-invite/?inviter_id=11345710&invite_code=ubpt2223 ##
+## (20% discount on trading fees) ##
+## Bitvavo: https://account.bitvavo.com/create?a=D22103A4BC (no fees for the first € 1000) ##
+#############################################################################################################
+
+class NostalgiaForInfinityX2(IStrategy):
+ INTERFACE_VERSION = 3
+
+ def version(self) -> str:
+ return "v12.0.80"
+
+ # ROI table:
+ minimal_roi = {
+ "0": 100.0,
+ }
+
+ stoploss = -0.99
+
+ # Trailing stoploss (not used)
+ trailing_stop = False
+ trailing_only_offset_is_reached = True
+ trailing_stop_positive = 0.01
+ trailing_stop_positive_offset = 0.03
+
+ use_custom_stoploss = False
+
+ # Optimal timeframe for the strategy.
+ timeframe = '5m'
+ info_timeframes = ['15m','1h','4h','1d']
+
+ # BTC informatives
+ btc_info_timeframes = ['5m','15m','1h','4h','1d']
+
+ # Backtest Age Filter emulation
+ has_bt_agefilter = False
+ bt_min_age_days = 3
+
+ # Exchange Downtime protection
+ has_downtime_protection = False
+
+ # Do you want to use the hold feature? (with hold-trades.json)
+ hold_support_enabled = True
+
+ # Run "populate_indicators()" only for new candle.
+ process_only_new_candles = True
+
+ # These values can be overridden in the "ask_strategy" section in the config.
+ use_exit_signal = True
+ exit_profit_only = False
+ ignore_roi_if_entry_signal = True
+
+ # Number of candles the strategy requires before producing valid signals
+ startup_candle_count: int = 480
+
+ # Normal mode bull tags
+ normal_mode_bull_tags = ['force_entry', '1', '2', '3', '4', '5', '6']
+ # Normal mode bear tags
+ normal_mode_bear_tags = ['11', '12', '13', '14', '15', '16']
+ # Pump mode bull tags
+ pump_mode_bull_tags = ['21', '22']
+ # Pump mode bear tags
+ pump_mode_bear_tags = ['31', '32']
+ # Quick mode bull tags
+ quick_mode_bull_tags = ['41', '42', '43', '44']
+ # Quick mode bear tags
+ quick_mode_bear_tags = ['51', '52', '53', '54']
+ # Rebuy mode bull tags
+ rebuy_mode_bull_tags = ['61']
+ # Rebuy mode bear tags
+ rebuy_mode_bear_tags = ['71']
+ # Long mode bull tags
+ long_mode_bull_tags = ['81', '82']
+ # Long mode bear tags
+ long_mode_bear_tags = ['91', '92']
+
+ # Stop thesholds. 0: Doom Bull, 1: Doom Bear, 2: u_e Bull, 3: u_e Bear, 4: u_e mins Bull, 5: u_e mins Bear.
+ # 6: u_e ema % Bull, 7: u_e ema % Bear, 8: u_e RSI diff Bull, 9: u_e RSI diff Bear.
+ # 10: enable Doom Bull, 11: enable Doom Bear, 12: enable u_e Bull, 13: enable u_e Bear.
+ stop_thresholds_normal = [-0.2, -0.2, -0.025, -0.025, 720, 720, 0.016, 0.016, 24.0, 24.0, True, True, True, True]
+ stop_thresholds_pump = [-0.2, -0.2, -0.025, -0.025, 720, 720, 0.016, 0.016, 24.0, 24.0, True, True, True, True]
+ stop_thresholds_quick = [-0.2, -0.2, -0.025, -0.025, 720, 720, 0.016, 0.016, 24.0, 24.0, True, True, True, True]
+ stop_thresholds_rebuy = [-0.2, -0.2, -0.025, -0.025, 720, 720, 0.016, 0.016, 24.0, 24.0, True, True, True, True]
+ stop_thresholds_long = [-0.2, -0.2, -0.025, -0.025, 720, 720, 0.016, 0.016, 24.0, 24.0, True, True, True, True]
+
+ # Rebuy mode minimum number of free slots
+ rebuy_mode_min_free_slots = 2
+
+ # Position adjust feature
+ position_adjustment_enable = True
+
+ stake_rebuy_mode_bull_multiplier = 0.33
+ pa_rebuy_mode_bull_max = 2
+ pa_rebuy_mode_bull_pcts = (-0.02, -0.04, -0.04)
+ pa_rebuy_mode_bull_multi = (1.0, 1.0, 1.0)
+
+ stake_rebuy_mode_bear_multiplier = 0.33
+ pa_rebuy_mode_bear_max = 2
+ pa_rebuy_mode_bear_pcts = (-0.02, -0.04, -0.04)
+ pa_rebuy_mode_bear_multi = (1.0, 1.0, 1.0)
+
+ #############################################################
+ # Buy side configuration
+
+ buy_params = {
+ # Enable/Disable conditions
+ # -------------------------------------------------------
+ "buy_condition_1_enable": True,
+ "buy_condition_2_enable": True,
+ "buy_condition_3_enable": True,
+ "buy_condition_4_enable": True,
+ "buy_condition_5_enable": True,
+ "buy_condition_6_enable": True,
+
+ "buy_condition_11_enable": True,
+ "buy_condition_12_enable": True,
+ "buy_condition_13_enable": True,
+ "buy_condition_14_enable": True,
+ "buy_condition_15_enable": True,
+ "buy_condition_16_enable": True,
+
+ "buy_condition_21_enable": True,
+ "buy_condition_22_enable": True,
+
+ "buy_condition_31_enable": True,
+ "buy_condition_32_enable": True,
+
+ "buy_condition_41_enable": True,
+ "buy_condition_42_enable": True,
+ "buy_condition_43_enable": True,
+ "buy_condition_44_enable": True,
+
+ "buy_condition_51_enable": True,
+ "buy_condition_52_enable": True,
+ "buy_condition_53_enable": True,
+ "buy_condition_54_enable": True,
+
+ "buy_condition_61_enable": True,
+
+ "buy_condition_71_enable": True,
+
+ "buy_condition_81_enable": True,
+ "buy_condition_82_enable": True,
+
+ "buy_condition_91_enable": True,
+ "buy_condition_92_enable": True,
+ }
+
+ buy_protection_params = {}
+
+ #############################################################
+ # CACHES
+
+ hold_trades_cache = None
+ target_profit_cache = None
+ #############################################################
+
+ def __init__(self, config: dict) -> None:
+ super().__init__(config)
+ if (('exit_profit_only' in self.config and self.config['exit_profit_only'])
+ or ('sell_profit_only' in self.config and self.config['sell_profit_only'])):
+ self.exit_profit_only = True
+ if ('stop_thresholds_normal' in self.config):
+ self.stop_thresholds_normal = self.config['stop_thresholds_normal']
+ if ('stop_thresholds_pump' in self.config):
+ self.stop_thresholds_pump = self.config['stop_thresholds_pump']
+ if ('stop_thresholds_quick' in self.config):
+ self.stop_thresholds_quick = self.config['stop_thresholds_quick']
+ if ('stop_thresholds_rebuy' in self.config):
+ self.stop_thresholds_rebuy = self.config['stop_thresholds_rebuy']
+ if ('stop_thresholds_long' in self.config):
+ self.stop_thresholds_long = self.config['stop_thresholds_long']
+ if self.target_profit_cache is None:
+ bot_name = ""
+ if ('bot_name' in self.config):
+ bot_name = self.config["bot_name"] + "-"
+ self.target_profit_cache = Cache(
+ self.config["user_data_dir"] / ("nfix2-profit_max-" + bot_name + self.config["exchange"]["name"] + "-" + self.config["stake_currency"] + ("-(backtest)" if (self.config['runmode'].value == 'backtest') else "") + ".json")
+ )
+
+ # If the cached data hasn't changed, it's a no-op
+ self.target_profit_cache.save()
+
+ def get_ticker_indicator(self):
+ return int(self.timeframe[:-1])
+
+ def exit_normal_bull(self, pair: str, current_rate: float, current_profit: float,
+ max_profit: float, max_loss: float,
+ last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5,
+ trade: 'Trade', current_time: 'datetime', enter_tags) -> tuple:
+ sell = False
+
+ # Original sell signals
+ sell, signal_name = self.exit_normal_bull_signals(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Main sell signals
+ if not sell:
+ sell, signal_name = self.exit_normal_bull_main(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Williams %R based sells
+ if not sell:
+ sell, signal_name = self.exit_normal_bull_r(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Stoplosses
+ if not sell:
+ sell, signal_name = self.exit_normal_bull_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Profit Target Signal
+ # Check if pair exist on target_profit_cache
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_rate = self.target_profit_cache.data[pair]['rate']
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ previous_sell_reason = self.target_profit_cache.data[pair]['sell_reason']
+ previous_time_profit_reached = datetime.fromisoformat(self.target_profit_cache.data[pair]['time_profit_reached'])
+
+ sell_max, signal_name_max = self.normal_bull_exit_profit_target(pair, trade, current_time, current_rate, current_profit,
+ last_candle, previous_candle_1,
+ previous_rate, previous_profit, previous_sell_reason,
+ previous_time_profit_reached, enter_tags)
+ if sell_max and signal_name_max is not None:
+ return True, f"{signal_name_max}_m"
+ if (current_profit > (previous_profit + 0.005)) and (previous_sell_reason not in ["exit_normal_bull_stoploss_doom"]):
+ # Update the target, raise it.
+ mark_pair, mark_signal = self.normal_bull_mark_profit_target(pair, True, previous_sell_reason, trade, current_time, current_rate, current_profit, last_candle, previous_candle_1)
+ if mark_pair:
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+
+ # Add the pair to the list, if a sell triggered and conditions met
+ if sell and signal_name is not None:
+ previous_profit = None
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ if (
+ (previous_profit is None)
+ or (previous_profit < current_profit)
+ ):
+ mark_pair, mark_signal = self.normal_bull_mark_profit_target(pair, sell, signal_name, trade, current_time, current_rate, current_profit, last_candle, previous_candle_1)
+ if mark_pair:
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+ else:
+ # Just sell it, without maximize
+ return True, f"{signal_name}"
+ else:
+ if (
+ (current_profit >= 0.01)
+ ):
+ previous_profit = None
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ if (previous_profit is None) or (previous_profit < current_profit):
+ mark_signal = "exit_profit_normal_bull_max"
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+
+ if (signal_name not in ["exit_profit_normal_bull_max", "exit_normal_bull_stoploss_doom", "exit_normal_bull_stoploss_u_e"]):
+ if sell and (signal_name is not None):
+ return True, f"{signal_name}"
+
+ return False, None
+
+ def normal_bull_mark_profit_target(self, pair: str, sell: bool, signal_name: str, trade: Trade, current_time: datetime, current_rate: float, current_profit: float, last_candle, previous_candle_1) -> tuple:
+ if sell and (signal_name is not None):
+ return pair, signal_name
+
+ return None, None
+
+ def normal_bull_exit_profit_target(self, pair: str, trade: Trade, current_time: datetime, current_rate: float, current_profit: float, last_candle, previous_candle_1, previous_rate, previous_profit, previous_sell_reason, previous_time_profit_reached, enter_tags) -> tuple:
+ if (previous_sell_reason in ["exit_normal_bull_stoploss_doom"]):
+ if (current_profit > 0.04):
+ # profit is over the threshold, don't exit
+ self._remove_profit_target(pair)
+ return False, None
+ if (current_profit < -0.18):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (current_profit < -0.1):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (current_profit < -0.04):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ else:
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (previous_sell_reason in ["exit_normal_bull_stoploss_u_e"]):
+ if (current_profit > 0.04):
+ # profit is over the threshold, don't exit
+ self._remove_profit_target(pair)
+ return False, None
+ if (current_profit < (previous_profit - 0.01)):
+ return True, previous_sell_reason
+ elif (previous_sell_reason in ["exit_profit_normal_bull_max"]):
+ if (current_profit < -0.08):
+ # profit is under the threshold, cancel it
+ self._remove_profit_target(pair)
+ return False, None
+ if (0.001 <= current_profit < 0.01):
+ if (current_profit < (previous_profit - 0.01)):
+ return True, previous_sell_reason
+ elif (0.01 <= current_profit < 0.02):
+ if (current_profit < (previous_profit - 0.02)):
+ return True, previous_sell_reason
+ elif (0.02 <= current_profit < 0.03):
+ if (current_profit < (previous_profit - 0.03)):
+ return True, previous_sell_reason
+ elif (0.03 <= current_profit < 0.05):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (0.05 <= current_profit < 0.08):
+ if (current_profit < (previous_profit - 0.05)):
+ return True, previous_sell_reason
+ elif (0.08 <= current_profit < 0.12):
+ if (current_profit < (previous_profit - 0.06)):
+ return True, previous_sell_reason
+ elif (0.12 <= current_profit):
+ if (current_profit < (previous_profit - 0.07)):
+ return True, previous_sell_reason
+ else:
+ return False, None
+
+ return False, None
+
+ def exit_normal_bull_signals(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ # Sell signal 1
+ if (last_candle['rsi_14'] > 79.0) and (last_candle['rsi_14_4h'] > 75.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) and (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_normal_bull_1_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_normal_bull_1_2_1'
+
+ # Sell signal 2
+ elif (last_candle['rsi_14'] > 80.0) and (last_candle['rsi_14_4h'] > 75.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_normal_bull_2_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_normal_bull_2_2_1'
+
+ # Sell signal 3
+ elif (last_candle['rsi_14'] > 85.0) and (last_candle['rsi_14_4h'] > 75.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_normal_bull_3_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_normal_bull_3_2_1'
+
+ # Sell signal 4
+ elif (last_candle['rsi_14'] > 80.0) and (last_candle['rsi_14_1h'] > 80.0) and (last_candle['rsi_14_4h'] > 75.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_normal_bull_4_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_normal_bull_4_2_1'
+
+ # Sell signal 6
+ elif (last_candle['close'] < last_candle['ema_200']) and (last_candle['close'] > last_candle['ema_50']) and (last_candle['rsi_14'] > 79.0):
+ if (current_profit > 0.01):
+ return True, 'exit_normal_bull_6_1'
+
+ # Sell signal 7
+ elif (last_candle['rsi_14_1h'] > 79.0) and (last_candle['crossed_below_ema_12_26']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_normal_bull_7_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_normal_bull_7_2_1'
+
+ # Sell signal 8
+ elif (last_candle['rsi_14_4h'] > 75.0) and (last_candle['close'] > last_candle['bb20_2_upp_1h'] * 1.08):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_normal_bull_8_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_normal_bull_8_2_1'
+
+ return False, None
+
+ def exit_normal_bull_main(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ if (last_candle['close'] > last_candle['sma_200_1h']):
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['rsi_14'] < 20.0):
+ return True, 'exit_normal_bull_o_0'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 28.0):
+ return True, 'exit_normal_bull_o_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 30.0):
+ return True, 'exit_normal_bull_o_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 32.0):
+ return True, 'exit_normal_bull_o_3'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 34.0):
+ return True, 'exit_normal_bull_o_4'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 36.0):
+ return True, 'exit_normal_bull_o_5'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 38.0):
+ return True, 'exit_normal_bull_o_6'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 40.0):
+ return True, 'exit_normal_bull_o_7'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'exit_normal_bull_o_8'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_normal_bull_o_9'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_normal_bull_o_10'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_normal_bull_o_11'
+ elif current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'exit_normal_bull_o_12'
+ elif (last_candle['close'] < last_candle['sma_200_1h']):
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['rsi_14'] < 22.0):
+ return True, 'exit_normal_bull_u_0'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 30.0):
+ return True, 'exit_normal_bull_u_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 32.0):
+ return True, 'exit_normal_bull_u_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 34.0):
+ return True, 'exit_normal_bull_u_3'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 36.0):
+ return True, 'exit_normal_bull_u_4'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 38.0):
+ return True, 'exit_normal_bull_u_5'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 40.0):
+ return True, 'exit_normal_bull_u_6'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'exit_normal_bull_u_7'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_normal_bull_u_8'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_normal_bull_u_9'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'exit_normal_bull_u_10'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_normal_bull_u_11'
+ elif current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_normal_bull_u_12'
+
+ return False, None
+
+ def exit_normal_bull_r(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['r_480'] > -0.1):
+ return True, 'exit_normal_bull_w_0_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_normal_bull_w_0_2'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['r_480'] > -0.2):
+ return True, 'exit_normal_bull_w_1_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_normal_bull_w_1_2'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['r_480'] > -0.3):
+ return True, 'exit_normal_bull_w_2_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_normal_bull_w_2_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['r_480'] > -0.4):
+ return True, 'exit_normal_bull_w_3_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_normal_bull_w_3_2'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['r_480'] > -0.5):
+ return True, 'exit_normal_bull_w_4_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_normal_bull_w_4_2'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['r_480'] > -0.6):
+ return True, 'exit_normal_bull_w_5_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_normal_bull_w_5_2'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['r_480'] > -0.7):
+ return True, 'exit_normal_bull_w_6_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_normal_bull_w_6_2'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['r_480'] > -0.8):
+ return True, 'exit_normal_bull_w_7_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_normal_bull_w_7_2'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['r_480'] > -0.9):
+ return True, 'exit_normal_bull_w_8_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_normal_bull_w_8_2'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['r_480'] > -1.0):
+ return True, 'exit_normal_bull_w_9_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_normal_bull_w_9_2'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['r_480'] > -1.1):
+ return True, 'exit_normal_bull_w_10_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_normal_bull_w_10_2'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['r_480'] > -0.4):
+ return True, 'exit_normal_bull_w_11_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_normal_bull_w_11_2'
+ elif current_profit >= 0.2:
+ if (last_candle['r_480'] > -0.2):
+ return True, 'exit_normal_bull_w_12_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 80.0):
+ return True, 'exit_normal_bull_w_12_2'
+
+ return False, None
+
+ def exit_normal_bull_stoploss(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ is_backtest = self.dp.runmode.value == 'backtest'
+ # Stoploss doom
+ if (
+ (self.stop_thresholds_normal[10])
+ and (current_profit < self.stop_thresholds_normal[0])
+ ):
+ return True, 'exit_normal_bull_stoploss_doom'
+
+ # Under & near EMA200, local uptrend move
+ if (
+ (self.stop_thresholds_normal[12])
+ and (current_profit < self.stop_thresholds_normal[2])
+ and (last_candle['close'] < last_candle['ema_200'])
+ and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.stop_thresholds_normal[6])
+ and (last_candle['rsi_14'] > previous_candle_1['rsi_14'])
+ and (last_candle['rsi_14'] > (last_candle['rsi_14_1h'] + self.stop_thresholds_normal[8]))
+ and (current_time - timedelta(minutes=self.stop_thresholds_normal[4]) > trade.open_date_utc)
+ # temporary
+ and (trade.open_date_utc.replace(tzinfo=None) >= datetime(2022, 12, 25) or is_backtest)
+ ):
+ return True, 'exit_normal_bull_stoploss_u_e'
+
+ return False, None
+
+ def exit_normal_bear(self, pair: str, current_rate: float, current_profit: float,
+ max_profit: float, max_loss: float,
+ last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5,
+ trade: 'Trade', current_time: 'datetime', enter_tags) -> tuple:
+ sell = False
+
+ # Original sell signals
+ sell, signal_name = self.exit_normal_bear_signals(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Main sell signals
+ if not sell:
+ sell, signal_name = self.exit_normal_bear_main(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Williams %R based sells
+ if not sell:
+ sell, signal_name = self.exit_normal_bear_r(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Stoplosses
+ if not sell:
+ sell, signal_name = self.exit_normal_bear_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Profit Target Signal
+ # Check if pair exist on target_profit_cache
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_rate = self.target_profit_cache.data[pair]['rate']
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ previous_sell_reason = self.target_profit_cache.data[pair]['sell_reason']
+ previous_time_profit_reached = datetime.fromisoformat(self.target_profit_cache.data[pair]['time_profit_reached'])
+
+ sell_max, signal_name_max = self.normal_bear_exit_profit_target(pair, trade, current_time, current_rate, current_profit,
+ last_candle, previous_candle_1,
+ previous_rate, previous_profit, previous_sell_reason,
+ previous_time_profit_reached, enter_tags)
+ if sell_max and signal_name_max is not None:
+ return True, f"{signal_name_max}_m"
+ if (current_profit > (previous_profit + 0.005)) and (previous_sell_reason not in ["exit_normal_bear_stoploss_doom"]):
+ # Update the target, raise it.
+ mark_pair, mark_signal = self.normal_bear_mark_profit_target(pair, True, previous_sell_reason, trade, current_time, current_rate, current_profit, last_candle, previous_candle_1)
+ if mark_pair:
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+
+ # Add the pair to the list, if a sell triggered and conditions met
+ if sell and signal_name is not None:
+ previous_profit = None
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ if (
+ (previous_profit is None)
+ or (previous_profit < current_profit)
+ ):
+ mark_pair, mark_signal = self.normal_bear_mark_profit_target(pair, sell, signal_name, trade, current_time, current_rate, current_profit, last_candle, previous_candle_1)
+ if mark_pair:
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+ else:
+ # Just sell it, without maximize
+ return True, f"{signal_name}"
+ else:
+ if (
+ (current_profit >= 0.01)
+ ):
+ previous_profit = None
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ if (previous_profit is None) or (previous_profit < current_profit):
+ mark_signal = "exit_profit_normal_bear_max"
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+
+ if (signal_name not in ["exit_profit_normal_bear_max", "exit_normal_bear_stoploss_doom", "exit_normal_bear_stoploss_u_e"]):
+ if sell and (signal_name is not None):
+ return True, f"{signal_name}"
+
+ return False, None
+
+ def normal_bear_mark_profit_target(self, pair: str, sell: bool, signal_name: str, trade: Trade, current_time: datetime, current_rate: float, current_profit: float, last_candle, previous_candle_1) -> tuple:
+ if sell and (signal_name is not None):
+ return pair, signal_name
+
+ return None, None
+
+ def normal_bear_exit_profit_target(self, pair: str, trade: Trade, current_time: datetime, current_rate: float, current_profit: float, last_candle, previous_candle_1, previous_rate, previous_profit, previous_sell_reason, previous_time_profit_reached, enter_tags) -> tuple:
+ if (previous_sell_reason in ["exit_normal_bear_stoploss_doom"]):
+ if (current_profit > 0.04):
+ # profit is over the threshold, don't exit
+ self._remove_profit_target(pair)
+ return False, None
+ if (current_profit < -0.18):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (current_profit < -0.1):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (current_profit < -0.04):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ else:
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (previous_sell_reason in ["exit_normal_bear_stoploss_u_e"]):
+ if (current_profit > 0.04):
+ # profit is over the threshold, don't exit
+ self._remove_profit_target(pair)
+ return False, None
+ if (current_profit < (previous_profit - 0.01)):
+ return True, previous_sell_reason
+ elif (previous_sell_reason in ["exit_profit_normal_bear_max"]):
+ if (current_profit < -0.08):
+ # profit is under the threshold, cancel it
+ self._remove_profit_target(pair)
+ return False, None
+ if (0.001 <= current_profit < 0.01):
+ if (current_profit < (previous_profit - 0.01)):
+ return True, previous_sell_reason
+ elif (0.01 <= current_profit < 0.02):
+ if (current_profit < (previous_profit - 0.02)):
+ return True, previous_sell_reason
+ elif (0.02 <= current_profit < 0.03):
+ if (current_profit < (previous_profit - 0.03)):
+ return True, previous_sell_reason
+ elif (0.03 <= current_profit < 0.05):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (0.05 <= current_profit < 0.08):
+ if (current_profit < (previous_profit - 0.05)):
+ return True, previous_sell_reason
+ elif (0.08 <= current_profit < 0.12):
+ if (current_profit < (previous_profit - 0.06)):
+ return True, previous_sell_reason
+ elif (0.12 <= current_profit):
+ if (current_profit < (previous_profit - 0.07)):
+ return True, previous_sell_reason
+ else:
+ return False, None
+
+ return False, None
+
+ def exit_normal_bear_signals(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ # Sell signal 1
+ if (last_candle['rsi_14'] > 78.0) and (last_candle['rsi_14_4h'] > 75.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) and (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_normal_bear_1_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_normal_bear_1_2_1'
+
+ # Sell signal 2
+ elif (last_candle['rsi_14'] > 79.0) and (last_candle['rsi_14_4h'] > 75.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_normal_bear_2_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_normal_bear_2_2_1'
+
+ # Sell signal 3
+ elif (last_candle['rsi_14'] > 84.0) and (last_candle['rsi_14_4h'] > 75.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_normal_bear_3_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_normal_bear_3_2_1'
+
+ # Sell signal 4
+ elif (last_candle['rsi_14'] > 79.0) and (last_candle['rsi_14_1h'] > 79.0) and (last_candle['rsi_14_4h'] > 75.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_normal_bear_4_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_normal_bear_4_2_1'
+
+ # Sell signal 6
+ elif (last_candle['close'] < last_candle['ema_200']) and (last_candle['close'] > last_candle['ema_50']) and (last_candle['rsi_14'] > 78.5):
+ if (current_profit > 0.01):
+ return True, 'exit_normal_bear_6_1'
+
+ # Sell signal 7
+ elif (last_candle['rsi_14_1h'] > 79.0) and (last_candle['crossed_below_ema_12_26']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_normal_bear_7_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_normal_bear_7_2_1'
+
+ # Sell signal 8
+ elif (last_candle['close'] > last_candle['bb20_2_upp_1h'] * 1.07) and (last_candle['rsi_14_4h'] > 75.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_normal_bear_8_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_normal_bear_8_2_1'
+
+ return False, None
+
+ def exit_normal_bear_main(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ if (last_candle['close'] > last_candle['sma_200_1h']):
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['rsi_14'] < 22.0):
+ return True, 'exit_normal_bear_o_0'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 30.0):
+ return True, 'exit_normal_bear_o_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 32.0):
+ return True, 'exit_normal_bear_o_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 34.0):
+ return True, 'exit_normal_bear_o_3'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 36.0):
+ return True, 'exit_normal_bear_o_4'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 38.0):
+ return True, 'exit_normal_bear_o_5'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 40.0):
+ return True, 'exit_normal_bear_o_6'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'exit_normal_bear_o_7'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_normal_bear_o_8'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_normal_bear_o_9'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'exit_normal_bear_o_10'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_normal_bear_o_11'
+ elif current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_normal_bear_o_12'
+ elif (last_candle['close'] < last_candle['sma_200_1h']):
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['rsi_14'] < 24.0):
+ return True, 'exit_normal_bear_u_0'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 32.0):
+ return True, 'exit_normal_bear_u_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 34.0):
+ return True, 'exit_normal_bear_u_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 36.0):
+ return True, 'exit_normal_bear_u_3'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 38.0):
+ return True, 'exit_normal_bear_u_4'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 40.0):
+ return True, 'exit_normal_bear_u_5'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'exit_normal_bear_u_6'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_normal_bear_u_7'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_normal_bear_u_8'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'exit_normal_bear_u_9'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 50.0):
+ return True, 'exit_normal_bear_u_10'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'exit_normal_bear_u_11'
+ elif current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_normal_bear_u_12'
+
+ return False, None
+
+ def exit_normal_bear_r(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['r_480'] > -0.1):
+ return True, 'exit_normal_bear_w_0_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_normal_bear_w_0_2'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['r_480'] > -0.2):
+ return True, 'exit_normal_bear_w_1_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_normal_bear_w_1_2'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['r_480'] > -0.3):
+ return True, 'exit_normal_bear_w_2_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_normal_bear_w_2_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['r_480'] > -0.4):
+ return True, 'exit_normal_bear_w_3_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_normal_bear_w_3_2'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['r_480'] > -0.5):
+ return True, 'exit_normal_bear_w_4_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_normal_bear_w_4_2'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['r_480'] > -0.6):
+ return True, 'exit_normal_bear_w_5_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_normal_bear_w_5_2'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['r_480'] > -0.7):
+ return True, 'exit_normal_bear_w_6_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_normal_bear_w_6_2'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['r_480'] > -0.8):
+ return True, 'exit_normal_bear_w_7_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_normal_bear_w_7_2'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['r_480'] > -0.9):
+ return True, 'exit_normal_bear_w_8_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_normal_bear_w_8_2'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['r_480'] > -1.0):
+ return True, 'exit_normal_bear_w_9_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_normal_bear_w_9_2'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['r_480'] > -1.1):
+ return True, 'exit_normal_bear_w_10_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_normal_bear_w_10_2'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['r_480'] > -0.4):
+ return True, 'exit_normal_bear_w_11_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_normal_bear_w_11_2'
+ elif current_profit >= 0.2:
+ if (last_candle['r_480'] > -0.2):
+ return True, 'exit_normal_bear_w_12_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 80.0):
+ return True, 'exit_normal_bear_w_12_2'
+
+ return False, None
+
+ def exit_normal_bear_stoploss(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ is_backtest = self.dp.runmode.value == 'backtest'
+ # Stoploss doom
+ if (
+ (self.stop_thresholds_normal[11])
+ and (current_profit < self.stop_thresholds_normal[1])
+ ):
+ return True, 'exit_normal_bear_stoploss_doom'
+
+ # Under & near EMA200, local uptrend move
+ if (
+ (self.stop_thresholds_normal[13])
+ and (current_profit < self.stop_thresholds_normal[3])
+ and (last_candle['close'] < last_candle['ema_200'])
+ and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.stop_thresholds_normal[7])
+ and (last_candle['rsi_14'] > previous_candle_1['rsi_14'])
+ and (last_candle['rsi_14'] > (last_candle['rsi_14_1h'] + self.stop_thresholds_normal[9]))
+ and (current_time - timedelta(minutes=self.stop_thresholds_normal[5]) > trade.open_date_utc)
+ # temporary
+ and (trade.open_date_utc.replace(tzinfo=None) >= datetime(2022, 12, 25) or is_backtest)
+ ):
+ return True, 'exit_normal_bear_stoploss_u_e'
+
+ return False, None
+
+ def exit_pump_bull(self, pair: str, current_rate: float, current_profit: float,
+ max_profit: float, max_loss: float,
+ last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5,
+ trade: 'Trade', current_time: 'datetime', enter_tags) -> tuple:
+ sell = False
+
+ # Original sell signals
+ sell, signal_name = self.exit_pump_bull_signals(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Main sell signals
+ if not sell:
+ sell, signal_name = self.exit_pump_bull_main(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Williams %R based sells
+ if not sell:
+ sell, signal_name = self.exit_pump_bull_r(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Stoplosses
+ if not sell:
+ sell, signal_name = self.exit_pump_bull_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Profit Target Signal
+ # Check if pair exist on target_profit_cache
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_rate = self.target_profit_cache.data[pair]['rate']
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ previous_sell_reason = self.target_profit_cache.data[pair]['sell_reason']
+ previous_time_profit_reached = datetime.fromisoformat(self.target_profit_cache.data[pair]['time_profit_reached'])
+
+ sell_max, signal_name_max = self.pump_bull_exit_profit_target(pair, trade, current_time, current_rate, current_profit,
+ last_candle, previous_candle_1,
+ previous_rate, previous_profit, previous_sell_reason,
+ previous_time_profit_reached, enter_tags)
+ if sell_max and signal_name_max is not None:
+ return True, f"{signal_name_max}_m"
+ if (current_profit > (previous_profit + 0.005)) and (previous_sell_reason not in ["exit_pump_bull_stoploss_doom"]):
+ # Update the target, raise it.
+ mark_pair, mark_signal = self.pump_bull_mark_profit_target(pair, True, previous_sell_reason, trade, current_time, current_rate, current_profit, last_candle, previous_candle_1)
+ if mark_pair:
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+
+ # Add the pair to the list, if a sell triggered and conditions met
+ if sell and signal_name is not None:
+ previous_profit = None
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ if (
+ (previous_profit is None)
+ or (previous_profit < current_profit)
+ ):
+ mark_pair, mark_signal = self.pump_bull_mark_profit_target(pair, sell, signal_name, trade, current_time, current_rate, current_profit, last_candle, previous_candle_1)
+ if mark_pair:
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+ else:
+ # Just sell it, without maximize
+ return True, f"{signal_name}"
+ else:
+ if (
+ (current_profit >= 0.01)
+ ):
+ previous_profit = None
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ if (previous_profit is None) or (previous_profit < current_profit):
+ mark_signal = "exit_profit_pump_bull_max"
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+
+ if (signal_name not in ["exit_profit_pump_bull_max", "exit_pump_bull_stoploss_doom"]):
+ if sell and (signal_name is not None):
+ return True, f"{signal_name}"
+
+ return False, None
+
+ def pump_bull_mark_profit_target(self, pair: str, sell: bool, signal_name: str, trade: Trade, current_time: datetime, current_rate: float, current_profit: float, last_candle, previous_candle_1) -> tuple:
+ if sell and (signal_name is not None):
+ return pair, signal_name
+
+ return None, None
+
+ def pump_bull_exit_profit_target(self, pair: str, trade: Trade, current_time: datetime, current_rate: float, current_profit: float, last_candle, previous_candle_1, previous_rate, previous_profit, previous_sell_reason, previous_time_profit_reached, enter_tags) -> tuple:
+ if (previous_sell_reason in ["exit_pump_bull_stoploss_doom"]):
+ if (current_profit > 0.04):
+ # profit is over the threshold, don't exit
+ self._remove_profit_target(pair)
+ return False, None
+ if (current_profit < -0.18):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (current_profit < -0.1):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (current_profit < -0.04):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ else:
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (previous_sell_reason in ["exit_pump_bull_stoploss_u_e"]):
+ if (current_profit > 0.04):
+ # profit is over the threshold, don't exit
+ self._remove_profit_target(pair)
+ return False, None
+ if (current_profit < (previous_profit - 0.01)):
+ return True, previous_sell_reason
+ elif (previous_sell_reason in ["exit_profit_pump_bull_max"]):
+ if (current_profit < -0.08):
+ # profit is under the threshold, cancel
+ self._remove_profit_target(pair)
+ return False, None
+ if (0.001 <= current_profit < 0.01):
+ if (current_profit < (previous_profit - 0.01)):
+ return True, previous_sell_reason
+ elif (0.01 <= current_profit < 0.02):
+ if (current_profit < (previous_profit - 0.02)):
+ return True, previous_sell_reason
+ elif (0.02 <= current_profit < 0.03):
+ if (current_profit < (previous_profit - 0.03)):
+ return True, previous_sell_reason
+ elif (0.03 <= current_profit < 0.05):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (0.05 <= current_profit < 0.08):
+ if (current_profit < (previous_profit - 0.05)):
+ return True, previous_sell_reason
+ elif (0.08 <= current_profit < 0.12):
+ if (current_profit < (previous_profit - 0.06)):
+ return True, previous_sell_reason
+ elif (0.12 <= current_profit):
+ if (current_profit < (previous_profit - 0.07)):
+ return True, previous_sell_reason
+ else:
+ return False, None
+
+ return False, None
+
+ def exit_pump_bull_signals(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ # Sell signal 1
+ if (last_candle['rsi_14'] > 79.0) and (last_candle['rsi_14_4h'] > 75.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) and (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_pump_bull_1_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_pump_bull_1_2_1'
+
+ # Sell signal 2
+ elif (last_candle['rsi_14'] > 80.0) and (last_candle['rsi_14_4h'] > 75.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_pump_bull_2_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_pump_bull_2_2_1'
+
+ # Sell signal 3
+ elif (last_candle['rsi_14'] > 85.0) and (last_candle['rsi_14_4h'] > 75.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_pump_bull_3_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_pump_bull_3_2_1'
+
+ # Sell signal 4
+ elif (last_candle['rsi_14'] > 80.0) and (last_candle['rsi_14_1h'] > 80.0) and (last_candle['rsi_14_4h'] > 75.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_pump_bull_4_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_pump_bull_4_2_1'
+
+ # Sell signal 6
+ elif (last_candle['close'] < last_candle['ema_200']) and (last_candle['close'] > last_candle['ema_50']) and (last_candle['rsi_14'] > 79.0):
+ if (current_profit > 0.01):
+ return True, 'exit_pump_bull_6_1'
+
+ # Sell signal 7
+ elif (last_candle['rsi_14_1h'] > 79.0) and (last_candle['crossed_below_ema_12_26']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_pump_bull_7_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_pump_bull_7_2_1'
+
+ # Sell signal 8
+ elif (last_candle['rsi_14_4h'] > 75.0) and (last_candle['close'] > last_candle['bb20_2_upp_1h'] * 1.08):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_pump_bull_8_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_pump_bull_8_2_1'
+
+ return False, None
+
+ def exit_pump_bull_main(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ if (last_candle['close'] > last_candle['sma_200_1h']):
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['rsi_14'] < 20.0):
+ return True, 'exit_pump_bull_o_0'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 28.0):
+ return True, 'exit_pump_bull_o_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 30.0):
+ return True, 'exit_pump_bull_o_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 32.0):
+ return True, 'exit_pump_bull_o_3'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 34.0):
+ return True, 'exit_pump_bull_o_4'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 36.0):
+ return True, 'exit_pump_bull_o_5'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 38.0):
+ return True, 'exit_pump_bull_o_6'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 40.0):
+ return True, 'exit_pump_bull_o_7'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'exit_pump_bull_o_8'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_pump_bull_o_9'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_pump_bull_o_10'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_pump_bull_o_11'
+ elif current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'exit_pump_bull_o_12'
+ elif (last_candle['close'] < last_candle['sma_200_1h']):
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['rsi_14'] < 22.0):
+ return True, 'exit_pump_bull_u_0'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 30.0):
+ return True, 'exit_pump_bull_u_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 32.0):
+ return True, 'exit_pump_bull_u_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 34.0):
+ return True, 'exit_pump_bull_u_3'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 36.0):
+ return True, 'exit_pump_bull_u_4'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 38.0):
+ return True, 'exit_pump_bull_u_5'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 40.0):
+ return True, 'exit_pump_bull_u_6'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'exit_pump_bull_u_7'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_pump_bull_u_8'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_pump_bull_u_9'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'exit_pump_bull_u_10'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_pump_bull_u_11'
+ elif current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_pump_bull_u_12'
+
+ return False, None
+
+ def exit_pump_bull_r(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['r_480'] > -0.1):
+ return True, 'exit_pump_bull_w_0_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_pump_bull_w_0_2'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['r_480'] > -0.2):
+ return True, 'exit_pump_bull_w_1_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_pump_bull_w_1_2'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['r_480'] > -0.3):
+ return True, 'exit_pump_bull_w_2_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_pump_bull_w_2_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['r_480'] > -0.4):
+ return True, 'exit_pump_bull_w_3_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_pump_bull_w_3_2'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['r_480'] > -0.5):
+ return True, 'exit_pump_bull_w_4_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_pump_bull_w_4_2'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['r_480'] > -0.6):
+ return True, 'exit_pump_bull_w_5_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_pump_bull_w_5_2'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['r_480'] > -0.7):
+ return True, 'exit_pump_bull_w_6_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_pump_bull_w_6_2'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['r_480'] > -0.8):
+ return True, 'exit_pump_bull_w_7_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_pump_bull_w_7_2'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['r_480'] > -0.9):
+ return True, 'exit_pump_bull_w_8_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_pump_bull_w_8_2'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['r_480'] > -1.0):
+ return True, 'exit_pump_bull_w_9_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_pump_bull_w_9_2'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['r_480'] > -1.1):
+ return True, 'exit_pump_bull_w_10_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_pump_bull_w_10_2'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['r_480'] > -0.4):
+ return True, 'exit_pump_bull_w_11_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_pump_bull_w_11_2'
+ elif current_profit >= 0.2:
+ if (last_candle['r_480'] > -0.2):
+ return True, 'exit_pump_bull_w_12_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 80.0):
+ return True, 'exit_pump_bull_w_12_2'
+
+ return False, None
+
+ def exit_pump_bull_stoploss(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ is_backtest = self.dp.runmode.value == 'backtest'
+ # Stoploss doom
+ if (
+ (self.stop_thresholds_pump[10])
+ and (current_profit < self.stop_thresholds_pump[0])
+ ):
+ return True, 'exit_pump_bull_stoploss_doom'
+
+ # Under & near EMA200, local uptrend move
+ if (
+ (self.stop_thresholds_pump[12])
+ and (current_profit < self.stop_thresholds_pump[2])
+ and (last_candle['close'] < last_candle['ema_200'])
+ and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.stop_thresholds_pump[6])
+ and (last_candle['rsi_14'] > previous_candle_1['rsi_14'])
+ and (last_candle['rsi_14'] > (last_candle['rsi_14_1h'] + self.stop_thresholds_pump[8]))
+ and (current_time - timedelta(minutes=self.stop_thresholds_pump[4]) > trade.open_date_utc)
+ # temporary
+ and (trade.open_date_utc.replace(tzinfo=None) >= datetime(2022, 12, 25) or is_backtest)
+ ):
+ return True, 'exit_pump_bull_stoploss_u_e'
+
+ return False, None
+
+ def exit_pump_bear(self, pair: str, current_rate: float, current_profit: float,
+ max_profit: float, max_loss: float,
+ last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5,
+ trade: 'Trade', current_time: 'datetime', enter_tags) -> tuple:
+ sell = False
+
+ # Original sell signals
+ sell, signal_name = self.exit_pump_bear_signals(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Main sell signals
+ if not sell:
+ sell, signal_name = self.exit_pump_bear_main(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Williams %R based sells
+ if not sell:
+ sell, signal_name = self.exit_pump_bear_r(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Stoplosses
+ if not sell:
+ sell, signal_name = self.exit_pump_bear_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Profit Target Signal
+ # Check if pair exist on target_profit_cache
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_rate = self.target_profit_cache.data[pair]['rate']
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ previous_sell_reason = self.target_profit_cache.data[pair]['sell_reason']
+ previous_time_profit_reached = datetime.fromisoformat(self.target_profit_cache.data[pair]['time_profit_reached'])
+
+ sell_max, signal_name_max = self.pump_bear_exit_profit_target(pair, trade, current_time, current_rate, current_profit,
+ last_candle, previous_candle_1,
+ previous_rate, previous_profit, previous_sell_reason,
+ previous_time_profit_reached, enter_tags)
+ if sell_max and signal_name_max is not None:
+ return True, f"{signal_name_max}_m"
+ if (current_profit > (previous_profit + 0.005)) and (previous_sell_reason not in ["exit_pump_bear_stoploss_doom"]):
+ # Update the target, raise it.
+ mark_pair, mark_signal = self.pump_bear_mark_profit_target(pair, True, previous_sell_reason, trade, current_time, current_rate, current_profit, last_candle, previous_candle_1)
+ if mark_pair:
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+
+ # Add the pair to the list, if a sell triggered and conditions met
+ if sell and signal_name is not None:
+ previous_profit = None
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ if (
+ (previous_profit is None)
+ or (previous_profit < current_profit)
+ ):
+ mark_pair, mark_signal = self.pump_bear_mark_profit_target(pair, sell, signal_name, trade, current_time, current_rate, current_profit, last_candle, previous_candle_1)
+ if mark_pair:
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+ else:
+ # Just sell it, without maximize
+ return True, f"{signal_name}"
+ else:
+ if (
+ (current_profit >= 0.01)
+ ):
+ previous_profit = None
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ if (previous_profit is None) or (previous_profit < current_profit):
+ mark_signal = "exit_profit_pump_bear_max"
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+
+ if (signal_name not in ["exit_profit_pump_bear_max", "exit_pump_bear_stoploss_doom"]):
+ if sell and (signal_name is not None):
+ return True, f"{signal_name}"
+
+ return False, None
+
+ def pump_bear_mark_profit_target(self, pair: str, sell: bool, signal_name: str, trade: Trade, current_time: datetime, current_rate: float, current_profit: float, last_candle, previous_candle_1) -> tuple:
+ if sell and (signal_name is not None):
+ return pair, signal_name
+
+ return None, None
+
+ def pump_bear_exit_profit_target(self, pair: str, trade: Trade, current_time: datetime, current_rate: float, current_profit: float, last_candle, previous_candle_1, previous_rate, previous_profit, previous_sell_reason, previous_time_profit_reached, enter_tags) -> tuple:
+ if (previous_sell_reason in ["exit_pump_bear_stoploss_doom"]):
+ if (current_profit > 0.04):
+ # profit is over the threshold, don't exit
+ self._remove_profit_target(pair)
+ return False, None
+ if (current_profit < -0.18):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (current_profit < -0.1):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (current_profit < -0.04):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ else:
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (previous_sell_reason in ["exit_pump_bear_stoploss_u_e"]):
+ if (current_profit > 0.04):
+ # profit is over the threshold, don't exit
+ self._remove_profit_target(pair)
+ return False, None
+ if (current_profit < (previous_profit - 0.01)):
+ return True, previous_sell_reason
+ elif (previous_sell_reason in ["exit_profit_pump_bear_max"]):
+ if (current_profit < -0.08):
+ # profit is under the threshold, cancel
+ self._remove_profit_target(pair)
+ return False, None
+ if (0.001 <= current_profit < 0.01):
+ if (current_profit < (previous_profit - 0.01)):
+ return True, previous_sell_reason
+ elif (0.01 <= current_profit < 0.02):
+ if (current_profit < (previous_profit - 0.02)):
+ return True, previous_sell_reason
+ elif (0.02 <= current_profit < 0.03):
+ if (current_profit < (previous_profit - 0.03)):
+ return True, previous_sell_reason
+ elif (0.03 <= current_profit < 0.05):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (0.05 <= current_profit < 0.08):
+ if (current_profit < (previous_profit - 0.05)):
+ return True, previous_sell_reason
+ elif (0.08 <= current_profit < 0.12):
+ if (current_profit < (previous_profit - 0.06)):
+ return True, previous_sell_reason
+ elif (0.12 <= current_profit):
+ if (current_profit < (previous_profit - 0.07)):
+ return True, previous_sell_reason
+ else:
+ return False, None
+
+ return False, None
+
+ def exit_pump_bear_signals(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ # Sell signal 1
+ if (last_candle['rsi_14'] > 78.0) and (last_candle['rsi_14_4h'] > 75.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) and (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_pump_bear_1_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_pump_bear_1_2_1'
+
+ # Sell signal 2
+ elif (last_candle['rsi_14'] > 79.0) and (last_candle['rsi_14_4h'] > 75.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_pump_bear_2_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_pump_bear_2_2_1'
+
+ # Sell signal 3
+ elif (last_candle['rsi_14'] > 84.0) and (last_candle['rsi_14_4h'] > 75.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_pump_bear_3_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_pump_bear_3_2_1'
+
+ # Sell signal 4
+ elif (last_candle['rsi_14'] > 79.0) and (last_candle['rsi_14_1h'] > 79.0) and (last_candle['rsi_14_4h'] > 75.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_pump_bear_4_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_pump_bear_4_2_1'
+
+ # Sell signal 6
+ elif (last_candle['close'] < last_candle['ema_200']) and (last_candle['close'] > last_candle['ema_50']) and (last_candle['rsi_14'] > 78.5):
+ if (current_profit > 0.01):
+ return True, 'exit_pump_bear_6_1'
+
+ # Sell signal 7
+ elif (last_candle['rsi_14_1h'] > 79.0) and (last_candle['crossed_below_ema_12_26']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_pump_bear_7_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_pump_bear_7_2_1'
+
+ # Sell signal 8
+ elif (last_candle['close'] > last_candle['bb20_2_upp_1h'] * 1.07) and (last_candle['rsi_14_4h'] > 75.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_pump_bear_8_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_pump_bear_8_2_1'
+
+ return False, None
+
+ def exit_pump_bear_main(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ if (last_candle['close'] > last_candle['sma_200_1h']):
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['rsi_14'] < 22.0):
+ return True, 'exit_pump_bear_o_0'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 30.0):
+ return True, 'exit_pump_bear_o_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 32.0):
+ return True, 'exit_pump_bear_o_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 34.0):
+ return True, 'exit_pump_bear_o_3'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 36.0):
+ return True, 'exit_pump_bear_o_4'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 38.0):
+ return True, 'exit_pump_bear_o_5'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 40.0):
+ return True, 'exit_pump_bear_o_6'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'exit_pump_bear_o_7'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_pump_bear_o_8'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_pump_bear_o_9'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'exit_pump_bear_o_10'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_pump_bear_o_11'
+ elif current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_pump_bear_o_12'
+ elif (last_candle['close'] < last_candle['sma_200_1h']):
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['rsi_14'] < 24.0):
+ return True, 'exit_pump_bear_u_0'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 32.0):
+ return True, 'exit_pump_bear_u_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 34.0):
+ return True, 'exit_pump_bear_u_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 36.0):
+ return True, 'exit_pump_bear_u_3'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 38.0):
+ return True, 'exit_pump_bear_u_4'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 40.0):
+ return True, 'exit_pump_bear_u_5'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'exit_pump_bear_u_6'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_pump_bear_u_7'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_pump_bear_u_8'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'exit_pump_bear_u_9'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 50.0):
+ return True, 'exit_pump_bear_u_10'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'exit_pump_bear_u_11'
+ elif current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_pump_bear_u_12'
+
+ return False, None
+
+ def exit_pump_bear_r(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['r_480'] > -0.1):
+ return True, 'exit_pump_bear_w_0_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_pump_bear_w_0_2'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['r_480'] > -0.2):
+ return True, 'exit_pump_bear_w_1_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_pump_bear_w_1_2'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['r_480'] > -0.3):
+ return True, 'exit_pump_bear_w_2_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_pump_bear_w_2_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['r_480'] > -0.4):
+ return True, 'exit_pump_bear_w_3_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_pump_bear_w_3_2'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['r_480'] > -0.5):
+ return True, 'exit_pump_bear_w_4_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_pump_bear_w_4_2'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['r_480'] > -0.6):
+ return True, 'exit_pump_bear_w_5_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_pump_bear_w_5_2'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['r_480'] > -0.7):
+ return True, 'exit_pump_bear_w_6_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_pump_bear_w_6_2'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['r_480'] > -0.8):
+ return True, 'exit_pump_bear_w_7_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_pump_bear_w_7_2'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['r_480'] > -0.9):
+ return True, 'exit_pump_bear_w_8_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_pump_bear_w_8_2'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['r_480'] > -1.0):
+ return True, 'exit_pump_bear_w_9_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_pump_bear_w_9_2'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['r_480'] > -1.1):
+ return True, 'exit_pump_bear_w_10_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_pump_bear_w_10_2'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['r_480'] > -0.4):
+ return True, 'exit_pump_bear_w_11_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_pump_bear_w_11_2'
+ elif current_profit >= 0.2:
+ if (last_candle['r_480'] > -0.2):
+ return True, 'exit_pump_bear_w_12_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 80.0):
+ return True, 'exit_pump_bear_w_12_2'
+
+ return False, None
+
+ def exit_pump_bear_stoploss(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ is_backtest = self.dp.runmode.value == 'backtest'
+ # Stoploss doom
+ if (
+ (self.stop_thresholds_pump[11])
+ and (current_profit < self.stop_thresholds_pump[1])
+ ):
+ return True, 'exit_pump_bear_stoploss_doom'
+
+ # Under & near EMA200, local uptrend move
+ if (
+ (self.stop_thresholds_pump[13])
+ and (current_profit < self.stop_thresholds_pump[3])
+ and (last_candle['close'] < last_candle['ema_200'])
+ and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.stop_thresholds_pump[7])
+ and (last_candle['rsi_14'] > previous_candle_1['rsi_14'])
+ and (last_candle['rsi_14'] > (last_candle['rsi_14_1h'] + self.stop_thresholds_pump[9]))
+ and (current_time - timedelta(minutes=self.stop_thresholds_pump[5]) > trade.open_date_utc)
+ # temporary
+ and (trade.open_date_utc.replace(tzinfo=None) >= datetime(2022, 12, 25) or is_backtest)
+ ):
+ return True, 'exit_pump_bear_stoploss_u_e'
+
+ return False, None
+
+ def exit_quick_bull(self, pair: str, current_rate: float, current_profit: float,
+ max_profit: float, max_loss: float,
+ last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5,
+ trade: 'Trade', current_time: 'datetime', enter_tags) -> tuple:
+ sell = False
+
+ # Original sell signals
+ sell, signal_name = self.exit_quick_bull_signals(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Main sell signals
+ if not sell:
+ sell, signal_name = self.exit_quick_bull_main(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Williams %R based sells
+ if not sell:
+ sell, signal_name = self.exit_quick_bull_r(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Stoplosses
+ if not sell:
+ sell, signal_name = self.exit_quick_bull_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Extra sell logic
+ if not sell:
+ if (0.09 >= current_profit > 0.02) and (last_candle['rsi_14'] > 78.0):
+ sell, signal_name = True, 'exit_quick_bull_q_1'
+
+ if (0.09 >= current_profit > 0.02) and (last_candle['cti_20'] > 0.95):
+ sell, signal_name = True, 'exit_quick_bull_q_2'
+
+ if (0.09 >= current_profit > 0.02) and (last_candle['r_14'] >= -0.1):
+ sell, signal_name = True, 'exit_quick_bull_q_3'
+
+ # Profit Target Signal
+ # Check if pair exist on target_profit_cache
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_rate = self.target_profit_cache.data[pair]['rate']
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ previous_sell_reason = self.target_profit_cache.data[pair]['sell_reason']
+ previous_time_profit_reached = datetime.fromisoformat(self.target_profit_cache.data[pair]['time_profit_reached'])
+
+ sell_max, signal_name_max = self.quick_bull_exit_profit_target(pair, trade, current_time, current_rate, current_profit,
+ last_candle, previous_candle_1,
+ previous_rate, previous_profit, previous_sell_reason,
+ previous_time_profit_reached, enter_tags)
+ if sell_max and signal_name_max is not None:
+ return True, f"{signal_name_max}_m"
+ if (current_profit > (previous_profit + 0.005)) and (previous_sell_reason not in ["exit_quick_bull_stoploss_doom"]):
+ # Update the target, raise it.
+ mark_pair, mark_signal = self.quick_bull_mark_profit_target(pair, True, previous_sell_reason, trade, current_time, current_rate, current_profit, last_candle, previous_candle_1)
+ if mark_pair:
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+
+ # Add the pair to the list, if a sell triggered and conditions met
+ if sell and signal_name is not None:
+ previous_profit = None
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ if (
+ (previous_profit is None)
+ or (previous_profit < current_profit)
+ ):
+ mark_pair, mark_signal = self.quick_bull_mark_profit_target(pair, sell, signal_name, trade, current_time, current_rate, current_profit, last_candle, previous_candle_1)
+ if mark_pair:
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+ else:
+ # Just sell it, without maximize
+ return True, f"{signal_name}"
+ else:
+ if (
+ (current_profit >= 0.01)
+ ):
+ previous_profit = None
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ if (previous_profit is None) or (previous_profit < current_profit):
+ mark_signal = "exit_profit_quick_bull_max"
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+
+ if (signal_name not in ["exit_profit_quick_bull_max", "exit_quick_bull_stoploss_doom", "exit_quick_bull_stoploss_u_e"]):
+ if sell and (signal_name is not None):
+ return True, f"{signal_name}"
+
+ return False, None
+
+ def quick_bull_mark_profit_target(self, pair: str, sell: bool, signal_name: str, trade: Trade, current_time: datetime, current_rate: float, current_profit: float, last_candle, previous_candle_1) -> tuple:
+ if sell and (signal_name is not None):
+ return pair, signal_name
+
+ return None, None
+
+ def quick_bull_exit_profit_target(self, pair: str, trade: Trade, current_time: datetime, current_rate: float, current_profit: float, last_candle, previous_candle_1, previous_rate, previous_profit, previous_sell_reason, previous_time_profit_reached, enter_tags) -> tuple:
+ if (previous_sell_reason in ["exit_quick_bull_stoploss_doom"]):
+ if (current_profit > 0.04):
+ # profit is over the threshold, don't exit
+ self._remove_profit_target(pair)
+ return False, None
+ if (current_profit < -0.18):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (current_profit < -0.1):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (current_profit < -0.04):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ else:
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (previous_sell_reason in ["exit_quick_bull_stoploss_u_e"]):
+ if (current_profit > 0.04):
+ # profit is over the threshold, don't exit
+ self._remove_profit_target(pair)
+ return False, None
+ if (current_profit < (previous_profit - 0.01)):
+ return True, previous_sell_reason
+ elif (previous_sell_reason in ["exit_profit_quick_bull_max"]):
+ if (current_profit < -0.08):
+ # profit is under the threshold, cancel
+ self._remove_profit_target(pair)
+ return False, None
+ if (0.001 <= current_profit < 0.01):
+ if (current_profit < (previous_profit - 0.01)):
+ return True, previous_sell_reason
+ elif (0.01 <= current_profit < 0.02):
+ if (current_profit < (previous_profit - 0.02)):
+ return True, previous_sell_reason
+ elif (0.02 <= current_profit < 0.03):
+ if (current_profit < (previous_profit - 0.03)):
+ return True, previous_sell_reason
+ elif (0.03 <= current_profit < 0.05):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (0.05 <= current_profit < 0.08):
+ if (current_profit < (previous_profit - 0.05)):
+ return True, previous_sell_reason
+ elif (0.08 <= current_profit < 0.12):
+ if (current_profit < (previous_profit - 0.06)):
+ return True, previous_sell_reason
+ elif (0.12 <= current_profit):
+ if (current_profit < (previous_profit - 0.07)):
+ return True, previous_sell_reason
+ else:
+ return False, None
+
+ return False, None
+
+ def exit_quick_bull_signals(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ # Sell signal 1
+ if (last_candle['rsi_14'] > 79.0) and (last_candle['rsi_14_4h'] > 75.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) and (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_quick_bull_1_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_quick_bull_1_2_1'
+
+ # Sell signal 2
+ elif (last_candle['rsi_14'] > 80.0) and (last_candle['rsi_14_4h'] > 75.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_quick_bull_2_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_quick_bull_2_2_1'
+
+ # Sell signal 3
+ elif (last_candle['rsi_14'] > 85.0) and (last_candle['rsi_14_4h'] > 75.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_quick_bull_3_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_quick_bull_3_2_1'
+
+ # Sell signal 4
+ elif (last_candle['rsi_14'] > 80.0) and (last_candle['rsi_14_1h'] > 80.0) and (last_candle['rsi_14_4h'] > 75.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_quick_bull_4_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_quick_bull_4_2_1'
+
+ # Sell signal 6
+ elif (last_candle['close'] < last_candle['ema_200']) and (last_candle['close'] > last_candle['ema_50']) and (last_candle['rsi_14'] > 79.0):
+ if (current_profit > 0.01):
+ return True, 'exit_quick_bull_6_1'
+
+ # Sell signal 7
+ elif (last_candle['rsi_14_1h'] > 79.0) and (last_candle['crossed_below_ema_12_26']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_quick_bull_7_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_quick_bull_7_2_1'
+
+ # Sell signal 8
+ elif (last_candle['rsi_14_4h'] > 75.0) and (last_candle['close'] > last_candle['bb20_2_upp_1h'] * 1.08):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_quick_bull_8_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_quick_bull_8_2_1'
+
+ return False, None
+
+ def exit_quick_bull_main(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ if (last_candle['close'] > last_candle['sma_200_1h']):
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['rsi_14'] < 20.0):
+ return True, 'exit_quick_bull_o_0'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 28.0):
+ return True, 'exit_quick_bull_o_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 30.0):
+ return True, 'exit_quick_bull_o_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 32.0):
+ return True, 'exit_quick_bull_o_3'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 34.0):
+ return True, 'exit_quick_bull_o_4'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 36.0):
+ return True, 'exit_quick_bull_o_5'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 38.0):
+ return True, 'exit_quick_bull_o_6'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 40.0):
+ return True, 'exit_quick_bull_o_7'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'exit_quick_bull_o_8'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_quick_bull_o_9'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_quick_bull_o_10'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_quick_bull_o_11'
+ elif current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'exit_quick_bull_o_12'
+ elif (last_candle['close'] < last_candle['sma_200_1h']):
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['rsi_14'] < 22.0):
+ return True, 'exit_quick_bull_u_0'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 30.0):
+ return True, 'exit_quick_bull_u_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 32.0):
+ return True, 'exit_quick_bull_u_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 34.0):
+ return True, 'exit_quick_bull_u_3'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 36.0):
+ return True, 'exit_quick_bull_u_4'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 38.0):
+ return True, 'exit_quick_bull_u_5'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 40.0):
+ return True, 'exit_quick_bull_u_6'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'exit_quick_bull_u_7'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_quick_bull_u_8'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_quick_bull_u_9'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'exit_quick_bull_u_10'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_quick_bull_u_11'
+ elif current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_quick_bull_u_12'
+
+ return False, None
+
+ def exit_quick_bull_r(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['r_480'] > -0.1):
+ return True, 'exit_quick_bull_w_0_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_quick_bull_w_0_2'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['r_480'] > -0.2):
+ return True, 'exit_quick_bull_w_1_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_quick_bull_w_1_2'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['r_480'] > -0.3):
+ return True, 'exit_quick_bull_w_2_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_quick_bull_w_2_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['r_480'] > -0.4):
+ return True, 'exit_quick_bull_w_3_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_quick_bull_w_3_2'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['r_480'] > -0.5):
+ return True, 'exit_quick_bull_w_4_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_quick_bull_w_4_2'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['r_480'] > -0.6):
+ return True, 'exit_quick_bull_w_5_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_quick_bull_w_5_2'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['r_480'] > -0.7):
+ return True, 'exit_quick_bull_w_6_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_quick_bull_w_6_2'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['r_480'] > -0.8):
+ return True, 'exit_quick_bull_w_7_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_quick_bull_w_7_2'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['r_480'] > -0.9):
+ return True, 'exit_quick_bull_w_8_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_quick_bull_w_8_2'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['r_480'] > -1.0):
+ return True, 'exit_quick_bull_w_9_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_quick_bull_w_9_2'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['r_480'] > -1.1):
+ return True, 'exit_quick_bull_w_10_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_quick_bull_w_10_2'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['r_480'] > -0.4):
+ return True, 'exit_quick_bull_w_11_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_quick_bull_w_11_2'
+ elif current_profit >= 0.2:
+ if (last_candle['r_480'] > -0.2):
+ return True, 'exit_quick_bull_w_12_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 80.0):
+ return True, 'exit_quick_bull_w_12_2'
+
+ return False, None
+
+ def exit_quick_bull_stoploss(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ is_backtest = self.dp.runmode.value == 'backtest'
+ # Stoploss doom
+ if (
+ (self.stop_thresholds_quick[10])
+ and (current_profit < self.stop_thresholds_quick[0])
+ ):
+ return True, 'exit_quick_bull_stoploss_doom'
+
+ # Under & near EMA200, local uptrend move
+ if (
+ (self.stop_thresholds_quick[12])
+ and (current_profit < self.stop_thresholds_quick[2])
+ and (last_candle['close'] < last_candle['ema_200'])
+ and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.stop_thresholds_quick[6])
+ and (last_candle['rsi_14'] > previous_candle_1['rsi_14'])
+ and (last_candle['rsi_14'] > (last_candle['rsi_14_1h'] + self.stop_thresholds_quick[8]))
+ and (current_time - timedelta(minutes=self.stop_thresholds_quick[4]) > trade.open_date_utc)
+ # temporary
+ and (trade.open_date_utc.replace(tzinfo=None) >= datetime(2022, 12, 25) or is_backtest)
+ ):
+ return True, 'exit_quick_bull_stoploss_u_e'
+
+ return False, None
+
+ def exit_quick_bear(self, pair: str, current_rate: float, current_profit: float,
+ max_profit: float, max_loss: float,
+ last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5,
+ trade: 'Trade', current_time: 'datetime', enter_tags) -> tuple:
+ sell = False
+
+ # Original sell signals
+ sell, signal_name = self.exit_quick_bear_signals(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Main sell signals
+ if not sell:
+ sell, signal_name = self.exit_quick_bear_main(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Williams %R based sells
+ if not sell:
+ sell, signal_name = self.exit_quick_bear_r(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Stoplosses
+ if not sell:
+ sell, signal_name = self.exit_quick_bear_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Extra sell logic
+ if not sell:
+ if (0.09 >= current_profit > 0.02) and (last_candle['rsi_14'] > 78.0):
+ sell, signal_name = True, 'exit_quick_bear_q_1'
+
+ if (0.09 >= current_profit > 0.02) and (last_candle['cti_20'] > 0.95):
+ sell, signal_name = True, 'exit_quick_bear_q_2'
+
+ if (0.09 >= current_profit > 0.02) and (last_candle['r_14'] >= -0.1):
+ sell, signal_name = True, 'exit_quick_bear_q_3'
+
+ # Profit Target Signal
+ # Check if pair exist on target_profit_cache
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_rate = self.target_profit_cache.data[pair]['rate']
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ previous_sell_reason = self.target_profit_cache.data[pair]['sell_reason']
+ previous_time_profit_reached = datetime.fromisoformat(self.target_profit_cache.data[pair]['time_profit_reached'])
+
+ sell_max, signal_name_max = self.quick_bear_exit_profit_target(pair, trade, current_time, current_rate, current_profit,
+ last_candle, previous_candle_1,
+ previous_rate, previous_profit, previous_sell_reason,
+ previous_time_profit_reached, enter_tags)
+ if sell_max and signal_name_max is not None:
+ return True, f"{signal_name_max}_m"
+ if (current_profit > (previous_profit + 0.005)) and (previous_sell_reason not in ["exit_quick_bear_stoploss_doom"]):
+ # Update the target, raise it.
+ mark_pair, mark_signal = self.quick_bear_mark_profit_target(pair, True, previous_sell_reason, trade, current_time, current_rate, current_profit, last_candle, previous_candle_1)
+ if mark_pair:
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+
+ # Add the pair to the list, if a sell triggered and conditions met
+ if sell and signal_name is not None:
+ previous_profit = None
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ if (
+ (previous_profit is None)
+ or (previous_profit < current_profit)
+ ):
+ mark_pair, mark_signal = self.quick_bear_mark_profit_target(pair, sell, signal_name, trade, current_time, current_rate, current_profit, last_candle, previous_candle_1)
+ if mark_pair:
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+ else:
+ # Just sell it, without maximize
+ return True, f"{signal_name}"
+ else:
+ if (
+ (current_profit >= 0.01)
+ ):
+ previous_profit = None
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ if (previous_profit is None) or (previous_profit < current_profit):
+ mark_signal = "exit_profit_quick_bear_max"
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+
+ if (signal_name not in ["exit_profit_quick_bear_max", "exit_quick_bear_stoploss_doom", "exit_quick_bear_stoploss_u_e"]):
+ if sell and (signal_name is not None):
+ return True, f"{signal_name}"
+
+ return False, None
+
+ def quick_bear_mark_profit_target(self, pair: str, sell: bool, signal_name: str, trade: Trade, current_time: datetime, current_rate: float, current_profit: float, last_candle, previous_candle_1) -> tuple:
+ if sell and (signal_name is not None):
+ return pair, signal_name
+
+ return None, None
+
+ def quick_bear_exit_profit_target(self, pair: str, trade: Trade, current_time: datetime, current_rate: float, current_profit: float, last_candle, previous_candle_1, previous_rate, previous_profit, previous_sell_reason, previous_time_profit_reached, enter_tags) -> tuple:
+ if (previous_sell_reason in ["exit_quick_bear_stoploss_doom"]):
+ if (current_profit > 0.04):
+ # profit is over the threshold, don't exit
+ self._remove_profit_target(pair)
+ return False, None
+ if (current_profit < -0.18):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (current_profit < -0.1):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (current_profit < -0.04):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ else:
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (previous_sell_reason in ["exit_quick_bear_stoploss_u_e"]):
+ if (current_profit > 0.04):
+ # profit is over the threshold, don't exit
+ self._remove_profit_target(pair)
+ return False, None
+ if (current_profit < (previous_profit - 0.01)):
+ return True, previous_sell_reason
+ elif (previous_sell_reason in ["exit_profit_quick_bear_max"]):
+ if (current_profit < -0.08):
+ # profit is under the threshold, cancel
+ self._remove_profit_target(pair)
+ return False, None
+ if (0.001 <= current_profit < 0.01):
+ if (current_profit < (previous_profit - 0.01)):
+ return True, previous_sell_reason
+ elif (0.01 <= current_profit < 0.02):
+ if (current_profit < (previous_profit - 0.02)):
+ return True, previous_sell_reason
+ elif (0.02 <= current_profit < 0.03):
+ if (current_profit < (previous_profit - 0.03)):
+ return True, previous_sell_reason
+ elif (0.03 <= current_profit < 0.05):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (0.05 <= current_profit < 0.08):
+ if (current_profit < (previous_profit - 0.05)):
+ return True, previous_sell_reason
+ elif (0.08 <= current_profit < 0.12):
+ if (current_profit < (previous_profit - 0.06)):
+ return True, previous_sell_reason
+ elif (0.12 <= current_profit):
+ if (current_profit < (previous_profit - 0.07)):
+ return True, previous_sell_reason
+ else:
+ return False, None
+
+ return False, None
+
+ def exit_quick_bear_signals(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ # Sell signal 1
+ if (last_candle['rsi_14'] > 78.0) and (last_candle['rsi_14_4h'] > 75.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) and (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_quick_bear_1_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_quick_bear_1_2_1'
+
+ # Sell signal 2
+ elif (last_candle['rsi_14'] > 79.0) and (last_candle['rsi_14_4h'] > 75.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_quick_bear_2_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_quick_bear_2_2_1'
+
+ # Sell signal 3
+ elif (last_candle['rsi_14'] > 84.0) and (last_candle['rsi_14_4h'] > 75.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_quick_bear_3_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_quick_bear_3_2_1'
+
+ # Sell signal 4
+ elif (last_candle['rsi_14'] > 79.0) and (last_candle['rsi_14_1h'] > 79.0) and (last_candle['rsi_14_4h'] > 75.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_quick_bear_4_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_quick_bear_4_2_1'
+
+ # Sell signal 6
+ elif (last_candle['close'] < last_candle['ema_200']) and (last_candle['close'] > last_candle['ema_50']) and (last_candle['rsi_14'] > 78.5):
+ if (current_profit > 0.01):
+ return True, 'exit_quick_bear_6_1'
+
+ # Sell signal 7
+ elif (last_candle['rsi_14_1h'] > 79.0) and (last_candle['crossed_below_ema_12_26']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_quick_bear_7_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_quick_bear_7_2_1'
+
+ # Sell signal 8
+ elif (last_candle['close'] > last_candle['bb20_2_upp_1h'] * 1.07) and (last_candle['rsi_14_4h'] > 75.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_quick_bear_8_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_quick_bear_8_2_1'
+
+ return False, None
+
+ def exit_quick_bear_main(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ if (last_candle['close'] > last_candle['sma_200_1h']):
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['rsi_14'] < 22.0):
+ return True, 'exit_quick_bear_o_0'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 30.0):
+ return True, 'exit_quick_bear_o_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 32.0):
+ return True, 'exit_quick_bear_o_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 34.0):
+ return True, 'exit_quick_bear_o_3'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 36.0):
+ return True, 'exit_quick_bear_o_4'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 38.0):
+ return True, 'exit_quick_bear_o_5'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 40.0):
+ return True, 'exit_quick_bear_o_6'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'exit_quick_bear_o_7'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_quick_bear_o_8'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_quick_bear_o_9'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'exit_quick_bear_o_10'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_quick_bear_o_11'
+ elif current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_quick_bear_o_12'
+ elif (last_candle['close'] < last_candle['sma_200_1h']):
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['rsi_14'] < 24.0):
+ return True, 'exit_quick_bear_u_0'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 32.0):
+ return True, 'exit_quick_bear_u_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 34.0):
+ return True, 'exit_quick_bear_u_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 36.0):
+ return True, 'exit_quick_bear_u_3'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 38.0):
+ return True, 'exit_quick_bear_u_4'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 40.0):
+ return True, 'exit_quick_bear_u_5'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'exit_quick_bear_u_6'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_quick_bear_u_7'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_quick_bear_u_8'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'exit_quick_bear_u_9'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 50.0):
+ return True, 'exit_quick_bear_u_10'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'exit_quick_bear_u_11'
+ elif current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_quick_bear_u_12'
+
+ return False, None
+
+ def exit_quick_bear_r(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['r_480'] > -0.1):
+ return True, 'exit_quick_bear_w_0_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_quick_bear_w_0_2'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['r_480'] > -0.2):
+ return True, 'exit_quick_bear_w_1_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_quick_bear_w_1_2'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['r_480'] > -0.3):
+ return True, 'exit_quick_bear_w_2_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_quick_bear_w_2_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['r_480'] > -0.4):
+ return True, 'exit_quick_bear_w_3_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_quick_bear_w_3_2'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['r_480'] > -0.5):
+ return True, 'exit_quick_bear_w_4_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_quick_bear_w_4_2'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['r_480'] > -0.6):
+ return True, 'exit_quick_bear_w_5_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_quick_bear_w_5_2'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['r_480'] > -0.7):
+ return True, 'exit_quick_bear_w_6_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_quick_bear_w_6_2'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['r_480'] > -0.8):
+ return True, 'exit_quick_bear_w_7_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_quick_bear_w_7_2'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['r_480'] > -0.9):
+ return True, 'exit_quick_bear_w_8_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_quick_bear_w_8_2'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['r_480'] > -1.0):
+ return True, 'exit_quick_bear_w_9_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_quick_bear_w_9_2'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['r_480'] > -1.1):
+ return True, 'exit_quick_bear_w_10_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_quick_bear_w_10_2'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['r_480'] > -0.4):
+ return True, 'exit_quick_bear_w_11_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_quick_bear_w_11_2'
+ elif current_profit >= 0.2:
+ if (last_candle['r_480'] > -0.2):
+ return True, 'exit_quick_bear_w_12_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 80.0):
+ return True, 'exit_quick_bear_w_12_2'
+
+ return False, None
+
+ def exit_quick_bear_stoploss(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ is_backtest = self.dp.runmode.value == 'backtest'
+ # Stoploss doom
+ if (
+ (self.stop_thresholds_quick[11])
+ and (current_profit < self.stop_thresholds_quick[1])
+ ):
+ return True, 'exit_quick_bear_stoploss_doom'
+
+ # Under & near EMA200, local uptrend move
+ if (
+ (self.stop_thresholds_quick[13])
+ and (current_profit < self.stop_thresholds_quick[3])
+ and (last_candle['close'] < last_candle['ema_200'])
+ and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.stop_thresholds_quick[7])
+ and (last_candle['rsi_14'] > previous_candle_1['rsi_14'])
+ and (last_candle['rsi_14'] > (last_candle['rsi_14_1h'] + self.stop_thresholds_quick[9]))
+ and (current_time - timedelta(minutes=self.stop_thresholds_quick[5]) > trade.open_date_utc)
+ # temporary
+ and (trade.open_date_utc.replace(tzinfo=None) >= datetime(2022, 12, 25) or is_backtest)
+ ):
+ return True, 'exit_quick_bear_stoploss_u_e'
+
+ return False, None
+
+ def exit_rebuy_bull(self, pair: str, current_rate: float, current_profit: float,
+ max_profit: float, max_loss: float,
+ last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5,
+ trade: 'Trade', current_time: 'datetime', enter_tags) -> tuple:
+ sell = False
+
+ # Original sell signals
+ sell, signal_name = self.exit_rebuy_bull_signals(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Main sell signals
+ if not sell:
+ sell, signal_name = self.exit_rebuy_bull_main(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Williams %R based sells
+ if not sell:
+ sell, signal_name = self.exit_rebuy_bull_r(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Stoplosses
+ if not sell:
+ sell, signal_name = self.exit_rebuy_bull_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Profit Target Signal
+ # Check if pair exist on target_profit_cache
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_rate = self.target_profit_cache.data[pair]['rate']
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ previous_sell_reason = self.target_profit_cache.data[pair]['sell_reason']
+ previous_time_profit_reached = datetime.fromisoformat(self.target_profit_cache.data[pair]['time_profit_reached'])
+
+ sell_max, signal_name_max = self.rebuy_bull_exit_profit_target(pair, trade, current_time, current_rate, current_profit,
+ last_candle, previous_candle_1,
+ previous_rate, previous_profit, previous_sell_reason,
+ previous_time_profit_reached, enter_tags)
+ if sell_max and signal_name_max is not None:
+ return True, f"{signal_name_max}_m"
+ if (current_profit > (previous_profit + 0.005)) and (previous_sell_reason not in ["exit_rebuy_bull_stoploss_doom"]):
+ # Update the target, raise it.
+ mark_pair, mark_signal = self.rebuy_bull_mark_profit_target(pair, True, previous_sell_reason, trade, current_time, current_rate, current_profit, last_candle, previous_candle_1)
+ if mark_pair:
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+
+ # Add the pair to the list, if a sell triggered and conditions met
+ if sell and signal_name is not None:
+ previous_profit = None
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ if (
+ (previous_profit is None)
+ or (previous_profit < current_profit)
+ ):
+ mark_pair, mark_signal = self.rebuy_bull_mark_profit_target(pair, sell, signal_name, trade, current_time, current_rate, current_profit, last_candle, previous_candle_1)
+ if mark_pair:
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+ else:
+ # Just sell it, without maximize
+ return True, f"{signal_name}"
+ else:
+ if (
+ (current_profit >= 0.01)
+ ):
+ previous_profit = None
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ if (previous_profit is None) or (previous_profit < current_profit):
+ mark_signal = "exit_profit_rebuy_bull_max"
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+
+ if (signal_name not in ["exit_profit_rebuy_bull_max", "exit_rebuy_bull_stoploss_doom", "exit_rebuy_bull_stoploss_u_e"]):
+ if sell and (signal_name is not None):
+ return True, f"{signal_name}"
+
+ return False, None
+
+ def rebuy_bull_mark_profit_target(self, pair: str, sell: bool, signal_name: str, trade: Trade, current_time: datetime, current_rate: float, current_profit: float, last_candle, previous_candle_1) -> tuple:
+ if sell and (signal_name is not None):
+ return pair, signal_name
+
+ return None, None
+
+ def rebuy_bull_exit_profit_target(self, pair: str, trade: Trade, current_time: datetime, current_rate: float, current_profit: float, last_candle, previous_candle_1, previous_rate, previous_profit, previous_sell_reason, previous_time_profit_reached, enter_tags) -> tuple:
+ if (previous_sell_reason in ["exit_rebuy_bull_stoploss_doom"]):
+ if (current_profit > 0.04):
+ # profit is over the threshold, don't exit
+ self._remove_profit_target(pair)
+ return False, None
+ if (current_profit < -0.18):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (current_profit < -0.1):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (current_profit < -0.04):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ else:
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (previous_sell_reason in ["exit_rebuy_bull_stoploss_u_e"]):
+ if (current_profit > 0.04):
+ # profit is over the threshold, don't exit
+ self._remove_profit_target(pair)
+ return False, None
+ if (current_profit < (previous_profit - 0.01)):
+ return True, previous_sell_reason
+ elif (previous_sell_reason in ["exit_profit_rebuy_bull_max"]):
+ if (current_profit < -0.08):
+ # profit is under the threshold, cancel
+ self._remove_profit_target(pair)
+ return False, None
+ if (0.001 <= current_profit < 0.01):
+ if (current_profit < (previous_profit - 0.01)):
+ return True, previous_sell_reason
+ elif (0.01 <= current_profit < 0.02):
+ if (current_profit < (previous_profit - 0.02)):
+ return True, previous_sell_reason
+ elif (0.02 <= current_profit < 0.03):
+ if (current_profit < (previous_profit - 0.03)):
+ return True, previous_sell_reason
+ elif (0.03 <= current_profit < 0.05):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (0.05 <= current_profit < 0.08):
+ if (current_profit < (previous_profit - 0.05)):
+ return True, previous_sell_reason
+ elif (0.08 <= current_profit < 0.12):
+ if (current_profit < (previous_profit - 0.06)):
+ return True, previous_sell_reason
+ elif (0.12 <= current_profit):
+ if (current_profit < (previous_profit - 0.07)):
+ return True, previous_sell_reason
+ else:
+ return False, None
+
+ return False, None
+
+ def exit_rebuy_bull_signals(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ # Sell signal 1
+ if (last_candle['rsi_14'] > 79.0) and (last_candle['rsi_14_4h'] > 75.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) and (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_rebuy_bull_1_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_rebuy_bull_1_2_1'
+
+ # Sell signal 2
+ elif (last_candle['rsi_14'] > 80.0) and (last_candle['rsi_14_4h'] > 75.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_rebuy_bull_2_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_rebuy_bull_2_2_1'
+
+ # Sell signal 3
+ elif (last_candle['rsi_14'] > 85.0) and (last_candle['rsi_14_4h'] > 75.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_rebuy_bull_3_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_rebuy_bull_3_2_1'
+
+ # Sell signal 4
+ elif (last_candle['rsi_14'] > 80.0) and (last_candle['rsi_14_1h'] > 80.0) and (last_candle['rsi_14_4h'] > 75.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_rebuy_bull_4_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_rebuy_bull_4_2_1'
+
+ # Sell signal 6
+ elif (last_candle['close'] < last_candle['ema_200']) and (last_candle['close'] > last_candle['ema_50']) and (last_candle['rsi_14'] > 79.0):
+ if (current_profit > 0.01):
+ return True, 'exit_rebuy_bull_6_1'
+
+ # Sell signal 7
+ elif (last_candle['rsi_14_1h'] > 79.0) and (last_candle['crossed_below_ema_12_26']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_rebuy_bull_7_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_rebuy_bull_7_2_1'
+
+ # Sell signal 8
+ elif (last_candle['rsi_14_4h'] > 75.0) and (last_candle['close'] > last_candle['bb20_2_upp_1h'] * 1.08):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_rebuy_bull_8_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_rebuy_bull_8_2_1'
+
+ return False, None
+
+ def exit_rebuy_bull_main(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ if (last_candle['close'] > last_candle['sma_200_1h']):
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['rsi_14'] < 20.0):
+ return True, 'exit_rebuy_bull_o_0'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 28.0):
+ return True, 'exit_rebuy_bull_o_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 30.0):
+ return True, 'exit_rebuy_bull_o_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 32.0):
+ return True, 'exit_rebuy_bull_o_3'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 34.0):
+ return True, 'exit_rebuy_bull_o_4'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 36.0):
+ return True, 'exit_rebuy_bull_o_5'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 38.0):
+ return True, 'exit_rebuy_bull_o_6'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 40.0):
+ return True, 'exit_rebuy_bull_o_7'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'exit_rebuy_bull_o_8'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_rebuy_bull_o_9'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_rebuy_bull_o_10'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_rebuy_bull_o_11'
+ elif current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'exit_rebuy_bull_o_12'
+ elif (last_candle['close'] < last_candle['sma_200_1h']):
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['rsi_14'] < 22.0):
+ return True, 'exit_rebuy_bull_u_0'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 30.0):
+ return True, 'exit_rebuy_bull_u_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 32.0):
+ return True, 'exit_rebuy_bull_u_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 34.0):
+ return True, 'exit_rebuy_bull_u_3'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 36.0):
+ return True, 'exit_rebuy_bull_u_4'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 38.0):
+ return True, 'exit_rebuy_bull_u_5'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 40.0):
+ return True, 'exit_rebuy_bull_u_6'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'exit_rebuy_bull_u_7'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_rebuy_bull_u_8'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_rebuy_bull_u_9'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'exit_rebuy_bull_u_10'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_rebuy_bull_u_11'
+ elif current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_rebuy_bull_u_12'
+
+ return False, None
+
+ def exit_rebuy_bull_r(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['r_480'] > -0.1):
+ return True, 'exit_rebuy_bull_w_0_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_rebuy_bull_w_0_2'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['r_480'] > -0.2):
+ return True, 'exit_rebuy_bull_w_1_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_rebuy_bull_w_1_2'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['r_480'] > -0.3):
+ return True, 'exit_rebuy_bull_w_2_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_rebuy_bull_w_2_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['r_480'] > -0.4):
+ return True, 'exit_rebuy_bull_w_3_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_rebuy_bull_w_3_2'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['r_480'] > -0.5):
+ return True, 'exit_rebuy_bull_w_4_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_rebuy_bull_w_4_2'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['r_480'] > -0.6):
+ return True, 'exit_rebuy_bull_w_5_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_rebuy_bull_w_5_2'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['r_480'] > -0.7):
+ return True, 'exit_rebuy_bull_w_6_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_rebuy_bull_w_6_2'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['r_480'] > -0.8):
+ return True, 'exit_rebuy_bull_w_7_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_rebuy_bull_w_7_2'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['r_480'] > -0.9):
+ return True, 'exit_rebuy_bull_w_8_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_rebuy_bull_w_8_2'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['r_480'] > -1.0):
+ return True, 'exit_rebuy_bull_w_9_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_rebuy_bull_w_9_2'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['r_480'] > -1.1):
+ return True, 'exit_rebuy_bull_w_10_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_rebuy_bull_w_10_2'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['r_480'] > -0.4):
+ return True, 'exit_rebuy_bull_w_11_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_rebuy_bull_w_11_2'
+ elif current_profit >= 0.2:
+ if (last_candle['r_480'] > -0.2):
+ return True, 'exit_rebuy_bull_w_12_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 80.0):
+ return True, 'exit_rebuy_bull_w_12_2'
+
+ return False, None
+
+ def exit_rebuy_bull_stoploss(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ # Stoploss doom
+ if (
+ (self.stop_thresholds_rebuy[10])
+ and (current_profit < self.stop_thresholds_rebuy[0])
+ ):
+ return True, 'exit_rebuy_bull_stoploss_doom'
+
+ # Under & near EMA200, local uptrend move
+ if (
+ (self.stop_thresholds_rebuy[12])
+ and (current_profit < self.stop_thresholds_rebuy[2])
+ and (last_candle['close'] < last_candle['ema_200'])
+ #and (last_candle['cmf_20'] < -0.0)
+ and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.stop_thresholds_rebuy[6])
+ and (last_candle['rsi_14'] > previous_candle_1['rsi_14'])
+ and (last_candle['rsi_14'] > (last_candle['rsi_14_1h'] + self.stop_thresholds_rebuy[8]))
+ and (current_time - timedelta(minutes=self.stop_thresholds_rebuy[4]) > trade.open_date_utc)
+ ):
+ return True, 'exit_rebuy_bull_stoploss_u_e'
+
+ return False, None
+
+ def exit_rebuy_bear(self, pair: str, current_rate: float, current_profit: float,
+ max_profit: float, max_loss: float,
+ last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5,
+ trade: 'Trade', current_time: 'datetime', enter_tags) -> tuple:
+ sell = False
+
+ # Original sell signals
+ sell, signal_name = self.exit_rebuy_bear_signals(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Main sell signals
+ if not sell:
+ sell, signal_name = self.exit_rebuy_bear_main(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Williams %R based sells
+ if not sell:
+ sell, signal_name = self.exit_rebuy_bear_r(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Stoplosses
+ if not sell:
+ sell, signal_name = self.exit_rebuy_bear_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Profit Target Signal
+ # Check if pair exist on target_profit_cache
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_rate = self.target_profit_cache.data[pair]['rate']
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ previous_sell_reason = self.target_profit_cache.data[pair]['sell_reason']
+ previous_time_profit_reached = datetime.fromisoformat(self.target_profit_cache.data[pair]['time_profit_reached'])
+
+ sell_max, signal_name_max = self.rebuy_bear_exit_profit_target(pair, trade, current_time, current_rate, current_profit,
+ last_candle, previous_candle_1,
+ previous_rate, previous_profit, previous_sell_reason,
+ previous_time_profit_reached, enter_tags)
+ if sell_max and signal_name_max is not None:
+ return True, f"{signal_name_max}_m"
+ if (current_profit > (previous_profit + 0.005)) and (previous_sell_reason not in ["exit_rebuy_bear_stoploss_doom"]):
+ # Update the target, raise it.
+ mark_pair, mark_signal = self.rebuy_bear_mark_profit_target(pair, True, previous_sell_reason, trade, current_time, current_rate, current_profit, last_candle, previous_candle_1)
+ if mark_pair:
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+
+ # Add the pair to the list, if a sell triggered and conditions met
+ if sell and signal_name is not None:
+ previous_profit = None
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ if (
+ (previous_profit is None)
+ or (previous_profit < current_profit)
+ ):
+ mark_pair, mark_signal = self.rebuy_bear_mark_profit_target(pair, sell, signal_name, trade, current_time, current_rate, current_profit, last_candle, previous_candle_1)
+ if mark_pair:
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+ else:
+ # Just sell it, without maximize
+ return True, f"{signal_name}"
+ else:
+ if (
+ (current_profit >= 0.01)
+ ):
+ previous_profit = None
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ if (previous_profit is None) or (previous_profit < current_profit):
+ mark_signal = "exit_profit_rebuy_bear_max"
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+
+ if (signal_name not in ["exit_profit_rebuy_bear_max", "exit_rebuy_bear_stoploss_doom", "exit_rebuy_bear_stoploss_u_e"]):
+ if sell and (signal_name is not None):
+ return True, f"{signal_name}"
+
+ return False, None
+
+ def rebuy_bear_mark_profit_target(self, pair: str, sell: bool, signal_name: str, trade: Trade, current_time: datetime, current_rate: float, current_profit: float, last_candle, previous_candle_1) -> tuple:
+ if sell and (signal_name is not None):
+ return pair, signal_name
+
+ return None, None
+
+ def rebuy_bear_exit_profit_target(self, pair: str, trade: Trade, current_time: datetime, current_rate: float, current_profit: float, last_candle, previous_candle_1, previous_rate, previous_profit, previous_sell_reason, previous_time_profit_reached, enter_tags) -> tuple:
+ if (previous_sell_reason in ["exit_rebuy_bear_stoploss_doom"]):
+ if (current_profit > 0.04):
+ # profit is over the threshold, don't exit
+ self._remove_profit_target(pair)
+ return False, None
+ if (current_profit < -0.18):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (current_profit < -0.1):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (current_profit < -0.04):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ else:
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (previous_sell_reason in ["exit_rebuy_bear_stoploss_u_e"]):
+ if (current_profit > 0.04):
+ # profit is over the threshold, don't exit
+ self._remove_profit_target(pair)
+ return False, None
+ if (current_profit < (previous_profit - 0.01)):
+ return True, previous_sell_reason
+ elif (previous_sell_reason in ["exit_profit_rebuy_bear_max"]):
+ if (current_profit < -0.08):
+ # profit is under the threshold, cancel
+ self._remove_profit_target(pair)
+ return False, None
+ if (0.001 <= current_profit < 0.01):
+ if (current_profit < (previous_profit - 0.01)):
+ return True, previous_sell_reason
+ elif (0.01 <= current_profit < 0.02):
+ if (current_profit < (previous_profit - 0.02)):
+ return True, previous_sell_reason
+ elif (0.02 <= current_profit < 0.03):
+ if (current_profit < (previous_profit - 0.03)):
+ return True, previous_sell_reason
+ elif (0.03 <= current_profit < 0.05):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (0.05 <= current_profit < 0.08):
+ if (current_profit < (previous_profit - 0.05)):
+ return True, previous_sell_reason
+ elif (0.08 <= current_profit < 0.12):
+ if (current_profit < (previous_profit - 0.06)):
+ return True, previous_sell_reason
+ elif (0.12 <= current_profit):
+ if (current_profit < (previous_profit - 0.07)):
+ return True, previous_sell_reason
+ else:
+ return False, None
+
+ return False, None
+
+ def exit_rebuy_bear_signals(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ # Sell signal 1
+ if (last_candle['rsi_14'] > 78.0) and (last_candle['rsi_14_4h'] > 75.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) and (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_rebuy_bear_1_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_rebuy_bear_1_2_1'
+
+ # Sell signal 2
+ elif (last_candle['rsi_14'] > 79.0) and (last_candle['rsi_14_4h'] > 75.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_rebuy_bear_2_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_rebuy_bear_2_2_1'
+
+ # Sell signal 3
+ elif (last_candle['rsi_14'] > 84.0) and (last_candle['rsi_14_4h'] > 75.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_rebuy_bear_3_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_rebuy_bear_3_2_1'
+
+ # Sell signal 4
+ elif (last_candle['rsi_14'] > 79.0) and (last_candle['rsi_14_1h'] > 79.0) and (last_candle['rsi_14_4h'] > 75.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_rebuy_bear_4_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_rebuy_bear_4_2_1'
+
+ # Sell signal 6
+ elif (last_candle['close'] < last_candle['ema_200']) and (last_candle['close'] > last_candle['ema_50']) and (last_candle['rsi_14'] > 78.5):
+ if (current_profit > 0.01):
+ return True, 'exit_rebuy_bear_6_1'
+
+ # Sell signal 7
+ elif (last_candle['rsi_14_1h'] > 79.0) and (last_candle['crossed_below_ema_12_26']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_rebuy_bear_7_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_rebuy_bear_7_2_1'
+
+ # Sell signal 8
+ elif (last_candle['close'] > last_candle['bb20_2_upp_1h'] * 1.07) and (last_candle['rsi_14_4h'] > 75.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_rebuy_bear_8_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_rebuy_bear_8_2_1'
+
+ return False, None
+
+ def exit_rebuy_bear_main(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ if (last_candle['close'] > last_candle['sma_200_1h']):
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['rsi_14'] < 22.0):
+ return True, 'exit_rebuy_bear_o_0'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 30.0):
+ return True, 'exit_rebuy_bear_o_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 32.0):
+ return True, 'exit_rebuy_bear_o_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 34.0):
+ return True, 'exit_rebuy_bear_o_3'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 36.0):
+ return True, 'exit_rebuy_bear_o_4'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 38.0):
+ return True, 'exit_rebuy_bear_o_5'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 40.0):
+ return True, 'exit_rebuy_bear_o_6'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'exit_rebuy_bear_o_7'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_rebuy_bear_o_8'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_rebuy_bear_o_9'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'exit_rebuy_bear_o_10'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_rebuy_bear_o_11'
+ elif current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_rebuy_bear_o_12'
+ elif (last_candle['close'] < last_candle['sma_200_1h']):
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['rsi_14'] < 24.0):
+ return True, 'exit_rebuy_bear_u_0'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 32.0):
+ return True, 'exit_rebuy_bear_u_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 34.0):
+ return True, 'exit_rebuy_bear_u_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 36.0):
+ return True, 'exit_rebuy_bear_u_3'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 38.0):
+ return True, 'exit_rebuy_bear_u_4'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 40.0):
+ return True, 'exit_rebuy_bear_u_5'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'exit_rebuy_bear_u_6'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_rebuy_bear_u_7'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_rebuy_bear_u_8'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'exit_rebuy_bear_u_9'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 50.0):
+ return True, 'exit_rebuy_bear_u_10'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'exit_rebuy_bear_u_11'
+ elif current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_rebuy_bear_u_12'
+
+ return False, None
+
+ def exit_rebuy_bear_r(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['r_480'] > -0.1):
+ return True, 'exit_rebuy_bear_w_0_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_rebuy_bear_w_0_2'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['r_480'] > -0.2):
+ return True, 'exit_rebuy_bear_w_1_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_rebuy_bear_w_1_2'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['r_480'] > -0.3):
+ return True, 'exit_rebuy_bear_w_2_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_rebuy_bear_w_2_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['r_480'] > -0.4):
+ return True, 'exit_rebuy_bear_w_3_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_rebuy_bear_w_3_2'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['r_480'] > -0.5):
+ return True, 'exit_rebuy_bear_w_4_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_rebuy_bear_w_4_2'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['r_480'] > -0.6):
+ return True, 'exit_rebuy_bear_w_5_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_rebuy_bear_w_5_2'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['r_480'] > -0.7):
+ return True, 'exit_rebuy_bear_w_6_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_rebuy_bear_w_6_2'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['r_480'] > -0.8):
+ return True, 'exit_rebuy_bear_w_7_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_rebuy_bear_w_7_2'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['r_480'] > -0.9):
+ return True, 'exit_rebuy_bear_w_8_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_rebuy_bear_w_8_2'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['r_480'] > -1.0):
+ return True, 'exit_rebuy_bear_w_9_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_rebuy_bear_w_9_2'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['r_480'] > -1.1):
+ return True, 'exit_rebuy_bear_w_10_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_rebuy_bear_w_10_2'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['r_480'] > -0.4):
+ return True, 'exit_rebuy_bear_w_11_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_rebuy_bear_w_11_2'
+ elif current_profit >= 0.2:
+ if (last_candle['r_480'] > -0.2):
+ return True, 'exit_rebuy_bear_w_12_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 80.0):
+ return True, 'exit_rebuy_bear_w_12_2'
+
+ return False, None
+
+ def exit_rebuy_bear_stoploss(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ # Stoploss doom
+ if (
+ (self.stop_thresholds_rebuy[11])
+ and (current_profit < self.stop_thresholds_rebuy[1])
+ ):
+ return True, 'exit_rebuy_bear_stoploss_doom'
+
+ # Under & near EMA200, local uptrend move
+ if (
+ (self.stop_thresholds_rebuy[13])
+ and (current_profit < self.stop_thresholds_rebuy[3])
+ and (last_candle['close'] < last_candle['ema_200'])
+ and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.stop_thresholds_rebuy[7])
+ and (last_candle['rsi_14'] > previous_candle_1['rsi_14'])
+ and (last_candle['rsi_14'] > (last_candle['rsi_14_1h'] + self.stop_thresholds_rebuy[9]))
+ and (current_time - timedelta(minutes=self.stop_thresholds_rebuy[5]) > trade.open_date_utc)
+ ):
+ return True, 'exit_rebuy_bear_stoploss_u_e'
+
+ return False, None
+
+ def exit_long_bull(self, pair: str, current_rate: float, current_profit: float,
+ max_profit: float, max_loss: float,
+ last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5,
+ trade: 'Trade', current_time: 'datetime', enter_tags) -> tuple:
+ sell = False
+
+ # Original sell signals
+ sell, signal_name = self.exit_long_bull_signals(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Main sell signals
+ if not sell:
+ sell, signal_name = self.exit_long_bull_main(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Williams %R based sells
+ if not sell:
+ sell, signal_name = self.exit_long_bull_r(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Stoplosses
+ if not sell:
+ sell, signal_name = self.exit_long_bull_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Profit Target Signal
+ # Check if pair exist on target_profit_cache
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_rate = self.target_profit_cache.data[pair]['rate']
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ previous_sell_reason = self.target_profit_cache.data[pair]['sell_reason']
+ previous_time_profit_reached = datetime.fromisoformat(self.target_profit_cache.data[pair]['time_profit_reached'])
+
+ sell_max, signal_name_max = self.long_bull_exit_profit_target(pair, trade, current_time, current_rate, current_profit,
+ last_candle, previous_candle_1,
+ previous_rate, previous_profit, previous_sell_reason,
+ previous_time_profit_reached, enter_tags)
+ if sell_max and signal_name_max is not None:
+ return True, f"{signal_name_max}_m"
+ if (current_profit > (previous_profit + 0.005)) and (previous_sell_reason not in ["exit_long_bull_stoploss_doom"]):
+ # Update the target, raise it.
+ mark_pair, mark_signal = self.long_bull_mark_profit_target(pair, True, previous_sell_reason, trade, current_time, current_rate, current_profit, last_candle, previous_candle_1)
+ if mark_pair:
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+
+ # Add the pair to the list, if a sell triggered and conditions met
+ if sell and signal_name is not None:
+ previous_profit = None
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ if (
+ (previous_profit is None)
+ or (previous_profit < current_profit)
+ ):
+ mark_pair, mark_signal = self.long_bull_mark_profit_target(pair, sell, signal_name, trade, current_time, current_rate, current_profit, last_candle, previous_candle_1)
+ if mark_pair:
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+ else:
+ # Just sell it, without maximize
+ return True, f"{signal_name}"
+ else:
+ if (
+ (current_profit >= 0.05)
+ ):
+ previous_profit = None
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ if (previous_profit is None) or (previous_profit < current_profit):
+ mark_signal = "exit_profit_long_bull_max"
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+
+ if (signal_name not in ["exit_profit_long_bull_max", "exit_long_bull_stoploss_doom", "exit_long_bull_stoploss_u_e"]):
+ if sell and (signal_name is not None):
+ return True, f"{signal_name}"
+
+ return False, None
+
+ def long_bull_mark_profit_target(self, pair: str, sell: bool, signal_name: str, trade: Trade, current_time: datetime, current_rate: float, current_profit: float, last_candle, previous_candle_1) -> tuple:
+ if sell and (signal_name is not None):
+ return pair, signal_name
+
+ return None, None
+
+ def long_bull_exit_profit_target(self, pair: str, trade: Trade, current_time: datetime, current_rate: float, current_profit: float, last_candle, previous_candle_1, previous_rate, previous_profit, previous_sell_reason, previous_time_profit_reached, enter_tags) -> tuple:
+ if (previous_sell_reason in ["exit_long_bull_stoploss_doom"]):
+ if (current_profit > 0.04):
+ # profit is over the threshold, don't exit
+ self._remove_profit_target(pair)
+ return False, None
+ if (current_profit < -0.18):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (current_profit < -0.1):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (current_profit < -0.04):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ else:
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (previous_sell_reason in ["exit_long_bull_stoploss_u_e"]):
+ if (current_profit > 0.04):
+ # profit is over the threshold, don't exit
+ self._remove_profit_target(pair)
+ return False, None
+ if (current_profit < (previous_profit - 0.01)):
+ return True, previous_sell_reason
+ elif (previous_sell_reason in ["exit_profit_long_bull_max"]):
+ if (current_profit < -0.08):
+ # profit is under the threshold, cancel it
+ self._remove_profit_target(pair)
+ return False, None
+ if (0.001 <= current_profit < 0.01):
+ if (current_profit < (previous_profit - 0.01)):
+ return True, previous_sell_reason
+ elif (0.01 <= current_profit < 0.02):
+ if (current_profit < (previous_profit - 0.02)):
+ return True, previous_sell_reason
+ elif (0.02 <= current_profit < 0.03):
+ if (current_profit < (previous_profit - 0.03)):
+ return True, previous_sell_reason
+ elif (0.03 <= current_profit < 0.05):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (0.05 <= current_profit < 0.08):
+ if (current_profit < (previous_profit - 0.05)):
+ return True, previous_sell_reason
+ elif (0.08 <= current_profit < 0.12):
+ if (current_profit < (previous_profit - 0.06)):
+ return True, previous_sell_reason
+ elif (0.12 <= current_profit):
+ if (current_profit < (previous_profit - 0.07)):
+ return True, previous_sell_reason
+ else:
+ return False, None
+
+ return False, None
+
+ def exit_long_bull_signals(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ # Sell signal 1
+ if (last_candle['rsi_14'] > 78.0) and (last_candle['rsi_14_4h'] > 50.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) and (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_long_bull_1_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_long_bull_1_2_1'
+
+ # Sell signal 2
+ elif (last_candle['rsi_14'] > 79.0) and (last_candle['rsi_14_4h'] > 50.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_long_bull_2_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_long_bull_2_2_1'
+
+ # Sell signal 3
+ elif (last_candle['rsi_14'] > 81.0) and (last_candle['rsi_14_4h'] > 50.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_long_bull_3_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_long_bull_3_2_1'
+
+ # Sell signal 4
+ elif (last_candle['rsi_14'] > 80.0) and (last_candle['rsi_14_1h'] > 80.0) and (last_candle['rsi_14_4h'] > 50.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_long_bull_4_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_long_bull_4_2_1'
+
+ # Sell signal 6
+ elif (last_candle['close'] < last_candle['ema_200']) and (last_candle['close'] > last_candle['ema_50']) and (last_candle['rsi_14'] > 79.0):
+ if (current_profit > 0.01):
+ return True, 'exit_long_bull_6_1'
+
+ # Sell signal 7
+ elif (last_candle['rsi_14_1h'] > 79.0) and (last_candle['crossed_below_ema_12_26']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_long_bull_7_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_long_bull_7_2_1'
+
+ # Sell signal 8
+ elif (last_candle['rsi_14_4h'] > 50.0) and (last_candle['close'] > last_candle['bb20_2_upp_1h'] * 1.08):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_long_bull_8_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_long_bull_8_2_1'
+
+ return False, None
+
+ def exit_long_bull_main(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ if (last_candle['close'] > last_candle['sma_200_1h']):
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['rsi_14'] < 10.0):
+ return True, 'exit_long_bull_o_0'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 28.0):
+ return True, 'exit_long_bull_o_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 30.0):
+ return True, 'exit_long_bull_o_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 32.0):
+ return True, 'exit_long_bull_o_3'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 34.0):
+ return True, 'exit_long_bull_o_4'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 36.0):
+ return True, 'exit_long_bull_o_5'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 38.0):
+ return True, 'exit_long_bull_o_6'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 40.0):
+ return True, 'exit_long_bull_o_7'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'exit_long_bull_o_8'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_long_bull_o_9'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_long_bull_o_10'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_long_bull_o_11'
+ elif current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'exit_long_bull_o_12'
+ elif (last_candle['close'] < last_candle['sma_200_1h']):
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['rsi_14'] < 12.0):
+ return True, 'exit_long_bull_u_0'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 30.0):
+ return True, 'exit_long_bull_u_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 32.0):
+ return True, 'exit_long_bull_u_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 34.0):
+ return True, 'exit_long_bull_u_3'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 36.0):
+ return True, 'exit_long_bull_u_4'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 38.0):
+ return True, 'exit_long_bull_u_5'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 40.0):
+ return True, 'exit_long_bull_u_6'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'exit_long_bull_u_7'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_long_bull_u_8'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_long_bull_u_9'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'exit_long_bull_u_10'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_long_bull_u_11'
+ elif current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_long_bull_u_12'
+
+ return False, None
+
+ def exit_long_bull_r(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['r_480'] > -0.1):
+ return True, 'exit_long_bull_w_0_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_long_bull_w_0_2'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['r_480'] > -0.2):
+ return True, 'exit_long_bull_w_1_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_long_bull_w_1_2'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['r_480'] > -0.3):
+ return True, 'exit_long_bull_w_2_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_long_bull_w_2_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['r_480'] > -0.4):
+ return True, 'exit_long_bull_w_3_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_long_bull_w_3_2'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['r_480'] > -0.5):
+ return True, 'exit_long_bull_w_4_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_long_bull_w_4_2'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['r_480'] > -0.6):
+ return True, 'exit_long_bull_w_5_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_long_bull_w_5_2'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['r_480'] > -0.7):
+ return True, 'exit_long_bull_w_6_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_long_bull_w_6_2'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['r_480'] > -0.8):
+ return True, 'exit_long_bull_w_7_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_long_bull_w_7_2'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['r_480'] > -0.9):
+ return True, 'exit_long_bull_w_8_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_long_bull_w_8_2'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['r_480'] > -1.0):
+ return True, 'exit_long_bull_w_9_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_long_bull_w_9_2'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['r_480'] > -1.1):
+ return True, 'exit_long_bull_w_10_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_long_bull_w_10_2'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['r_480'] > -0.4):
+ return True, 'exit_long_bull_w_11_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_long_bull_w_11_2'
+ elif current_profit >= 0.2:
+ if (last_candle['r_480'] > -0.2):
+ return True, 'exit_long_bull_w_12_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 80.0):
+ return True, 'exit_long_bull_w_12_2'
+
+ return False, None
+
+ def exit_long_bull_stoploss(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ # Stoploss doom
+ if (
+ (self.stop_thresholds_long[10])
+ and (current_profit < self.stop_thresholds_long[0])
+ ):
+ return True, 'exit_long_bull_stoploss_doom'
+
+ # Under & near EMA200, local uptrend move
+ if (
+ (self.stop_thresholds_long[12])
+ and (current_profit < self.stop_thresholds_long[2])
+ and (last_candle['close'] < last_candle['ema_200'])
+ #and (last_candle['cmf_20'] < -0.0)
+ and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.stop_thresholds_long[6])
+ and (last_candle['rsi_14'] > previous_candle_1['rsi_14'])
+ and (last_candle['rsi_14'] > (last_candle['rsi_14_1h'] + self.stop_thresholds_long[8]))
+ and (current_time - timedelta(minutes=self.stop_thresholds_long[4]) > trade.open_date_utc)
+ ):
+ return True, 'exit_long_bull_stoploss_u_e'
+
+ return False, None
+
+ def exit_long_bear(self, pair: str, current_rate: float, current_profit: float,
+ max_profit: float, max_loss: float,
+ last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5,
+ trade: 'Trade', current_time: 'datetime', enter_tags) -> tuple:
+ sell = False
+
+ # Original sell signals
+ sell, signal_name = self.exit_long_bear_signals(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Main sell signals
+ if not sell:
+ sell, signal_name = self.exit_long_bear_main(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Williams %R based sells
+ if not sell:
+ sell, signal_name = self.exit_long_bear_r(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Stoplosses
+ if not sell:
+ sell, signal_name = self.exit_long_bear_stoploss(current_profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+
+ # Profit Target Signal
+ # Check if pair exist on target_profit_cache
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_rate = self.target_profit_cache.data[pair]['rate']
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ previous_sell_reason = self.target_profit_cache.data[pair]['sell_reason']
+ previous_time_profit_reached = datetime.fromisoformat(self.target_profit_cache.data[pair]['time_profit_reached'])
+
+ sell_max, signal_name_max = self.long_bear_exit_profit_target(pair, trade, current_time, current_rate, current_profit,
+ last_candle, previous_candle_1,
+ previous_rate, previous_profit, previous_sell_reason,
+ previous_time_profit_reached, enter_tags)
+ if sell_max and signal_name_max is not None:
+ return True, f"{signal_name_max}_m"
+ if (current_profit > (previous_profit + 0.005)) and (previous_sell_reason not in ["exit_long_bear_stoploss_doom"]):
+ # Update the target, raise it.
+ mark_pair, mark_signal = self.long_bear_mark_profit_target(pair, True, previous_sell_reason, trade, current_time, current_rate, current_profit, last_candle, previous_candle_1)
+ if mark_pair:
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+
+ # Add the pair to the list, if a sell triggered and conditions met
+ if sell and signal_name is not None:
+ previous_profit = None
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ if (
+ (previous_profit is None)
+ or (previous_profit < current_profit)
+ ):
+ mark_pair, mark_signal = self.long_bear_mark_profit_target(pair, sell, signal_name, trade, current_time, current_rate, current_profit, last_candle, previous_candle_1)
+ if mark_pair:
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+ else:
+ # Just sell it, without maximize
+ return True, f"{signal_name}"
+ else:
+ if (
+ (current_profit >= 0.05)
+ ):
+ previous_profit = None
+ if self.target_profit_cache is not None and pair in self.target_profit_cache.data:
+ previous_profit = self.target_profit_cache.data[pair]['profit']
+ if (previous_profit is None) or (previous_profit < current_profit):
+ mark_signal = "exit_profit_long_bear_max"
+ self._set_profit_target(pair, mark_signal, current_rate, current_profit, current_time)
+
+ if (signal_name not in ["exit_profit_long_bear_max", "exit_long_bear_stoploss_doom", "exit_long_bear_stoploss_u_e"]):
+ if sell and (signal_name is not None):
+ return True, f"{signal_name}"
+
+ return False, None
+
+ def long_bear_mark_profit_target(self, pair: str, sell: bool, signal_name: str, trade: Trade, current_time: datetime, current_rate: float, current_profit: float, last_candle, previous_candle_1) -> tuple:
+ if sell and (signal_name is not None):
+ return pair, signal_name
+
+ return None, None
+
+ def long_bear_exit_profit_target(self, pair: str, trade: Trade, current_time: datetime, current_rate: float, current_profit: float, last_candle, previous_candle_1, previous_rate, previous_profit, previous_sell_reason, previous_time_profit_reached, enter_tags) -> tuple:
+ if (previous_sell_reason in ["exit_long_bear_stoploss_doom"]):
+ if (current_profit > 0.04):
+ # profit is over the threshold, don't exit
+ self._remove_profit_target(pair)
+ return False, None
+ if (current_profit < -0.18):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (current_profit < -0.1):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (current_profit < -0.04):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ else:
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (previous_sell_reason in ["exit_long_bear_stoploss_u_e"]):
+ if (current_profit > 0.04):
+ # profit is over the threshold, don't exit
+ self._remove_profit_target(pair)
+ return False, None
+ if (current_profit < (previous_profit - 0.01)):
+ return True, previous_sell_reason
+ elif (previous_sell_reason in ["exit_profit_long_bear_max"]):
+ if (current_profit < -0.08):
+ # profit is under the threshold, cancel it
+ self._remove_profit_target(pair)
+ return False, None
+ if (0.001 <= current_profit < 0.01):
+ if (current_profit < (previous_profit - 0.01)):
+ return True, previous_sell_reason
+ elif (0.01 <= current_profit < 0.02):
+ if (current_profit < (previous_profit - 0.02)):
+ return True, previous_sell_reason
+ elif (0.02 <= current_profit < 0.03):
+ if (current_profit < (previous_profit - 0.03)):
+ return True, previous_sell_reason
+ elif (0.03 <= current_profit < 0.05):
+ if (current_profit < (previous_profit - 0.04)):
+ return True, previous_sell_reason
+ elif (0.05 <= current_profit < 0.08):
+ if (current_profit < (previous_profit - 0.05)):
+ return True, previous_sell_reason
+ elif (0.08 <= current_profit < 0.12):
+ if (current_profit < (previous_profit - 0.06)):
+ return True, previous_sell_reason
+ elif (0.12 <= current_profit):
+ if (current_profit < (previous_profit - 0.07)):
+ return True, previous_sell_reason
+ else:
+ return False, None
+
+ return False, None
+
+ def exit_long_bear_signals(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ # Sell signal 1
+ if (last_candle['rsi_14'] > 78.0) and (last_candle['rsi_14_4h'] > 50.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']) and (previous_candle_3['close'] > previous_candle_3['bb20_2_upp']) and (previous_candle_4['close'] > previous_candle_4['bb20_2_upp']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_long_bear_1_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_long_bear_1_2_1'
+
+ # Sell signal 2
+ elif (last_candle['rsi_14'] > 79.0) and (last_candle['rsi_14_4h'] > 50.0) and (last_candle['close'] > last_candle['bb20_2_upp']) and (previous_candle_1['close'] > previous_candle_1['bb20_2_upp']) and (previous_candle_2['close'] > previous_candle_2['bb20_2_upp']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_long_bear_2_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_long_bear_2_2_1'
+
+ # Sell signal 3
+ elif (last_candle['rsi_14'] > 81.0) and (last_candle['rsi_14_4h'] > 50.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_long_bear_3_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_long_bear_3_2_1'
+
+ # Sell signal 4
+ elif (last_candle['rsi_14'] > 79.0) and (last_candle['rsi_14_1h'] > 79.0) and (last_candle['rsi_14_4h'] > 50.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_long_bear_4_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_long_bear_4_2_1'
+
+ # Sell signal 6
+ elif (last_candle['close'] < last_candle['ema_200']) and (last_candle['close'] > last_candle['ema_50']) and (last_candle['rsi_14'] > 78.5):
+ if (current_profit > 0.01):
+ return True, 'exit_long_bear_6_1'
+
+ # Sell signal 7
+ elif (last_candle['rsi_14_1h'] > 79.0) and (last_candle['crossed_below_ema_12_26']):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_long_bear_7_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_long_bear_7_2_1'
+
+ # Sell signal 8
+ elif (last_candle['close'] > last_candle['bb20_2_upp_1h'] * 1.07) and (last_candle['rsi_14_4h'] > 50.0):
+ if (last_candle['close'] > last_candle['ema_200']):
+ if (current_profit > 0.01):
+ return True, 'exit_long_bear_8_1_1'
+ else:
+ if (current_profit > 0.01):
+ return True, 'exit_long_bear_8_2_1'
+
+ return False, None
+
+ def exit_long_bear_main(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ if (last_candle['close'] > last_candle['sma_200_1h']):
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['rsi_14'] < 12.0):
+ return True, 'exit_long_bear_o_0'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 30.0):
+ return True, 'exit_long_bear_o_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 32.0):
+ return True, 'exit_long_bear_o_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 34.0):
+ return True, 'exit_long_bear_o_3'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 36.0):
+ return True, 'exit_long_bear_o_4'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 38.0):
+ return True, 'exit_long_bear_o_5'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 40.0):
+ return True, 'exit_long_bear_o_6'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'exit_long_bear_o_7'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_long_bear_o_8'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_long_bear_o_9'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'exit_long_bear_o_10'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_long_bear_o_11'
+ elif current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_long_bear_o_12'
+ elif (last_candle['close'] < last_candle['sma_200_1h']):
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['rsi_14'] < 14.0):
+ return True, 'exit_long_bear_u_0'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['rsi_14'] < 32.0):
+ return True, 'exit_long_bear_u_1'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['rsi_14'] < 34.0):
+ return True, 'exit_long_bear_u_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['rsi_14'] < 36.0):
+ return True, 'exit_long_bear_u_3'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['rsi_14'] < 38.0):
+ return True, 'exit_long_bear_u_4'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['rsi_14'] < 40.0):
+ return True, 'exit_long_bear_u_5'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['rsi_14'] < 42.0):
+ return True, 'exit_long_bear_u_6'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['rsi_14'] < 44.0):
+ return True, 'exit_long_bear_u_7'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_long_bear_u_8'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'exit_long_bear_u_9'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['rsi_14'] < 50.0):
+ return True, 'exit_long_bear_u_10'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['rsi_14'] < 48.0):
+ return True, 'exit_long_bear_u_11'
+ elif current_profit >= 0.2:
+ if (last_candle['rsi_14'] < 46.0):
+ return True, 'exit_long_bear_u_12'
+
+ return False, None
+
+ def exit_long_bear_r(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ if 0.01 > current_profit >= 0.001:
+ if (last_candle['r_480'] > -0.1):
+ return True, 'exit_long_bear_w_0_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_long_bear_w_0_2'
+ elif 0.02 > current_profit >= 0.01:
+ if (last_candle['r_480'] > -0.2):
+ return True, 'exit_long_bear_w_1_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_long_bear_w_1_2'
+ elif 0.03 > current_profit >= 0.02:
+ if (last_candle['r_480'] > -0.3):
+ return True, 'exit_long_bear_w_2_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_long_bear_w_2_2'
+ elif 0.04 > current_profit >= 0.03:
+ if (last_candle['r_480'] > -0.4):
+ return True, 'exit_long_bear_w_3_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_long_bear_w_3_2'
+ elif 0.05 > current_profit >= 0.04:
+ if (last_candle['r_480'] > -0.5):
+ return True, 'exit_long_bear_w_4_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_long_bear_w_4_2'
+ elif 0.06 > current_profit >= 0.05:
+ if (last_candle['r_480'] > -0.6):
+ return True, 'exit_long_bear_w_5_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_long_bear_w_5_2'
+ elif 0.07 > current_profit >= 0.06:
+ if (last_candle['r_480'] > -0.7):
+ return True, 'exit_long_bear_w_6_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_long_bear_w_6_2'
+ elif 0.08 > current_profit >= 0.07:
+ if (last_candle['r_480'] > -0.8):
+ return True, 'exit_long_bear_w_7_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_long_bear_w_7_2'
+ elif 0.09 > current_profit >= 0.08:
+ if (last_candle['r_480'] > -0.9):
+ return True, 'exit_long_bear_w_8_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_long_bear_w_8_2'
+ elif 0.1 > current_profit >= 0.09:
+ if (last_candle['r_480'] > -1.0):
+ return True, 'exit_long_bear_w_9_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_long_bear_w_9_2'
+ elif 0.12 > current_profit >= 0.1:
+ if (last_candle['r_480'] > -1.1):
+ return True, 'exit_long_bear_w_10_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_long_bear_w_10_2'
+ elif 0.2 > current_profit >= 0.12:
+ if (last_candle['r_480'] > -0.4):
+ return True, 'exit_long_bear_w_11_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 79.0):
+ return True, 'exit_long_bear_w_11_2'
+ elif current_profit >= 0.2:
+ if (last_candle['r_480'] > -0.2):
+ return True, 'exit_long_bear_w_12_1'
+ elif (last_candle['r_14'] >= -1.0) and (last_candle['rsi_14'] > 80.0):
+ return True, 'exit_long_bear_w_12_2'
+
+ return False, None
+
+ def exit_long_bear_stoploss(self, current_profit: float, max_profit:float, max_loss:float, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade: 'Trade', current_time: 'datetime', buy_tag) -> tuple:
+ # Stoploss doom
+ if (
+ (self.stop_thresholds_long[11])
+ and (current_profit < self.stop_thresholds_long[1])
+ ):
+ return True, 'exit_long_bear_stoploss_doom'
+
+ # Under & near EMA200, local uptrend move
+ if (
+ (self.stop_thresholds_long[13])
+ and (current_profit < self.stop_thresholds_long[3])
+ and (last_candle['close'] < last_candle['ema_200'])
+ and (((last_candle['ema_200'] - last_candle['close']) / last_candle['close']) < self.stop_thresholds_long[7])
+ and (last_candle['rsi_14'] > previous_candle_1['rsi_14'])
+ and (last_candle['rsi_14'] > (last_candle['rsi_14_1h'] + self.stop_thresholds_long[9]))
+ and (current_time - timedelta(minutes=self.stop_thresholds_long[5]) > trade.open_date_utc)
+ ):
+ return True, 'exit_long_bear_stoploss_u_e'
+
+ return False, None
+
+ def custom_exit(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,
+ current_profit: float, **kwargs):
+ dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)
+ last_candle = dataframe.iloc[-1].squeeze()
+ previous_candle_1 = dataframe.iloc[-2].squeeze()
+ previous_candle_2 = dataframe.iloc[-3].squeeze()
+ previous_candle_3 = dataframe.iloc[-4].squeeze()
+ previous_candle_4 = dataframe.iloc[-5].squeeze()
+ previous_candle_5 = dataframe.iloc[-6].squeeze()
+
+ enter_tag = 'empty'
+ if hasattr(trade, 'enter_tag') and trade.enter_tag is not None:
+ enter_tag = trade.enter_tag
+ enter_tags = enter_tag.split()
+
+ profit = current_profit
+
+ max_profit = ((trade.max_rate - trade.open_rate) / trade.open_rate)
+ max_loss = ((trade.open_rate - trade.min_rate) / trade.min_rate)
+
+ if hasattr(trade, 'select_filled_orders'):
+ filled_entries = trade.select_filled_orders('enter_long')
+ count_of_entries = len(filled_entries)
+ if count_of_entries > 1:
+ initial_entry = filled_entries[0]
+ if (initial_entry is not None and initial_entry.average is not None):
+ max_profit = ((trade.max_rate - initial_entry.average) / initial_entry.average)
+ max_loss = ((initial_entry.average - trade.min_rate) / trade.min_rate)
+
+ # Normal mode, bull
+ if any(c in self.normal_mode_bull_tags for c in enter_tags):
+ sell, signal_name = self.exit_normal_bull(pair, current_rate, profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+ if sell and (signal_name is not None):
+ return f"{signal_name} ( {enter_tag})"
+
+ # Normal mode, bear
+ if any(c in self.normal_mode_bear_tags for c in enter_tags):
+ sell, signal_name = self.exit_normal_bear(pair, current_rate, profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+ if sell and (signal_name is not None):
+ return f"{signal_name} ( {enter_tag})"
+
+ # Pump mpde, bull
+ if any(c in self.pump_mode_bull_tags for c in enter_tags):
+ sell, signal_name = self.exit_pump_bull(pair, current_rate, profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+ if sell and (signal_name is not None):
+ return f"{signal_name} ( {enter_tag})"
+
+ # Pump mode, bear
+ if any(c in self.pump_mode_bear_tags for c in enter_tags):
+ sell, signal_name = self.exit_pump_bear(pair, current_rate, profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+ if sell and (signal_name is not None):
+ return f"{signal_name} ( {enter_tag})"
+
+ # Quick mode, bull
+ if any(c in self.quick_mode_bull_tags for c in enter_tags):
+ sell, signal_name = self.exit_quick_bull(pair, current_rate, profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+ if sell and (signal_name is not None):
+ return f"{signal_name} ( {enter_tag})"
+
+ # Quick mode, bear
+ if any(c in self.quick_mode_bear_tags for c in enter_tags):
+ sell, signal_name = self.exit_quick_bear(pair, current_rate, profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+ if sell and (signal_name is not None):
+ return f"{signal_name} ( {enter_tag})"
+
+ # Rebuy mode, bull
+ if all(c in self.rebuy_mode_bull_tags for c in enter_tags):
+ sell, signal_name = self.exit_rebuy_bull(pair, current_rate, profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+ if sell and (signal_name is not None):
+ return f"{signal_name} ( {enter_tag})"
+
+ # Rebuy mode, bear
+ if all(c in self.rebuy_mode_bear_tags for c in enter_tags):
+ sell, signal_name = self.exit_rebuy_bear(pair, current_rate, profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+ if sell and (signal_name is not None):
+ return f"{signal_name} ( {enter_tag})"
+
+ # Long mode, bull
+ if any(c in self.long_mode_bull_tags for c in enter_tags):
+ sell, signal_name = self.exit_long_bull(pair, current_rate, profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+ if sell and (signal_name is not None):
+ return f"{signal_name} ( {enter_tag})"
+
+ # Long mode, bear
+ if any(c in self.long_mode_bear_tags for c in enter_tags):
+ sell, signal_name = self.exit_long_bear(pair, current_rate, profit, max_profit, max_loss, last_candle, previous_candle_1, previous_candle_2, previous_candle_3, previous_candle_4, previous_candle_5, trade, current_time, enter_tags)
+ if sell and (signal_name is not None):
+ return f"{signal_name} ( {enter_tag})"
+
+ return None
+
+ def custom_stake_amount(self, pair: str, current_time: datetime, current_rate: float,
+ proposed_stake: float, min_stake: Optional[float], max_stake: float,
+ leverage: float, entry_tag: Optional[str], side: str,
+ **kwargs) -> float:
+ if (self.position_adjustment_enable == True):
+ enter_tags = entry_tag.split()
+ if all(c in self.rebuy_mode_bull_tags for c in enter_tags):
+ return proposed_stake * self.stake_rebuy_mode_bull_multiplier
+ # Rebuy mode, bear
+ if all(c in self.rebuy_mode_bear_tags for c in enter_tags):
+ return proposed_stake * self.stake_rebuy_mode_bear_multiplier
+
+ return proposed_stake
+
+ def adjust_trade_position(self, trade: Trade, current_time: datetime,
+ current_rate: float, current_profit: float,
+ min_stake: Optional[float], max_stake: float,
+ current_entry_rate: float, current_exit_rate: float,
+ current_entry_profit: float, current_exit_profit: float,
+ **kwargs) -> Optional[float]:
+ if (self.position_adjustment_enable == False):
+ return None
+
+ enter_tag = 'empty'
+ if hasattr(trade, 'enter_tag') and trade.enter_tag is not None:
+ enter_tag = trade.enter_tag
+ enter_tags = enter_tag.split()
+
+ # Rebuy mode, bull
+ if all(c in self.rebuy_mode_bull_tags for c in enter_tags):
+ return self.rebuy_bull_adjust_trade_position(trade, current_time,
+ current_rate, current_profit,
+ min_stake, max_stake,
+ current_entry_rate, current_exit_rate,
+ current_entry_profit, current_exit_profit
+ )
+
+ # Rebuy mode, bear
+ if all(c in self.rebuy_mode_bear_tags for c in enter_tags):
+ return self.rebuy_bear_adjust_trade_position(trade, current_time,
+ current_rate, current_profit,
+ min_stake, max_stake,
+ current_entry_rate, current_exit_rate,
+ current_entry_profit, current_exit_profit
+ )
+
+ return None
+
+ def rebuy_bull_adjust_trade_position(self, trade: Trade, current_time: datetime,
+ current_rate: float, current_profit: float,
+ min_stake: Optional[float], max_stake: float,
+ current_entry_rate: float, current_exit_rate: float,
+ current_entry_profit: float, current_exit_profit: float,
+ **kwargs) -> Optional[float]:
+ dataframe, _ = self.dp.get_analyzed_dataframe(trade.pair, self.timeframe)
+ if(len(dataframe) < 2):
+ return None
+ last_candle = dataframe.iloc[-1].squeeze()
+ previous_candle = dataframe.iloc[-2].squeeze()
+
+ filled_orders = trade.select_filled_orders()
+ filled_entries = trade.select_filled_orders(trade.entry_side)
+ filled_exits = trade.select_filled_orders(trade.exit_side)
+ count_of_entries = trade.nr_of_successful_entries
+ count_of_exits = trade.nr_of_successful_exits
+
+ if (count_of_entries == 0):
+ return None
+
+ is_rebuy = False
+
+ if (0 < count_of_entries <= self.pa_rebuy_mode_bull_max):
+ if (
+ (current_profit < self.pa_rebuy_mode_bull_pcts[count_of_entries - 1])
+ and (
+ (last_candle['rsi_3'] > 10.0)
+ and (last_candle['rsi_14'] < 40.0)
+ and (last_candle['rsi_3_1h'] > 10.0)
+ and (last_candle['close_max_48'] < (last_candle['close'] * 1.1))
+ and (last_candle['btc_pct_close_max_72_5m'] < 1.03)
+ )
+ ):
+ is_rebuy = True
+
+ if is_rebuy:
+ # This returns first order stake size
+ stake_amount = filled_entries[0].cost
+ print('rebuying..')
+ stake_amount = stake_amount * self.pa_rebuy_mode_bull_multi[count_of_entries - 1]
+ return stake_amount
+
+ return None
+
+ def rebuy_bear_adjust_trade_position(self, trade: Trade, current_time: datetime,
+ current_rate: float, current_profit: float,
+ min_stake: Optional[float], max_stake: float,
+ current_entry_rate: float, current_exit_rate: float,
+ current_entry_profit: float, current_exit_profit: float,
+ **kwargs) -> Optional[float]:
+ dataframe, _ = self.dp.get_analyzed_dataframe(trade.pair, self.timeframe)
+ if(len(dataframe) < 2):
+ return None
+ last_candle = dataframe.iloc[-1].squeeze()
+ previous_candle = dataframe.iloc[-2].squeeze()
+
+ filled_orders = trade.select_filled_orders()
+ filled_entries = trade.select_filled_orders(trade.entry_side)
+ filled_exits = trade.select_filled_orders(trade.exit_side)
+ count_of_entries = trade.nr_of_successful_entries
+ count_of_exits = trade.nr_of_successful_exits
+
+ if (count_of_entries == 0):
+ return None
+
+ is_rebuy = False
+
+ if (0 < count_of_entries <= self.pa_rebuy_mode_bear_max):
+ if (
+ (current_profit < self.pa_rebuy_mode_bear_pcts[count_of_entries - 1])
+ and (
+ (last_candle['rsi_3'] > 10.0)
+ and (last_candle['rsi_14'] < 40.0)
+ and (last_candle['rsi_3_1h'] > 10.0)
+ and (last_candle['close_max_48'] < (last_candle['close'] * 1.1))
+ and (last_candle['btc_pct_close_max_72_5m'] < 1.03)
+ )
+ ):
+ is_rebuy = True
+
+ if is_rebuy:
+ # This returns first order stake size
+ stake_amount = filled_entries[0].cost
+ print('rebuying..')
+ stake_amount = stake_amount * self.pa_rebuy_mode_bear_multi[count_of_entries - 1]
+ return stake_amount
+
+ return None
+
+ def informative_pairs(self):
+ # get access to all pairs available in whitelist.
+ pairs = self.dp.current_whitelist()
+ # Assign tf to each pair so they can be downloaded and cached for strategy.
+ informative_pairs = []
+ for info_timeframe in self.info_timeframes:
+ informative_pairs.extend([(pair, info_timeframe) for pair in pairs])
+
+ if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP']:
+ btc_info_pair = f"BTC/{self.config['stake_currency']}"
+ else:
+ btc_info_pair = "BTC/USDT"
+
+ informative_pairs.extend([(btc_info_pair, btc_info_timeframe) for btc_info_timeframe in self.btc_info_timeframes])
+
+ return informative_pairs
+
+ def informative_1d_indicators(self, metadata: dict, info_timeframe) -> DataFrame:
+ tik = time.perf_counter()
+ assert self.dp, "DataProvider is required for multiple timeframes."
+ # Get the informative pair
+ informative_1d = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=info_timeframe)
+
+ # Indicators
+ # -----------------------------------------------------------------------------------------
+ # RSI
+ informative_1d['rsi_14'] = ta.RSI(informative_1d, timeperiod=14)
+
+ # CTI
+ informative_1d['cti_20'] = pta.cti(informative_1d["close"], length=20)
+
+ # Pivots
+ informative_1d['pivot'], informative_1d['res1'], informative_1d['res2'], informative_1d['res3'], informative_1d['sup1'], informative_1d['sup2'], informative_1d['sup3'] = pivot_points(informative_1d, mode='fibonacci')
+
+ # S/R
+ res_series = informative_1d['high'].rolling(window = 5, center=True).apply(lambda row: is_resistance(row), raw=True).shift(2)
+ sup_series = informative_1d['low'].rolling(window = 5, center=True).apply(lambda row: is_support(row), raw=True).shift(2)
+ informative_1d['res_level'] = Series(np.where(res_series, np.where(informative_1d['close'] > informative_1d['open'], informative_1d['close'], informative_1d['open']), float('NaN'))).ffill()
+ informative_1d['res_hlevel'] = Series(np.where(res_series, informative_1d['high'], float('NaN'))).ffill()
+ informative_1d['sup_level'] = Series(np.where(sup_series, np.where(informative_1d['close'] < informative_1d['open'], informative_1d['close'], informative_1d['open']), float('NaN'))).ffill()
+
+ # Downtrend checks
+ informative_1d['is_downtrend_3'] = ((informative_1d['close'] < informative_1d['open']) & (informative_1d['close'].shift(1) < informative_1d['open'].shift(1)) & (informative_1d['close'].shift(2) < informative_1d['open'].shift(2)))
+
+ informative_1d['is_downtrend_5'] = ((informative_1d['close'] < informative_1d['open']) & (informative_1d['close'].shift(1) < informative_1d['open'].shift(1)) & (informative_1d['close'].shift(2) < informative_1d['open'].shift(2)) & (informative_1d['close'].shift(3) < informative_1d['open'].shift(3)) & (informative_1d['close'].shift(4) < informative_1d['open'].shift(4)))
+
+ # Wicks
+ informative_1d['top_wick_pct'] = ((informative_1d['high'] - np.maximum(informative_1d['open'], informative_1d['close'])) / np.maximum(informative_1d['open'], informative_1d['close']))
+
+ # Candle change
+ informative_1d['change_pct'] = (informative_1d['close'] - informative_1d['open']) / informative_1d['open']
+
+ # Performance logging
+ # -----------------------------------------------------------------------------------------
+ tok = time.perf_counter()
+ log.debug(f"[{metadata['pair']}] informative_1d_indicators took: {tok - tik:0.4f} seconds.")
+
+ return informative_1d
+
+ def informative_4h_indicators(self, metadata: dict, info_timeframe) -> DataFrame:
+ tik = time.perf_counter()
+ assert self.dp, "DataProvider is required for multiple timeframes."
+ # Get the informative pair
+ informative_4h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=info_timeframe)
+
+ # Indicators
+ # -----------------------------------------------------------------------------------------
+ # RSI
+ informative_4h['rsi_14'] = ta.RSI(informative_4h, timeperiod=14, fillna=True)
+
+ informative_4h['rsi_14_max_6'] = informative_4h['rsi_14'].rolling(6).max()
+
+ # EMA
+ informative_4h['ema_12'] = ta.EMA(informative_4h, timeperiod=12)
+ informative_4h['ema_26'] = ta.EMA(informative_4h, timeperiod=26)
+ informative_4h['ema_50'] = ta.EMA(informative_4h, timeperiod=50)
+ informative_4h['ema_100'] = ta.EMA(informative_4h, timeperiod=100)
+ informative_4h['ema_200'] = ta.EMA(informative_4h, timeperiod=200)
+
+ # SMA
+ informative_4h['sma_12'] = ta.SMA(informative_4h, timeperiod=12)
+ informative_4h['sma_26'] = ta.SMA(informative_4h, timeperiod=26)
+ informative_4h['sma_50'] = ta.SMA(informative_4h, timeperiod=50)
+ informative_4h['sma_200'] = ta.SMA(informative_4h, timeperiod=200)
+
+ # Williams %R
+ informative_4h['r_14'] = williams_r(informative_4h, period=14)
+ informative_4h['r_480'] = williams_r(informative_4h, period=480)
+
+ # CTI
+ informative_4h['cti_20'] = pta.cti(informative_4h["close"], length=20)
+
+ # S/R
+ res_series = informative_4h['high'].rolling(window = 5, center=True).apply(lambda row: is_resistance(row), raw=True).shift(2)
+ sup_series = informative_4h['low'].rolling(window = 5, center=True).apply(lambda row: is_support(row), raw=True).shift(2)
+ informative_4h['res_level'] = Series(np.where(res_series, np.where(informative_4h['close'] > informative_4h['open'], informative_4h['close'], informative_4h['open']), float('NaN'))).ffill()
+ informative_4h['res_hlevel'] = Series(np.where(res_series, informative_4h['high'], float('NaN'))).ffill()
+ informative_4h['sup_level'] = Series(np.where(sup_series, np.where(informative_4h['close'] < informative_4h['open'], informative_4h['close'], informative_4h['open']), float('NaN'))).ffill()
+
+ # Downtrend checks
+ informative_4h['not_downtrend'] = ((informative_4h['close'] > informative_4h['close'].shift(2)) | (informative_4h['rsi_14'] > 50.0))
+
+ informative_4h['is_downtrend_3'] = ((informative_4h['close'] < informative_4h['open']) & (informative_4h['close'].shift(1) < informative_4h['open'].shift(1)) & (informative_4h['close'].shift(2) < informative_4h['open'].shift(2)))
+
+ # Wicks
+ informative_4h['top_wick_pct'] = ((informative_4h['high'] - np.maximum(informative_4h['open'], informative_4h['close'])) / np.maximum(informative_4h['open'], informative_4h['close']))
+
+ # Candle change
+ informative_4h['change_pct'] = (informative_4h['close'] - informative_4h['open']) / informative_4h['open']
+
+ # Max highs
+ informative_4h['high_max_3'] = informative_4h['high'].rolling(3).max()
+ informative_4h['high_max_12'] = informative_4h['high'].rolling(12).max()
+ informative_4h['high_max_24'] = informative_4h['high'].rolling(24).max()
+ informative_4h['high_max_36'] = informative_4h['high'].rolling(36).max()
+ informative_4h['high_max_48'] = informative_4h['high'].rolling(48).max()
+
+ informative_4h['pct_change_high_max_1_12'] = (informative_4h['high'] - informative_4h['high_max_12']) / informative_4h['high_max_12']
+ informative_4h['pct_change_high_max_3_12'] = (informative_4h['high_max_3'] - informative_4h['high_max_12']) / informative_4h['high_max_12']
+ informative_4h['pct_change_high_max_3_24'] = (informative_4h['high_max_3'] - informative_4h['high_max_24']) / informative_4h['high_max_24']
+ informative_4h['pct_change_high_max_3_36'] = (informative_4h['high_max_3'] - informative_4h['high_max_36']) / informative_4h['high_max_36']
+ informative_4h['pct_change_high_max_3_48'] = (informative_4h['high_max_3'] - informative_4h['high_max_48']) / informative_4h['high_max_48']
+
+ # Volume
+ informative_4h['volume_mean_factor_6'] = informative_4h['volume'] / informative_4h['volume'].rolling(6).mean()
+
+ # Performance logging
+ # -----------------------------------------------------------------------------------------
+ tok = time.perf_counter()
+ log.debug(f"[{metadata['pair']}] informative_1d_indicators took: {tok - tik:0.4f} seconds.")
+
+ return informative_4h
+
+ def informative_1h_indicators(self, metadata: dict, info_timeframe) -> DataFrame:
+ tik = time.perf_counter()
+ assert self.dp, "DataProvider is required for multiple timeframes."
+ # Get the informative pair
+ informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=info_timeframe)
+
+ # Indicators
+ # -----------------------------------------------------------------------------------------
+ # RSI
+ informative_1h['rsi_3'] = ta.RSI(informative_1h, timeperiod=3)
+ informative_1h['rsi_14'] = ta.RSI(informative_1h, timeperiod=14)
+
+ # EMA
+ informative_1h['ema_12'] = ta.EMA(informative_1h, timeperiod=12)
+ informative_1h['ema_26'] = ta.EMA(informative_1h, timeperiod=26)
+ informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)
+ informative_1h['ema_100'] = ta.EMA(informative_1h, timeperiod=100)
+ informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)
+
+ # SMA
+ informative_1h['sma_12'] = ta.SMA(informative_1h, timeperiod=12)
+ informative_1h['sma_26'] = ta.SMA(informative_1h, timeperiod=26)
+ informative_1h['sma_50'] = ta.SMA(informative_1h, timeperiod=50)
+ informative_1h['sma_100'] = ta.SMA(informative_1h, timeperiod=100)
+ informative_1h['sma_200'] = ta.SMA(informative_1h, timeperiod=200)
+
+ # BB
+ bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(informative_1h), window=20, stds=2)
+ informative_1h['bb20_2_low'] = bollinger['lower']
+ informative_1h['bb20_2_mid'] = bollinger['mid']
+ informative_1h['bb20_2_upp'] = bollinger['upper']
+
+ informative_1h['bb20_2_width'] = ((informative_1h['bb20_2_upp'] - informative_1h['bb20_2_low']) / informative_1h['bb20_2_mid'])
+
+ # Williams %R
+ informative_1h['r_14'] = williams_r(informative_1h, period=14)
+ informative_1h['r_96'] = williams_r(informative_1h, period=96)
+ informative_1h['r_480'] = williams_r(informative_1h, period=480)
+
+ # CTI
+ informative_1h['cti_20'] = pta.cti(informative_1h["close"], length=20)
+ informative_1h['cti_40'] = pta.cti(informative_1h["close"], length=40)
+
+ # S/R
+ res_series = informative_1h['high'].rolling(window = 5, center=True).apply(lambda row: is_resistance(row), raw=True).shift(2)
+ sup_series = informative_1h['low'].rolling(window = 5, center=True).apply(lambda row: is_support(row), raw=True).shift(2)
+ informative_1h['res_level'] = Series(np.where(res_series, np.where(informative_1h['close'] > informative_1h['open'], informative_1h['close'], informative_1h['open']), float('NaN'))).ffill()
+ informative_1h['res_hlevel'] = Series(np.where(res_series, informative_1h['high'], float('NaN'))).ffill()
+ informative_1h['sup_level'] = Series(np.where(sup_series, np.where(informative_1h['close'] < informative_1h['open'], informative_1h['close'], informative_1h['open']), float('NaN'))).ffill()
+
+ # Pump protections
+ informative_1h['hl_pct_change_48'] = range_percent_change(self, informative_1h, 'HL', 48)
+ informative_1h['hl_pct_change_36'] = range_percent_change(self, informative_1h, 'HL', 36)
+ informative_1h['hl_pct_change_24'] = range_percent_change(self, informative_1h, 'HL', 24)
+ informative_1h['hl_pct_change_12'] = range_percent_change(self, informative_1h, 'HL', 12)
+ informative_1h['hl_pct_change_6'] = range_percent_change(self, informative_1h, 'HL', 6)
+
+ # Downtrend checks
+ informative_1h['not_downtrend'] = ((informative_1h['close'] > informative_1h['close'].shift(2)) | (informative_1h['rsi_14'] > 50.0))
+
+ informative_1h['is_downtrend_3'] = ((informative_1h['close'] < informative_1h['open']) & (informative_1h['close'].shift(1) < informative_1h['open'].shift(1)) & (informative_1h['close'].shift(2) < informative_1h['open'].shift(2)))
+
+ informative_1h['is_downtrend_5'] = ((informative_1h['close'] < informative_1h['open']) & (informative_1h['close'].shift(1) < informative_1h['open'].shift(1)) & (informative_1h['close'].shift(2) < informative_1h['open'].shift(2)) & (informative_1h['close'].shift(3) < informative_1h['open'].shift(3)) & (informative_1h['close'].shift(4) < informative_1h['open'].shift(4)))
+
+ # Wicks
+ informative_1h['top_wick_pct'] = ((informative_1h['high'] - np.maximum(informative_1h['open'], informative_1h['close'])) / np.maximum(informative_1h['open'], informative_1h['close']))
+
+ # Candle change
+ informative_1h['change_pct'] = (informative_1h['close'] - informative_1h['open']) / informative_1h['open']
+
+ # Max highs
+ informative_1h['high_max_3'] = informative_1h['high'].rolling(3).max()
+ informative_1h['high_max_6'] = informative_1h['high'].rolling(6).max()
+ informative_1h['high_max_12'] = informative_1h['high'].rolling(12).max()
+ informative_1h['high_max_24'] = informative_1h['high'].rolling(24).max()
+ informative_1h['high_max_36'] = informative_1h['high'].rolling(36).max()
+ informative_1h['high_max_48'] = informative_1h['high'].rolling(48).max()
+
+ informative_1h['pct_change_high_max_3_12'] = (informative_1h['high_max_3'] - informative_1h['high_max_12']) / informative_1h['high_max_12']
+ informative_1h['pct_change_high_max_6_12'] = (informative_1h['high_max_6'] - informative_1h['high_max_12']) / informative_1h['high_max_12']
+ informative_1h['pct_change_high_max_6_24'] = (informative_1h['high_max_6'] - informative_1h['high_max_24']) / informative_1h['high_max_24']
+
+ # Volume
+ informative_1h['volume_mean_factor_12'] = informative_1h['volume'] / informative_1h['volume'].rolling(12).mean()
+
+ # Performance logging
+ # -----------------------------------------------------------------------------------------
+ tok = time.perf_counter()
+ log.debug(f"[{metadata['pair']}] informative_1h_indicators took: {tok - tik:0.4f} seconds.")
+
+ return informative_1h
+
+ def informative_15m_indicators(self, metadata: dict, info_timeframe) -> DataFrame:
+ tik = time.perf_counter()
+ assert self.dp, "DataProvider is required for multiple timeframes."
+
+ # Get the informative pair
+ informative_15m = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=info_timeframe)
+
+ # Indicators
+ # -----------------------------------------------------------------------------------------
+
+ # RSI
+ informative_15m['rsi_3'] = ta.RSI(informative_15m, timeperiod=3)
+ informative_15m['rsi_14'] = ta.RSI(informative_15m, timeperiod=14)
+
+ # SMA
+ informative_15m['sma_200'] = ta.SMA(informative_15m, timeperiod=200)
+
+ # CTI
+ informative_15m['cti_20'] = pta.cti(informative_15m["close"], length=20)
+
+ # Downtrend check
+ informative_15m['not_downtrend'] = ((informative_15m['close'] > informative_15m['open']) | (informative_15m['close'].shift(1) > informative_15m['open'].shift(1)) | (informative_15m['close'].shift(2) > informative_15m['open'].shift(2)) | (informative_15m['rsi_14'] > 50.0) | (informative_15m['rsi_3'] > 25.0))
+
+ # Volume
+ informative_15m['volume_mean_factor_12'] = informative_15m['volume'] / informative_15m['volume'].rolling(12).mean()
+
+ # Performance logging
+ # -----------------------------------------------------------------------------------------
+ tok = time.perf_counter()
+ log.debug(f"[{metadata['pair']}] informative_15m_indicators took: {tok - tik:0.4f} seconds.")
+
+ return informative_15m
+
+ # Coin Pair Base Timeframe Indicators
+ # ---------------------------------------------------------------------------------------------
+ def base_tf_5m_indicators(self, metadata: dict, dataframe: DataFrame) -> DataFrame:
+ tik = time.perf_counter()
+
+ # Indicators
+ # -----------------------------------------------------------------------------------------
+ # RSI
+ dataframe['rsi_3'] = ta.RSI(dataframe, timeperiod=3)
+ dataframe['rsi_14'] = ta.RSI(dataframe, timeperiod=14)
+
+ # EMA
+ dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)
+ dataframe['ema_16'] = ta.EMA(dataframe, timeperiod=16)
+ dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)
+ dataframe['ema_50'] = ta.EMA(dataframe, timeperiod=50)
+ dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)
+
+ dataframe['ema_200_pct_change_144'] = ((dataframe['ema_200'] - dataframe['ema_200'].shift(144)) / dataframe['ema_200'].shift(144))
+ dataframe['ema_200_pct_change_288'] = ((dataframe['ema_200'] - dataframe['ema_200'].shift(288)) / dataframe['ema_200'].shift(288))
+
+ # SMA
+ dataframe['sma_50'] = ta.SMA(dataframe, timeperiod=50)
+ dataframe['sma_200'] = ta.SMA(dataframe, timeperiod=200)
+
+ # BB 20 - STD2
+ bb_20_std2 = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)
+ dataframe['bb20_2_low'] = bb_20_std2['lower']
+ dataframe['bb20_2_mid'] = bb_20_std2['mid']
+ dataframe['bb20_2_upp'] = bb_20_std2['upper']
+
+ # BB 40 - STD2
+ bb_40_std2 = qtpylib.bollinger_bands(dataframe['close'], window=40, stds=2)
+ dataframe['bb40_2_low'] = bb_40_std2['lower']
+ dataframe['bb40_2_mid'] = bb_40_std2['mid']
+ dataframe['bb40_2_delta'] = (bb_40_std2['mid'] - dataframe['bb40_2_low']).abs()
+ dataframe['bb40_2_tail'] = (dataframe['close'] - dataframe['bb40_2_low']).abs()
+
+ # Williams %R
+ dataframe['r_14'] = williams_r(dataframe, period=14)
+ dataframe['r_480'] = williams_r(dataframe, period=480)
+
+ # CTI
+ dataframe['cti_20'] = pta.cti(dataframe["close"], length=20)
+
+ # Heiken Ashi
+ heikinashi = qtpylib.heikinashi(dataframe)
+ dataframe['ha_open'] = heikinashi['open']
+ dataframe['ha_close'] = heikinashi['close']
+ dataframe['ha_high'] = heikinashi['high']
+ dataframe['ha_low'] = heikinashi['low']
+
+ # Dip protection
+ dataframe['tpct_change_0'] = top_percent_change(self, dataframe, 0)
+ dataframe['tpct_change_2'] = top_percent_change(self, dataframe, 2)
+
+ # Close max
+ dataframe['close_max_12'] = dataframe['close'].rolling(12).max()
+ dataframe['close_max_24'] = dataframe['close'].rolling(24).max()
+ dataframe['close_max_48'] = dataframe['close'].rolling(48).max()
+
+ dataframe['pct_close_max_48'] = (dataframe['close_max_48'] - dataframe['close']) / dataframe['close']
+
+ # Close delta
+ dataframe['close_delta'] = (dataframe['close'] - dataframe['close'].shift()).abs()
+
+ # For sell checks
+ dataframe['crossed_below_ema_12_26'] = qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26'])
+
+ # Global protections
+ # -----------------------------------------------------------------------------------------
+ if not self.config['runmode'].value in ('live', 'dry_run'):
+ # Backtest age filter
+ dataframe['bt_agefilter_ok'] = False
+ dataframe.loc[dataframe.index > (12 * 24 * self.bt_min_age_days),'bt_agefilter_ok'] = True
+ else:
+ # Exchange downtime protection
+ dataframe['live_data_ok'] = (dataframe['volume'].rolling(window=72, min_periods=72).min() > 0)
+
+ # Performance logging
+ # -----------------------------------------------------------------------------------------
+ tok = time.perf_counter()
+ log.debug(f"[{metadata['pair']}] base_tf_5m_indicators took: {tok - tik:0.4f} seconds.")
+
+ return dataframe
+
+ # Coin Pair Indicator Switch Case
+ # ---------------------------------------------------------------------------------------------
+ def info_switcher(self, metadata: dict, info_timeframe) -> DataFrame:
+ if info_timeframe == '1d':
+ return self.informative_1d_indicators(metadata, info_timeframe)
+ elif info_timeframe == '4h':
+ return self.informative_4h_indicators(metadata, info_timeframe)
+ elif info_timeframe == '1h':
+ return self.informative_1h_indicators(metadata, info_timeframe)
+ elif info_timeframe == '15m':
+ return self.informative_15m_indicators(metadata, info_timeframe)
+ else:
+ raise RuntimeError(f"{info_timeframe} not supported as informative timeframe for BTC pair.")
+
+ # BTC 1D Indicators
+ # ---------------------------------------------------------------------------------------------
+ def btc_info_1d_indicators(self, btc_info_pair, btc_info_timeframe, metadata: dict) -> DataFrame:
+ tik = time.perf_counter()
+ btc_info_1d = self.dp.get_pair_dataframe(btc_info_pair, btc_info_timeframe)
+ # Indicators
+ # -----------------------------------------------------------------------------------------
+ btc_info_1d['rsi_14'] = ta.RSI(btc_info_1d, timeperiod=14)
+ #btc_info_1d['pivot'], btc_info_1d['res1'], btc_info_1d['res2'], btc_info_1d['res3'], btc_info_1d['sup1'], btc_info_1d['sup2'], btc_info_1d['sup3'] = pivot_points(btc_info_1d, mode='fibonacci')
+
+ # Add prefix
+ # -----------------------------------------------------------------------------------------
+ ignore_columns = ['date']
+ btc_info_1d.rename(columns=lambda s: f"btc_{s}" if s not in ignore_columns else s, inplace=True)
+
+ tok = time.perf_counter()
+ log.debug(f"[{metadata['pair']}] btc_info_1d_indicators took: {tok - tik:0.4f} seconds.")
+
+ return btc_info_1d
+
+ # BTC 4h Indicators
+ # ---------------------------------------------------------------------------------------------
+ def btc_info_4h_indicators(self, btc_info_pair, btc_info_timeframe, metadata: dict) -> DataFrame:
+ tik = time.perf_counter()
+ btc_info_4h = self.dp.get_pair_dataframe(btc_info_pair, btc_info_timeframe)
+ # Indicators
+ # -----------------------------------------------------------------------------------------
+ # RSI
+ btc_info_4h['rsi_14'] = ta.RSI(btc_info_4h, timeperiod=14)
+
+ # SMA
+ btc_info_4h['sma_200'] = ta.SMA(btc_info_4h, timeperiod=200)
+
+ # Bull market or not
+ btc_info_4h['is_bull'] = btc_info_4h['close'] > btc_info_4h['sma_200']
+
+ # Add prefix
+ # -----------------------------------------------------------------------------------------
+ ignore_columns = ['date']
+ btc_info_4h.rename(columns=lambda s: f"btc_{s}" if s not in ignore_columns else s, inplace=True)
+
+ tok = time.perf_counter()
+ log.debug(f"[{metadata['pair']}] btc_info_4h_indicators took: {tok - tik:0.4f} seconds.")
+
+ return btc_info_4h
+
+ # BTC 1h Indicators
+ # ---------------------------------------------------------------------------------------------
+ def btc_info_1h_indicators(self, btc_info_pair, btc_info_timeframe, metadata: dict) -> DataFrame:
+ tik = time.perf_counter()
+ btc_info_1h = self.dp.get_pair_dataframe(btc_info_pair, btc_info_timeframe)
+ # Indicators
+ # -----------------------------------------------------------------------------------------
+ # RSI
+ btc_info_1h['rsi_14'] = ta.RSI(btc_info_1h, timeperiod=14)
+
+ btc_info_1h['not_downtrend'] = ((btc_info_1h['close'] > btc_info_1h['close'].shift(2)) | (btc_info_1h['rsi_14'] > 50))
+
+ # Add prefix
+ # -----------------------------------------------------------------------------------------
+ ignore_columns = ['date']
+ btc_info_1h.rename(columns=lambda s: f"btc_{s}" if s not in ignore_columns else s, inplace=True)
+
+ tok = time.perf_counter()
+ log.debug(f"[{metadata['pair']}] btc_info_1h_indicators took: {tok - tik:0.4f} seconds.")
+
+ return btc_info_1h
+
+ # BTC 15m Indicators
+ # ---------------------------------------------------------------------------------------------
+ def btc_info_15m_indicators(self, btc_info_pair, btc_info_timeframe, metadata: dict) -> DataFrame:
+ tik = time.perf_counter()
+ btc_info_15m = self.dp.get_pair_dataframe(btc_info_pair, btc_info_timeframe)
+ # Indicators
+ # -----------------------------------------------------------------------------------------
+ btc_info_15m['rsi_14'] = ta.RSI(btc_info_15m, timeperiod=14)
+
+ # Add prefix
+ # -----------------------------------------------------------------------------------------
+ ignore_columns = ['date']
+ btc_info_15m.rename(columns=lambda s: f"btc_{s}" if s not in ignore_columns else s, inplace=True)
+
+ tok = time.perf_counter()
+ log.debug(f"[{metadata['pair']}] btc_info_15m_indicators took: {tok - tik:0.4f} seconds.")
+
+ return btc_info_15m
+
+ # BTC 5m Indicators
+ # ---------------------------------------------------------------------------------------------
+ def btc_info_5m_indicators(self, btc_info_pair, btc_info_timeframe, metadata: dict) -> DataFrame:
+ tik = time.perf_counter()
+ btc_info_5m = self.dp.get_pair_dataframe(btc_info_pair, btc_info_timeframe)
+ # Indicators
+ # -----------------------------------------------------------------------------------------
+
+ # RSI
+ btc_info_5m['rsi_14'] = ta.RSI(btc_info_5m, timeperiod=14)
+
+ # Close max
+ btc_info_5m['close_max_24'] = btc_info_5m['close'].rolling(24).max()
+ btc_info_5m['close_max_72'] = btc_info_5m['close'].rolling(72).max()
+
+ btc_info_5m['pct_close_max_24'] = (btc_info_5m['close_max_24'] - btc_info_5m['close']) / btc_info_5m['close']
+ btc_info_5m['pct_close_max_72'] = (btc_info_5m['close_max_72'] - btc_info_5m['close']) / btc_info_5m['close']
+
+ # Add prefix
+ # -----------------------------------------------------------------------------------------
+ ignore_columns = ['date']
+ btc_info_5m.rename(columns=lambda s: f"btc_{s}" if s not in ignore_columns else s, inplace=True)
+
+ tok = time.perf_counter()
+ log.debug(f"[{metadata['pair']}] btc_info_5m_indicators took: {tok - tik:0.4f} seconds.")
+
+ return btc_info_5m
+
+ # BTC Indicator Switch Case
+ # ---------------------------------------------------------------------------------------------
+ def btc_info_switcher(self, btc_info_pair, btc_info_timeframe, metadata: dict) -> DataFrame:
+ if btc_info_timeframe == '1d':
+ return self.btc_info_1d_indicators(btc_info_pair, btc_info_timeframe, metadata)
+ elif btc_info_timeframe == '4h':
+ return self.btc_info_4h_indicators(btc_info_pair, btc_info_timeframe, metadata)
+ elif btc_info_timeframe == '1h':
+ return self.btc_info_1h_indicators(btc_info_pair, btc_info_timeframe, metadata)
+ elif btc_info_timeframe == '15m':
+ return self.btc_info_15m_indicators(btc_info_pair, btc_info_timeframe, metadata)
+ elif btc_info_timeframe == '5m':
+ return self.btc_info_5m_indicators(btc_info_pair, btc_info_timeframe, metadata)
+ else:
+ raise RuntimeError(f"{btc_info_timeframe} not supported as informative timeframe for BTC pair.")
+
+ def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ tik = time.perf_counter()
+ '''
+ --> BTC informative indicators
+ ___________________________________________________________________________________________
+ '''
+ if self.config['stake_currency'] in ['USDT','BUSD','USDC','DAI','TUSD','PAX','USD','EUR','GBP']:
+ btc_info_pair = f"BTC/{self.config['stake_currency']}"
+ else:
+ btc_info_pair = "BTC/USDT"
+
+ for btc_info_timeframe in self.btc_info_timeframes:
+ btc_informative = self.btc_info_switcher(btc_info_pair, btc_info_timeframe, metadata)
+ dataframe = merge_informative_pair(dataframe, btc_informative, self.timeframe, btc_info_timeframe, ffill=True)
+ # Customize what we drop - in case we need to maintain some BTC informative ohlcv data
+ # Default drop all
+ drop_columns = {
+ '1d': [f"btc_{s}_{btc_info_timeframe}" for s in ['date', 'open', 'high', 'low', 'close', 'volume']],
+ '4h': [f"btc_{s}_{btc_info_timeframe}" for s in ['date', 'open', 'high', 'low', 'close', 'volume']],
+ '1h': [f"btc_{s}_{btc_info_timeframe}" for s in ['date', 'open', 'high', 'low', 'close', 'volume']],
+ '15m': [f"btc_{s}_{btc_info_timeframe}" for s in ['date', 'open', 'high', 'low', 'close', 'volume']],
+ '5m': [f"btc_{s}_{btc_info_timeframe}" for s in ['date', 'open', 'high', 'low', 'close', 'volume']],
+ }.get(btc_info_timeframe,[f"{s}_{btc_info_timeframe}" for s in ['date', 'open', 'high', 'low', 'close', 'volume']])
+ drop_columns.append(f"date_{btc_info_timeframe}")
+ dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)
+
+ '''
+ --> Indicators on informative timeframes
+ ___________________________________________________________________________________________
+ '''
+ for info_timeframe in self.info_timeframes:
+ info_indicators = self.info_switcher(metadata, info_timeframe)
+ dataframe = merge_informative_pair(dataframe, info_indicators, self.timeframe, info_timeframe, ffill=True)
+ # Customize what we drop - in case we need to maintain some informative timeframe ohlcv data
+ # Default drop all except base timeframe ohlcv data
+ drop_columns = {
+ '1d': [f"{s}_{info_timeframe}" for s in ['date', 'open', 'high', 'low', 'close', 'volume']],
+ '4h': [f"{s}_{info_timeframe}" for s in ['date', 'open', 'high', 'low', 'close', 'volume']],
+ '1h': [f"{s}_{info_timeframe}" for s in ['date', 'open', 'high', 'low', 'close', 'volume']],
+ '15m': [f"{s}_{info_timeframe}" for s in ['date', 'open', 'high', 'low', 'close', 'volume']]
+ }.get(info_timeframe,[f"{s}_{info_timeframe}" for s in ['date', 'open', 'high', 'low', 'close', 'volume']])
+ dataframe.drop(columns=dataframe.columns.intersection(drop_columns), inplace=True)
+
+ '''
+ --> The indicators for the base timeframe (5m)
+ ___________________________________________________________________________________________
+ '''
+ dataframe = self.base_tf_5m_indicators(metadata, dataframe)
+
+ tok = time.perf_counter()
+ log.debug(f"[{metadata['pair']}] Populate indicators took a total of: {tok - tik:0.4f} seconds.")
+
+ return dataframe
+
+ def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ conditions = []
+ dataframe.loc[:, 'enter_tag'] = ''
+
+ # the number of free slots
+ current_free_slots = self.config["max_open_trades"] - len(LocalTrade.get_trades_proxy(is_open=True))
+
+ for buy_enable in self.buy_params:
+ index = int(buy_enable.split('_')[2])
+ item_buy_protection_list = [True]
+ if self.buy_params[f'{buy_enable}']:
+
+ # Buy conditions
+ # -----------------------------------------------------------------------------------------
+ item_buy_logic = []
+ item_buy_logic.append(reduce(lambda x, y: x & y, item_buy_protection_list))
+
+ # Condition #1 - Long mode bull. Uptrend.
+ if index == 1:
+ # Protections
+ item_buy_logic.append(dataframe['btc_is_bull_4h'])
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+ item_buy_logic.append(dataframe['close_max_12'] < (dataframe['close'] * 1.16))
+ item_buy_logic.append(dataframe['close_max_48'] < (dataframe['close'] * 1.3))
+ item_buy_logic.append(dataframe['high_max_24_1h'] < (dataframe['close'] * 1.36))
+ item_buy_logic.append(dataframe['high_max_48_1h'] < (dataframe['close'] * 1.4))
+ item_buy_logic.append(dataframe['high_max_48_4h'] < (dataframe['close'] * 1.5))
+ item_buy_logic.append(dataframe['hl_pct_change_24_1h'] < 0.5)
+ item_buy_logic.append(dataframe['hl_pct_change_48_1h'] < 0.75)
+
+ item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_200_1h'])
+
+ item_buy_logic.append(dataframe['cti_20_1h'] < 0.95)
+ item_buy_logic.append(dataframe['rsi_14_1d'] < 80.0)
+ item_buy_logic.append(dataframe['r_14_1h'] < -25.0)
+ item_buy_logic.append(dataframe['r_14_4h'] < -25.0)
+
+ # curent 4h long red, overbought 4h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.08)
+ | (dataframe['cti_20_4h'] < 0.85))
+ # current 1d red with top wick, overbought 1d
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.04)
+ | (dataframe['top_wick_pct_1d'] < 0.04)
+ | (dataframe['rsi_14_1d'] < 70.0))
+ # current 1d long green, current 4h red with top wick, overbought 1d
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.2)
+ | (dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.04)
+ | (dataframe['cti_20_1d'] < 0.8))
+ # current 4h red with top wick, drop in last 4 hours
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.08)
+ | (dataframe['top_wick_pct_4h'] < 0.08)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16)))
+ # current 4h long red, drop in the last 4h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.1)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12)))
+ # current 4h green with top wick, current 1d red, overbought 1d
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.08)
+ | (dataframe['change_pct_1d'] > -0.04)
+ | (dataframe['cti_20_1d'] < 0.85))
+ # current 4h green with top wick, previous high is higher than current high
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.01)
+ | (dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 3.0))
+ | (dataframe['pct_change_high_max_3_24_4h'] > -0.1))
+ # current 4h with relative long top wick, drop in the last 4h
+ item_buy_logic.append((dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 10.0))
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1)))
+ #current 4h red, current higher lower than previous high, downtrend 4h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['pct_change_high_max_3_24_4h'] > -0.12)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # current 4h red, overbought 4h, downtrend 4h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['cti_20_4h'] < 0.85)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # current 4h long red
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.12)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['cti_20_1h'] < -0.5))
+ # current 1d long green with top long wick
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.12)
+ | (dataframe['top_wick_pct_1d'] < 0.12))
+ # current 1d long red, overbought 1d
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.12)
+ | (dataframe['cti_20_1d'] < 0.85))
+ # current 1d red with top wick, overbought 1d
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.06)
+ | (dataframe['top_wick_pct_1d'] < 0.06)
+ | (dataframe['cti_20_1d'] < 0.9))
+ # current 1d long red, overbought 1d, drop in the last 4h
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.04)
+ | (dataframe['cti_20_1d'] < 0.9)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12)))
+ # current 1d red, previous 1d red with top wick
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.04)
+ | (dataframe['change_pct_1d'].shift(288) > -0.04)
+ | (dataframe['top_wick_pct_1d'].shift(288) < 0.04)
+ | (dataframe['cti_20_1d'] < 0.5))
+ # current 1d red, previous 1d red with top wick
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.02)
+ | (dataframe['change_pct_1d'].shift(288) > -0.02)
+ | (dataframe['top_wick_pct_1d'].shift(288) < 0.02)
+ | (dataframe['rsi_14_1d'] < 70.0))
+ # current 1d green with top wick
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.04)
+ | (dataframe['top_wick_pct_1d'] < 0.04)
+ | (dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['is_downtrend_3_1h'] == False))
+ # current 1d red, previous 1d red, overbought 1d
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.0)
+ | (dataframe['change_pct_1d'].shift(288) > -0.0)
+ | (dataframe['cti_20_1d'] < 0.9))
+ # current 1d green, overbought 4h
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.12)
+ | (dataframe['cti_20_4h'] < 0.8))
+ # drop while near there was overbought 4h
+ item_buy_logic.append((dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['rsi_14_max_6_4h'] < 80.0)
+ | (dataframe['cti_20_4h'] < 0.5))
+ # current 4h downtrend, drop in last 24h
+ item_buy_logic.append((dataframe['is_downtrend_3_4h'] == False)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['high_max_24_1h'] < (dataframe['close'] * 1.2)))
+ # current 4h downtrend, overbought 4h
+ item_buy_logic.append((dataframe['is_downtrend_3_4h'] == False)
+ | (dataframe['cti_20_4h'] < 0.85))
+ item_buy_logic.append((dataframe['is_downtrend_3_4h'] == False)
+ | (dataframe['change_pct_1d'] < 0.12))
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['rsi_14_1d'] < 70.0))
+ # current 1d long top wick
+ item_buy_logic.append(dataframe['top_wick_pct_1d'] < (abs(dataframe['change_pct_1d']) * 10.0))
+ item_buy_logic.append((dataframe['is_downtrend_3_1h'] == False)
+ | (dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_4h'] < 0.5))
+ item_buy_logic.append((dataframe['is_downtrend_3_1h'] == False)
+ | (dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_1d'] < 0.75))
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])
+ item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.016))
+ item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))
+ item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))
+
+ # Condition #2 - Normal mode bull.
+ if index == 2:
+ # Protections
+ item_buy_logic.append(dataframe['btc_is_bull_4h'])
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+ item_buy_logic.append((dataframe['tpct_change_0'] < 0.034))
+ item_buy_logic.append(dataframe['close_max_12'] < (dataframe['close'] * 1.2))
+ item_buy_logic.append(dataframe['close_max_48'] < (dataframe['close'] * 1.26))
+ item_buy_logic.append(dataframe['high_max_6_1h'] < (dataframe['close'] * 1.3))
+ item_buy_logic.append(dataframe['high_max_12_1h'] < (dataframe['close'] * 1.36))
+ item_buy_logic.append(dataframe['high_max_24_1h'] < (dataframe['close'] * 1.4))
+ item_buy_logic.append(dataframe['high_max_48_1h'] < (dataframe['close'] * 1.5))
+
+ item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(48))
+
+ item_buy_logic.append(dataframe['cti_20_1h'] < 0.5)
+ item_buy_logic.append(dataframe['cti_20_4h'] < 0.95)
+ item_buy_logic.append(dataframe['rsi_14_1d'] < 80.0)
+ item_buy_logic.append(dataframe['r_14_4h'] < -25.0)
+
+ item_buy_logic.append(dataframe['not_downtrend_15m'])
+
+ # current 4h green with top wick
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.04))
+ # current 4h red, overbought, 4h downtrend
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.06)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # current 4h long red
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.1)
+ | (dataframe['cti_20_4h'] < 0.85))
+ # current 4h red with top wick
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.02)
+ | (dataframe['top_wick_pct_4h'] < 0.02)
+ | (dataframe['cti_20_4h'] < 0.85))
+ # 3 4h red
+ item_buy_logic.append((dataframe['is_downtrend_3_4h'] == False)
+ | (dataframe['cti_20_4h'] < 0.5))
+ # current and previous 4h red
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.0)
+ | (dataframe['change_pct_4h'].shift(48) > -0.0)
+ | (dataframe['rsi_14_4h'] < 50.0)
+ | (dataframe['cti_20_4h'] < 0.5))
+ item_buy_logic.append((dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # currend 1d red with top wick
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.12)
+ | (dataframe['top_wick_pct_1d'] < 0.12))
+ # currend 1d green with top wick
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.12)
+ | (dataframe['top_wick_pct_1d'] < 0.12))
+ # currend 1d red with top wick
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.06)
+ | (dataframe['top_wick_pct_1d'] < 0.06)
+ | (dataframe['rsi_14_1d'] < 70.0))
+ # current 1d green with top wick, current 4h red
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.06)
+ | (dataframe['top_wick_pct_1d'] < 0.06)
+ | (dataframe['change_pct_4h'] > -0.06)
+ | (dataframe['cti_20_4h'] < 0.8))
+ # current 1d red
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.05)
+ | (dataframe['rsi_14_1d'] < 70.0)
+ | (dataframe['cti_20_1d'] < 0.85))
+ # current 1d red
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.12)
+ | (dataframe['cti_20_1d'] < 0.8))
+
+ # Logic
+ item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.04))
+ item_buy_logic.append(dataframe['close_delta'].gt(dataframe['close'] * 0.02))
+ item_buy_logic.append(dataframe['bb40_2_tail'].lt(dataframe['bb40_2_delta'] * 0.2))
+ item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))
+ item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))
+
+ # Condition #3 - Normal mode bull.
+ if index == 3:
+ # Protections
+ item_buy_logic.append(dataframe['btc_is_bull_4h'])
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+ item_buy_logic.append(dataframe['close_max_48'] < (dataframe['close'] * 1.26))
+
+ item_buy_logic.append(dataframe['ema_12_1h'] > dataframe['ema_200_1h'])
+
+ item_buy_logic.append(dataframe['ema_12_4h'] > dataframe['ema_200_4h'])
+
+ item_buy_logic.append(dataframe['rsi_14_4h'] < 75.0)
+ item_buy_logic.append(dataframe['rsi_14_1d'] < 85.0)
+
+ item_buy_logic.append(dataframe['not_downtrend_15m'])
+ item_buy_logic.append(dataframe['not_downtrend_1h'])
+ item_buy_logic.append(dataframe['not_downtrend_4h'])
+ item_buy_logic.append(dataframe['pct_change_high_max_6_24_1h'] > -0.3)
+ item_buy_logic.append(dataframe['pct_change_high_max_3_12_4h'] > -0.4)
+ # current 4h green with wick, overbought 4h
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.1)
+ | (dataframe['top_wick_pct_4h'] < 0.16)
+ | (dataframe['rsi_14_4h'] < 70.0))
+ # current 4h long green, overbought 4h
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.12)
+ | (dataframe['rsi_14_4h'] < 70.0))
+ # current 4h red with top wick
+ item_buy_logic.append((dataframe['change_pct_4h'] > 0.0)
+ | (dataframe['top_wick_pct_4h'] < 0.1)
+ | (dataframe['ema_12_4h'] > dataframe['ema_200_4h']))
+ # current 4h long red
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.1)
+ | (dataframe['rsi_14_max_6_4h'] < 85.0))
+ # current 4h very long top wick
+ item_buy_logic.append((dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 10.0))
+ | (dataframe['rsi_14_max_6_4h'] < 80.0))
+ # current 4h red with top wick
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.06)
+ | (dataframe['rsi_14_max_6_4h'] < 80.0))
+ # current 4h green with top wick
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.04)
+ | (dataframe['rsi_14_4h'] < 70.00))
+ # current 1d long red, previous 1d long green with long top wick
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.2)
+ | (dataframe['change_pct_1d'].shift(288) < 0.2)
+ | (dataframe['top_wick_pct_1d'].shift(288) < 0.2))
+ # current 1d green, overbought 4h
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.12)
+ | (dataframe['rsi_14_4h'] < 70.0)
+ | (dataframe['cti_20_4h'] < 0.8))
+ # current 1d long green with long green wick
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.2)
+ | (dataframe['top_wick_pct_1d'] < 0.2))
+ # current 1d long green, overbought 1d
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.12)
+ | (dataframe['rsi_14_1d'] < 70.0)
+ | (dataframe['cti_20_1d'] < 0.8))
+
+
+ # Logic
+ item_buy_logic.append(dataframe['rsi_14'] < 36.0)
+ item_buy_logic.append(dataframe['ha_close'] > dataframe['ha_open'])
+ item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.018))
+
+ # Condition #4 - Normal mode bull.
+ if index == 4:
+ # Protections
+ item_buy_logic.append(dataframe['btc_is_bull_4h'])
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+ item_buy_logic.append(dataframe['close_max_48'] < (dataframe['close'] * 1.36))
+ item_buy_logic.append(dataframe['high_max_12_1h'] < (dataframe['close'] * 1.4))
+ item_buy_logic.append(dataframe['high_max_24_1h'] < (dataframe['close'] * 1.5))
+
+ item_buy_logic.append(dataframe['cti_20_1h'] < 0.9)
+ item_buy_logic.append(dataframe['cti_20_4h'] < 0.9)
+ item_buy_logic.append(dataframe['rsi_14_4h'] < 80.0)
+ item_buy_logic.append(dataframe['r_480_1h'] < -25.0)
+ item_buy_logic.append(dataframe['r_480_4h'] < -4.0)
+ item_buy_logic.append(dataframe['rsi_3_15m'] > 14.0)
+ item_buy_logic.append(dataframe['rsi_3_1h'] > 16.0)
+
+ item_buy_logic.append(dataframe['not_downtrend_1h'])
+ item_buy_logic.append(dataframe['not_downtrend_4h'])
+ item_buy_logic.append(dataframe['pct_change_high_max_6_24_1h'] > -0.3)
+ item_buy_logic.append(dataframe['pct_change_high_max_3_12_4h'] > -0.4)
+ # current 4h red with wick, previous 4h green with wick
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.02)
+ | (dataframe['top_wick_pct_4h'] < 0.08)
+ | (dataframe['change_pct_4h'].shift(48) < 0.08)
+ | (dataframe['top_wick_pct_4h'].shift(48) < 0.08))
+ # current 4h green with top wick
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.02)
+ | (dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 2.0))
+ | (dataframe['high_max_6_1h'] < (dataframe['close'] * 1.2)))
+ # current and previous 4h red
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.05)
+ | (dataframe['change_pct_4h'].shift(48) > -0.05)
+ | (dataframe['rsi_14_max_6_4h'] < 85.0))
+ # current 4h red, previous 4h long green with long top wick
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['change_pct_4h'].shift(48) < 0.16)
+ | (dataframe['top_wick_pct_4h'].shift(48) < 0.16)
+ | (dataframe['cti_20_4h'] < 0.8))
+ # current 4h long green and descending
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.2)
+ | (dataframe['r_14_4h'] < -20.0)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(576)))
+ # current 4h green with top wick
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.04)
+ | (dataframe['cti_20_4h'] < 0.8)
+ | (dataframe['pct_change_high_max_3_12_4h'] > -0.05))
+ # current 4h red
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['rsi_14_max_6_4h'] < 80.0)
+ | (dataframe['pct_change_high_max_1_12_4h'] > -0.05))
+ # current 4h red with top wick, previous 4h green
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.06)
+ | (dataframe['top_wick_pct_4h'] < 0.06)
+ | (dataframe['change_pct_4h'].shift(48) < 0.06)
+ | (dataframe['high_max_24_1h'] < (dataframe['close'] * 1.3)))
+ item_buy_logic.append((dataframe['rsi_14_4h'] < 70.0)
+ | (dataframe['cti_20_4h'] < 0.8)
+ | (dataframe['pct_change_high_max_3_12_4h'] > -0.1))
+ # current 4h red with long top wick, downtrend
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.02)
+ | (dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 5.0))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(576)))
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])
+ item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.018))
+ item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))
+ item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.996))
+
+ # Condition #5 - Normal mode bull.
+ if index == 5:
+ # Protections
+ item_buy_logic.append(dataframe['btc_is_bull_4h'])
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+ item_buy_logic.append(dataframe['close_max_24'] < (dataframe['close'] * 1.2))
+ item_buy_logic.append(dataframe['close_max_48'] < (dataframe['close'] * 1.36))
+ item_buy_logic.append(dataframe['high_max_6_1h'] < (dataframe['close'] * 1.4))
+ item_buy_logic.append(dataframe['high_max_48_1h'] < (dataframe['close'] * 1.5))
+
+ item_buy_logic.append(dataframe['rsi_14_1h'] < 85.0)
+ item_buy_logic.append(dataframe['rsi_14_4h'] < 85.0)
+ item_buy_logic.append((dataframe['cti_20_4h'] < 0.9)
+ | (dataframe['r_14_4h'] < -30.0))
+
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h']))
+ # downtrend 15m, drop in the last 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.2)))
+ # downtrend 1h, drop in the last 1h
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['close_max_12'] < (dataframe['close'] * 1.16)))
+ # downtrend 1h, drop in the last 4h
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.2)))
+ # downtrend 1h, drop in the last 4h
+ item_buy_logic.append((dataframe['not_downtrend_4h'])
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12)))
+ # current 4h long green, overbought 4h
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.08)
+ | (dataframe['rsi_14_4h'] < 70.0))
+ # current 4h with relative long top wick, drop in the last 4h
+ item_buy_logic.append((dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 10.0))
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1)))
+ # current 4h red, overbought 4h, drop in the last 4h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['cti_20_4h'] < 0.8)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1)))
+ # current 1d very long green with very long top wick, drop in last 4h, downtrend 4h
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.3)
+ | (dataframe['top_wick_pct_1d'] < 0.3)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # current 4h green with top wick, downtrend 4h
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.04)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # current 4h red with top wick, downtrend 4h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.04)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # current 1h red, overbought 1h, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1h'] > -0.02)
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 1h long red, downtrend 1h, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1h'] > -0.08)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])
+ item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.03))
+ item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))
+ item_buy_logic.append(dataframe['rsi_14'] < 36.0)
+
+ # Condition #6 - Normal mode bull.
+ if index == 6:
+ # Protections
+ item_buy_logic.append(dataframe['btc_is_bull_4h'])
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+ item_buy_logic.append((dataframe['tpct_change_0'] < 0.03))
+ item_buy_logic.append(dataframe['close_max_24'] < (dataframe['close'] * 1.2))
+ item_buy_logic.append(dataframe['close_max_48'] < (dataframe['close'] * 1.3))
+ item_buy_logic.append(dataframe['high_max_24_1h'] < (dataframe['close'] * 1.36))
+ item_buy_logic.append(dataframe['high_max_48_4h'] < (dataframe['close'] * 1.9))
+
+ item_buy_logic.append(dataframe['rsi_14_1d'] < 85.0)
+ item_buy_logic.append(dataframe['r_14_4h'] < -25.0)
+
+ item_buy_logic.append(dataframe['pct_change_high_max_6_24_1h'] > -0.3)
+ item_buy_logic.append(dataframe['pct_change_high_max_3_12_4h'] > -0.4)
+
+ item_buy_logic.append((dataframe['not_downtrend_15m']))
+ # downtrend 1h, drop in the last 1h
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['close_max_12'] < (dataframe['close'] * 1.16)))
+ # downtrend 1h, downtrend 4h, drop in the last 4h
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(288))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # downtrend 1h, drop in the last 4h
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.2)))
+ # downtrend 1h, drop in the last 4h
+ item_buy_logic.append((dataframe['not_downtrend_4h'])
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12)))
+
+ # current 1h red, overbought 1h, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1h'] > -0.02)
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 4h green with top wick, downtrend 1h, downtrend 4h, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.04)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(288))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152))
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 4h green with top wick, overbought 4h, downtrend 4h, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.04)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152))
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 4h red with top wick, overbought 1h, overbought 4h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.04)
+ | (dataframe['rsi_14_1h'] < 70.0)
+ | (dataframe['rsi_14_4h'] < 70.0))
+ # downtrend 1d, downtrend 15m, downtrend 1h
+ item_buy_logic.append((dataframe['is_downtrend_3_1d'] == False)
+ | (dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(288)))
+ # # downtrend 1d, downtrend 1h, downtrend 4h
+ item_buy_logic.append((dataframe['is_downtrend_3_1d'] == False)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(288))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # downtrend 1d, overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['is_downtrend_3_1d'] == False)
+ | (dataframe['cti_20_1d'] < 0.8)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # downtrend 1d, overbought 1d, downtrend 1h, drop in last 2h
+ item_buy_logic.append((dataframe['is_downtrend_3_1d'] == False)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 1d red with top wick, overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.02)
+ | (dataframe['top_wick_pct_1d'] < 0.02)
+ | (dataframe['cti_20_1d'] < 0.85)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 4h red, overbought 1h, drop in the last 2h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.06)
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 1d very long green with very long top wick, drop in last 4h, downtrend 4h
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.3)
+ | (dataframe['top_wick_pct_1d'] < 0.3)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # current 1d long green with long top wick, overbought 4h, downtrend 4h, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.16)
+ | (dataframe['top_wick_pct_1d'] < 0.16)
+ | (dataframe['cti_20_4h'] < 0.85)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152))
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['cti_20_1d'] < 0.9)
+ | (dataframe['rsi_14_1d'] < 75.0)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # overbought 1d, overbought 4h
+ item_buy_logic.append((dataframe['cti_20_1d'] < 0.85)
+ | (dataframe['rsi_14_1d'] < 70.0)
+ | (dataframe['cti_20_4h'] < 0.5))
+ # current 1d long green, down 15m, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.2)
+ | (dataframe['not_downtrend_15m'])
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # downtrend 4h, mild overbought 4h, drop in last 2h and 4h
+ item_buy_logic.append((dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152))
+ | (dataframe['cti_20_4h'] < -0.0)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1))
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12)))
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < (dataframe['ema_26'] * 0.94))
+ item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.996))
+
+ # Condition #11 - Normal mode bear.
+ if index == 11:
+ # Protections
+ item_buy_logic.append(dataframe['btc_is_bull_4h'] == False)
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+ item_buy_logic.append(dataframe['close_max_12'] < (dataframe['close'] * 1.16))
+ item_buy_logic.append(dataframe['close_max_48'] < (dataframe['close'] * 1.3))
+ item_buy_logic.append(dataframe['high_max_24_1h'] < (dataframe['close'] * 1.36))
+ item_buy_logic.append(dataframe['high_max_48_1h'] < (dataframe['close'] * 1.4))
+ item_buy_logic.append(dataframe['high_max_48_4h'] < (dataframe['close'] * 1.5))
+ item_buy_logic.append(dataframe['hl_pct_change_24_1h'] < 0.5)
+ item_buy_logic.append(dataframe['hl_pct_change_48_1h'] < 0.75)
+
+ item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_200_1h'])
+
+ item_buy_logic.append(dataframe['cti_20_1h'] < 0.95)
+ item_buy_logic.append(dataframe['rsi_14_1d'] < 80.0)
+ item_buy_logic.append(dataframe['r_14_1h'] < -25.0)
+ item_buy_logic.append(dataframe['r_14_4h'] < -25.0)
+
+ # curent 4h long red, overbought 4h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.08)
+ | (dataframe['cti_20_4h'] < 0.85))
+ # current 1d red with top wick, overbought 1d
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.04)
+ | (dataframe['top_wick_pct_1d'] < 0.04)
+ | (dataframe['rsi_14_1d'] < 70.0))
+ # current 1d long green, current 4h red with top wick, overbought 1d
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.2)
+ | (dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.04)
+ | (dataframe['cti_20_1d'] < 0.8))
+ # current 4h red with top wick, drop in last 4 hours
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.08)
+ | (dataframe['top_wick_pct_4h'] < 0.08)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16)))
+ # current 4h long red, drop in the last 4h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.1)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12)))
+ # current 4h green with top wick, current 1d red, overbought 1d
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.08)
+ | (dataframe['change_pct_1d'] > -0.04)
+ | (dataframe['cti_20_1d'] < 0.85))
+ # current 4h green with top wick, previous high is higher than current high
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.01)
+ | (dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 3.0))
+ | (dataframe['pct_change_high_max_3_24_4h'] > -0.1))
+ # current 4h with relative long top wick, drop in the last 4h
+ item_buy_logic.append((dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 10.0))
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1)))
+ #current 4h red, current higher lower than previous high, downtrend 4h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['pct_change_high_max_3_24_4h'] > -0.12)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # current 4h red, overbought 4h, downtrend 4h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['cti_20_4h'] < 0.85)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # current 4h long red
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.12)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16))
+ | (dataframe['cti_20_1h'] < -0.5))
+ # current 1d long green with top long wick
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.12)
+ | (dataframe['top_wick_pct_1d'] < 0.12))
+ # current 1d long red, overbought 1d
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.12)
+ | (dataframe['cti_20_1d'] < 0.85))
+ # current 1d red with top wick, overbought 1d
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.06)
+ | (dataframe['top_wick_pct_1d'] < 0.06)
+ | (dataframe['cti_20_1d'] < 0.9))
+ # current 1d long red, overbought 1d, drop in the last 4h
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.04)
+ | (dataframe['cti_20_1d'] < 0.9)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12)))
+ # current 1d red, previous 1d red with top wick
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.04)
+ | (dataframe['change_pct_1d'].shift(288) > -0.04)
+ | (dataframe['top_wick_pct_1d'].shift(288) < 0.04)
+ | (dataframe['cti_20_1d'] < 0.5))
+ # current 1d red, previous 1d red with top wick
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.02)
+ | (dataframe['change_pct_1d'].shift(288) > -0.02)
+ | (dataframe['top_wick_pct_1d'].shift(288) < 0.02)
+ | (dataframe['rsi_14_1d'] < 70.0))
+ # current 1d green with top wick
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.04)
+ | (dataframe['top_wick_pct_1d'] < 0.04)
+ | (dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['is_downtrend_3_1h'] == False))
+ # current 1d red, previous 1d red, overbought 1d
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.0)
+ | (dataframe['change_pct_1d'].shift(288) > -0.0)
+ | (dataframe['cti_20_1d'] < 0.9))
+ # current 1d green, overbought 4h
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.12)
+ | (dataframe['cti_20_4h'] < 0.8))
+ # drop while near there was overbought 4h
+ item_buy_logic.append((dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['rsi_14_max_6_4h'] < 80.0)
+ | (dataframe['cti_20_4h'] < 0.5))
+ # current 4h downtrend, drop in last 24h
+ item_buy_logic.append((dataframe['is_downtrend_3_4h'] == False)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['high_max_24_1h'] < (dataframe['close'] * 1.2)))
+ # current 4h downtrend, overbought 4h
+ item_buy_logic.append((dataframe['is_downtrend_3_4h'] == False)
+ | (dataframe['cti_20_4h'] < 0.85))
+ item_buy_logic.append((dataframe['is_downtrend_3_4h'] == False)
+ | (dataframe['change_pct_1d'] < 0.12))
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['rsi_14_1d'] < 70.0))
+ # current 1d long top wick
+ item_buy_logic.append(dataframe['top_wick_pct_1d'] < (abs(dataframe['change_pct_1d']) * 10.0))
+ item_buy_logic.append((dataframe['is_downtrend_3_1h'] == False)
+ | (dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_4h'] < 0.5))
+ item_buy_logic.append((dataframe['is_downtrend_3_1h'] == False)
+ | (dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_1d'] < 0.75))
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])
+ item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.016))
+ item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))
+ item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.999))
+
+ # Condition #12 - Normal mode bear.
+ if index == 12:
+ # Protections
+ item_buy_logic.append(dataframe['btc_is_bull_4h'] == False)
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+ item_buy_logic.append((dataframe['tpct_change_0'] < 0.034))
+ item_buy_logic.append(dataframe['close_max_12'] < (dataframe['close'] * 1.2))
+ item_buy_logic.append(dataframe['close_max_48'] < (dataframe['close'] * 1.26))
+ item_buy_logic.append(dataframe['high_max_6_1h'] < (dataframe['close'] * 1.3))
+ item_buy_logic.append(dataframe['high_max_12_1h'] < (dataframe['close'] * 1.36))
+ item_buy_logic.append(dataframe['high_max_24_1h'] < (dataframe['close'] * 1.4))
+ item_buy_logic.append(dataframe['high_max_48_1h'] < (dataframe['close'] * 1.5))
+
+ item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(48))
+
+ item_buy_logic.append(dataframe['cti_20_1h'] < 0.5)
+ item_buy_logic.append(dataframe['cti_20_4h'] < 0.95)
+ item_buy_logic.append(dataframe['rsi_14_1d'] < 80.0)
+ item_buy_logic.append(dataframe['r_14_4h'] < -25.0)
+
+ item_buy_logic.append(dataframe['not_downtrend_15m'])
+
+ # current 4h green with top wick
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.04))
+ # current 4h red, overbought, 4h downtrend
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.06)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # current 4h long red
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.1)
+ | (dataframe['cti_20_4h'] < 0.85))
+ # current 4h red with top wick
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.02)
+ | (dataframe['top_wick_pct_4h'] < 0.02)
+ | (dataframe['cti_20_4h'] < 0.85))
+ # 3 4h red
+ item_buy_logic.append((dataframe['is_downtrend_3_4h'] == False)
+ | (dataframe['cti_20_4h'] < 0.5))
+ # current and previous 4h red
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.0)
+ | (dataframe['change_pct_4h'].shift(48) > -0.0)
+ | (dataframe['rsi_14_4h'] < 50.0)
+ | (dataframe['cti_20_4h'] < 0.5))
+ item_buy_logic.append((dataframe['hl_pct_change_48_1h'] < 0.5)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # currend 1d red with top wick
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.12)
+ | (dataframe['top_wick_pct_1d'] < 0.12))
+ # currend 1d green with top wick
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.12)
+ | (dataframe['top_wick_pct_1d'] < 0.12))
+ # currend 1d red with top wick
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.06)
+ | (dataframe['top_wick_pct_1d'] < 0.06)
+ | (dataframe['rsi_14_1d'] < 70.0))
+ # current 1d green with top wick, current 4h red
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.06)
+ | (dataframe['top_wick_pct_1d'] < 0.06)
+ | (dataframe['change_pct_4h'] > -0.06)
+ | (dataframe['cti_20_4h'] < 0.8))
+ # current 1d red
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.05)
+ | (dataframe['rsi_14_1d'] < 70.0)
+ | (dataframe['cti_20_1d'] < 0.85))
+ # current 1d red
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.12)
+ | (dataframe['cti_20_1d'] < 0.8))
+
+ # Logic
+ item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.04))
+ item_buy_logic.append(dataframe['close_delta'].gt(dataframe['close'] * 0.02))
+ item_buy_logic.append(dataframe['bb40_2_tail'].lt(dataframe['bb40_2_delta'] * 0.2))
+ item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))
+ item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))
+
+ # Condition #13 - Normal mode bear.
+ if index == 13:
+ # Protections
+ item_buy_logic.append(dataframe['btc_is_bull_4h'] == False)
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+ item_buy_logic.append(dataframe['close_max_48'] < (dataframe['close'] * 1.26))
+
+ item_buy_logic.append(dataframe['ema_12_1h'] > dataframe['ema_200_1h'])
+
+ item_buy_logic.append(dataframe['ema_12_4h'] > dataframe['ema_200_4h'])
+
+ item_buy_logic.append(dataframe['rsi_14_4h'] < 75.0)
+ item_buy_logic.append(dataframe['rsi_14_1d'] < 85.0)
+
+ item_buy_logic.append(dataframe['not_downtrend_15m'])
+ item_buy_logic.append(dataframe['not_downtrend_1h'])
+ item_buy_logic.append(dataframe['not_downtrend_4h'])
+ item_buy_logic.append(dataframe['pct_change_high_max_6_24_1h'] > -0.3)
+ item_buy_logic.append(dataframe['pct_change_high_max_3_12_4h'] > -0.4)
+ # current 4h green with wick, overbought 4h
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.1)
+ | (dataframe['top_wick_pct_4h'] < 0.16)
+ | (dataframe['rsi_14_4h'] < 70.0))
+ # current 4h long green, overbought 4h
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.12)
+ | (dataframe['rsi_14_4h'] < 70.0))
+ # current 4h red with top wick
+ item_buy_logic.append((dataframe['change_pct_4h'] > 0.0)
+ | (dataframe['top_wick_pct_4h'] < 0.1)
+ | (dataframe['ema_12_4h'] > dataframe['ema_200_4h']))
+ # current 4h long red
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.1)
+ | (dataframe['rsi_14_max_6_4h'] < 85.0))
+ # current 4h very long top wick
+ item_buy_logic.append((dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 10.0))
+ | (dataframe['rsi_14_max_6_4h'] < 80.0))
+ # current 4h red with top wick
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.06)
+ | (dataframe['rsi_14_max_6_4h'] < 80.0))
+ # current 4h green with top wick
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.04)
+ | (dataframe['rsi_14_4h'] < 70.00))
+ # current 1d long red, previous 1d long green with long top wick
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.2)
+ | (dataframe['change_pct_1d'].shift(288) < 0.2)
+ | (dataframe['top_wick_pct_1d'].shift(288) < 0.2))
+ # current 1d green, overbought 4h
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.12)
+ | (dataframe['rsi_14_4h'] < 70.0)
+ | (dataframe['cti_20_4h'] < 0.8))
+ # current 1d long green with long green wick
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.2)
+ | (dataframe['top_wick_pct_1d'] < 0.2))
+ # current 1d long green, overbought 1d
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.12)
+ | (dataframe['rsi_14_1d'] < 70.0)
+ | (dataframe['cti_20_1d'] < 0.8))
+
+
+ # Logic
+ item_buy_logic.append(dataframe['rsi_14'] < 36.0)
+ item_buy_logic.append(dataframe['ha_close'] > dataframe['ha_open'])
+ item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.018))
+
+ # Condition #14 - Normal mode bear.
+ if index == 14:
+ # Protections
+ item_buy_logic.append(dataframe['btc_is_bull_4h'] == False)
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+ item_buy_logic.append(dataframe['close_max_48'] < (dataframe['close'] * 1.36))
+ item_buy_logic.append(dataframe['high_max_12_1h'] < (dataframe['close'] * 1.4))
+ item_buy_logic.append(dataframe['high_max_24_1h'] < (dataframe['close'] * 1.5))
+
+ item_buy_logic.append(dataframe['cti_20_1h'] < 0.9)
+ item_buy_logic.append(dataframe['cti_20_4h'] < 0.9)
+ item_buy_logic.append(dataframe['rsi_14_4h'] < 80.0)
+ item_buy_logic.append(dataframe['r_480_1h'] < -25.0)
+ item_buy_logic.append(dataframe['r_480_4h'] < -4.0)
+ item_buy_logic.append(dataframe['rsi_3_15m'] > 14.0)
+ item_buy_logic.append(dataframe['rsi_3_1h'] > 16.0)
+
+ item_buy_logic.append(dataframe['not_downtrend_1h'])
+ item_buy_logic.append(dataframe['not_downtrend_4h'])
+ item_buy_logic.append(dataframe['pct_change_high_max_6_24_1h'] > -0.3)
+ item_buy_logic.append(dataframe['pct_change_high_max_3_12_4h'] > -0.4)
+ # current 4h red with wick, previous 4h green with wick
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.02)
+ | (dataframe['top_wick_pct_4h'] < 0.08)
+ | (dataframe['change_pct_4h'].shift(48) < 0.08)
+ | (dataframe['top_wick_pct_4h'].shift(48) < 0.08))
+ # current 4h green with top wick
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.02)
+ | (dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 2.0))
+ | (dataframe['high_max_6_1h'] < (dataframe['close'] * 1.2)))
+ # current and previous 4h red
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.05)
+ | (dataframe['change_pct_4h'].shift(48) > -0.05)
+ | (dataframe['rsi_14_max_6_4h'] < 85.0))
+ # current 4h red, previous 4h long green with long top wick
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['change_pct_4h'].shift(48) < 0.16)
+ | (dataframe['top_wick_pct_4h'].shift(48) < 0.16)
+ | (dataframe['cti_20_4h'] < 0.8))
+ # current 4h long green and descending
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.2)
+ | (dataframe['r_14_4h'] < -20.0)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(576)))
+ # current 4h green with top wick
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.04)
+ | (dataframe['cti_20_4h'] < 0.8)
+ | (dataframe['pct_change_high_max_3_12_4h'] > -0.05))
+ # current 4h red
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['rsi_14_max_6_4h'] < 80.0)
+ | (dataframe['pct_change_high_max_1_12_4h'] > -0.05))
+ # current 4h red with top wick, previous 4h green
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.06)
+ | (dataframe['top_wick_pct_4h'] < 0.06)
+ | (dataframe['change_pct_4h'].shift(48) < 0.06)
+ | (dataframe['high_max_24_1h'] < (dataframe['close'] * 1.3)))
+ item_buy_logic.append((dataframe['rsi_14_4h'] < 70.0)
+ | (dataframe['cti_20_4h'] < 0.8)
+ | (dataframe['pct_change_high_max_3_12_4h'] > -0.1))
+ # current 4h red with long top wick, downtrend
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.02)
+ | (dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 5.0))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(576)))
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])
+ item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.018))
+ item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))
+ item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.996))
+
+ # Condition #15 - Normal mode bear.
+ if index == 15:
+ # Protections
+ item_buy_logic.append(dataframe['btc_is_bull_4h'] == False)
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+ item_buy_logic.append(dataframe['close_max_24'] < (dataframe['close'] * 1.2))
+ item_buy_logic.append(dataframe['close_max_48'] < (dataframe['close'] * 1.36))
+ item_buy_logic.append(dataframe['high_max_6_1h'] < (dataframe['close'] * 1.4))
+ item_buy_logic.append(dataframe['high_max_48_1h'] < (dataframe['close'] * 1.5))
+
+ item_buy_logic.append(dataframe['rsi_14_1h'] < 85.0)
+ item_buy_logic.append(dataframe['rsi_14_4h'] < 85.0)
+ item_buy_logic.append((dataframe['cti_20_4h'] < 0.9)
+ | (dataframe['r_14_4h'] < -30.0))
+
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h']))
+ # downtrend 15m, drop in the last 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.2)))
+ # downtrend 1h, drop in the last 1h
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['close_max_12'] < (dataframe['close'] * 1.16)))
+ # downtrend 1h, drop in the last 4h
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.2)))
+ # downtrend 1h, drop in the last 4h
+ item_buy_logic.append((dataframe['not_downtrend_4h'])
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12)))
+ # current 4h long green, overbought 4h
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.08)
+ | (dataframe['rsi_14_4h'] < 70.0))
+ # current 4h with relative long top wick, drop in the last 4h
+ item_buy_logic.append((dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 10.0))
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1)))
+ # current 4h red, overbought 4h, drop in the last 4h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['cti_20_4h'] < 0.8)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1)))
+ # current 1d very long green with very long top wick, drop in last 4h, downtrend 4h
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.3)
+ | (dataframe['top_wick_pct_1d'] < 0.3)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # current 4h green with top wick, downtrend 4h
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.04)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # current 4h red with top wick, downtrend 4h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.04)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # current 1h red, overbought 1h, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1h'] > -0.02)
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 1h long red, downtrend 1h, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1h'] > -0.08)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])
+ item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.03))
+ item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))
+ item_buy_logic.append(dataframe['rsi_14'] < 36.0)
+
+ # Condition #16 - Normal mode bear.
+ if index == 16:
+ # Protections
+ item_buy_logic.append(dataframe['btc_is_bull_4h'] == False)
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+ item_buy_logic.append((dataframe['tpct_change_0'] < 0.03))
+ item_buy_logic.append(dataframe['close_max_24'] < (dataframe['close'] * 1.2))
+ item_buy_logic.append(dataframe['close_max_48'] < (dataframe['close'] * 1.3))
+ item_buy_logic.append(dataframe['high_max_24_1h'] < (dataframe['close'] * 1.36))
+ item_buy_logic.append(dataframe['high_max_48_4h'] < (dataframe['close'] * 1.9))
+
+ item_buy_logic.append(dataframe['rsi_14_1d'] < 85.0)
+ item_buy_logic.append(dataframe['r_14_4h'] < -25.0)
+
+ item_buy_logic.append(dataframe['pct_change_high_max_6_24_1h'] > -0.3)
+ item_buy_logic.append(dataframe['pct_change_high_max_3_12_4h'] > -0.4)
+
+ item_buy_logic.append((dataframe['not_downtrend_15m']))
+ # downtrend 1h, drop in the last 1h
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['close_max_12'] < (dataframe['close'] * 1.16)))
+ # downtrend 1h, downtrend 4h, drop in the last 4h
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(288))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # downtrend 1h, drop in the last 4h
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.2)))
+ # downtrend 1h, drop in the last 4h
+ item_buy_logic.append((dataframe['not_downtrend_4h'])
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12)))
+
+ # current 1h red, overbought 1h, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1h'] > -0.02)
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 4h green with top wick, downtrend 1h, downtrend 4h, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.04)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(288))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152))
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 4h green with top wick, overbought 4h, downtrend 4h, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.04)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152))
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 4h red with top wick, overbought 1h, overbought 4h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.04)
+ | (dataframe['rsi_14_1h'] < 70.0)
+ | (dataframe['rsi_14_4h'] < 70.0))
+ # downtrend 1d, downtrend 15m, downtrend 1h
+ item_buy_logic.append((dataframe['is_downtrend_3_1d'] == False)
+ | (dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(288)))
+ # # downtrend 1d, downtrend 1h, downtrend 4h
+ item_buy_logic.append((dataframe['is_downtrend_3_1d'] == False)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(288))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # downtrend 1d, overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['is_downtrend_3_1d'] == False)
+ | (dataframe['cti_20_1d'] < 0.8)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # downtrend 1d, overbought 1d, downtrend 1h, drop in last 2h
+ item_buy_logic.append((dataframe['is_downtrend_3_1d'] == False)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 1d red with top wick, overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.02)
+ | (dataframe['top_wick_pct_1d'] < 0.02)
+ | (dataframe['cti_20_1d'] < 0.85)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 4h red, overbought 1h, drop in the last 2h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.06)
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 1d very long green with very long top wick, drop in last 4h, downtrend 4h
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.3)
+ | (dataframe['top_wick_pct_1d'] < 0.3)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # current 1d long green with long top wick, overbought 4h, downtrend 4h, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.16)
+ | (dataframe['top_wick_pct_1d'] < 0.16)
+ | (dataframe['cti_20_4h'] < 0.85)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152))
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['cti_20_1d'] < 0.9)
+ | (dataframe['rsi_14_1d'] < 75.0)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # overbought 1d, overbought 4h
+ item_buy_logic.append((dataframe['cti_20_1d'] < 0.85)
+ | (dataframe['rsi_14_1d'] < 70.0)
+ | (dataframe['cti_20_4h'] < 0.5))
+ # current 1d long green, down 15m, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.2)
+ | (dataframe['not_downtrend_15m'])
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # downtrend 4h, mild overbought 4h, drop in last 2h and 4h
+ item_buy_logic.append((dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152))
+ | (dataframe['cti_20_4h'] < -0.0)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1))
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.12)))
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < (dataframe['ema_26'] * 0.94))
+ item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.996))
+
+ # Condition #21 - Pump mode bull.
+ if index == 21:
+ # Protections
+ item_buy_logic.append(dataframe['btc_is_bull_4h'])
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+ item_buy_logic.append(dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ item_buy_logic.append(dataframe['high_max_6_1h'] < (dataframe['close'] * 1.24))
+ item_buy_logic.append(dataframe['high_max_12_1h'] < (dataframe['close'] * 1.3))
+
+ item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(96))
+ item_buy_logic.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24))
+ item_buy_logic.append(dataframe['sma_200_4h'] > dataframe['sma_200_4h'].shift(96))
+
+ item_buy_logic.append(dataframe['close'] > dataframe['ema_200'])
+
+ item_buy_logic.append(dataframe['cti_20_1h'] < 0.9)
+ item_buy_logic.append(dataframe['cti_20_4h'] < 0.88)
+ item_buy_logic.append(dataframe['rsi_14_1h'] < 80.0)
+ item_buy_logic.append(dataframe['rsi_14_4h'] < 80.0)
+ item_buy_logic.append(dataframe['r_480_4h'] < -5.0)
+
+ item_buy_logic.append(dataframe['not_downtrend_15m'])
+ item_buy_logic.append(dataframe['not_downtrend_1h'])
+ item_buy_logic.append((dataframe['is_downtrend_3_1h'] == False)
+ | (dataframe['rsi_3_1h'] > 20.0))
+ item_buy_logic.append(dataframe['is_downtrend_5_1h'] == False)
+ item_buy_logic.append(dataframe['not_downtrend_4h'])
+ item_buy_logic.append(dataframe['pct_change_high_max_6_24_1h'] > -0.3)
+ item_buy_logic.append(dataframe['pct_change_high_max_3_12_4h'] > -0.4)
+ # current 4h red with top wick, previous 4h long green
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 2.0))
+ | (dataframe['change_pct_4h'].shift(48) < 0.12))
+ # current 4h red, previous 4h green with wick
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['change_pct_4h'].shift(48) < 0.18)
+ | (dataframe['top_wick_pct_4h'].shift(48) < 0.08)
+ | (dataframe['rsi_14_max_6_4h'] < 80.0))
+ item_buy_logic.append((dataframe['cti_20_4h'] < 0.7)
+ | (dataframe['high_max_24_1h'] < (dataframe['close'] * 1.3)))
+ # 4h long top wick
+ item_buy_logic.append((dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 10.0))
+ | (dataframe['cti_20_4h'] < 0.75)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(576)))
+ # current 4h red, previous 4h red, 2nd previous 4h big green
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.02)
+ | (dataframe['change_pct_4h'].shift(48) > -0.02)
+ | (dataframe['change_pct_4h'].shift(96) < 0.2)
+ | (dataframe['hl_pct_change_24_1h'] < 0.5))
+ # current 4h red with top wick
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.01)
+ | (dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 4.0))
+ | (dataframe['pct_change_high_max_3_36_4h'] > -0.1))
+ # current 4h red with top wick
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.06)
+ | (dataframe['rsi_14_max_6_4h'] < 80.0))
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.1)
+ | (dataframe['top_wick_pct_4h'] < 0.08))
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])
+ item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.022))
+ item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))
+ item_buy_logic.append(dataframe['rsi_14'] < 36.0)
+
+ # Condition #22 - Pump mode bull.
+ if index == 22:
+ # Protections
+ item_buy_logic.append(dataframe['btc_is_bull_4h'])
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+ item_buy_logic.append(dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ item_buy_logic.append(dataframe['high_max_12_1h'] < (dataframe['close'] * 1.3))
+ item_buy_logic.append(dataframe['high_max_24_1h'] < (dataframe['close'] * 1.36))
+ item_buy_logic.append(dataframe['high_max_48_1h'] < (dataframe['close'] * 1.4))
+
+ item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(96))
+ item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ item_buy_logic.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24))
+
+ item_buy_logic.append(dataframe['cti_20_1h'] < 0.9)
+ item_buy_logic.append(dataframe['cti_20_4h'] < 0.9)
+ item_buy_logic.append(dataframe['rsi_14_1h'] < 70.0)
+ item_buy_logic.append(dataframe['rsi_14_4h'] < 70.0)
+ item_buy_logic.append(dataframe['r_480_4h'] < -25.0)
+
+ item_buy_logic.append(dataframe['not_downtrend_15m'])
+ item_buy_logic.append(dataframe['not_downtrend_1h'])
+ item_buy_logic.append((dataframe['is_downtrend_3_1h'] == False)
+ | (dataframe['rsi_3_1h'] > 20.0))
+ item_buy_logic.append(dataframe['is_downtrend_5_1h'] == False)
+ item_buy_logic.append(dataframe['not_downtrend_4h'])
+ item_buy_logic.append(dataframe['pct_change_high_max_6_24_1h'] > -0.2)
+ item_buy_logic.append(dataframe['pct_change_high_max_3_12_4h'] > -0.01)
+ item_buy_logic.append(dataframe['pct_change_high_max_3_24_4h'] > -0.05)
+ item_buy_logic.append(dataframe['pct_change_high_max_3_48_4h'] > -0.1)
+ item_buy_logic.append((dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 4.0))
+ | (dataframe['r_480_1h'] < -25.0))
+ # current 4h green with top wick
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.05)
+ | (dataframe['top_wick_pct_4h'] < 0.05)
+ | (dataframe['cti_20_1h'] < 0.8))
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.05)
+ | (dataframe['cti_20_4h'] < 0.85)
+ | (dataframe['r_14_4h'] < -16.0))
+ # current 4h long top wick
+ item_buy_logic.append((dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 10.0))
+ | (dataframe['cti_20_4h'] < 0.8))
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < (dataframe['ema_16'] * 0.968))
+ item_buy_logic.append(dataframe['cti_20'] < -0.8)
+ item_buy_logic.append(dataframe['rsi_14'] < 50.0)
+
+ # Condition #31 - Pump mode bear.
+ if index == 31:
+ # Protections
+ item_buy_logic.append(dataframe['btc_is_bull_4h'] == False)
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+ item_buy_logic.append(dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ item_buy_logic.append(dataframe['high_max_6_1h'] < (dataframe['close'] * 1.24))
+ item_buy_logic.append(dataframe['high_max_12_1h'] < (dataframe['close'] * 1.3))
+
+ item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(96))
+ item_buy_logic.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24))
+ item_buy_logic.append(dataframe['sma_200_4h'] > dataframe['sma_200_4h'].shift(96))
+
+ item_buy_logic.append(dataframe['close'] > dataframe['ema_200'])
+
+ item_buy_logic.append(dataframe['cti_20_1h'] < 0.9)
+ item_buy_logic.append(dataframe['cti_20_4h'] < 0.88)
+ item_buy_logic.append(dataframe['rsi_14_1h'] < 80.0)
+ item_buy_logic.append(dataframe['rsi_14_4h'] < 80.0)
+ item_buy_logic.append(dataframe['r_480_4h'] < -5.0)
+
+ item_buy_logic.append(dataframe['not_downtrend_15m'])
+ item_buy_logic.append(dataframe['not_downtrend_1h'])
+ item_buy_logic.append((dataframe['is_downtrend_3_1h'] == False)
+ | (dataframe['rsi_3_1h'] > 20.0))
+ item_buy_logic.append(dataframe['is_downtrend_5_1h'] == False)
+ item_buy_logic.append(dataframe['not_downtrend_4h'])
+ item_buy_logic.append(dataframe['pct_change_high_max_6_24_1h'] > -0.3)
+ item_buy_logic.append(dataframe['pct_change_high_max_3_12_4h'] > -0.4)
+ # current 4h red with top wick, previous 4h long green
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 2.0))
+ | (dataframe['change_pct_4h'].shift(48) < 0.12))
+ # current 4h red, previous 4h green with wick
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['change_pct_4h'].shift(48) < 0.18)
+ | (dataframe['top_wick_pct_4h'].shift(48) < 0.08)
+ | (dataframe['rsi_14_max_6_4h'] < 80.0))
+ item_buy_logic.append((dataframe['cti_20_4h'] < 0.7)
+ | (dataframe['high_max_24_1h'] < (dataframe['close'] * 1.3)))
+ # 4h long top wick
+ item_buy_logic.append((dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 10.0))
+ | (dataframe['cti_20_4h'] < 0.75)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(576)))
+ # current 4h red, previous 4h red, 2nd previous 4h big green
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.02)
+ | (dataframe['change_pct_4h'].shift(48) > -0.02)
+ | (dataframe['change_pct_4h'].shift(96) < 0.2)
+ | (dataframe['hl_pct_change_24_1h'] < 0.5))
+ # current 4h red with top wick
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.01)
+ | (dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 4.0))
+ | (dataframe['pct_change_high_max_3_36_4h'] > -0.1))
+ # current 4h red with top wick
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.06)
+ | (dataframe['rsi_14_max_6_4h'] < 80.0))
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.1)
+ | (dataframe['top_wick_pct_4h'] < 0.08))
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])
+ item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.022))
+ item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))
+ item_buy_logic.append(dataframe['rsi_14'] < 36.0)
+
+ # Condition #32 - Pump mode bear.
+ if index == 32:
+ # Protections
+ item_buy_logic.append(dataframe['btc_is_bull_4h'] == False)
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+ item_buy_logic.append(dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ item_buy_logic.append(dataframe['high_max_12_1h'] < (dataframe['close'] * 1.3))
+ item_buy_logic.append(dataframe['high_max_24_1h'] < (dataframe['close'] * 1.36))
+ item_buy_logic.append(dataframe['high_max_48_1h'] < (dataframe['close'] * 1.4))
+
+ item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(96))
+ item_buy_logic.append(dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ item_buy_logic.append(dataframe['sma_200_1h'] > dataframe['sma_200_1h'].shift(24))
+
+ item_buy_logic.append(dataframe['cti_20_1h'] < 0.9)
+ item_buy_logic.append(dataframe['cti_20_4h'] < 0.9)
+ item_buy_logic.append(dataframe['rsi_14_1h'] < 70.0)
+ item_buy_logic.append(dataframe['rsi_14_4h'] < 70.0)
+ item_buy_logic.append(dataframe['r_480_4h'] < -25.0)
+
+ item_buy_logic.append(dataframe['not_downtrend_15m'])
+ item_buy_logic.append(dataframe['not_downtrend_1h'])
+ item_buy_logic.append((dataframe['is_downtrend_3_1h'] == False)
+ | (dataframe['rsi_3_1h'] > 20.0))
+ item_buy_logic.append(dataframe['is_downtrend_5_1h'] == False)
+ item_buy_logic.append(dataframe['not_downtrend_4h'])
+ item_buy_logic.append(dataframe['pct_change_high_max_6_24_1h'] > -0.2)
+ item_buy_logic.append(dataframe['pct_change_high_max_3_12_4h'] > -0.01)
+ item_buy_logic.append(dataframe['pct_change_high_max_3_24_4h'] > -0.05)
+ item_buy_logic.append(dataframe['pct_change_high_max_3_48_4h'] > -0.1)
+ item_buy_logic.append((dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 4.0))
+ | (dataframe['r_480_1h'] < -25.0))
+ # current 4h green with top wick
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.05)
+ | (dataframe['top_wick_pct_4h'] < 0.05)
+ | (dataframe['cti_20_1h'] < 0.8))
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.05)
+ | (dataframe['cti_20_4h'] < 0.85)
+ | (dataframe['r_14_4h'] < -16.0))
+ # current 4h long top wick
+ item_buy_logic.append((dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 10.0))
+ | (dataframe['cti_20_4h'] < 0.8))
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < (dataframe['ema_16'] * 0.968))
+ item_buy_logic.append(dataframe['cti_20'] < -0.8)
+ item_buy_logic.append(dataframe['rsi_14'] < 50.0)
+
+ # Condition #41 - Quick mode bull.
+ if index == 41:
+ # Protections
+ item_buy_logic.append(dataframe['btc_is_bull_4h'])
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+ item_buy_logic.append(dataframe['high_max_24_4h'] < (dataframe['close'] * 1.5))
+
+ item_buy_logic.append(dataframe['cti_20_1h'] < -0.75)
+
+ item_buy_logic.append(dataframe['pct_change_high_max_6_24_1h'] > -0.3)
+ item_buy_logic.append(dataframe['pct_change_high_max_3_12_4h'] > -0.4)
+ # current 1d long red, overbought 1d
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.16)
+ | (dataframe['cti_20_1d'] < 0.85))
+ # downtrend 4h, downtrend 1h, downtrend 15, drop in last 4 days
+ item_buy_logic.append((dataframe['is_downtrend_3_4h'] == False)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_15m'])
+ | (dataframe['high_max_24_4h'] < (dataframe['close'] * 1.24)))
+ # downtrend4h, downtrend 1h
+ item_buy_logic.append((dataframe['is_downtrend_3_4h'] == False)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # downtrend 4h, downtrend 1h, overbought 4h
+ item_buy_logic.append((dataframe['is_downtrend_3_4h'] == False)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_4h'] < 0.5))
+ # downtrend 4h, overbought 4h, overbought 1d
+ item_buy_logic.append((dataframe['is_downtrend_3_4h'] == False)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['cti_20_1d'] < 0.85))
+ # downtrend 1h, downtrend 4h
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h'])
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # current 1d red, previous 1d red, downtrend 1h, downtrend 4h
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.02)
+ | (dataframe['change_pct_1d'].shift(288) > -0.02)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h'])
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # current 1d relative long top wick, overbought 1d, downtrend 1h
+ item_buy_logic.append((dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 4.0))
+ | (dataframe['cti_20_1d'] < 0.85)
+ | (dataframe['not_downtrend_1h']))
+ # current 1d red, downtrend 1h, downtrend 4h
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.06)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # current 1d red, overbought 1d, current 4h red, downtrend 1h, downtrend 4h
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.06)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['change_pct_4h'] > -0.06)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h']))
+ # current 1d green with top wick, overbought 1d, overbought 4h
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.04)
+ | (dataframe['top_wick_pct_1d'] < 0.04)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['rsi_14_1d'] < 70.0)
+ | (dataframe['cti_20_4h'] < 0.85))
+ # current 4h green, overbought 4h, overbought 1d
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['rsi_14_1d'] < 85.0))
+
+ # Logic
+ item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.036))
+ item_buy_logic.append(dataframe['close_delta'].gt(dataframe['close'] * 0.02))
+ item_buy_logic.append(dataframe['bb40_2_tail'].lt(dataframe['bb40_2_delta'] * 0.4))
+ item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))
+ item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))
+ item_buy_logic.append(dataframe['rsi_14'] < 36.0)
+
+ # Condition #42 - Quick mode bull.
+ if index == 42:
+ # Protections
+ item_buy_logic.append(dataframe['btc_is_bull_4h'])
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+ item_buy_logic.append(dataframe['close_max_48'] < (dataframe['close'] * 1.24))
+ item_buy_logic.append(dataframe['high_max_24_4h'] < (dataframe['close'] * 1.5))
+
+ item_buy_logic.append(dataframe['cti_20_1h'] < -0.0)
+
+ item_buy_logic.append(dataframe['pct_change_high_max_6_24_1h'] > -0.3)
+ item_buy_logic.append(dataframe['pct_change_high_max_3_12_4h'] > -0.4)
+ # downtrend 15m, downtrend 1h, downtrend 4h, drop in last 4 days
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h'])
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['high_max_24_4h'] < (dataframe['close'] * 1.2)))
+ # downtrend 15m, downtrend 1h, CTI 1h not low enough
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_1h'] < -0.5))
+ # downtrend 1h, CTI 1h not low enough, overbought 1d
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_1h'] < -0.5)
+ | (dataframe['cti_20_1d'] < 0.9)
+ | (dataframe['rsi_14_1d'] < 75.0))
+ # current and previous 4h red, downtrend 4h, downtrend 1h, downtrend 15m
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['change_pct_4h'].shift(48) > -0.04)
+ | (dataframe['is_downtrend_3_4h'] == False)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_15m']))
+ # downtrend 4h, current 1d long red, overbought 1d
+ item_buy_logic.append((dataframe['is_downtrend_3_4h'] == False)
+ | (dataframe['change_pct_1d'] > -0.12)
+ | (dataframe['cti_20_1d'] < 0.75)
+ | (dataframe['rsi_14_1d'] < 70.0))
+ # downtrend 4h, overbought 4h, downtrend 15m, downtrend 1h, drop in last 2h
+ item_buy_logic.append((dataframe['is_downtrend_3_4h'] == False)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.16)))
+ # downtrend 4h, overbought 4h, overbought 1d, downtrend 1h
+ item_buy_logic.append((dataframe['is_downtrend_3_4h'] == False)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['not_downtrend_1h']))
+ # current 4h long relative top wick, overbought 1d, downtrend 15m
+ item_buy_logic.append((dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 4.0))
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['not_downtrend_15m']))
+ # current 4h long relative top wick, overbought 4h. overbought 15m
+ item_buy_logic.append((dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 4.0))
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['not_downtrend_15m']))
+ # current 1h long red, overbought 4h, drop 15m, rapid drop in RSI 1h
+ item_buy_logic.append((dataframe['change_pct_1h'] > -0.06)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['not_downtrend_15m'])
+ | (((dataframe['rsi_14_1h']) / (dataframe['rsi_14_1h'].shift(12))) > 0.5))
+ # current 4h red, downtrend 1h, downtrend 4h, drop in last 48h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.06)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152))
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16)))
+ # current 4h red with top wick, overbought 4h, overbought 1d, downtrend 1h, downtrend 15m
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.04)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['cti_20_1d'] < 0.85)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_15m']))
+ # current 4h red with top wick, downtrend 1h, downtrend 2h, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.04)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h'])
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 1d red, downtrend 15m, downtrend 1h, downtrend 4h, CTI 4h not low enough. drop in last 4 days
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.12)
+ | (dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h'])
+ | (dataframe['cti_20_4h'] < -0.0)
+ | (dataframe['high_max_24_4h'] < (dataframe['close'] * 1.3)))
+ # downtrend 1h, downtrend 4h, CTI 1h not low enough, drop in last 4 days
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h'])
+ | (dataframe['cti_20_1h'] < -0.5)
+ | (dataframe['high_max_24_4h'] < (dataframe['close'] * 1.3)))
+ # overbought 1d, overbought 4h, downtrend 15m
+ item_buy_logic.append((dataframe['cti_20_1d'] < 0.85)
+ | (dataframe['rsi_14_1d'] < 70.0)
+ | (dataframe['cti_20_4h'] < 0.85)
+ | (dataframe['rsi_14_4h'] < 70.0)
+ | (dataframe['not_downtrend_15m']))
+ # currend 1d very long green, overbought 1d, overbought 4h, downtrend 1h, CTI 1h not low enouigh
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.3)
+ | (dataframe['rsi_14_1d'] < 70.0)
+ | (dataframe['cti_20_4h'] < 0.85)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_1h'] < -0.5))
+ # downtrend 15m, downtrend 1h, downtrend 4h, overbought 1d
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h'])
+ | (dataframe['cti_20_1d'] < 0.85))
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])
+ item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.018))
+ item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))
+ item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.996))
+ item_buy_logic.append(dataframe['rsi_14'] < 40.0)
+
+ # Condition #43 - Quick mode bull.
+ if index == 43:
+ # Protections
+ item_buy_logic.append(dataframe['btc_is_bull_4h'])
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+
+ item_buy_logic.append(dataframe['pct_change_high_max_6_24_1h'] > -0.3)
+ item_buy_logic.append(dataframe['pct_change_high_max_3_12_4h'] > -0.4)
+
+ # overbought 15m, overbought 1h, overbought 4h
+ item_buy_logic.append((dataframe['cti_20_15m'] < -0.75)
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['cti_20_4h'] < -0.5)
+ | (dataframe['rsi_14_4h'] < 50.0))
+ # downtrend 15m, overbought 15m, overbought 15m, overbought 4h, downtrend 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['cti_20_15m'] < -0.9)
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['cti_20_4h'] < -0.0)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # downtrend 15m, overbought 1h, overbought 15m, overbought 4h,downtrend 1h, downtrend 4h
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['cti_20_4h'] < -0.75)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # downtrend 15m, downtrend 1h, overbought 1h, overbought 4h, downtrend 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['rsi_14_4h'] < 70.0)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # overbought 15m, overbought 1h, overbought 4h, overbought 1d
+ item_buy_logic.append((dataframe['cti_20_15m'] < -0.8)
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 36.0)
+ | (dataframe['cti_20_4h'] < -0.85)
+ | (dataframe['cti_20_1d'] < -0.0)
+ | (dataframe['rsi_14_4h'] < 40.0)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576)))
+ # downtrend 15m, overbought 15m, overbought 1h, overbought 4h, drop in last 48h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['cti_20_4h'] < -0.75)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16)))
+ # overbought 15m, overbought 1h, overbought 4h, overbought 1d
+ item_buy_logic.append((dataframe['cti_20_15m'] < -0.8)
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['cti_20_4h'] < 0.85)
+ | (dataframe['rsi_14_1d'] < 75.0))
+ # downtrend 15m, overbought 1h, overbought 4h, overbought 1d
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['rsi_14_4h'] < 70.0)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['rsi_14_1d'] < 70.0))
+ # downtrend 15m, overbought 15m, overbought 1h, overbought 4h, downtrend 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['cti_20_15m'] < -0.0)
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['cti_20_4h'] < -0.75)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # overbought 15m, overbought 1h, overbought 4h, drop in last 4h
+ item_buy_logic.append((dataframe['cti_20_15m'] < -0.75)
+ | (dataframe['cti_20_1h'] < -0.5)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.24)))
+ # downtrend 15m, downtrend 1h, downtrend 4h, overbought 15m, overbought 1h, overbought 4h, drop in last 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h'])
+ | (dataframe['cti_20_15m'] < -0.0)
+ | (dataframe['cti_20_1h'] < -0.5)
+ | (dataframe['cti_20_4h'] < 0.85)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.24)))
+ # downtrend 15m, overbought 15m, overbought 1h, overbought 4h, overbought 1d
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_1h'] < -0.5)
+ | (dataframe['cti_20_4h'] < 0.85)
+ | (dataframe['rsi_14_1d'] < 80.0))
+ # downtrend 15m, downtrend 1h, downtrend 4h, overbought 15m, overbought 1h, overbought 4h, overbought 1d
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h'])
+ | (dataframe['cti_20_15m'] < -0.75)
+ | (dataframe['cti_20_1h'] < -0.92)
+ | (dataframe['cti_20_4h'] < -0.9)
+ | (dataframe['cti_20_1d'] < -0.0))
+ # downtrend 1h, overbought 15m, overbought 1h, overbought 4h, overbought 1d
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_1h'] < -0.0)
+ | (dataframe['cti_20_4h'] < 0.75)
+ | (dataframe['rsi_14_1d'] < 80.0))
+ # downtrend 15m, downtrend 1h, overbought 15m, overbought 1h, overbought 4h, downtrend 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.9)
+ | (dataframe['cti_20_1h'] < -0.0)
+ | (dataframe['cti_20_4h'] < -0.0)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # downtrend 15m, overbought 15m, overbought 1h, overbought 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['cti_20_15m'] < -0.75)
+ | (dataframe['cti_20_1h'] < -0.0)
+ | (dataframe['cti_20_4h'] < 0.75)
+ | (dataframe['cti_20_4h'] < 0.70))
+ # downtrend 15m, downtrend 1h, overbought 15m, overbought 1h, overbought 4h, drop in last 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_1h'] < -0.0)
+ | (dataframe['cti_20_4h'] < -0.75)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16)))
+ # downtrend 15m, overbought 15m, overbought 1h, overbought 4h, downtrend 4h, drop in last 2h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_1h'] < -0.0)
+ | (dataframe['cti_20_4h'] < -0.0)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152))
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.16)))
+ # downtrend 15m, downtrend 1h, overbought 15m, overbought 1h, overbought 4h, downtrend 4h, drop in last 2h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_1h'] < -0.75)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152))
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.16)))
+ # downtrend 15m, downtrend 1h, downtrend 4h, overbought 15m, overbought 1h, overbought 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h'])
+ | (dataframe['cti_20_15m'] < -0.9)
+ | (dataframe['cti_20_1h'] < -0.9)
+ | (dataframe['cti_20_4h'] < -0.9)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # downtrend 4h, overbought 15m, overbought 1h, overbought 4h, overbought 1d
+ item_buy_logic.append((dataframe['not_downtrend_4h'])
+ | (dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_4h'] < -0.5)
+ | (dataframe['cti_20_1h'] < -0.9)
+ | (dataframe['cti_20_1d'] < 0.85)
+ | (dataframe['rsi_14_1d'] < 70.0))
+ # downtrend 1h, overbought 15m, overbought 1h, overbought 4h, downtrend 1h, downtrend 4h
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_1h'] < -0.0)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # downtrend 15m, overbought 15m, overbought 1h, overbought 4h, drop in last 2h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_1h'] < -0.75)
+ | (dataframe['cti_20_4h'] < 0.85)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.2)))
+ # downtrend 15m, downtrend 1h, overbought 15m, overbought 1h, overbought 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_1h'] < -0.75)
+ | (dataframe['cti_20_4h'] < 0.5))
+ # overbought 15m, overbought 1h, overbought 4h, overbought 1d
+ item_buy_logic.append((dataframe['cti_20_15m'] < -0.0)
+ | (dataframe['cti_20_1h'] < -0.5)
+ | (dataframe['cti_20_4h'] < 0.85)
+ | (dataframe['rsi_14_4h'] < 70.0)
+ | (dataframe['rsi_14_1d'] < 80.0))
+ # downtrend 15m, downtrend 1h, overbought 15m, overbought 1h, overbought 4h, downtrend 1h, drop in last 2h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.75)
+ | (dataframe['cti_20_1h'] < -0.5)
+ | (dataframe['cti_20_4h'] < -0.75)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # downtrend 15m, overbought 15m, overbought 1h, overbought 4h, downtrend 4h, drop in last 2h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_1h'] < -0.75)
+ | (dataframe['cti_20_4h'] < -0.0)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152))
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # downtrend 15m, overbought 15m, overbought 1h, overbought 4h, drop in last 2h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_1h'] < -0.0)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # downtrend 15m, downtrend 1h, overbought 15m, overbought 1h, overbought 4h, overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.9)
+ | (dataframe['cti_20_1h'] < -0.8)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['cti_20_1d'] < 0.85)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # downtrend 15m, downtrend 1h, overbought 15m, overbought 1h, overbought 4h, drop in last 2h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_1h'] < -0.0)
+ | (dataframe['cti_20_4h'] < -0.5)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # downtrend 15m, downtrend 1h, overbought 15m, overbought 1h, overbought 4h, downtrend 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.75)
+ | (dataframe['cti_20_1h'] < -0.5)
+ | (dataframe['cti_20_4h'] < -0.75)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # overbought 15m, overbought 1h, overbought 4h, big drop in last 24h
+ item_buy_logic.append((dataframe['cti_20_1h'] < -0.75)
+ | (dataframe['cti_20_4h'] < 0.25)
+ | (dataframe['rsi_14_max_6_4h'] < 80.0)
+ | (dataframe['high_max_24_1h'] < (dataframe['close'] * 1.5)))
+ # downtrend 15m, downtrend 1h, overbought 15m, overbought 1h, overbought 4h, downtrend 1h, downtrend 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.9)
+ | (dataframe['cti_20_1h'] < -0.0)
+ | (dataframe['cti_20_4h'] < -0.75)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # overbought 15m, overbought 1h, overbought 4h, downtrend 1h, downtrend 4h, drop in last 4h
+ item_buy_logic.append((dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_1h'] < -0.25)
+ | (dataframe['cti_20_4h'] < -0.25)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152))
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16)))
+ # downtrend 15m, downtrend 1h, overbought 15m, overbought 1h, overbought 4h, drop in last 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.75)
+ | (dataframe['cti_20_1h'] < -0.0)
+ | (dataframe['cti_20_4h'] < -0.75)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.2)))
+ # downtrend 15m, downtrend 1h, downtrend 4h, overbought 15m, overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h'])
+ | (dataframe['cti_20_15m'] < -0.75)
+ | (dataframe['cti_20_1d'] < -0.0)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # downtrend 15m, overbought 15m, overbought 1h, overbought 4h, overbought 1d
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['cti_20_15m'] < -0.0)
+ | (dataframe['cti_20_1h'] < -0.0)
+ | (dataframe['cti_20_4h'] < -0.0)
+ | (dataframe['cti_20_1d'] < 0.5))
+ # downtrend 15m, downtrend 1h, overbought 15m, overbought 1h, overbought 4h, downtrend 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.0)
+ | (dataframe['cti_20_1h'] < -0.9)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # overbought 15m, overbought 1h, overbought 4h, overbought 1d
+ item_buy_logic.append((dataframe['cti_20_15m'] < -0.0)
+ | (dataframe['cti_20_1h'] < -0.0)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['rsi_14_1d'] < 70.0))
+ # downtrend 1h, downtrend 4h, overbought 15m, overbought 1h, overbought 4h, downtrend 1h, downtrend 4h
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h'])
+ | (dataframe['cti_20_15m'] < -0.75)
+ | (dataframe['cti_20_1h'] < -0.8)
+ | (dataframe['cti_20_4h'] < -0.95)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # downtrend 15m, downtrend 1h, overbought 15m, overbought 1h, overbought 4h, downtrend 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.9)
+ | (dataframe['cti_20_1h'] < -0.5)
+ | (dataframe['cti_20_4h'] < -0.25)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # downtrend 15m, downtrend 1h, overbought 15m, overbought 1h, overbought 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.9)
+ | (dataframe['cti_20_1h'] < -0.5)
+ | (dataframe['cti_20_4h'] < -0.85)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576)))
+ # current 1d long green with long top wick, downtrend 15m, overbought 15m, overbought 1h, overbought 4hdowntrend 4h
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.16)
+ | (dataframe['top_wick_pct_1d'] < 0.16)
+ | (dataframe['not_downtrend_15m'])
+ | (dataframe['cti_20_15m'] < -0.9)
+ | (dataframe['cti_20_1h'] < -0.75)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # downtrend 1h, overbought 15m, overbought 1h, overbought 4h, overbought 1d
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.0)
+ | (dataframe['cti_20_1h'] < -0.9)
+ | (dataframe['cti_20_4h'] < 0.85)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['rsi_14_1d'] < 70.0))
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < (dataframe['ema_26'] * 0.938))
+ item_buy_logic.append(dataframe['cti_20'] < -0.75)
+ item_buy_logic.append(dataframe['r_14'] < -94.0)
+
+ # Condition #44 - Quick mode bull.
+ if index == 44:
+ # Protections
+ item_buy_logic.append(dataframe['btc_is_bull_4h'])
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+ item_buy_logic.append(dataframe['close_max_48'] < (dataframe['close'] * 1.26))
+ item_buy_logic.append(dataframe['high_max_6_1h'] < (dataframe['close'] * 1.3))
+ item_buy_logic.append(dataframe['high_max_12_1h'] < (dataframe['close'] * 1.36))
+ item_buy_logic.append(dataframe['high_max_24_1h'] < (dataframe['close'] * 1.4))
+ item_buy_logic.append(dataframe['high_max_36_1h'] < (dataframe['close'] * 1.46))
+ item_buy_logic.append(dataframe['high_max_48_1h'] < (dataframe['close'] * 1.5))
+ item_buy_logic.append(dataframe['high_max_24_4h'] < (dataframe['close'] * 1.5))
+ item_buy_logic.append(dataframe['high_max_36_4h'] < (dataframe['close'] * 1.7))
+
+ item_buy_logic.append(dataframe['close_max_48'] > (dataframe['close'] * 1.1))
+
+ item_buy_logic.append(dataframe['cti_40_1h'] < -0.8)
+ item_buy_logic.append(dataframe['r_96_1h'] < -70.0)
+
+ item_buy_logic.append((dataframe['is_downtrend_3_1h'] == False)
+ | (dataframe['rsi_3_1h'] > 20.0))
+ item_buy_logic.append(dataframe['is_downtrend_5_1h'] == False)
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['r_480_1h'] > -95.0))
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['r_480_4h'] > -95.0))
+ item_buy_logic.append((dataframe['not_downtrend_4h'])
+ | (dataframe['r_480_1h'] > -95.0))
+ item_buy_logic.append((dataframe['not_downtrend_4h'])
+ | (dataframe['r_480_4h'] > -95.0))
+ item_buy_logic.append(dataframe['pct_change_high_max_3_36_4h'] > -0.5)
+ item_buy_logic.append((dataframe['pct_change_high_max_3_36_4h'] > -0.2)
+ | (dataframe['r_480_4h'] > -80.0))
+
+
+ # Logic
+ item_buy_logic.append(dataframe['bb20_2_width_1h'] > 0.156)
+ item_buy_logic.append(dataframe['cti_20'] < -0.88)
+ item_buy_logic.append(dataframe['r_14'] < -50.0)
+
+ # Condition #51 - Quick mode bear.
+ if index == 51:
+ # Protections
+ item_buy_logic.append(dataframe['btc_is_bull_4h'] == False)
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+ item_buy_logic.append(dataframe['high_max_24_4h'] < (dataframe['close'] * 1.5))
+
+ item_buy_logic.append(dataframe['cti_20_1h'] < -0.75)
+
+ item_buy_logic.append(dataframe['pct_change_high_max_6_24_1h'] > -0.3)
+ item_buy_logic.append(dataframe['pct_change_high_max_3_12_4h'] > -0.4)
+ # current 1d long red, overbought 1d
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.16)
+ | (dataframe['cti_20_1d'] < 0.85))
+ # downtrend 4h, downtrend 1h, downtrend 15, drop in last 4 days
+ item_buy_logic.append((dataframe['is_downtrend_3_4h'] == False)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_15m'])
+ | (dataframe['high_max_24_4h'] < (dataframe['close'] * 1.24)))
+ # downtrend4h, downtrend 1h
+ item_buy_logic.append((dataframe['is_downtrend_3_4h'] == False)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # downtrend 4h, downtrend 1h, overbought 4h
+ item_buy_logic.append((dataframe['is_downtrend_3_4h'] == False)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_4h'] < 0.5))
+ # downtrend 4h, overbought 4h, overbought 1d
+ item_buy_logic.append((dataframe['is_downtrend_3_4h'] == False)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['cti_20_1d'] < 0.85))
+ # downtrend 1h, downtrend 4h
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h'])
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # current 1d red, previous 1d red, downtrend 1h, downtrend 4h
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.02)
+ | (dataframe['change_pct_1d'].shift(288) > -0.02)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h'])
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # current 1d relative long top wick, overbought 1d, downtrend 1h
+ item_buy_logic.append((dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 4.0))
+ | (dataframe['cti_20_1d'] < 0.85)
+ | (dataframe['not_downtrend_1h']))
+ # current 1d red, downtrend 1h, downtrend 4h
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.06)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # current 1d red, overbought 1d, current 4h red, downtrend 1h, downtrend 4h
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.06)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['change_pct_4h'] > -0.06)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h']))
+ # current 1d green with top wick, overbought 1d, overbought 4h
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.04)
+ | (dataframe['top_wick_pct_1d'] < 0.04)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['rsi_14_1d'] < 70.0)
+ | (dataframe['cti_20_4h'] < 0.85))
+ # current 4h green, overbought 4h, overbought 1d
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['rsi_14_1d'] < 85.0))
+
+ # Logic
+ item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.036))
+ item_buy_logic.append(dataframe['close_delta'].gt(dataframe['close'] * 0.02))
+ item_buy_logic.append(dataframe['bb40_2_tail'].lt(dataframe['bb40_2_delta'] * 0.4))
+ item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))
+ item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))
+ item_buy_logic.append(dataframe['rsi_14'] < 36.0)
+
+ # Condition #52 - Quick mode bear.
+ if index == 52:
+ # Protections
+ item_buy_logic.append(dataframe['btc_is_bull_4h'] == False)
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+ item_buy_logic.append(dataframe['close_max_48'] < (dataframe['close'] * 1.24))
+ item_buy_logic.append(dataframe['high_max_24_4h'] < (dataframe['close'] * 1.5))
+
+ item_buy_logic.append(dataframe['cti_20_1h'] < -0.0)
+
+ item_buy_logic.append(dataframe['pct_change_high_max_6_24_1h'] > -0.3)
+ item_buy_logic.append(dataframe['pct_change_high_max_3_12_4h'] > -0.4)
+ # downtrend 15m, downtrend 1h, downtrend 4h, drop in last 4 days
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h'])
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['high_max_24_4h'] < (dataframe['close'] * 1.2)))
+ # downtrend 15m, downtrend 1h, CTI 1h not low enough
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_1h'] < -0.5))
+ # downtrend 1h, CTI 1h not low enough, overbought 1d
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_1h'] < -0.5)
+ | (dataframe['cti_20_1d'] < 0.9)
+ | (dataframe['rsi_14_1d'] < 75.0))
+ # current and previous 4h red, downtrend 4h, downtrend 1h, downtrend 15m
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['change_pct_4h'].shift(48) > -0.04)
+ | (dataframe['is_downtrend_3_4h'] == False)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_15m']))
+ # downtrend 4h, current 1d long red, overbought 1d
+ item_buy_logic.append((dataframe['is_downtrend_3_4h'] == False)
+ | (dataframe['change_pct_1d'] > -0.12)
+ | (dataframe['cti_20_1d'] < 0.75)
+ | (dataframe['rsi_14_1d'] < 70.0))
+ # downtrend 4h, overbought 4h, downtrend 15m, downtrend 1h, drop in last 2h
+ item_buy_logic.append((dataframe['is_downtrend_3_4h'] == False)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.16)))
+ # downtrend 4h, overbought 4h, overbought 1d, downtrend 1h
+ item_buy_logic.append((dataframe['is_downtrend_3_4h'] == False)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['not_downtrend_1h']))
+ # current 4h long relative top wick, overbought 1d, downtrend 15m
+ item_buy_logic.append((dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 4.0))
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['not_downtrend_15m']))
+ # current 4h long relative top wick, overbought 4h. overbought 15m
+ item_buy_logic.append((dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 4.0))
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['not_downtrend_15m']))
+ # current 1h long red, overbought 4h, drop 15m, rapid drop in RSI 1h
+ item_buy_logic.append((dataframe['change_pct_1h'] > -0.06)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['not_downtrend_15m'])
+ | (((dataframe['rsi_14_1h']) / (dataframe['rsi_14_1h'].shift(12))) > 0.5))
+ # current 4h red, downtrend 1h, downtrend 4h, drop in last 48h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.06)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152))
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16)))
+ # current 4h red with top wick, overbought 4h, overbought 1d, downtrend 1h, downtrend 15m
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.04)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['cti_20_1d'] < 0.85)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_15m']))
+ # current 4h red with top wick, downtrend 1h, downtrend 2h, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.04)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h'])
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 1d red, downtrend 15m, downtrend 1h, downtrend 4h, CTI 4h not low enough. drop in last 4 days
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.12)
+ | (dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h'])
+ | (dataframe['cti_20_4h'] < -0.0)
+ | (dataframe['high_max_24_4h'] < (dataframe['close'] * 1.3)))
+ # downtrend 1h, downtrend 4h, CTI 1h not low enough, drop in last 4 days
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h'])
+ | (dataframe['cti_20_1h'] < -0.5)
+ | (dataframe['high_max_24_4h'] < (dataframe['close'] * 1.3)))
+ # overbought 1d, overbought 4h, downtrend 15m
+ item_buy_logic.append((dataframe['cti_20_1d'] < 0.85)
+ | (dataframe['rsi_14_1d'] < 70.0)
+ | (dataframe['cti_20_4h'] < 0.85)
+ | (dataframe['rsi_14_4h'] < 70.0)
+ | (dataframe['not_downtrend_15m']))
+ # currend 1d very long green, overbought 1d, overbought 4h, downtrend 1h, CTI 1h not low enouigh
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.3)
+ | (dataframe['rsi_14_1d'] < 70.0)
+ | (dataframe['cti_20_4h'] < 0.85)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_1h'] < -0.5))
+ # downtrend 15m, downtrend 1h, downtrend 4h, overbought 1d
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h'])
+ | (dataframe['cti_20_1d'] < 0.85))
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])
+ item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.018))
+ item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))
+ item_buy_logic.append(dataframe['close'] < (dataframe['bb20_2_low'] * 0.996))
+ item_buy_logic.append(dataframe['rsi_14'] < 40.0)
+
+ # Condition #53 - Quick mode bear.
+ if index == 53:
+ # Protections
+ item_buy_logic.append(dataframe['btc_is_bull_4h'] == False)
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+
+ item_buy_logic.append(dataframe['pct_change_high_max_6_24_1h'] > -0.3)
+ item_buy_logic.append(dataframe['pct_change_high_max_3_12_4h'] > -0.4)
+
+ # overbought 15m, overbought 1h, overbought 4h
+ item_buy_logic.append((dataframe['cti_20_15m'] < -0.75)
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 50.0)
+ | (dataframe['cti_20_4h'] < -0.5)
+ | (dataframe['rsi_14_4h'] < 50.0))
+ # downtrend 15m, overbought 15m, overbought 15m, overbought 4h, downtrend 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['cti_20_15m'] < -0.9)
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['cti_20_4h'] < -0.0)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # downtrend 15m, overbought 1h, overbought 15m, overbought 4h,downtrend 1h, downtrend 4h
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['cti_20_4h'] < -0.75)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # downtrend 15m, downtrend 1h, overbought 1h, overbought 4h, downtrend 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['rsi_14_4h'] < 70.0)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # overbought 15m, overbought 1h, overbought 4h, overbought 1d
+ item_buy_logic.append((dataframe['cti_20_15m'] < -0.8)
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['rsi_14_1h'] < 36.0)
+ | (dataframe['cti_20_4h'] < -0.85)
+ | (dataframe['cti_20_1d'] < -0.0)
+ | (dataframe['rsi_14_4h'] < 40.0)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576)))
+ # downtrend 15m, overbought 15m, overbought 1h, overbought 4h, drop in last 48h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['cti_20_4h'] < -0.75)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16)))
+ # overbought 15m, overbought 1h, overbought 4h, overbought 1d
+ item_buy_logic.append((dataframe['cti_20_15m'] < -0.8)
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['cti_20_4h'] < 0.85)
+ | (dataframe['rsi_14_1d'] < 75.0))
+ # downtrend 15m, overbought 1h, overbought 4h, overbought 1d
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['rsi_14_4h'] < 70.0)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['rsi_14_1d'] < 70.0))
+ # downtrend 15m, overbought 15m, overbought 1h, overbought 4h, downtrend 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['cti_20_15m'] < -0.0)
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['cti_20_4h'] < -0.75)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # overbought 15m, overbought 1h, overbought 4h, drop in last 4h
+ item_buy_logic.append((dataframe['cti_20_15m'] < -0.75)
+ | (dataframe['cti_20_1h'] < -0.5)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.24)))
+ # downtrend 15m, downtrend 1h, downtrend 4h, overbought 15m, overbought 1h, overbought 4h, drop in last 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h'])
+ | (dataframe['cti_20_15m'] < -0.0)
+ | (dataframe['cti_20_1h'] < -0.5)
+ | (dataframe['cti_20_4h'] < 0.85)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.24)))
+ # downtrend 15m, overbought 15m, overbought 1h, overbought 4h, overbought 1d
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_1h'] < -0.5)
+ | (dataframe['cti_20_4h'] < 0.85)
+ | (dataframe['rsi_14_1d'] < 80.0))
+ # downtrend 15m, downtrend 1h, downtrend 4h, overbought 15m, overbought 1h, overbought 4h, overbought 1d
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h'])
+ | (dataframe['cti_20_15m'] < -0.75)
+ | (dataframe['cti_20_1h'] < -0.92)
+ | (dataframe['cti_20_4h'] < -0.9)
+ | (dataframe['cti_20_1d'] < -0.0))
+ # downtrend 1h, overbought 15m, overbought 1h, overbought 4h, overbought 1d
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_1h'] < -0.0)
+ | (dataframe['cti_20_4h'] < 0.75)
+ | (dataframe['rsi_14_1d'] < 80.0))
+ # downtrend 15m, downtrend 1h, overbought 15m, overbought 1h, overbought 4h, downtrend 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.9)
+ | (dataframe['cti_20_1h'] < -0.0)
+ | (dataframe['cti_20_4h'] < -0.0)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # downtrend 15m, overbought 15m, overbought 1h, overbought 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['cti_20_15m'] < -0.75)
+ | (dataframe['cti_20_1h'] < -0.0)
+ | (dataframe['cti_20_4h'] < 0.75)
+ | (dataframe['cti_20_4h'] < 0.70))
+ # downtrend 15m, downtrend 1h, overbought 15m, overbought 1h, overbought 4h, drop in last 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_1h'] < -0.0)
+ | (dataframe['cti_20_4h'] < -0.75)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16)))
+ # downtrend 15m, overbought 15m, overbought 1h, overbought 4h, downtrend 4h, drop in last 2h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_1h'] < -0.0)
+ | (dataframe['cti_20_4h'] < -0.0)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152))
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.16)))
+ # downtrend 15m, downtrend 1h, overbought 15m, overbought 1h, overbought 4h, downtrend 4h, drop in last 2h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_1h'] < -0.75)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152))
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.16)))
+ # downtrend 15m, downtrend 1h, downtrend 4h, overbought 15m, overbought 1h, overbought 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h'])
+ | (dataframe['cti_20_15m'] < -0.9)
+ | (dataframe['cti_20_1h'] < -0.9)
+ | (dataframe['cti_20_4h'] < -0.9)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # downtrend 4h, overbought 15m, overbought 1h, overbought 4h, overbought 1d
+ item_buy_logic.append((dataframe['not_downtrend_4h'])
+ | (dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_4h'] < -0.5)
+ | (dataframe['cti_20_1h'] < -0.9)
+ | (dataframe['cti_20_1d'] < 0.85)
+ | (dataframe['rsi_14_1d'] < 70.0))
+ # downtrend 1h, overbought 15m, overbought 1h, overbought 4h, downtrend 1h, downtrend 4h
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_1h'] < -0.0)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # downtrend 15m, overbought 15m, overbought 1h, overbought 4h, drop in last 2h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_1h'] < -0.75)
+ | (dataframe['cti_20_4h'] < 0.85)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.2)))
+ # downtrend 15m, downtrend 1h, overbought 15m, overbought 1h, overbought 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_1h'] < -0.75)
+ | (dataframe['cti_20_4h'] < 0.5))
+ # overbought 15m, overbought 1h, overbought 4h, overbought 1d
+ item_buy_logic.append((dataframe['cti_20_15m'] < -0.0)
+ | (dataframe['cti_20_1h'] < -0.5)
+ | (dataframe['cti_20_4h'] < 0.85)
+ | (dataframe['rsi_14_4h'] < 70.0)
+ | (dataframe['rsi_14_1d'] < 80.0))
+ # downtrend 15m, downtrend 1h, overbought 15m, overbought 1h, overbought 4h, downtrend 1h, drop in last 2h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.75)
+ | (dataframe['cti_20_1h'] < -0.5)
+ | (dataframe['cti_20_4h'] < -0.75)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # downtrend 15m, overbought 15m, overbought 1h, overbought 4h, downtrend 4h, drop in last 2h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_1h'] < -0.75)
+ | (dataframe['cti_20_4h'] < -0.0)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152))
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # downtrend 15m, overbought 15m, overbought 1h, overbought 4h, drop in last 2h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_1h'] < -0.0)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # downtrend 15m, downtrend 1h, overbought 15m, overbought 1h, overbought 4h, overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.9)
+ | (dataframe['cti_20_1h'] < -0.8)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['cti_20_1d'] < 0.85)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # downtrend 15m, downtrend 1h, overbought 15m, overbought 1h, overbought 4h, drop in last 2h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_1h'] < -0.0)
+ | (dataframe['cti_20_4h'] < -0.5)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # downtrend 15m, downtrend 1h, overbought 15m, overbought 1h, overbought 4h, downtrend 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.75)
+ | (dataframe['cti_20_1h'] < -0.5)
+ | (dataframe['cti_20_4h'] < -0.75)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # overbought 15m, overbought 1h, overbought 4h, big drop in last 24h
+ item_buy_logic.append((dataframe['cti_20_1h'] < -0.75)
+ | (dataframe['cti_20_4h'] < 0.25)
+ | (dataframe['rsi_14_max_6_4h'] < 80.0)
+ | (dataframe['high_max_24_1h'] < (dataframe['close'] * 1.5)))
+ # downtrend 15m, downtrend 1h, overbought 15m, overbought 1h, overbought 4h, downtrend 1h, downtrend 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.9)
+ | (dataframe['cti_20_1h'] < -0.0)
+ | (dataframe['cti_20_4h'] < -0.75)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # overbought 15m, overbought 1h, overbought 4h, downtrend 1h, downtrend 4h, drop in last 4h
+ item_buy_logic.append((dataframe['cti_20_15m'] < -0.5)
+ | (dataframe['cti_20_1h'] < -0.25)
+ | (dataframe['cti_20_4h'] < -0.25)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152))
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.16)))
+ # downtrend 15m, downtrend 1h, overbought 15m, overbought 1h, overbought 4h, drop in last 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.75)
+ | (dataframe['cti_20_1h'] < -0.0)
+ | (dataframe['cti_20_4h'] < -0.75)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.2)))
+ # downtrend 15m, downtrend 1h, downtrend 4h, overbought 15m, overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h'])
+ | (dataframe['cti_20_15m'] < -0.75)
+ | (dataframe['cti_20_1d'] < -0.0)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # downtrend 15m, overbought 15m, overbought 1h, overbought 4h, overbought 1d
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['cti_20_15m'] < -0.0)
+ | (dataframe['cti_20_1h'] < -0.0)
+ | (dataframe['cti_20_4h'] < -0.0)
+ | (dataframe['cti_20_1d'] < 0.5))
+ # downtrend 15m, downtrend 1h, overbought 15m, overbought 1h, overbought 4h, downtrend 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.0)
+ | (dataframe['cti_20_1h'] < -0.9)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # overbought 15m, overbought 1h, overbought 4h, overbought 1d
+ item_buy_logic.append((dataframe['cti_20_15m'] < -0.0)
+ | (dataframe['cti_20_1h'] < -0.0)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['rsi_14_1d'] < 70.0))
+ # downtrend 1h, downtrend 4h, overbought 15m, overbought 1h, overbought 4h, downtrend 1h, downtrend 4h
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h'])
+ | (dataframe['cti_20_15m'] < -0.75)
+ | (dataframe['cti_20_1h'] < -0.8)
+ | (dataframe['cti_20_4h'] < -0.95)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # downtrend 15m, downtrend 1h, overbought 15m, overbought 1h, overbought 4h, downtrend 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.9)
+ | (dataframe['cti_20_1h'] < -0.5)
+ | (dataframe['cti_20_4h'] < -0.25)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # downtrend 15m, downtrend 1h, overbought 15m, overbought 1h, overbought 4h
+ item_buy_logic.append((dataframe['not_downtrend_15m'])
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.9)
+ | (dataframe['cti_20_1h'] < -0.5)
+ | (dataframe['cti_20_4h'] < -0.85)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(576)))
+ # current 1d long green with long top wick, downtrend 15m, overbought 15m, overbought 1h, overbought 4hdowntrend 4h
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.16)
+ | (dataframe['top_wick_pct_1d'] < 0.16)
+ | (dataframe['not_downtrend_15m'])
+ | (dataframe['cti_20_15m'] < -0.9)
+ | (dataframe['cti_20_1h'] < -0.75)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # downtrend 1h, overbought 15m, overbought 1h, overbought 4h, overbought 1d
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_15m'] < -0.0)
+ | (dataframe['cti_20_1h'] < -0.9)
+ | (dataframe['cti_20_4h'] < 0.85)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['rsi_14_1d'] < 70.0))
+
+ # Logic
+ item_buy_logic.append(dataframe['close'] < (dataframe['ema_26'] * 0.938))
+ item_buy_logic.append(dataframe['cti_20'] < -0.75)
+ item_buy_logic.append(dataframe['r_14'] < -94.0)
+
+ # Condition #54 - Quick mode bear.
+ if index == 54:
+ # Protections
+ item_buy_logic.append(dataframe['btc_is_bull_4h'] == False)
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+ item_buy_logic.append(dataframe['close_max_48'] < (dataframe['close'] * 1.26))
+ item_buy_logic.append(dataframe['high_max_6_1h'] < (dataframe['close'] * 1.3))
+ item_buy_logic.append(dataframe['high_max_12_1h'] < (dataframe['close'] * 1.36))
+ item_buy_logic.append(dataframe['high_max_24_1h'] < (dataframe['close'] * 1.4))
+ item_buy_logic.append(dataframe['high_max_36_1h'] < (dataframe['close'] * 1.46))
+ item_buy_logic.append(dataframe['high_max_48_1h'] < (dataframe['close'] * 1.5))
+ item_buy_logic.append(dataframe['high_max_24_4h'] < (dataframe['close'] * 1.5))
+ item_buy_logic.append(dataframe['high_max_36_4h'] < (dataframe['close'] * 1.7))
+
+ item_buy_logic.append(dataframe['close_max_48'] > (dataframe['close'] * 1.1))
+
+ item_buy_logic.append(dataframe['cti_40_1h'] < -0.8)
+ item_buy_logic.append(dataframe['r_96_1h'] < -70.0)
+
+ item_buy_logic.append((dataframe['is_downtrend_3_1h'] == False)
+ | (dataframe['rsi_3_1h'] > 20.0))
+ item_buy_logic.append(dataframe['is_downtrend_5_1h'] == False)
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['r_480_1h'] > -95.0))
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['r_480_4h'] > -95.0))
+ item_buy_logic.append((dataframe['not_downtrend_4h'])
+ | (dataframe['r_480_1h'] > -95.0))
+ item_buy_logic.append((dataframe['not_downtrend_4h'])
+ | (dataframe['r_480_4h'] > -95.0))
+ item_buy_logic.append(dataframe['pct_change_high_max_3_36_4h'] > -0.5)
+ item_buy_logic.append((dataframe['pct_change_high_max_3_36_4h'] > -0.2)
+ | (dataframe['r_480_4h'] > -80.0))
+
+
+ # Logic
+ item_buy_logic.append(dataframe['bb20_2_width_1h'] > 0.156)
+ item_buy_logic.append(dataframe['cti_20'] < -0.88)
+ item_buy_logic.append(dataframe['r_14'] < -50.0)
+
+ # Condition #61 - Rebuy mode bull.
+ if index == 61:
+ # Protections
+ item_buy_logic.append(current_free_slots >= self.rebuy_mode_min_free_slots)
+ item_buy_logic.append(dataframe['btc_is_bull_4h'])
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+ item_buy_logic.append(dataframe['close_max_12'] < (dataframe['close'] * 1.12))
+ item_buy_logic.append(dataframe['close_max_24'] < (dataframe['close'] * 1.16))
+ item_buy_logic.append(dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ item_buy_logic.append(dataframe['high_max_6_1h'] < (dataframe['close'] * 1.24))
+ item_buy_logic.append(dataframe['high_max_12_1h'] < (dataframe['close'] * 1.3))
+ item_buy_logic.append(dataframe['high_max_24_1h'] < (dataframe['close'] * 1.36))
+ item_buy_logic.append(dataframe['hl_pct_change_24_1h'] < 0.5)
+ item_buy_logic.append(dataframe['hl_pct_change_48_1h'] < 0.75)
+
+ item_buy_logic.append(dataframe['cti_20_1h'] < 0.95)
+ item_buy_logic.append(dataframe['cti_20_4h'] < 0.95)
+ item_buy_logic.append(dataframe['rsi_14_1h'] < 85.0)
+ item_buy_logic.append(dataframe['rsi_14_4h'] < 85.0)
+ item_buy_logic.append(dataframe['rsi_14_1d'] < 85.0)
+ item_buy_logic.append(dataframe['r_14_1h'] < -25.0)
+ item_buy_logic.append(dataframe['r_14_4h'] < -25.0)
+
+ item_buy_logic.append(dataframe['pct_change_high_max_6_24_1h'] > -0.3)
+ item_buy_logic.append(dataframe['pct_change_high_max_3_12_4h'] > -0.4)
+
+ item_buy_logic.append(dataframe['not_downtrend_15m'])
+ # current 1h downtrend, downtrend 4h
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(288))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # current 1h red, overbought 1h, downtrend 1h, downtrend 1h, drop last 2h
+ item_buy_logic.append((dataframe['change_pct_1h'] > -0.04)
+ | (dataframe['cti_20_1h'] < 0.85)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(288))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152))
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 1d green, overbought 1d
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.16)
+ | (dataframe['cti_20_1d'] < 0.5))
+ # current 1d long relative top wick, overbought 1d, current 4h red, drop last 4h
+ item_buy_logic.append((dataframe['top_wick_pct_1d'] < (abs(dataframe['change_pct_1d']) * 5.0))
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1)))
+ # downtrend 1d, overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['is_downtrend_3_1d'] == False)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 1d red with top wick, overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.02)
+ | (dataframe['top_wick_pct_1d'] < 0.02)
+ | (dataframe['cti_20_1d'] < 0.85)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 1d green with top wick, downtrend 4h, overbought 4h, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.06)
+ | (dataframe['top_wick_pct_1d'] < 0.06)
+ | (dataframe['is_downtrend_3_4h'] == False)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 1h red, overbought 1h, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1h'] > -0.02)
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 4h grered, previous 4h green, overbought 1h, downtrend 1h, downtrend 4h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['change_pct_4h'].shift(48) < 0.04)
+ | (dataframe['cti_20_1h'] < 0.85)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(288))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # current 4h red, downtrend 1h, downtrend 4h, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152))
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.08)))
+ # current 1d long red, overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.16)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 1d relative long top wick, overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['top_wick_pct_1d'] < (abs(dataframe['change_pct_1d']) * 2.0))
+ | (dataframe['cti_20_1d'] < 0.85)
+ | (dataframe['rsi_14_1d'] < 70.0)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current and previous 1d red, overbought 1d
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.0)
+ | (dataframe['change_pct_1d'].shift(288) > -0.0)
+ | (dataframe['cti_20_1d'] < 0.85))
+ # downtrend 1d, overbought 1d
+ item_buy_logic.append((dataframe['is_downtrend_3_1d'] == False)
+ | (dataframe['cti_20_1d'] < 0.5))
+ # overbought 1d
+ item_buy_logic.append((dataframe['cti_20_1d'] < 0.9)
+ | (dataframe['rsi_14_1d'] < 80.0))
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])
+ item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.016))
+ item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))
+ item_buy_logic.append(dataframe['close_delta'] > dataframe['close'] * 12.0 / 1000)
+ item_buy_logic.append(dataframe['rsi_14'] < 30.0)
+
+ # Condition #71 - Rebuy mode bear.
+ if index == 71:
+ # Protections
+ item_buy_logic.append(current_free_slots >= self.rebuy_mode_min_free_slots)
+ item_buy_logic.append(dataframe['btc_is_bull_4h'] == False)
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+ item_buy_logic.append(dataframe['close_max_12'] < (dataframe['close'] * 1.12))
+ item_buy_logic.append(dataframe['close_max_24'] < (dataframe['close'] * 1.16))
+ item_buy_logic.append(dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ item_buy_logic.append(dataframe['high_max_6_1h'] < (dataframe['close'] * 1.24))
+ item_buy_logic.append(dataframe['high_max_12_1h'] < (dataframe['close'] * 1.3))
+ item_buy_logic.append(dataframe['high_max_24_1h'] < (dataframe['close'] * 1.36))
+ item_buy_logic.append(dataframe['hl_pct_change_24_1h'] < 0.5)
+ item_buy_logic.append(dataframe['hl_pct_change_48_1h'] < 0.75)
+
+ item_buy_logic.append(dataframe['cti_20_1h'] < 0.95)
+ item_buy_logic.append(dataframe['cti_20_4h'] < 0.95)
+ item_buy_logic.append(dataframe['rsi_14_1h'] < 85.0)
+ item_buy_logic.append(dataframe['rsi_14_4h'] < 85.0)
+ item_buy_logic.append(dataframe['rsi_14_1d'] < 85.0)
+ item_buy_logic.append(dataframe['r_14_1h'] < -25.0)
+ item_buy_logic.append(dataframe['r_14_4h'] < -25.0)
+
+ item_buy_logic.append(dataframe['pct_change_high_max_6_24_1h'] > -0.3)
+ item_buy_logic.append(dataframe['pct_change_high_max_3_12_4h'] > -0.4)
+
+ item_buy_logic.append(dataframe['not_downtrend_15m'])
+ # current 1h downtrend, downtrend 4h
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(288))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # current 1h red, overbought 1h, downtrend 1h, downtrend 1h, drop last 2h
+ item_buy_logic.append((dataframe['change_pct_1h'] > -0.04)
+ | (dataframe['cti_20_1h'] < 0.85)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(288))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152))
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 1d green, overbought 1d
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.16)
+ | (dataframe['cti_20_1d'] < 0.5))
+ # current 1d long relative top wick, overbought 1d, current 4h red, drop last 4h
+ item_buy_logic.append((dataframe['top_wick_pct_1d'] < (abs(dataframe['change_pct_1d']) * 5.0))
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['close_max_48'] < (dataframe['close'] * 1.1)))
+ # downtrend 1d, overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['is_downtrend_3_1d'] == False)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 1d red with top wick, overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.02)
+ | (dataframe['top_wick_pct_1d'] < 0.02)
+ | (dataframe['cti_20_1d'] < 0.85)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 1d green with top wick, downtrend 4h, overbought 4h, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.06)
+ | (dataframe['top_wick_pct_1d'] < 0.06)
+ | (dataframe['is_downtrend_3_4h'] == False)
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 1h red, overbought 1h, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1h'] > -0.02)
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 4h grered, previous 4h green, overbought 1h, downtrend 1h, downtrend 4h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['change_pct_4h'].shift(48) < 0.04)
+ | (dataframe['cti_20_1h'] < 0.85)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(288))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152)))
+ # current 4h red, downtrend 1h, downtrend 4h, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(1152))
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.08)))
+ # current 1d long red, overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.16)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 1d relative long top wick, overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['top_wick_pct_1d'] < (abs(dataframe['change_pct_1d']) * 2.0))
+ | (dataframe['cti_20_1d'] < 0.85)
+ | (dataframe['rsi_14_1d'] < 70.0)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current and previous 1d red, overbought 1d
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.0)
+ | (dataframe['change_pct_1d'].shift(288) > -0.0)
+ | (dataframe['cti_20_1d'] < 0.85))
+ # downtrend 1d, overbought 1d
+ item_buy_logic.append((dataframe['is_downtrend_3_1d'] == False)
+ | (dataframe['cti_20_1d'] < 0.5))
+ # overbought 1d
+ item_buy_logic.append((dataframe['cti_20_1d'] < 0.9)
+ | (dataframe['rsi_14_1d'] < 80.0))
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])
+ item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.016))
+ item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))
+ item_buy_logic.append(dataframe['close_delta'] > dataframe['close'] * 12.0 / 1000)
+ item_buy_logic.append(dataframe['rsi_14'] < 30.0)
+
+ # Condition #81 - Long mode bull.
+ if index == 81:
+ # Protections
+ item_buy_logic.append(dataframe['btc_is_bull_4h'])
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+ item_buy_logic.append(dataframe['close_max_12'] < (dataframe['close'] * 1.12))
+ item_buy_logic.append(dataframe['close_max_24'] < (dataframe['close'] * 1.16))
+ item_buy_logic.append(dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ item_buy_logic.append(dataframe['high_max_6_1h'] < (dataframe['close'] * 1.24))
+
+ item_buy_logic.append(dataframe['cti_20_1h'] < 0.95)
+ item_buy_logic.append(dataframe['cti_20_4h'] < 0.95)
+ item_buy_logic.append(dataframe['rsi_14_1h'] < 85.0)
+ item_buy_logic.append(dataframe['rsi_14_4h'] < 85.0)
+ item_buy_logic.append(dataframe['rsi_14_1d'] < 85.0)
+ item_buy_logic.append(dataframe['r_14_1h'] < -25.0)
+ item_buy_logic.append(dataframe['r_14_4h'] < -25.0)
+
+ item_buy_logic.append(dataframe['pct_change_high_max_6_24_1h'] > -0.3)
+ item_buy_logic.append(dataframe['pct_change_high_max_3_12_4h'] > -0.4)
+
+ item_buy_logic.append(dataframe['not_downtrend_15m'])
+
+ # current 4h relative long top wick, overbought 1h, downtrend 1h, downtrend 4h
+ item_buy_logic.append((dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 2.0))
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(288))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(576)))
+ # current 4h relative long top wick, overbought 1d
+ item_buy_logic.append((dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 6.0))
+ | (dataframe['cti_20_1d'] < 0.5))
+ # current 4h relative long top wick, overbought 1h, downtrend 1h
+ item_buy_logic.append((dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 2.0))
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['not_downtrend_1h']))
+ # big drop in last 48h, downtrend 1h
+ item_buy_logic.append((dataframe['high_max_48_1h'] < (dataframe['close'] * 1.5))
+ | (dataframe['not_downtrend_1h']))
+ # downtrend 1h, downtrend 4h, drop in last 2h
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h'])
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # downtrend 1h, overbought 1h
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_1h'] < 0.5))
+ # downtrend 1h, overbought 4h
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_4h'] < 0.5))
+ # downtrend 1h, downtrend 4h, overbought 1d
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h'])
+ | (dataframe['cti_20_1d'] < 0.5))
+ # downtrend 1d, overbought 1d
+ item_buy_logic.append((dataframe['is_downtrend_3_1d'] == False)
+ | (dataframe['cti_20_1d'] < 0.5))
+ # downtrend 1d, downtrend 1h
+ item_buy_logic.append((dataframe['is_downtrend_3_1d'] == False)
+ | (dataframe['not_downtrend_1h']))
+ # current 4h red, previous 4h green, overbought 4h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.06)
+ | (dataframe['change_pct_4h'].shift(48) < 0.06)
+ | (dataframe['cti_20_4h'] < 0.5))
+ # current 1d long green with long top wick
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.12)
+ | (dataframe['top_wick_pct_1d'] < 0.12))
+ # current 1d long 1d with top wick, overbought 1d, downtrend 1h
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.2)
+ | (dataframe['top_wick_pct_1d'] < 0.04)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['not_downtrend_1h']))
+ # current 1d long red, overbought 1d, downtrend 1h
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.1)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['not_downtrend_1h']))
+
+ # Logic
+ item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.052))
+ item_buy_logic.append(dataframe['close_delta'].gt(dataframe['close'] * 0.024))
+ item_buy_logic.append(dataframe['bb40_2_tail'].lt(dataframe['bb40_2_delta'] * 0.2))
+ item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))
+ item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))
+ item_buy_logic.append(dataframe['rsi_14'] < 30.0)
+
+ # Condition #82 - Long mode bull.
+ if index == 82:
+ # Protections
+ item_buy_logic.append(dataframe['btc_is_bull_4h'])
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+ item_buy_logic.append(dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ item_buy_logic.append(dataframe['high_max_12_1h'] < (dataframe['close'] * 1.3))
+
+ item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_200_1h'])
+ item_buy_logic.append(dataframe['sma_50_1h'] > dataframe['sma_200_1h'])
+
+ item_buy_logic.append(dataframe['ema_50_4h'] > dataframe['ema_200_4h'])
+ item_buy_logic.append(dataframe['sma_50_4h'] > dataframe['sma_200_4h'])
+
+ item_buy_logic.append(dataframe['rsi_14_4h'] < 85.0)
+ item_buy_logic.append(dataframe['rsi_14_1d'] < 85.0)
+ item_buy_logic.append(dataframe['r_480_4h'] < -10.0)
+
+ # current 1d long green with long top wick
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.12)
+ | (dataframe['top_wick_pct_1d'] < 0.12))
+ # overbought 1d, overbought 4h, downtrend 1h, drop in last 2h
+ item_buy_logic.append((dataframe['rsi_14_1d'] < 70.0)
+ | (dataframe['rsi_14_4h'] < 70.0)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 4h red, downtrend 1h, overbought 4h, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.06)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 4h long red, downtrend 1h, overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.12)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_1d'] < 0.8)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 1d red, overbought 1d, downtrend 1h, downtrend 4h, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.12)
+ | (dataframe['cti_20_1d'] < 0.85)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['is_downtrend_3_4h'] == False)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 1d red, overbought 1d, downtrend 1h, current 4h red, previous 4h green with top wick
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.08)
+ | (dataframe['cti_20_1d'] < 0.85)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['change_pct_4h'] > -0.0)
+ | (dataframe['change_pct_4h'].shift(48) < 0.04)
+ | (dataframe['top_wick_pct_4h'].shift(48) < 0.04))
+ # current 1d long red with long top wick, overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.12)
+ | (dataframe['top_wick_pct_1d'] < 0.12)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 1d long red, overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.16)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 4h red with top wick, overbought 1d
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.04)
+ | (dataframe['cti_20_1d'] < 0.85))
+ # current 4h green with top wick, overbought 4h
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.04)
+ | (dataframe['rsi_14_4h'] < 70.0))
+ # current 4h red, downtrend 1h, overbought 1d
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_1d'] < 0.5))
+ # current 1d long relative top wick, overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['top_wick_pct_1d'] < (abs(dataframe['change_pct_1d']) * 4.0))
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 4h relative long top wick, overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 4.0))
+ | (dataframe['cti_20_1d'] < 0.85)
+ | (dataframe['rsi_14_1d'] < 50.0)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current and previous 1d red, overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.04)
+ | (dataframe['change_pct_1d'].shift(288) > -0.04)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 4h long green, overbought 4h, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.08)
+ | (dataframe['rsi_14_4h'] < 70.0)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])
+ item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.03))
+ item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))
+ item_buy_logic.append(dataframe['cti_20'] < -0.8)
+
+ # Condition #91 - Long mode bear.
+ if index == 91:
+ # Protections
+ item_buy_logic.append(dataframe['btc_is_bull_4h'] == False)
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+ item_buy_logic.append(dataframe['close_max_12'] < (dataframe['close'] * 1.12))
+ item_buy_logic.append(dataframe['close_max_24'] < (dataframe['close'] * 1.16))
+ item_buy_logic.append(dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ item_buy_logic.append(dataframe['high_max_6_1h'] < (dataframe['close'] * 1.24))
+
+ item_buy_logic.append(dataframe['cti_20_1h'] < 0.95)
+ item_buy_logic.append(dataframe['cti_20_4h'] < 0.95)
+ item_buy_logic.append(dataframe['rsi_14_1h'] < 85.0)
+ item_buy_logic.append(dataframe['rsi_14_4h'] < 85.0)
+ item_buy_logic.append(dataframe['rsi_14_1d'] < 85.0)
+ item_buy_logic.append(dataframe['r_14_1h'] < -25.0)
+ item_buy_logic.append(dataframe['r_14_4h'] < -25.0)
+
+ item_buy_logic.append(dataframe['pct_change_high_max_6_24_1h'] > -0.3)
+ item_buy_logic.append(dataframe['pct_change_high_max_3_12_4h'] > -0.4)
+
+ item_buy_logic.append(dataframe['not_downtrend_15m'])
+
+ # current 4h relative long top wick, overbought 1h, downtrend 1h, downtrend 4h
+ item_buy_logic.append((dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 2.0))
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['ema_200_1h'] > dataframe['ema_200_1h'].shift(288))
+ | (dataframe['ema_200_4h'] > dataframe['ema_200_4h'].shift(576)))
+ # current 4h relative long top wick, overbought 1d
+ item_buy_logic.append((dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 6.0))
+ | (dataframe['cti_20_1d'] < 0.5))
+ # current 4h relative long top wick, overbought 1h, downtrend 1h
+ item_buy_logic.append((dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 2.0))
+ | (dataframe['cti_20_1h'] < 0.5)
+ | (dataframe['not_downtrend_1h']))
+ # big drop in last 48h, downtrend 1h
+ item_buy_logic.append((dataframe['high_max_48_1h'] < (dataframe['close'] * 1.5))
+ | (dataframe['not_downtrend_1h']))
+ # downtrend 1h, downtrend 4h, drop in last 2h
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h'])
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # downtrend 1h, overbought 1h
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_1h'] < 0.5))
+ # downtrend 1h, overbought 4h
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_4h'] < 0.5))
+ # downtrend 1h, downtrend 4h, overbought 1d
+ item_buy_logic.append((dataframe['not_downtrend_1h'])
+ | (dataframe['not_downtrend_4h'])
+ | (dataframe['cti_20_1d'] < 0.5))
+ # downtrend 1d, overbought 1d
+ item_buy_logic.append((dataframe['is_downtrend_3_1d'] == False)
+ | (dataframe['cti_20_1d'] < 0.5))
+ # downtrend 1d, downtrend 1h
+ item_buy_logic.append((dataframe['is_downtrend_3_1d'] == False)
+ | (dataframe['not_downtrend_1h']))
+ # current 4h red, previous 4h green, overbought 4h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.06)
+ | (dataframe['change_pct_4h'].shift(48) < 0.06)
+ | (dataframe['cti_20_4h'] < 0.5))
+ # current 1d long green with long top wick
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.12)
+ | (dataframe['top_wick_pct_1d'] < 0.12))
+ # current 1d long 1d with top wick, overbought 1d, downtrend 1h
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.2)
+ | (dataframe['top_wick_pct_1d'] < 0.04)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['not_downtrend_1h']))
+ # current 1d long red, overbought 1d, downtrend 1h
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.1)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['not_downtrend_1h']))
+
+ # Logic
+ item_buy_logic.append(dataframe['bb40_2_delta'].gt(dataframe['close'] * 0.052))
+ item_buy_logic.append(dataframe['close_delta'].gt(dataframe['close'] * 0.024))
+ item_buy_logic.append(dataframe['bb40_2_tail'].lt(dataframe['bb40_2_delta'] * 0.2))
+ item_buy_logic.append(dataframe['close'].lt(dataframe['bb40_2_low'].shift()))
+ item_buy_logic.append(dataframe['close'].le(dataframe['close'].shift()))
+ item_buy_logic.append(dataframe['rsi_14'] < 30.0)
+
+ # Condition #92 - Long mode bear.
+ if index == 92:
+ # Protections
+ item_buy_logic.append(dataframe['btc_is_bull_4h'] == False)
+ item_buy_logic.append(dataframe['btc_pct_close_max_24_5m'] < 0.03)
+ item_buy_logic.append(dataframe['btc_pct_close_max_72_5m'] < 0.03)
+ item_buy_logic.append(dataframe['close_max_48'] < (dataframe['close'] * 1.2))
+ item_buy_logic.append(dataframe['high_max_12_1h'] < (dataframe['close'] * 1.3))
+
+ item_buy_logic.append(dataframe['ema_50_1h'] > dataframe['ema_200_1h'])
+ item_buy_logic.append(dataframe['sma_50_1h'] > dataframe['sma_200_1h'])
+
+ item_buy_logic.append(dataframe['ema_50_4h'] > dataframe['ema_200_4h'])
+ item_buy_logic.append(dataframe['sma_50_4h'] > dataframe['sma_200_4h'])
+
+ item_buy_logic.append(dataframe['rsi_14_4h'] < 85.0)
+ item_buy_logic.append(dataframe['rsi_14_1d'] < 85.0)
+ item_buy_logic.append(dataframe['r_480_4h'] < -10.0)
+
+ # current 1d long green with long top wick
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.12)
+ | (dataframe['top_wick_pct_1d'] < 0.12))
+ # overbought 1d, overbought 4h, downtrend 1h, drop in last 2h
+ item_buy_logic.append((dataframe['rsi_14_1d'] < 70.0)
+ | (dataframe['rsi_14_4h'] < 70.0)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 4h red, downtrend 1h, overbought 4h, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.06)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_4h'] < 0.5)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 4h long red, downtrend 1h, overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.12)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_1d'] < 0.8)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 1d red, overbought 1d, downtrend 1h, downtrend 4h, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.12)
+ | (dataframe['cti_20_1d'] < 0.85)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['is_downtrend_3_4h'] == False)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 1d red, overbought 1d, downtrend 1h, current 4h red, previous 4h green with top wick
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.08)
+ | (dataframe['cti_20_1d'] < 0.85)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['change_pct_4h'] > -0.0)
+ | (dataframe['change_pct_4h'].shift(48) < 0.04)
+ | (dataframe['top_wick_pct_4h'].shift(48) < 0.04))
+ # current 1d long red with long top wick, overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.12)
+ | (dataframe['top_wick_pct_1d'] < 0.12)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 1d long red, overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.16)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 4h red with top wick, overbought 1d
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.04)
+ | (dataframe['cti_20_1d'] < 0.85))
+ # current 4h green with top wick, overbought 4h
+ item_buy_logic.append((dataframe['change_pct_4h'] < 0.04)
+ | (dataframe['top_wick_pct_4h'] < 0.04)
+ | (dataframe['rsi_14_4h'] < 70.0))
+ # current 4h red, downtrend 1h, overbought 1d
+ item_buy_logic.append((dataframe['change_pct_4h'] > -0.04)
+ | (dataframe['not_downtrend_1h'])
+ | (dataframe['cti_20_1d'] < 0.5))
+ # current 1d long relative top wick, overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['top_wick_pct_1d'] < (abs(dataframe['change_pct_1d']) * 4.0))
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 4h relative long top wick, overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['top_wick_pct_4h'] < (abs(dataframe['change_pct_4h']) * 4.0))
+ | (dataframe['cti_20_1d'] < 0.85)
+ | (dataframe['rsi_14_1d'] < 50.0)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current and previous 1d red, overbought 1d, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1d'] > -0.04)
+ | (dataframe['change_pct_1d'].shift(288) > -0.04)
+ | (dataframe['cti_20_1d'] < 0.5)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+ # current 4h long green, overbought 4h, drop in last 2h
+ item_buy_logic.append((dataframe['change_pct_1d'] < 0.08)
+ | (dataframe['rsi_14_4h'] < 70.0)
+ | (dataframe['close_max_24'] < (dataframe['close'] * 1.1)))
+
+ # Logic
+ item_buy_logic.append(dataframe['ema_26'] > dataframe['ema_12'])
+ item_buy_logic.append((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * 0.03))
+ item_buy_logic.append((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open'] / 100))
+ item_buy_logic.append(dataframe['cti_20'] < -0.8)
+
+ item_buy_logic.append(dataframe['volume'] > 0)
+ item_buy = reduce(lambda x, y: x & y, item_buy_logic)
+ dataframe.loc[item_buy, 'enter_tag'] += f"{index} "
+ conditions.append(item_buy)
+ dataframe.loc[:, 'enter_long'] = item_buy
+
+ if conditions:
+ dataframe.loc[:, 'enter_long'] = reduce(lambda x, y: x | y, conditions)
+
+ return dataframe
+
+ def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ dataframe.loc[:, 'exit_long'] = 0
+ dataframe.loc[:, 'exit_short'] = 0
+
+ return dataframe
+
+ def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float,
+ time_in_force: str, current_time: datetime, entry_tag: Optional[str],
+ **kwargs) -> bool:
+ # allow force entries
+ if (entry_tag == 'force_entry'):
+ return True
+
+ dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)
+
+ if(len(dataframe) < 1):
+ return False
+
+ dataframe = dataframe.iloc[-1].squeeze()
+
+ if ((rate > dataframe['close'])):
+ slippage = ((rate / dataframe['close']) - 1.0)
+
+ if slippage < 0.038:
+ return True
+ else:
+ log.warning(
+ "Cancelling buy for %s due to slippage %s",
+ pair, slippage
+ )
+ return False
+
+ return True
+
+ def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,
+ rate: float, time_in_force: str, exit_reason: str,
+ current_time: datetime, **kwargs) -> bool:
+ # Allow force exits
+ if exit_reason != 'force_exit':
+ if self._should_hold_trade(trade, rate, exit_reason):
+ return False
+ if self.exit_profit_only:
+ current_profit = ((rate - trade.open_rate) / trade.open_rate)
+ if (current_profit < self.exit_profit_offset):
+ return False
+
+ self._remove_profit_target(pair)
+ return True
+
+ def bot_loop_start(self, **kwargs) -> None:
+ if self.config["runmode"].value not in ("live", "dry_run"):
+ return super().bot_loop_start(**kwargs)
+
+ if self.hold_support_enabled:
+ self.load_hold_trades_config()
+
+ return super().bot_loop_start(**kwargs)
+
+ def _set_profit_target(self, pair: str, sell_reason: str, rate: float, current_profit: float, current_time: datetime):
+ self.target_profit_cache.data[pair] = {
+ "rate": rate,
+ "profit": current_profit,
+ "sell_reason": sell_reason,
+ "time_profit_reached": current_time.isoformat()
+ }
+ self.target_profit_cache.save()
+
+ def _remove_profit_target(self, pair: str):
+ if self.target_profit_cache is not None:
+ self.target_profit_cache.data.pop(pair, None)
+ self.target_profit_cache.save()
+
+ def get_hold_trades_config_file(self):
+ proper_holds_file_path = self.config["user_data_dir"].resolve() / "nfi-hold-trades.json"
+ if proper_holds_file_path.is_file():
+ return proper_holds_file_path
+
+ strat_file_path = pathlib.Path(__file__)
+ hold_trades_config_file_resolve = strat_file_path.resolve().parent / "hold-trades.json"
+ if hold_trades_config_file_resolve.is_file():
+ log.warning(
+ "Please move %s to %s which is now the expected path for the holds file",
+ hold_trades_config_file_resolve,
+ proper_holds_file_path,
+ )
+ return hold_trades_config_file_resolve
+
+ # The resolved path does not exist, is it a symlink?
+ hold_trades_config_file_absolute = strat_file_path.absolute().parent / "hold-trades.json"
+ if hold_trades_config_file_absolute.is_file():
+ log.warning(
+ "Please move %s to %s which is now the expected path for the holds file",
+ hold_trades_config_file_absolute,
+ proper_holds_file_path,
+ )
+ return hold_trades_config_file_absolute
+
+ def load_hold_trades_config(self):
+ if self.hold_trades_cache is None:
+ hold_trades_config_file = self.get_hold_trades_config_file()
+ if hold_trades_config_file:
+ log.warning("Loading hold support data from %s", hold_trades_config_file)
+ self.hold_trades_cache = HoldsCache(hold_trades_config_file)
+
+ if self.hold_trades_cache:
+ self.hold_trades_cache.load()
+
+ def _should_hold_trade(self, trade: "Trade", rate: float, sell_reason: str) -> bool:
+ if self.config['runmode'].value not in ('live', 'dry_run'):
+ return False
+
+ if not self.hold_support_enabled:
+ return False
+
+ # Just to be sure our hold data is loaded, should be a no-op call after the first bot loop
+ self.load_hold_trades_config()
+
+ if not self.hold_trades_cache:
+ # Cache hasn't been setup, likely because the corresponding file does not exist, sell
+ return False
+
+ if not self.hold_trades_cache.data:
+ # We have no pairs we want to hold until profit, sell
+ return False
+
+ # By default, no hold should be done
+ hold_trade = False
+
+ trade_ids: dict = self.hold_trades_cache.data.get("trade_ids")
+ if trade_ids and trade.id in trade_ids:
+ trade_profit_ratio = trade_ids[trade.id]
+ current_profit_ratio = trade.calc_profit_ratio(rate)
+ if sell_reason == "force_sell":
+ formatted_profit_ratio = f"{trade_profit_ratio * 100}%"
+ formatted_current_profit_ratio = f"{current_profit_ratio * 100}%"
+ log.warning(
+ "Force selling %s even though the current profit of %s < %s",
+ trade, formatted_current_profit_ratio, formatted_profit_ratio
+ )
+ return False
+ elif current_profit_ratio >= trade_profit_ratio:
+ # This pair is on the list to hold, and we reached minimum profit, sell
+ formatted_profit_ratio = f"{trade_profit_ratio * 100}%"
+ formatted_current_profit_ratio = f"{current_profit_ratio * 100}%"
+ log.warning(
+ "Selling %s because the current profit of %s >= %s",
+ trade, formatted_current_profit_ratio, formatted_profit_ratio
+ )
+ return False
+
+ # This pair is on the list to hold, and we haven't reached minimum profit, hold
+ hold_trade = True
+
+ trade_pairs: dict = self.hold_trades_cache.data.get("trade_pairs")
+ if trade_pairs and trade.pair in trade_pairs:
+ trade_profit_ratio = trade_pairs[trade.pair]
+ current_profit_ratio = trade.calc_profit_ratio(rate)
+ if sell_reason == "force_sell":
+ formatted_profit_ratio = f"{trade_profit_ratio * 100}%"
+ formatted_current_profit_ratio = f"{current_profit_ratio * 100}%"
+ log.warning(
+ "Force selling %s even though the current profit of %s < %s",
+ trade, formatted_current_profit_ratio, formatted_profit_ratio
+ )
+ return False
+ elif current_profit_ratio >= trade_profit_ratio:
+ # This pair is on the list to hold, and we reached minimum profit, sell
+ formatted_profit_ratio = f"{trade_profit_ratio * 100}%"
+ formatted_current_profit_ratio = f"{current_profit_ratio * 100}%"
+ log.warning(
+ "Selling %s because the current profit of %s >= %s",
+ trade, formatted_current_profit_ratio, formatted_profit_ratio
+ )
+ return False
+
+ # This pair is on the list to hold, and we haven't reached minimum profit, hold
+ hold_trade = True
+
+ return hold_trade
+
+# +---------------------------------------------------------------------------+
+# | Custom Indicators |
+# +---------------------------------------------------------------------------+
+
+# Range midpoint acts as Support
+def is_support(row_data) -> bool:
+ conditions = []
+ for row in range(len(row_data)-1):
+ if row < len(row_data)//2:
+ conditions.append(row_data[row] > row_data[row+1])
+ else:
+ conditions.append(row_data[row] < row_data[row+1])
+ result = reduce(lambda x, y: x & y, conditions)
+ return result
+
+# Range midpoint acts as Resistance
+def is_resistance(row_data) -> bool:
+ conditions = []
+ for row in range(len(row_data)-1):
+ if row < len(row_data)//2:
+ conditions.append(row_data[row] < row_data[row+1])
+ else:
+ conditions.append(row_data[row] > row_data[row+1])
+ result = reduce(lambda x, y: x & y, conditions)
+ return result
+
+# Elliot Wave Oscillator
+def ewo(dataframe, sma1_length=5, sma2_length=35):
+ sma1 = ta.EMA(dataframe, timeperiod=sma1_length)
+ sma2 = ta.EMA(dataframe, timeperiod=sma2_length)
+ smadif = (sma1 - sma2) / dataframe['close'] * 100
+ return smadif
+
+# Chaikin Money Flow
+def chaikin_money_flow(dataframe, n=20, fillna=False) -> Series:
+ """Chaikin Money Flow (CMF)
+ It measures the amount of Money Flow Volume over a specific period.
+ http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:chaikin_money_flow_cmf
+ Args:
+ dataframe(pandas.Dataframe): dataframe containing ohlcv
+ n(int): n period.
+ fillna(bool): if True, fill nan values.
+ Returns:
+ pandas.Series: New feature generated.
+ """
+ mfv = ((dataframe['close'] - dataframe['low']) - (dataframe['high'] - dataframe['close'])) / (dataframe['high'] - dataframe['low'])
+ mfv = mfv.fillna(0.0) # float division by zero
+ mfv *= dataframe['volume']
+ cmf = (mfv.rolling(n, min_periods=0).sum()
+ / dataframe['volume'].rolling(n, min_periods=0).sum())
+ if fillna:
+ cmf = cmf.replace([np.inf, -np.inf], np.nan).fillna(0)
+ return Series(cmf, name='cmf')
+
+# Williams %R
+def williams_r(dataframe: DataFrame, period: int = 14) -> Series:
+ """Williams %R, or just %R, is a technical analysis oscillator showing the current closing price in relation to the high and low
+ of the past N days (for a given N). It was developed by a publisher and promoter of trading materials, Larry Williams.
+ Its purpose is to tell whether a stock or commodity market is trading near the high or the low, or somewhere in between,
+ of its recent trading range.
+ The oscillator is on a negative scale, from −100 (lowest) up to 0 (highest).
+ """
+
+ highest_high = dataframe["high"].rolling(center=False, window=period).max()
+ lowest_low = dataframe["low"].rolling(center=False, window=period).min()
+
+ WR = Series(
+ (highest_high - dataframe["close"]) / (highest_high - lowest_low),
+ name=f"{period} Williams %R",
+ )
+
+ return WR * -100
+
+# Volume Weighted Moving Average
+def vwma(dataframe: DataFrame, length: int = 10):
+ """Indicator: Volume Weighted Moving Average (VWMA)"""
+ # Calculate Result
+ pv = dataframe['close'] * dataframe['volume']
+ vwma = Series(ta.SMA(pv, timeperiod=length) / ta.SMA(dataframe['volume'], timeperiod=length))
+ vwma = vwma.fillna(0, inplace=True)
+ return vwma
+
+# Exponential moving average of a volume weighted simple moving average
+def ema_vwma_osc(dataframe, len_slow_ma):
+ slow_ema = Series(ta.EMA(vwma(dataframe, len_slow_ma), len_slow_ma))
+ return ((slow_ema - slow_ema.shift(1)) / slow_ema.shift(1)) * 100
+
+def t3_average(dataframe, length=5):
+ """
+ T3 Average by HPotter on Tradingview
+ https://www.tradingview.com/script/qzoC9H1I-T3-Average/
+ """
+ df = dataframe.copy()
+
+ df['xe1'] = ta.EMA(df['close'], timeperiod=length)
+ df['xe1'].fillna(0, inplace=True)
+ df['xe2'] = ta.EMA(df['xe1'], timeperiod=length)
+ df['xe2'].fillna(0, inplace=True)
+ df['xe3'] = ta.EMA(df['xe2'], timeperiod=length)
+ df['xe3'].fillna(0, inplace=True)
+ df['xe4'] = ta.EMA(df['xe3'], timeperiod=length)
+ df['xe4'].fillna(0, inplace=True)
+ df['xe5'] = ta.EMA(df['xe4'], timeperiod=length)
+ df['xe5'].fillna(0, inplace=True)
+ df['xe6'] = ta.EMA(df['xe5'], timeperiod=length)
+ df['xe6'].fillna(0, inplace=True)
+ b = 0.7
+ c1 = -b * b * b
+ c2 = 3 * b * b + 3 * b * b * b
+ c3 = -6 * b * b - 3 * b - 3 * b * b * b
+ c4 = 1 + 3 * b + b * b * b + 3 * b * b
+ df['T3Average'] = c1 * df['xe6'] + c2 * df['xe5'] + c3 * df['xe4'] + c4 * df['xe3']
+
+ return df['T3Average']
+
+# Pivot Points - 3 variants - daily recommended
+def pivot_points(dataframe: DataFrame, mode = 'fibonacci') -> Series:
+ if mode == 'simple':
+ hlc3_pivot = (dataframe['high'] + dataframe['low'] + dataframe['close']).shift(1) / 3
+ res1 = hlc3_pivot * 2 - dataframe['low'].shift(1)
+ sup1 = hlc3_pivot * 2 - dataframe['high'].shift(1)
+ res2 = hlc3_pivot + (dataframe['high'] - dataframe['low']).shift()
+ sup2 = hlc3_pivot - (dataframe['high'] - dataframe['low']).shift()
+ res3 = hlc3_pivot * 2 + (dataframe['high'] - 2 * dataframe['low']).shift()
+ sup3 = hlc3_pivot * 2 - (2 * dataframe['high'] - dataframe['low']).shift()
+ return hlc3_pivot, res1, res2, res3, sup1, sup2, sup3
+ elif mode == 'fibonacci':
+ hlc3_pivot = (dataframe['high'] + dataframe['low'] + dataframe['close']).shift(1) / 3
+ hl_range = (dataframe['high'] - dataframe['low']).shift(1)
+ res1 = hlc3_pivot + 0.382 * hl_range
+ sup1 = hlc3_pivot - 0.382 * hl_range
+ res2 = hlc3_pivot + 0.618 * hl_range
+ sup2 = hlc3_pivot - 0.618 * hl_range
+ res3 = hlc3_pivot + 1 * hl_range
+ sup3 = hlc3_pivot - 1 * hl_range
+ return hlc3_pivot, res1, res2, res3, sup1, sup2, sup3
+ elif mode == 'DeMark':
+ demark_pivot_lt = (dataframe['low'] * 2 + dataframe['high'] + dataframe['close'])
+ demark_pivot_eq = (dataframe['close'] * 2 + dataframe['low'] + dataframe['high'])
+ demark_pivot_gt = (dataframe['high'] * 2 + dataframe['low'] + dataframe['close'])
+ demark_pivot = np.where((dataframe['close'] < dataframe['open']), demark_pivot_lt, np.where((dataframe['close'] > dataframe['open']), demark_pivot_gt, demark_pivot_eq))
+ dm_pivot = demark_pivot / 4
+ dm_res = demark_pivot / 2 - dataframe['low']
+ dm_sup = demark_pivot / 2 - dataframe['high']
+ return dm_pivot, dm_res, dm_sup
+
+# Heikin Ashi candles
+def heikin_ashi(dataframe, smooth_inputs = False, smooth_outputs = False, length = 10):
+ df = dataframe[['open','close','high','low']].copy().fillna(0)
+ if smooth_inputs:
+ df['open_s'] = ta.EMA(df['open'], timeframe = length)
+ df['high_s'] = ta.EMA(df['high'], timeframe = length)
+ df['low_s'] = ta.EMA(df['low'], timeframe = length)
+ df['close_s'] = ta.EMA(df['close'],timeframe = length)
+
+ open_ha = (df['open_s'].shift(1) + df['close_s'].shift(1)) / 2
+ high_ha = df.loc[:, ['high_s', 'open_s', 'close_s']].max(axis=1)
+ low_ha = df.loc[:, ['low_s', 'open_s', 'close_s']].min(axis=1)
+ close_ha = (df['open_s'] + df['high_s'] + df['low_s'] + df['close_s'])/4
+ else:
+ open_ha = (df['open'].shift(1) + df['close'].shift(1)) / 2
+ high_ha = df.loc[:, ['high', 'open', 'close']].max(axis=1)
+ low_ha = df.loc[:, ['low', 'open', 'close']].min(axis=1)
+ close_ha = (df['open'] + df['high'] + df['low'] + df['close'])/4
+
+ open_ha = open_ha.fillna(0)
+ high_ha = high_ha.fillna(0)
+ low_ha = low_ha.fillna(0)
+ close_ha = close_ha.fillna(0)
+
+ if smooth_outputs:
+ open_sha = ta.EMA(open_ha, timeframe = length)
+ high_sha = ta.EMA(high_ha, timeframe = length)
+ low_sha = ta.EMA(low_ha, timeframe = length)
+ close_sha = ta.EMA(close_ha, timeframe = length)
+
+ return open_sha, close_sha, low_sha
+ else:
+ return open_ha, close_ha, low_ha
+
+# Peak Percentage Change
+def range_percent_change(self, dataframe: DataFrame, method, length: int) -> float:
+ """
+ Rolling Percentage Change Maximum across interval.
+
+ :param dataframe: DataFrame The original OHLC dataframe
+ :param method: High to Low / Open to Close
+ :param length: int The length to look back
+ """
+ if method == 'HL':
+ return (dataframe['high'].rolling(length).max() - dataframe['low'].rolling(length).min()) / dataframe['low'].rolling(length).min()
+ elif method == 'OC':
+ return (dataframe['open'].rolling(length).max() - dataframe['close'].rolling(length).min()) / dataframe['close'].rolling(length).min()
+ else:
+ raise ValueError(f"Method {method} not defined!")
+
+# Percentage distance to top peak
+def top_percent_change(self, dataframe: DataFrame, length: int) -> float:
+ """
+ Percentage change of the current close from the range maximum Open price
+
+ :param dataframe: DataFrame The original OHLC dataframe
+ :param length: int The length to look back
+ """
+ if length == 0:
+ return (dataframe['open'] - dataframe['close']) / dataframe['close']
+ else:
+ return (dataframe['open'].rolling(length).max() - dataframe['close']) / dataframe['close']
+
+ # +---------------------------------------------------------------------------+
+# | Classes |
+# +---------------------------------------------------------------------------+
+
+class Cache:
+
+ def __init__(self, path):
+ self.path = path
+ self.data = {}
+ self._mtime = None
+ self._previous_data = {}
+ try:
+ self.load()
+ except FileNotFoundError:
+ pass
+
+ @staticmethod
+ def rapidjson_load_kwargs():
+ return {"number_mode": rapidjson.NM_NATIVE}
+
+ @staticmethod
+ def rapidjson_dump_kwargs():
+ return {"number_mode": rapidjson.NM_NATIVE}
+
+ def load(self):
+ if not self._mtime or self.path.stat().st_mtime_ns != self._mtime:
+ self._load()
+
+ def save(self):
+ if self.data != self._previous_data:
+ self._save()
+
+ def process_loaded_data(self, data):
+ return data
+
+ def _load(self):
+ # This method only exists to simplify unit testing
+ with self.path.open("r") as rfh:
+ try:
+ data = rapidjson.load(
+ rfh,
+ **self.rapidjson_load_kwargs()
+ )
+ except rapidjson.JSONDecodeError as exc:
+ log.error("Failed to load JSON from %s: %s", self.path, exc)
+ else:
+ self.data = self.process_loaded_data(data)
+ self._previous_data = copy.deepcopy(self.data)
+ self._mtime = self.path.stat().st_mtime_ns
+
+ def _save(self):
+ # This method only exists to simplify unit testing
+ rapidjson.dump(
+ self.data,
+ self.path.open("w"),
+ **self.rapidjson_dump_kwargs()
+ )
+ self._mtime = self.path.stat().st_mtime
+ self._previous_data = copy.deepcopy(self.data)
+
+class HoldsCache(Cache):
+
+ @staticmethod
+ def rapidjson_load_kwargs():
+ return {
+ "number_mode": rapidjson.NM_NATIVE,
+ "object_hook": HoldsCache._object_hook,
+ }
+
+ @staticmethod
+ def rapidjson_dump_kwargs():
+ return {
+ "number_mode": rapidjson.NM_NATIVE,
+ "mapping_mode": rapidjson.MM_COERCE_KEYS_TO_STRINGS,
+ }
+
+ def save(self):
+ raise RuntimeError("The holds cache does not allow programatical save")
+
+ def process_loaded_data(self, data):
+ trade_ids = data.get("trade_ids")
+ trade_pairs = data.get("trade_pairs")
+
+ if not trade_ids and not trade_pairs:
+ return data
+
+ open_trades = {}
+ for trade in Trade.get_trades_proxy(is_open=True):
+ open_trades[trade.id] = open_trades[trade.pair] = trade
+
+ r_trade_ids = {}
+ if trade_ids:
+ if isinstance(trade_ids, dict):
+ # New syntax
+ for trade_id, profit_ratio in trade_ids.items():
+ if not isinstance(trade_id, int):
+ log.error(
+ "The trade_id(%s) defined under 'trade_ids' in %s is not an integer",
+ trade_id, self.path
+ )
+ continue
+ if not isinstance(profit_ratio, float):
+ log.error(
+ "The 'profit_ratio' config value(%s) for trade_id %s in %s is not a float",
+ profit_ratio,
+ trade_id,
+ self.path
+ )
+ if trade_id in open_trades:
+ formatted_profit_ratio = f"{profit_ratio * 100}%"
+ log.warning(
+ "The trade %s is configured to HOLD until the profit ratio of %s is met",
+ open_trades[trade_id],
+ formatted_profit_ratio
+ )
+ r_trade_ids[trade_id] = profit_ratio
+ else:
+ log.warning(
+ "The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s",
+ trade_id,
+ self.path
+ )
+ else:
+ # Initial Syntax
+ profit_ratio = data.get("profit_ratio")
+ if profit_ratio:
+ if not isinstance(profit_ratio, float):
+ log.error(
+ "The 'profit_ratio' config value(%s) in %s is not a float",
+ profit_ratio,
+ self.path
+ )
+ else:
+ profit_ratio = 0.005
+ formatted_profit_ratio = f"{profit_ratio * 100}%"
+ for trade_id in trade_ids:
+ if not isinstance(trade_id, int):
+ log.error(
+ "The trade_id(%s) defined under 'trade_ids' in %s is not an integer",
+ trade_id, self.path
+ )
+ continue
+ if trade_id in open_trades:
+ log.warning(
+ "The trade %s is configured to HOLD until the profit ratio of %s is met",
+ open_trades[trade_id],
+ formatted_profit_ratio
+ )
+ r_trade_ids[trade_id] = profit_ratio
+ else:
+ log.warning(
+ "The trade_id(%s) is no longer open. Please remove it from 'trade_ids' in %s",
+ trade_id,
+ self.path
+ )
+
+ r_trade_pairs = {}
+ if trade_pairs:
+ for trade_pair, profit_ratio in trade_pairs.items():
+ if not isinstance(trade_pair, str):
+ log.error(
+ "The trade_pair(%s) defined under 'trade_pairs' in %s is not a string",
+ trade_pair, self.path
+ )
+ continue
+ if "/" not in trade_pair:
+ log.error(
+ "The trade_pair(%s) defined under 'trade_pairs' in %s does not look like "
+ "a valid '/' formatted pair.",
+ trade_pair, self.path
+ )
+ continue
+ if not isinstance(profit_ratio, float):
+ log.error(
+ "The 'profit_ratio' config value(%s) for trade_pair %s in %s is not a float",
+ profit_ratio,
+ trade_pair,
+ self.path
+ )
+ formatted_profit_ratio = f"{profit_ratio * 100}%"
+ if trade_pair in open_trades:
+ log.warning(
+ "The trade %s is configured to HOLD until the profit ratio of %s is met",
+ open_trades[trade_pair],
+ formatted_profit_ratio
+ )
+ else:
+ log.warning(
+ "The trade pair %s is configured to HOLD until the profit ratio of %s is met",
+ trade_pair,
+ formatted_profit_ratio
+ )
+ r_trade_pairs[trade_pair] = profit_ratio
+
+ r_data = {}
+ if r_trade_ids:
+ r_data["trade_ids"] = r_trade_ids
+ if r_trade_pairs:
+ r_data["trade_pairs"] = r_trade_pairs
+ return r_data
+
+ @staticmethod
+ def _object_hook(data):
+ _data = {}
+ for key, value in data.items():
+ try:
+ key = int(key)
+ except ValueError:
+ pass
+ _data[key] = value
+ return _data
diff --git a/strategies/ROuGGy.py b/strategies/ROuGGy.py
new file mode 100755
index 0000000..cf6be3d
--- /dev/null
+++ b/strategies/ROuGGy.py
@@ -0,0 +1,595 @@
+import freqtrade.vendor.qtpylib.indicators as qtpylib
+import numpy as np
+import talib.abstract as ta
+from freqtrade.persistence import Trade
+from freqtrade.strategy.interface import IStrategy
+from pandas import DataFrame
+from datetime import datetime, timedelta
+from freqtrade.strategy import merge_informative_pair, CategoricalParameter, DecimalParameter, IntParameter
+from functools import reduce
+
+
+###########################################################################################################
+## BigZ06 by ilya ##
+## ##
+## https://github.com/i1ya/freqtrade-strategies ##
+## The stratagy most inspired by iterativ (authors of the CombinedBinHAndClucV6) ##
+## ## ##
+###########################################################################################################
+## The main point of this strat is: ##
+## - make drawdown as low as possible ##
+## - buy at dip ##
+## - sell quick as fast as you can (release money for the next buy) ##
+## - soft check if market if rising ##
+## - hard check is market if fallen ##
+## - 14 buy signals ##
+## - stoploss function preventing from big fall ##
+## - no sell signal. Whether ROI or stoploss =) ##
+## ##
+###########################################################################################################
+## GENERAL RECOMMENDATIONS ##
+## ##
+## For optimal performance, suggested to use between 3 and 5 open trades. ##
+## ##
+## As a pairlist you can use VolumePairlist. ##
+## ##
+## Ensure that you don't override any variables in your config.json. Especially ##
+## the timeframe (must be 5m). ##
+## ##
+## sell_profit_only: ##
+## True - risk more (gives you higher profit and higher Drawdown) ##
+## False (default) - risk less (gives you less ~10-15% profit and much lower Drawdown) ##
+## ##
+## BigZ06 using market orders. ##
+## Ensure you're familar with https://www.freqtrade.io/en/stable/configuration/#market-order-pricing ##
+## ##
+###########################################################################################################
+## DONATIONS 2 @iterativ (author of the original strategy) ##
+## ##
+## Absolutely not required. However, will be accepted as a token of appreciation. ##
+## ##
+## BTC: bc1qvflsvddkmxh7eqhc4jyu5z5k6xcw3ay8jl49sk ##
+## ETH: 0x83D3cFb8001BDC5d2211cBeBB8cB3461E5f7Ec91 ##
+## ##
+###########################################################################################################
+
+
+class ROuGGy(IStrategy):
+ INTERFACE_VERSION = 2
+
+ minimal_roi = {
+ "0": 0.028, # I feel lucky!
+ "10": 0.018,
+ "40": 0.005,
+ "180": 0.018, # We're going up?
+ }
+
+
+ stoploss = -0.99 # effectively disabled.
+
+ timeframe = '5m'
+ inf_1h = '1h'
+
+ # Sell signal
+ use_exit_signal = True
+ exit_profit_only = False
+ exit_profit_offset = 0.001 # it doesn't meant anything, just to guarantee there is a minimal profit.
+ ignore_roi_if_entry_signal = False
+
+ # Trailing stoploss
+ trailing_stop = False
+ trailing_only_offset_is_reached = False
+ trailing_stop_positive = 0.01
+ trailing_stop_positive_offset = 0.025
+
+ # Custom stoploss
+ use_custom_stoploss = True
+
+ # Run "populate_indicators()" only for new candle.
+ process_only_new_candles = True
+
+ # Number of candles the strategy requires before producing valid signals
+ startup_candle_count: int = 200
+
+ # Optional order type mapping.
+ order_types = {
+ 'entry': 'market',
+ 'exit': 'market',
+ 'stoploss': 'market',
+ 'stoploss_on_exchange': False
+ }
+
+
+ buy_params = {
+ #############
+ # Enable/Disable conditions
+ "buy_condition_0_enable": True,
+ "buy_condition_1_enable": True,
+ "buy_condition_2_enable": True,
+ "buy_condition_3_enable": True,
+ "buy_condition_4_enable": True,
+ "buy_condition_5_enable": True,
+ "buy_condition_6_enable": True,
+ "buy_condition_7_enable": True,
+ "buy_condition_8_enable": True,
+ "buy_condition_9_enable": True,
+ "buy_condition_10_enable": True,
+ "buy_condition_11_enable": True,
+ "buy_condition_12_enable": True,
+ "buy_condition_13_enable": True,
+ "buy_condition_14_enable": True,
+ }
+
+ ############################################################################
+
+ # Buy
+
+ buy_condition_0_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_1_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_2_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_3_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_4_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_5_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_6_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_7_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_8_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_9_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_10_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_11_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_12_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_13_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+ buy_condition_14_enable = CategoricalParameter([True, False], default=True, space='buy', optimize=False, load=True)
+
+ buy_bb20_close_bblowerband_safe_1 = DecimalParameter(0.7, 1.1, default=0.989, space='buy', optimize=False, load=True)
+ buy_bb20_close_bblowerband_safe_2 = DecimalParameter(0.7, 1.1, default=0.982, space='buy', optimize=False, load=True)
+
+ buy_volume_pump_1 = DecimalParameter(0.1, 0.9, default=0.4, space='buy', decimals=1, optimize=False, load=True)
+ buy_volume_drop_1 = DecimalParameter(1, 10, default=3.8, space='buy', decimals=1, optimize=False, load=True)
+ buy_volume_drop_2 = DecimalParameter(1, 10, default=3, space='buy', decimals=1, optimize=False, load=True)
+ buy_volume_drop_3 = DecimalParameter(1, 10, default=2.7, space='buy', decimals=1, optimize=False, load=True)
+
+ buy_rsi_1h_1 = DecimalParameter(10.0, 40.0, default=16.5, space='buy', decimals=1, optimize=False, load=True)
+ buy_rsi_1h_2 = DecimalParameter(10.0, 40.0, default=15.0, space='buy', decimals=1, optimize=False, load=True)
+ buy_rsi_1h_3 = DecimalParameter(10.0, 40.0, default=20.0, space='buy', decimals=1, optimize=False, load=True)
+ buy_rsi_1h_4 = DecimalParameter(10.0, 40.0, default=35.0, space='buy', decimals=1, optimize=False, load=True)
+ buy_rsi_1h_5 = DecimalParameter(10.0, 60.0, default=39.0, space='buy', decimals=1, optimize=False, load=True)
+
+ buy_rsi_1 = DecimalParameter(10.0, 40.0, default=28.0, space='buy', decimals=1, optimize=False, load=True)
+ buy_rsi_2 = DecimalParameter(7.0, 40.0, default=10.0, space='buy', decimals=1, optimize=False, load=True)
+ buy_rsi_3 = DecimalParameter(7.0, 40.0, default=14.2, space='buy', decimals=1, optimize=False, load=True)
+
+ buy_macd_1 = DecimalParameter(0.01, 0.09, default=0.02, space='buy', decimals=2, optimize=False, load=True)
+ buy_macd_2 = DecimalParameter(0.01, 0.09, default=0.03, space='buy', decimals=2, optimize=False, load=True)
+
+ def confirm_trade_exit(self, pair: str, trade: Trade, order_type: str, amount: float,
+ rate: float, time_in_force: str, sell_reason: str, **kwargs) -> bool:
+
+ return True
+
+
+ def custom_sell(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float,
+ current_profit: float, **kwargs):
+
+ return False
+
+ dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)
+ last_candle = dataframe.iloc[-1].squeeze()
+ last_candle_2 = dataframe.iloc[-2].squeeze()
+
+ if (last_candle is not None):
+ if (last_candle['high'] > last_candle['bb_upperband']) & (last_candle['volume'] > (last_candle_2['volume'] * 1.5)):
+ return 'sell_signal_1'
+
+ return False
+
+
+ def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime,
+ current_rate: float, current_profit: float, **kwargs) -> float:
+ # Manage losing trades and open room for better ones.
+
+ if (current_profit > 0):
+ return 0.99
+ else:
+ trade_time_50 = trade.open_date_utc + timedelta(minutes=50)
+
+ # Trade open more then 60 minutes. For this strategy it's means -> loss
+ # Let's try to minimize the loss
+
+ if (current_time > trade_time_50):
+
+ try:
+ number_of_candle_shift = int((current_time - trade_time_50).total_seconds() / 300)
+ dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)
+ candle = dataframe.iloc[-number_of_candle_shift].squeeze()
+
+ # We are at bottom. Wait...
+ if candle['rsi_1h'] < 40:
+ return 0.99
+
+ # Are we still sinking?
+ if candle['close'] > candle['ema_200']:
+ if current_rate * 1.035 < candle['open']:
+ return 0.01
+
+ if current_rate * 1.025 < candle['open']:
+ return 0.01
+
+ except IndexError as error:
+
+ # Whoops, set stoploss at 10%
+ return 0.1
+
+ return 0.99
+
+ def informative_pairs(self):
+ pairs = self.dp.current_whitelist()
+ informative_pairs = [(pair, '1h') for pair in pairs]
+ return informative_pairs
+
+ def informative_1h_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ assert self.dp, "DataProvider is required for multiple timeframes."
+ # Get the informative pair
+ informative_1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe=self.inf_1h)
+ # EMA
+ informative_1h['ema_50'] = ta.EMA(informative_1h, timeperiod=50)
+ informative_1h['ema_200'] = ta.EMA(informative_1h, timeperiod=200)
+ # RSI
+ informative_1h['rsi'] = ta.RSI(informative_1h, timeperiod=14)
+
+ bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)
+ informative_1h['bb_lowerband'] = bollinger['lower']
+ informative_1h['bb_middleband'] = bollinger['mid']
+ informative_1h['bb_upperband'] = bollinger['upper']
+
+ return informative_1h
+
+ def normal_tf_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+
+ bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)
+ dataframe['bb_lowerband'] = bollinger['lower']
+ dataframe['bb_middleband'] = bollinger['mid']
+ dataframe['bb_upperband'] = bollinger['upper']
+
+ dataframe['volume_mean_slow'] = dataframe['volume'].rolling(window=48).mean()
+
+ # EMA
+ dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200)
+
+ dataframe['ema_26'] = ta.EMA(dataframe, timeperiod=26)
+ dataframe['ema_12'] = ta.EMA(dataframe, timeperiod=12)
+
+ # For sell checks
+ dataframe['crossed_below_ema_12_26'] = qtpylib.crossed_below(dataframe['ema_12'], dataframe['ema_26'])
+ # For buy checks
+ dataframe['crossed_above_ema_12_26'] = qtpylib.crossed_above(dataframe['ema_12'], dataframe['ema_26'])
+
+ # MACD
+ dataframe['macd'], dataframe['signal'], dataframe['hist'] = ta.MACD(dataframe['close'], fastperiod=12, slowperiod=26, signalperiod=9)
+
+ # SMA
+ dataframe['sma_5'] = ta.EMA(dataframe, timeperiod=5)
+
+ # RSI
+ dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14)
+
+ # Chaikin A/D Oscillator
+ dataframe['mfv'] = MFV(dataframe)
+ dataframe['cmf'] = dataframe['mfv'].rolling(20).sum()/dataframe['volume'].rolling(20).sum()
+
+ return dataframe
+
+
+ def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ # The indicators for the 1h informative timeframe
+ informative_1h = self.informative_1h_indicators(dataframe, metadata)
+ dataframe = merge_informative_pair(dataframe, informative_1h, self.timeframe, self.inf_1h, ffill=True)
+
+ # The indicators for the normal (5m) timeframe
+ dataframe = self.normal_tf_indicators(dataframe, metadata)
+ print(dataframe)
+
+ return dataframe
+
+ def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+
+ conditions = []
+
+ conditions.append(
+ (
+ self.buy_condition_14_enable.value &
+
+ (dataframe['cmf'] > 0) &
+ (dataframe['crossed_above_ema_12_26']) &
+ (dataframe['rsi'] < 45) &
+ # (dataframe['open'] < dataframe['bb_lowerband']) &
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_13_enable.value &
+
+ (dataframe['close'] > dataframe['ema_200_1h']) &
+
+ (dataframe['cmf'] < -0.435) &
+ (dataframe['rsi'] < 22) &
+
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &
+ (dataframe['volume'] > 0)
+ )
+ )
+
+
+ conditions.append(
+ (
+ self.buy_condition_12_enable.value &
+
+ (dataframe['close'] > dataframe['ema_200']) &
+ (dataframe['close'] > dataframe['ema_200_1h']) &
+
+ (dataframe['close'] < dataframe['bb_lowerband'] * 0.993) &
+ (dataframe['low'] < dataframe['bb_lowerband'] * 0.985) &
+ (dataframe['close'].shift() > dataframe['bb_lowerband']) &
+ (dataframe['rsi_1h'] < 72.8) &
+ (dataframe['open'] > dataframe['close']) &
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &
+ ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &
+
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_11_enable.value &
+
+ (dataframe['close'] > dataframe['ema_200']) &
+
+ (dataframe['hist'] > 0) &
+ (dataframe['hist'].shift() > 0) &
+ (dataframe['hist'].shift(2) > 0) &
+ (dataframe['hist'].shift(3) > 0) &
+ (dataframe['hist'].shift(5) > 0) &
+
+ (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(5) > dataframe['close']/200) &
+ (dataframe['bb_middleband'] - dataframe['bb_middleband'].shift(10) > dataframe['close']/100) &
+ ((dataframe['bb_upperband'] - dataframe['bb_lowerband']) < (dataframe['close']*0.1)) &
+ ((dataframe['open'].shift() - dataframe['close'].shift()) < (dataframe['close'] * 0.018)) &
+ (dataframe['rsi'] > 51) &
+
+ (dataframe['open'] < dataframe['close']) &
+ (dataframe['open'].shift() > dataframe['close'].shift()) &
+
+ (dataframe['close'] > dataframe['bb_middleband']) &
+ (dataframe['close'].shift() < dataframe['bb_middleband'].shift()) &
+ (dataframe['low'].shift(2) > dataframe['bb_middleband'].shift(2)) &
+
+ (dataframe['volume'] > 0) # Make sure Volume is not 0
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_0_enable.value &
+
+ (dataframe['close'] > dataframe['ema_200']) &
+
+ (dataframe['rsi'] < 30) &
+ (dataframe['close'] * 1.024 < dataframe['open'].shift(3)) &
+ (dataframe['rsi_1h'] < 71) &
+
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &
+ (dataframe['volume'] > 0) # Make sure Volume is not 0
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_1_enable.value &
+
+ (dataframe['close'] > dataframe['ema_200']) &
+ (dataframe['close'] > dataframe['ema_200_1h']) &
+
+ (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb20_close_bblowerband_safe_1.value) &
+ (dataframe['rsi_1h'] < 69) &
+ (dataframe['open'] > dataframe['close']) &
+
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &
+ ((dataframe['open'] - dataframe['close']) < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &
+
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_2_enable.value &
+
+ (dataframe['close'] > dataframe['ema_200']) &
+
+ (dataframe['close'] < dataframe['bb_lowerband'] * self.buy_bb20_close_bblowerband_safe_2.value) &
+
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &
+ (dataframe['open'] - dataframe['close'] < dataframe['bb_upperband'].shift(2) - dataframe['bb_lowerband'].shift(2)) &
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_3_enable.value &
+
+ (dataframe['close'] > dataframe['ema_200_1h']) &
+
+ (dataframe['close'] < dataframe['bb_lowerband']) &
+ (dataframe['rsi'] < self.buy_rsi_3.value) &
+
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_3.value)) &
+
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_4_enable.value &
+
+ (dataframe['rsi_1h'] < self.buy_rsi_1h_1.value) &
+
+ (dataframe['close'] < dataframe['bb_lowerband']) &
+
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_5_enable.value &
+
+ (dataframe['close'] > dataframe['ema_200']) &
+ (dataframe['close'] > dataframe['ema_200_1h']) &
+
+ (dataframe['ema_26'] > dataframe['ema_12']) &
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &
+ ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &
+ (dataframe['close'] < (dataframe['bb_lowerband'])) &
+
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &
+ (dataframe['volume'] > 0) # Make sure Volume is not 0
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_6_enable.value &
+
+ (dataframe['rsi_1h'] < self.buy_rsi_1h_5.value) &
+
+ (dataframe['ema_26'] > dataframe['ema_12']) &
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_2.value)) &
+ ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &
+ (dataframe['close'] < (dataframe['bb_lowerband'])) &
+
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ conditions.append(
+ (
+ self.buy_condition_7_enable.value &
+
+ (dataframe['rsi_1h'] < self.buy_rsi_1h_2.value) &
+
+ (dataframe['ema_26'] > dataframe['ema_12']) &
+ ((dataframe['ema_26'] - dataframe['ema_12']) > (dataframe['open'] * self.buy_macd_1.value)) &
+ ((dataframe['ema_26'].shift() - dataframe['ema_12'].shift()) > (dataframe['open']/100)) &
+
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &
+ (dataframe['volume'] > 0)
+ )
+ )
+
+
+ conditions.append(
+ (
+
+ self.buy_condition_8_enable.value &
+
+ (dataframe['rsi_1h'] < self.buy_rsi_1h_3.value) &
+ (dataframe['rsi'] < self.buy_rsi_1.value) &
+
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &
+
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ conditions.append(
+ (
+
+ self.buy_condition_9_enable.value &
+
+ (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &
+ (dataframe['rsi'] < self.buy_rsi_2.value) &
+
+ (dataframe['volume'] < (dataframe['volume'].shift() * self.buy_volume_drop_1.value)) &
+ (dataframe['volume_mean_slow'] > dataframe['volume_mean_slow'].shift(48) * self.buy_volume_pump_1.value) &
+ (dataframe['volume_mean_slow'] * self.buy_volume_pump_1.value < dataframe['volume_mean_slow'].shift(48)) &
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ conditions.append(
+ (
+
+ self.buy_condition_10_enable.value &
+
+ (dataframe['rsi_1h'] < self.buy_rsi_1h_4.value) &
+ (dataframe['close_1h'] < dataframe['bb_lowerband_1h']) &
+
+ (dataframe['hist'] > 0) &
+ (dataframe['hist'].shift(2) < 0) &
+ (dataframe['rsi'] < 40.5) &
+ (dataframe['hist'] > dataframe['close'] * 0.0012) &
+ (dataframe['open'] < dataframe['close']) &
+
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ if conditions:
+ dataframe.loc[
+ reduce(lambda x, y: x | y, conditions),
+ 'buy'
+ ] = 1
+
+ return dataframe
+
+ def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ # dataframe.loc[
+ # (
+ # (dataframe['close'] > dataframe['bb_middleband'] * 1.01) & # Don't be gready, sell fast
+ # (dataframe['volume'] > 0) # Make sure Volume is not 0
+ # )
+ # ,
+ # 'sell'
+ # ] = 0
+
+ dataframe.loc[
+ (
+ (dataframe['crossed_below_ema_12_26']) &
+ (dataframe['volume'] > 0) # Make sure Volume is not 0
+ )
+ ,
+ 'sell'
+ ] = 0
+
+ return dataframe
+
+# Chaikin Money Flow Volume
+def MFV(dataframe):
+ df = dataframe.copy()
+ N = ((df['close'] - df['low']) - (df['high'] - df['close'])) / (df['high'] - df['low'])
+ M = N * df['volume']
+ return M
diff --git a/strategies/RSIDivergence.py b/strategies/RSIDivergence.py
new file mode 100755
index 0000000..d96c7d4
--- /dev/null
+++ b/strategies/RSIDivergence.py
@@ -0,0 +1,568 @@
+# --- Do not remove these libs ---
+from freqtrade.strategy.interface import IStrategy
+from typing import Dict, List
+from functools import reduce
+from pandas import DataFrame
+# --------------------------------
+
+import talib.abstract as ta
+import numpy as np
+import freqtrade.vendor.qtpylib.indicators as qtpylib
+import datetime
+from technical.util import resample_to_interval, resampled_merge
+from freqtrade.strategy import DecimalParameter, IntParameter, BooleanParameter
+
+rangeUpper = 60
+rangeLower = 5
+
+def EWO(dataframe, ema_length=5, ema2_length=35):
+ df = dataframe.copy()
+ ema1 = ta.EMA(df, timeperiod=ema_length)
+ ema2 = ta.EMA(df, timeperiod=ema2_length)
+ emadif = (ema1 - ema2) / df['close'] * 100
+ return emadif
+
+def valuewhen(dataframe, condition, source, occurrence):
+ copy = dataframe.copy()
+ copy['colFromIndex'] = copy.index
+ copy = copy.sort_values(by=[condition, 'colFromIndex'], ascending=False).reset_index(drop=True)
+ copy['valuewhen'] = np.where(copy[condition] > 0, copy[source].shift(-occurrence), copy[source])
+ copy['barrsince'] = copy['colFromIndex'] - copy['colFromIndex'].shift(-occurrence)
+ copy.loc[
+ (
+ (rangeLower <= copy['barrsince']) &
+ (copy['barrsince'] <= rangeUpper)
+ )
+ , "in_range"] = 1
+ copy['in_range'] = copy['in_range'].fillna(0)
+ copy = copy.sort_values(by=['colFromIndex'], ascending=True).reset_index(drop=True)
+ return copy['valuewhen'], copy['in_range']
+
+
+class Divergence(IStrategy):
+ INTERFACE_VERSION = 2
+
+ # Buy hyperspace params:
+ buy_params = {
+ 'use_bull': True,
+ 'use_hidden_bull': False,
+ "ewo_high": 5.835,
+ "low_rsi_buy": 30,
+ "high_rsi_buy": 60,
+ "low_adx_buy": 30,
+ "high_adx_buy": 30,
+ "low_stoch_buy": 20,
+ "high_stoch_buy": 80,
+ "low_osc_buy": 80,
+ "high_osc_buy": 80,
+ }
+ # Sell hyperspace params:
+ sell_params = {
+ 'use_bear': True,
+ 'use_hidden_bear': True
+ }
+
+ # ROI table:
+ minimal_roi = {
+ "0": 0.05,
+ }
+
+ # Stoploss:
+ stoploss = -0.08
+
+ # Trailing stop:
+ trailing_stop = True
+ trailing_stop_positive = 0.005
+ trailing_stop_positive_offset = 0.02
+ trailing_only_offset_is_reached = True
+
+ # Optimal timeframe for the strategy
+ timeframe = '5m'
+
+ use_custom_stoploss = False
+
+ use_bull = BooleanParameter(default=buy_params['use_bull'], space='buy', optimize=False)
+ use_hidden_bull = BooleanParameter(default=buy_params['use_hidden_bull'], space='buy', optimize=False)
+ use_bear = BooleanParameter(default=sell_params['use_bear'], space='sell', optimize=True)
+ use_hidden_bear = BooleanParameter(default=sell_params['use_hidden_bear'], space='sell', optimize=True)
+ # Protection
+ fast_ewo = 50
+ slow_ewo = 200
+ ewo_high = DecimalParameter(0, 7.0, default=buy_params['ewo_high'], space='buy', optimize=False)
+ low_rsi_buy = IntParameter(0, 100, default=buy_params['low_rsi_buy'], space='buy', optimize=True)
+ high_rsi_buy = IntParameter(0, 100, default=buy_params['high_rsi_buy'], space='buy', optimize=True)
+ low_adx_buy = IntParameter(0, 100, default=buy_params['low_adx_buy'], space='buy', optimize=True)
+ high_adx_buy = IntParameter(0, 100, default=buy_params['high_adx_buy'], space='buy', optimize=True)
+ low_stoch_buy = IntParameter(0, 100, default=buy_params['low_stoch_buy'], space='buy', optimize=True)
+ high_stoch_buy = IntParameter(0, 100, default=buy_params['high_stoch_buy'], space='buy', optimize=True)
+ low_osc_buy = IntParameter(0, 100, default=buy_params['low_osc_buy'], space='buy', optimize=True)
+ high_osc_buy = IntParameter(0, 100, default=buy_params['high_osc_buy'], space='buy', optimize=True)
+
+ # Number of candles the strategy requires before producing valid signals
+ startup_candle_count: int = 30
+
+ osc = 'slowd'
+ len = 14
+ src = 'close'
+ lbL = 5
+ lbR = 5
+
+ def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ """
+ study(title="Divergence Indicator", format=format.price, resolution="")
+ len = input(title="RSI Period", minval=1, defval=14)
+ src = input(title="RSI Source", defval=close)
+ lbR = input(title="Pivot Lookback Right", defval=5) # lookahead
+ lbL = input(title="Pivot Lookback Left", defval=5)
+ rangeUpper = input(title="Max of Lookback Range", defval=60)
+ rangeLower = input(title="Min of Lookback Range", defval=5)
+ plotBull = input(title="Plot Bullish", defval=true)
+ plotHiddenBull = input(title="Plot Hidden Bullish", defval=false)
+ plotBear = input(title="Plot Bearish", defval=true)
+ plotHiddenBear = input(title="Plot Hidden Bearish", defval=false)
+ bearColor = color.red
+ bullColor = color.green
+ hiddenBullColor = color.new(color.green, 80)
+ hiddenBearColor = color.new(color.red, 80)
+ textColor = color.white
+ noneColor = color.new(color.white, 100)
+ osc = rsi(src, len)
+ """
+ dataframe['RSI'] = ta.RSI(dataframe[self.src], self.len)
+ dataframe['RSI'] = dataframe['RSI'].fillna(0)
+ stoch = ta.STOCH(dataframe, fastk_period=10, slowk_period=3, slowk_matype=0, slowd_period=3, slowd_matype=0)
+ dataframe['slowk'] = stoch['slowk']
+ dataframe['slowd'] = stoch['slowd']
+ dataframe['osc'] = dataframe[self.osc]
+
+ # plFound = na(pivotlow(osc, lbL, lbR)) ? false : true
+ dataframe['min'] = dataframe['osc'].rolling(self.lbL).min()
+ dataframe['prevMin'] = np.where(dataframe['min'] > dataframe['min'].shift(), dataframe['min'].shift(), dataframe['min'])
+ dataframe.loc[
+ (
+ (dataframe['osc'].shift(1) == dataframe['prevMin'].shift(1)) &
+ (dataframe['osc'] != dataframe['prevMin'])
+ )
+ , 'plFound'] = 1
+
+ # phFound = na(pivothigh(osc, lbL, lbR)) ? false : true
+ dataframe['max'] = dataframe['osc'].rolling(self.lbL).max()
+ dataframe['prevMax'] = np.where(dataframe['max'] < dataframe['max'].shift(), dataframe['max'].shift(), dataframe['max'])
+ dataframe.loc[
+ (
+ (dataframe['osc'].shift(1) == dataframe['prevMax'].shift(1)) &
+ (dataframe['osc'] != dataframe['prevMax'])
+ )
+ , 'phFound'] = 1
+
+
+ #------------------------------------------------------------------------------
+ # Regular Bullish
+ # Osc: Higher Low
+ # oscHL = osc[lbR] > valuewhen(plFound, osc[lbR], 1) and _inRange(plFound[1])
+ dataframe['valuewhen_plFound_osc'], dataframe['inrange_plFound_osc'] = valuewhen(dataframe, 'plFound', 'osc', 1)
+ dataframe.loc[
+ (
+ (dataframe['osc'] > dataframe['valuewhen_plFound_osc']) &
+ (dataframe['inrange_plFound_osc'] == 1)
+ )
+ , 'oscHL'] = 1
+
+ # Price: Lower Low
+ # priceLL = low[lbR] < valuewhen(plFound, low[lbR], 1)
+ dataframe['valuewhen_plFound_low'], dataframe['inrange_plFound_low'] = valuewhen(dataframe, 'plFound', 'low', 1)
+ dataframe.loc[
+ (dataframe['low'] < dataframe['valuewhen_plFound_low'])
+ , 'priceLL'] = 1
+ #bullCond = plotBull and priceLL and oscHL and plFound
+ dataframe.loc[
+ (
+ (dataframe['priceLL'] == 1) &
+ (dataframe['oscHL'] == 1) &
+ (dataframe['plFound'] == 1)
+ )
+ , 'bullCond'] = 1
+
+ # plot(
+ # plFound ? osc[lbR] : na,
+ # offset=-lbR,
+ # title="Regular Bullish",
+ # linewidth=2,
+ # color=(bullCond ? bullColor : noneColor)
+ # )
+ #
+ # plotshape(
+ # bullCond ? osc[lbR] : na,
+ # offset=-lbR,
+ # title="Regular Bullish Label",
+ # text=" Bull ",
+ # style=shape.labelup,
+ # location=location.absolute,
+ # color=bullColor,
+ # textcolor=textColor
+ # )
+
+ # //------------------------------------------------------------------------------
+ # // Hidden Bullish
+ # // Osc: Lower Low
+ #
+ # oscLL = osc[lbR] < valuewhen(plFound, osc[lbR], 1) and _inRange(plFound[1])
+ dataframe['valuewhen_plFound_osc'], dataframe['inrange_plFound_osc'] = valuewhen(dataframe, 'plFound', 'osc', 1)
+ dataframe.loc[
+ (
+ (dataframe['osc'] < dataframe['valuewhen_plFound_osc']) &
+ (dataframe['inrange_plFound_osc'] == 1)
+ )
+ , 'oscLL'] = 1
+ #
+ # // Price: Higher Low
+ #
+ # priceHL = low[lbR] > valuewhen(plFound, low[lbR], 1)
+ dataframe['valuewhen_plFound_low'], dataframe['inrange_plFound_low'] = valuewhen(dataframe,'plFound', 'low', 1)
+ dataframe.loc[
+ (dataframe['low'] > dataframe['valuewhen_plFound_low'])
+ , 'priceHL'] = 1
+ # hiddenBullCond = plotHiddenBull and priceHL and oscLL and plFound
+ dataframe.loc[
+ (
+ (dataframe['priceHL'] == 1) &
+ (dataframe['oscLL'] == 1) &
+ (dataframe['plFound'] == 1)
+ )
+ , 'hiddenBullCond'] = 1
+ #
+ # plot(
+ # plFound ? osc[lbR] : na,
+ # offset=-lbR,
+ # title="Hidden Bullish",
+ # linewidth=2,
+ # color=(hiddenBullCond ? hiddenBullColor : noneColor)
+ # )
+ #
+ # plotshape(
+ # hiddenBullCond ? osc[lbR] : na,
+ # offset=-lbR,
+ # title="Hidden Bullish Label",
+ # text=" H Bull ",
+ # style=shape.labelup,
+ # location=location.absolute,
+ # color=bullColor,
+ # textcolor=textColor
+ # )
+ #
+ # //------------------------------------------------------------------------------
+ # // Regular Bearish
+ # // Osc: Lower High
+ #
+ # oscLH = osc[lbR] < valuewhen(phFound, osc[lbR], 1) and _inRange(phFound[1])
+ dataframe['valuewhen_phFound_osc'], dataframe['inrange_phFound_osc'] = valuewhen(dataframe, 'phFound', 'osc', 1)
+ dataframe.loc[
+ (
+ (dataframe['osc'] < dataframe['valuewhen_phFound_osc']) &
+ (dataframe['inrange_phFound_osc'] == 1)
+ )
+ , 'oscLH'] = 1
+ #
+ # // Price: Higher High
+ #
+ # priceHH = high[lbR] > valuewhen(phFound, high[lbR], 1)
+ dataframe['valuewhen_phFound_high'], dataframe['inrange_phFound_high'] = valuewhen(dataframe, 'phFound', 'high', 1)
+ dataframe.loc[
+ (dataframe['high'] > dataframe['valuewhen_phFound_high'])
+ , 'priceHH'] = 1
+ #
+ # bearCond = plotBear and priceHH and oscLH and phFound
+ dataframe.loc[
+ (
+ (dataframe['priceHH'] == 1) &
+ (dataframe['oscLH'] == 1) &
+ (dataframe['phFound'] == 1)
+ )
+ , 'bearCond'] = 1
+ #
+ # plot(
+ # phFound ? osc[lbR] : na,
+ # offset=-lbR,
+ # title="Regular Bearish",
+ # linewidth=2,
+ # color=(bearCond ? bearColor : noneColor)
+ # )
+ #
+ # plotshape(
+ # bearCond ? osc[lbR] : na,
+ # offset=-lbR,
+ # title="Regular Bearish Label",
+ # text=" Bear ",
+ # style=shape.labeldown,
+ # location=location.absolute,
+ # color=bearColor,
+ # textcolor=textColor
+ # )
+ #
+ # //------------------------------------------------------------------------------
+ # // Hidden Bearish
+ # // Osc: Higher High
+ #
+ # oscHH = osc[lbR] > valuewhen(phFound, osc[lbR], 1) and _inRange(phFound[1])
+ dataframe['valuewhen_phFound_osc'], dataframe['inrange_phFound_osc'] = valuewhen(dataframe, 'phFound', 'osc', 1)
+ dataframe.loc[
+ (
+ (dataframe['osc'] > dataframe['valuewhen_phFound_osc']) &
+ (dataframe['inrange_phFound_osc'] == 1)
+ )
+ , 'oscHH'] = 1
+ #
+ # // Price: Lower High
+ #
+ # priceLH = high[lbR] < valuewhen(phFound, high[lbR], 1)
+ dataframe['valuewhen_phFound_high'], dataframe['inrange_phFound_high'] = valuewhen(dataframe, 'phFound', 'high', 1)
+ dataframe.loc[
+ (dataframe['high'] < dataframe['valuewhen_phFound_high'])
+ , 'priceLH'] = 1
+ #
+ # hiddenBearCond = plotHiddenBear and priceLH and oscHH and phFound
+ dataframe.loc[
+ (
+ (dataframe['priceLH'] == 1) &
+ (dataframe['oscHH'] == 1) &
+ (dataframe['phFound'] == 1)
+ )
+ , 'hiddenBearCond'] = 1
+ #
+ # plot(
+ # phFound ? osc[lbR] : na,
+ # offset=-lbR,
+ # title="Hidden Bearish",
+ # linewidth=2,
+ # color=(hiddenBearCond ? hiddenBearColor : noneColor)
+ # )
+ #
+ # plotshape(
+ # hiddenBearCond ? osc[lbR] : na,
+ # offset=-lbR,
+ # title="Hidden Bearish Label",
+ # text=" H Bear ",
+ # style=shape.labeldown,
+ # location=location.absolute,
+ # color=bearColor,
+ # textcolor=textColor
+ # )"""
+
+ # Elliot
+ dataframe['EWO'] = EWO(dataframe, self.fast_ewo, self.slow_ewo)
+
+ dataframe['ADX'] = ta.ADX(dataframe, timeperiod=14)
+ return dataframe
+
+ def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ conditions = []
+
+ if self.use_bull.value:
+ conditions.append(
+ (
+ (dataframe['bullCond'] > 0) &
+ (dataframe['valuewhen_plFound_osc'] > self.low_osc_buy.value) &
+ (dataframe['valuewhen_plFound_osc'] < self.high_osc_buy.value) &
+ #(dataframe['EWO'] > self.ewo_high.value) &
+ (dataframe['RSI'] < self.high_rsi_buy.value) &
+ (dataframe['RSI'] > self.low_rsi_buy.value) &
+ (dataframe['ADX'] > self.low_adx_buy.value) &
+ (dataframe['ADX'] < self.high_adx_buy.value) &
+ (dataframe['slowk'] < self.high_stoch_buy.value) &
+ (dataframe['slowk'] > self.low_stoch_buy.value) &
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ if self.use_hidden_bull.value:
+ conditions.append(
+ (
+ (dataframe['hiddenBullCond'] > 0) &
+ (dataframe['valuewhen_plFound_osc'] > self.low_osc_buy.value) &
+ (dataframe['valuewhen_plFound_osc'] < self.high_osc_buy.value) &
+ (dataframe['RSI'] < self.high_rsi_buy.value) &
+ (dataframe['RSI'] > self.low_rsi_buy.value) &
+ (dataframe['slowk'] < self.high_stoch_buy.value) &
+ (dataframe['slowk'] > self.low_stoch_buy.value) &
+ (dataframe['ADX'] > self.low_adx_buy.value) &
+ (dataframe['ADX'] < self.high_adx_buy.value) &
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ if conditions:
+ dataframe.loc[
+ reduce(lambda x, y: x | y, conditions),
+ 'buy'
+ ] = 1
+
+ return dataframe
+
+ def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ conditions = []
+
+ if self.use_bear.value:
+ conditions.append(
+ (
+ (dataframe['bearCond'] > 0) &
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ if self.use_hidden_bear.value:
+ conditions.append(
+ (
+ (dataframe['hiddenBearCond'] > 0) &
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ if conditions:
+ dataframe.loc[
+ reduce(lambda x, y: x | y, conditions),
+ 'sell'
+ ] = 1
+
+ dataframe.to_csv('user_data/csvs/%s_%s.csv' % (self.__class__.__name__, metadata["pair"].replace("/", "_")))
+
+ return dataframe
+
+class RSIDivergence(SOTCHDivergence):
+
+ # Buy hyperspace params:
+ buy_params = {
+ "high_adx_buy": 68,
+ "high_osc_buy": 74,
+ "high_rsi_buy": 53,
+ "high_stoch_buy": 64,
+ "low_adx_buy": 41,
+ "low_osc_buy": 15,
+ "low_rsi_buy": 9,
+ "low_stoch_buy": 13,
+ "ewo_high": 5.835, # value loaded from strategy
+ "use_bull": True, # value loaded from strategy
+ "use_hidden_bull": False, # value loaded from strategy
+ }
+
+ # Sell hyperspace params:
+ sell_params = {
+ "use_bear": False, # value loaded from strategy
+ "use_hidden_bear": False, # value loaded from strategy
+ }
+
+ # ROI table: # value loaded from strategy
+ minimal_roi = {
+ "0": 0.131,
+ "13": 0.073,
+ "56": 0.022,
+ "133": 0
+ }
+
+ # Stoploss:
+ stoploss = -0.2 # value loaded from strategy
+
+ # Trailing stop:
+ trailing_stop = True # value loaded from strategy
+ trailing_stop_positive = 0.005 # value loaded from strategy
+ trailing_stop_positive_offset = 0.02 # value loaded from strategy
+ trailing_only_offset_is_reached = True # value loaded from strategy
+
+
+ osc = 'RSI'
+ len = 14
+ src = 'close'
+ lbL = 40
+
+class RSIDivergenceNPOriginal(RSIDivergence):
+ # Buy hyperspace params:
+ buy_params = {
+ "adx_buy": 36,
+ "high_rsi_buy": 60,
+ "high_stoch_buy": 92,
+ "low_rsi_buy": 21,
+ "low_stoch_buy": 6,
+ "use_bull": True,
+ "use_hidden_bull": False,
+ "ewo_high": 5.835, # value loaded from strategy
+ }
+
+ # Sell hyperspace params:
+ sell_params = {
+ "use_bear": False,
+ "use_hidden_bear": False,
+ }
+
+ # ROI table: # value loaded from strategy
+ minimal_roi = {
+ "0": 0.05
+ }
+
+ # Stoploss:
+ stoploss = -0.2 # value loaded from strategy
+
+ # Trailing stop:
+ trailing_stop = True
+ trailing_stop_positive = 0.001
+ trailing_stop_positive_offset = 0.02
+ trailing_only_offset_is_reached = True
+
+ osc = 'RSI'
+ len = 14
+ src = 'close'
+ lbL = 40
+
+ def populate_buy_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ conditions = []
+
+ if self.use_bull.value:
+ conditions.append(
+ (
+ (dataframe['bullCond'] > 0) &
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ if self.use_hidden_bull.value:
+ conditions.append(
+ (
+ (dataframe['hiddenBullCond'] > 0) &
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ if conditions:
+ dataframe.loc[
+ reduce(lambda x, y: x | y, conditions),
+ 'buy'
+ ] = 1
+
+ return dataframe
+
+ def populate_sell_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ conditions = []
+
+ if self.use_bear.value:
+ conditions.append(
+ (
+ (dataframe['bearCond'] > 0) &
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ if self.use_hidden_bear.value:
+ conditions.append(
+ (
+ (dataframe['hiddenBearCond'] > 0) &
+ (dataframe['volume'] > 0)
+ )
+ )
+
+ if conditions:
+ dataframe.loc[
+ reduce(lambda x, y: x | y, conditions),
+ 'sell'
+ ] = 1
+
+ dataframe.to_csv('user_data/csvs/%s_%s.csv' % (self.__class__.__name__, metadata["pair"].replace("/", "_")))
+
+ return dataframe
\ No newline at end of file
diff --git a/strategies/SwingHighToSky.py b/strategies/SwingHighToSky.py
new file mode 100755
index 0000000..4289cde
--- /dev/null
+++ b/strategies/SwingHighToSky.py
@@ -0,0 +1,110 @@
+"""
+author = "Kevin Ossenbrück"
+copyright = "Free For Use"
+credits = ["Bloom Trading, Mohsen Hassan"]
+license = "MIT"
+version = "1.0"
+maintainer = "Kevin Ossenbrück"
+email = "kevin.ossenbrueck@pm.de"
+status = "Live"
+"""
+
+from freqtrade.strategy import IStrategy
+from freqtrade.strategy import IntParameter
+from functools import reduce
+from pandas import DataFrame
+
+import talib.abstract as ta
+import freqtrade.vendor.qtpylib.indicators as qtpylib
+import numpy
+
+
+
+# CCI timerperiods and values
+cciBuyTP = 72
+cciBuyVal = -175
+cciSellTP = 66
+cciSellVal = -106
+
+# RSI timeperiods and values
+rsiBuyTP = 36
+rsiBuyVal = 90
+rsiSellTP = 45
+rsiSellVal = 88
+
+
+class SwingHighToSky(IStrategy):
+ INTERFACE_VERSION = 3
+
+ timeframe = '15m'
+
+ stoploss = -0.34338
+
+ minimal_roi = {"0": 0.27058, "33": 0.0853, "64": 0.04093, "244": 0}
+
+ buy_cci = IntParameter(low=-200, high=200, default=100, space='buy', optimize=True)
+ buy_cciTime = IntParameter(low=10, high=80, default=20, space='buy', optimize=True)
+ buy_rsi = IntParameter(low=10, high=90, default=30, space='buy', optimize=True)
+ buy_rsiTime = IntParameter(low=10, high=80, default=26, space='buy', optimize=True)
+
+ sell_cci = IntParameter(low=-200, high=200, default=100, space='sell', optimize=True)
+ sell_cciTime = IntParameter(low=10, high=80, default=20, space='sell', optimize=True)
+ sell_rsi = IntParameter(low=10, high=90, default=30, space='sell', optimize=True)
+ sell_rsiTime = IntParameter(low=10, high=80, default=26, space='sell', optimize=True)
+
+ # Buy hyperspace params:
+ buy_params = {
+ "buy_cci": -175,
+ "buy_cciTime": 72,
+ "buy_rsi": 90,
+ "buy_rsiTime": 36,
+ }
+
+ # Sell hyperspace params:
+ sell_params = {
+ "sell_cci": -106,
+ "sell_cciTime": 66,
+ "sell_rsi": 88,
+ "sell_rsiTime": 45,
+ }
+
+ def informative_pairs(self):
+ return []
+
+ def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+
+ for val in self.buy_cciTime.range:
+ dataframe[f'cci-{val}'] = ta.CCI(dataframe, timeperiod=val)
+
+ for val in self.sell_cciTime.range:
+ dataframe[f'cci-sell-{val}'] = ta.CCI(dataframe, timeperiod=val)
+
+ for val in self.buy_rsiTime.range:
+ dataframe[f'rsi-{val}'] = ta.RSI(dataframe, timeperiod=val)
+
+ for val in self.sell_rsiTime.range:
+ dataframe[f'rsi-sell-{val}'] = ta.RSI(dataframe, timeperiod=val)
+
+ return dataframe
+
+ def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+
+ dataframe.loc[
+ (
+ (dataframe[f'cci-{self.buy_cciTime.value}'] < self.buy_cci.value) &
+ (dataframe[f'rsi-{self.buy_rsiTime.value}'] < self.buy_rsi.value)
+ ),
+ 'enter_long'] = 1
+
+ return dataframe
+
+ def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+
+ dataframe.loc[
+ (
+ (dataframe[f'cci-sell-{self.sell_cciTime.value}'] > self.sell_cci.value) &
+ (dataframe[f'rsi-sell-{self.sell_rsiTime.value}'] > self.sell_rsi.value)
+ ),
+ 'exit_long'] = 1
+
+ return dataframe
diff --git a/strategies/sample_strategy.py b/strategies/sample_strategy.py
new file mode 100755
index 0000000..fd81570
--- /dev/null
+++ b/strategies/sample_strategy.py
@@ -0,0 +1,404 @@
+# pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement
+# flake8: noqa: F401
+# isort: skip_file
+# --- Do not remove these libs ---
+import numpy as np # noqa
+import pandas as pd # noqa
+from pandas import DataFrame
+from typing import Optional, Union
+
+from freqtrade.strategy import (BooleanParameter, CategoricalParameter, DecimalParameter,
+ IStrategy, IntParameter)
+
+# --------------------------------
+# Add your lib to import here
+import talib.abstract as ta
+import freqtrade.vendor.qtpylib.indicators as qtpylib
+
+
+# This class is a sample. Feel free to customize it.
+class SampleStrategy(IStrategy):
+ """
+ This is a sample strategy to inspire you.
+ More information in https://www.freqtrade.io/en/latest/strategy-customization/
+
+ You can:
+ :return: a Dataframe with all mandatory indicators for the strategies
+ - Rename the class name (Do not forget to update class_name)
+ - Add any methods you want to build your strategy
+ - Add any lib you need to build your strategy
+
+ You must keep:
+ - the lib in the section "Do not remove these libs"
+ - the methods: populate_indicators, populate_entry_trend, populate_exit_trend
+ You should keep:
+ - timeframe, minimal_roi, stoploss, trailing_*
+ """
+ # Strategy interface version - allow new iterations of the strategy interface.
+ # Check the documentation or the Sample strategy to get the latest version.
+ INTERFACE_VERSION = 3
+
+ # Can this strategy go short?
+ can_short: bool = False
+
+ # Minimal ROI designed for the strategy.
+ # This attribute will be overridden if the config file contains "minimal_roi".
+ minimal_roi = {
+ "60": 0.01,
+ "30": 0.02,
+ "0": 0.04
+ }
+
+ # Optimal stoploss designed for the strategy.
+ # This attribute will be overridden if the config file contains "stoploss".
+ stoploss = -0.10
+
+ # Trailing stoploss
+ trailing_stop = False
+ # trailing_only_offset_is_reached = False
+ # trailing_stop_positive = 0.01
+ # trailing_stop_positive_offset = 0.0 # Disabled / not configured
+
+ # Optimal timeframe for the strategy.
+ timeframe = '5m'
+
+ # Run "populate_indicators()" only for new candle.
+ process_only_new_candles = True
+
+ # These values can be overridden in the config.
+ use_exit_signal = True
+ exit_profit_only = False
+ ignore_roi_if_entry_signal = False
+
+ # Hyperoptable parameters
+ buy_rsi = IntParameter(low=1, high=50, default=30, space='buy', optimize=True, load=True)
+ sell_rsi = IntParameter(low=50, high=100, default=70, space='sell', optimize=True, load=True)
+ short_rsi = IntParameter(low=51, high=100, default=70, space='sell', optimize=True, load=True)
+ exit_short_rsi = IntParameter(low=1, high=50, default=30, space='buy', optimize=True, load=True)
+
+ # Number of candles the strategy requires before producing valid signals
+ startup_candle_count: int = 30
+
+ # Optional order type mapping.
+ order_types = {
+ 'entry': 'limit',
+ 'exit': 'limit',
+ 'stoploss': 'market',
+ 'stoploss_on_exchange': False
+ }
+
+ # Optional order time in force.
+ order_time_in_force = {
+ 'entry': 'GTC',
+ 'exit': 'GTC'
+ }
+
+ plot_config = {
+ 'main_plot': {
+ 'tema': {},
+ 'sar': {'color': 'white'},
+ },
+ 'subplots': {
+ "MACD": {
+ 'macd': {'color': 'blue'},
+ 'macdsignal': {'color': 'orange'},
+ },
+ "RSI": {
+ 'rsi': {'color': 'red'},
+ }
+ }
+ }
+
+ def informative_pairs(self):
+ """
+ Define additional, informative pair/interval combinations to be cached from the exchange.
+ These pair/interval combinations are non-tradeable, unless they are part
+ of the whitelist as well.
+ For more information, please consult the documentation
+ :return: List of tuples in the format (pair, interval)
+ Sample: return [("ETH/USDT", "5m"),
+ ("BTC/USDT", "15m"),
+ ]
+ """
+ return []
+
+ def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ """
+ Adds several different TA indicators to the given DataFrame
+
+ Performance Note: For the best performance be frugal on the number of indicators
+ you are using. Let uncomment only the indicator you are using in your strategies
+ or your hyperopt configuration, otherwise you will waste your memory and CPU usage.
+ :param dataframe: Dataframe with data from the exchange
+ :param metadata: Additional information, like the currently traded pair
+ :return: a Dataframe with all mandatory indicators for the strategies
+ """
+
+ # Momentum Indicators
+ # ------------------------------------
+
+ # ADX
+ dataframe['adx'] = ta.ADX(dataframe)
+
+ # # Plus Directional Indicator / Movement
+ # dataframe['plus_dm'] = ta.PLUS_DM(dataframe)
+ # dataframe['plus_di'] = ta.PLUS_DI(dataframe)
+
+ # # Minus Directional Indicator / Movement
+ # dataframe['minus_dm'] = ta.MINUS_DM(dataframe)
+ # dataframe['minus_di'] = ta.MINUS_DI(dataframe)
+
+ # # Aroon, Aroon Oscillator
+ # aroon = ta.AROON(dataframe)
+ # dataframe['aroonup'] = aroon['aroonup']
+ # dataframe['aroondown'] = aroon['aroondown']
+ # dataframe['aroonosc'] = ta.AROONOSC(dataframe)
+
+ # # Awesome Oscillator
+ # dataframe['ao'] = qtpylib.awesome_oscillator(dataframe)
+
+ # # Keltner Channel
+ # keltner = qtpylib.keltner_channel(dataframe)
+ # dataframe["kc_upperband"] = keltner["upper"]
+ # dataframe["kc_lowerband"] = keltner["lower"]
+ # dataframe["kc_middleband"] = keltner["mid"]
+ # dataframe["kc_percent"] = (
+ # (dataframe["close"] - dataframe["kc_lowerband"]) /
+ # (dataframe["kc_upperband"] - dataframe["kc_lowerband"])
+ # )
+ # dataframe["kc_width"] = (
+ # (dataframe["kc_upperband"] - dataframe["kc_lowerband"]) / dataframe["kc_middleband"]
+ # )
+
+ # # Ultimate Oscillator
+ # dataframe['uo'] = ta.ULTOSC(dataframe)
+
+ # # Commodity Channel Index: values [Oversold:-100, Overbought:100]
+ # dataframe['cci'] = ta.CCI(dataframe)
+
+ # RSI
+ dataframe['rsi'] = ta.RSI(dataframe)
+
+ # # Inverse Fisher transform on RSI: values [-1.0, 1.0] (https://goo.gl/2JGGoy)
+ # rsi = 0.1 * (dataframe['rsi'] - 50)
+ # dataframe['fisher_rsi'] = (np.exp(2 * rsi) - 1) / (np.exp(2 * rsi) + 1)
+
+ # # Inverse Fisher transform on RSI normalized: values [0.0, 100.0] (https://goo.gl/2JGGoy)
+ # dataframe['fisher_rsi_norma'] = 50 * (dataframe['fisher_rsi'] + 1)
+
+ # # Stochastic Slow
+ # stoch = ta.STOCH(dataframe)
+ # dataframe['slowd'] = stoch['slowd']
+ # dataframe['slowk'] = stoch['slowk']
+
+ # Stochastic Fast
+ stoch_fast = ta.STOCHF(dataframe)
+ dataframe['fastd'] = stoch_fast['fastd']
+ dataframe['fastk'] = stoch_fast['fastk']
+
+ # # Stochastic RSI
+ # Please read https://github.com/freqtrade/freqtrade/issues/2961 before using this.
+ # STOCHRSI is NOT aligned with tradingview, which may result in non-expected results.
+ # stoch_rsi = ta.STOCHRSI(dataframe)
+ # dataframe['fastd_rsi'] = stoch_rsi['fastd']
+ # dataframe['fastk_rsi'] = stoch_rsi['fastk']
+
+ # MACD
+ macd = ta.MACD(dataframe)
+ dataframe['macd'] = macd['macd']
+ dataframe['macdsignal'] = macd['macdsignal']
+ dataframe['macdhist'] = macd['macdhist']
+
+ # MFI
+ dataframe['mfi'] = ta.MFI(dataframe)
+
+ # # ROC
+ # dataframe['roc'] = ta.ROC(dataframe)
+
+ # Overlap Studies
+ # ------------------------------------
+
+ # Bollinger Bands
+ bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2)
+ dataframe['bb_lowerband'] = bollinger['lower']
+ dataframe['bb_middleband'] = bollinger['mid']
+ dataframe['bb_upperband'] = bollinger['upper']
+ dataframe["bb_percent"] = (
+ (dataframe["close"] - dataframe["bb_lowerband"]) /
+ (dataframe["bb_upperband"] - dataframe["bb_lowerband"])
+ )
+ dataframe["bb_width"] = (
+ (dataframe["bb_upperband"] - dataframe["bb_lowerband"]) / dataframe["bb_middleband"]
+ )
+
+ # Bollinger Bands - Weighted (EMA based instead of SMA)
+ # weighted_bollinger = qtpylib.weighted_bollinger_bands(
+ # qtpylib.typical_price(dataframe), window=20, stds=2
+ # )
+ # dataframe["wbb_upperband"] = weighted_bollinger["upper"]
+ # dataframe["wbb_lowerband"] = weighted_bollinger["lower"]
+ # dataframe["wbb_middleband"] = weighted_bollinger["mid"]
+ # dataframe["wbb_percent"] = (
+ # (dataframe["close"] - dataframe["wbb_lowerband"]) /
+ # (dataframe["wbb_upperband"] - dataframe["wbb_lowerband"])
+ # )
+ # dataframe["wbb_width"] = (
+ # (dataframe["wbb_upperband"] - dataframe["wbb_lowerband"]) /
+ # dataframe["wbb_middleband"]
+ # )
+
+ # # EMA - Exponential Moving Average
+ # dataframe['ema3'] = ta.EMA(dataframe, timeperiod=3)
+ # dataframe['ema5'] = ta.EMA(dataframe, timeperiod=5)
+ # dataframe['ema10'] = ta.EMA(dataframe, timeperiod=10)
+ # dataframe['ema21'] = ta.EMA(dataframe, timeperiod=21)
+ # dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50)
+ # dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100)
+
+ # # SMA - Simple Moving Average
+ # dataframe['sma3'] = ta.SMA(dataframe, timeperiod=3)
+ # dataframe['sma5'] = ta.SMA(dataframe, timeperiod=5)
+ # dataframe['sma10'] = ta.SMA(dataframe, timeperiod=10)
+ # dataframe['sma21'] = ta.SMA(dataframe, timeperiod=21)
+ # dataframe['sma50'] = ta.SMA(dataframe, timeperiod=50)
+ # dataframe['sma100'] = ta.SMA(dataframe, timeperiod=100)
+
+ # Parabolic SAR
+ dataframe['sar'] = ta.SAR(dataframe)
+
+ # TEMA - Triple Exponential Moving Average
+ dataframe['tema'] = ta.TEMA(dataframe, timeperiod=9)
+
+ # Cycle Indicator
+ # ------------------------------------
+ # Hilbert Transform Indicator - SineWave
+ hilbert = ta.HT_SINE(dataframe)
+ dataframe['htsine'] = hilbert['sine']
+ dataframe['htleadsine'] = hilbert['leadsine']
+
+ # Pattern Recognition - Bullish candlestick patterns
+ # ------------------------------------
+ # # Hammer: values [0, 100]
+ # dataframe['CDLHAMMER'] = ta.CDLHAMMER(dataframe)
+ # # Inverted Hammer: values [0, 100]
+ # dataframe['CDLINVERTEDHAMMER'] = ta.CDLINVERTEDHAMMER(dataframe)
+ # # Dragonfly Doji: values [0, 100]
+ # dataframe['CDLDRAGONFLYDOJI'] = ta.CDLDRAGONFLYDOJI(dataframe)
+ # # Piercing Line: values [0, 100]
+ # dataframe['CDLPIERCING'] = ta.CDLPIERCING(dataframe) # values [0, 100]
+ # # Morningstar: values [0, 100]
+ # dataframe['CDLMORNINGSTAR'] = ta.CDLMORNINGSTAR(dataframe) # values [0, 100]
+ # # Three White Soldiers: values [0, 100]
+ # dataframe['CDL3WHITESOLDIERS'] = ta.CDL3WHITESOLDIERS(dataframe) # values [0, 100]
+
+ # Pattern Recognition - Bearish candlestick patterns
+ # ------------------------------------
+ # # Hanging Man: values [0, 100]
+ # dataframe['CDLHANGINGMAN'] = ta.CDLHANGINGMAN(dataframe)
+ # # Shooting Star: values [0, 100]
+ # dataframe['CDLSHOOTINGSTAR'] = ta.CDLSHOOTINGSTAR(dataframe)
+ # # Gravestone Doji: values [0, 100]
+ # dataframe['CDLGRAVESTONEDOJI'] = ta.CDLGRAVESTONEDOJI(dataframe)
+ # # Dark Cloud Cover: values [0, 100]
+ # dataframe['CDLDARKCLOUDCOVER'] = ta.CDLDARKCLOUDCOVER(dataframe)
+ # # Evening Doji Star: values [0, 100]
+ # dataframe['CDLEVENINGDOJISTAR'] = ta.CDLEVENINGDOJISTAR(dataframe)
+ # # Evening Star: values [0, 100]
+ # dataframe['CDLEVENINGSTAR'] = ta.CDLEVENINGSTAR(dataframe)
+
+ # Pattern Recognition - Bullish/Bearish candlestick patterns
+ # ------------------------------------
+ # # Three Line Strike: values [0, -100, 100]
+ # dataframe['CDL3LINESTRIKE'] = ta.CDL3LINESTRIKE(dataframe)
+ # # Spinning Top: values [0, -100, 100]
+ # dataframe['CDLSPINNINGTOP'] = ta.CDLSPINNINGTOP(dataframe) # values [0, -100, 100]
+ # # Engulfing: values [0, -100, 100]
+ # dataframe['CDLENGULFING'] = ta.CDLENGULFING(dataframe) # values [0, -100, 100]
+ # # Harami: values [0, -100, 100]
+ # dataframe['CDLHARAMI'] = ta.CDLHARAMI(dataframe) # values [0, -100, 100]
+ # # Three Outside Up/Down: values [0, -100, 100]
+ # dataframe['CDL3OUTSIDE'] = ta.CDL3OUTSIDE(dataframe) # values [0, -100, 100]
+ # # Three Inside Up/Down: values [0, -100, 100]
+ # dataframe['CDL3INSIDE'] = ta.CDL3INSIDE(dataframe) # values [0, -100, 100]
+
+ # # Chart type
+ # # ------------------------------------
+ # # Heikin Ashi Strategy
+ # heikinashi = qtpylib.heikinashi(dataframe)
+ # dataframe['ha_open'] = heikinashi['open']
+ # dataframe['ha_close'] = heikinashi['close']
+ # dataframe['ha_high'] = heikinashi['high']
+ # dataframe['ha_low'] = heikinashi['low']
+
+ # Retrieve best bid and best ask from the orderbook
+ # ------------------------------------
+ """
+ # first check if dataprovider is available
+ if self.dp:
+ if self.dp.runmode.value in ('live', 'dry_run'):
+ ob = self.dp.orderbook(metadata['pair'], 1)
+ dataframe['best_bid'] = ob['bids'][0][0]
+ dataframe['best_ask'] = ob['asks'][0][0]
+ """
+
+ return dataframe
+
+ def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ """
+ Based on TA indicators, populates the entry signal for the given dataframe
+ :param dataframe: DataFrame
+ :param metadata: Additional information, like the currently traded pair
+ :return: DataFrame with entry columns populated
+ """
+ dataframe.loc[
+ (
+ # Signal: RSI crosses above 30
+ (qtpylib.crossed_above(dataframe['rsi'], self.buy_rsi.value)) &
+ (dataframe['tema'] <= dataframe['bb_middleband']) & # Guard: tema below BB middle
+ (dataframe['tema'] > dataframe['tema'].shift(1)) & # Guard: tema is raising
+ (dataframe['volume'] > 0) # Make sure Volume is not 0
+ ),
+ 'enter_long'] = 1
+
+ dataframe.loc[
+ (
+ # Signal: RSI crosses above 70
+ (qtpylib.crossed_above(dataframe['rsi'], self.short_rsi.value)) &
+ (dataframe['tema'] > dataframe['bb_middleband']) & # Guard: tema above BB middle
+ (dataframe['tema'] < dataframe['tema'].shift(1)) & # Guard: tema is falling
+ (dataframe['volume'] > 0) # Make sure Volume is not 0
+ ),
+ 'enter_short'] = 1
+
+ return dataframe
+
+ def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame:
+ """
+ Based on TA indicators, populates the exit signal for the given dataframe
+ :param dataframe: DataFrame
+ :param metadata: Additional information, like the currently traded pair
+ :return: DataFrame with exit columns populated
+ """
+ dataframe.loc[
+ (
+ # Signal: RSI crosses above 70
+ (qtpylib.crossed_above(dataframe['rsi'], self.sell_rsi.value)) &
+ (dataframe['tema'] > dataframe['bb_middleband']) & # Guard: tema above BB middle
+ (dataframe['tema'] < dataframe['tema'].shift(1)) & # Guard: tema is falling
+ (dataframe['volume'] > 0) # Make sure Volume is not 0
+ ),
+
+ 'exit_long'] = 1
+
+ dataframe.loc[
+ (
+ # Signal: RSI crosses above 30
+ (qtpylib.crossed_above(dataframe['rsi'], self.exit_short_rsi.value)) &
+ # Guard: tema below BB middle
+ (dataframe['tema'] <= dataframe['bb_middleband']) &
+ (dataframe['tema'] > dataframe['tema'].shift(1)) & # Guard: tema is raising
+ (dataframe['volume'] > 0) # Make sure Volume is not 0
+ ),
+ 'exit_short'] = 1
+
+ return dataframe