Timeframe
5m
Direction
Long & Short
Stoploss
-99.0%
Trailing Stop
No
ROI
N/A
Interface Version
3
Startup Candles
480
Indicators
15
freqtrade/freqtrade-strategies
Strategy 003 author@: Gerald Lonlas github@: https://github.com/freqtrade/freqtrade-strategies
import copy
import logging
import pathlib
import rapidjson
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
from freqtrade.persistence import Trade
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)
#############################################################################################################
## NostalgiaForInfinityX6 by iterativ ##
## https://github.com/iterativv/NostalgiaForInfinity ##
## ##
## Strategy for Freqtrade https://github.com/freqtrade/freqtrade ##
## ##
#############################################################################################################
## GENERAL RECOMMENDATIONS ##
## ##
## For optimal performance, suggested to use between 6 and 12 open trades, with unlimited stake. ##
## A pairlist with 40 to 80 pairs. Volume pairlist works well. ##
## Prefer stable coin (USDT, USDC 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 ##
## ##
## Patreon: https://www.patreon.com/iterativ ##
## ##
## REFERRAL LINKS ##
## ##
## Binance: https://www.binance.com/join?ref=C68K26A9 (20% discount on trading fees) ##
## Kucoin: https://www.kucoin.com/r/af/QBSSS5J2 (20% lifetime discount on trading fees) ##
## Gate: https://www.gate.io/share/nfinfinity (20% lifetime discount on trading fees) ##
## OKX: https://www.okx.com/join/11749725931 (20% discount on trading fees) ##
## MEXC: https://promote.mexc.com/a/luA6Xclb (10% discount on trading fees) ##
## ByBit: https://partner.bybit.com/b/nfi ##
## Bitget: https://bonus.bitget.com/fdqe83481698435803831 (lifetime 20% +10% extra spot rebate) ##
## BitMart: https://www.bitmart.com/invite/nfinfinity/en-US (20% lifetime discount on trading fees) ##
## HTX: https://www.htx.com/invite/en-us/1f?invite_code=ubpt2223 ##
## (Welcome Bonus worth 241 USDT upon completion of a deposit and trade) ##
## Bitvavo: https://bitvavo.com/invite?a=D22103A4BC (no fees for the first € 10000) ##
#############################################################################################################
class NostalgiaForInfinityX6(IStrategy):
INTERFACE_VERSION = 3
def version(self) -> str:
return "v16.8.372"
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 = 800
# Number of cores to use for pandas_ta indicators calculations
num_cores_indicators_calc = 0
# Long Normal mode tags
long_normal_mode_tags = ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13"]
# Long Pump mode tags
long_pump_mode_tags = ["21", "22", "23", "24", "25", "26"]
# Long Quick mode tags
long_quick_mode_tags = ["41", "42", "43", "44", "45", "46", "47", "48", "49", "50", "51", "52", "53"]
# Long rebuy mode tags
long_rebuy_mode_tags = ["61", "62"]
# Long high profit mode tags
long_high_profit_mode_tags = ["81", "82"]
# Long rapid mode tags
long_rapid_mode_tags = ["101", "102", "103", "104", "105", "106", "107", "108", "109", "110"]
# Long grind mode tags
long_grind_mode_tags = ["120"]
# Long top coins mode tags
long_top_coins_mode_tags = ["141", "142", "143", "144"]
# Long scalp mode tags
long_scalp_mode_tags = ["161", "162", "163"]
long_normal_mode_name = "long_normal"
long_pump_mode_name = "long_pump"
long_quick_mode_name = "long_quick"
long_rebuy_mode_name = "long_rebuy"
long_high_profit_mode_name = "long_hp"
long_rapid_mode_name = "long_rapid"
long_grind_mode_name = "long_grind"
long_top_coins_mode_name = "long_tc"
long_scalp_mode_name = "long_scalp"
# Shorting
# Short normal mode tags
short_normal_mode_tags = ["501", "502"]
# Short Pump mode tags
short_pump_mode_tags = ["521", "522", "523", "524", "525", "526"]
# Short Quick mode tags
short_quick_mode_tags = ["541", "542", "543", "544", "545", "546", "547", "548", "549", "550"]
# Short rebuy mode tags
short_rebuy_mode_tags = ["561"]
# Short mode tags
short_high_profit_mode_tags = ["581", "582"]
# Short rapid mode tags
short_rapid_mode_tags = ["601", "602", "603", "604", "605", "606", "607", "608", "609", "610"]
# Short grind mode tags
short_grind_mode_tags = ["620"]
# Short top coins mode tags
short_top_coins_mode_tags = ["641", "642"]
# Short scalp mode tags
short_scalp_mode_tags = ["661"]
short_normal_mode_name = "short_normal"
short_pump_mode_name = "short_pump"
short_quick_mode_name = "short_quick"
short_rebuy_mode_name = "short_rebuy"
short_high_profit_mode_name = "short_hp"
short_rapid_mode_name = "short_rapid"
short_top_coins_mode_name = "short_tc"
short_scalp_mode_name = "short_scalp"
is_futures_mode = False
futures_mode_leverage = 3.0
futures_mode_leverage_rebuy_mode = 3.0
futures_mode_leverage_grind_mode = 3.0
# Limit the number of long/short trades for futures (0 for no limit)
futures_max_open_trades_long = 0
futures_max_open_trades_short = 0
# Based on the the first entry (regardless of rebuys)
stop_threshold_spot = 0.10
stop_threshold_futures = 0.10
stop_threshold_doom_spot = 0.20
stop_threshold_doom_futures = 0.20
stop_threshold_spot_rebuy = 1.0
stop_threshold_futures_rebuy = 1.0
stop_threshold_rapid_spot = 0.20
stop_threshold_rapid_futures = 0.20
stop_threshold_scalp_spot = 0.20
stop_threshold_scalp_futures = 0.20
# user specified fees to be used for profit calculations
custom_fee_open_rate = None
custom_fee_close_rate = None
# Rebuy mode minimum number of free slots
rebuy_mode_min_free_slots = 2
# Position adjust feature
position_adjustment_enable = True
# Grinding feature
grinding_enable = True
derisk_enable = True
stops_enable = True
doom_stops_enable = True
u_e_stops_enable = False
# Grinding
grinding_v1_max_stake = 1.0 # ratio of first entry
derisk_use_grind_stops = False
grind_1_stop_grinds_spot = -0.50
grind_1_profit_threshold_spot = 0.018
grind_1_stakes_spot = [0.24, 0.26, 0.28]
grind_1_sub_thresholds_spot = [-0.12, -0.16, -0.20]
grind_1_stop_grinds_futures = -0.50
grind_1_profit_threshold_futures = 0.018
grind_1_stakes_futures = [0.24, 0.26, 0.28]
grind_1_sub_thresholds_futures = [-0.12, -0.16, -0.20]
grind_2_stop_grinds_spot = -0.50
grind_2_profit_threshold_spot = 0.018
grind_2_stakes_spot = [0.20, 0.24, 0.28]
grind_2_sub_thresholds_spot = [-0.12, -0.16, -0.20]
grind_2_stop_grinds_futures = -0.50
grind_2_profit_threshold_futures = 0.018
grind_2_stakes_futures = [0.20, 0.24, 0.28]
grind_2_sub_thresholds_futures = [-0.12, -0.16, -0.20]
grind_3_stop_grinds_spot = -0.50
grind_3_profit_threshold_spot = 0.018
grind_3_stakes_spot = [0.20, 0.22, 0.24]
grind_3_sub_thresholds_spot = [-0.12, -0.16, -0.20]
grind_3_stop_grinds_futures = -0.50
grind_3_profit_threshold_futures = 0.018
grind_3_stakes_futures = [0.20, 0.22, 0.24]
grind_3_sub_thresholds_futures = [-0.12, -0.16, -0.20]
grind_4_stop_grinds_spot = -0.50
grind_4_profit_threshold_spot = 0.018
grind_4_stakes_spot = [0.20, 0.22, 0.24]
grind_4_sub_thresholds_spot = [-0.12, -0.16, -0.20]
grind_4_stop_grinds_futures = -0.50
grind_4_profit_threshold_futures = 0.018
grind_4_stakes_futures = [0.20, 0.22, 0.24]
grind_4_sub_thresholds_futures = [-0.12, -0.16, -0.20]
grind_5_stop_grinds_spot = -0.50
grind_5_profit_threshold_spot = 0.048
grind_5_stakes_spot = [0.20, 0.22, 0.24]
grind_5_sub_thresholds_spot = [-0.12, -0.16, -0.20]
grind_5_stop_grinds_futures = -0.50
grind_5_profit_threshold_futures = 0.048
grind_5_stakes_futures = [0.20, 0.22, 0.24]
grind_5_sub_thresholds_futures = [-0.12, -0.16, -0.20]
grind_6_stop_grinds_spot = -0.50
grind_6_profit_threshold_spot = 0.018
grind_6_stakes_spot = [0.10, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18]
grind_6_sub_thresholds_spot = [-0.03, -0.08, -0.10, -0.12, -0.14, -0.16, -0.18, -0.20, -0.22]
grind_6_stop_grinds_futures = -0.50
grind_6_profit_threshold_futures = 0.018
grind_6_stakes_futures = [0.10, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18]
grind_6_sub_thresholds_futures = [-0.03, -0.08, -0.10, -0.12, -0.14, -0.16, -0.18, -0.20, -0.22]
grind_1_derisk_1_stop_grinds_spot = -0.50
grind_1_derisk_1_profit_threshold_spot = 0.018
grind_1_derisk_1_stakes_spot = [0.20, 0.24, 0.28]
grind_1_derisk_1_sub_thresholds_spot = [-0.12, -0.16, -0.20]
grind_1_derisk_1_stop_grinds_futures = -0.50
grind_1_derisk_1_profit_threshold_futures = 0.018
grind_1_derisk_1_stakes_futures = [0.20, 0.24, 0.28]
grind_1_derisk_1_sub_thresholds_futures = [-0.12, -0.16, -0.20]
grind_2_derisk_1_stop_grinds_spot = -0.50
grind_2_derisk_1_profit_threshold_spot = 0.018
grind_2_derisk_1_stakes_spot = [0.20, 0.24, 0.28]
grind_2_derisk_1_sub_thresholds_spot = [-0.12, -0.16, -0.20]
grind_2_derisk_1_stop_grinds_futures = -0.50
grind_2_derisk_1_profit_threshold_futures = 0.018
grind_2_derisk_1_stakes_futures = [0.20, 0.24, 0.28]
grind_2_derisk_1_sub_thresholds_futures = [-0.12, -0.16, -0.20]
grinds_stop_spot = -0.12
grinds_stop_futures = -0.12
# Non rebuy modes
regular_mode_stake_multiplier_spot = [1.0]
regular_mode_stake_multiplier_futures = [1.0]
regular_mode_use_grind_stops = False
regular_mode_rebuy_stakes_spot = [0.10, 0.10, 0.10]
regular_mode_rebuy_thresholds_spot = [-0.12, -0.14, -0.16]
regular_mode_grind_1_stakes_spot = [0.22, 0.24, 0.26]
regular_mode_grind_1_thresholds_spot = [-0.06, -0.10, -0.12]
regular_mode_grind_1_stop_grinds_spot = -0.20
regular_mode_grind_1_profit_threshold_spot = 0.018
regular_mode_grind_2_stakes_spot = [0.14, 0.20, 0.26]
regular_mode_grind_2_thresholds_spot = [-0.04, -0.10, -0.12]
regular_mode_grind_2_stop_grinds_spot = -0.20
regular_mode_grind_2_profit_threshold_spot = 0.018
regular_mode_grind_3_stakes_spot = [0.18, 0.20, 0.22]
regular_mode_grind_3_thresholds_spot = [-0.03, -0.10, -0.12]
regular_mode_grind_3_stop_grinds_spot = -0.20
regular_mode_grind_3_profit_threshold_spot = 0.018
regular_mode_grind_4_stakes_spot = [0.18, 0.20, 0.22]
regular_mode_grind_4_thresholds_spot = [-0.03, -0.10, -0.12]
regular_mode_grind_4_stop_grinds_spot = -0.20
regular_mode_grind_4_profit_threshold_spot = 0.018
regular_mode_grind_5_stakes_spot = [0.18, 0.20, 0.22]
regular_mode_grind_5_thresholds_spot = [-0.03, -0.10, -0.12]
regular_mode_grind_5_stop_grinds_spot = -0.20
regular_mode_grind_5_profit_threshold_spot = 0.048
regular_mode_grind_6_stakes_spot = [0.05, 0.057, 0.065, 0.074, 0.084, 0.095, 0.107, 0.121, 0.137]
regular_mode_grind_6_thresholds_spot = [-0.025, -0.05, -0.06, -0.07, -0.08, -0.09, -0.10, -0.11, -0.12]
regular_mode_grind_6_stop_grinds_spot = -0.20
regular_mode_grind_6_profit_threshold_spot = 0.018
regular_mode_derisk_1_spot = -0.24
regular_mode_derisk_1_spot_old = -0.80
regular_mode_derisk_1_reentry_spot = -0.08
regular_mode_derisk_spot = -0.24
regular_mode_derisk_spot_old = -1.60
regular_mode_derisk_1_scalp_mode_spot = -0.05
regular_mode_rebuy_stakes_futures = [0.10, 0.10, 0.10]
regular_mode_rebuy_thresholds_futures = [-0.12, -0.14, -0.16]
regular_mode_grind_1_stakes_futures = [0.22, 0.24, 0.26]
regular_mode_grind_1_thresholds_futures = [-0.06, -0.10, -0.12]
regular_mode_grind_1_stop_grinds_futures = -0.20
regular_mode_grind_1_profit_threshold_futures = 0.018
regular_mode_grind_2_stakes_futures = [0.14, 0.20, 0.26]
regular_mode_grind_2_thresholds_futures = [-0.04, -0.10, -0.12]
regular_mode_grind_2_stop_grinds_futures = -0.20
regular_mode_grind_2_profit_threshold_futures = 0.018
regular_mode_grind_3_stakes_futures = [0.18, 0.20, 0.22]
regular_mode_grind_3_thresholds_futures = [-0.03, -0.10, -0.12]
regular_mode_grind_3_stop_grinds_futures = -0.20
regular_mode_grind_3_profit_threshold_futures = 0.018
regular_mode_grind_4_stakes_futures = [0.18, 0.20, 0.22]
regular_mode_grind_4_thresholds_futures = [-0.03, -0.10, -0.12]
regular_mode_grind_4_stop_grinds_futures = -0.20
regular_mode_grind_4_profit_threshold_futures = 0.018
regular_mode_grind_5_stakes_futures = [0.18, 0.20, 0.22]
regular_mode_grind_5_thresholds_futures = [-0.03, -0.10, -0.12]
regular_mode_grind_5_stop_grinds_futures = -0.20
regular_mode_grind_5_profit_threshold_futures = 0.048
regular_mode_grind_6_stakes_futures = [0.05, 0.057, 0.065, 0.074, 0.084, 0.095, 0.107, 0.121, 0.137]
regular_mode_grind_6_thresholds_futures = [-0.025, -0.05, -0.06, -0.07, -0.08, -0.09, -0.10, -0.11, -0.12]
regular_mode_grind_6_stop_grinds_futures = -0.20
regular_mode_grind_6_profit_threshold_futures = 0.018
regular_mode_derisk_1_futures = -0.60
regular_mode_derisk_1_futures_old = -0.80
regular_mode_derisk_1_reentry_futures = -0.08 # without leverage
regular_mode_derisk_futures = -0.60
regular_mode_derisk_futures_old = -1.20
regular_mode_derisk_1_scalp_mode_futures = -0.05
# Grinding v2
grinding_v2_max_stake = 1.0 # ratio of first entry
grinding_v2_max_grinds_and_buybacks = 20 # current open
grinding_v2_derisk_level_1_enable = True
grinding_v2_derisk_level_1_spot = [-0.06, -0.15]
grinding_v2_derisk_level_1_futures = [-0.18, -0.35]
grinding_v2_derisk_level_2_enable = True
grinding_v2_derisk_level_2_spot = [-0.08, -0.18]
grinding_v2_derisk_level_2_futures = [-0.16, -0.54]
grinding_v2_derisk_level_3_enable = True
grinding_v2_derisk_level_3_spot = [-0.10, -0.20]
grinding_v2_derisk_level_3_futures = [-0.30, -0.60]
grinding_v2_derisk_level_1_stake_spot = 0.20
grinding_v2_derisk_level_1_stake_futures = 0.20
grinding_v2_derisk_level_2_stake_spot = 0.30
grinding_v2_derisk_level_2_stake_futures = 0.30
grinding_v2_derisk_level_3_stake_spot = 0.50
grinding_v2_derisk_level_3_stake_futures = 0.50
grinding_v2_derisk_global_enable = False
grinding_v2_derisk_global_spot = -0.10
grinding_v2_derisk_global_futures = -0.30
grinding_v2_grind_1_enable = True
grinding_v2_grind_1_stakes_spot = [0.20, 0.22, 0.24, 0.26, 0.28]
grinding_v2_grind_1_thresholds_spot = [-0.06, -0.07, -0.08, -0.09, -0.10]
grinding_v2_grind_1_stakes_futures = [0.20, 0.22, 0.24, 0.26, 0.28]
grinding_v2_grind_1_thresholds_futures = [-0.06, -0.07, -0.08, -0.09, -0.10]
grinding_v2_grind_1_profit_threshold_spot = 0.02
grinding_v2_grind_1_profit_threshold_futures = 0.02
grinding_v2_grind_1_use_derisk = True
grinding_v2_grind_1_derisk_spot = -0.26
grinding_v2_grind_1_derisk_futures = -0.26
grinding_v2_grind_2_enable = True
grinding_v2_grind_2_stakes_spot = [0.10, 0.12, 0.14, 0.16, 0.18]
grinding_v2_grind_2_thresholds_spot = [-0.06, -0.07, -0.08, -0.09, -0.10]
grinding_v2_grind_2_stakes_futures = [0.10, 0.12, 0.14, 0.16, 0.18]
grinding_v2_grind_2_thresholds_futures = [-0.06, -0.07, -0.08, -0.09, -0.10]
grinding_v2_grind_2_profit_threshold_spot = 0.02
grinding_v2_grind_2_profit_threshold_futures = 0.02
grinding_v2_grind_2_use_derisk = True
grinding_v2_grind_2_derisk_spot = -0.26
grinding_v2_grind_2_derisk_futures = -0.26
grinding_v2_grind_3_enable = True
grinding_v2_grind_3_stakes_spot = [0.10, 0.12, 0.14, 0.16, 0.18]
grinding_v2_grind_3_thresholds_spot = [-0.06, -0.07, -0.08, -0.09, -0.10]
grinding_v2_grind_3_stakes_futures = [0.10, 0.12, 0.14, 0.16, 0.18]
grinding_v2_grind_3_thresholds_futures = [-0.06, -0.07, -0.08, -0.09, -0.10]
grinding_v2_grind_3_profit_threshold_spot = 0.02
grinding_v2_grind_3_profit_threshold_futures = 0.02
grinding_v2_grind_3_use_derisk = True
grinding_v2_grind_3_derisk_spot = -0.26
grinding_v2_grind_3_derisk_futures = -0.26
grinding_v2_grind_4_enable = True
grinding_v2_grind_4_stakes_spot = [0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11]
grinding_v2_grind_4_thresholds_spot = [-0.06, -0.07, -0.09, -0.12, -0.16, -0.21, -0.27]
grinding_v2_grind_4_stakes_futures = [0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11]
grinding_v2_grind_4_thresholds_futures = [-0.06, -0.07, -0.09, -0.12, -0.16, -0.21, -0.27]
grinding_v2_grind_4_profit_threshold_spot = 0.10
grinding_v2_grind_4_profit_threshold_futures = 0.10
grinding_v2_grind_4_use_derisk = True
grinding_v2_grind_4_derisk_spot = -0.26
grinding_v2_grind_4_derisk_futures = -0.26
grinding_v2_grind_5_enable = True
grinding_v2_grind_5_stakes_spot = [0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11]
grinding_v2_grind_5_thresholds_spot = [-0.06, -0.07, -0.09, -0.12, -0.16, -0.21, -0.27]
grinding_v2_grind_5_stakes_futures = [0.05, 0.06, 0.07, 0.08, 0.09, 0.10, 0.11]
grinding_v2_grind_5_thresholds_futures = [-0.06, -0.07, -0.09, -0.12, -0.16, -0.21, -0.27]
grinding_v2_grind_5_profit_threshold_spot = 0.10
grinding_v2_grind_5_profit_threshold_futures = 0.10
grinding_v2_grind_5_use_derisk = True
grinding_v2_grind_5_derisk_spot = -0.26
grinding_v2_grind_5_derisk_futures = -0.26
grinding_v2_buyback_1_enable = True
grinding_v2_buyback_1_stake_spot = 0.10
grinding_v2_buyback_1_stake_futures = 0.10
grinding_v2_buyback_1_distance_ratio_spot = -0.06
grinding_v2_buyback_1_distance_ratio_futures = -0.06
grinding_v2_buyback_1_profit_threshold_spot = 0.05
grinding_v2_buyback_1_profit_threshold_futures = 0.05
grinding_v2_buyback_1_use_derisk = True
grinding_v2_buyback_1_derisk_spot = -0.26
grinding_v2_buyback_1_derisk_futures = -0.26
grinding_v2_buyback_2_enable = True
grinding_v2_buyback_2_stake_spot = 0.10
grinding_v2_buyback_2_stake_futures = 0.10
grinding_v2_buyback_2_distance_ratio_spot = -0.12
grinding_v2_buyback_2_distance_ratio_futures = -0.12
grinding_v2_buyback_2_profit_threshold_spot = 0.05
grinding_v2_buyback_2_profit_threshold_futures = 0.05
grinding_v2_buyback_2_use_derisk = True
grinding_v2_buyback_2_derisk_spot = -0.26
grinding_v2_buyback_2_derisk_futures = -0.26
grinding_v2_buyback_3_enable = True
grinding_v2_buyback_3_stake_spot = 0.10
grinding_v2_buyback_3_stake_futures = 0.10
grinding_v2_buyback_3_distance_ratio_spot = -0.16
grinding_v2_buyback_3_distance_ratio_futures = -0.16
grinding_v2_buyback_3_profit_threshold_spot = 0.05
grinding_v2_buyback_3_profit_threshold_futures = 0.05
grinding_v2_buyback_3_use_derisk = True
grinding_v2_buyback_3_derisk_spot = -0.26
grinding_v2_buyback_3_derisk_futures = -0.26
# Rebuy mode
rebuy_mode_stake_multiplier = 0.35
rebuy_mode_derisk_spot = -0.60
rebuy_mode_derisk_futures = -0.60
rebuy_mode_stakes_spot = [1.0, 1.0]
rebuy_mode_stakes_futures = [1.0, 1.0]
rebuy_mode_thresholds_spot = [-0.08, -0.10]
rebuy_mode_thresholds_futures = [-0.08, -0.10]
# Rapid mode
rapid_mode_stake_multiplier_spot = [0.75]
rapid_mode_stake_multiplier_futures = [0.75]
# Scalp mode
min_free_slots_scalp_mode = 1
# Grind mode
grind_mode_stake_multiplier_spot = [0.20, 0.30, 0.40, 0.50, 0.60, 0.70]
grind_mode_stake_multiplier_futures = [0.20, 0.30, 0.40, 0.50]
grind_mode_first_entry_profit_threshold_spot = 0.018
grind_mode_first_entry_profit_threshold_futures = 0.018
grind_mode_first_entry_stop_threshold_spot = -0.20
grind_mode_first_entry_stop_threshold_futures = -0.20
grind_mode_max_slots = 1
grind_mode_coins = [
"AAVE",
"ADA",
"ALGO",
"APE",
"APT",
"ARB",
"ATOM",
"AVAX",
"BCH",
"BNB",
"BTC",
"CAKE",
"CRV",
"DOGE",
"DOT",
"DYDX",
"ETC",
"ETH",
"FIL",
"GALA",
"HBAR",
"HYPE",
"ICP",
"INJ",
"IOTA",
"JUP",
"KAS",
"LDO",
"LINK",
"LTC",
"NEAR",
"NEO",
"OP",
"POL",
"RENDER",
"RUNE",
"SAND",
"SEI",
"SOL",
"SUI",
"THETA",
"TIA",
"TON",
"TRX",
"UNI",
"VET",
"XLM",
"XMR",
"XRP",
"XTZ",
"ZEC",
]
# Top coins mode coins
top_coins_mode_coins = [
"1INCH",
"AAVE",
"ADA",
"ALGO",
"APE",
"APT",
"ARB",
"ATOM",
"AVAX",
"BCH",
"BNB",
"BTC",
"CAKE",
"CRV",
"DASH",
"DOGE",
"DOT",
"DYDX",
"ETC",
"ETH",
"FIL",
"GALA",
"HBAR",
"HYPE",
"ICP",
"INJ",
"IOTA",
"JUP",
"KAS",
"LDO",
"LINK",
"LTC",
"NEAR",
"NEO",
"ONDO",
"OP",
"POL",
"RENDER",
"RUNE",
"SAND",
"SEI",
"SOL",
"SUI",
"THETA",
"TIA",
"TON",
"TRX",
"UNI",
"VET",
"WLD",
"XLM",
"XMR",
"XRP",
"XTZ",
"ZEC",
]
# Profit max thresholds
profit_max_thresholds = [0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.05, 0.05]
# Max allowed buy "slippage", how high to buy on the candle
max_slippage = 0.01
# BTC/ETH stakes
btc_stakes = ["BTC", "ETH"]
#############################################################
# Buy side configuration
long_entry_signal_params = {
# Enable/Disable conditions
# -------------------------------------------------------
"long_entry_condition_1_enable": True,
"long_entry_condition_2_enable": True,
"long_entry_condition_3_enable": True,
"long_entry_condition_4_enable": True,
"long_entry_condition_5_enable": True,
"long_entry_condition_6_enable": True,
"long_entry_condition_21_enable": True,
"long_entry_condition_41_enable": True,
"long_entry_condition_42_enable": True,
"long_entry_condition_43_enable": True,
"long_entry_condition_44_enable": True,
"long_entry_condition_45_enable": True,
"long_entry_condition_46_enable": True,
"long_entry_condition_61_enable": True,
"long_entry_condition_62_enable": True,
"long_entry_condition_101_enable": True,
"long_entry_condition_102_enable": True,
"long_entry_condition_103_enable": True,
"long_entry_condition_104_enable": True,
"long_entry_condition_120_enable": True,
"long_entry_condition_141_enable": True,
"long_entry_condition_142_enable": True,
"long_entry_condition_143_enable": True,
"long_entry_condition_144_enable": True,
"long_entry_condition_161_enable": True,
"long_entry_condition_162_enable": True,
"long_entry_condition_163_enable": True,
}
short_entry_signal_params = {
# Enable/Disable conditions
# -------------------------------------------------------
"short_entry_condition_501_enable": True,
"short_entry_condition_502_enable": True,
# "short_entry_condition_503_enable": True,
# "short_entry_condition_504_enable": True,
# "short_entry_condition_541_enable": True,
"short_entry_condition_542_enable": True,
# "short_entry_condition_543_enable": True,
# "short_entry_condition_603_enable": True,
# "short_entry_condition_641_enable": True,
# "short_entry_condition_642_enable": True,
# "short_entry_condition_661_enable": True,
}
#############################################################
# CACHES
hold_trades_cache = None
target_profit_cache = None
#############################################################
#
#
# $$$$$$\ $$$$$$\ $$\ $$\ $$\ $$\ $$$$$$\ $$\ $$\
# $$ __$$\ $$ __$$\ $$$\ $$$ |$$$\ $$$ |$$ __$$\ $$$\ $$ |
# $$ / \__|$$ / $$ |$$$$\ $$$$ |$$$$\ $$$$ |$$ / $$ |$$$$\ $$ |
# $$ | $$ | $$ |$$\$$\$$ $$ |$$\$$\$$ $$ |$$ | $$ |$$ $$\$$ |
# $$ | $$ | $$ |$$ \$$$ $$ |$$ \$$$ $$ |$$ | $$ |$$ \$$$$ |
# $$ | $$\ $$ | $$ |$$ |\$ /$$ |$$ |\$ /$$ |$$ | $$ |$$ |\$$$ |
# \$$$$$$ | $$$$$$ |$$ | \_/ $$ |$$ | \_/ $$ | $$$$$$ |$$ | \$$ |
# \______/ \______/ \__| \__|\__| \__| \______/ \__| \__|
#
#
#
# $$$$$$$$\ $$\ $$\ $$\ $$\ $$$$$$\ $$$$$$$$\ $$$$$$\ $$$$$$\ $$\ $$\ $$$$$$\
# $$ _____|$$ | $$ |$$$\ $$ |$$ __$$\\__$$ __|\_$$ _|$$ __$$\ $$$\ $$ |$$ __$$\
# $$ | $$ | $$ |$$$$\ $$ |$$ / \__| $$ | $$ | $$ / $$ |$$$$\ $$ |$$ / \__|
# $$$$$\ $$ | $$ |$$ $$\$$ |$$ | $$ | $$ | $$ | $$ |$$ $$\$$ |\$$$$$$\
# $$ __| $$ | $$ |$$ \$$$$ |$$ | $$ | $$ | $$ | $$ |$$ \$$$$ | \____$$\
# $$ | $$ | $$ |$$ |\$$$ |$$ | $$\ $$ | $$ | $$ | $$ |$$ |\$$$ |$$\ $$ |
# $$ | \$$$$$$ |$$ | \$$ |\$$$$$$ | $$ | $$$$$$\ $$$$$$ |$$ | \$$ |\$$$$$$ |
# \__| \______/ \__| \__| \______/ \__| \______| \______/ \__| \__| \______/
#
#
###############################################################################################
# COMMON FUNCTIONS FOR BOTH LONG AND SHORT SIDE STARTS HERE
###############################################################################################
def __init__(self, config: dict) -> None:
# A list of parameters that can be changed through the config.
NFI_SAFE_PARAMETERS = [
"num_cores_indicators_calc",
"custom_fee_open_rate",
"custom_fee_close_rate",
"futures_mode_leverage",
"futures_mode_leverage_rebuy_mode",
"futures_mode_leverage_grind_mode",
"futures_max_open_trades_long",
"futures_max_open_trades_short",
"stop_threshold_doom_spot",
"stop_threshold_doom_futures",
"stop_threshold_rapid_spot",
"stop_threshold_rapid_futures",
"stop_threshold_scalp_spot",
"stop_threshold_scalp_futures",
"derisk_enable",
"stops_enable",
"regular_mode_derisk_1_spot",
"regular_mode_derisk_spot",
"regular_mode_derisk_1_futures",
"regular_mode_derisk_futures",
"grind_mode_max_slots",
"grind_mode_coins",
"max_slippage",
]
if "ccxt_config" not in config["exchange"]:
config["exchange"]["ccxt_config"] = {}
if "ccxt_async_config" not in config["exchange"]:
config["exchange"]["ccxt_async_config"] = {}
options = {
"brokerId": None,
"broker": {"spot": None, "margin": None, "future": None, "delivery": None},
"partner": {
"spot": {"id": None, "key": None},
"future": {"id": None, "key": None},
"id": None,
"key": None,
},
}
config["exchange"]["ccxt_config"]["options"] = options
config["exchange"]["ccxt_async_config"]["options"] = options
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
# Advanced configuration mode. Allows to change any parameter.
is_config_advanced_mode = "nfi_advanced_mode" in self.config and self.config["nfi_advanced_mode"] == True
if is_config_advanced_mode:
log.warning("The advanced configuration mode is enabled. I hope you know what you are doing.")
# Configuration from the nfi_parameters block. New config style.
if "nfi_parameters" in self.config and type(self.config["nfi_parameters"]) is dict:
for nfi_param in self.config["nfi_parameters"]:
if nfi_param in ["long_entry_signal_params", "short_entry_signal_params"]:
continue
if (nfi_param in NFI_SAFE_PARAMETERS or is_config_advanced_mode) and hasattr(self, nfi_param):
log.info(
f'Parameter {nfi_param} changed from "{getattr(self, nfi_param)}" to "{self.config["nfi_parameters"][nfi_param]}".'
)
setattr(self, nfi_param, self.config["nfi_parameters"][nfi_param])
else:
log.warning(f"Invalid or unsafe parameter: {nfi_param}.")
self.update_signals_from_config(self.config["nfi_parameters"])
# Parameter settings. Backward compatibility with the old configuration style.
for nfi_param in NFI_SAFE_PARAMETERS:
if (nfi_param in self.config) and hasattr(self, nfi_param):
setattr(self, nfi_param, self.config[nfi_param])
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"]
/ (
"nfix6-profit_max-"
+ bot_name
+ self.config["exchange"]["name"]
+ "-"
+ self.config["stake_currency"]
+ ("-(backtest)" if (self.config["runmode"].value == "backtest") else "")
+ ("-(hyperopt)" if (self.config["runmode"].value == "hyperopt") else "")
+ ".json"
)
)
# OKX, Kraken provides a lower number of candle data per API call
if self.config["exchange"]["name"] in ["okx", "okex"]:
self.startup_candle_count = 480
elif self.config["exchange"]["name"] in ["kraken"]:
self.startup_candle_count = 710
elif self.config["exchange"]["name"] in ["bybit"]:
self.startup_candle_count = 199
elif self.config["exchange"]["name"] in ["bitget"]:
self.startup_candle_count = 499
elif self.config["exchange"]["name"] in ["bingx"]:
self.startup_candle_count = 499
if ("trading_mode" in self.config) and (self.config["trading_mode"] in ["futures", "margin"]):
self.is_futures_mode = True
self.can_short = True
# If the cached data hasn't changed, it's a no-op
self.target_profit_cache.save()
# Parameter settings. Backward compatibility with the old configuration style.
self.update_signals_from_config(self.config)
# Plot configuration for FreqUI
# ---------------------------------------------------------------------------------------------
@property
def plot_config(self):
plot_config = {}
plot_config["main_plot"] = {
"EMA_12": {"color": "LightGreen"},
"EMA_26": {"color": "Yellow"},
"EMA_50": {"color": "DodgerBlue"},
"EMA_200": {"color": "DarkRed"},
}
plot_config["subplots"] = {
"long_pump_protection": {"global_protections_long_pump": {"color": "green"}},
"long_dump_protection": {"global_protections_long_dump": {"color": "red"}},
}
return plot_config
# Get Ticker Indicator
# ---------------------------------------------------------------------------------------------
def get_ticker_indicator(self):
return int(self.timeframe[:-1])
# Mark Profit Target
# ---------------------------------------------------------------------------------------------
def mark_profit_target(
self,
mode_name: str,
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
# Exit Profit Target
# ---------------------------------------------------------------------------------------------
def exit_profit_target(
self,
mode_name: str,
pair: str,
trade: Trade,
current_time: datetime,
current_rate: float,
profit_stake: float,
profit_ratio: float,
profit_current_stake_ratio: float,
profit_init_ratio: float,
last_candle,
previous_candle_1,
previous_rate,
previous_profit,
previous_sell_reason,
previous_time_profit_reached,
enter_tags,
) -> tuple:
is_backtest = self.is_backtest_mode()
is_derisk = False
if previous_sell_reason in [
f"exit_{mode_name}_stoploss_doom",
f"exit_{mode_name}_stoploss",
f"exit_{mode_name}_stoploss_u_e",
]:
filled_entries = trade.select_filled_orders(trade.entry_side)
filled_exits = trade.select_filled_orders(trade.exit_side)
has_order_tags = False
if hasattr(filled_entries[0], "ft_order_tag"):
has_order_tags = True
for order in filled_exits:
order_tag = ""
if has_order_tags:
if order.ft_order_tag is not None:
sell_order_tag = order.ft_order_tag
order_mode = sell_order_tag.split(" ", 1)
if len(order_mode) > 0:
order_tag = order_mode[0]
if order_tag in ["d", "d1", "derisk_level_1", "derisk_level_2", "derisk_level_3"]:
is_derisk = True
break
if not is_derisk:
is_derisk = trade.amount < (filled_entries[0].safe_filled * 0.95)
if previous_sell_reason in [f"exit_{mode_name}_stoploss_doom", f"exit_{mode_name}_stoploss"]:
is_rapid_mode = all(c in self.long_rapid_mode_tags for c in enter_tags)
is_rebuy_mode = all(c in self.long_rebuy_mode_tags for c in enter_tags) or (
any(c in self.long_rebuy_mode_tags for c in enter_tags)
and all(c in (self.long_rebuy_mode_tags + self.long_grind_mode_tags) for c in enter_tags)
)
is_scalp_mode = all(c in self.long_scalp_mode_tags for c in enter_tags) or (
any(c in self.long_scalp_mode_tags for c in enter_tags)
and all(
c in (self.long_scalp_mode_tags + self.long_rebuy_mode_tags + self.long_grind_mode_tags) for c in enter_tags
)
)
if profit_init_ratio > 0.0:
# profit is over the threshold, don't exit
self._remove_profit_target(pair)
return False, None
elif is_derisk:
self._remove_profit_target(pair)
return False, None
elif self.derisk_enable and (current_time - timedelta(minutes=60) > previous_time_profit_reached):
if profit_ratio < previous_profit:
return True, previous_sell_reason
elif profit_ratio > previous_profit:
self._remove_profit_target(pair)
return False, None
elif (
not self.derisk_enable
and not is_rapid_mode
and not is_rebuy_mode
and not is_scalp_mode
and (
profit_init_ratio
<= -(self.stop_threshold_doom_futures if self.is_futures_mode else self.stop_threshold_doom_spot)
)
):
return True, previous_sell_reason
elif (
not self.derisk_enable
and is_rapid_mode
and (
profit_init_ratio
<= -(self.stop_threshold_rapid_futures if self.is_futures_mode else self.stop_threshold_rapid_spot)
)
):
return True, previous_sell_reason
elif (
not self.derisk_enable
and is_rebuy_mode
and (
profit_init_ratio
<= -(self.stop_threshold_futures_rebuy if self.is_futures_mode else self.stop_threshold_spot_rebuy)
)
):
return True, previous_sell_reason
elif (
not self.derisk_enable
and is_scalp_mode
and (
profit_init_ratio
<= -(self.stop_threshold_scalp_futures if self.is_futures_mode else self.stop_threshold_scalp_spot)
)
):
return True, previous_sell_reason
elif previous_sell_reason in [f"exit_{mode_name}_stoploss_u_e"]:
if profit_init_ratio > 0.0:
# profit is over the threshold, don't exit
self._remove_profit_target(pair)
return False, None
elif is_derisk:
self._remove_profit_target(pair)
return False, None
elif profit_ratio < (previous_profit - (0.04 / trade.leverage)):
return True, previous_sell_reason
elif previous_sell_reason in [f"exit_profit_{mode_name}_max"]:
if profit_init_ratio < -0.08:
# profit is under the threshold, cancel it
self._remove_profit_target(pair)
return False, None
if trade.is_short:
is_scalp_mode = all(c in self.short_scalp_mode_tags for c in enter_tags)
if is_scalp_mode:
if 0.001 <= profit_init_ratio < 0.01:
if profit_init_ratio < (previous_profit - 0.008):
return True, f"exit_profit_{mode_name}_t_0_1"
elif 0.01 <= profit_init_ratio < 0.02:
if profit_init_ratio < (previous_profit - 0.01):
return True, f"exit_profit_{mode_name}_t_1_1"
elif 0.02 <= profit_init_ratio < 0.03:
if profit_init_ratio < (previous_profit - 0.01):
return True, f"exit_profit_{mode_name}_t_2_1"
elif 0.03 <= profit_init_ratio < 0.04:
if profit_init_ratio < (previous_profit - 0.015):
return True, f"exit_profit_{mode_name}_t_3_1"
elif 0.04 <= profit_init_ratio < 0.05:
if profit_init_ratio < (previous_profit - 0.015):
return True, f"exit_profit_{mode_name}_t_4_1"
elif 0.05 <= profit_init_ratio < 0.06:
if profit_init_ratio < (previous_profit - 0.015):
return True, f"exit_profit_{mode_name}_t_5_1"
elif 0.06 <= profit_init_ratio < 0.07:
if profit_init_ratio < (previous_profit - 0.015):
return True, f"exit_profit_{mode_name}_t_6_1"
elif 0.07 <= profit_init_ratio < 0.08:
if profit_init_ratio < (previous_profit - 0.02):
return True, f"exit_profit_{mode_name}_t_7_1"
elif 0.08 <= profit_init_ratio < 0.09:
if profit_init_ratio < (previous_profit - 0.02):
return True, f"exit_profit_{mode_name}_t_8_1"
elif 0.09 <= profit_init_ratio < 0.10:
if profit_init_ratio < (previous_profit - 0.02):
return True, f"exit_profit_{mode_name}_t_9_1"
elif 0.10 <= profit_init_ratio < 0.11:
if profit_init_ratio < (previous_profit - 0.025):
return True, f"exit_profit_{mode_name}_t_10_1"
elif 0.11 <= profit_init_ratio < 0.12:
if profit_init_ratio < (previous_profit - 0.025):
return True, f"exit_profit_{mode_name}_t_11_1"
elif 0.12 <= profit_init_ratio:
if profit_init_ratio < (previous_profit - 0.025):
return True, f"exit_profit_{mode_name}_t_12_1"
elif 0.001 <= profit_init_ratio < 0.01:
if (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["RSI_14"] > 50.0)
and (last_candle["RSI_14"] > previous_candle_1["RSI_14"])
and (last_candle["CMF_20"] > 0.0)
):
return True, f"exit_profit_{mode_name}_t_0_1"
elif (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["CMF_20"] > 0.0)
and (last_candle["CMF_20_1h"] > 0.0)
and (last_candle["CMF_20_4h"] > 0.0)
):
return True, f"exit_profit_{mode_name}_t_0_2"
elif profit_init_ratio < (previous_profit - 0.05) and (last_candle["ROC_9_4h"] < -40.0):
return True, f"exit_profit_{mode_name}_t_0_3"
elif 0.01 <= profit_init_ratio < 0.02:
if (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["RSI_14"] > 50.0)
and (last_candle["RSI_14"] > previous_candle_1["RSI_14"])
and (last_candle["CMF_20"] > 0.0)
):
return True, f"exit_profit_{mode_name}_t_1_1"
elif (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["CMF_20"] > 0.0)
and (last_candle["CMF_20_1h"] > 0.0)
and (last_candle["CMF_20_4h"] > 0.0)
):
return True, f"exit_profit_{mode_name}_t_1_2"
elif profit_init_ratio < (previous_profit - 0.05) and (last_candle["ROC_9_4h"] < -40.0):
return True, f"exit_profit_{mode_name}_t_1_3"
elif 0.02 <= profit_init_ratio < 0.03:
if (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["RSI_14"] > 50.0)
and (last_candle["RSI_14"] > previous_candle_1["RSI_14"])
and (last_candle["CMF_20"] > 0.0)
):
return True, f"exit_profit_{mode_name}_t_2_1"
elif (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["CMF_20"] > 0.0)
and (last_candle["CMF_20_1h"] > 0.0)
and (last_candle["CMF_20_4h"] > 0.0)
):
return True, f"exit_profit_{mode_name}_t_2_2"
elif profit_init_ratio < (previous_profit - 0.05) and (last_candle["ROC_9_4h"] < -40.0):
return True, f"exit_profit_{mode_name}_t_2_3"
elif 0.03 <= profit_init_ratio < 0.04:
if (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["RSI_14"] > 50.0)
and (last_candle["RSI_14"] > previous_candle_1["RSI_14"])
and (last_candle["CMF_20"] > 0.0)
):
return True, f"exit_profit_{mode_name}_t_3_1"
elif (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["CMF_20"] > 0.0)
and (last_candle["CMF_20_1h"] > 0.0)
and (last_candle["CMF_20_4h"] > 0.0)
):
return True, f"exit_profit_{mode_name}_t_3_2"
elif profit_init_ratio < (previous_profit - 0.05) and (last_candle["ROC_9_4h"] < -40.0):
return True, f"exit_profit_{mode_name}_t_3_3"
elif 0.04 <= profit_init_ratio < 0.05:
if (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["RSI_14"] > 50.0)
and (last_candle["RSI_14"] > previous_candle_1["RSI_14"])
and (last_candle["CMF_20"] > 0.0)
):
return True, f"exit_profit_{mode_name}_t_4_1"
elif (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["CMF_20"] > 0.0)
and (last_candle["CMF_20_1h"] > 0.0)
and (last_candle["CMF_20_4h"] > 0.0)
):
return True, f"exit_profit_{mode_name}_t_4_2"
elif profit_init_ratio < (previous_profit - 0.05) and (last_candle["ROC_9_4h"] < -40.0):
return True, f"exit_profit_{mode_name}_t_4_3"
elif 0.05 <= profit_init_ratio < 0.06:
if (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["RSI_14"] > 50.0)
and (last_candle["RSI_14"] > previous_candle_1["RSI_14"])
and (last_candle["CMF_20"] > 0.0)
):
return True, f"exit_profit_{mode_name}_t_5_1"
elif (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["CMF_20"] > 0.0)
and (last_candle["CMF_20_1h"] > 0.0)
and (last_candle["CMF_20_4h"] > 0.0)
):
return True, f"exit_profit_{mode_name}_t_5_2"
elif profit_init_ratio < (previous_profit - 0.05) and (last_candle["ROC_9_4h"] < -40.0):
return True, f"exit_profit_{mode_name}_t_5_3"
elif 0.06 <= profit_init_ratio < 0.07:
if (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["RSI_14"] > 50.0)
and (last_candle["RSI_14"] > previous_candle_1["RSI_14"])
and (last_candle["CMF_20"] > 0.0)
):
return True, f"exit_profit_{mode_name}_t_6_1"
elif (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["CMF_20"] > 0.0)
and (last_candle["CMF_20_1h"] > 0.0)
and (last_candle["CMF_20_4h"] > 0.0)
):
return True, f"exit_profit_{mode_name}_t_6_2"
elif profit_init_ratio < (previous_profit - 0.05) and (last_candle["ROC_9_4h"] < -40.0):
return True, f"exit_profit_{mode_name}_t_6_3"
elif 0.07 <= profit_init_ratio < 0.08:
if (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["RSI_14"] > 50.0)
and (last_candle["RSI_14"] > previous_candle_1["RSI_14"])
and (last_candle["CMF_20"] > 0.0)
):
return True, f"exit_profit_{mode_name}_t_7_1"
elif (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["CMF_20"] > 0.0)
and (last_candle["CMF_20_1h"] > 0.0)
and (last_candle["CMF_20_4h"] > 0.0)
):
return True, f"exit_profit_{mode_name}_t_7_2"
elif profit_init_ratio < (previous_profit - 0.05) and (last_candle["ROC_9_4h"] < -40.0):
return True, f"exit_profit_{mode_name}_t_7_3"
elif 0.08 <= profit_init_ratio < 0.09:
if (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["RSI_14"] > 50.0)
and (last_candle["RSI_14"] > previous_candle_1["RSI_14"])
and (last_candle["CMF_20"] > 0.0)
):
return True, f"exit_profit_{mode_name}_t_8_1"
elif (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["CMF_20"] > 0.0)
and (last_candle["CMF_20_1h"] > 0.0)
and (last_candle["CMF_20_4h"] > 0.0)
):
return True, f"exit_profit_{mode_name}_t_8_2"
elif profit_init_ratio < (previous_profit - 0.05) and (last_candle["ROC_9_4h"] < -40.0):
return True, f"exit_profit_{mode_name}_t_8_3"
elif 0.09 <= profit_init_ratio < 0.10:
if (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["RSI_14"] > 50.0)
and (last_candle["RSI_14"] > previous_candle_1["RSI_14"])
and (last_candle["CMF_20"] > 0.0)
):
return True, f"exit_profit_{mode_name}_t_9_1"
elif (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["CMF_20"] > 0.0)
and (last_candle["CMF_20_1h"] > 0.0)
and (last_candle["CMF_20_4h"] > 0.0)
):
return True, f"exit_profit_{mode_name}_t_9_2"
elif profit_init_ratio < (previous_profit - 0.05) and (last_candle["ROC_9_4h"] < -40.0):
return True, f"exit_profit_{mode_name}_t_9_3"
elif 0.10 <= profit_init_ratio < 0.11:
if (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["RSI_14"] > 50.0)
and (last_candle["RSI_14"] > previous_candle_1["RSI_14"])
and (last_candle["CMF_20"] > 0.0)
):
return True, f"exit_profit_{mode_name}_t_10_1"
elif (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["CMF_20"] > 0.0)
and (last_candle["CMF_20_1h"] > 0.0)
and (last_candle["CMF_20_4h"] > 0.0)
):
return True, f"exit_profit_{mode_name}_t_10_2"
elif profit_init_ratio < (previous_profit - 0.05) and (last_candle["ROC_9_4h"] < -40.0):
return True, f"exit_profit_{mode_name}_t_10_3"
elif 0.11 <= profit_init_ratio < 0.12:
if (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["RSI_14"] > 50.0)
and (last_candle["RSI_14"] > previous_candle_1["RSI_14"])
and (last_candle["CMF_20"] > 0.0)
):
return True, f"exit_profit_{mode_name}_t_11_1"
elif (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["CMF_20"] > 0.0)
and (last_candle["CMF_20_1h"] > 0.0)
and (last_candle["CMF_20_4h"] > 0.0)
):
return True, f"exit_profit_{mode_name}_t_11_2"
elif profit_init_ratio < (previous_profit - 0.05) and (last_candle["ROC_9_4h"] < -40.0):
return True, f"exit_profit_{mode_name}_t_11_3"
elif 0.12 <= profit_init_ratio:
if (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["RSI_14"] > 50.0)
and (last_candle["RSI_14"] > previous_candle_1["RSI_14"])
and (last_candle["CMF_20"] > 0.0)
):
return True, f"exit_profit_{mode_name}_t_12_1"
elif (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["CMF_20"] > 0.0)
and (last_candle["CMF_20_1h"] > 0.0)
and (last_candle["CMF_20_4h"] > 0.0)
):
return True, f"exit_profit_{mode_name}_t_12_2"
elif profit_init_ratio < (previous_profit - 0.05) and (last_candle["ROC_9_4h"] < -40.0):
return True, f"exit_profit_{mode_name}_t_12_3"
else:
is_scalp_mode = all(c in self.long_scalp_mode_tags for c in enter_tags)
if is_scalp_mode:
if 0.001 <= profit_init_ratio < 0.01:
if profit_init_ratio < (previous_profit - 0.008):
return True, f"exit_profit_{mode_name}_t_0_1"
elif 0.01 <= profit_init_ratio < 0.02:
if profit_init_ratio < (previous_profit - 0.01):
return True, f"exit_profit_{mode_name}_t_1_1"
elif 0.02 <= profit_init_ratio < 0.03:
if profit_init_ratio < (previous_profit - 0.01):
return True, f"exit_profit_{mode_name}_t_2_1"
elif 0.03 <= profit_init_ratio < 0.04:
if profit_init_ratio < (previous_profit - 0.015):
return True, f"exit_profit_{mode_name}_t_3_1"
elif 0.04 <= profit_init_ratio < 0.05:
if profit_init_ratio < (previous_profit - 0.015):
return True, f"exit_profit_{mode_name}_t_4_1"
elif 0.05 <= profit_init_ratio < 0.06:
if profit_init_ratio < (previous_profit - 0.015):
return True, f"exit_profit_{mode_name}_t_5_1"
elif 0.06 <= profit_init_ratio < 0.07:
if profit_init_ratio < (previous_profit - 0.015):
return True, f"exit_profit_{mode_name}_t_6_1"
elif 0.07 <= profit_init_ratio < 0.08:
if profit_init_ratio < (previous_profit - 0.02):
return True, f"exit_profit_{mode_name}_t_7_1"
elif 0.08 <= profit_init_ratio < 0.09:
if profit_init_ratio < (previous_profit - 0.02):
return True, f"exit_profit_{mode_name}_t_8_1"
elif 0.09 <= profit_init_ratio < 0.10:
if profit_init_ratio < (previous_profit - 0.02):
return True, f"exit_profit_{mode_name}_t_9_1"
elif 0.10 <= profit_init_ratio < 0.11:
if profit_init_ratio < (previous_profit - 0.025):
return True, f"exit_profit_{mode_name}_t_10_1"
elif 0.11 <= profit_init_ratio < 0.12:
if profit_init_ratio < (previous_profit - 0.025):
return True, f"exit_profit_{mode_name}_t_11_1"
elif 0.12 <= profit_init_ratio:
if profit_init_ratio < (previous_profit - 0.025):
return True, f"exit_profit_{mode_name}_t_12_1"
else:
if 0.001 <= profit_init_ratio < 0.01:
if (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["RSI_14"] < 50.0)
and (last_candle["RSI_14"] < previous_candle_1["RSI_14"])
and (last_candle["CMF_20"] < -0.0)
):
return True, f"exit_profit_{mode_name}_t_0_1"
elif (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["CMF_20"] < -0.0)
and (last_candle["CMF_20_1h"] < -0.0)
and (last_candle["CMF_20_4h"] < -0.0)
):
return True, f"exit_profit_{mode_name}_t_0_2"
elif profit_init_ratio < (previous_profit - 0.05) and (last_candle["ROC_9_4h"] > 40.0):
return True, f"exit_profit_{mode_name}_t_0_3"
elif 0.01 <= profit_init_ratio < 0.02:
if (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["RSI_14"] < 50.0)
and (last_candle["RSI_14"] < previous_candle_1["RSI_14"])
and (last_candle["CMF_20"] < -0.0)
):
return True, f"exit_profit_{mode_name}_t_1_1"
elif (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["CMF_20"] < -0.0)
and (last_candle["CMF_20_1h"] < -0.0)
and (last_candle["CMF_20_4h"] < -0.0)
):
return True, f"exit_profit_{mode_name}_t_1_2"
elif profit_init_ratio < (previous_profit - 0.05) and (last_candle["ROC_9_4h"] > 40.0):
return True, f"exit_profit_{mode_name}_t_1_3"
elif 0.02 <= profit_init_ratio < 0.03:
if (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["RSI_14"] < 50.0)
and (last_candle["RSI_14"] < previous_candle_1["RSI_14"])
and (last_candle["CMF_20"] < -0.0)
):
return True, f"exit_profit_{mode_name}_t_2_1"
elif (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["CMF_20"] < -0.0)
and (last_candle["CMF_20_1h"] < -0.0)
and (last_candle["CMF_20_4h"] < -0.0)
):
return True, f"exit_profit_{mode_name}_t_2_2"
elif profit_init_ratio < (previous_profit - 0.05) and (last_candle["ROC_9_4h"] > 40.0):
return True, f"exit_profit_{mode_name}_t_2_3"
elif 0.03 <= profit_init_ratio < 0.04:
if (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["RSI_14"] < 50.0)
and (last_candle["RSI_14"] < previous_candle_1["RSI_14"])
and (last_candle["CMF_20"] < -0.0)
):
return True, f"exit_profit_{mode_name}_t_3_1"
elif (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["CMF_20"] < -0.0)
and (last_candle["CMF_20_1h"] < -0.0)
and (last_candle["CMF_20_4h"] < -0.0)
):
return True, f"exit_profit_{mode_name}_t_3_2"
elif profit_init_ratio < (previous_profit - 0.05) and (last_candle["ROC_9_4h"] > 40.0):
return True, f"exit_profit_{mode_name}_t_3_3"
elif 0.04 <= profit_init_ratio < 0.05:
if (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["RSI_14"] < 50.0)
and (last_candle["RSI_14"] < previous_candle_1["RSI_14"])
and (last_candle["CMF_20"] < -0.0)
):
return True, f"exit_profit_{mode_name}_t_4_1"
elif (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["CMF_20"] < -0.0)
and (last_candle["CMF_20_1h"] < -0.0)
and (last_candle["CMF_20_4h"] < -0.0)
):
return True, f"exit_profit_{mode_name}_t_4_2"
elif profit_init_ratio < (previous_profit - 0.05) and (last_candle["ROC_9_4h"] > 40.0):
return True, f"exit_profit_{mode_name}_t_4_3"
elif 0.05 <= profit_init_ratio < 0.06:
if (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["RSI_14"] < 50.0)
and (last_candle["RSI_14"] < previous_candle_1["RSI_14"])
and (last_candle["CMF_20"] < -0.0)
):
return True, f"exit_profit_{mode_name}_t_5_1"
elif (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["CMF_20"] < -0.0)
and (last_candle["CMF_20_1h"] < -0.0)
and (last_candle["CMF_20_4h"] < -0.0)
):
return True, f"exit_profit_{mode_name}_t_5_2"
elif profit_init_ratio < (previous_profit - 0.05) and (last_candle["ROC_9_4h"] > 40.0):
return True, f"exit_profit_{mode_name}_t_5_3"
elif 0.06 <= profit_init_ratio < 0.07:
if (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["RSI_14"] < 50.0)
and (last_candle["RSI_14"] < previous_candle_1["RSI_14"])
and (last_candle["CMF_20"] < -0.0)
):
return True, f"exit_profit_{mode_name}_t_6_1"
elif (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["CMF_20"] < -0.0)
and (last_candle["CMF_20_1h"] < -0.0)
and (last_candle["CMF_20_4h"] < -0.0)
):
return True, f"exit_profit_{mode_name}_t_6_2"
elif profit_init_ratio < (previous_profit - 0.05) and (last_candle["ROC_9_4h"] > 40.0):
return True, f"exit_profit_{mode_name}_t_6_3"
elif 0.07 <= profit_init_ratio < 0.08:
if (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["RSI_14"] < 50.0)
and (last_candle["RSI_14"] < previous_candle_1["RSI_14"])
and (last_candle["CMF_20"] < -0.0)
):
return True, f"exit_profit_{mode_name}_t_7_1"
elif (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["CMF_20"] < -0.0)
and (last_candle["CMF_20_1h"] < -0.0)
and (last_candle["CMF_20_4h"] < -0.0)
):
return True, f"exit_profit_{mode_name}_t_7_2"
elif profit_init_ratio < (previous_profit - 0.05) and (last_candle["ROC_9_4h"] > 40.0):
return True, f"exit_profit_{mode_name}_t_7_3"
elif 0.08 <= profit_init_ratio < 0.09:
if (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["RSI_14"] < 50.0)
and (last_candle["RSI_14"] < previous_candle_1["RSI_14"])
and (last_candle["CMF_20"] < -0.0)
):
return True, f"exit_profit_{mode_name}_t_8_1"
elif (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["CMF_20"] < -0.0)
and (last_candle["CMF_20_1h"] < -0.0)
and (last_candle["CMF_20_4h"] < -0.0)
):
return True, f"exit_profit_{mode_name}_t_8_2"
elif profit_init_ratio < (previous_profit - 0.05) and (last_candle["ROC_9_4h"] > 40.0):
return True, f"exit_profit_{mode_name}_t_8_3"
elif 0.09 <= profit_init_ratio < 0.10:
if (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["RSI_14"] < 50.0)
and (last_candle["RSI_14"] < previous_candle_1["RSI_14"])
and (last_candle["CMF_20"] < -0.0)
):
return True, f"exit_profit_{mode_name}_t_9_1"
elif (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["CMF_20"] < -0.0)
and (last_candle["CMF_20_1h"] < -0.0)
and (last_candle["CMF_20_4h"] < -0.0)
):
return True, f"exit_profit_{mode_name}_t_9_2"
elif profit_init_ratio < (previous_profit - 0.05) and (last_candle["ROC_9_4h"] > 40.0):
return True, f"exit_profit_{mode_name}_t_9_3"
elif 0.10 <= profit_init_ratio < 0.11:
if (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["RSI_14"] < 50.0)
and (last_candle["RSI_14"] < previous_candle_1["RSI_14"])
and (last_candle["CMF_20"] < -0.0)
):
return True, f"exit_profit_{mode_name}_t_10_1"
elif (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["CMF_20"] < -0.0)
and (last_candle["CMF_20_1h"] < -0.0)
and (last_candle["CMF_20_4h"] < -0.0)
):
return True, f"exit_profit_{mode_name}_t_10_2"
elif profit_init_ratio < (previous_profit - 0.05) and (last_candle["ROC_9_4h"] > 40.0):
return True, f"exit_profit_{mode_name}_t_10_3"
elif 0.11 <= profit_init_ratio < 0.12:
if (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["RSI_14"] < 50.0)
and (last_candle["RSI_14"] < previous_candle_1["RSI_14"])
and (last_candle["CMF_20"] < -0.0)
):
return True, f"exit_profit_{mode_name}_t_11_1"
elif (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["CMF_20"] < -0.0)
and (last_candle["CMF_20_1h"] < -0.0)
and (last_candle["CMF_20_4h"] < -0.0)
):
return True, f"exit_profit_{mode_name}_t_11_2"
elif profit_init_ratio < (previous_profit - 0.05) and (last_candle["ROC_9_4h"] > 40.0):
return True, f"exit_profit_{mode_name}_t_11_3"
elif 0.12 <= profit_init_ratio:
if (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["RSI_14"] < 50.0)
and (last_candle["RSI_14"] < previous_candle_1["RSI_14"])
and (last_candle["CMF_20"] < -0.0)
):
return True, f"exit_profit_{mode_name}_t_12_1"
elif (
profit_init_ratio < (previous_profit - 0.03)
and (last_candle["CMF_20"] < -0.0)
and (last_candle["CMF_20_1h"] < -0.0)
and (last_candle["CMF_20_4h"] < -0.0)
):
return True, f"exit_profit_{mode_name}_t_12_2"
elif profit_init_ratio < (previous_profit - 0.05) and (last_candle["ROC_9_4h"] > 40.0):
return True, f"exit_profit_{mode_name}_t_12_3"
else:
return False, None
return False, None
# Calc Total Profit
# ---------------------------------------------------------------------------------------------
def calc_total_profit(
self, trade: "Trade", filled_entries: "Orders", filled_exits: "Orders", exit_rate: float
) -> tuple:
"""
Calculates the absolute profit for open trades.
:param trade: trade object.
:param filled_entries: Filled entries list.
:param filled_exits: Filled exits list.
:param exit_rate: The exit rate.
:return tuple: The total profit in stake, ratio, ratio based on current stake, and ratio based on the first entry stake.
"""
fee_open_rate = trade.fee_open if self.custom_fee_open_rate is None else self.custom_fee_open_rate
fee_close_rate = trade.fee_close if self.custom_fee_close_rate is None else self.custom_fee_close_rate
total_amount = 0.0
total_stake = 0.0
total_profit = 0.0
current_stake = 0.0
for entry_order in filled_entries:
if trade.is_short:
entry_stake = entry_order.safe_filled * entry_order.safe_price * (1 - fee_open_rate)
total_amount += entry_order.safe_filled
total_stake += entry_stake
total_profit += entry_stake
else:
entry_stake = entry_order.safe_filled * entry_order.safe_price * (1 + fee_open_rate)
total_amount += entry_order.safe_filled
total_stake += entry_stake
total_profit -= entry_stake
for exit_order in filled_exits:
if trade.is_short:
exit_stake = exit_order.safe_filled * exit_order.safe_price * (1 + fee_close_rate)
total_amount -= exit_order.safe_filled
total_profit -= exit_stake
else:
exit_stake = exit_order.safe_filled * exit_order.safe_price * (1 - fee_close_rate)
total_amount -= exit_order.safe_filled
total_profit += exit_stake
if trade.is_short:
current_stake = total_amount * exit_rate * (1 + fee_close_rate)
total_profit -= current_stake
else:
current_stake = total_amount * exit_rate * (1 - fee_close_rate)
total_profit += current_stake
if self.is_futures_mode:
total_profit += trade.funding_fees
total_profit_ratio = total_profit / total_stake
current_profit_ratio = total_profit / current_stake
init_profit_ratio = total_profit / filled_entries[0].cost
return total_profit, total_profit_ratio, current_profit_ratio, init_profit_ratio
# Custom Exit
# ---------------------------------------------------------------------------------------------
def custom_exit(
self, pair: str, trade: "Trade", current_time: "datetime", current_rate: float, current_profit: float, **kwargs
):
df, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)
last_candle = df.iloc[-1].squeeze()
previous_candle_1 = df.iloc[-2].squeeze()
previous_candle_2 = df.iloc[-3].squeeze()
previous_candle_3 = df.iloc[-4].squeeze()
previous_candle_4 = df.iloc[-5].squeeze()
previous_candle_5 = df.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()
filled_entries = trade.select_filled_orders(trade.entry_side)
filled_exits = trade.select_filled_orders(trade.exit_side)
profit_stake = 0.0
profit_ratio = 0.0
profit_current_stake_ratio = 0.0
profit_init_ratio = 0.0
profit_stake, profit_ratio, profit_current_stake_ratio, profit_init_ratio = self.calc_total_profit(
trade, filled_entries, filled_exits, current_rate
)
max_profit = 0.0
max_loss = 0.0
# Long Normal mode
if any(c in self.long_normal_mode_tags for c in enter_tags):
sell, signal_name = self.long_exit_normal(
pair,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
max_profit,
max_loss,
filled_entries,
filled_exits,
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 Pump mode
if any(c in self.long_pump_mode_tags for c in enter_tags):
sell, signal_name = self.long_exit_pump(
pair,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
max_profit,
max_loss,
filled_entries,
filled_exits,
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 Quick mode
if any(c in self.long_quick_mode_tags for c in enter_tags):
sell, signal_name = self.long_exit_quick(
pair,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
max_profit,
max_loss,
filled_entries,
filled_exits,
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 Rebuy mode
if all(c in self.long_rebuy_mode_tags for c in enter_tags) or (
any(c in self.long_rebuy_mode_tags for c in enter_tags)
and all(c in (self.long_rebuy_mode_tags + self.long_grind_mode_tags) for c in enter_tags)
):
sell, signal_name = self.long_exit_rebuy(
pair,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
max_profit,
max_loss,
filled_entries,
filled_exits,
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 high profit mode
if any(c in self.long_high_profit_mode_tags for c in enter_tags):
sell, signal_name = self.long_exit_high_profit(
pair,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
max_profit,
max_loss,
filled_entries,
filled_exits,
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 rapid mode
if all(c in self.long_rapid_mode_tags for c in enter_tags) or (
any(c in self.long_rapid_mode_tags for c in enter_tags)
and all(
c
in (
self.long_rapid_mode_tags + self.long_rebuy_mode_tags + self.long_grind_mode_tags + self.long_scalp_mode_tags
)
for c in enter_tags
)
):
sell, signal_name = self.long_exit_rapid(
pair,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
max_profit,
max_loss,
filled_entries,
filled_exits,
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 grind mode
if all(c in self.long_grind_mode_tags for c in enter_tags):
sell, signal_name = self.long_exit_grind(
pair,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
max_profit,
max_loss,
filled_entries,
filled_exits,
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 Top Coins mode
if any(c in self.long_top_coins_mode_tags for c in enter_tags):
sell, signal_name = self.long_exit_top_coins(
pair,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
max_profit,
max_loss,
filled_entries,
filled_exits,
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 scalp mode
if all(c in self.long_scalp_mode_tags for c in enter_tags) or (
any(c in self.long_scalp_mode_tags for c in enter_tags)
and all(
c in (self.long_scalp_mode_tags + self.long_rebuy_mode_tags + self.long_grind_mode_tags) for c in enter_tags
)
):
sell, signal_name = self.long_exit_scalp(
pair,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
max_profit,
max_loss,
filled_entries,
filled_exits,
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})"
# Short normal mode
if any(c in self.short_normal_mode_tags for c in enter_tags):
sell, signal_name = self.short_exit_normal(
pair,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
max_profit,
max_loss,
filled_entries,
filled_exits,
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})"
# Short Pump mode
if any(c in self.short_pump_mode_tags for c in enter_tags):
sell, signal_name = self.short_exit_pump(
pair,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
max_profit,
max_loss,
filled_entries,
filled_exits,
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})"
# Short Quick mode
if any(c in self.short_quick_mode_tags for c in enter_tags):
sell, signal_name = self.short_exit_quick(
pair,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
max_profit,
max_loss,
filled_entries,
filled_exits,
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})"
# Short Rebuy mode
if all(c in self.short_rebuy_mode_tags for c in enter_tags):
sell, signal_name = self.short_exit_rebuy(
pair,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
max_profit,
max_loss,
filled_entries,
filled_exits,
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})"
# Short high profit mode
if any(c in self.short_high_profit_mode_tags for c in enter_tags):
sell, signal_name = self.short_exit_high_profit(
pair,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
max_profit,
max_loss,
filled_entries,
filled_exits,
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})"
# Short rapid mode
if any(c in self.short_rapid_mode_tags for c in enter_tags):
sell, signal_name = self.short_exit_rapid(
pair,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
max_profit,
max_loss,
filled_entries,
filled_exits,
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})"
# Short scalp mode
if all(c in self.short_scalp_mode_tags for c in enter_tags) or (
any(c in self.short_scalp_mode_tags for c in enter_tags)
and all(
c in (self.short_scalp_mode_tags + self.short_rebuy_mode_tags + self.short_grind_mode_tags) for c in enter_tags
)
):
sell, signal_name = self.short_exit_scalp(
pair,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
max_profit,
max_loss,
filled_entries,
filled_exits,
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})"
# Trades not opened by X6
if not trade.is_short and (
not any(
c
in (
self.long_normal_mode_tags
+ self.long_pump_mode_tags
+ self.long_quick_mode_tags
+ self.long_rebuy_mode_tags
+ self.long_high_profit_mode_tags
+ self.long_rapid_mode_tags
+ self.long_grind_mode_tags
+ self.long_top_coins_mode_tags
+ self.long_scalp_mode_tags
)
for c in enter_tags
)
):
# use normal mode for such trades
sell, signal_name = self.long_exit_normal(
pair,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
max_profit,
max_loss,
filled_entries,
filled_exits,
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})"
# Trades not opened by X6
if trade.is_short and (
not any(
c
in (
self.short_normal_mode_tags
+ self.short_pump_mode_tags
+ self.short_quick_mode_tags
+ self.short_rebuy_mode_tags
+ self.short_high_profit_mode_tags
+ self.short_rapid_mode_tags
+ self.short_grind_mode_tags
+ self.short_scalp_mode_tags
)
for c in enter_tags
)
):
# use normal mode for such trades
sell, signal_name = self.short_exit_normal(
pair,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
max_profit,
max_loss,
filled_entries,
filled_exits,
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
# Custom Stake Amount
# ---------------------------------------------------------------------------------------------
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:
enter_tags = entry_tag.split()
if side == "long":
# Rebuy mode
if all(c in self.long_rebuy_mode_tags for c in enter_tags) or (
any(c in self.long_rebuy_mode_tags for c in enter_tags)
and all(c in (self.long_rebuy_mode_tags + self.long_grind_mode_tags) for c in enter_tags)
):
stake_multiplier = self.rebuy_mode_stake_multiplier
stake = proposed_stake * stake_multiplier
if stake > min_stake:
return stake
else:
return min_stake
# Rapid mode
if all(c in self.long_rapid_mode_tags for c in enter_tags) or (
any(c in self.long_rapid_mode_tags for c in enter_tags)
and all(
c in (self.long_rapid_mode_tags + self.long_rebuy_mode_tags + self.long_grind_mode_tags) for c in enter_tags
)
):
stake_multiplier = (
self.rapid_mode_stake_multiplier_futures[0]
if self.is_futures_mode
else self.rapid_mode_stake_multiplier_spot[0]
)
if (proposed_stake * stake_multiplier) > min_stake:
return proposed_stake * stake_multiplier
else:
return min_stake
# Grind mode
elif all(c in self.long_grind_mode_tags for c in enter_tags):
for _, item in enumerate(
self.grind_mode_stake_multiplier_futures if self.is_futures_mode else self.grind_mode_stake_multiplier_spot
):
if (proposed_stake * item) > min_stake:
stake_multiplier = item
return proposed_stake * stake_multiplier
else:
stake_multiplier = (
self.regular_mode_stake_multiplier_futures[0]
if self.is_futures_mode
else self.regular_mode_stake_multiplier_spot[0]
)
if (proposed_stake * stake_multiplier) > min_stake:
return proposed_stake * stake_multiplier
else:
return min_stake
else:
# Rebuy mode
if all(c in self.short_rebuy_mode_tags for c in enter_tags) or (
any(c in self.short_rebuy_mode_tags for c in enter_tags)
and all(c in (self.short_rebuy_mode_tags + self.short_grind_mode_tags) for c in enter_tags)
):
stake_multiplier = self.rebuy_mode_stake_multiplier
# Low stakes, on Binance mostly
if (proposed_stake * self.rebuy_mode_stake_multiplier) < min_stake:
stake_multiplier = self.rebuy_mode_stake_multiplier_alt
return proposed_stake * stake_multiplier
# Grind mode
elif all(c in self.short_grind_mode_tags for c in enter_tags):
for _, item in enumerate(
self.grind_mode_stake_multiplier_futures if self.is_futures_mode else self.grind_mode_stake_multiplier_spot
):
if (proposed_stake * item) > min_stake:
stake_multiplier = item
return proposed_stake * stake_multiplier
else:
stake_multiplier = (
self.regular_mode_stake_multiplier_futures[0]
if self.is_futures_mode
else self.regular_mode_stake_multiplier_spot[0]
)
if (proposed_stake * stake_multiplier) > min_stake:
return proposed_stake * stake_multiplier
else:
return min_stake
return proposed_stake
# Adjust Trade Position
# ---------------------------------------------------------------------------------------------
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,
):
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()
is_backtest = self.is_backtest_mode()
is_long_grind_mode = all(c in self.long_grind_mode_tags for c in enter_tags)
is_short_grind_mode = all(c in self.short_grind_mode_tags for c in enter_tags)
is_v2_date = trade.open_date_utc.replace(tzinfo=None) >= datetime(2025, 2, 13) or is_backtest
# Rebuy mode
if not trade.is_short and (
all(c in self.long_rebuy_mode_tags for c in enter_tags)
or (
any(c in self.long_rebuy_mode_tags for c in enter_tags)
and all(c in (self.long_rebuy_mode_tags + self.long_grind_mode_tags) for c in enter_tags)
)
):
return self.long_rebuy_adjust_trade_position(
trade,
enter_tags,
current_time,
current_rate,
current_profit,
min_stake,
max_stake,
current_entry_rate,
current_exit_rate,
current_entry_profit,
current_exit_profit,
)
# Grinding
elif not trade.is_short:
if is_long_grind_mode or not is_v2_date:
return self.long_grind_adjust_trade_position(
trade,
enter_tags,
current_time,
current_rate,
current_profit,
min_stake,
max_stake,
current_entry_rate,
current_exit_rate,
current_entry_profit,
current_exit_profit,
)
elif any(
c
in (
self.long_normal_mode_tags
+ self.long_pump_mode_tags
+ self.long_quick_mode_tags
+ self.long_high_profit_mode_tags
+ self.long_rapid_mode_tags
+ self.long_top_coins_mode_tags
+ self.long_scalp_mode_tags
)
for c in enter_tags
) or not any(
c
in (
self.long_normal_mode_tags
+ self.long_pump_mode_tags
+ self.long_quick_mode_tags
+ self.long_rebuy_mode_tags
+ self.long_high_profit_mode_tags
+ self.long_rapid_mode_tags
+ self.long_grind_mode_tags
+ self.long_top_coins_mode_tags
+ self.long_scalp_mode_tags
)
for c in enter_tags
):
return self.long_grind_adjust_trade_position_v2(
trade,
enter_tags,
current_time,
current_rate,
current_profit,
min_stake,
max_stake,
current_entry_rate,
current_exit_rate,
current_entry_profit,
current_exit_profit,
)
elif trade.is_short:
if is_short_grind_mode or not is_v2_date:
return self.short_grind_adjust_trade_position(
trade,
enter_tags,
current_time,
current_rate,
current_profit,
min_stake,
max_stake,
current_entry_rate,
current_exit_rate,
current_entry_profit,
current_exit_profit,
)
else:
if any(
c
in (
self.short_normal_mode_tags
+ self.short_pump_mode_tags
+ self.short_quick_mode_tags
+ self.short_high_profit_mode_tags
+ self.short_rapid_mode_tags
+ self.short_top_coins_mode_tags
+ self.short_scalp_mode_tags
)
for c in enter_tags
) or not any(
c
in (
self.short_normal_mode_tags
+ self.short_pump_mode_tags
+ self.short_quick_mode_tags
+ self.short_rebuy_mode_tags
+ self.short_high_profit_mode_tags
+ self.short_rapid_mode_tags
+ self.short_grind_mode_tags
+ self.short_top_coins_mode_tags
+ self.short_scalp_mode_tags
)
for c in enter_tags
):
return self.short_grind_adjust_trade_position_v2(
trade,
enter_tags,
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 notification_msg(
self,
msg_type: str,
tag: str,
pair: str,
rate: float,
stake_amount: float,
profit_stake: float,
profit_ratio: float,
grind_profit_stake: float = None,
grind_profit_pct: float = None,
stake_currency: str = None,
coin_amount: float = None,
) -> str:
"""
Generate a formatted notification message for trade events.
This function is designed to standardize trade-related notifications
such as grinding entries, exits, stop-losses, buybacks, and re-entries.
It builds a Markdown-formatted message with emojis for readability.
Parameters
----------
msg_type : str
Type of notification. Must be one of:
- "grinding-entry"
- "grinding-exit"
- "grinding-derisk"
- "grinding-stop"
- "buyback-entry"
- "buyback-exit"
- "buyback-derisk"
- "re-entry"
- "de-risk"
- "rebuy-derisk"
- "rebuy"
tag : str
Identifier or label for the trade step (e.g., "g1", "dl1").
pair : str
Pair (e.g., "BTC/USDT").
rate : float
Entry or exit rate for the trade.
stake_amount : float
Amount of stake used in the trade.
profit_stake : float
Profit expressed in stake currency.
profit_ratio : float
Profit ratio (decimal form, e.g. 0.05 = 5%).
grind_profit_stake : float, optional
Grind profit expressed in stake currency (default: None).
grind_profit_pct : float, optional
Grind profit ratio (decimal form, e.g. 0.02 = 2%) (default: None).
stake_currency : str, optional
Symbol of the stake currency (e.g., "USDT"). If None, only numeric values are shown.
coin_amount : float, optional
Amount of base coins involved in the trade (e.g., exit/stop cases).
Returns
-------
str
A formatted multi-line string with trade details.
Example:
```
✅ **Grinding entry:** `(dl1)`
🏦 **Exchange:** `Binance`
🪙 **Pair:** `BTC/USDT`
〽️ **Rate:** `20000.0`
💰 **Stake amount:** `100.00 USDT`
💵 **Profit (stake):** `5.00 USDT`
💸 **Profit (percent):** `5.00%`
💶 **Grind profit (stake):** `2.00 USDT`
💸 **Grind profit (percent):** `2.00%`
```
Notes
-----
- The function uses Markdown formatting (e.g., **bold**, `inline code`)
for compatibility with Discord, Telegram, etc.
- If `grind_profit_stake` or `grind_profit_pct` are not provided,
the related fields are omitted.
- If `stake_currency` is provided, it will be appended to amounts.
"""
# Headers for different message types
headers = {
"grinding-entry": f"✅ **Grinding entry:** `({tag})`\n",
"grinding-exit": f"❎ **Grinding exit:** `({tag})`\n",
"grinding-derisk": f"❌ **Grinding de-risk:** `({tag})`\n",
"grinding-stop": f"❌ **Grinding stop exit:** `({tag})`\n",
"buyback-entry": f"✅ **Buyback entry:** `({tag})`\n",
"buyback-exit": f"❎ **Buyback exit:** `({tag})`\n",
"buyback-derisk": f"❌ **Buyback de-risk:** `({tag})`\n",
"re-entry": f"✅ **Re-entry:** `({tag})`\n",
"de-risk": f"❌ **De-risk:** `({tag})`\n",
"rebuy-derisk": f"❌ **Rebuy de-risk:** `({tag})`\n",
"rebuy": f"✅ **Rebuy:** `({tag})`\n",
}
# Start with the header
msg = headers.get(msg_type, None)
# Add exchange information
exchange_name = getattr(self, "config", {}).get("exchange", {}).get("name", "Unknown").capitalize()
msg += f"🏦 **Exchange:** `{exchange_name}`\n"
# Common fields
msg += (
f"🪙 **Pair:** `{pair}`\n"
f"〽️ **Rate:** `{rate}`\n"
f"💰 **Stake amount:** `{stake_amount:.2f}{'' if stake_currency is None else ' ' + stake_currency}`\n"
)
# Add coin amount if available (exit/stop cases)
if coin_amount is not None:
msg += f"🪙 **Coin amount:** `{coin_amount}`\n"
# Profit section
profit_pct = profit_ratio * 100
msg += (
f"💵 **Profit (stake):** `{profit_stake:.2f}{'' if stake_currency is None else ' ' + stake_currency}`\n"
f"💸 **Profit (percent):** `{profit_pct:.2f}%`\n"
)
# Grind profit calculation
if grind_profit_stake is not None and grind_profit_stake != 0:
msg += f"💶 **Grind profit (stake):** `{grind_profit_stake:.2f}{'' if stake_currency is None else ' ' + stake_currency}`\n"
if grind_profit_pct is not None and grind_profit_pct != 0:
msg += f"💸 **Grind profit (percent):** `{(grind_profit_pct * 100.0):.2f}%`"
return msg
# Informative Pairs
# ---------------------------------------------------------------------------------------------
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",
"FDUSD",
"PAX",
"USD",
"EUR",
"GBP",
"TRY",
]:
if ("trading_mode" in self.config) and (self.config["trading_mode"] in ["futures", "margin"]):
btc_info_pair = f"BTC/{self.config['stake_currency']}:{self.config['stake_currency']}"
else:
btc_info_pair = f"BTC/{self.config['stake_currency']}"
else:
if ("trading_mode" in self.config) and (self.config["trading_mode"] in ["futures", "margin"]):
btc_info_pair = "BTC/USDT:USDT"
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
# Informative 1d Timeframe Indicators
# ---------------------------------------------------------------------------------------------
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
# -----------------------------------------------------------------------------------------
# informative_1d_indicators_pandas_ta = pta.Strategy(
# name="informative_1d_indicators_pandas_ta",
# ta=[
# # RSI
# {"kind": "rsi", "length": 3},
# {"kind": "rsi", "length": 14},
# # {"kind": "rsi", "length": 20},
# # EMA
# # {"kind": "ema", "length": 12},
# # {"kind": "ema", "length": 16},
# # {"kind": "ema", "length": 20},
# # {"kind": "ema", "length": 26},
# # {"kind": "ema", "length": 50},
# # {"kind": "ema", "length": 100},
# # {"kind": "ema", "length": 200},
# # SMA
# # {"kind": "sma", "length": 16},
# # MFI
# {"kind": "mfi"},
# # CMF
# {"kind": "cmf"},
# # Williams %R
# {"kind": "willr", "length": 14},
# # STOCHRSI
# {"kind": "stochrsi"},
# # KST
# {"kind": "kst"},
# # ROC
# {"kind": "roc"},
# # AROON
# {"kind": "aroon"},
# ],
# )
# informative_1d.ta.study(informative_1d_indicators_pandas_ta, cores=self.num_cores_indicators_calc)
# RSI
informative_1d["RSI_3"] = pta.rsi(informative_1d["close"], length=3)
informative_1d["RSI_14"] = pta.rsi(informative_1d["close"], length=14)
informative_1d["RSI_3_change_pct"] = (
(informative_1d["RSI_3"] - informative_1d["RSI_3"].shift(1)) / (informative_1d["RSI_3"].shift(1))
) * 100.0
informative_1d["RSI_14_change_pct"] = (
(informative_1d["RSI_14"] - informative_1d["RSI_14"].shift(1)) / (informative_1d["RSI_14"].shift(1))
) * 100.0
informative_1d["RSI_3_diff"] = informative_1d["RSI_3"] - informative_1d["RSI_3"].shift(1)
informative_1d["RSI_14_diff"] = informative_1d["RSI_14"] - informative_1d["RSI_14"].shift(1)
# BB 20 - STD2
bbands_20_2 = pta.bbands(informative_1d["close"], length=20)
informative_1d["BBL_20_2.0"] = bbands_20_2["BBL_20_2.0"] if isinstance(bbands_20_2, pd.DataFrame) else np.nan
informative_1d["BBM_20_2.0"] = bbands_20_2["BBM_20_2.0"] if isinstance(bbands_20_2, pd.DataFrame) else np.nan
informative_1d["BBU_20_2.0"] = bbands_20_2["BBU_20_2.0"] if isinstance(bbands_20_2, pd.DataFrame) else np.nan
informative_1d["BBB_20_2.0"] = bbands_20_2["BBB_20_2.0"] if isinstance(bbands_20_2, pd.DataFrame) else np.nan
informative_1d["BBP_20_2.0"] = bbands_20_2["BBP_20_2.0"] if isinstance(bbands_20_2, pd.DataFrame) else np.nan
# MFI
informative_1d["MFI_14"] = pta.mfi(
informative_1d["high"], informative_1d["low"], informative_1d["close"], informative_1d["volume"], length=14
)
# CMF
informative_1d["CMF_20"] = pta.cmf(
informative_1d["high"], informative_1d["low"], informative_1d["close"], informative_1d["volume"], length=20
)
# Williams %R
informative_1d["WILLR_14"] = pta.willr(
informative_1d["high"], informative_1d["low"], informative_1d["close"], length=14
)
# AROON
aroon_14 = pta.aroon(informative_1d["high"], informative_1d["low"], length=14)
informative_1d["AROONU_14"] = aroon_14["AROONU_14"] if isinstance(aroon_14, pd.DataFrame) else np.nan
informative_1d["AROOND_14"] = aroon_14["AROOND_14"] if isinstance(aroon_14, pd.DataFrame) else np.nan
# Stochastic
try:
stochrsi = pta.stoch(informative_1d["high"], informative_1d["low"], informative_1d["close"])
informative_1d["STOCHk_14_3_3"] = stochrsi["STOCHk_14_3_3"] if isinstance(stochrsi, pd.DataFrame) else np.nan
informative_1d["STOCHd_14_3_3"] = stochrsi["STOCHd_14_3_3"] if isinstance(stochrsi, pd.DataFrame) else np.nan
except AttributeError:
informative_1d["STOCHk_14_3_3"] = np.nan
informative_1d["STOCHd_14_3_3"] = np.nan
# Stochastic RSI
stochrsi = pta.stochrsi(informative_1d["close"])
informative_1d["STOCHRSIk_14_14_3_3"] = (
stochrsi["STOCHRSIk_14_14_3_3"] if isinstance(stochrsi, pd.DataFrame) else np.nan
)
informative_1d["STOCHRSId_14_14_3_3"] = (
stochrsi["STOCHRSId_14_14_3_3"] if isinstance(stochrsi, pd.DataFrame) else np.nan
)
# ROC
informative_1d["ROC_2"] = pta.roc(informative_1d["close"], length=2)
informative_1d["ROC_9"] = pta.roc(informative_1d["close"], length=9)
# Candle change
informative_1d["change_pct"] = (informative_1d["close"] - informative_1d["open"]) / informative_1d["open"] * 100.0
# 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"])
* 100.0
)
informative_1d["bot_wick_pct"] = abs(
(informative_1d["low"] - np.minimum(informative_1d["open"], informative_1d["close"]))
/ np.minimum(informative_1d["open"], informative_1d["close"])
* 100.0
)
# Max highs
informative_1d["high_max_6"] = informative_1d["high"].rolling(6).max()
informative_1d["high_max_12"] = informative_1d["high"].rolling(12).max()
informative_1d["high_max_20"] = informative_1d["high"].rolling(20).max()
informative_1d["high_max_30"] = informative_1d["high"].rolling(30).max()
# Max lows
informative_1d["low_min_6"] = informative_1d["low"].rolling(6).min()
informative_1d["low_min_12"] = informative_1d["low"].rolling(12).min()
informative_1d["low_min_20"] = informative_1d["low"].rolling(20).min()
informative_1d["low_min_30"] = informative_1d["low"].rolling(30).min()
# Performance logging
# -----------------------------------------------------------------------------------------
tok = time.perf_counter()
log.debug(f"[{metadata['pair']}] informative_1d_indicators took: {tok - tik:0.4f} seconds.")
return informative_1d
# Informative 4h Timeframe Indicators
# ---------------------------------------------------------------------------------------------
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
# -----------------------------------------------------------------------------------------
# informative_4h_indicators_pandas_ta = pta.Strategy(
# name="informative_4h_indicators_pandas_ta",
# ta=[
# # RSI
# {"kind": "rsi", "length": 3},
# {"kind": "rsi", "length": 14},
# # {"kind": "rsi", "length": 20},
# # EMA
# {"kind": "ema", "length": 12},
# # {"kind": "ema", "length": 16},
# # {"kind": "ema", "length": 20},
# {"kind": "ema", "length": 26},
# # {"kind": "ema", "length": 50},
# # {"kind": "ema", "length": 100},
# {"kind": "ema", "length": 200},
# # SMA
# # {"kind": "sma", "length": 16},
# # BB 20 - STD2
# {"kind": "bbands", "length": 20},
# # MFI
# {"kind": "mfi"},
# # CMF
# {"kind": "cmf"},
# # Williams %R
# {"kind": "willr", "length": 14},
# # CTI
# {"kind": "cti", "length": 20},
# # STOCHRSI
# {"kind": "stochrsi"},
# # KST
# {"kind": "kst"},
# # ROC
# {"kind": "roc"},
# # AROON
# {"kind": "aroon"},
# # UO
# {"kind": "uo"},
# # AO
# {"kind": "ao"},
# ],
# )
# informative_4h.ta.study(informative_4h_indicators_pandas_ta, cores=self.num_cores_indicators_calc)
# RSI
informative_4h["RSI_3"] = pta.rsi(informative_4h["close"], length=3)
informative_4h["RSI_14"] = pta.rsi(informative_4h["close"], length=14)
informative_4h["RSI_3_change_pct"] = (
(informative_4h["RSI_3"] - informative_4h["RSI_3"].shift(1)) / (informative_4h["RSI_3"].shift(1))
) * 100.0
informative_4h["RSI_14_change_pct"] = (
(informative_4h["RSI_14"] - informative_4h["RSI_14"].shift(1)) / (informative_4h["RSI_14"].shift(1))
) * 100.0
informative_4h["RSI_3_diff"] = informative_4h["RSI_3"] - informative_4h["RSI_3"].shift(1)
informative_4h["RSI_14_diff"] = informative_4h["RSI_14"] - informative_4h["RSI_14"].shift(1)
# EMA
informative_4h["EMA_12"] = pta.ema(informative_4h["close"], length=12)
informative_4h["EMA_200"] = pta.ema(informative_4h["close"], length=200, fillna=0.0)
# BB 20 - STD2
bbands_20_2 = pta.bbands(informative_4h["close"], length=20)
informative_4h["BBL_20_2.0"] = bbands_20_2["BBL_20_2.0"] if isinstance(bbands_20_2, pd.DataFrame) else np.nan
informative_4h["BBM_20_2.0"] = bbands_20_2["BBM_20_2.0"] if isinstance(bbands_20_2, pd.DataFrame) else np.nan
informative_4h["BBU_20_2.0"] = bbands_20_2["BBU_20_2.0"] if isinstance(bbands_20_2, pd.DataFrame) else np.nan
informative_4h["BBB_20_2.0"] = bbands_20_2["BBB_20_2.0"] if isinstance(bbands_20_2, pd.DataFrame) else np.nan
informative_4h["BBP_20_2.0"] = bbands_20_2["BBP_20_2.0"] if isinstance(bbands_20_2, pd.DataFrame) else np.nan
# MFI
informative_4h["MFI_14"] = pta.mfi(
informative_4h["high"], informative_4h["low"], informative_4h["close"], informative_4h["volume"], length=14
)
# CMF
informative_4h["CMF_20"] = pta.cmf(
informative_4h["high"], informative_4h["low"], informative_4h["close"], informative_4h["volume"], length=20
)
# Williams %R
informative_4h["WILLR_14"] = pta.willr(
informative_4h["high"], informative_4h["low"], informative_4h["close"], length=14
)
# AROON
aroon_14 = pta.aroon(informative_4h["high"], informative_4h["low"], length=14)
informative_4h["AROONU_14"] = aroon_14["AROONU_14"] if isinstance(aroon_14, pd.DataFrame) else np.nan
informative_4h["AROOND_14"] = aroon_14["AROOND_14"] if isinstance(aroon_14, pd.DataFrame) else np.nan
# Stochastic
try:
stochrsi = pta.stoch(informative_4h["high"], informative_4h["low"], informative_4h["close"])
informative_4h["STOCHk_14_3_3"] = stochrsi["STOCHk_14_3_3"] if isinstance(stochrsi, pd.DataFrame) else np.nan
informative_4h["STOCHd_14_3_3"] = stochrsi["STOCHd_14_3_3"] if isinstance(stochrsi, pd.DataFrame) else np.nan
except AttributeError:
informative_4h["STOCHk_14_3_3"] = np.nan
informative_4h["STOCHd_14_3_3"] = np.nan
# Stochastic RSI
stochrsi = pta.stochrsi(informative_4h["close"])
informative_4h["STOCHRSIk_14_14_3_3"] = (
stochrsi["STOCHRSIk_14_14_3_3"] if isinstance(stochrsi, pd.DataFrame) else np.nan
)
informative_4h["STOCHRSId_14_14_3_3"] = (
stochrsi["STOCHRSId_14_14_3_3"] if isinstance(stochrsi, pd.DataFrame) else np.nan
)
informative_4h["STOCHRSIk_14_14_3_3_change_pct"] = (
(informative_4h["STOCHRSIk_14_14_3_3"] - informative_4h["STOCHRSIk_14_14_3_3"].shift(1))
/ informative_4h["STOCHRSIk_14_14_3_3"].shift(1)
) * 100.0
# KST
kst = pta.kst(informative_4h["close"])
informative_4h["KST_10_15_20_30_10_10_10_15"] = (
kst["KST_10_15_20_30_10_10_10_15"] if isinstance(kst, pd.DataFrame) else np.nan
)
informative_4h["KSTs_9"] = kst["KSTs_9"] if isinstance(kst, pd.DataFrame) else np.nan
# UO
informative_4h["UO_7_14_28"] = pta.uo(informative_4h["high"], informative_4h["low"], informative_4h["close"])
# OBV
informative_4h["OBV"] = pta.obv(informative_4h["close"], informative_4h["volume"])
informative_4h["OBV_change_pct"] = (
(informative_4h["OBV"] - informative_4h["OBV"].shift(1)) / abs(informative_4h["OBV"].shift(1))
) * 100.0
# ROC
informative_4h["ROC_2"] = pta.roc(informative_4h["close"], length=2)
informative_4h["ROC_9"] = pta.roc(informative_4h["close"], length=9)
# CCI
informative_4h["CCI_20"] = pta.cci(
informative_4h["high"], informative_4h["low"], informative_4h["close"], length=20
)
informative_4h["CCI_20"] = (
(informative_4h["CCI_20"]).astype(np.float64).replace(to_replace=[np.nan, None], value=(0.0))
)
informative_4h["CCI_20_change_pct"] = (
(informative_4h["CCI_20"] - informative_4h["CCI_20"].shift(1)) / abs(informative_4h["CCI_20"].shift(1))
) * 100.0
# Candle change
informative_4h["change_pct"] = (informative_4h["close"] - informative_4h["open"]) / informative_4h["open"] * 100.0
informative_4h["change_pct_min_3"] = informative_4h["change_pct"].rolling(3).min()
informative_4h["change_pct_min_6"] = informative_4h["change_pct"].rolling(6).min()
informative_4h["change_pct_max_3"] = informative_4h["change_pct"].rolling(3).max()
informative_4h["change_pct_max_6"] = informative_4h["change_pct"].rolling(6).max()
# Candle change
informative_4h["change_pct"] = (informative_4h["close"] - informative_4h["open"]) / informative_4h["open"] * 100.0
# 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"])
* 100.0
)
informative_4h["bot_wick_pct"] = abs(
(informative_4h["low"] - np.minimum(informative_4h["open"], informative_4h["close"]))
/ np.minimum(informative_4h["open"], informative_4h["close"])
* 100.0
)
# Max highs
informative_4h["high_max_6"] = informative_4h["high"].rolling(6).max()
informative_4h["high_max_12"] = informative_4h["high"].rolling(12).max()
informative_4h["high_max_24"] = informative_4h["high"].rolling(24).max()
# Min lows
informative_4h["low_min_6"] = informative_4h["low"].rolling(6).min()
informative_4h["low_min_12"] = informative_4h["low"].rolling(12).min()
informative_4h["low_min_24"] = informative_4h["low"].rolling(24).min()
# Performance logging
# -----------------------------------------------------------------------------------------
tok = time.perf_counter()
log.debug(f"[{metadata['pair']}] informative_1d_indicators took: {tok - tik:0.4f} seconds.")
return informative_4h
# Informative 1h Timeframe Indicators
# ---------------------------------------------------------------------------------------------
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
# -----------------------------------------------------------------------------------------
# informative_1h_indicators_pandas_ta = pta.Strategy(
# name="informative_1h_indicators_pandas_ta",
# ta=[
# # RSI
# {"kind": "rsi", "length": 3},
# {"kind": "rsi", "length": 14},
# # {"kind": "rsi", "length": 20},
# # EMA
# {"kind": "ema", "length": 12},
# # {"kind": "ema", "length": 16},
# {"kind": "ema", "length": 20},
# {"kind": "ema", "length": 26},
# # {"kind": "ema", "length": 50},
# # {"kind": "ema", "length": 100},
# {"kind": "ema", "length": 200},
# # SMA
# # {"kind": "sma", "length": 16},
# # BB 20 - STD2
# {"kind": "bbands", "length": 20},
# # MFI
# {"kind": "mfi"},
# # CMF
# {"kind": "cmf"},
# # Williams %R
# {"kind": "willr", "length": 14},
# # CTI
# {"kind": "cti", "length": 20},
# # STOCHRSI
# {"kind": "stochrsi"},
# # KST
# {"kind": "kst"},
# # ROC
# {"kind": "roc"},
# # AROON
# {"kind": "aroon"},
# # UO
# {"kind": "uo"},
# # AO
# {"kind": "ao"},
# ],
# )
# informative_1h.ta.study(informative_1h_indicators_pandas_ta, cores=self.num_cores_indicators_calc)
# RSI
informative_1h["RSI_3"] = pta.rsi(informative_1h["close"], length=3)
informative_1h["RSI_14"] = pta.rsi(informative_1h["close"], length=14)
informative_1h["RSI_3_change_pct"] = (
(informative_1h["RSI_3"] - informative_1h["RSI_3"].shift(1)) / (informative_1h["RSI_3"].shift(1))
) * 100.0
informative_1h["RSI_14_change_pct"] = (
(informative_1h["RSI_14"] - informative_1h["RSI_14"].shift(1)) / (informative_1h["RSI_14"].shift(1))
) * 100.0
informative_1h["RSI_3_diff"] = informative_1h["RSI_3"] - informative_1h["RSI_3"].shift(1)
informative_1h["RSI_14_diff"] = informative_1h["RSI_14"] - informative_1h["RSI_14"].shift(1)
# EMA
informative_1h["EMA_12"] = pta.ema(informative_1h["close"], length=12)
informative_1h["EMA_200"] = pta.ema(informative_1h["close"], length=200, fillna=0.0)
# SMA
informative_1h["SMA_16"] = pta.sma(informative_1h["close"], length=16)
# BB 20 - STD2
bbands_20_2 = pta.bbands(informative_1h["close"], length=20)
informative_1h["BBL_20_2.0"] = bbands_20_2["BBL_20_2.0"] if isinstance(bbands_20_2, pd.DataFrame) else np.nan
informative_1h["BBM_20_2.0"] = bbands_20_2["BBM_20_2.0"] if isinstance(bbands_20_2, pd.DataFrame) else np.nan
informative_1h["BBU_20_2.0"] = bbands_20_2["BBU_20_2.0"] if isinstance(bbands_20_2, pd.DataFrame) else np.nan
informative_1h["BBB_20_2.0"] = bbands_20_2["BBB_20_2.0"] if isinstance(bbands_20_2, pd.DataFrame) else np.nan
informative_1h["BBP_20_2.0"] = bbands_20_2["BBP_20_2.0"] if isinstance(bbands_20_2, pd.DataFrame) else np.nan
# MFI
informative_1h["MFI_14"] = pta.mfi(
informative_1h["high"], informative_1h["low"], informative_1h["close"], informative_1h["volume"], length=14
)
# CMF
informative_1h["CMF_20"] = pta.cmf(
informative_1h["high"], informative_1h["low"], informative_1h["close"], informative_1h["volume"], length=20
)
# Williams %R
informative_1h["WILLR_14"] = pta.willr(
informative_1h["high"], informative_1h["low"], informative_1h["close"], length=14
)
informative_1h["WILLR_84"] = pta.willr(
informative_1h["high"], informative_1h["low"], informative_1h["close"], length=84
)
# AROON
aroon_14 = pta.aroon(informative_1h["high"], informative_1h["low"], length=14)
informative_1h["AROONU_14"] = aroon_14["AROONU_14"] if isinstance(aroon_14, pd.DataFrame) else np.nan
informative_1h["AROOND_14"] = aroon_14["AROOND_14"] if isinstance(aroon_14, pd.DataFrame) else np.nan
# Stochastic
stochrsi = pta.stoch(informative_1h["high"], informative_1h["low"], informative_1h["close"])
informative_1h["STOCHk_14_3_3"] = stochrsi["STOCHk_14_3_3"] if isinstance(stochrsi, pd.DataFrame) else np.nan
informative_1h["STOCHd_14_3_3"] = stochrsi["STOCHd_14_3_3"] if isinstance(stochrsi, pd.DataFrame) else np.nan
# Stochastic RSI
stochrsi = pta.stochrsi(informative_1h["close"])
informative_1h["STOCHRSIk_14_14_3_3"] = (
stochrsi["STOCHRSIk_14_14_3_3"] if isinstance(stochrsi, pd.DataFrame) else np.nan
)
informative_1h["STOCHRSId_14_14_3_3"] = (
stochrsi["STOCHRSId_14_14_3_3"] if isinstance(stochrsi, pd.DataFrame) else np.nan
)
# KST
kst = pta.kst(informative_1h["close"])
informative_1h["KST_10_15_20_30_10_10_10_15"] = (
kst["KST_10_15_20_30_10_10_10_15"] if isinstance(kst, pd.DataFrame) else np.nan
)
informative_1h["KSTs_9"] = kst["KSTs_9"] if isinstance(kst, pd.DataFrame) else np.nan
# UO
informative_1h["UO_7_14_28"] = pta.uo(informative_1h["high"], informative_1h["low"], informative_1h["close"])
informative_1h["UO_7_14_28"] = (
(informative_1h["UO_7_14_28"]).astype(np.float64).replace(to_replace=[np.nan, None], value=(50.0))
)
informative_1h["UO_7_14_28_change_pct"] = (
(informative_1h["UO_7_14_28"] - informative_1h["UO_7_14_28"].shift(1))
/ abs(informative_1h["UO_7_14_28"].shift(1))
) * 100.0
# OBV
informative_1h["OBV"] = pta.obv(informative_1h["close"], informative_1h["volume"])
informative_1h["OBV_change_pct"] = (
(informative_1h["OBV"] - informative_1h["OBV"].shift(1)) / abs(informative_1h["OBV"].shift(1))
) * 100.0
# ROC
informative_1h["ROC_2"] = pta.roc(informative_1h["close"], length=2)
informative_1h["ROC_9"] = pta.roc(informative_1h["close"], length=9)
# CCI
informative_1h["CCI_20"] = pta.cci(
informative_1h["high"], informative_1h["low"], informative_1h["close"], length=20
)
informative_1h["CCI_20"] = (
(informative_1h["CCI_20"]).astype(np.float64).replace(to_replace=[np.nan, None], value=(0.0))
)
informative_1h["CCI_20_change_pct"] = (
(informative_1h["CCI_20"] - informative_1h["CCI_20"].shift(1)) / abs(informative_1h["CCI_20"].shift(1))
) * 100.0
# Candle change
informative_1h["change_pct"] = (informative_1h["close"] - informative_1h["open"]) / informative_1h["open"] * 100.0
# 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"])
* 100.0
)
informative_1h["bot_wick_pct"] = abs(
(informative_1h["low"] - np.minimum(informative_1h["open"], informative_1h["close"]))
/ np.minimum(informative_1h["open"], informative_1h["close"])
* 100.0
)
# Max highs
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()
# Min lows
informative_1h["low_min_6"] = informative_1h["low"].rolling(6).min()
informative_1h["low_min_12"] = informative_1h["low"].rolling(12).min()
informative_1h["low_min_24"] = informative_1h["low"].rolling(24).min()
# Performance logging
# -----------------------------------------------------------------------------------------
tok = time.perf_counter()
log.debug(f"[{metadata['pair']}] informative_1h_indicators took: {tok - tik:0.4f} seconds.")
return informative_1h
# Informative 15m Timeframe Indicators
# ---------------------------------------------------------------------------------------------
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
# -----------------------------------------------------------------------------------------
# informative_15m_indicators_pandas_ta = pta.Strategy(
# name="informative_15m_indicators_pandas_ta",
# ta=[
# # RSI
# {"kind": "rsi", "length": 3},
# {"kind": "rsi", "length": 14},
# # {"kind": "rsi", "length": 20},
# # EMA
# {"kind": "ema", "length": 12},
# # {"kind": "ema", "length": 16},
# # {"kind": "ema", "length": 20},
# # {"kind": "ema", "length": 26},
# # {"kind": "ema", "length": 50},
# # {"kind": "ema", "length": 100},
# # {"kind": "ema", "length": 200},
# # SMA
# # {"kind": "sma", "length": 16},
# # BB 20 - STD2
# {"kind": "bbands", "length": 20},
# # Williams %R
# {"kind": "willr", "length": 14},
# # CTI
# {"kind": "cti", "length": 20},
# # STOCHRSI
# {"kind": "stochrsi"},
# # ROC
# {"kind": "roc"},
# # AROON
# {"kind": "aroon"},
# # UO
# {"kind": "uo"},
# # AO
# {"kind": "ao"},
# ],
# )
# informative_15m.ta.study(informative_15m_indicators_pandas_ta, cores=self.num_cores_indicators_calc)
# RSI
informative_15m["RSI_3"] = pta.rsi(informative_15m["close"], length=3)
informative_15m["RSI_14"] = pta.rsi(informative_15m["close"], length=14)
informative_15m["RSI_3_change_pct"] = (
(informative_15m["RSI_3"] - informative_15m["RSI_3"].shift(1)) / (informative_15m["RSI_3"].shift(1))
) * 100.0
informative_15m["RSI_14_change_pct"] = (
(informative_15m["RSI_14"] - informative_15m["RSI_14"].shift(1)) / (informative_15m["RSI_14"].shift(1))
) * 100.0
# EMA
informative_15m["EMA_12"] = pta.ema(informative_15m["close"], length=12)
informative_15m["EMA_20"] = pta.ema(informative_15m["close"], length=20)
informative_15m["EMA_26"] = pta.ema(informative_15m["close"], length=26)
# MFI
informative_15m["MFI_14"] = pta.mfi(
informative_15m["high"], informative_15m["low"], informative_15m["close"], informative_15m["volume"], length=14
)
# CMF
informative_15m["CMF_20"] = pta.cmf(
informative_15m["high"], informative_15m["low"], informative_15m["close"], informative_15m["volume"], length=20
)
# Williams %R
informative_15m["WILLR_14"] = pta.willr(
informative_15m["high"], informative_15m["low"], informative_15m["close"], length=14
)
# AROON
aroon_14 = pta.aroon(informative_15m["high"], informative_15m["low"], length=14)
informative_15m["AROONU_14"] = aroon_14["AROONU_14"] if isinstance(aroon_14, pd.DataFrame) else np.nan
informative_15m["AROOND_14"] = aroon_14["AROOND_14"] if isinstance(aroon_14, pd.DataFrame) else np.nan
# Stochastic
stochrsi = pta.stoch(informative_15m["high"], informative_15m["low"], informative_15m["close"])
informative_15m["STOCHk_14_3_3"] = stochrsi["STOCHk_14_3_3"] if isinstance(stochrsi, pd.DataFrame) else np.nan
informative_15m["STOCHd_14_3_3"] = stochrsi["STOCHd_14_3_3"] if isinstance(stochrsi, pd.DataFrame) else np.nan
# Stochastic RSI
stochrsi = pta.stochrsi(informative_15m["close"])
informative_15m["STOCHRSIk_14_14_3_3"] = (
stochrsi["STOCHRSIk_14_14_3_3"] if isinstance(stochrsi, pd.DataFrame) else np.nan
)
informative_15m["STOCHRSId_14_14_3_3"] = (
stochrsi["STOCHRSId_14_14_3_3"] if isinstance(stochrsi, pd.DataFrame) else np.nan
)
# UO
informative_15m["UO_7_14_28"] = pta.uo(informative_15m["high"], informative_15m["low"], informative_15m["close"])
informative_15m["UO_7_14_28_change_pct"] = (
informative_15m["UO_7_14_28"] - informative_15m["UO_7_14_28"].shift(1)
) * 100.0
# OBV
informative_15m["OBV"] = pta.obv(informative_15m["close"], informative_15m["volume"])
informative_15m["OBV_change_pct"] = (
(informative_15m["OBV"] - informative_15m["OBV"].shift(1)) / abs(informative_15m["OBV"].shift(1))
) * 100.0
# ROC
informative_15m["ROC_9"] = pta.roc(informative_15m["close"], length=9)
# CCI
informative_15m["CCI_20"] = pta.cci(
informative_15m["high"], informative_15m["low"], informative_15m["close"], length=20
)
informative_15m["CCI_20"] = (
(informative_15m["CCI_20"]).astype(np.float64).replace(to_replace=[np.nan, None], value=(0.0))
)
informative_15m["CCI_20_change_pct"] = (
(informative_15m["CCI_20"] - informative_15m["CCI_20"].shift(1)) / abs(informative_15m["CCI_20"].shift(1))
) * 100.0
# Candle change
informative_15m["change_pct"] = (
(informative_15m["close"] - informative_15m["open"]) / informative_15m["open"] * 100.0
)
# 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, df: DataFrame) -> DataFrame:
tik = time.perf_counter()
# Indicators
# base_tf_5m_indicators_pandas_ta = pta.Strategy(
# name="base_tf_5m_indicators_pandas_ta",
# ta=[
# # RSI
# {"kind": "rsi", "length": 3},
# {"kind": "rsi", "length": 4},
# {"kind": "rsi", "length": 14},
# {"kind": "rsi", "length": 20},
# # EMA
# {"kind": "ema", "length": 3},
# {"kind": "ema", "length": 9},
# {"kind": "ema", "length": 12},
# {"kind": "ema", "length": 16},
# {"kind": "ema", "length": 20},
# {"kind": "ema", "length": 26},
# {"kind": "ema", "length": 50},
# {"kind": "ema", "length": 100},
# {"kind": "ema", "length": 200},
# # SMA
# {"kind": "sma", "length": 16},
# {"kind": "sma", "length": 30},
# {"kind": "sma", "length": 75},
# {"kind": "sma", "length": 200},
# # BB 20 - STD2
# {"kind": "bbands", "length": 20},
# # BB 40 - STD2
# {"kind": "bbands", "length": 40},
# # Williams %R
# {"kind": "willr", "length": 14},
# {"kind": "willr", "length": 480},
# # CTI
# {"kind": "cti", "length": 20},
# # MFI
# {"kind": "mfi"},
# # CMF
# {"kind": "cmf"},
# # CCI
# {"kind": "cci", "length": 20},
# # Hull Moving Average
# {"kind": "hma", "length": 55},
# {"kind": "hma", "length": 70},
# # ZL MA
# # {"kind": "zlma", "length": 50, "mamode":"linreg"},
# # Heiken Ashi
# # {"kind": "ha"},
# # STOCHRSI
# {"kind": "stochrsi"},
# # KST
# {"kind": "kst"},
# # ROC
# {"kind": "roc"},
# # AROON
# {"kind": "aroon"},
# # UO
# {"kind": "uo"},
# # AO
# {"kind": "ao"},
# # OBV
# {"kind": "obv"},
# ],
# )
# df.ta.study(base_tf_5m_indicators_pandas_ta, cores=self.num_cores_indicators_calc)
# RSI
df["RSI_3"] = pta.rsi(df["close"], length=3)
df["RSI_4"] = pta.rsi(df["close"], length=4)
df["RSI_14"] = pta.rsi(df["close"], length=14)
df["RSI_20"] = pta.rsi(df["close"], length=20)
df["RSI_3_change_pct"] = ((df["RSI_3"] - df["RSI_3"].shift(1)) / (df["RSI_3"].shift(1))) * 100.0
df["RSI_14_change_pct"] = ((df["RSI_14"] - df["RSI_14"].shift(1)) / (df["RSI_14"].shift(1))) * 100.0
# EMA
df["EMA_3"] = pta.ema(df["close"], length=3)
df["EMA_9"] = pta.ema(df["close"], length=9)
df["EMA_12"] = pta.ema(df["close"], length=12)
df["EMA_16"] = pta.ema(df["close"], length=16)
df["EMA_20"] = pta.ema(df["close"], length=20)
df["EMA_26"] = pta.ema(df["close"], length=26)
df["EMA_50"] = pta.ema(df["close"], length=50)
df["EMA_100"] = pta.ema(df["close"], length=100, fillna=0.0)
df["EMA_200"] = pta.ema(df["close"], length=200, fillna=0.0)
# SMA
df["SMA_9"] = pta.sma(df["close"], length=9)
df["SMA_16"] = pta.sma(df["close"], length=16)
df["SMA_21"] = pta.sma(df["close"], length=21)
df["SMA_30"] = pta.sma(df["close"], length=30)
df["SMA_200"] = pta.sma(df["close"], length=200)
# BB 20 - STD2
bbands_20_2 = pta.bbands(df["close"], length=20)
df["BBL_20_2.0"] = bbands_20_2["BBL_20_2.0"] if isinstance(bbands_20_2, pd.DataFrame) else np.nan
df["BBM_20_2.0"] = bbands_20_2["BBM_20_2.0"] if isinstance(bbands_20_2, pd.DataFrame) else np.nan
df["BBU_20_2.0"] = bbands_20_2["BBU_20_2.0"] if isinstance(bbands_20_2, pd.DataFrame) else np.nan
df["BBB_20_2.0"] = bbands_20_2["BBB_20_2.0"] if isinstance(bbands_20_2, pd.DataFrame) else np.nan
df["BBP_20_2.0"] = bbands_20_2["BBP_20_2.0"] if isinstance(bbands_20_2, pd.DataFrame) else np.nan
# MFI
df["MFI_14"] = pta.mfi(df["high"], df["low"], df["close"], df["volume"], length=14)
# CMF
df["CMF_20"] = pta.cmf(df["high"], df["low"], df["close"], df["volume"], length=20)
# Williams %R
df["WILLR_14"] = pta.willr(df["high"], df["low"], df["close"], length=14)
df["WILLR_480"] = pta.willr(df["high"], df["low"], df["close"], length=480)
# AROON
aroon_14 = pta.aroon(df["high"], df["low"], length=14)
df["AROONU_14"] = aroon_14["AROONU_14"] if isinstance(aroon_14, pd.DataFrame) else np.nan
df["AROOND_14"] = aroon_14["AROOND_14"] if isinstance(aroon_14, pd.DataFrame) else np.nan
# Stochastic RSI
stochrsi = pta.stochrsi(df["close"])
df["STOCHRSIk_14_14_3_3"] = stochrsi["STOCHRSIk_14_14_3_3"] if isinstance(stochrsi, pd.DataFrame) else np.nan
df["STOCHRSId_14_14_3_3"] = stochrsi["STOCHRSId_14_14_3_3"] if isinstance(stochrsi, pd.DataFrame) else np.nan
# KST
kst = pta.kst(df["close"])
df["KST_10_15_20_30_10_10_10_15"] = kst["KST_10_15_20_30_10_10_10_15"] if isinstance(kst, pd.DataFrame) else np.nan
df["KSTs_9"] = kst["KSTs_9"] if isinstance(kst, pd.DataFrame) else np.nan
# OBV
df["OBV"] = pta.obv(df["close"], df["volume"])
df["OBV_change_pct"] = ((df["OBV"] - df["OBV"].shift(1)) / abs(df["OBV"].shift(1))) * 100.0
# ROC
df["ROC_2"] = pta.roc(df["close"], length=2)
df["ROC_9"] = pta.roc(df["close"], length=9)
# Candle change
df["change_pct"] = (df["close"] - df["open"]) / df["open"] * 100.0
# Close max
df["close_max_12"] = df["close"].rolling(12).max()
df["close_max_48"] = df["close"].rolling(48).max()
# Close min
df["close_min_12"] = df["close"].rolling(12).min()
df["close_min_48"] = df["close"].rolling(48).min()
# Number of empty candles
df["num_empty_288"] = (df["volume"] <= 0).rolling(window=288, min_periods=288).sum()
# -----------------------------------------------------------------------------------------
# Global protections
# -----------------------------------------------------------------------------------------
if not self.config["runmode"].value in ("live", "dry_run"):
# Backtest age filter
df["bt_agefilter_ok"] = False
df.loc[df.index > (12 * 24 * self.bt_min_age_days), "bt_agefilter_ok"] = True
else:
# Exchange downtime protection
df["live_data_ok"] = df["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 df
# 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_indicators_pandas_ta = pta.Strategy(
# name="btc_info_1d_indicators_pandas_ta",
# ta=[
# # RSI
# # {"kind": "rsi", "length": 3},
# {"kind": "rsi", "length": 14},
# # {"kind": "rsi", "length": 20},
# # EMA
# # {"kind": "ema", "length": 12},
# # {"kind": "ema", "length": 16},
# # {"kind": "ema", "length": 20},
# # {"kind": "ema", "length": 26},
# # {"kind": "ema", "length": 50},
# # {"kind": "ema", "length": 100},
# # {"kind": "ema", "length": 200},
# # SMA
# # {"kind": "sma", "length": 16},
# ],
# )
# btc_info_1d.ta.study(btc_info_1d_indicators_pandas_ta, cores=self.num_cores_indicators_calc)
# 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
# -----------------------------------------------------------------------------------------
# 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
# -----------------------------------------------------------------------------------------
# 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
# -----------------------------------------------------------------------------------------
# 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
# -----------------------------------------------------------------------------------------
# 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.")
# Populate Indicators
# ---------------------------------------------------------------------------------------------
def populate_indicators(self, df: DataFrame, metadata: dict) -> DataFrame:
tik = time.perf_counter()
"""
--> BTC informative indicators
___________________________________________________________________________________________
"""
if self.config["stake_currency"] in [
"USDT",
"BUSD",
"USDC",
"DAI",
"TUSD",
"FDUSD",
"PAX",
"USD",
"EUR",
"GBP",
"TRY",
]:
if ("trading_mode" in self.config) and (self.config["trading_mode"] in ["futures", "margin"]):
btc_info_pair = f"BTC/{self.config['stake_currency']}:{self.config['stake_currency']}"
else:
btc_info_pair = f"BTC/{self.config['stake_currency']}"
else:
if ("trading_mode" in self.config) and (self.config["trading_mode"] in ["futures", "margin"]):
btc_info_pair = "BTC/USDT:USDT"
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)
df = merge_informative_pair(df, 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}")
df.drop(columns=df.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)
df = merge_informative_pair(df, 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", "high", "low", "volume"]],
}.get(info_timeframe, [f"{s}_{info_timeframe}" for s in ["date", "open", "high", "low", "close", "volume"]])
df.drop(columns=df.columns.intersection(drop_columns), inplace=True)
"""
--> The indicators for the base timeframe (5m)
___________________________________________________________________________________________
"""
df = self.base_tf_5m_indicators(metadata, df)
# df["zlma_50_1h"] = df["zlma_50_1h"].astype(np.float64).replace(to_replace=[np.nan, None], value=(0.0))
# df["CTI_20_1d"] = df["CTI_20_1d"].astype(np.float64).replace(to_replace=[np.nan, None], value=(0.0))
# df["WILLR_480_1h"] = df["WILLR_480_1h"].astype(np.float64).replace(to_replace=[np.nan, None], value=(-50.0))
# df["WILLR_480_4h"] = df["WILLR_480_4h"].astype(np.float64).replace(to_replace=[np.nan, None], value=(-50.0))
# df["RSI_14_1d"] = df["RSI_14_1d"].astype(np.float64).replace(to_replace=[np.nan, None], value=(50.0))
df["RSI_14_1h"] = df["RSI_14_1h"].astype(np.float64).replace(to_replace=[np.nan, None], value=(50.0))
# Global protections Long
df["protections_long_global"] = (
# 5m & 15m & 1h & 4h & 1d down move, 1h & 4h & 1d still not low enough
(
(df["RSI_3"] > 1.0)
| (df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 20.0)
| (df["RSI_3_1d"] > 20.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["RSI_14_1d"] < 30.0)
| (df["CCI_20_1h"] < -250.0)
| (df["CCI_20_4h"] < -200.0)
)
# 5m & 4h & 1d down move, 15m & 1h & 4h still not low enough, 1d still high
& (
(df["RSI_3"] > 1.0)
| (df["RSI_3_4h"] > 10.0)
| (df["RSI_3_1d"] > 35.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_1d"] < 50.0)
)
# 5m down move, 15m & 1h & 4h still high, 15m high
& (
(df["RSI_3"] > 3.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 70.0)
)
# 1h & 4h down move, 15m & 1h & 4h downtrend, 1h still high
& (
(df["RSI_3"] > 5.0)
| (df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 55.0)
| (df["CMF_20_15m"] > -0.25)
| (df["AROONU_14_4h"] < 60.0)
| (df["ROC_9_1d"] < 80.0)
)
# 5m & 15m & 1h down move, 1h & 4h still high, 15m still high, 1h high
& (
(df["RSI_3"] > 5.0)
| (df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 40.0)
| (df["AROONU_14_1h"] < 85.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 5m & 15m & 1h & 4h down move, 4h high
& (
(df["RSI_3"] > 5.0)
| (df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 5m & 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 15m & 4h high
& (
(df["RSI_3"] > 5.0)
| (df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
)
# 5m & 15m & 4h down move, 15m & 1h & 4h still high, 15m & 1h still high
& (
(df["RSI_3"] > 5.0)
| (df["RSI_3_15m"] > 30.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 5m & 4h & 1d down move, 15m high
& (
(df["RSI_3"] > 5.0)
| (df["RSI_3_4h"] > 10.0)
| (df["RSI_3_1d"] > 15.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 70.0)
)
# 5m & 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h stil high, 15m & 4h high
& (
(df["RSI_3"] > 10.0)
| (df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 5m & 15m & 1h & 4h down move, 15m & 1h & 4h still high, 15m & 4h high
& (
(df["RSI_3"] > 10.0)
| (df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
)
# 5m & 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 15m high
& (
(df["RSI_3"] > 10.0)
| (df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 60.0)
)
# 5m & 15m & 1h down move, 15m & 1h still high, 4h high, 15m still not low enough, 5h overbought
& (
(df["RSI_3"] > 10.0)
| (df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_1h"] < 20.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
| (df["ROC_9_4h"] < 80.0)
)
# 5m & 15m & 1h & 1d down move, 1h & 4h still high, 1d downtrend
& (
(df["RSI_3"] > 10.0)
| (df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 65.0)
| (df["RSI_3_1d"] > 25.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_1d"] > -0.20)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
| (df["ROC_9_1d"] > -15.0)
)
# 5m & 15m & 4h down move, 15m & 1h still not low enough, 4h still high, 15m & 4h high
& (
(df["RSI_3"] > 10.0)
| (df["RSI_3_15m"] > 25.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 60.0)
)
# 5m & 15m & 1h down move, 15m still not low enough, 1h still high, 4h high, 15m & 4h high
& (
(df["RSI_3"] > 10.0)
| (df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 5m & 15m & 1h down move, 15m still high, 1h & 4h high, 4h high & overbought
& (
(df["RSI_3"] > 15.0)
| (df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 60.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_15m"] < 40.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
| (df["ROC_9_4h"] < 30.0)
)
# 15m & 1h & 4h down move, 1h still high, 15m & 1h downtrend
& (
(df["RSI_3_15m"] > 3.0)
| (df["RSI_3_1h"] > 3.0)
| (df["RSI_3_4h"] > 20.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["ROC_9_15m"] > -10.0)
| (df["ROC_9_1h"] > -15.0)
)
# 15m & 1h & 4h down move, 15m downtrend, 1h still high, 4h still not low enough
& (
(df["RSI_3_15m"] > 3.0)
| (df["RSI_3_1h"] > 5.0)
| (df["RSI_3_4h"] > 30.0)
| (df["CMF_20_15m"] > -0.20)
| (df["AROONU_14_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 15m & 1h & 4h down move, 15m downtrend, 1h & 4h still not low enough
& (
(df["RSI_3_15m"] > 3.0)
| (df["RSI_3_1h"] > 10.0)
| (df["RSI_3_4h"] > 15.0)
| (df["CMF_20_15m"] > -0.30)
| (df["AROONU_14_1h"] < 20.0)
| (df["AROONU_14_4h"] < 20.0)
)
# 15m & 1h & 4h down move, 15m downtrend, 15m & 1h still not low enough
& (
(df["RSI_3_15m"] > 3.0)
| (df["RSI_3_1h"] > 10.0)
| (df["RSI_3_4h"] > 15.0)
| (df["CMF_20_15m"] > -0.30)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
)
# 15m & 1h & 4h down move, 1h & 4h still high, 15m downtrend, 4h overbought
& (
(df["RSI_3_15m"] > 3.0)
| (df["RSI_3_1h"] > 10.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_15m"] > -0.20)
| (df["ROC_9_4h"] < 15.0)
)
# 15m & 1h & 4h down move, 15m & 1h downtrend, 1h & 4h still not low enough
& (
(df["RSI_3_15m"] > 3.0)
| (df["RSI_3_1h"] > 10.0)
| (df["RSI_3_4h"] > 40.0)
| (df["CMF_20_15m"] > -0.20)
| (df["CMF_20_1h"] > -0.20)
| (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 15m & 1h & 4h down move, 4h still high, 1h downtrend, 4h still high
& (
(df["RSI_3_15m"] > 3.0)
| (df["RSI_3_1h"] > 10.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_1h"] > -0.30)
| (df["AROONU_14_4h"] < 40.0)
)
# 15m & 1h & 4h down move, 1h & 4h still not low enough, 15m downtrend
& (
(df["RSI_3_15m"] > 3.0)
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_15m"] > -0.25)
| (df["AROONU_14_4h"] < 25.0)
)
# 15m & 1h & 4h down move, 1h & 4h still not low enough, 15m still not low enough
& (
(df["RSI_3_15m"] > 3.0)
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["AROONU_14_15m"] < 25.0)
)
# 15m & 1h & 4h down move, 1h & 4h still not low enough, 15m & 1h & 4h downtrend, 1h still not low enough
& (
(df["RSI_3_15m"] > 3.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 20.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 20.0)
| (df["CMF_20_15m"] > -0.20)
| (df["CMF_20_1h"] > -0.25)
| (df["CMF_20_4h"] > -0.25)
| (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
)
# 15m & 1h & 4h & 1d down move, 1h still high, 1h & 4h still not low enough
& (
(df["RSI_3_15m"] > 3.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_3_1d"] > 50.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["CCI_20_1h"] < -250.0)
| (df["CCI_20_4h"] < -250.0)
)
# 15m & 1h & 4h down move, 4h downtrend, 15m & 1h still not low enough
& (
(df["RSI_3_15m"] > 3.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_3_4h"] > 50.0)
| (df["CMF_20_4h"] > -0.30)
| (df["AROONU_14_15m"] < 20.0)
| (df["AROONU_14_1h"] < 30.0)
)
# 15m & 4h down move, 15m & 1h & 4h still not low enough, 1h still not low enough
& (
(df["RSI_3_15m"] > 3.0)
| (df["RSI_3_4h"] > 10.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
)
# 15m & 4h down move, 1h & 4h still high, 15m still not low enough, 1h still high
& (
(df["RSI_3_15m"] > 3.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 25.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m down move, 15m & 1h high
& (
(df["RSI_3_15m"] > 3.0)
| (df["AROONU_14_15m"] < 70.0)
| (df["AROONU_14_1h"] < 90.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 90.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h downtrend, 1h & 4h still not low enough, 4h downtrend
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 5.0)
| (df["RSI_3_4h"] > 20.0)
| (df["CMF_20_15m"] > -0.15)
| (df["CMF_20_1h"] > -0.15)
| (df["CMF_20_4h"] > -0.15)
| (df["AROONU_14_1h"] < 20.0)
| (df["AROONU_14_4h"] < 20.0)
| (df["ROC_9_4h"] > -20.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h downtrend, 1h still high, 15m still not low enough, 15m & 1h downtrend
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 5.0)
| (df["RSI_3_4h"] > 20.0)
| (df["CMF_20_15m"] > -0.20)
| (df["CMF_20_1h"] > -0.15)
| (df["CMF_20_4h"] > -0.10)
| (df["AROONU_14_1h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
| (df["ROC_9_15m"] > -15.0)
| (df["ROC_9_1h"] > -15.0)
)
# 15m & 1h & 4h down move, 15m & 1h downtrend, 15m & 4h still not low enough
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 5.0)
| (df["RSI_3_4h"] > 20.0)
| (df["CMF_20_15m"] > -0.20)
| (df["CMF_20_1h"] > -0.25)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 20.0)
)
# 15m & 1h & 4h down move, 15m & 1h downtrend, 15m still not low enough
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 5.0)
| (df["RSI_3_4h"] > 20.0)
| (df["CMF_20_15m"] > -0.40)
| (df["CMF_20_1h"] > -0.40)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
)
# 5m & 1h & 4h down move, 1h & 4h downtrend, 15m still high, 4h still not low enough
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 5.0)
| (df["RSI_3_4h"] > 20.0)
| (df["CMF_20_1h"] > -0.20)
| (df["CMF_20_4h"] > -0.25)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 10.0)
)
# 15m & 1h & 4h & 1d down move, 15m downtrend, 15m still not low enough, 1h downtrend
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 5.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_3_1d"] > 30.0)
| (df["CMF_20_15m"] > -0.20)
| (df["STOCHRSIk_14_14_3_3_15m"] < 10.0)
| (df["ROC_9_1h"] > -10.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h downtrend, 15m still not low enough
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 5.0)
| (df["RSI_3_4h"] > 25.0)
| (df["CMF_20_15m"] > -0.30)
| (df["CMF_20_1h"] > -0.30)
| (df["CMF_20_4h"] > -0.30)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
)
# 15m & 1h & 4h down move, 15m & 1h downtrend, 15m still high
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 5.0)
| (df["RSI_3_4h"] > 25.0)
| (df["CMF_20_15m"] > -0.20)
| (df["CMF_20_1h"] > -0.20)
| (df["AROONU_14_15m"] < 50.0)
)
# 15m & 1h & 4h & 1d down move, 15m downtrend, 1d overbought
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 5.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_3_1d"] > 40.0)
| (df["CMF_20_15m"] > -0.30)
| (df["ROC_9_1d"] < 100.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h downtrend, 15m & 4h still not low enough
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 5.0)
| (df["RSI_3_4h"] > 30.0)
| (df["CMF_20_15m"] > -0.15)
| (df["CMF_20_1h"] > -0.15)
| (df["CMF_20_4h"] > -0.20)
| (df["STOCHRSIk_14_14_3_3_15m"] < 10.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 20.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h downtrend, 1h still not low enugh, 4h still high
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 5.0)
| (df["RSI_3_4h"] > 40.0)
| (df["CMF_20_15m"] > -0.10)
| (df["CMF_20_1h"] > -0.20)
| (df["CMF_20_4h"] > -0.30)
| (df["AROONU_14_1h"] < 30.0)
| (df["AROONU_14_4h"] < 50.0)
)
# 15m & 1h & 4h down move, 15m & 1h downtrend, 4h still high
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 5.0)
| (df["RSI_14_1h"] < 20.0)
| (df["CMF_20_15m"] > -0.25)
| (df["CMF_20_1h"] > -0.40)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m & 1h & 4h down move, 15m & 1h downtrend, 1h still high
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 10.0)
| (df["RSI_3_4h"] > 30.0)
| (df["CMF_20_15m"] > -0.30)
| (df["CMF_20_1h"] > -0.30)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 1h & 4h & 1d down move, 15m downtrend, 1h still high, 1h & 4h still not low enough, 4h overbought
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 10.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_3_1d"] > 55.0)
| (df["CMF_20_15m"] > -0.30)
| (df["AROONU_14_1h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 20.0)
| (df["ROC_9_4h"] < 10.0)
)
# 15m & 1h down move, 1h & 4h still not low enough, 4h high
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 10.0)
| (df["AROONU_14_1h"] < 20.0)
| (df["AROONU_14_4h"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m & 1h & 4h down move, 1h & 4h still not low enough, 15m & 1h & 4h downtrend
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_15m"] > -0.25)
| (df["CMF_20_1h"] > -0.25)
| (df["CMF_20_4h"] > -0.15)
)
# 15m & 1h & 4h down move, 1h & 4h stil not low enough, 15m & 1h & 4h downtrend, 1h still high
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_15m"] > -0.20)
| (df["CMF_20_1h"] > -0.20)
| (df["CMF_20_4h"] > -0.20)
| (df["AROONU_14_1h"] < 50.0)
)
# 15m & 1h & 4h down move, 1h & 4h still not low enough, 15m & 4h still not low enough, 15m & 4h still not low
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_15m"] > -0.10)
| (df["CMF_20_4h"] > -0.20)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 15m & 1h & 4h down move, 1h & 4h still not low enough, 15m still high
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 50.0)
)
# 15m & 1h down move, 1h high, 4h high
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 15.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
)
# 15m & 1h & 4h down move, 1h still not low enough, 4h still high, 15m still not low enough, 1d high & overbought
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_1d"] < 90.0)
| (df["ROC_9_1d"] < 80.0)
)
# 15m & 1h & 4h down move, 15m downtrend, 1h still high, 15m still not low enough
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 40.0)
| (df["CMF_20_15m"] > -0.30)
| (df["AROONU_14_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
)
# 15m & 1h down move, 1h & 4h high
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 100.0)
)
# 15m & 1h & 4h & 1d down move, 15m downtrend
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_3_1d"] > 5.0)
| (df["CMF_20_15m"] > -0.40)
)
# 15m & 1h down move, 15m still not low enough, 1h still high, 4h high, 15m still high, 4h overbought
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["ROC_9_4h"] < 25.0)
)
# 15m & 1h & 4h down move, 15m downtrend, 4h high
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 25.0)
| (df["CMF_20_15m"] > -0.30)
| (df["AROONU_14_4h"] < 80.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 4h downtrend, 4h high
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_4h"] > -0.20)
| (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 15m & 1h & 4h down move, 1h high, 4h downtrend
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 40.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["ROC_9_4h"] > -40.0)
)
# 15m & 1h & 4h down move, 1h & 4h still high, 15m downtrend
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_15m"] > -0.25)
| (df["AROONU_14_4h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h high, 1h high, 4h overbought
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["ROC_9_4h"] < 10.0)
)
# 15m & 1h & 4h down move, 15m & 1h still not low enough, 4h still high, 1h & 4h still high, 15m still high
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_1h"] < 40.0)
| (df["AROONU_14_4h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
)
# 15m & 1h & 4h down move, 1h & 4h still high, 4h high
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
)
# 15m & 1h & 3h down move, 1h & 4h still not low enough, 15m downtrend, 1h still high
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_15m"] > -0.30)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 1h & 4h down move, 1h & 4h still high, 1d overbought
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 50.0)
| (df["ROC_9_1d"] < 70.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 1h high, 1d overbought
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
| (df["ROC_9_1d"] < 60.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 15m still not low enough
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 60.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 10.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["AROONU_14_15m"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h high, 1h & 4h overbought
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 60.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 60.0)
| (df["RSI_14_4h"] < 80.0)
| (df["AROONU_14_1h"] < 75.0)
| (df["AROONU_14_4h"] < 90.0)
| (df["ROC_9_1h"] < 10.0)
| (df["ROC_9_4h"] < 10.0)
)
# 15m & 1h & 4h down move, 1h & 4h still high, 15m downtrend, 1h still high
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 65.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_15m"] > -0.40)
| (df["AROONU_14_1h"] < 50.0)
)
# 15m & 4h down move, 15m & 1h still not low enough, 4h still high, 1h & 4h still not low enough, 1d overbought
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_4h"] > 20.0)
| (df["RSI_14_15m"] < 10.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_1h"] < 20.0)
| (df["AROONU_14_4h"] < 20.0)
| (df["ROC_9_1d"] < 20.0)
)
# 15m down move, 15m still not low enough, 1h & 4h high, 1h overbought
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 60.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_1h"] < 10.0)
)
# 15m down move, 15m still not low enough, 1h & 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 60.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
| (df["ROC_9_4h"] < 10.0)
)
# 15m & 1h & 4h down move, 1h & 4h still not low enough, 15m & 1h & 4h downtrend, 1h & 4h downtrend
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 10.0)
| (df["RSI_3_4h"] > 10.0)
| (df["RSI_14_1h"] < 10.0)
| (df["RSI_14_4h"] < 20.0)
| (df["CMF_20_15m"] > -0.15)
| (df["CMF_20_1h"] > -0.15)
| (df["CMF_20_4h"] > -0.15)
| (df["ROC_9_1h"] > -20.0)
| (df["ROC_9_4h"] > -20.0)
)
# 15m & 1h & 4h down move, 4h still high, 15m & 1h & 4h downtrend
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 10.0)
| (df["RSI_3_4h"] > 15.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_15m"] > -0.20)
| (df["CMF_20_1h"] > -0.20)
| (df["CMF_20_4h"] > -0.20)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h downtrend, 4h still high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 10.0)
| (df["RSI_3_4h"] > 15.0)
| (df["CMF_20_15m"] > -0.25)
| (df["CMF_20_1h"] > -0.15)
| (df["CMF_20_4h"] > -0.15)
| (df["AROONU_14_4h"] < 40.0)
)
# 15m & 1h & 4h down move, 15m & 1h downtrend, 15m still high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 10.0)
| (df["RSI_3_4h"] > 15.0)
| (df["CMF_20_15m"] > -0.30)
| (df["CMF_20_1h"] > -0.40)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
)
# 15m & 1h & 4h down move, 1h & 4h downtrend, 1h still high, 1h downtrend
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 10.0)
| (df["RSI_3_4h"] > 15.0)
| (df["CMF_20_1h"] > -0.30)
| (df["CMF_20_4h"] > -0.30)
| (df["AROONU_14_1h"] < 50.0)
| (df["ROC_9_1h"] > -15.0)
)
# 15m & 1h & 4h down move, 1h & 4h still not low enough, 15m still high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 10.0)
| (df["RSI_3_4h"] > 15.0)
| (df["AROONU_14_1h"] < 30.0)
| (df["AROONU_14_4h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 40.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h downtrend, 15m still high, 4h still not low enough
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 10.0)
| (df["RSI_3_4h"] > 20.0)
| (df["CMF_20_15m"] > -0.20)
| (df["CMF_20_1h"] > -0.25)
| (df["CMF_20_4h"] > -0.25)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 20.0)
)
# 15m & 1h & 4h down move, 1h & 15m still high, 1h downtrend
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 10.0)
| (df["RSI_3_4h"] > 20.0)
| (df["AROONU_14_1h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["ROC_9_1h"] > -10.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h downtrend, 4h high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 10.0)
| (df["RSI_3_4h"] > 25.0)
| (df["CMF_20_15m"] > -0.20)
| (df["CMF_20_1h"] > -0.20)
| (df["CMF_20_4h"] > -0.20)
| (df["AROONU_14_4h"] < 70.0)
)
# 15m & 1h & 4h down move, 4h still not low enough, 1h still high, 4h high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 10.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_14_4h"] < 30.0)
| (df["AROONU_14_1h"] < 40.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 15m & 1h downtrend, 15m still not low enough
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 10.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_14_15m"] < 10.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_15m"] > -0.20)
| (df["CMF_20_1h"] > -0.15)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 15m & 1h downtrend, 4h still high, 4h downtrend
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 10.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_15m"] > -0.15)
| (df["CMF_20_1h"] > -0.25)
| (df["AROONU_14_4h"] < 40.0)
| (df["ROC_9_4h"] > -20.0)
)
# 15m & 1h & 4h down move, 15m & 1h still not low enough, 4h still high, 15m & 1h downtrend
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 10.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["ROC_9_15m"] > -10.0)
| (df["ROC_9_1h"] > -20.0)
)
# 15m & 1h & 4h down move, 15m & 1h still not low enough, 4h still high, 1d overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 10.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["ROC_9_1d"] < 200.0)
)
# 15m & 1h down move, 1h still high, 4h high & overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 10.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 80.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
| (df["ROC_9_4h"] < 80.0)
)
# 15m & 1h & 4h down move, 15m & 1h still not low enough, 4h still high, 4h overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 20.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_4h"] < 50.0)
| (df["ROC_9_4h"] < 40.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 15m & 1h downtrend, 15m still not low enough
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_15m"] > -0.25)
| (df["CMF_20_1h"] > -0.25)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 15m & 1h & 4h downtrend, 1h still not low enough
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_15m"] > -0.25)
| (df["CMF_20_1h"] > -0.25)
| (df["CMF_20_4h"] > -0.25)
| (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
)
# 15m & 1h & 4h down move, 1h still not low enough, 4h high, 1d overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 60.0)
| (df["ROC_9_1d"] < 200.0)
)
# 15m & 1h & 4h down move, 1h downtrend, 4h high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_1h"] > -0.4)
| (df["AROONU_14_4h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 15m & 1h & 4h down move, 1h & 4h still not low enough, 1h & 4h downtrend, 15m & 1h & 4h still not low enough
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 20.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 20.0)
| (df["CMF_20_1h"] > -0.15)
| (df["CMF_20_4h"] > -0.20)
| (df["AROONU_14_15m"] < 25.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h downtrend, 15m still high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 20.0)
| (df["CMF_20_15m"] > -0.20)
| (df["CMF_20_1h"] > -0.30)
| (df["CMF_20_4h"] > -0.30)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
)
# 15m & 1h & 4h down move, 1h still not low enough, 4h still high, 1h downtrend, 1d overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 20.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_1h"] > -0.25)
| (df["AROONU_14_4h"] < 50.0)
| (df["CCI_20_1h"] < -200.0)
| (df["CCI_20_4h"] < -0.0)
| (df["ROC_9_1d"] < 30.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 25.0)
| (df["AROONU_14_15m"] < 30.0)
| (df["AROONU_14_1h"] < 60.0)
| (df["AROONU_14_4h"] < 100.0)
)
# 15m & 1h & 4h & 1d down move, 1h still not low enough, 4h still high, 1d overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_3_1d"] > 45.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["ROC_9_1d"] < 50.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 4h overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
| (df["ROC_9_4h"] < 10.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 1h high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 30.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m & 1h & 4h down move, 15m & 1h still not low enough, 4h stil high, 1h & 4h downtrend, 1h & 4h still not low
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 10.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_1h"] > -0.20)
| (df["CMF_20_4h"] > -0.30)
| (df["AROONU_14_1h"] < 30.0)
| (df["AROONU_14_4h"] < 30.0)
)
# 15m & 1h & 4h down move, 15m & 1h still not low enough, 1h & 4h still high, 1d overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
| (df["ROC_9_1d"] < 100.0)
)
# 15m & 1h down move, 15m still not low enough, 1h still high, 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
| (df["ROC_9_4h"] < 25.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h high, 1h & 1d overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_4h"] < 10.0)
| (df["ROC_9_1d"] < 20.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 1h & 4h downtrend, 1h & 4h still high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 20.0)
| (df["CMF_20_1h"] > -0.15)
| (df["CMF_20_4h"] > -0.20)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
)
# 15m & 1h & 4h down move, 15m & 1h still not low, 4h still high, 15m & 1h downtrend, 4h not low, 4h downtrend
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_15m"] > -0.10)
| (df["CMF_20_1h"] > -0.20)
| (df["AROONU_14_4h"] < 20.0)
| (df["ROC_9_4h"] > -10.0)
)
# 15m & 1h & 4h down move, 1h & 4h not low enouhg, 15m downtrend, 4h high, 1d overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_15m"] > -0.30)
| (df["AROONU_14_4h"] < 60.0)
| (df["ROC_9_1d"] < 25.0)
)
# 15m & 1h & 4h & 1d down move, 15m & 1h still not low enough, 4h still high. 1d high & overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_3_1d"] > 60.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_1d"] < 70.0)
| (df["ROC_9_1d"] < 80.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h downtrend, 1h & 4h still not low enough, 1h & 4h downtrend
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 25.0)
| (df["CMF_20_15m"] > -0.20)
| (df["CMF_20_1h"] > -0.20)
| (df["CMF_20_4h"] > -0.20)
| (df["AROONU_14_1h"] < 25.0)
| (df["AROONU_14_4h"] < 25.0)
| (df["ROC_9_1h"] > -10.0)
| (df["ROC_9_4h"] > -30.0)
)
# 15m & 1h & 1d down move, 1h still not low enough, 4h high & overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_1d"] > 25.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_1h"] < 40.0)
| (df["AROONU_14_4h"] < 90.0)
| (df["ROC_9_1h"] > -20.0)
| (df["ROC_9_4h"] < 30.0)
)
# 15m & 1h & 1d down move, 15m still not low enough, 1h & 4h still high, 1h high, 4h overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_1d"] > 30.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 30.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["ROC_9_4h"] < 10.0)
)
# 15m & 1h & 4h down move, 15m & 1h still not low enough, 4h still high, 15m & 1h downtrend
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_15m"] > -0.30)
| (df["CMF_20_1h"] > -0.25)
)
# 15m & 1h & 4h down move, 1h & 4h still high, 4h high, 4h & 1d overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_1h"] < 45.0)
| (df["RSI_14_4h"] < 55.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["ROC_9_4h"] < 25.0)
| (df["ROC_9_1d"] < 50.0)
)
# 15m & 1h & 4h down move, 1h & 4h still high, 15m downtrend, 4h high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_15m"] > -0.25)
| (df["AROONU_14_4h"] < 80.0)
)
# 15m & 1h down move, 4h high, 1d downtrend, 1h still not low enough, 1d overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_14_4h"] < 70.0)
| (df["CMF_20_1d"] > -0.3)
| (df["AROONU_14_1h"] < 30.0)
| (df["ROC_9_1d"] < 100.0)
)
# 15m & 1h & 4h & 1d down move, 15m & 1h not low enough, 4h high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_3_1d"] > 15.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 35.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 85.0)
)
# 15m & 1h & 4h & 1d down move, 15m & 1 & 4h still not low enough, 1h still high, 4h high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_3_1d"] > 35.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 60.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h still high, 4h high & overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["ROC_9_4h"] < 80.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 1h still high, 4h high & overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_4h"] < 25.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 15m & 1h & 4h downtrend, 1h still high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_15m"] > -0.30)
| (df["CMF_20_1h"] > -0.10)
| (df["CMF_20_4h"] > -0.10)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 1h & 4h still high, 1d downtrend
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["AROONU_14_15m"] < 10.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
| (df["ROC_9_1d"] > -50.0)
)
# 15m & 1h down move, 4h still high, 15m downtrend, 1h & 1d high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_15m"] > -0.3)
| (df["AROONU_14_1h"] < 60.0)
| (df["AROONU_14_1d"] < 90.0)
| (df["STOCHRSIk_14_14_3_3_1d"] < 80.0)
)
# 15m & 1h down move, 15m & 1h still high, 1h & 4h high, 1d overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_1d"] < 50.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 1h & 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_4h"] < 25.0)
)
# 15m & 1h & 4h down move, 1h & 4h sitll high, 15m & 1h & 4h downtrend, 1h & 4h still high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_15m"] > -0.20)
| (df["CMF_20_1h"] > -0.20)
| (df["CMF_20_4h"] > -0.25)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
)
# 15m & 1h & 4h down move, 15m stil not low enough, 1h & 4h still high, 15m & 4h still high, 1d overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_4h"] < 50.0)
| (df["ROC_9_1d"] < 200.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 1h & 4h downtrend, 1h high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_1h"] > -0.10)
| (df["CMF_20_4h"] > -0.25)
| (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 15m & 1h & 4h down move, 1h & 4h still not low enough, 15m & 4h downtrend, 1h & 4h still high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_15m"] > -0.40)
| (df["CMF_20_4h"] > -0.20)
| (df["AROONU_14_1h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 14h & 1d overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["ROC_9_4h"] < 20.0)
| (df["ROC_9_1d"] < 80.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_15m"] < 20.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_4h"] < 30.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h high & overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 70.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_1h"] < 60.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_1h"] < 20.0)
| (df["ROC_9_4h"] < 50.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 1h & 4h downtrend, 4h high, 1h overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_1h"] > -0.10)
| (df["CMF_20_4h"] > -0.10)
| (df["AROONU_14_4h"] < 80.0)
| (df["ROC_9_1h"] < 10.0)
)
# 15m & 1h & 4h down move, 1h & 4h downtrend, 15m still high, 1h high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_3_4h"] > 55.0)
| (df["CMF_20_1h"] > -0.0)
| (df["CMF_20_4h"] > -0.4)
| (df["AROONU_14_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 90.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 1d overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 40.0)
| (df["AROONU_14_4h"] < 40.0)
| (df["ROC_9_1d"] < 200.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h still high, 15m & 4h high, 4h & 1d overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["ROC_9_4h"] < 10.0)
| (df["ROC_9_1d"] < 50.0)
)
# 15m & 1h down move, 15m & 1h still high, 4h high, 15m still not low enough, 1h & 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_15m"] < 10.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 60.0)
| (df["ROC_9_4h"] < 40.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 1h & 4h downtrend, 15m & 1h high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 60.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_1h"] > -0.0)
| (df["CMF_20_4h"] > -0.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
)
# 15m & 1h down move, 15m & 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 65.0)
| (df["AROONU_14_15m"] < 80.0)
| (df["AROONU_14_4h"] < 85.0)
| (df["ROC_9_4h"] < 100.0)
)
# 15m & 1h down move, 15m & 1h & 4h still high, 1h & 4h high, 1h & 4h overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 65.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_1h"] < 20.0)
| (df["ROC_9_4h"] < 30.0)
)
# 15m & 4h & 1d down move, 15m high, 15m & 4h still high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_4h"] > 15.0)
| (df["RSI_3_1d"] > 20.0)
| (df["AROONU_14_15m"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m & 4h & 1d down move, 15m & 1h still not low enough, 1h still high, 4h & 1d downtrend
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_4h"] > 20.0)
| (df["RSI_3_1d"] > 20.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
| (df["ROC_9_4h"] > -25.0)
| (df["ROC_9_1d"] > -50.0)
)
# 15m & 4h down move, 1h & 4h stil high, 15m high, 4h overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 70.0)
| (df["ROC_9_4h"] < 30.0)
)
# 15m down move, 15m still not low enough, 1h & 4h high & overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 70.0)
| (df["RSI_14_4h"] < 80.0)
| (df["AROONU_14_1h"] < 85.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_1h"] < 30.0)
| (df["ROC_9_4h"] < 80.0)
)
# 15m down move, 15m & 1h & 4h still high, 15m still high, 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
| (df["ROC_9_4h"] < 40.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 1h & 4h downtrend
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 15.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 20.0)
| (df["ROC_9_1h"] > -20.0)
| (df["ROC_9_4h"] > -35.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 1h high, 15m still not low enough
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 15.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 30.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
)
# 15m & 1h & 4h & 1d down move, 1h & 4h still not low enough, 1h & 4h downtrend, 4h still high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_3_1d"] > 25.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_1h"] > -0.10)
| (df["CMF_20_4h"] > -0.10)
| (df["AROONU_14_4h"] < 40.0)
| (df["ROC_9_4h"] > -20.0)
)
# 15m & 1h & 4h & 1d down move, 1h still not low enough, 4h still high, 4h downtrend, 1h still not low enough
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_3_1d"] > 50.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_4h"] > -0.30)
| (df["AROONU_14_1h"] < 20.0)
)
# 15m & 1h & 4h & 1d down move, 15m downtrend, 15m & 4h high, 1d downtrend
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_3_1d"] > 50.0)
| (df["CMF_20_15m"] > -0.20)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["ROC_9_1d"] > -40.0)
)
# 15m & 1h & 4h & 1d down move, 4h still not low enough, 15m & 1h & 4h downtrend
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_3_1d"] > 40.0)
| (df["RSI_14_15m"] > 20.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_15m"] > -0.25)
| (df["CMF_20_1h"] > -0.20)
| (df["CMF_20_4h"] > -0.0)
| (df["AROONU_14_4h"] < 20.0)
)
# 15m & 1h & 4h down move, 1h still not low enough, 4h high, 1h downtrend
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 45.0)
| (df["AROONU_14_1h"] < 40.0)
| (df["AROONU_14_4h"] < 90.0)
| (df["ROC_9_1h"] > -30.0)
)
# 15m & 1h & 4h down move, 4h high, 1d overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 45.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["ROC_9_1d"] < 150.0)
)
# 15m & 1h down move, 15m & 1h still not low enough, 4h still high, 4h high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 30.0)
| (df["AROONU_14_1h"] < 30.0)
| (df["AROONU_14_4h"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m & 1h down move, 15m still not low enough, 1h still high, 4h high. 4h overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["ROC_9_4h"] < 50.0)
)
# 15m & 1h & 4h down move, 15m & 1h still not low enough, 4h still high, 15m downtrend
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_15m"] > -0.50)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 15m high, 1h still high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m & 1h & 4h down move, 15m & 1h still not low enough, 4h still high, 15m downtrend, 4h high, 1h downtrend
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_15m"] > -0.30)
| (df["AROONU_14_4h"] < 60.0)
| (df["ROC_9_1h"] > -10.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 1h & 4h high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_1h"] < 60.0)
| (df["AROONU_14_4h"] < 85.0)
)
# 15m & 1h & 4h down move, 15m & 1h still not low enough, 4h still high, 1h & 4h downtrend, 1h high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_1h"] > -0.40)
| (df["CMF_20_4h"] > -0.10)
| (df["AROONU_14_1h"] < 70.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h still high, 15m downtrend, 1h still high, 4h high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_15m"] > -0.25)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m & 1h & 4h & 1d down move, 15m still not low enough, 1h & 4h still high, 4h high, 1d overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_3_1d"] > 60.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
| (df["ROC_9_1d"] < 30.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 1d overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["ROC_9_1d"] < 80.0)
)
# 15m & 1h & 1d down move, 15m & 1h still not low enough, 4h high, 1d downtrend, 4h overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_1d"] > 25.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_4h"] < 85.0)
| (df["ROC_9_1h"] > -10.0)
| (df["ROC_9_4h"] < 30.0)
)
# 15m & 1h down move, 15m still not low enough, 1h still high, 4h high, 1h & 4h downtrend
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 70.0)
| (df["CMF_20_1h"] > -0.10)
| (df["CMF_20_4h"] > -0.10)
)
# 15m & 1h & 4h & 1d down move, 15m & 1h & 4h still not low enough, 15m still high 4h & 1d downtrend
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_3_1d"] > 30.0)
| (df["RSI_14_15m"] < 25.0)
| (df["RSI_14_1h"] < 25.0)
| (df["RSI_14_4h"] < 25.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["ROC_9_4h"] > -15.0)
| (df["ROC_9_1d"] > -15.0)
)
# 15m & 1h & 4h down move, 15m downtrend, 15m & 1h still not low enough, 1h & 4h downtrend
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 30.0)
| (df["CMF_20_15m"] > -0.20)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
| (df["ROC_9_1h"] > -10.0)
| (df["ROC_9_4h"] > -15.0)
)
# 15m & 1h & 4h down move, 1h still high, 4h high, 4h & 1d overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_1h"] < 35.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["ROC_9_4h"] < 25.0)
| (df["ROC_9_1d"] < 100.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 15m & 4h still high, 4h & 1d overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_4h"] < 50.0)
| (df["ROC_9_4h"] < 25.0)
| (df["ROC_9_1d"] < 30.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 4h overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 45.0)
| (df["ROC_9_4h"] < 70.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 4h overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 20.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 50.0)
| (df["ROC_9_4h"] < 10.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h still high, 4h high, 4h high & overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_1h"] < 30.0)
| (df["AROONU_14_4h"] < 85.0)
| (df["ROC_9_4h"] < 15.0)
)
# 15m & 1h down move, 15m still not low enough, 1h still high, 4h high, 1d downtrend, 4h overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 60.0)
| (df["CMF_20_1d"] > -0.10)
| (df["AROONU_14_15m"] < 20.0)
| (df["AROONU_14_1h"] < 20.0)
| (df["AROONU_14_4h"] < 85.0)
| (df["ROC_9_4h"] < 20.0)
)
# 15m & 1h down move, 15m still not low enough, 1h still high, 4h high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_1h"] < 60.0)
| (df["AROONU_14_4h"] < 100.0)
)
# 15m & 1h down move, 15m still high, 1h & dh high, 1d overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_14_15m"] < 40.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_1d"] < 50.0)
)
# 15m & 1h & 4h & 1d down move, 15m & 1h & 4h still not low enough, 1d high, 4h downtrend
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_3_1d"] > 40.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["RSI_14_1d"] < 40.0)
| (df["AROONU_14_1d"] < 70.0)
| (df["ROC_9_4h"] > -40.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 4h high, 1d downtrend, 4h overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["ROC_9_1h"] > -20.0)
| (df["ROC_9_4h"] < 10.0)
)
# 15m & 1h & 4h down move, 15m & 1h still not low enough, 4h high & overbought, 1d overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["ROC_9_4h"] < 20.0)
| (df["ROC_9_1d"] < 50.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 1h & 4h high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 85.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 1h high, 1d downtrend
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["ROC_9_1d"] > -20.0)
)
# 15m & 1h down move, 15m still not low enough, 1h still high, 1h & 4h high, 1h & 4h overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_1h"] < 20.0)
| (df["ROC_9_4h"] < 40.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h still high, 1d downtrend, 1h & 4h high, 1d overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_1d"] > -0.1)
| (df["AROONU_14_1h"] < 60.0)
| (df["AROONU_14_4h"] < 90.0)
| (df["ROC_9_1d"] < 20.0)
)
# 15m & 1h down move, 15m & 1h still high, 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_15m"] < 40.0)
| (df["AROONU_14_1h"] < 40.0)
| (df["AROONU_14_4h"] < 85.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 85.0)
| (df["ROC_9_4h"] < 10.0)
)
# 15m & 1h & 4h & 1d down move, 1h still high, 4h still not low enough, 4h downtrend
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 20.0)
| (df["RSI_3_1d"] > 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["CCI_20_1h"] < -250.0)
| (df["CCI_20_4h"] < -250.0)
| (df["ROC_9_4h"] > -15.0)
)
# 15m & 1h & 4h & 1d down move, 15m & 1h & 4h downtrend, 1h & 4h still not low enough, 1d downtrend
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_3_1d"] > 30.0)
| (df["RSI_14_1h"] < 35.0)
| (df["RSI_14_4h"] < 35.0)
| (df["CMF_20_15m"] > -0.30)
| (df["CMF_20_1h"] > -0.30)
| (df["CMF_20_4h"] > -0.30)
| (df["CCI_20_1h"] < -200.0)
| (df["CCI_20_4h"] < -200.0)
| (df["ROC_9_1d"] > -25.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 1h overbought, 4h downtrend
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
| (df["ROC_9_1h"] < 10.0)
| (df["ROC_9_4h"] > -10.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 15m & 1h still high, 4h high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
)
# 15m & 1h & 4h down move, 4h downtrend, 1h high, 4h downtrend
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 40.0)
| (df["CMF_20_4h"] > -0.10)
| (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
| (df["ROC_9_4h"] > -30.0)
)
# 15m & 1h & 4h down move, 15m & 1h still not low enough, 4h & 1d still high, 1h downtrend, 1d downtrend
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["RSI_14_1d"] < 40.0)
| (df["CMF_20_1h"] > -0.15)
| (df["STOCHRSIk_14_14_3_3_15m"] < 10.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
| (df["ROC_9_1d"] > -25.0)
)
# 15m down move, 15m still not low enough, 1h & 4h still high, 15m still high, 1h high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_1h"] < 85.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 1h downtrend, 15m & 4h still not low, 1h high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_1h"] > -0.25)
| (df["AROONU_14_15m"] < 30.0)
| (df["AROONU_14_4h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 15m ^ 1h down move, 15m & 1h & 4h still not low enough, 1h & 4h high, 1h overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
| (df["ROC_9_1h"] < 10.0)
)
# 15m & 1h down move, 15m still not low enough, 1h still high, 4h high, 15m still high, 4h overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_4h"] < 85.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
| (df["ROC_9_4h"] < 20.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 15m still high, 1h & 4h high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_1h"] < 85.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 60.0)
| (df["AROONU_14_4h"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
| (df["ROC_9_4h"] < 10.0)
)
# 15m & 1h & 1d down move, 15m still not low enough, 1h & 4h high, 1d overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_3_1d"] > 55.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_1d"] < 50.0)
)
# 14m & 1h down move, 15m & 1h still high, 4h high & overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 65.0)
| (df["AROONU_14_15m"] < 40.0)
| (df["AROONU_14_1h"] < 40.0)
| (df["AROONU_14_4h"] < 85.0)
| (df["ROC_9_4h"] < 35.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 5h still high, 15m still high, 4h & 1d overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 60.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["ROC_9_4h"] < 20.0)
| (df["ROC_9_1d"] < 100.0)
)
# 15m & 1h & 1d down move, 15m still not low enough, 1h & 4h still high, 1d overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 60.0)
| (df["RSI_3_1d"] > 60.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["ROC_9_1d"] < 80.0)
)
# 15m & 1h down move, 15m & 1h stil high, 4h high, 15m & 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_15m"] < 70.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["ROC_9_4h"] < 100.0)
)
# 15m & 1h down move, 15m & 1h & 4h still high, 15m downtrend, 1h & 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_15m"] > -0.25)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_4h"] < 25.0)
)
# 15m & 1h down move, 15m & 1h & 4h still high, 1h & 4h high, 1h overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 65.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_1h"] < 90.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_1h"] < 15.0)
)
# 15m & 4h down move, 15m high, 4h downtrend
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_4h"] > 3.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 70.0)
| (df["ROC_9_4h"] > -15.0)
)
# 15m & 4h down move, 15m & 1h & 4h still not low enough, 15m & 4h downtrend, 1h & 4h downtrend
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_4h"] > 5.0)
| (df["RSI_14_15m"] < 10.0)
| (df["RSI_14_1h"] < 10.0)
| (df["RSI_14_4h"] < 10.0)
| (df["CMF_20_15m"] > -0.10)
| (df["CMF_20_4h"] > -0.20)
| (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 20.0)
| (df["ROC_9_1h"] > -15.0)
| (df["ROC_9_4h"] > -15.0)
)
# 15m & 4h & 1d down move, 15m & 1h & 4h still not low enough, 15m & 1d downtrend
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_4h"] > 15.0)
| (df["RSI_3_1d"] > 25.0)
| (df["RSI_14_15m"] > 25.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_15m"] > -0.3)
| (df["CMF_20_1d"] > -0.3)
| (df["AROONU_14_15m"] < 30.0)
)
# 15m & 4h down move, 15m & 1h still high, 1h high, 1h over
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_4h"] > 15.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 90.0)
| (df["ROC_9_1h"] < 10.0)
)
# 15m & 4h down move, 15m still not low enough, 1h & 4h still high, 15m & 1h downtrend
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_4h"] > 20)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_15m"] > -0.20)
| (df["CMF_20_1h"] > -0.20)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m & 4h down move, 15m & 1h & 4h still not low enough, 15m & 4h high, 4h downtrend
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["ROC_9_4h"] > -20.0)
)
# 15m & 4h down move, 1h high & overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_4h"] > 45.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 90.0)
| (df["ROC_9_1h"] < 10.0)
)
# 15m & 4h down move, 15m & 1h & 4h still high, 4h high, 1h & 4h overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 50.0)
| (df["ROC_9_1h"] < 10.0)
| (df["ROC_9_4h"] < 10.0)
)
# 15m & 4h down move, 15m & 1h & 4h still high, 15m & 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 70.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["ROC_9_4h"] < 10.0)
)
# 15m & 1d down move, 15m still not low enough, 1h & 4h high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1d"] > 5.0)
| (df["RSI_14_15m"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 15m & 1d down move, 15m still not low enough, 1h & 4h high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1d"] > 60.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 60.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_15m"] < 30.0)
| (df["AROONU_14_1h"] < 60.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
)
# 15m down move, 15m & 1h & 4h still not low enough, 15m & 1h downtrend, 15m & 1h high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_15m"] > -0.20)
| (df["CMF_20_1h"] > -0.20)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_1h"] < 100.0)
)
# 15m down move, 15m still not low enough, 1h & 4h high, 1d downtrend, 1h & 4h high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_14_15m"] < 35.0)
| (df["RSI_14_1h"] < 70.0)
| (df["RSI_14_4h"] < 70.0)
| (df["CMF_20_1d"] > -0.1)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 100.0)
)
# 15m down move, 15m still not low enough, 1h & 4h high, 1d overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["AROONU_14_15m"] < 30.0)
| (df["AROONU_14_1h"] < 85.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_1d"] < 250.0)
)
# 15m down move, 15m & 1h still high, 1h high, 1h overbought, 4h & 1d downtrend
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["AROONU_14_15m"] < 40.0)
| (df["AROONU_14_1h"] < 85.0)
| (df["ROC_9_1h"] < 40.0)
| (df["ROC_9_4h"] > -50.0)
| (df["ROC_9_1d"] > -50.0)
)
# 15m down move, 15m still high, 1h & 4h high, 1h & 1d overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 70.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["ROC_9_1h"] < 40.0)
| (df["ROC_9_1d"] < 100.0)
)
# 15m down move, 15m still not low enough, 1h & 4h high, 4h & 1d overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 60.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_15m"] < 30.0)
| (df["AROONU_14_1h"] < 85.0)
| (df["ROC_9_4h"] < 20.0)
| (df["ROC_9_1d"] < 50.0)
)
# 15m down move, 15m & 1h & 4h still high, 1h & 4h high, 1h & 4h overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
| (df["ROC_9_1h"] < 20.0)
| (df["ROC_9_4h"] < 20.0)
)
# 15m down move, 15m high, 1h & 4h overbought
& ((df["RSI_3_15m"] > 15.0) | (df["AROONU_14_15m"] < 75.0) | (df["ROC_9_1h"] < 50.0) | (df["ROC_9_4h"] < 80.0))
# 15m & 1h & 4h down move, 1h still high, 15m still not low enough, 4h downtrend
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 5.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
| (df["ROC_9_4h"] > -30.0)
)
# 15m & 1h & 4h & 1d down move, 15m downtrend, 1h & 4h still not low enough
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_3_1d"] > 45.0)
| (df["CMF_20_15m"] > -0.40)
| (df["AROONU_14_1h"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 15.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 15.0)
| (df["CCI_20_1h"] < -350.0)
| (df["CCI_20_4h"] < -200.0)
)
# 15m & 1h & 4h down move, 15m downtrend, 1h & 4h till high, 15m still high, 1d overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 20.0)
| (df["CMF_20_15m"] > -0.3)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 40.0)
| (df["ROC_9_1d"] < 100.0)
)
# 15m & 1h & 4h & 1d down move, 4h & 1d still not low enough, 1d downtrend, 1h & 4h still high, 1d downtrend
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 20.0)
| (df["RSI_3_1d"] > 25.0)
| (df["RSI_14_4h"] < 30.0)
| (df["RSI_14_1d"] < 30.0)
| (df["CMF_20_1d"] > -0.20)
| (df["AROONU_14_1h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
| (df["ROC_9_1d"] > -15.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 1h & 4h downtrend, 1h high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_1h"] > -0.10)
| (df["CMF_20_4h"] > -0.10)
| (df["AROONU_14_1h"] < 70.0)
| (df["CCI_20_1h"] < -200.0)
| (df["CCI_20_4h"] < -200.0)
)
# 15m & 1h & 4h down move, 1h still not low enough, 1d overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 30.0)
| (df["AROONU_14_1h"] < 25.0)
| (df["ROC_9_1d"] < 200.0)
)
# 15m & 1h & 4h & 1d down move, 1h & 4h still not low enough, 1d still high, 1d downtrend, 1d overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_3_1d"] > 45.0)
| (df["RSI_14_4h"] < 30.0)
| (df["RSI_14_1d"] < 50.0)
| (df["CMF_20_1d"] > -0.0)
| (df["MFI_14_1d"] < 70.0)
| (df["CCI_20_1h"] < -250.0)
| (df["CCI_20_4h"] < -200.0)
| (df["ROC_9_4h"] > -10.0)
| (df["ROC_9_1d"] < 15.0)
)
# 15m & 1h & 4h & 1d down move, 1h & 4h still not low enough, 15m & 1h downtrend, 1h & 4h still not low enough
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_3_1d"] > 50.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_15m"] > -0.40)
| (df["CMF_20_1h"] > -0.25)
| (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 20.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 1h still high, 4h high & overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_4h"] < 10.0)
)
# 15m & 1h down move, 15m & 1h still not low enough, 4h still high, 15m still not low enough, 1h & 4h high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 30.0)
| (df["AROONU_14_1h"] < 85.0)
| (df["AROONU_14_4h"] < 100.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 15m & 1h & 4h downtrend, 1d overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_15m"] > -0.10)
| (df["CMF_20_1h"] > -0.10)
| (df["CMF_20_4h"] > -0.10)
| (df["ROC_9_1d"] < 50.0)
)
# 15m & 1h & 4h down move, 1h still not low enough, 4h still high, 1h high, 1h & 4h downtrend, 1d overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["ROC_9_1h"] > -10.0)
| (df["ROC_9_4h"] > -10.0)
| (df["ROC_9_1d"] < 80.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 15m & 1h downtrend
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_15m"] > -0.10)
| (df["CMF_20_1h"] > -0.15)
| (df["AROONU_14_15m"] < 20.0)
| (df["AROONU_14_1h"] < 30.0)
| (df["AROONU_14_4h"] < 50.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 15m & 1h & 4h downtrend, 4h high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_15m"] > -0.15)
| (df["CMF_20_1h"] > -0.15)
| (df["CMF_20_4h"] > -0.15)
| (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h still high, 15m & 4h high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 75.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m & 1h down move, 1h still not low enough, 1h still high, 4h high & overbought, 1d downtrend
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
| (df["ROC_9_4h"] < 40.0)
| (df["ROC_9_1d"] > -50.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h still high, 1d overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["ROC_9_1d"] < 150.0)
)
# 15m & 1h & 1d down move, 1h & 4h still high, 15m downtrend, 1d overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_1d"] > 55.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_15m"] > -0.3)
| (df["ROC_9_1d"] < 80.0)
)
# 15m & 1h & 4h & 1d down move, 15m & 1h still high, 4h downtrend
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_3_1d"] > 30.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["ROC_9_4h"] > -70.0)
)
# 15m & 1h & 4h & 1d down move, 15m & 1h & 4h still not low enough, 4h still high, 1h & 4h downtrend, 1d overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_3_1d"] > 40.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 20.0)
| (df["AROONU_14_4h"] < 40.0)
| (df["ROC_9_1h"] > -15.0)
| (df["ROC_9_4h"] > -30.0)
| (df["ROC_9_1d"] < 40.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 15m stil high, 4h high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 4h downtrend, 1h high, 4h downtrend
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 20.0)
| (df["CMF_20_4h"] > -0.25)
| (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
| (df["ROC_9_4h"] > -40.0)
)
# 15m & 1h & 4h down move, 1h & 4h still high, 15m & 1h downtrend, 1h & 4h high, 4h & 1d overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_15m"] > -0.20)
| (df["CMF_20_1h"] > -0.20)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 60.0)
| (df["ROC_9_4h"] < 20.0)
| (df["ROC_9_1d"] < 25.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 4h overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 50.0)
| (df["ROC_9_4h"] < 40.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h still high, 4h high, 4h & 1d overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 85.0)
| (df["ROC_9_4h"] < 20.0)
| (df["ROC_9_1d"] < 50.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h still high, 15m & 1h high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_1h"] < 100.0)
)
# 15m & 1h down move, 15m still not low enough, 1h still high, 4h high, 4h & 1d overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_1h"] < 30.0)
| (df["AROONU_14_4h"] < 50.0)
| (df["ROC_9_4h"] < 20.0)
| (df["ROC_9_1d"] < 200.0)
)
# 15m & 1h down move, 15m still not low enough, 1h still high, 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
| (df["ROC_9_4h"] < 40.0)
)
# 15m & 1h down move, 1h still high, 1h & 4h high, 4h & 1d overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_4h"] < 20.0)
| (df["ROC_9_1d"] < 80.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 15m & 4h still not low enough, 4h downtrend
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 30.0)
| (df["AROONU_14_4h"] < 30.0)
| (df["ROC_9_4h"] > -50.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h downtrend, 4h still high, 15m still not low enough, 1h still high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 40.0)
| (df["CMF_20_15m"] > -0.10)
| (df["CMF_20_1h"] > -0.20)
| (df["CMF_20_4h"] > -0.20)
| (df["AROONU_14_4h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
| (df["ROC_9_4h"] > -30.0)
)
# 15m & 1h & 4h & 1d down move, 1d still high, 1h still high, 4h high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_3_1d"] > 25.0)
| (df["MFI_14_1d"] < 50.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 85.0)
)
# 15m & 1h & 4h & 1d down move, 15m still not low enough, 1h & 4h still high, 15m downtrend, 4h high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_3_1d"] > 55.0)
| (df["RSI_14_15m"] < 25.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_15m"] > -0.10)
| (df["AROONU_14_4h"] < 80.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 4h high & overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["ROC_9_4h"] < 20.0)
)
# 15m & 1h down move, 15m & 1h & 4h still not low enough, 15m still high, 1h high, 1h & 4h still high, 1d downtrend
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_1h"] < 90.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
| (df["ROC_9_1d"] > -50.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h still high, 15m still not lowenough, 1h high, 1d overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 25.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["ROC_9_1d"] < 80.0)
)
# 15m & 1h down move, 15m & 1h & 4h still high, 15m & 1h high, 4h overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_1h"] < 100.0)
| (df["ROC_9_4h"] < 10.0)
)
# 15m & 1h down move, 15m & 1h sitll high, 4h high, 1h & 4h high, 1h & 4h overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 90.0)
| (df["ROC_9_1h"] < 20.0)
| (df["ROC_9_4h"] < 30.0)
)
# 15m & 4h down move, 15m & 1h & 4h still high, 4h downtrend, 15m & 1h still high, 4h downtrend
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_4h"] > -0.25)
| (df["AROONU_14_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["ROC_9_4h"] > -20.0)
)
# 15m & 1h & 4h down move, 15m downtrend, 15m still high, 1h overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 40.0)
| (df["CMF_20_15m"] > -0.20)
| (df["AROONU_14_15m"] < 50.0)
| (df["ROC_9_1d"] < 100.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 4h downtrend
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 40.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
| (df["ROC_9_4h"] > -20.0)
)
# 15m & 1h & 4h down move, 4d downtrend, 1h high, 4h downtrend
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 40.0)
| (df["CMF_20_4h"] > -0.40)
| (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
| (df["ROC_9_4h"] > -30.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 4h downtrend, 15m high, 4h & 1d downtrend
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_4h"] > -0.40)
| (df["AROONU_14_15m"] < 60.0)
| (df["ROC_9_4h"] > -20.0)
| (df["ROC_9_1d"] > -50.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h still high, 4h high & overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 30.0)
| (df["AROONU_14_15m"] < 30.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 85.0)
| (df["ROC_9_4h"] < 30.0)
)
# 15m & 1h & 4h down move, 1h & 4h still high, 4h overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 50.0)
| (df["CCI_20_1h"] < 0.0)
| (df["CCI_20_4h"] < 0.0)
| (df["ROC_9_4h"] < 40.0)
)
# 15m & 1h & 4h down move, 15m & 1h still high, 4h high, 15m stil high, 4h high & overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["ROC_9_4h"] < 25.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h still high, 15m downtrend, 1h & 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_15m"] > -0.20)
| (df["AROONU_14_1h"] < 70.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_4h"] < 40.0)
)
# 15m & 1h & 4h & 1d down move, 15m & 1h & 4h still not low enough, 15m still high, 1h high, 4h & 1d downtrend
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_3_1d"] > 45.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 20.0)
| (df["AROONU_14_15m"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
| (df["ROC_9_4h"] > -25.0)
| (df["ROC_9_1d"] > -30.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 15m high, 1h still high, 4h overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
| (df["ROC_9_4h"] < 10.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 15m & 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 70.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["ROC_9_4h"] < 40.0)
)
# 15m & 1h & 1d down move, 15m still not low enough, 1h & 4h still high, 1h high, 4h downtrend, 1d overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_1d"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["ROC_9_4h"] > -20.0)
| (df["ROC_9_1d"] < 50.0)
)
# 15m & 1h & 4h down move, 15m still not low, 1h & 4h sitll high, 15m & 1h downtrend, 15m still high, 4h high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_15m"] > -0.10)
| (df["CMF_20_1h"] > -0.20)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 15m & 1h down move, 15m & 1h still high, 4h high, 15m still high, 1h & 4h high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_15m"] < 40.0)
| (df["AROONU_14_1h"] < 85.0)
| (df["AROONU_14_4h"] < 100.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 1h & 1d overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["ROC_9_1h"] < 10.0)
| (df["ROC_9_1d"] < 200.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 1h high & overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 40.0)
| (df["AROONU_14_1h"] < 85.0)
| (df["ROC_9_1h"] < 10.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h downtrend, 15m & 1h high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_3_4h"] > 55.0)
| (df["CMF_20_15m"] > -0.25)
| (df["CMF_20_1h"] > -0.10)
| (df["CMF_20_4h"] > -0.10)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_1h"] < 90.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 15m still high, 4h downtrend
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["ROC_9_4h"] > -40.0)
)
# 15m & 1h & 4h down move, 1h & 4h high, 4h & 1d overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_4h"] < 75.0)
| (df["ROC_9_4h"] < 25.0)
| (df["ROC_9_1d"] < 150.0)
)
# 15m & 1h down move, 15m & 1h stil high, 4h high, 1h & 4h overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["ROC_9_1h"] < 40.0)
| (df["ROC_9_4h"] < 50.0)
)
# 15m & 1h down move, 15m still not low enough, 1h still high, 4h high, 15m & 1h & 4h high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_15m"] < 70.0)
| (df["AROONU_14_1h"] < 100.0)
| (df["AROONU_14_4h"] < 100.0)
)
# 15m & 1h down move, 15m & 1h still high, 4h high, 15m & 4h high, 15m & 1h still not low enough, 4h overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 65.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
| (df["ROC_9_4h"] < 30.0)
)
# 15m & 1h down move, 15m & 1h still high, 4h high, 1h & 4h high, 1h overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["ROC_9_1h"] < 15.0)
)
# 15m & 1h down move, 15m still high, 1h high & overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["ROC_9_1h"] < 80.0)
)
# 15m & 1h down move, 15m still not low enough, 1h still high, 4h high & overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 65.0)
| (df["RSI_14_15m"] < 35.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 75.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
| (df["ROC_9_4h"] < 100.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h still high, 15m downtrend, 4h high & overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 65.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_15m"] > -0.20)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 90.0)
| (df["ROC_9_4h"] < 20.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h high, 15m still high, 1h & 4h high, 1d overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 65.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 60.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_1d"] < 50.0)
)
# 15m & 4h down move, 15m & 1h & 4h sitll high, 4h high, 4h & 1d overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_4h"] < 60.0)
| (df["ROC_9_4h"] < 15.0)
| (df["ROC_9_1d"] < 60.0)
)
# 15m & 4h & 1d down move, 15m & 1h & 4h s till high, 15m & 4h high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_3_1d"] > 50.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
)
# 15m & 4h down move, 15m & 1h still not low enough, 15m still high, 1h high, 4h downtrend
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_4h"] > 20.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["AROONU_14_15m"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
| (df["ROC_9_4h"] > -25.0)
)
# 15m & 4h down move, 15m & 1h still high, 4h downtrend
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_4h"] > 20.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["ROC_9_4h"] > -30.0)
)
# 15m &4d down move, 15m & 1h high, 4h downtrend
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_4h"] > 20.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
| (df["ROC_9_4h"] > -30.0)
)
# 15m & 4h down move, 4h still high, 4h downtrend, 1d overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_4h"] > 20.0)
| (df["AROONU_14_4h"] < 50.0)
| (df["ROC_9_4h"] > -30.0)
| (df["ROC_9_1d"] < 100.0)
)
# 15m & 4h down move, 15m & 1h & 4h still high, 15m still not low enough, 4h still high, 4h overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 30.0)
| (df["AROONU_14_4h"] < 50.0)
| (df["ROC_9_4h"] < 40.0)
)
# 15m & 4h down move, 15m still not low enough, 1h & 4h still high, 15, & 4h still high, 1h high, 4h downtrend
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_4h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
| (df["ROC_9_4h"] > -20.0)
)
# 15m & 4h down move, 15m & 1h & 4h still high, 15m still high, 1h high, 4h overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_1h"] < 100.0)
| (df["ROC_9_4h"] < 70.0)
)
# 15m & 4h down move, 15m & 1h still not low enough, 1h still high & overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 35.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
| (df["ROC_9_4h"] < 10.0)
)
# 15m & 4h down move, 15m still high, 1h still high, 4h high & overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_15m"] < 30.0)
| (df["AROONU_14_4h"] < 60.0)
| (df["ROC_9_4h"] < 100.0)
)
# 15m & 4h down move, 15m still not low enough, 1h & 4h high, 15m & 1h & 4h high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 60.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_1h"] < 90.0)
| (df["AROONU_14_4h"] < 90.0)
)
# 15m down move, 15m still not low enough, 1h & 4h high, 1h & 4h overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 70.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_1h"] < 85.0)
| (df["AROONU_14_4h"] < 85.0)
| (df["ROC_9_1h"] < 50.0)
| (df["ROC_9_4h"] < 50.0)
)
# 15m down move, 15m still high, 1h & 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 60.0)
| (df["RSI_14_4h"] < 80.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
| (df["ROC_9_4h"] < 75.0)
)
# 15m down move, 15m & 1h & 4h high, 1h & 4h overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_14_15m"] < 50.0)
| (df["RSI_14_1h"] < 60.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_1h"] < 50.0)
| (df["ROC_9_4h"] < 50.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 4h overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 50.0)
| (df["ROC_9_4h"] < 70.0)
)
# 15m & 1h & 4h down move, 15m & 1h still not low enough, 4h still high, 1h high, 1d overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_1h"] < 60.0)
| (df["ROC_9_1d"] < 100.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 15m high, 1h & 4h still high
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 70.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 40.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 15m & 1h & 4h high
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 70.0)
| (df["AROONU_14_1h"] < 85.0)
| (df["AROONU_14_4h"] < 85.0)
)
# 15m & 1h & 4h & 1d down move, 15m & 1h still not low enough, 4h still high, 1d overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_3_1d"] > 55.0)
| (df["RSI_14_15m"] < 25.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
| (df["ROC_9_1d"] < 30.0)
)
# 15m & 1h & 1d down move, 1h & 4h still high, 1d downtrend, 1h high, 1h & 4h still high, 1d downtrend
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_1d"] > 25.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_1d"] > -0.20)
| (df["AROONU_14_1h"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
| (df["ROC_9_1d"] > -15.0)
)
# 15m & 1h down move, 15m still not low enough, 1h stil high, 4h high & overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_1h"] < 40.0)
| (df["AROONU_14_4h"] < 85.0)
| (df["ROC_9_4h"] < 70.0)
)
# 15m & 1h down move, 15m still not low enough, 1h still high, 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 80.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_4h"] < 30.0)
)
# 15m & 1h & 4h & 1d down move, 15m & 1h still not low enough, 4h stil high, 15m still high, 1d overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_3_1d"] > 60.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["ROC_9_1d"] < 50.0)
)
# 15m & 1h & 4h & 1d down move, 15m & 1h & 4h downtrend, 4h downtrend
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_3_1d"] > 30.0)
| (df["CMF_20_15m"] > -0.30)
| (df["CMF_20_1h"] > -0.40)
| (df["CMF_20_4h"] > -0.40)
| (df["ROC_9_4h"] > -40.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 1h still high, 1d overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["ROC_9_1d"] < 100.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 1h still high
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_15m"] > -0.25)
| (df["AROONU_14_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 1h & 4h down move, 1h still not low enough, 4h still high, 15m downtrend, 15m still not low enough
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_15m"] > -0.30)
| (df["AROONU_14_15m"] < 20.0)
| (df["AROONU_14_1h"] < 30.0)
| (df["AROONU_14_4h"] < 50.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h stil high, 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
| (df["ROC_9_4h"] < 25.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 15m still not low, 4h high, 1h still high
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 20.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m & 1h down move, 15m still not low enough, 1h still high, 4h high & overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_4h"] < 50.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 15m still high, 4h downtrend, 1d overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["ROC_9_4h"] > -20.0)
| (df["ROC_9_1d"] < 100.0)
)
# 15m & 1h & 4h down move, 15m & 1h still not low enough, 4h still high, 1h still high, 15m still high
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 40.0)
)
# 15m & 1h & 4h down move, 1h still not low enough, 4h still high, 4h & 1d overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 50.0)
| (df["ROC_9_4h"] < 10.0)
| (df["ROC_9_1d"] < 100.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h still high, 4h high & overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["ROC_9_4h"] < 80.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 15m & 1h & 4h still high, 1d downtrend
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["AROONU_14_15m"] < 40.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
| (df["ROC_9_1d"] > -40.0)
)
# 15m & 1h & 1d down move, 15m still not low enough, 1h & 4h still high, 1d downtrend, 1h high, 1d overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_1d"] > 65.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_1d"] > -0.20)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_1h"] < 85.0)
| (df["ROC_9_1d"] < 20.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 4h & 1d overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 60.0)
| (df["ROC_9_4h"] < 20.0)
| (df["ROC_9_1d"] < 20.0)
)
# 15m & 1h & 1d down move, 4h & 1d downtrend, 1h & 4h high, 1d downtrend
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_1d"] > 35.0)
| (df["CMF_20_4h"] > -0.1)
| (df["CMF_20_1d"] > -0.1)
| (df["AROONU_14_1h"] < 75.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
| (df["ROC_2_1d"] > -20.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h still high, 15m & 1h & 4h downtrend, 4h high
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_15m"] > -0.25)
| (df["CMF_20_1h"] > -0.10)
| (df["CMF_20_4h"] > -0.10)
| (df["AROONU_14_1h"] < 30.0)
| (df["AROONU_14_4h"] < 80.0)
)
# 15m & 1h down move, 15m still not low enough, 1h still high, 4h high, 4h & 1d overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["ROC_9_4h"] < 80.0)
| (df["ROC_9_1d"] < 100.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h high, 1h & 4h overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 80.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 90.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
| (df["ROC_9_1h"] < 20.0)
| (df["ROC_9_4h"] < 60.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 1h & 4h downtrend
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 10.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 20.0)
| (df["CMF_20_1h"] > -0.15)
| (df["CMF_20_4h"] > -0.20)
| (df["AROONU_14_15m"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 85.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
| (df["ROC_9_4h"] < 30.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 4h high & overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 60.0)
| (df["ROC_9_4h"] < 25.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 4h high, 4h & 1d overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["ROC_9_4h"] < 15.0)
| (df["ROC_9_1d"] < 50.0)
)
# 15m & 1h down move, 15m sitll not low enough, 1h still high, 4h high, 15m & 1h downtrend, 15m & 1h still high
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 60.0)
| (df["CMF_20_15m"] > -0.20)
| (df["CMF_20_1h"] > -0.20)
| (df["AROONU_14_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h still high, 15m & 1h high, 1d overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_1h"] < 100.0)
| (df["ROC_9_1d"] < 80.0)
)
# 15m & 1h & 4h down move, 15m & 1h still not low enough, 4h still high, 4h overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
| (df["ROC_9_4h"] < 10.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 1h & 4h downtrend, 15m high, 4h downtrend
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_1h"] > -0.20)
| (df["CMF_20_4h"] > -0.30)
| (df["AROONU_14_15m"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["ROC_9_4h"] > -30.0)
)
# 15m & 1h & 4h, 15m still not low enough, 1h & 4h still high, 15m downtrend, 15m & 4h high
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_15m"] > -0.25)
| (df["AROONU_14_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h still high, 4h high & overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 85.0)
| (df["ROC_9_4h"] < 70.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 15m still high, 4h high & overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 40.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
| (df["ROC_9_4h"] < 10.0)
)
# 15m & 1h & 1d down move, 15m & 1h & 4h still high, 15m & 1d downtrend
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_1d"] > 55.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 45.0)
| (df["RSI_14_4h"] < 45.0)
| (df["AROONU_14_15m"] < 25.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["ROC_9_15m"] > -40.0)
| (df["ROC_9_1d"] > -40.0)
)
# 15m & 1h down move, 15m & 1h & 4h stil high, 15m & 1h & 4h high, 1d downtrend
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
| (df["ROC_9_1d"] > -50.0)
)
# 15m & 1h down move, 15m & 1h & 4h still high, 1h & 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
| (df["ROC_9_4h"] < 30.0)
)
# 15m & 1h & 4h & 1d down move, 15m & 1h still not low enough, 4h still high, 4h downtrend, 4h high, 1d overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_3_1d"] > 50.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_4h"] > -0.10)
| (df["AROONU_14_1h"] < 70.0)
| (df["ROC_9_1d"] < 30.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h still high, 4h high
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 40.0)
| (df["AROONU_14_1h"] < 40.0)
| (df["AROONU_14_4h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 15m & 1h high, 4h overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_1h"] < 90.0)
| (df["ROC_9_4h"] < 10.0)
)
# 15m & 1h down move, 15m & 1h & 4h still high, 15m & 1h & 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_1h"] < 60.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_4h"] < 40.0)
)
# 15m & 1h down move, 15m & 1h still high, 4h high, 4h & 1d overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["ROC_9_4h"] < 20.0)
| (df["ROC_9_1d"] < 100.0)
)
# 15m & 1h down move, 15m & 1h & 4h still high, 15m & 1h high, 1h & 4h overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_1h"] < 100.0)
| (df["ROC_9_1h"] < 10.0)
| (df["ROC_9_4h"] < 10.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h still high, 1h & 4h downtrend, 4h high & overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 60.0)
| (df["CMF_20_1h"] > -0.10)
| (df["CMF_20_4h"] > -0.10)
| (df["AROONU_14_1h"] < 30.0)
| (df["AROONU_14_4h"] < 85.0)
| (df["ROC_9_4h"] < 30.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h high, 4h downtrend
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_3_4h"] > 55.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
| (df["ROC_9_4h"] > -25.0)
)
# 15m & 1h down move, 15m still high, 1h & 4h high, 1h overbought, 1d downtrend
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["AROONU_14_4h"] < 90.0)
| (df["ROC_9_1h"] < 20.0)
| (df["ROC_9_1d"] > -30.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h high, 4h downtrend
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 60.0)
| (df["RSI_3_4h"] > 60.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
| (df["ROC_9_4h"] > -15.0)
)
# 15m & 1h down move, 15m & 1h still high, 4h high, 1h & 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
| (df["ROC_9_4h"] < 60.0)
)
# 15m & 1h down move, 15m & 1hstill high, 4h downtrend, 15m still high, 1h high
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 60.0)
| (df["RSI_14_15m"] < 50.0)
| (df["RSI_14_1h"] < 50.0)
| (df["CMF_20_4h"] > -0.10)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_1h"] < 85.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 15m & 1h down move, 1h & 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 60.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 90.0)
| (df["ROC_9_4h"] < 120.0)
)
# 15m & 1h down move, 15m still high, 1h & 4h high, 1h & 4h & 1d overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 65.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 60.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_1h"] < 20.0)
| (df["ROC_9_4h"] < 50.0)
| (df["ROC_9_1d"] < 250.0)
)
# 15m & 4h down move, 15m high, 1h still not low enough, 4h downtrend
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_4h"] > 3.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
| (df["ROC_9_4h"] > -30.0)
)
# 15m & 4h down move, 15m & 1h high, 4h downtrend
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_4h"] > 10.0)
| (df["AROONU_14_15m"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
| (df["ROC_9_4h"] > -30.0)
)
# 15m & 4h & 1d down move, 15m still high, 1h & 4h downtrend
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_4h"] > 15.0)
| (df["RSI_3_1d"] > 15.0)
| (df["RSI_14_15m"] < 40.0)
| (df["CMF_20_1h"] > -0.20)
| (df["CMF_20_4h"] > -0.20)
| (df["AROONU_14_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
)
# 15m & 4h & 1d down move, 15m high, 1d overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_3_1d"] > 30.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["ROC_9_1d"] < 50.0)
)
# 15m & 4h down move, 15m & 1h still high, 15m & 1h high, 4h downtrend
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_4h"] > 3.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
| (df["ROC_9_4h"] > -25.0)
)
# 15m & 4h down move, 15m & 1h still not low enough, 4h still high, 1h & 4h downtrend, 15m & 1h & 4h still high
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_1h"] > -0.10)
| (df["CMF_20_4h"] > -0.10)
| (df["AROONU_14_15m"] < 30.0)
| (df["AROONU_14_1h"] < 30.0)
| (df["AROONU_14_4h"] < 40.0)
)
# 15m & 4h down move, 15m & 1h & 4h still high, 1h & 4h downtrend
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_4h"] > 25.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
| (df["ROC_9_1h"] > -20.0)
| (df["ROC_9_4h"] > -30.0)
)
# 15m & 4h down move, 15m & 1h & 4h still high, 15m & 4h high, 1d overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["ROC_9_1d"] < 50.0)
)
# 15m & 4h down move, 15m & 1h & 4h still high, 15m & 1h high, 1h overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_1h"] < 85.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
| (df["ROC_9_1h"] < 10.0)
)
# 15m & 4h down move, 15m & 1h & 4h still high, 15m & 4h high, 4h & 1d overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["ROC_9_4h"] < 25.0)
| (df["ROC_9_1d"] < 200.0)
)
# 15m & 4h down move, 15m still not low enough, 1h & 4h still high, 15m & 1h & 4h still high, 4h overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
| (df["ROC_9_4h"] < 50.0)
)
# 15m & 1d down move, 1h & 4h still not low enough, 1h & 4h downtrend, 4h still high
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1d"] > 25.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["MFI_14_1h"] < 40.0)
| (df["MFI_14_4h"] < 50.0)
| (df["CMF_20_1h"] > -0.0)
| (df["CMF_20_4h"] > -0.20)
| (df["AROONU_14_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
)
# 15m down move, 15m & 1h & 4h still high, 15m & 1h & 4h high, 1h & 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 70.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
| (df["ROC_9_4h"] < 20.0)
)
# 15m down move, 15m & 1h & 4h still high, 15m & 1h downtrend, 4h high, 15m & 1h still high
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_15m"] > -0.20)
| (df["CMF_20_1h"] > -0.10)
| (df["AROONU_14_4h"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m down move, 15m still high, 1h >& 4h high, 15m & 1h & 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 60.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
| (df["ROC_9_4h"] < 25.0)
)
# 15m down move, 15m still high, 1h & 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 60.0)
| (df["RSI_14_4h"] < 80.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["ROC_9_4h"] < 25.0)
)
# 15m down move, 15m still high, 1h & 4h high, 1d downtrend, 4h overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 70.0)
| (df["RSI_14_4h"] < 75.0)
| (df["CMF_20_1d"] > -0.0)
| (df["AROONU_14_4h"] < 90.0)
| (df["ROC_9_4h"] < 50.0)
)
# 15m down move, 15m & 1h high, 1h & 4h overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["AROONU_14_15m"] < 80.0)
| (df["AROONU_14_1h"] < 100.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 90.0)
| (df["ROC_9_1h"] < 10.0)
| (df["ROC_9_4h"] < 20.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 15m & 4h downtrend, 1h & 4h still not low enough
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 15.0)
| (df["RSI_14_15m"] < 10.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 20.0)
| (df["CMF_20_15m"] > -0.30)
| (df["CMF_20_4h"] > -0.30)
| (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enugh, 4h still high, 15m still high, 1h & 4h downtrend
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 15.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 30.0)
| (df["AROONU_14_1h"] < 10.0)
| (df["AROONU_14_4h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["ROC_9_1h"] > -20.0)
| (df["ROC_9_4h"] > -30.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 1h downtrend
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 20.0)
| (df["AROONU_14_15m"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
| (df["ROC_9_1h"] > -15.0)
)
# 15m & 1h & 4h down move, 15m & 1h still not low enough, 4h still high, 15m & 1h & 4h downtrend
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_15m"] > -0.35)
| (df["ROC_9_1h"] > -10.0)
| (df["ROC_9_4h"] > -15.0)
)
# 15m & 1h & 4h & 1d down move, 15m & 1h & 4h still not low enough, 15m still high, 1h & 4h & 1d downtrend
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_3_1d"] > 30.0)
| (df["RSI_14_15m"] < 25.0)
| (df["RSI_14_1h"] < 25.0)
| (df["RSI_14_4h"] < 25.0)
| (df["AROONU_14_15m"] < 40.0)
| (df["ROC_9_1h"] > -15.0)
| (df["ROC_9_4h"] > -15.0)
| (df["ROC_9_1d"] > -15.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 1h & 4h downtrend, 4h downtrend
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_1h"] > -0.20)
| (df["CMF_20_4h"] > -0.20)
| (df["AROONU_14_4h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
| (df["ROC_9_4h"] > -20.0)
)
# 15m & 1h & 4h & 1d down move, 15m still not low enough, 1h & 4h still high, 15m downtrend, 4h high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_3_1d"] > 60.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_15m"] > -0.15)
| (df["AROONU_14_4h"] < 70.0)
| (df["CCI_20_1h"] < -100.0)
| (df["CCI_20_4h"] < 0.0)
)
# 15m & 1h & 4h down move, 15m & 1h still not low enough, 4h still high, 15m & 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["ROC_9_4h"] < 25.0)
)
# 15m & 1h & 4h & 1d down move, 15m & 1h & 4h still not low enough, 4h downtrend, 1d high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_3_1d"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_4h"] > -0.25)
| (df["AROONU_14_1d"] < 90.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 15m still not low enough, 4h high & overbought
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 25.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["ROC_9_4h"] < 80.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 1d overbought
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
| (df["ROC_9_1d"] < 80.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h still high, 15m & 1h downtrend, 15m & 4h high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_15m"] > -0.25)
| (df["CMF_20_1h"] > -0.30)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 60.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 1h & 4h high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["AROONU_14_4h"] < 100.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h stil high, 15m high, 4h downtrend
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["ROC_9_4h"] > -40.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 4h high, 4h & 1d overbought
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 30.0)
| (df["AROONU_14_4h"] < 85.0)
| (df["ROC_9_4h"] < 20.0)
| (df["ROC_9_1d"] < 80.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 15m & 4h high, 1h still not low enough, 4h high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 15m & 1h down move, 15m & 1h & 4h still high, 1h & 4h downtrend, 15m & 1h high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_1h"] > -0.10)
| (df["CMF_20_4h"] > -0.10)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_1h"] < 100.0)
)
# 15m & 1h down move, 15m still not low enough, 1h sitll high, 1h & 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 80.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_4h"] < 20.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 15m & 1h still high, 4h high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 15h & 4h high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
)
# 15m & 1h & 4h down move, 15m high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 40.0)
| (df["AROONU_14_15m"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 70.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 1h high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_1h"] < 100.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m & 1h & 4h down move, 15m still low, 1h & 4h still high, 4h high & overbought
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["ROC_9_4h"] < 100.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h stil high, 15m & 4h still high, 4h overbought
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_4h"] < 50.0)
| (df["ROC_9_4h"] < 20.0)
)
# 15m & 1h & 4h & 1d down move, 15m & 1h & 4h high, 1d downtrend
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_3_1d"] > 45.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_1h"] < 85.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_1d"] > -50.0)
)
# 15m & 1h & 4h & 1d down move, 15m still not low enough, 1h & 4h still high, 4h downtrend, 1d overbought
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_3_1d"] > 50.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["ROC_9_4h"] > -20.0)
| (df["ROC_9_1d"] < 50.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 15m high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h stil high, 15m & 4h still high, 4h overbought
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["ROC_9_4h"] < 20.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 15m & 1h high, 4h & 1d overbought
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_1h"] < 100.0)
| (df["ROC_9_4h"] < 10.0)
| (df["ROC_9_1d"] < 30.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 1d overbought
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CCI_20_1h"] < 0.0)
| (df["CCI_20_4h"] < 0.0)
| (df["ROC_9_1d"] < 200.0)
)
# 15m & 1h & 4h down move, 15m & 1h still high, 1h & 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["ROC_9_4h"] < 70.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h still high, 15m downtrend, 15m still high, 1h high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_15m"] > -0.25)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_1h"] < 100.0)
)
# 15m & 1h down move, 15m still not low enough, 1h stil high, 4h high, 1h downtrend
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 80.0)
| (df["CMF_20_1h"] > -0.10)
| (df["AROONU_14_1h"] < 40.0)
| (df["AROONU_14_4h"] < 80.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 1h & 4h high, 1d overbought
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 60.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_1d"] < 80.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h still high, 1h high, 1h & 1d overbought
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 60.0)
| (df["ROC_9_1h"] < 20.0)
| (df["ROC_9_1d"] < 80.0)
)
# 15m & 1h & 4h & 1d down move, 15m & 4h downtrend, 15m & 1h high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_3_1d"] > 55.0)
| (df["CMF_20_15m"] > -0.25)
| (df["CMF_20_4h"] > -0.20)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_1h"] < 100.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 15m high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 80.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 1h & 4h downtrend, 1h high, 4h downtrend
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_1h"] > -0.20)
| (df["CMF_20_4h"] > -0.25)
| (df["AROONU_14_1h"] < 80.0)
| (df["ROC_9_4h"] > -20.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 1h & 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 60.0)
| (df["AROONU_14_4h"] < 85.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
| (df["ROC_9_4h"] < 25.0)
)
# 15m & 1h & 4h down move, 15m & 1h still not low enough, 4h still high, 4h downtrend, 1h still high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 60.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_4h"] > -0.30)
| (df["AROONU_14_1h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 1h down move, 15m & 1h & 4h still high, 4h high, 4h & 1d overbought
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["ROC_9_4h"] < 50.0)
| (df["ROC_9_1d"] < 150.0)
)
# 15m & 1h down move, 15m still high, 1h & 4h high & overbought
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 80.0)
| (df["AROONU_14_1h"] < 60.0)
| (df["AROONU_14_4h"] < 90.0)
| (df["ROC_9_1h"] < 50.0)
| (df["ROC_9_4h"] < 100.0)
)
# 15m & 1h down move, 15m still high, 1h & 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 65.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 60.0)
| (df["RSI_14_4h"] < 80.0)
| (df["AROONU_14_4h"] < 90.0)
| (df["ROC_9_4h"] < 130.0)
)
# 15m & 4h down move, 15m & 1h & 4h still high, 15m still high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_4h"] > 5.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
)
# 15m & 4h down move, 15m & 1h high, 4h downtrend
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_4h"] > 15.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
| (df["ROC_9_4h"] > -50.0)
)
# 15m & 4h down move, 15m & 1h still high, 1h & 4h downtrend, 15m & 1h still high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["CMF_20_1h"] > -0.10)
| (df["CMF_20_4h"] > -0.30)
| (df["AROONU_14_15m"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 4h down move, 15m & 1h & 4h still high, 15m & 4h high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 70.0)
)
# 15m & 1h down move, 15m still high, 1h & 4h high & overbought
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 65.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 60.0)
| (df["RSI_14_4h"] < 75.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_1h"] < 40.0)
| (df["ROC_9_4h"] < 40.0)
)
# 15m & 4h down move, 15m & 1h & 4h still high, 15m high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
)
# 15m & 4h down move, 15m & 1h & 4h stil high, 14m & 4h high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 70.0)
| (df["AROONU_14_4h"] < 90.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
)
# 15m & 4h down move, 15m still not low enough, 1h & 4h still high, 15m & 4h high, 1d overbought
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 70.0)
| (df["AROONU_14_4h"] < 30.0)
| (df["ROC_9_1d"] < 200.0)
)
# 15m down move, 15m still not low enough, 1h & 4h high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 70.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
)
# 15m down move, 15m & 1h & 4h still high, 15m high, 15m & 1h still high, 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
| (df["ROC_9_4h"] < 20.0)
)
# 15m & 1h down move, 15m & 1h still high, 1h & 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_4h"] < 20.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 15m & 4h still high, 1d downtrend
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
| (df["ROC_9_1d"] > -50.0)
)
# 15m & 1h & 4h down move, 15m & 1h still not low enough, 4h high, 1d overbought
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 60.0)
| (df["ROC_9_1d"] < 200.0)
)
# 15m & 1h & 4h down move, 15m & 1h still high, 4h high, 15m & 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["ROC_9_4h"] < 20.0)
)
# 15m & 1h down move, 15m still not low enough, 1h still high, 15m high, 4h high & overbought
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 80.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
| (df["ROC_9_4h"] < 40.0)
)
# 15m & 1h & 4h down move, 15m & 1h high
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 45.0)
| (df["AROONU_14_15m"] < 70.0)
| (df["AROONU_14_1h"] < 100.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 15m & 1h & 4h & 1d down move, 15m & 1h & 4h still high, 15m & 1h high, 1d overbought
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_3_1d"] > 45.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["ROC_9_1d"] < 50.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still highm 15m & 1h high, 1h still high, 4h high
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_1h"] < 85.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 15m & 4h high, 4h & 1d overbought
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 60.0)
| (df["ROC_9_4h"] < 10.0)
| (df["ROC_9_1d"] < 50.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 15m & 4h high, 1d overbought
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 70.0)
| (df["AROONU_14_4h"] < 85.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["ROC_9_1d"] < 40.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h still high, 1h & 4h downtrend, 1h still high, 4h high
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_1h"] > -0.30)
| (df["CMF_20_1h"] > -0.30)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 80.0)
)
# 15m & 1h down move, 15m still not low enough, 1h still high, 4h high & overbought
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 80.0)
| (df["STOCHk_14_3_3_1h"] < 60.0)
| (df["STOCHk_14_3_3_4h"] < 90.0)
| (df["ROC_9_4h"] < 80.0)
)
# 15m & 1h & 4h down move, 15m high
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_3_4h"] > 50.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 90.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 15m high, 1d overbought
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 50.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 70.0)
| (df["ROC_9_1d"] < 80.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 15m & 1h & 4h still high
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h stil high, 1h & 4h high, 1h overbought
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 30.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["ROC_9_1h"] < 10.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 15m still high, 4h overbought
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["ROC_9_4h"] < 80.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 15m & 4h high, 1d overbought
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["ROC_9_1d"] < 75.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 15m & 1h high
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_1h"] > 60.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 70.0)
| (df["AROONU_14_1h"] < 90.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 4h downtrend, 15m high
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_1h"] > 60.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_4h"] > -0.10)
| (df["AROONU_14_15m"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 70.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 15m still not low enough, 4h & 1h still high, 1d overbought
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_1h"] > 60.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 20.0)
| (df["AROONU_14_4h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["ROC_9_1d"] < 150.0)
)
# 15m & 1h down move, 15m & 1h & 4h high, 1h overbought
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_1h"] > 65.0)
| (df["RSI_14_15m"] < 50.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 90.0)
| (df["ROC_9_1h"] < 20.0)
)
# 15m & 4h down move, 15m & 1h high, 4h downtrend
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_4h"] > 10.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
| (df["ROC_9_4h"] > -30.0)
)
# 15m & 4h down move, 15m still high, 1h high, 15m & 1h high
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 70.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_1h"] < 100.0)
)
# 15m & 4h down move, 15m still not low enough, 1h & 4h still high, 15m & 1h high
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 70.0)
| (df["AROONU_14_1h"] < 100.0)
)
# 15m & 4h down move, 15m still not low enough, 1h & 4h still high, 1h & 4h downtrend, 15m & 1h still high
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_1h"] > -0.25)
| (df["CMF_20_4h"] > -0.25)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
)
# 15m & 4h down move, 15m & 1h & 4h still high, 15m & 1h high, 4h downtrend
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
| (df["ROC_9_4h"] > -20.0)
)
# 15m down move, 15m still high, 1h & 4h high, 1h & 4h overbought
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_14_15m"] < 50.0)
| (df["RSI_14_1h"] < 60.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 60.0)
| (df["ROC_9_1h"] < 20.0)
| (df["ROC_9_4h"] < 20.0)
)
# 15m down move, 15m & 1h still high, 4h high, 15m downtrend, 15m high, 1h & 4h overbought
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 60.0)
| (df["CMF_20_15m"] > -0.10)
| (df["AROONU_14_15m"] < 70.0)
| (df["ROC_9_1h"] < 15.0)
| (df["ROC_9_4h"] < 80.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 15m downtrend, 4h high & overbought
& (
(df["RSI_3_15m"] > 40.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_15m"] > -0.30)
| (df["AROONU_14_4h"] < 70.0)
| (df["ROC_9_4h"] < 70.0)
)
# 15m & 1h & 4h down move, 15m & 1h sitll not low enough, 4h still high, 15m high
& (
(df["RSI_3_15m"] > 40.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_4h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 70.0)
)
# 15m & 1h & 4h & 1d down move, 1d downtrend, 4h still not low enough, 15m still high, 1h downtrend
& (
(df["RSI_3_15m"] > 40.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_3_1d"] > 45.0)
| (df["CMF_20_1d"] > -0.40)
| (df["AROONU_14_4h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["ROC_9_1h"] > -25.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h downtrend, 4h high
& (
(df["RSI_3_15m"] > 40.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 45.0)
| (df["CMF_20_15m"] > -0.40)
| (df["CMF_20_1h"] > -0.40)
| (df["CMF_20_4h"] > -0.40)
| (df["AROONU_14_4h"] < 75.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 4h high & overbought
& (
(df["RSI_3_15m"] > 40.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 30.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["ROC_9_4h"] < 50.0)
)
# 15m & 1h down move, 15m still not low enough, 1h still high, 4h high & overbought
& (
(df["RSI_3_15m"] > 40.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 90.0)
| (df["AROONU_14_4h"] < 90.0)
| (df["ROC_9_4h"] < 80.0)
)
# 15m & 1h down move, 15m still not low enough, 1h still high, 4h high, 15m still high, 4h high & overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_15m"] < 40.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["ROC_9_4h"] < 100.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 15m high, 1h & 4h downtrend
& (
(df["RSI_3_15m"] > 40.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 60.0)
| (df["ROC_9_1h"] > -30.0)
| (df["ROC_9_4h"] > -40.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 15m & 1h high
& (
(df["RSI_3_15m"] > 40.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_1h"] < 100.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h high
& (
(df["RSI_3_15m"] > 40.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 55.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_1h"] < 100.0)
| (df["AROONU_14_4h"] < 100.0)
)
# 15m & 1h & 4h & 1d down move, 15m & 1h & 4h still high, 15m & 1h high, 1d overbought
& (
(df["RSI_3_15m"] > 40.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_3_1d"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_1h"] < 85.0)
| (df["ROC_9_1d"] < 50.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 4h downtrend, 4h overbought
& (
(df["RSI_3_15m"] > 40.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_4h"] > -0.15)
| (df["AROONU_14_4h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
| (df["ROC_9_4h"] < 25.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 4h high & overbought
& (
(df["RSI_3_15m"] > 40.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["ROC_9_4h"] < 50.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 1h & 4h downtrend, 1h high, 4h overbought
& (
(df["RSI_3_15m"] > 40.0)
| (df["RSI_3_1h"] > 65.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_1h"] > -0.10)
| (df["CMF_20_4h"] > -0.30)
| (df["AROONU_14_15m"] < 20.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["ROC_9_4h"] < 10.0)
)
# 15m & 1h down move, 15m & 1h & 4h still high, 15m still high, 1h high, 1h overbought
& (
(df["RSI_3_15m"] > 40.0)
| (df["RSI_3_1h"] > 65.0)
| (df["RSI_14_15m"] < 50.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_1h"] < 85.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
| (df["ROC_9_1h"] < 20.0)
)
# 15m &4h down move, 15m & 1h & 4h still high, 15m still high, 1h high, 15m & 1h overbought
& (
(df["RSI_3_15m"] > 40.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 40.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["ROC_9_15m"] < 10.0)
| (df["ROC_9_1h"] < 40.0)
)
# 15m & 4h down move, 15m & 1h & 4h still high, 15m & 1h high, 1h overbought
& (
(df["RSI_3_15m"] > 40.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
| (df["ROC_9_1h"] < 20.0)
)
# 15m & 1d down move, 15m & 1h & 4h stil high, 4h high, 15m & 1h & 4h still high
& (
(df["RSI_3_15m"] > 40.0)
| (df["RSI_3_1d"] > 20.0)
| (df["RSI_14_15m"] < 50.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m down move, 15m & 1h still high, 4h high & overbought
& (
(df["RSI_3_15m"] > 40.0)
| (df["RSI_14_15m"] < 50.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 90.0)
| (df["AROONU_14_1h"] < 40.0)
| (df["AROONU_14_4h"] < 85.0)
| (df["ROC_9_4h"] < 100.0)
)
# 15m down move, 15m still high, 1h & 4h high & overbought
& (
(df["RSI_3_15m"] > 40.0)
| (df["RSI_14_15m"] < 50.0)
| (df["RSI_14_1h"] < 70.0)
| (df["RSI_14_4h"] < 80.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_1h"] < 70.0)
| (df["ROC_9_4h"] < 80.0)
)
# 15m down move, 15m & 1h & 4h still high, 15m & 1h & 4h high
& (
(df["RSI_3_15m"] > 40.0)
| (df["RSI_14_15m"] < 50.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_1h"] < 100.0)
| (df["AROONU_14_4h"] < 100.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 15m & 4h still high, 4h & 1d overbought
& (
(df["RSI_3_15m"] > 45.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_4h"] < 50.0)
| (df["ROC_9_4h"] < 40.0)
| (df["ROC_9_1d"] < 100.0)
)
# 15m & 1h down move, 15m & 1h & 4h still high, 15m & 1h & 4h downtrend, 4h high
& (
(df["RSI_3_15m"] > 45.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_15m"] > -0.10)
| (df["CMF_20_1h"] > -0.10)
| (df["CMF_20_4h"] > -0.10)
| (df["AROONU_14_4h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m & 1h down move, 15m & 1h & 4h still high, 1h & 4h & 1d downtrend, 1h & 4h high
& (
(df["RSI_3_15m"] > 45.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_1h"] > -0.10)
| (df["CMF_20_4h"] > -0.10)
| (df["CMF_20_1d"] > -0.30)
| (df["AROONU_14_1h"] < 70.0)
| (df["AROONU_14_4h"] < 90.0)
)
# 15m & 1h down move, 1h & 4h still high, 4h high, 1h & 4h overbought
& (
(df["RSI_3_15m"] > 45.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
| (df["ROC_9_1h"] < 30.0)
| (df["ROC_9_4h"] < 100.0)
)
# 15m & 1h & 4h & 1d down move, 15m still not low enough, 1h & 4h still high, 15m still high, 1d overbought
& (
(df["RSI_3_15m"] > 45.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_3_1d"] > 50.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["ROC_9_1d"] < 80.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 15m still high, 4h high & overbought
& (
(df["RSI_3_15m"] > 45.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["ROC_9_4h"] < 40.0)
)
# 15m & 1h down move, 15m & 1h still high, 4h high, 1h & 4h high, 1h & 4h overbought
& (
(df["RSI_3_15m"] > 45.0)
| (df["RSI_3_1h"] > 60.0)
| (df["RSI_14_15m"] < 50.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["AROONU_14_4h"] < 90.0)
| (df["ROC_9_1h"] < 30.0)
| (df["ROC_9_4h"] < 80.0)
)
# 15m & 1h down move, 15m still high, 1h high, 15m overbought
& (
(df["RSI_3_15m"] > 45.0)
| (df["RSI_3_1h"] > 60.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_1h"] < 100.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
| (df["ROC_9_15m"] < 20.0)
)
# 15m & 4h down move, 15m & 1h & 4h still not low enough, 15m & 1h & 4h downtrend, 1h & 4h still high
& (
(df["RSI_3_15m"] > 45.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_15m"] > -0.15)
| (df["CMF_20_1h"] > -0.25)
| (df["CMF_20_4h"] > -0.35)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m down move, 15m & 1h & 4h high, 15m & 1h high, 4h & 1d overbought
& (
(df["RSI_3_15m"] > 45.0)
| (df["RSI_14_15m"] < 50.0)
| (df["RSI_14_1h"] < 60.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_15m"] < 70.0)
| (df["AROONU_14_1h"] < 100.0)
| (df["ROC_9_4h"] < 10.0)
| (df["ROC_9_1d"] < 40.0)
)
# 15m down move, 15m & 1h & 4h high, 1h & 4h high, 1h & 4h overbought
& (
(df["RSI_3_15m"] > 45.0)
| (df["RSI_14_15m"] < 50.0)
| (df["RSI_14_1h"] < 70.0)
| (df["RSI_14_4h"] < 80.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_1h"] < 40.0)
| (df["ROC_9_4h"] < 100.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 15m downtrend, 15m & 4h high
& (
(df["RSI_3_15m"] > 55.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_15m"] > -0.10)
| (df["AROONU_14_1h"] < 30.0)
| (df["AROONU_14_4h"] < 85.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 70.0)
)
# 15m & 1h down move, 15m & 1h & 4h high, 1h & 4h overbought
& (
(df["RSI_3_15m"] > 55.0)
| (df["RSI_3_1h"] > 65.0)
| (df["RSI_14_15m"] < 50.0)
| (df["RSI_14_1h"] < 60.0)
| (df["RSI_14_4h"] < 80.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_1h"] < 30.0)
| (df["ROC_9_4h"] < 70.0)
)
# 1h & 4h down move, 15m high
& ((df["RSI_3_1h"] > 3.0) | (df["RSI_3_4h"] > 3.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0))
# 1h & 4h down move, 4h still not low enough
& ((df["RSI_3_1h"] > 3.0) | (df["RSI_3_4h"] > 3.0) | (df["AROONU_14_4h"] < 20.0))
# 1h & 4h down move, 15m still not low enough, 4h downtrend
& ((df["RSI_3_1h"] > 3.0) | (df["RSI_3_4h"] > 5.0) | (df["RSI_14_15m"] < 30.0) | (df["CMF_20_4h"] > -0.30))
# 1h & 4h down move, 1h downtrend, 4h still high
& ((df["RSI_3_1h"] > 3.0) | (df["RSI_3_4h"] > 20.0) | (df["CMF_20_1h"] > -0.30) | (df["AROONU_14_4h"] < 50.0))
# 1h & 4h down move, 1h still not low enough, 4h still high, 1d overbought
& (
(df["RSI_3_1h"] > 3.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 50.0)
| (df["ROC_9_1d"] < 80.0)
)
# 1h & 4h & 1d down move, 1d still not low enough, 1d downtrend
& (
(df["RSI_3_1h"] > 5.0)
| (df["RSI_3_4h"] > 5.0)
| (df["RSI_3_1d"] > 10.0)
| (df["AROONU_14_1d"] < 25.0)
| (df["ROC_9_1d"] > -30.0)
)
# 1h & 4h down move, 1h & 4h downtrend
& ((df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 10.0) | (df["CMF_20_1h"] > -0.5) | (df["CMF_20_4h"] > -0.5))
# 1h & 4h down move, 15m & 1h & 4h downtrend, 1h & 4h still high
& (
(df["RSI_3_1h"] > 5.0)
| (df["RSI_3_4h"] > 20.0)
| (df["CMF_20_15m"] > -0.20)
| (df["CMF_20_1h"] > -0.20)
| (df["CMF_20_4h"] > -0.20)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 50.0)
)
# 1h & 4h down move, 15m & 1hg downtrend, 4h downtrend
& (
(df["RSI_3_1h"] > 5.0)
| (df["RSI_3_4h"] > 20.0)
| (df["CMF_20_15m"] > -0.40)
| (df["CMF_20_1h"] > -0.40)
| (df["ROC_9_4h"] > -20.0)
)
# 1h & 4h down move, 1h still high, 4h high, 1d overbought
& (
(df["RSI_3_1h"] > 5.0)
| (df["RSI_3_4h"] > 30.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 85.0)
| (df["ROC_9_1d"] < 50.0)
)
# 1h & 4h down move, 1h & 4h still high, 4h high, 15m & 1h downtrend
& (
(df["RSI_3_1h"] > 5.0)
| (df["RSI_3_4h"] > 40.0)
| (df["AROONU_14_1h"] < 40.0)
| (df["AROONU_14_4h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
| (df["ROC_9_15m"] > -10.0)
| (df["ROC_9_1h"] > -20.0)
)
# 1h & 4h down move, 15m & 1h still not low enough, 4h high, 1d overbought
& (
(df["RSI_3_1h"] > 5.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["ROC_9_1d"] < 100.0)
)
# 1h & 4h down move, 15m & 1h & 4h downtrend, 1h high
& (
(df["RSI_3_1h"] > 10.0)
| (df["RSI_3_4h"] > 20.0)
| (df["CMF_20_15m"] > -0.0)
| (df["CMF_20_1h"] > -0.30)
| (df["CMF_20_4h"] > -0.30)
| (df["AROONU_14_1h"] < 60.0)
)
# 1h & 4h down move, 1h & 4h downtrend, 1h high
& (
(df["RSI_3_1h"] > 10.0)
| (df["RSI_3_4h"] > 20.0)
| (df["CMF_20_1h"] > -0.40)
| (df["CMF_20_4h"] > -0.40)
| (df["AROONU_14_1h"] < 60.0)
)
# 1h & 4h & 1d down move, 1h & 4h still not low enough, 1h & 4h downtrend, 1h still not low enough
& (
(df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 15.0)
| (df["RSI_3_1d"] > 15.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 20.0)
| (df["CMF_20_1h"] > -0.10)
| (df["CMF_20_4h"] > -0.20)
| (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
)
# 1h & 4h down move, 1h & 4h still not low enough, 15m high, 1h & 4h downtrend
& (
(df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 15.0)
| (df["AROONU_14_1h"] < 20.0)
| (df["AROONU_14_4h"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 80.0)
| (df["ROC_9_1h"] > -30.0)
| (df["ROC_9_4h"] > -30.0)
)
# 1h & 4h down move, 15m & 1h still not low enough, 4h still high, 1h & 4h downtrend
& (
(df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_1h"] > -0.20)
| (df["CMF_20_4h"] > -0.10)
| (df["AROONU_14_1h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
| (df["ROC_9_1h"] > -10.0)
)
# 1h & 4h down move, 1h still not low enough, 4h downtrend
& (
(df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 3.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
| (df["ROC_9_4h"] > -25.0)
)
# 1h & 4h down move, 1h & 4h downtrend, 1h high, 4h downtrend
& (
(df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 30.0)
| (df["CMF_20_1h"] > -0.20)
| (df["CMF_20_4h"] > -0.25)
| (df["AROONU_14_1h"] < 80.0)
| (df["ROC_9_4h"] > -30.0)
)
# 1h & 4h & 1d down move, 1h & 4h still not low enough, 1d high & overbought
& (
(df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_3_1d"] > 60.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_4h"] < 40.0)
| (df["AROONU_14_1d"] < 70.0)
| (df["ROC_9_1d"] < 100.0)
)
# 1h & 1d down move, 15m & 1h & 4h still not low enough, 15m & 1h downtrend, 1h still high
& (
(df["RSI_3_1h"] > 20.0)
| (df["RSI_3_1d"] > 30.0)
| (df["RSI_14_15m"] < 10.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_15m"] > -0.30)
| (df["CMF_20_1h"] > -0.30)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 1h & 4h & 1d down move, 1h still not low enough, 4h still high, 1d downtrend
& (
(df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_3_1d"] > 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
| (df["ROC_9_1d"] > -30.0)
)
# 1h & 4h down move, 1h & 4h still not low enough, 4h still high, 1h & 4h downtrend, 1d overbought
& (
(df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 40.0)
| (df["ROC_9_1h"] > -20.0)
| (df["ROC_9_4h"] > -20.0)
| (df["ROC_9_1d"] < 80.0)
)
# 5m & 15m & 1h & 4h down move, 15m downtrend, 4h high, 1d overbought
& (
(df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 25.0)
| (df["CMF_20_15m"] > -0.5)
| (df["CMF_20_1h"] > -0.3)
| (df["CMF_20_4h"] > -0.3)
| (df["AROONU_14_1h"] < 50.0)
)
# 1h & 4h down move, 1h & 4h high, 4h overbought
& (
(df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
| (df["ROC_9_4h"] < 80.0)
)
# 1h & 4h & 1d down move, 15m & 1h & 4h still not low enough, 4h still high
& (
(df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_3_1d"] > 5.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
)
# 1h & 4h down move, 1h & 4h still high, 1h still not low enough, 4h still high, 1h downtrend, 4h & 1d overbought
& (
(df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_1h"] < 25.0)
| (df["AROONU_14_4h"] < 50.0)
| (df["ROC_9_1h"] > -10.0)
| (df["ROC_9_4h"] < 20.0)
| (df["ROC_9_1d"] < 100.0)
)
# 1h & 4h down move, 1h & 4h still high, 4h high, 1h & 4h overbought
& (
(df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 85.0)
| (df["ROC_9_1h"] < 10.0)
| (df["ROC_9_4h"] < 25.0)
)
# 1h down move, 1h still high, 4h overbought
& ((df["RSI_3_1h"] > 55.0) | (df["RSI_14_1h"] < 40.0) | (df["ROC_9_4h"] < 300.0))
# 1h & 1d down move, 1h & 4h & 1d still high, 1h & 4h high, 4h overbought
& (
(df["RSI_3_1h"] > 60.0)
| (df["RSI_3_1d"] > 25.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 60.0)
| (df["MFI_14_1d"] < 50.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["AROONU_14_4h"] < 90.0)
| (df["ROC_9_4h"] < 25.0)
)
# 4h down move, 15m & 1h & 4h still not low enough
& ((df["RSI_3_4h"] > 3.0) | (df["RSI_14_15m"] < 20.0) | (df["RSI_14_1h"] < 20.0) | (df["RSI_14_4h"] < 30.0))
# 4h down move, 1h & 4h downtrend, 1h still not low enough
& ((df["RSI_3_4h"] > 3.0) | (df["CMF_20_1h"] > -0.20) | (df["CMF_20_4h"] > -0.25) | (df["AROONU_14_1h"] < 30.0))
# 4h down move, 1h & 4h downtrend, 1h & 4h & 1d downtrend
& (
(df["RSI_3_4h"] > 3.0)
| (df["CMF_20_1h"] > -0.20)
| (df["CMF_20_4h"] > -0.35)
| (df["CCI_20_change_pct_4h"] > 0.0)
| (df["ROC_9_1h"] > -20.0)
| (df["ROC_9_4h"] > -25.0)
| (df["ROC_9_1d"] > -25.0)
)
# 4h down move, 15m downtrend, 15m still not low enough, 1h high
& (
(df["RSI_3_4h"] > 3.0)
| (df["CMF_20_15m"] > -0.20)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 4h down move, 1h & 4h downtrend, 15m high
& (
(df["RSI_3_4h"] > 3.0)
| (df["CMF_20_1h"] > -0.25)
| (df["CMF_20_4h"] > -0.30)
| (df["STOCHRSIk_14_14_3_3_15m"] < 70.0)
)
# 4h down move, 15m & 1h high
& ((df["RSI_3_4h"] > 3.0) | (df["AROONU_14_15m"] < 60.0) | (df["AROONU_14_1h"] < 90.0))
# 4h down move, 15m high, 4h still high
& (
(df["RSI_3_4h"] > 3.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
)
# 4h down move, 15m & 1h high, 4h downtrend
& (
(df["RSI_3_4h"] > 3.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["ROC_9_4h"] > -20.0)
)
# 4h & 1d down move, 15m still not low enough, 4h downtrend
& (
(df["RSI_3_4h"] > 5.0)
| (df["RSI_3_1d"] > 5.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
| (df["ROC_9_4h"] > -40.0)
)
# 4h down move, 15m & 1h & 4h still not low enough, 1h & 4h downtrend, 4h & 15m still not low enough
& (
(df["RSI_3_4h"] > 5.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 20.0)
| (df["CMF_20_1h"] > -0.20)
| (df["CMF_20_4h"] > -0.20)
| (df["AROONU_14_4h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
)
# 4h down move, 1h & 4h downtrend, 1h still not low enough, 4h high
& (
(df["RSI_3_4h"] > 5.0)
| (df["CMF_20_1h"] > -0.10)
| (df["CMF_20_4h"] > -0.20)
| (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
)
# 4h down mnove, 15m & 1h & 4h downtrend, 15m high, 4h downtrend
& (
(df["RSI_3_4h"] > 10.0)
| (df["CMF_20_15m"] > -0.25)
| (df["CMF_20_1h"] > -0.10)
| (df["CMF_20_4h"] > -0.10)
| (df["AROONU_14_15m"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 70.0)
| (df["ROC_9_4h"] > -30.0)
)
# 4h down move, 15m & 1h & 4h still high, 15m high
& (
(df["RSI_3_4h"] > 10.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 70.0)
)
# 4h & 1d down move, 15m & 1h still not low enough, 4h still high, 4h downtrend, 1d overbought
& (
(df["RSI_3_4h"] > 15.0)
| (df["RSI_3_1d"] > 65.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 40.0)
| (df["ROC_9_4h"] > -40.0)
| (df["ROC_9_1d"] < 200.0)
)
# 4h & 1d down move, 1h still high, 4h high, 1d downtrend
& (
(df["RSI_3_4h"] > 25.0)
| (df["RSI_3_1d"] > 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_1d"] > -40.0)
)
# 4h down move, 1h & 4h still not low enough, 15m high, 4h downtrend
& (
(df["RSI_3_4h"] > 25.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["ROC_9_4h"] > -50.0)
)
# 4h & 1d down move, 15m & 1h & 4h still not low enough, 4h downtrend, 1h still high, 4h downtrend
& (
(df["RSI_3_4h"] > 30.0)
| (df["RSI_3_1d"] > 40.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 20.0)
| (df["CMF_20_4h"] > -0.25)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["ROC_9_4h"] > -60.0)
)
# 4h down move, 15m & 1h & 4h still high, 15m high, 4h still not low enough, 1d overbought
& (
(df["RSI_3_4h"] > 35.0)
| (df["RSI_14_15m"] < 50.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
| (df["ROC_9_1d"] < 50.0)
)
# 4h down move, 15m high, 15m & 1h & 4h high, 4h & 1d overbought
& (
(df["RSI_3_4h"] > 55.0)
| (df["AROONU_14_15m"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
| (df["ROC_9_4h"] < 20.0)
| (df["ROC_9_1d"] < 30.0)
)
# 1d down move, 15m & 1h still not low enough, 4h & 1d downtrend
& (
(df["RSI_3_1d"] > 3.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
| (df["ROC_9_4h"] > -30.0)
| (df["ROC_9_1d"] > -50.0)
)
# 1d down move, 1h & 4h still not low enough, 1h still high & overbought, 1d downtrend
& (
(df["RSI_3_1d"] > 3.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["ROC_9_1h"] < 10.0)
| (df["ROC_9_1d"] > -30.0)
)
# 1d down move, 15m & 1h & 4h still not low enough, 15m still not low enough, 1h high
& (
(df["RSI_3_1d"] > 5.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["AROONU_14_15m"] < 30.0)
| (df["AROONU_14_1h"] < 85.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
)
# 1d down move, 15m still not low enough, 1h high, 1d downtrend
& (
(df["RSI_3_1d"] > 5.0)
| (df["RSI_14_15m"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
| (df["ROC_2_1d"] > -40.0)
)
# 1d down move, 15m high, 1h & 4h downtrend
& (
(df["RSI_3_1d"] > 5.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 70.0)
| (df["ROC_9_1h"] > -60.0)
| (df["ROC_9_4h"] > -60.0)
)
# 1d down move, 1h still high, 4h high
& ((df["RSI_3_1d"] > 5.0) | (df["AROONU_14_1h"] < 40.0) | (df["AROONU_14_4h"] < 70.0))
# 1d down move, 4h high, 1h & 4h downtrend
& (
(df["RSI_3_1d"] > 5.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
| (df["ROC_9_1h"] > -10.0)
| (df["ROC_9_4h"] > -10.0)
)
# 1d down move, 1h high & overbought, 4h & 1d downtrend
& (
(df["RSI_3_1d"] > 10.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
| (df["ROC_9_1h"] < 10.0)
| (df["ROC_9_4h"] > -40.0)
| (df["ROC_9_1d"] > -40.0)
)
# 1d down move, 1h & 4h still high, 1h & 4h downtrend, 1h & 4h high, 1d downtrend
& (
(df["RSI_3_1d"] > 10.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_1h"] > -0.40)
| (df["CMF_20_4h"] > -0.10)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 85.0)
| (df["ROC_9_1d"] > -40.0)
)
# 15m & 1h & 4h still high, 4h downtrend, 4h overbought
& (
(df["RSI_14_15m"] < 50.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 60.0)
| (df["CMF_20_4h"] > -0.2)
| (df["ROC_9_4h"] < 250.0)
)
# 4h red, 15m & 1h & 4h down move, 1h & 4h still high, 4h high
& (
(df["change_pct_4h"] > -30.0)
| (df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_4h"] < 70.0)
)
# 4h P&D, 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 1h & 4h high
& (
(df["change_pct_4h"] > -5.0)
| (df["change_pct_4h"].shift(48) < 5.0)
| (df["RSI_3_15m"] > 40.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 100.0)
)
# 4h green with top wick, 15m & 1h down move, 15m still not low enough, 1h & 4h high
& (
(df["change_pct_4h"] < 10.0)
| (df["top_wick_pct_4h"] < 10.0)
| (df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 60.0)
| (df["AROONU_14_4h"] < 90.0)
)
# 4h green with top wick, 1h down move, 1h still high, 4h high, 1d overbought
& (
(df["change_pct_4h"] < 10.0)
| (df["top_wick_pct_4h"] < 10.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["AROONU_14_4h"] < 90.0)
| (df["ROC_9_1d"] < 20.0)
)
# 4h green with top wick, 15m & 1h down move, 1h still high, 4h high
& (
(df["change_pct_4h"] < 15.0)
| (df["top_wick_pct_4h"] < 15.0)
| (df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 35.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 100.0)
)
# 4h green with top wick, 15m & 1h down move, 1h & 4h high
& (
(df["change_pct_4h"] < 15.0)
| (df["top_wick_pct_4h"] < 10.0)
| (df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 40.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 100.0)
)
# 4h green, 15m & 1h down move, 15m still not low enough, 1h & 4h high
& (
(df["change_pct_4h"] < 15.0)
| (df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["AROONU_14_4h"] < 100.0)
)
# 1d red, 1h & 4h down move, 1h still high, 4d downtrend
& (
(df["change_pct_1d"] > -40.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_3_4h"] > 10.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["ROC_9_4h"] > -35.0)
)
# 1d P&D, 15m & 4h down move, 15m & 4h still high
& (
(df["change_pct_1d"] > -20.0)
| (df["change_pct_1d"].shift(288) < 20.0)
| (df["RSI_3_15m"] > 20.0)
| (df["RSI_3_4h"] > 25.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 1d red, 15m & 1h & 4h down move, 1h still not low enough, 4h & 1d still high
& (
(df["change_pct_1d"] > -20.0)
| (df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_1h"] < 35.0)
| (df["RSI_14_4h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_1d"] < 50.0)
)
# 1d red, 1h & 4h & 1d down move, 1h still not low enough, 4h & 1d still high, 1d downtrend
& (
(df["change_pct_1d"] > -20.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_3_1d"] > 50.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["RSI_14_1d"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
| (df["ROC_9_1d"] > -20.0)
)
# 1d red, 15m & 1h & 4h down move, 1d high, 15m & 1h still high
& (
(df["change_pct_1d"] > -20.0)
| (df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_3_4h"] > 55.0)
| (df["AROONU_14_1d"] < 85.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 1d P&D, 15m & 1h & 4h down move, 15m & 1h & 4h still high, 15m & 4h still high
& (
(df["change_pct_1d"] > -15.0)
| (df["change_pct_1d"].shift(288) < 15.0)
| (df["RSI_3_15m"] > 50.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_4h"] < 50.0)
)
# 1d P&D, 15m & 1h & 4h & 1d down move, 4h still not low enough
& (
(df["change_pct_1d"] > -10.0)
| (df["change_pct_1d"].shift(288) < 10.0)
| (df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 10.0)
| (df["RSI_3_1d"] > 40.0)
| (df["RSI_14_4h"] < 30.0)
)
# 1d P&D, 15m & 1h down move, 1h still not low enough, 4h still high, 15m downtrend, 1h still high
& (
(df["change_pct_1d"] > -10.0)
| (df["change_pct_1d"].shift(288) < 10.0)
| (df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_15m"] > -0.30)
| (df["AROONU_14_1h"] < 50.0)
)
# 1d P&D, 15m down move, 1h high
& (
(df["change_pct_1d"] > -10.0)
| (df["change_pct_1d"].shift(288) < 20.0)
| (df["top_wick_pct_1d"].shift(288) < 20.0)
| (df["RSI_3_15m"] > 35.0)
| (df["AROONU_14_1h"] < 70.0)
)
# 1d P&D, 15m & 1h & 4h down move, 15m & 1h still not low enough, 4h still high, 1d overbought
& (
(df["change_pct_1d"] > -10.0)
| (df["change_pct_1d"].shift(288) < 20.0)
| (df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 50.0)
| (df["ROC_9_1d"] < 25.0)
)
# 1d P&D, 15m & 1h & 4h down move, 15m & 1h still not low enough, 4h still high, 1h & 4h downtrend, 1d overbought
& (
(df["change_pct_1d"] > -10.0)
| (df["change_pct_1d"].shift(288) < 50.0)
| (df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["ROC_9_1h"] > -10.0)
| (df["ROC_9_4h"] > -10.0)
| (df["ROC_9_1d"] < 100.0)
)
# 1d red with top wick, 15m & 1h down move, 1h downtrend, 1h high
& (
(df["change_pct_1d"] > -10.0)
| (df["top_wick_pct_1d"] < 10.0)
| (df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 25.0)
| (df["CMF_20_1h"] > -0.2)
| (df["AROONU_14_1h"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 1d P&D, 15m & 1h down move, 15m still not low enough, 1h & 4h still high, 1d overbought
& (
(df["change_pct_1d"] > -5.0)
| (df["change_pct_1d"].shift(288) < 10.0)
| (df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["ROC_9_1d"] < 100.0)
)
# 1d P&D, 15m & 1h & 4h down move, 1h & 4h still not low enough, 1h & 4h downtrend, 1d overbought
& (
(df["change_pct_1d"] > -5.0)
| (df["change_pct_1d"].shift(288) < 10.0)
| (df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 30.0)
| (df["AROONU_14_1h"] < 30.0)
| (df["AROONU_14_4h"] < 30.0)
| (df["ROC_9_1h"] > -25.0)
| (df["ROC_9_4h"] > -25.0)
| (df["ROC_9_1d"] < 50.0)
)
# 1d red, 15m & 1h & 4h down move, 1h & 4h still not low enough, 1d high, 4h downtrend, 1d overbought
& (
(df["change_pct_1d"] > -5.0)
| (df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_1d"] < 85.0)
| (df["ROC_9_4h"] > -30.0)
| (df["ROC_9_1d"] < 20.0)
)
# 1d green with top wick, 15m & 1h & 1d down move, 1h still not low enough, 4h still high, 1d overbought
& (
(df["change_pct_1d"] < 10.0)
| (df["top_wick_pct_1d"] < 10.0)
| (df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_1d"] > 65.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
| (df["ROC_9_1d"] < 20.0)
)
# 1d green with top wick, 15m & 1h & 4h down move, 1h & 4h still high
& (
(df["change_pct_1d"] < 10.0)
| (df["top_wick_pct_1d"] < 10.0)
| (df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 30.0)
| (df["AROONU_14_4h"] < 60.0)
)
# 1d green with top wick, 15m down move, 1h & 4h high, 1d overbought
& (
(df["change_pct_1d"] < 10.0)
| (df["top_wick_pct_1d"] < 10.0)
| (df["RSI_3_15m"] > 10.0)
| (df["RSI_14_1h"] < 70.0)
| (df["RSI_14_4h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
| (df["ROC_9_1d"] < 40.0)
)
# 1d green with top wick, 15m down move, 15m & 1h still high, 4h & 1d high, 4h overbought
& (
(df["change_pct_1d"] < 10.0)
| (df["top_wick_pct_1d"] < 10.0)
| (df["RSI_3_15m"] > 10.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 75.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["AROONU_14_1d"] < 90.0)
| (df["ROC_9_4h"] < 25.0)
)
# 1d green with top wick, 15m & 1h & 4h down move, 15m still not low enough, 1h still high, 4h high
& (
(df["change_pct_1d"] < 10.0)
| (df["top_wick_pct_1d"] < 10.0)
| (df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_15m"] < 30.0)
| (df["AROONU_14_4h"] < 60.0)
)
# 1d green with top wick, 15m down move, 15m & 1h still high, 4h high & overbought
& (
(df["change_pct_1d"] < 10.0)
| (df["top_wick_pct_1d"] < 10.0)
| (df["RSI_3_15m"] > 15.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 80.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["ROC_9_4h"] < 80.0)
)
# 1d green with top wick, 1h & 4h down move, 1h & 4h still high
& (
(df["change_pct_1d"] < 10.0)
| (df["top_wick_pct_1d"] < 10.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_3_4h"] > 55.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 50.0)
)
# 1d green with top wick, 15m & 1h down move, 15m & 1h & 4h still high, 4h high & overbought
& (
(df["change_pct_1d"] < 20.0)
| (df["top_wick_pct_1d"] < 20.0)
| (df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["ROC_9_4h"] < 20.0)
)
# 1d green with top wick, 1h & 4h down move, 1h still not low enough, 4h still high, 4h & 1d overbought
& (
(df["change_pct_1d"] < 20.0)
| (df["top_wick_pct_1d"] < 20.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 50.0)
| (df["ROC_9_4h"] < 10.0)
| (df["ROC_9_1d"] < 50.0)
)
# 1d green with top wick, 15m down move, 15m & 1h & 4h still high, 4h & 1d overbought
& (
(df["change_pct_1d"] < 25.0)
| (df["top_wick_pct_1d"] < 25.0)
| (df["RSI_3_15m"] > 40.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
| (df["ROC_9_4h"] < 20.0)
| (df["ROC_9_1d"] < 50.0)
)
# 1d green with top wick, 15m & 1h & 4h down move, 15m still not low enough, 4h high, 1d overbought
& (
(df["change_pct_1d"] < 30.0)
| (df["top_wick_pct_1d"] < 10.0)
| (df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 70.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_15m"] < 25.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["ROC_9_1d"] < 40.0)
)
# 1d green with top wick, 15m & 1h & 4h down move, 1h still not low enough, 4h still high, 1d overbought
& (
(df["change_pct_1d"] < 30.0)
| (df["top_wick_pct_1d"] < 20.0)
| (df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 40.0)
| (df["AROONU_14_1h"] < 20.0)
| (df["AROONU_14_4h"] < 50.0)
| (df["ROC_9_1d"] < 100.0)
)
# 1d green with top wick, 15m down move, 15m & 1h still high, 4h high & overbought
& (
(df["change_pct_1d"] < 30.0)
| (df["top_wick_pct_1d"] < 20.0)
| (df["RSI_3_15m"] > 35.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 80.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["ROC_9_4h"] < 50.0)
)
# 1d green with top wick, 1h down move, 1h still high, 4h high & overbought, 1d overbought
& (
(df["change_pct_1d"] < 30.0)
| (df["top_wick_pct_1d"] < 20.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["ROC_9_4h"] < 40.0)
| (df["ROC_9_1d"] < 50.0)
)
# 1d green with top wick, 15m & 1h down move, 1h & 4h still high, 4h overbought
& (
(df["change_pct_1d"] < 30.0)
| (df["top_wick_pct_1d"] < 30.0)
| (df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["ROC_9_4h"] < 30.0)
)
# 1d green with top wick, 15m & 4h down move, 15m & 1h still high, 1d overbought
& (
(df["change_pct_1d"] < 30.0)
| (df["top_wick_pct_1d"] < 30.0)
| (df["RSI_3_15m"] > 50.0)
| (df["RSI_3_4h"] > 60.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["ROC_9_1d"] < 100.0)
)
# 1d green, 15m & 4h down move, 4h still high, 4h & 1d overbought
& (
(df["change_pct_1d"] < 50.0)
| (df["RSI_3_15m"] > 15.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_14_4h"] < 50.0)
| (df["ROC_9_4h"] < 40.0)
| (df["ROC_9_1d"] < 100.0)
)
# 1d green with top wick, 15m & 1h & 4h down move, 1h & 4h still high, 4h high
& (
(df["change_pct_1d"] < 50.0)
| (df["top_wick_pct_1d"] < 50.0)
| (df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_4h"] < 70.0)
)
# 1d green with top wick, 1d down move, 4h still high & overbought
& (
(df["change_pct_1d"] < 50.0)
| (df["top_wick_pct_1d"] < 50.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 50.0)
| (df["ROC_9_4h"] < 50.0)
)
# 1d green with top wick, 4h down move, 4h still high, 1d overbought
& (
(df["change_pct_1d"] < 50.0)
| (df["top_wick_pct_1d"] < 50.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["ROC_9_1d"] < 200.0)
)
# 1d green, 15m & 4h down move, 15m & 1h & 4h still high, 15m high, 4h & 1d overbought
& (
(df["change_pct_1d"] < 50.0)
| (df["RSI_3_15m"] > 50.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["ROC_9_4h"] < 30.0)
| (df["ROC_9_1d"] < 200.0)
)
# 4h top wick, 15m down move, 15m still not low enough, 1h & 4h still high, 4h overbought
& (
(df["top_wick_pct_4h"] < 20.0)
| (df["RSI_3_15m"] > 25.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
| (df["ROC_9_4h"] < 50.0)
)
# 4h top wick, 15m & 1h down move, 15m & 1h still high, 1h & 4h high
& (
(df["top_wick_pct_4h"] < 20.0)
| (df["RSI_3_15m"] > 40.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_15m"] < 40.0)
| (df["AROONU_14_1h"] < 85.0)
| (df["AROONU_14_4h"] < 100.0)
)
# 1d top wick, 1h & 4h down move, 15m downtrend, 4h still high, 1d overbought
& (
(df["top_wick_pct_1d"] < 20.0)
| (df["RSI_3_1h"] > 10.0)
| (df["RSI_3_4h"] > 45.0)
| (df["CMF_20_15m"] > -0.2)
| (df["AROONU_14_4h"] < 50.0)
| (df["ROC_9_1d"] < 80.0)
)
# 1d top wick, 4h down move, 4h still high, 1d overbought
& (
(df["top_wick_pct_1d"] < 25.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_14_4h"] < 45.0)
| (df["AROONU_14_4h"] < 40.0)
| (df["ROC_9_1d"] < 200.0)
)
# 1d top wick, 15m & 1h & 4h down move, 15m & 1h downtrend, 4h still high
& (
(df["top_wick_pct_1d"] < 25.0)
| (df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 50.0)
| (df["CMF_20_15m"] > -0.25)
| (df["CMF_20_1h"] > -0.25)
| (df["AROONU_14_4h"] < 50.0)
)
# 1d top wick, 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high
& (
(df["top_wick_pct_1d"] < 25.0)
| (df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 60.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 30.0)
| (df["AROONU_14_4h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
)
# 1d top wick, 15m down move, 15m stil high, 1h & 4h high, 4h overbought
& (
(df["top_wick_pct_1d"] < 25.0)
| (df["RSI_3_15m"] > 35.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 80.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["ROC_9_4h"] < 50.0)
)
# 1d top wick, 15m & 1h & 4h down move, 15m & 1h & 4h still high
& (
(df["top_wick_pct_1d"] < 80.0)
| (df["RSI_3_15m"] > 40.0)
| (df["RSI_3_1h"] > 65.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_4h"] < 50.0)
)
# pump, drop but not yet near the previous lows, 15m & 1h & 4h & 1d down move, 1d overbought
& (
(((df["high_max_6_1d"] - df["low_min_6_1d"]) / df["low_min_6_1d"]) < 1.5)
| (df["close"] > (df["high_max_6_4h"] * 0.70))
| (df["close"] < (df["low_min_6_1d"] * 1.25))
| (df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_3_1d"] > 45.0)
| (df["ROC_9_1d"] < 20.0)
)
# pump, drop in lays days, 1h & 4h down move, 1h & 4h still not low enough, 1d overbought
& (
(((df["high_max_12_1d"] - df["low_min_12_1d"]) / df["low_min_12_1d"]) < 3.0)
| (df["close"] > (df["high_max_24_4h"] * 0.70))
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_3_1d"] > 50.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["ROC_9_1d"] < 20.0)
)
# pump, 15m & 1h & 4h down move, 15m & 1h still not low enough, 4h still high, 1h downtrend, 1h high
& (
(((df["high_max_12_1d"] - df["low_min_12_1d"]) / df["low_min_12_1d"]) < 3.0)
| (df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_1h"] > -0.10)
| (df["AROONU_14_1h"] < 70.0)
)
# pump, drop in last 6 days, 1h & 4h down move, 1h & 4h still not low enough, 4h downtrend, 4h & 1d downtrend
& (
(((df["high_max_30_1d"] - df["low_min_30_1d"]) / df["low_min_30_1d"]) < 10.0)
| (df["close"] > (df["high_max_6_1d"] * 0.50))
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["CMF_20_4h"] > -0.10)
| (df["ROC_9_4h"] > -15.0)
| (df["ROC_9_1d"] > -25.0)
)
# drop in the last 4 hours, 1h & 4h high
& ((df["close"] > (df["close_max_48"] * 0.30)) | (df["AROONU_14_1h"] < 85.0) | (df["AROONU_14_4h"] < 85.0))
# drop in last 12 hours, 14m & 1h & 4h down move, 15m still not low enough, 1h still high, 4h high & overbought
& (
(df["close"] > (df["high_max_12_1h"] * 0.50))
| (df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["ROC_9_4h"] < 25.0)
)
# drop in last 12 hours, 1h & 4h down move, 1h & 4h downtrend
& (
(df["close"] > (df["high_max_12_1h"] * 0.35))
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 5.0)
| (df["ROC_9_1h"] > -50.0)
| (df["ROC_9_4h"] > -50.0)
)
# drop in last 4 days, 15m & 1h & 4h down move, 15m still not low enough, 1h still high, 4h overbought
& (
(df["close"] > (df["high_max_24_4h"] * 0.40))
| (df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["ROC_9_4h"] < 20.0)
)
# drop in last 4 days, 15m & 1h & 4h & 1d down move, 4h high
& (
(df["close"] > (df["high_max_24_4h"] * 0.40))
| (df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_3_1d"] > 10.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
)
# drop in last 6 days, 15m & 1h & 4h & 1d down move, 1d high, 4h downtrend
& (
(df["close"] > (df["high_max_24_4h"] * 0.35))
| (df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_3_1d"] > 30.0)
| (df["AROONU_14_1d"] < 80.0)
| (df["ROC_9_4h"] > -40.0)
)
# drop in last 4 days, 15m & 1d down move, 15m still not low enough, 1h still high, 1d high, 4h downtrend
& (
(df["close"] > (df["high_max_24_4h"] * 0.35))
| (df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1d"] > 30.0)
| (df["AROONU_14_15m"] < 25.0)
| (df["AROONU_14_1h"] < 40.0)
| (df["AROONU_14_1d"] < 80.0)
| (df["ROC_9_4h"] > -50.0)
)
# drop in last 4 days, 1h & 5h & 1d down move, 1h still high, 1h & 4h downtrend
& (
(df["close"] > (df["high_max_24_4h"] * 0.25))
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_3_1d"] > 25.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["ROC_9_1h"] > -20.0)
| (df["ROC_9_4h"] > -35.0)
)
# drop in last 4 days, 1d down move, 1h & 4h downtrend, 15m & 4h downtrend
& (
(df["close"] > (df["high_max_24_4h"] * 0.25))
| (df["RSI_3_1d"] > 15.0)
| (df["CMF_20_1h"] > -0.20)
| (df["CMF_20_4h"] > -0.20)
| (df["ROC_9_15m"] > -15.0)
| (df["ROC_9_4h"] > -20.0)
)
# drop in last 6 days, 15m & 1d down move, 1h still high, 4h high, 4h downtrend
& (
(df["close"] > (df["high_max_6_1d"] * 0.25))
| (df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1d"] > 15.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 60.0)
| (df["ROC_9_4h"] > -25.0)
)
# drop in last 6 days, 15m & 1h down move, 15m & 1h still not low enough, 15m & 1h & 4h & 1d downtrend
& (
(df["close"] > (df["high_max_6_1d"] * 0.25))
| (df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_14_15m"] < 30.0)
| (df["CMF_20_15m"] > -0.10)
| (df["CMF_20_1h"] > -0.10)
| (df["CMF_20_4h"] > -0.40)
| (df["CMF_20_1d"] > -0.50)
| (df["AROONU_14_1h"] < 30.0)
)
# drop in last 4 days, 4h & 1d down move, 1h high
& (
(df["close"] > (df["high_max_24_4h"] * 0.15))
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_3_1d"] > 25.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# drop in last 4 days, 1d down move, 1d downtrendm 1h still high, 1d downtrend
& (
(df["close"] > (df["high_max_24_4h"] * 0.15))
| (df["RSI_3_1d"] > 20.0)
| (df["CMF_20_1d"] > -0.30)
| (df["AROONU_14_1h"] < 50.0)
| (df["ROC_2_1d"] > -40.0)
)
# drop in last 6 days, 1d down move, 1h & 4h & 1d downtrend, 1d still high, 4h downtrend
& (
(df["close"] > (df["high_max_6_1d"] * 0.15))
| (df["RSI_3_1d"] > 20.0)
| (df["CMF_20_1h"] > -0.10)
| (df["CMF_20_4h"] > -0.40)
| (df["CMF_20_1d"] > -0.50)
| (df["AROONU_14_1d"] < 50.0)
| (df["ROC_9_4h"] > -30.0)
)
# drop in last 12 days. 15m & 1h & 4h & 1d down move, 4h still high, 1d downtrend
& (
(df["close"] > (df["high_max_12_1d"] * 0.25))
| (df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 10.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_3_1d"] > 35.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
| (df["ROC_9_1d"] > -40.0)
)
# drop in last 12 days, 15m & 1h down move, 1h still not low enough, 4h high
& (
(df["close"] > (df["high_max_12_1d"] * 0.25))
| (df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# drop in last 20 days, 15m & 1h & 1d down move, 15m still not low enough, 1h high
& (
(df["close"] > (df["high_max_20_1d"] * 0.05))
| (df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_1d"] > 25.0)
| (df["AROONU_14_15m"] < 30.0)
| (df["AROONU_14_1h"] < 80.0)
)
# drop in last 20 days, 1h & 4h & 1d down move, 1h & 4h still not low enough, 1h & 4h & 1d downtrend
& (
(df["close"] > (df["high_max_20_1d"] * 0.01))
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_3_1d"] > 15.0)
| (df["RSI_14_1h"] < 15.0)
| (df["RSI_14_4h"] < 20.0)
| (df["CMF_20_1h"] > -0.0)
| (df["CMF_20_4h"] > -0.10)
| (df["CMF_20_1d"] > -0.40)
| (df["CCI_20_1h"] < -150.0)
| (df["CCI_20_4h"] < -200.0)
| (df["ROC_2_1d"] > -25.0)
| (df["ROC_9_1d"] > -60.0)
)
# drop in last 30 days, 15m & 1h down move, 1h still high, 4h high & overbought
& (
(df["close"] > (df["high_max_30_1d"] * 0.10))
| (df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 55.0)
| (df["AROONU_14_1h"] < 40.0)
| (df["AROONU_14_4h"] < 85.0)
| (df["ROC_9_4h"] < 80.0)
)
# drop in last 30 days, 15m down move, 15m & 1h high
& (
(df["close"] > (df["high_max_30_1d"] * 0.05))
| (df["RSI_3_15m"] > 15.0)
| (df["RSI_3_4h"] > 50.0)
| (df["AROONU_14_15m"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 85.0)
)
# drop in last 30 days, 15m & 1h & 4h down move, 15m still not low enough, 1h high
& (
(df["close"] > (df["high_max_30_1d"] * 0.05))
| (df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 40.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
)
df["global_protections_long_pump"] = True
df["global_protections_long_dump"] = True
df["protections_long_rebuy"] = True
# Global protections Short
df["protections_short_global"] = (
# 5m & 15m & 1h & 4h up move, 15m & 1h & 4h still not high enough, 4h still low, 1h uptrend
(
(df["RSI_3"] < 90.0)
| (df["RSI_3_15m"] < 75.0)
| (df["RSI_3_1h"] < 75.0)
| (df["RSI_3_4h"] < 75.0)
| (df["RSI_14_15m"] > 90.0)
| (df["RSI_14_1h"] > 85.0)
| (df["RSI_14_4h"] > 70.0)
| (df["STOCHRSIk_14_14_3_3_4h"] > 60.0)
| (df["ROC_9_1h"] < 15.0)
)
# 5m & 15m up move, 15m & 1h & 4h still low, 15m & 1h low, 4h still low
& (
(df["RSI_3"] < 90.0)
| (df["RSI_3_15m"] < 75.0)
| (df["RSI_14_15m"] > 60.0)
| (df["RSI_14_1h"] > 50.0)
| (df["RSI_14_4h"] > 40.0)
| (df["AROONU_14_15m"] > 20.0)
| (df["AROONU_14_1h"] > 20.0)
| (df["AROONU_14_4h"] > 40.0)
)
# 15m & 1h & 4h up move, 15m & 1h & 4h still not high enough, 1h & 4h still low, 4h low
& (
(df["RSI_3_15m"] < 90.0)
| (df["RSI_3_1h"] < 60.0)
| (df["RSI_3_4h"] < 60.0)
| (df["RSI_14_15m"] > 80.0)
| (df["RSI_14_1h"] > 70.0)
| (df["RSI_14_4h"] > 70.0)
| (df["AROONU_14_1h"] > 60.0)
| (df["AROONU_14_4h"] > 60.0)
| (df["STOCHRSIk_14_14_3_3_4h"] > 40.0)
)
# 15m & 1h & 4h up move, 15m still not high enough, 1h & 4h still low, 1h low
& (
(df["RSI_3_15m"] < 90.0)
| (df["RSI_3_1h"] < 60.0)
| (df["RSI_3_4h"] < 35.0)
| (df["RSI_14_15m"] > 80.0)
| (df["RSI_14_1h"] > 60.0)
| (df["RSI_14_4h"] > 60.0)
| (df["AROONU_14_1h"] > 40.0)
)
# 15m & 1h & 4h up move, 15m & 1h & 4h still not high enough, 4h uptrend
& (
(df["RSI_3_15m"] < 95.0)
| (df["RSI_3_1h"] < 80.0)
| (df["RSI_3_4h"] < 80.0)
| (df["RSI_14_15m"] > 80.0)
| (df["RSI_14_1h"] > 80.0)
| (df["RSI_14_4h"] > 80.0)
| (df["CCI_20_1h"] > 200.0)
| (df["CCI_20_4h"] > 150.0)
| (df["ROC_9_4h"] < 20.0)
)
# 15m & 1h & 4h up move, 1h & 4h still now high enough, 15m uptrend, 1h still not high enough
& (
(df["RSI_3_15m"] < 95.0)
| (df["RSI_3_1h"] < 50.0)
| (df["RSI_3_4h"] < 50.0)
| (df["RSI_14_1h"] > 70.0)
| (df["RSI_14_4h"] > 70.0)
| (df["CMF_20_15m"] < 0.20)
| (df["STOCHRSIk_14_14_3_3_1h"] > 70.0)
)
# 15m & 1h & 4h up move, 15m & 1h & 4h still not high enough, 1h & 4h & 1d uptrend
& (
(df["RSI_3_15m"] < 90.0)
| (df["RSI_3_1h"] < 90.0)
| (df["RSI_3_4h"] < 80.0)
| (df["RSI_14_15m"] > 80.0)
| (df["RSI_14_1h"] > 80.0)
| (df["RSI_14_4h"] > 80.0)
| (df["ROC_9_1h"] < 10.0)
| (df["ROC_9_4h"] < 20.0)
| (df["ROC_9_1d"] < 80.0)
)
# 15m & 1h & 4h up move, 15m & 1h & 4h still not high enough, 1h & 4h uptrend
& (
(df["RSI_3_15m"] < 90.0)
| (df["RSI_3_1h"] < 80.0)
| (df["RSI_3_4h"] < 80.0)
| (df["RSI_14_15m"] > 80.0)
| (df["RSI_14_1h"] > 80.0)
| (df["RSI_14_4h"] > 80.0)
| (df["CCI_20_1h"] > 250.0)
| (df["CCI_20_4h"] > 200.0)
| (df["ROC_9_1h"] < 10.0)
| (df["ROC_9_4h"] < 40.0)
)
# 15m & 1h & 4h up move, 15m & 1h & 4h still not high enough, 15m uptrend, 4h still low
& (
(df["RSI_3_15m"] < 90.0)
| (df["RSI_3_1h"] < 80.0)
| (df["RSI_3_4h"] < 80.0)
| (df["RSI_14_15m"] > 80.0)
| (df["RSI_14_1h"] > 80.0)
| (df["RSI_14_4h"] > 70.0)
| (df["CMF_20_15m"] < 0.25)
| (df["STOCHRSIk_14_14_3_3_4h"] > 60.0)
)
# 15m & 1h & 4h up move, 15m still not high enough, 1h & 4h still low, 4h still low
& (
(df["RSI_3_15m"] < 90.0)
| (df["RSI_3_1h"] < 60.0)
| (df["RSI_3_4h"] < 60.0)
| (df["RSI_14_15m"] > 80.0)
| (df["RSI_14_1h"] > 60.0)
| (df["RSI_14_4h"] > 60.0)
| (df["AROONU_14_4h"] > 50.0)
)
# 15m & 1h & 4h up move, 15m & 1h still not high enough, 1h & 4h uptrend
& (
(df["RSI_3_15m"] < 85.0)
| (df["RSI_3_1h"] < 85.0)
| (df["RSI_3_4h"] < 85.0)
| (df["AROONU_14_15m"] > 70.0)
| (df["STOCHRSIk_14_14_3_3_15m"] > 80.0)
| (df["STOCHRSIk_14_14_3_3_1h"] > 80.0)
| (df["ROC_9_1h"] < 10.0)
| (df["ROC_9_4h"] < 30.0)
)
# 15m & 1h & 4h up move, 15m & 1h & 4h still not high enough, 15m & 1h & 4h uptrend
& (
(df["RSI_3_15m"] < 85.0)
| (df["RSI_3_1h"] < 85.0)
| (df["RSI_3_4h"] < 80.0)
| (df["RSI_14_15m"] > 85.0)
| (df["RSI_14_1h"] > 80.0)
| (df["RSI_14_4h"] > 80.0)
| (df["CMF_20_15m"] < 0.20)
| (df["CMF_20_1h"] < 0.10)
| (df["CMF_20_4h"] < 0.10)
)
# 15m & 1h & 4h up move, 1h still low, 4h & 1d uptrend
& (
(df["RSI_3_15m"] < 85.0)
| (df["RSI_3_1h"] < 85.0)
| (df["RSI_3_4h"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_1h"] > 50.0)
| (df["ROC_9_4h"] < 80.0)
| (df["ROC_9_1d"] < 100.0)
)
# 15m & 1h & 4h up move, 1h & 4h still not high enough, 4h overbought
& (
(df["RSI_3_15m"] < 85.0)
| (df["RSI_3_1h"] < 80.0)
| (df["RSI_3_4h"] < 80.0)
| (df["AROONU_14_4h"] > 70.0)
| (df["STOCHRSIk_14_14_3_3_1h"] > 80.0)
| (df["STOCHRSIk_14_14_3_3_4h"] > 80.0)
| (df["ROC_9_4h"] < 10.0)
)
# 15m & 1h & 4h up move, 1h still nt high enough, 1h & 4h uptrend
& (
(df["RSI_3_15m"] < 85.0)
| (df["RSI_3_1h"] < 70.0)
| (df["RSI_3_4h"] < 70.0)
| (df["AROONU_14_1h"] > 70.0)
| (df["STOCHRSIk_14_14_3_3_1h"] > 70.0)
| (df["ROC_9_1h"] < 45.0)
| (df["ROC_9_4h"] < 45.0)
)
# 15m & 1h & 4h up move, 15m & 1h & 4h still not high enough, 1h still low, 1h & 4h uptrend
& (
(df["RSI_3_15m"] < 85.0)
| (df["RSI_3_1h"] < 70.0)
| (df["RSI_3_4h"] < 70.0)
| (df["RSI_14_15m"] > 70.0)
| (df["RSI_14_1h"] > 80.0)
| (df["RSI_14_4h"] > 80.0)
| (df["STOCHRSIk_14_14_3_3_1h"] > 60.0)
| (df["ROC_9_1h"] < 20.0)
| (df["ROC_9_4h"] < 40.0)
)
# 15m & 1h & 4h up move, 4h still not high enough, 15m & 1h & 4h uptrend
& (
(df["RSI_3_15m"] < 80.0)
| (df["RSI_3_1h"] < 80.0)
| (df["RSI_3_4h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_4h"] > 75.0)
| (df["ROC_9_15m"] < 10.0)
| (df["ROC_9_1h"] < 10.0)
| (df["ROC_9_4h"] < 20.0)
)
# 15m & 1h & 4h up move, 15m & 1h & 4h still not high enough, 4h low, 1h & 4h uptrend
& (
(df["RSI_3_15m"] < 80.0)
| (df["RSI_3_1h"] < 80.0)
| (df["RSI_3_4h"] < 60.0)
| (df["RSI_14_15m"] > 80.0)
| (df["RSI_14_1h"] > 80.0)
| (df["RSI_14_4h"] > 60.0)
| (df["STOCHRSIk_14_14_3_3_4h"] > 40.0)
| (df["ROC_9_1h"] < 20.0)
| (df["ROC_9_4h"] < 20.0)
)
# 15m & 1h & 4h up move, 15m & 1h & 4h still not high enough, 4h still low, 15m & 1h & 4h uptrend
& (
(df["RSI_3_15m"] < 80.0)
| (df["RSI_3_1h"] < 80.0)
| (df["RSI_3_4h"] < 55.0)
| (df["RSI_14_15m"] > 80.0)
| (df["RSI_14_1h"] > 80.0)
| (df["RSI_14_4h"] > 70.0)
| (df["AROONU_14_4h"] > 70.0)
| (df["ROC_9_15m"] < 10.0)
| (df["ROC_9_1h"] < 10.0)
| (df["ROC_9_4h"] < 20.0)
)
# 15m & 1h & 4h up move, 15m & 1h & 4h still not high enough, 15m uptrend
& (
(df["RSI_3_15m"] < 80.0)
| (df["RSI_3_1h"] < 70.0)
| (df["RSI_3_4h"] < 70.0)
| (df["RSI_14_15m"] > 80.0)
| (df["RSI_14_1h"] > 70.0)
| (df["RSI_14_4h"] > 70.0)
| (df["AROONU_14_4h"] > 70.0)
| (df["STOCHRSIk_14_14_3_3_15m"] > 90.0)
| (df["ROC_9_15m"] < 10.0)
)
# 15m & 1h & 4h up move, 15m & 1h & 4h still not high enough, 1h low, 4h overbought
& (
(df["RSI_3_15m"] < 80.0)
| (df["RSI_3_1h"] < 70.0)
| (df["RSI_3_4h"] < 70.0)
| (df["RSI_14_15m"] > 80.0)
| (df["RSI_14_1h"] > 80.0)
| (df["RSI_14_4h"] > 80.0)
| (df["STOCHRSIk_14_14_3_3_1h"] > 40.0)
| (df["ROC_9_4h"] < 30.0)
)
# 15m & 1h & 4h up move, 15m & 1h & 4h still not high enough, 4h low
& (
(df["RSI_3_15m"] < 80.0)
| (df["RSI_3_1h"] < 70.0)
| (df["RSI_3_4h"] < 35.0)
| (df["RSI_14_15m"] > 80.0)
| (df["RSI_14_1h"] > 70.0)
| (df["RSI_14_4h"] > 60.0)
| (df["STOCHRSIk_14_14_3_3_4h"] > 30.0)
)
# 15m & 1h & 4h up move, 15m & 1h & 4h still not high enough, 4h low, 4h overbought
& (
(df["RSI_3_15m"] < 75.0)
| (df["RSI_3_1h"] < 75.0)
| (df["RSI_3_4h"] < 70.0)
| (df["RSI_14_15m"] > 80.0)
| (df["RSI_14_1h"] > 80.0)
| (df["RSI_14_4h"] > 70.0)
| (df["AROONU_14_4h"] > 30.0)
| (df["ROC_9_4h"] < 10.0)
)
# 15m & 1h & 4h up move, 15m low, 1h uptrend
& (
(df["RSI_3_15m"] < 70.0)
| (df["RSI_3_1h"] < 95.0)
| (df["RSI_3_4h"] < 85.0)
| (df["STOCHRSIk_14_14_3_3_15m"] > 30.0)
| (df["ROC_9_1h"] < 25.0)
)
# 15m & 1h & 4h up move, 15m & 1h & 4h uptrend, 15m still low, 1h uptrend
& (
(df["RSI_3_15m"] < 70.0)
| (df["RSI_3_1h"] < 70.0)
| (df["RSI_3_4h"] < 70.0)
| (df["CMF_20_15m"] < 0.20)
| (df["CMF_20_1h"] < 0.20)
| (df["CMF_20_4h"] < 0.20)
| (df["STOCHRSIk_14_14_3_3_15m"] > 50.0)
| (df["ROC_9_1h"] < 50.0)
)
# 15m & 1h & 4h up move, 15m & 1h & 4h still not high enough, 4h uptrend
& (
(df["RSI_3_15m"] < 70.0)
| (df["RSI_3_1h"] < 60.0)
| (df["RSI_3_4h"] < 60.0)
| (df["RSI_14_15m"] > 70.0)
| (df["RSI_14_1h"] > 70.0)
| (df["RSI_14_4h"] > 70.0)
| (df["STOCHRSIk_14_14_3_3_1h"] > 70.0)
| (df["ROC_9_4h"] < 50.0)
)
# 1h & 4h up move, 1d still low, 15m & 4h still not high enough
& (
(df["RSI_3_1h"] < 95.0)
| (df["RSI_3_4h"] < 80.0)
| (df["RSI_14_1d"] > 50.0)
| (df["STOCHRSIk_14_14_3_3_15m"] > 70.0)
| (df["STOCHRSIk_14_14_3_3_4h"] > 70.0)
)
# 1h & 4h up move, 1d still low, 1h & 4h & 1d uptrend
& (
(df["RSI_3_1h"] < 90.0)
| (df["RSI_3_4h"] < 90.0)
| (df["RSI_14_1d"] > 50.0)
| (df["ROC_9_1h"] < 20.0)
| (df["ROC_9_4h"] < 20.0)
| (df["ROC_9_1d"] < 20.0)
)
# 4h up move, 15m & 1h & 4h still not high enough, 1d still low, 4h still not high enough, 1d still low
& (
(df["RSI_3_4h"] < 90.0)
| (df["RSI_14_15m"] > 80.0)
| (df["RSI_14_1h"] > 80.0)
| (df["RSI_14_4h"] > 80.0)
| (df["RSI_14_1d"] > 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] > 80.0)
| (df["STOCHRSIk_14_14_3_3_1d"] > 50.0)
)
# 4h up move, 15m & 1h & 4h still not high enough, 15m low, 15m & 1h & 4h uptrend
& (
(df["RSI_3_4h"] < 90.0)
| (df["RSI_14_15m"] > 80.0)
| (df["RSI_14_1h"] > 80.0)
| (df["RSI_14_4h"] > 80.0)
| (df["STOCHRSIk_14_14_3_3_15m"] > 40.0)
| (df["ROC_9_15m"] < 20.0)
| (df["ROC_9_1h"] < 15.0)
| (df["ROC_9_4h"] < 15.0)
)
# 4h up move, 15m & 1h & 4h still not high enough, 1h still low, 1h & 4h overbought
& (
(df["RSI_3_4h"] < 90.0)
| (df["RSI_14_15m"] > 80.0)
| (df["RSI_14_1h"] > 80.0)
| (df["RSI_14_4h"] > 90.0)
| (df["STOCHRSIk_14_14_3_3_1h"] > 60.0)
| (df["ROC_9_1h"] < 20.0)
| (df["ROC_9_4h"] < 60.0)
)
)
df["global_protections_short_pump"] = (
# 15m & 1h & 4h & 1d up move, 15m & 1h & 4h still not high enough, 1d still not high enough & uptrend
(
(df["RSI_3_15m"] < 40.0)
| (df["RSI_3_1h"] < 40.0)
| (df["RSI_3_4h"] < 85.0)
| (df["RSI_3_1d"] < 85.0)
| (df["RSI_14_15m"] > 70.0)
| (df["CCI_20_15m"] > 350.0)
| (df["RSI_14_1h"] > 75.0)
| (df["CCI_20_1h"] > 250.0)
| (df["STOCHRSIk_14_14_3_3_1h"] > 50.0)
| (df["RSI_14_4h"] > 95.0)
| (df["AROOND_14_4h"] < 50.0)
| (df["CCI_20_4h"] > 250.0)
| (df["RSI_14_1d"] > 60.0)
| (df["AROOND_14_1d"] < 75.0)
| (df["STOCHRSIk_14_14_3_3_1d"] > 70.0)
| (df["ROC_9_1d"] < 40.0)
)
# 15m & 1h & 4h & 1d up move, 15m & 1h & 4h still not high enough, 1d still not high enough & uptrend
& (
(df["RSI_3_15m"] < 60.0)
| (df["RSI_3_1h"] < 60.0)
| (df["RSI_3_4h"] < 80.0)
| (df["RSI_3_1d"] < 90.0)
| (df["RSI_14_15m"] > 90.0)
| (df["CCI_20_15m"] > 350.0)
| (df["RSI_14_1h"] > 90.0)
| (df["CCI_20_1h"] > 300.0)
| (df["RSI_14_4h"] > 80.0)
| (df["CCI_20_4h"] > 200.0)
| (df["RSI_14_1d"] > 95.0)
| (df["ROC_9_1d"] < 80.0)
)
# 1d green, 15m & 1h & 4h & 1d up move, 4h & 1d still not high enough & uptrend
& (
(df["RSI_3_15m"] < 60.0)
| (df["RSI_3_1h"] < 70.0)
| (df["RSI_3_4h"] < 70.0)
| (df["RSI_3_1d"] < 80.0)
| (df["RSI_14_4h"] > 70.0)
| (df["WILLR_14_4h"] > -10.0)
| (df["STOCHRSIk_14_14_3_3_4h"] > 80.0)
| (df["ROC_9_4h"] < 40.0)
| (df["RSI_14_1d"] > 80.0)
| (df["ROC_9_1d"] < 100.0)
)
# 15m & 1h & 1d up move, 15m & 1h & 4h still not high enough, 1d still not high enough & uptrend
& (
(df["RSI_3_15m"] < 65.0)
| (df["RSI_3_1h"] < 70.0)
| (df["RSI_3_1d"] < 60.0)
| (df["RSI_14_15m"] > 90.0)
| (df["CMF_20_15m"] > 0.40)
| (df["WILLR_14_15m"] > -10.0)
| (df["CCI_20_15m"] > 450.0)
| (df["STOCHk_14_3_3_15m"] > 90.0)
| (df["RSI_14_1h"] > 90.0)
| (df["CMF_20_1h"] > 0.20)
| (df["WILLR_14_1h"] > -5.0)
| (df["CCI_20_1h"] > 250.0)
| (df["RSI_14_4h"] > 90.0)
| (df["CMF_20_4h"] > 0.10)
| (df["CCI_20_4h"] > 250.0)
| (df["RSI_14_1d"] > 90.0)
| (df["ROC_9_1d"] < 25.0)
)
# 15m & 1h & 4h & 1d up move, 15m & 1h & 4h & 1d still not high enough, 1d uptrend
& (
(df["RSI_3_15m"] < 70.0)
| (df["RSI_3_1h"] < 80.0)
| (df["RSI_3_4h"] < 80.0)
| (df["RSI_3_1d"] < 80.0)
| (df["MFI_14_15m"] > 90.0)
| (df["STOCHRSIk_14_14_3_3_15m"] > 90.0)
| (df["MFI_14_1h"] > 90.0)
| (df["MFI_14_4h"] > 80.0)
| (df["WILLR_14_4h"] > -5.0)
| (df["AROOND_14_4h"] < 50.0)
| (df["ROC_9_1d"] < 40.0)
)
# 15m & 1h up move, 15m & 1h & 4h still not high enough, 1d still not high enough & uptrend
& (
(df["RSI_3_15m"] < 70.0)
| (df["RSI_3_1h"] < 85.0)
| (df["MFI_14_15m"] > 90.0)
| (df["STOCHRSIk_14_14_3_3_15m"] > 80.0)
| (df["RSI_14_1h"] > 80.0)
| (df["MFI_14_1h"] > 80.0)
| (df["STOCHRSIk_14_14_3_3_1h"] > 70.0)
| (df["RSI_14_4h"] > 80.0)
| (df["RSI_14_1d"] > 80.0)
| (df["ROC_9_1d"] < 40.0)
)
# 15m & 1h & 4h & 1d up move, 15m & 1h still not high enough, 4h & 1d stil not high enough & uptrend
& (
(df["RSI_3_15m"] < 80.0)
| (df["RSI_3_1h"] < 80.0)
| (df["RSI_3_4h"] < 80.0)
| (df["RSI_3_1d"] < 95.0)
| (df["RSI_14_15m"] > 85.0)
| (df["CCI_20_15m"] > 250.0)
| (df["RSI_14_1h"] > 85.0)
| (df["CCI_20_1h"] > 250.0)
| (df["CCI_20_change_pct_1h"] < -0.0)
| (df["STOCHRSIk_14_14_3_3_1h"] > 90.0)
| (df["RSI_14_4h"] > 85.0)
| (df["CCI_20_4h"] > 250.0)
| (df["CCI_20_change_pct_4h"] < -0.0)
| (df["STOCHRSIk_14_14_3_3_4h"] > 90.0)
| (df["ROC_9_4h"] < 30.0)
| (df["RSI_14_1d"] > 90.0)
| (df["WILLR_14_1d"] > -10.0)
| (df["ROC_9_1d"] < 50.0)
)
# 15m & 1h & 4h up move, 15m & 1h still not high enough, 4h still not high enough & uptrend
& (
(df["RSI_3_15m"] < 80.0)
| (df["RSI_3_1h"] < 80.0)
| (df["RSI_3_4h"] < 90.0)
| (df["RSI_14_15m"] > 90.0)
| (df["CCI_20_15m"] > 400.0)
| (df["RSI_14_1h"] > 90.0)
| (df["CCI_20_1h"] > 400.0)
| (df["CCI_20_4h"] > 400.0)
| (df["ROC_9_4h"] < 200.0)
)
# 15m & 1h up move, 15m & 1h & 4h still not high enough, 1d still not high enough & uptrend
& (
(df["RSI_3_15m"] < 80.0)
| (df["RSI_3_1h"] < 90.0)
| (df["RSI_14_15m"] > 85.0)
| (df["CCI_20_15m"] > 250.0)
| (df["RSI_14_1h"] > 75.0)
| (df["AROOND_14_1h"] < 50.0)
| (df["CCI_20_1h"] > 350.0)
| (df["CCI_20_change_pct_1h"] < -0.0)
| (df["RSI_14_4h"] > 85.0)
| (df["CCI_20_4h"] > 150.0)
| (df["CCI_20_change_pct_4h"] < -0.0)
| (df["STOCHRSIk_14_14_3_3_4h"] > 70.0)
| (df["RSI_14_1d"] > 85.0)
| (df["ROC_9_1d"] < 50.0)
)
# 15m & 1h & 4h & 1d up move, 15m & 1h & 4h & 1d still not high enough
& (
(df["RSI_3_15m"] < 80.0)
| (df["RSI_3_1h"] < 90.0)
| (df["RSI_3_4h"] < 70.0)
| (df["RSI_3_1d"] < 70.0)
| (df["RSI_14_15m"] > 85.0)
| (df["RSI_14_1h"] > 85.0)
| (df["CCI_20_1h"] > 250.0)
| (df["CCI_20_change_pct_1h"] < -0.0)
| (df["RSI_14_4h"] > 70.0)
| (df["AROOND_14_4h"] < 75.0)
| (df["CCI_20_4h"] > 200.0)
| (df["CCI_20_change_pct_4h"] < -0.0)
| (df["STOCHk_14_3_3_4h"] > 70.0)
| (df["RSI_14_1d"] > 70.0)
)
# 15m & 1h & 4h & 1d up move, 1h still not high enough, 1d still low, 4h & 1d uptrend
& (
(df["RSI_3_15m"] < 80.0)
| (df["RSI_3_1h"] < 85.0)
| (df["RSI_3_4h"] < 90.0)
| (df["RSI_3_1d"] < 95.0)
| (df["STOCHRSIk_14_14_3_3_1h"] > 60.0)
| (df["AROOND_14_1d"] < 50.0)
| (df["ROC_9_4h"] < 100.0)
| (df["ROC_9_1d"] < 100.0)
)
# 15m & 1h & 4h & 1d up move, 15m & 1h still not high enough, 4h & 1d still not high enough & uptrend
& (
(df["RSI_3_15m"] < 80.0)
| (df["RSI_3_1h"] < 80.0)
| (df["RSI_3_4h"] < 90.0)
| (df["RSI_3_1d"] < 95.0)
| (df["RSI_14_15m"] > 85.0)
| (df["STOCHk_14_3_3_15m"] > 90.0)
| (df["RSI_14_1h"] > 90.0)
| (df["STOCHk_14_3_3_1h"] > 90.0)
| (df["RSI_14_4h"] > 95.0)
| (df["STOCHk_14_3_3_4h"] > 90.0)
| (df["ROC_9_4h"] < 50.0)
| (df["RSI_14_1d"] > 95.0)
| (df["STOCHk_14_3_3_1d"] > 70.0)
| (df["AROOND_14_1d"] < 50.0)
| (df["ROC_9_1d"] < 50.0)
)
# 15m & 1h & 4h up move, 1h & 4h still not high enough, 1d uptrend
& (
(df["RSI_3_15m"] < 85.0)
| (df["RSI_3_1h"] < 80.0)
| (df["RSI_3_4h"] < 60.0)
| (df["WILLR_14_1h"] > -5.0)
| (df["AROOND_14_1h"] < 25.0)
| (df["WILLR_14_4h"] > -10.0)
| (df["AROOND_14_4h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] > 60.0)
| (df["ROC_9_1d"] < 50.0)
)
# 15m & 1h & 4h up move, 15m still not high enough, 1h & 4h still not high enough & uptrend, 1d still not high enough
& (
(df["RSI_3_15m"] < 85.0)
| (df["RSI_3_1h"] < 85.0)
| (df["RSI_3_4h"] < 90.0)
| (df["RSI_14_15m"] > 95.0)
| (df["CMF_20_15m"] > 0.50)
| (df["UO_7_14_28_15m"] > 80.0)
| (df["UO_7_14_28_change_pct_15m"] < -0.0)
| (df["CCI_20_15m"] > 250.0)
| (df["STOCHk_14_3_3_15m"] > 90.0)
| (df["RSI_14_1h"] > 95.0)
| (df["CMF_20_1h"] > 0.50)
| (df["UO_7_14_28_1h"] > 80.0)
| (df["CCI_20_1h"] > 350.0)
| (df["ROC_9_1h"] < 10.0)
| (df["RSI_14_4h"] > 90.0)
| (df["CMF_20_4h"] > 0.35)
| (df["UO_7_14_28_4h"] > 75.0)
| (df["CCI_20_4h"] > 500.0)
| (df["ROC_2_4h"] < 10.0)
| (df["ROC_9_4h"] < 10.0)
| (df["RSI_14_1d"] > 70.0)
)
# 15m & 1h & 4h up move, 15m & 1h & 4h still not high enough, 1d still not high enough & overbought
& (
(df["RSI_3_15m"] < 90.0)
| (df["RSI_3_1h"] < 60.0)
| (df["RSI_3_4h"] < 60.0)
| (df["RSI_14_15m"] > 85.0)
| (df["CCI_20_15m"] > 250.0)
| (df["RSI_14_1h"] > 70.0)
| (df["CCI_20_1h"] > 200.0)
| (df["STOCHk_14_3_3_1h"] > 90.0)
| (df["RSI_14_4h"] > 65.0)
| (df["CCI_20_4h"] > 200.0)
| (df["STOCHk_14_3_3_4h"] > 90.0)
| (df["RSI_14_1d"] > 65.0)
| (df["STOCHk_14_3_3_1d"] > 70.0)
| (df["ROC_9_1d"] < 30.0)
)
# 15m & 1h & 4h & 1d up move, 15m & 1h & 4h still not high enough. 1d still not high enough & uptrend
& (
(df["RSI_3_15m"] < 95.0)
| (df["RSI_3_1h"] < 80.0)
| (df["RSI_3_4h"] < 80.0)
| (df["RSI_3_1d"] < 80.0)
| (df["RSI_14_15m"] > 90.0)
| (df["RSI_14_1h"] > 90.0)
| (df["STOCHRSIk_14_14_3_3_1h"] > 70.0)
| (df["RSI_14_4h"] > 90.0)
| (df["WILLR_14_4h"] > -5.0)
| (df["RSI_14_1d"] > 80.0)
| (df["STOCHRSIk_14_14_3_3_1d"] > 80.0)
| (df["ROC_9_1d"] < 40.0)
)
# 15m & 1h & 4h up move, 15m & 1h still not high enough, 4h still not high enough & uptrend
& (
(df["RSI_3_15m"] < 95.0)
| (df["RSI_3_1h"] < 90.0)
| (df["RSI_3_4h"] < 90.0)
| (df["RSI_14_15m"] > 90.0)
| (df["CCI_20_15m"] > 250.0)
| (df["RSI_14_1h"] > 90.0)
| (df["AROOND_14_1h"] < 25.0)
| (df["CCI_20_1h"] > 300.0)
| (df["STOCHk_14_3_3_1h"] > 90.0)
| (df["RSI_14_4h"] > 95.0)
| (df["CCI_20_4h"] > 300.0)
| (df["ROC_9_4h"] < 20.0)
)
# 1h & 4h & 1d up move, 15m still not high enough, 1h & 4h & 1d still not high enough, 1d uptrend
& (
(df["RSI_3_1h"] < 80.0)
| (df["RSI_3_4h"] < 60.0)
| (df["RSI_3_1d"] < 90.0)
| (df["STOCHRSIk_14_14_3_3_15m"] > 80.0)
| (df["WILLR_14_1h"] > -20.0)
| (df["WILLR_14_4h"] > -25.0)
| (df["STOCHRSIk_14_14_3_3_4h"] > 20.0)
| (df["AROOND_14_1d"] < 50.0)
| (df["ROC_9_1d"] < 20.0)
)
)
df["global_protections_short_dump"] = (
# 15m & 1h up move, 15m & 1h still not high enough, 4h still low, 1d still low & downtrend
(
(df["RSI_3_15m"] < 80.0)
| (df["RSI_3_1h"] < 70.0)
| (df["RSI_14_15m"] > 80.0)
| (df["CCI_20_15m"] > 400.0)
| (df["RSI_14_1h"] > 75.0)
| (df["CCI_20_1h"] > 250.0)
| (df["RSI_14_4h"] > 60.0)
| (df["AROOND_14_4h"] < 50.0)
| (df["CCI_20_4h"] > 200.0)
| (df["RSI_14_1d"] > 50.0)
| (df["AROOND_14_1d"] < 75.0)
| (df["ROC_9_1d"] > -30.0)
)
# 15m up move, 15m still low, 1h & 4h & 1d still not high
& (
(df["RSI_3_15m"] < 85.0)
| (df["AROOND_14_15m"] < 50.0)
| (df["RSI_14_1h"] > 70.0)
| (df["WILLR_14_1h"] > -50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] > 80.0)
| (df["AROOND_14_1h"] < 75.0)
| (df["RSI_14_4h"] > 70.0)
| (df["WILLR_14_4h"] > -50.0)
| (df["AROOND_14_4h"] < 25.0)
| (df["STOCHRSIk_14_14_3_3_4h"] > 30.0)
| (df["RSI_14_1d"] > 70.0)
)
# 1h & 4h up move, 15m & 1h & 4h still not high enough, 1d still low & downtrend
& (
(df["RSI_3_1h"] < 70.0)
| (df["RSI_3_4h"] < 90.0)
| (df["RSI_14_15m"] > 95.0)
| (df["CCI_20_15m"] > 600.0)
| (df["RSI_14_1h"] > 95.0)
| (df["CCI_20_1h"] > 600.0)
| (df["RSI_14_4h"] > 95.0)
| (df["WILLR_14_4h"] > -10.0)
| (df["CCI_20_4h"] > 600.0)
| (df["RSI_14_1d"] > 40.0)
| (df["ROC_9_1d"] > -20.0)
)
)
df["protections_short_rebuy"] = True
tok = time.perf_counter()
log.debug(f"[{metadata['pair']}] Populate indicators took a total of: {tok - tik:0.4f} seconds.")
return df
# Confirm Trade Entry
# ---------------------------------------------------------------------------------------------
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:
# Force Entry
if entry_tag == "force_entry":
return True
# Mode configurations (dynamic structure)
mode_configs = {
"grind": {
"tags": self.long_grind_mode_tags,
"coins": self.grind_mode_coins,
"max_slots": self.grind_mode_max_slots,
"log_message": "grind mode",
},
"top_coins": {
"tags": self.long_top_coins_mode_tags,
"coins": self.top_coins_mode_coins,
"log_message": "top coins mode",
},
"scalp": {
"tags": self.long_scalp_mode_tags,
"min_free_slots": self.min_free_slots_scalp_mode,
"log_message": "scalp mode",
},
}
# Mode Validation
for mode, config in mode_configs.items():
if all(c in config["tags"] for c in entry_tag.split()):
if mode == "grind":
return self._handle_grind_mode(pair, config, current_time)
elif mode == "top_coins":
return self._handle_top_coins_mode(pair, config, current_time)
elif mode == "scalp":
return self._handle_scalp_mode(pair, config, current_time)
# Long/Short Slot Validation (only in futures mode)
if self.is_futures_mode and (self.futures_max_open_trades_long != 0 or self.futures_max_open_trades_short != 0):
open_trades = Trade.get_trades_proxy(is_open=True)
long_trades = sum(1 for t in open_trades if t.trade_direction == "long")
short_trades = sum(1 for t in open_trades if t.trade_direction == "short")
# Long trade limit validation
if (
side == "long" and self.futures_max_open_trades_long != 0 and long_trades >= self.futures_max_open_trades_long
):
log.info(
f"[{current_time}] Cancelling entry for {pair} due to long trades reaching the max limit of {self.futures_max_open_trades_long}."
)
return False
# Short trade limit validation
if (
side == "short"
and self.futures_max_open_trades_short != 0
and short_trades >= self.futures_max_open_trades_short
):
log.info(
f"[{current_time}] Cancelling entry for {pair} due to short trades reaching the max limit of {self.futures_max_open_trades_short}."
)
return False
# Slippage Validation
df, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe)
if len(df) >= 1:
last_candle = df.iloc[-1].squeeze()
if (side == "long" and rate > last_candle["close"]) or (side == "short" and rate < last_candle["close"]):
slippage = (rate / last_candle["close"]) - 1.0
if (side == "long" and slippage < self.max_slippage) or (side == "short" and slippage > -self.max_slippage):
return True
else:
log.warning(f"[{current_time}] Cancelling entry for {pair} due to slippage {(slippage * 100.0):.2f}%")
return False
return True
def _handle_grind_mode(self, pair: str, config: dict, current_time: datetime) -> bool:
is_pair_grind_mode = pair.split("/")[0] in config["coins"]
if not is_pair_grind_mode:
log.info(f"[{current_time}] Cancelling entry for {pair} due to not being in grind mode coins list.")
return False
open_trades = Trade.get_trades_proxy(is_open=True)
num_open_grind_mode = sum(1 for t in open_trades if all(c in config["tags"] for c in t.enter_tag.split()))
if num_open_grind_mode >= config["max_slots"]:
log.info(f"[{current_time}] Cancelling entry for {pair} due to grind mode slots limit reached.")
return False
return True
def _handle_top_coins_mode(self, pair: str, config: dict, current_time: datetime) -> bool:
is_pair_top_coins_mode = pair.split("/")[0] in config["coins"]
if not is_pair_top_coins_mode:
log.info(f"[{current_time}] Cancelling entry for {pair} due to not being in top coins list.")
return False
return True
def _handle_scalp_mode(self, pair: str, config: dict, current_time: datetime) -> bool:
current_free_slots = self.config["max_open_trades"] - Trade.get_open_trade_count()
if current_free_slots < config["min_free_slots"]:
log.info(f"[{current_time}] Cancelling entry for {pair} due to insufficient free slots.")
return False
return True
# Confirm Trade Exit
# ---------------------------------------------------------------------------------------------
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 in ["stop_loss", "trailing_stop_loss"]:
# log.info(f"[{current_time}] Cancelling {exit_reason} exit for {pair}")
return False
if self.exit_profit_only:
profit = 0.0
if trade.realized_profit != 0.0:
profit = ((rate - trade.open_rate) / trade.open_rate) * trade.stake_amount * (1 - trade.fee_close)
profit = profit + trade.realized_profit
profit = profit / trade.stake_amount
else:
profit = trade.calc_profit_ratio(rate)
if profit < self.exit_profit_offset:
return False
self._remove_profit_target(pair)
return True
# Bot Loop Start
# ---------------------------------------------------------------------------------------------
def bot_loop_start(self, current_time: datetime, **kwargs) -> None:
if self.config["runmode"].value not in ("live", "dry_run"):
return super().bot_loop_start(datetime, **kwargs)
if self.hold_support_enabled:
self.load_hold_trades_config()
return super().bot_loop_start(current_time, **kwargs)
# Leverage
# ---------------------------------------------------------------------------------------------
def leverage(
self,
pair: str,
current_time: datetime,
current_rate: float,
proposed_leverage: float,
max_leverage: float,
entry_tag: Optional[str],
side: str,
**kwargs,
) -> float:
enter_tags = entry_tag.split()
if all(c in self.long_rebuy_mode_tags for c in enter_tags):
return self.futures_mode_leverage_rebuy_mode
elif all(c in self.long_grind_mode_tags for c in enter_tags):
return self.futures_mode_leverage_grind_mode
return self.futures_mode_leverage
# Correct Min Stake
# ---------------------------------------------------------------------------------------------
def correct_min_stake(self, min_stake: float) -> float:
if self.config["exchange"]["name"] in ["bybit"]:
if self.is_futures_mode:
if min_stake < 5.0 / self.futures_mode_leverage:
min_stake = 5.0 / self.futures_mode_leverage
return min_stake
def is_backtest_mode(self) -> bool:
"""Check if the current run mode is backtest or hyperopt"""
return self.dp.runmode.value in ["backtest", "hyperopt"]
def has_valid_entry_conditions(self, trade: Trade, exit_rate: float, last_candle, previous_candle) -> bool:
"""Check if there are valid entry conditions"""
filled_orders = trade.select_filled_orders()
if len(filled_orders) < 1:
return False
slice_profit = (exit_rate - filled_orders[-1].safe_price) / filled_orders[-1].safe_price
if not trade.is_short:
return last_candle["enter_long"] or self.long_grind_entry(last_candle, previous_candle, slice_profit, False)
else:
return last_candle["enter_short"] or self.short_grind_entry(last_candle, previous_candle, slice_profit, False)
return False
# Update signals (enable/disable) from config
# ---------------------------------------------------------------------------------------------
def update_signals_from_config(self, config):
# Update long entry signal parameters (if they exist in the config)
if hasattr(self, "long_entry_signal_params") and "long_entry_signal_params" in config:
for condition_key in self.long_entry_signal_params:
if condition_key in config["long_entry_signal_params"]:
self.long_entry_signal_params[condition_key] = config["long_entry_signal_params"][condition_key]
# Update short entry signal parameters (if they exist in the config)
if hasattr(self, "short_entry_signal_params") and "short_entry_signal_params" in config:
for condition_key in self.short_entry_signal_params:
if condition_key in config["short_entry_signal_params"]:
self.short_entry_signal_params[condition_key] = config["short_entry_signal_params"][condition_key]
# Set Profit Target
# ---------------------------------------------------------------------------------------------
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()
# Remove Profit Target
# ---------------------------------------------------------------------------------------------
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()
# Get Hold Trades Config File
# ---------------------------------------------------------------------------------------------
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
# Load Hold Trades Config
# ---------------------------------------------------------------------------------------------
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()
# Should Hold Trade
# ---------------------------------------------------------------------------------------------
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]
filled_entries = trade.select_filled_orders(trade.entry_side)
filled_exits = trade.select_filled_orders(trade.exit_side)
profit_stake, profit_ratio, profit_current_stake_ratio, profit_init_ratio = self.calc_total_profit(
trade, filled_entries, filled_exits, rate
)
current_profit_ratio = profit_init_ratio
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]
filled_entries = trade.select_filled_orders(trade.entry_side)
filled_exits = trade.select_filled_orders(trade.exit_side)
profit_stake, profit_ratio, profit_current_stake_ratio, profit_init_ratio = self.calc_total_profit(
trade, filled_entries, filled_exits, rate
)
current_profit_ratio = profit_init_ratio
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
# Populate Exit Trend
# ---------------------------------------------------------------------------------------------
def populate_exit_trend(self, df: DataFrame, metadata: dict) -> DataFrame:
df.loc[:, "exit_long"] = 0
df.loc[:, "exit_short"] = 0
return df
#
# $$$$$$$$\ $$\ $$\ $$$$$$$$\ $$$$$$$\ $$\ $$\
# $$ _____|$$$\ $$ |\__$$ __|$$ __$$\\$$\ $$ |
# $$ | $$$$\ $$ | $$ | $$ | $$ |\$$\ $$ /
# $$$$$\ $$ $$\$$ | $$ | $$$$$$$ | \$$$$ /
# $$ __| $$ \$$$$ | $$ | $$ __$$< \$$ /
# $$ | $$ |\$$$ | $$ | $$ | $$ | $$ |
# $$$$$$$$\ $$ | \$$ | $$ | $$ | $$ | $$ |
# \________|\__| \__| \__| \__| \__| \__|
#
#
# $$$$$$\ $$$$$$\ $$\ $$\ $$$$$$$\ $$$$$$\ $$$$$$$$\ $$$$$$\ $$$$$$\ $$\ $$\ $$$$$$\
# $$ __$$\ $$ __$$\ $$$\ $$ |$$ __$$\ \_$$ _|\__$$ __|\_$$ _|$$ __$$\ $$$\ $$ |$$ __$$\
# $$ / \__|$$ / $$ |$$$$\ $$ |$$ | $$ | $$ | $$ | $$ | $$ / $$ |$$$$\ $$ |$$ / \__|
# $$ | $$ | $$ |$$ $$\$$ |$$ | $$ | $$ | $$ | $$ | $$ | $$ |$$ $$\$$ |\$$$$$$\
# $$ | $$ | $$ |$$ \$$$$ |$$ | $$ | $$ | $$ | $$ | $$ | $$ |$$ \$$$$ | \____$$\
# $$ | $$\ $$ | $$ |$$ |\$$$ |$$ | $$ | $$ | $$ | $$ | $$ | $$ |$$ |\$$$ |$$\ $$ |
# \$$$$$$ | $$$$$$ |$$ | \$$ |$$$$$$$ |$$$$$$\ $$ | $$$$$$\ $$$$$$ |$$ | \$$ |\$$$$$$ |
# \______/ \______/ \__| \__|\_______/ \______| \__| \______| \______/ \__| \__| \______/
#
# Populate Entry Trend
# ---------------------------------------------------------------------------------------------
def populate_entry_trend(self, df: DataFrame, metadata: dict) -> DataFrame:
long_entry_conditions = []
short_entry_conditions = []
df.loc[:, "enter_tag"] = ""
df.loc[:, "enter_long"] = ""
df.loc[:, "enter_short"] = ""
is_backtest = self.dp.runmode.value in ["backtest", "hyperopt", "plot", "webserver"]
# the number of free slots
current_free_slots = self.config["max_open_trades"]
if not is_backtest:
current_free_slots = self.config["max_open_trades"] - Trade.get_open_trade_count()
# Grind mode
num_open_long_grind_mode = 0
is_pair_long_grind_mode = metadata["pair"].split("/")[0] in self.grind_mode_coins
if not is_backtest:
open_trades = Trade.get_trades_proxy(is_open=True)
for open_trade in open_trades:
enter_tag = open_trade.enter_tag
if enter_tag is not None:
enter_tags = enter_tag.split()
if all(c in self.long_grind_mode_tags for c in enter_tags):
num_open_long_grind_mode += 1
# Top Coins mode
is_pair_long_top_coins_mode = metadata["pair"].split("/")[0] in self.top_coins_mode_coins
is_pair_short_top_coins_mode = metadata["pair"].split("/")[0] in self.top_coins_mode_coins
# if BTC/ETH stake
is_btc_stake = self.config["stake_currency"] in self.btc_stakes
allowed_empty_candles_288 = 144 if is_btc_stake else 60
###############################################################################################
# LONG ENTRY CONDITIONS STARTS HERE
###############################################################################################
#
# /$$ /$$$$$$ /$$ /$$ /$$$$$$ /$$$$$$$$/$$ /$$/$$$$$$$$/$$$$$$$$/$$$$$$$
# | $$ /$$__ $| $$$ | $$/$$__ $$ | $$_____| $$$ | $|__ $$__| $$_____| $$__ $$
# | $$ | $$ \ $| $$$$| $| $$ \__/ | $$ | $$$$| $$ | $$ | $$ | $$ \ $$
# | $$ | $$ | $| $$ $$ $| $$ /$$$$ | $$$$$ | $$ $$ $$ | $$ | $$$$$ | $$$$$$$/
# | $$ | $$ | $| $$ $$$| $$|_ $$ | $$__/ | $$ $$$$ | $$ | $$__/ | $$__ $$
# | $$ | $$ | $| $$\ $$| $$ \ $$ | $$ | $$\ $$$ | $$ | $$ | $$ \ $$
# | $$$$$$$| $$$$$$| $$ \ $| $$$$$$/ | $$$$$$$| $$ \ $$ | $$ | $$$$$$$| $$ | $$
# |________/\______/|__/ \__/\______/ |________|__/ \__/ |__/ |________|__/ |__/
#
for enabled_long_entry_signal in self.long_entry_signal_params:
long_entry_condition_index = int(enabled_long_entry_signal.split("_")[3])
item_buy_protection_list = [True]
if self.long_entry_signal_params[f"{enabled_long_entry_signal}"]:
# Long Entry Conditions Starts Here
# -----------------------------------------------------------------------------------------
long_entry_logic = []
long_entry_logic.append(reduce(lambda x, y: x & y, item_buy_protection_list))
# Condition #1 - Normal mode (Long).
if long_entry_condition_index == 1:
# Protections
long_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
long_entry_logic.append(df["protections_long_global"] == True)
long_entry_logic.append(
# 5m & 15m & 1h down move
((df["RSI_3"] > 3.0) | (df["RSI_3_15m"] > 3.0) | (df["RSI_3_change_pct_1h"] > -50.0))
# 5m & 15m down move, 5h high
& ((df["RSI_3"] > 3.0) | (df["RSI_3_15m"] > 5.0) | (df["RSI_14_4h"] < 60.0))
# 5m & 15m down move, 4h high
& ((df["RSI_3"] > 3.0) | (df["RSI_3_15m"] > 10.0) | (df["AROONU_14_4h"] < 100.0))
# 5m & 1h down move, 15m still not low enough
& ((df["RSI_3"] > 3.0) | (df["RSI_3_1h"] > 15.0) | (df["AROONU_14_15m"] < 30.0))
# 5m down move, 15m high
& ((df["RSI_3"] > 3.0) | (df["AROONU_14_15m"] < 80.0))
# 15m down move, 1h downtrend, 1h high
& ((df["RSI_3_15m"] > 1.0) | (df["CMF_20_1h"] > -0.1) | (df["AROONU_14_1h"] < 70.0))
# 15m & 1h down move, 15m still high
& ((df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 20.0) | (df["AROONU_14_15m"] < 40.0))
# 15m & 1h down move, 1h high
& ((df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 30.0) | (df["AROONU_14_1h"] < 80.0))
# 15m & 1h down move, 1h still high
& ((df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 35.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0))
# 15m & 1h & 4h down move
& ((df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 15.0))
# 15m & 1h down move, 1h still high
& ((df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0))
# 15m & 1h & 4h & 1d down move
& ((df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 15.0) | (df["RSI_3_1d"] > 15.0))
# 15m & 1h down move, 1h high
& ((df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 45.0) | (df["AROONU_14_1h"] < 80.0))
# 15m & 4h down move, 4h still high
& ((df["RSI_3_15m"] > 3.0) | (df["RSI_3_4h"] > 35.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0))
# 15m down move, 1h & 4h high
& ((df["RSI_3_15m"] > 3.0) | (df["AROONU_14_1h"] < 85.0) | (df["AROONU_14_4h"] < 90.0))
# 15m down move, 4h high, 1d overbought
& ((df["RSI_3_15m"] > 3.0) | (df["AROONU_14_4h"] < 85.0) | (df["ROC_9_1d"] < 100.0))
# 15m down move, 4h high & overbought
& ((df["RSI_3_15m"] > 3.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 80.0) | (df["ROC_9_4h"] < 30.0))
# 15m & 1h down move, 1d overbought
& ((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 5.0) | (df["ROC_9_1d"] < 40.0))
# 5m & 1h down move, 1h overbought
& ((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 60.0) | (df["ROC_9_1h"] < 40.0))
# 15m & 4h down move, 15m still high
& ((df["RSI_3_15m"] > 5.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0))
# 15m down move, 15m & 4h still high
& ((df["RSI_3_15m"] > 5.0) | (df["AROONU_14_15m"] < 50.0) | (df["AROONU_14_4h"] < 60.0))
# 15m down move, 15m still high, 1d overbought
& ((df["RSI_3_15m"] > 5.0) | (df["AROONU_14_15m"] < 50.0) | (df["ROC_9_1d"] < 80.0))
# 15m down move, 4h high, 1d overbought
& ((df["RSI_3_15m"] > 5.0) | (df["AROONU_14_4h"] < 60.0) | (df["ROC_9_1d"] < 80.0))
# 15m & 1h down move, 1h still high
& ((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0))
# 15m & 1h down move, 4h high
& ((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 20.0) | (df["RSI_14_4h"] < 80.0))
# 15m & 1h down move, 4h overbought
& ((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 25.0) | (df["ROC_9_4h"] < 80.0))
# 15m & 4h down move, 15m still high
& ((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0))
# 15m & 4h down move, 1h high
& ((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 10.0) | (df["AROONU_14_1h"] < 75.0))
# 15m & 4h down move, 1h high
& ((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 30.0) | (df["AROONU_14_1h"] < 85.0))
# 15m & 4h down move, 4h high
& ((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 60.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0))
# 15m down move & downtrend, 4h high
& ((df["RSI_3_15m"] > 10.0) | (df["CMF_20_15m"] > -0.3) | (df["AROONU_14_4h"] < 100.0))
# 15m down move, 1h high, 1d overbought
& ((df["RSI_3_15m"] > 10.0) | (df["AROONU_14_1h"] < 100.0) | (df["ROC_9_1d"] < 80.0))
# 15m down move, 1h high, 4h downtrend
& ((df["RSI_3_15m"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0) | (df["ROC_9_4h"] > -25.0))
# 15m down move, 15m still high, 4h overbought
& ((df["RSI_3_15m"] > 15.0) | (df["RSI_14_15m"] < 50.0) | (df["ROC_9_4h"] < 50.0))
# 15m down move, 15m & 1h high
& ((df["RSI_3_15m"] > 15.0) | (df["AROONU_14_15m"] < 80.0) | (df["AROONU_14_1h"] < 90.0))
# 1h & 1d down move, 4h still high
& ((df["RSI_3_1h"] > 3.0) | (df["RSI_3_1d"] > 15.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0))
# 1h & 4h down move, 1h downtrend
& ((df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 10.0) | (df["CMF_20_1h"] > -0.3))
# 1h & 4h down move, 4h high
& ((df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 20.0) | (df["AROONU_14_4h"] < 70.0))
# 1h & 4h down move, 1d overbought
& ((df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 20.0) | (df["ROC_9_1d"] < 40.0))
# 1h & 4h down move, 15m still not low enough
& ((df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 10.0) | (df["AROONU_14_15m"] < 30.0))
# 1h & 4h down move, 1h still high
& ((df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0))
# 1h & 1d down move, 4h high
& ((df["RSI_3_1h"] > 10.0) | (df["RSI_3_1d"] > 20.0) | (df["AROONU_14_4h"] < 80.0))
# 1h down move, 4h high
& ((df["RSI_3_1h"] > 10.0) | (df["RSI_14_4h"] < 75.0))
# 1h down move, 4h overbought
& ((df["RSI_3_1h"] > 10.0) | (df["ROC_9_4h"] < 50.0))
# 1h & 4h down move, 4h overbought
& ((df["RSI_3_1h"] > 20.0) | (df["RSI_3_4h"] > 50.0) | (df["ROC_9_4h"] < 80.0))
# 1h down move, 4h high & overbought
& ((df["RSI_3_1h"] > 20.0) | (df["AROONU_14_4h"] < 100.0) | (df["ROC_9_4h"] < 50.0))
# 1h down move, 4h & 1d overbought
& ((df["RSI_3_1h"] > 25.0) | (df["ROC_9_4h"] < 80.0) | (df["ROC_9_1d"] < 100.0))
# 1h down move, 1h downtrend, 1h high
& ((df["RSI_3_1h"] > 40.0) | (df["CMF_20_1h"] > -0.25) | (df["AROONU_14_1h"] < 90.0))
# 1h down move, 1h high, 1d overbought
& ((df["RSI_3_1h"] > 40.0) | (df["AROONU_14_1h"] < 80.0) | (df["ROC_9_1d"] < 100.0))
# 1h down move, 1h & 4h high
& ((df["RSI_3_1h"] > 45.0) | (df["AROONU_14_1h"] < 80.0) | (df["AROONU_14_4h"] < 100.0))
# 1h down move, 1h still high, 4h high
& ((df["RSI_3_1h"] > 60.0) | (df["AROONU_14_1h"] < 50.0) | (df["RSI_14_4h"] < 90.0))
# 4h & 1d down move, 4h still not low enough
& ((df["RSI_3_4h"] > 10.0) | (df["RSI_3_1d"] > 15.0) | (df["AROONU_14_4h"] < 20.0))
# 1d down move, 1h still high, 4h high
& ((df["RSI_3_1d"] > 20.0) | (df["AROONU_14_1h"] < 50.0) | (df["AROONU_14_4h"] < 90.0))
# 1d down move, 1h & 4h high
& ((df["RSI_3_1d"] > 25.0) | (df["AROONU_14_1h"] < 80.0) | (df["AROONU_14_4h"] < 90.0))
# 1d down move, 4h still high, 1d overbought
& ((df["RSI_3_1d"] > 50.0) | (df["AROONU_14_4h"] < 50.0) | (df["ROC_9_1d"] < 200.0))
# 1h down move, 4h high, 1d overbought
& ((df["RSI_3_change_pct_1h"] > -75.0) | (df["AROONU_14_4h"] < 90.0) | (df["ROC_9_1d"] < 100.0))
# 15m & 1h & 4h downtrend
& ((df["CMF_20_15m"] > -0.3) | (df["CMF_20_1h"] > -0.3) | (df["CMF_20_4h"] > -0.3))
# 5m down move, 15m still not low enough, 1h high
& ((df["ROC_2"] > -10.0) | (df["AROONU_14_15m"] < 30.0) | (df["AROONU_14_1h"] < 80.0))
# 5m down move, 15m still high
& ((df["ROC_2"] > -10.0) | (df["AROONU_14_15m"] < 50.0))
# 5m down move, 15m & 1h down move, 15m still high
& (
(df["ROC_9"] > -15.0) | (df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 35.0) | (df["AROONU_14_15m"] < 50.0)
)
# 5m down move, 4h down move, 15m downtrend, 1h high
& (
(df["ROC_9"] > -15.0) | (df["RSI_3_4h"] > 45.0) | (df["CMF_20_15m"] > -0.3) | (df["AROONU_14_1h"] < 60.0)
)
# 1h downtrend, 4h high & overbought
& ((df["ROC_9_1h"] > -25.0) | (df["AROONU_14_4h"] < 80.0) | (df["ROC_9_4h"] < 80.0))
# 1d P&D, 1d downtrend
& ((df["change_pct_1d"] > -5.0) | (df["change_pct_1d"].shift(288) < 30.0) | (df["CMF_20_1d"] > -0.0))
# 1d green with top wick, 1h down move
& ((df["change_pct_1d"] < 20.0) | (df["top_wick_pct_1d"] < 15.0) | (df["RSI_3_1h"] > 20.0))
# 1d green with top wick, 4h high
& ((df["change_pct_1d"] < 25.0) | (df["top_wick_pct_1d"] < 25.0) | (df["AROONU_14_4h"] < 80.0))
# 1d green, 1h down move, 1d downtrend
& ((df["change_pct_1d"] < 40.0) | (df["RSI_3_1h"] > 25.0) | (df["CMF_20_1d"] > -0.2))
# 1d green with top wick, 4h overbought
& ((df["change_pct_1d"] < 50.0) | (df["top_wick_pct_1d"] < 30.0) | (df["ROC_9_4h"] < 80.0))
# big drop in the last hour, 15m downtrend
& ((df["close"] > (df["close_max_12"] * 0.65)) | (df["CMF_20_15m"] > -0.5))
# big drop in the last 6 hours, 1h down move, 1h high
& ((df["close"] > (df["high_max_6_1h"] * 0.60)) | (df["RSI_3_1h"] > 20.0) | (df["AROONU_14_1h"] < 60.0))
# big drop in the last 24 hours, 1h still high
& ((df["close"] > (df["high_max_24_1h"] * 0.40)) | (df["STOCHRSIk_14_14_3_3_1h"] < 45.0))
# big drop in the last 4 days, 1h high
& ((df["close"] > (df["high_max_24_4h"] * 0.20)) | (df["AROONU_14_1h"] < 70.0))
)
# Logic
long_entry_logic.append(
(df["EMA_26"] > df["EMA_12"])
& ((df["EMA_26"] - df["EMA_12"]) > (df["open"] * 0.034))
& ((df["EMA_26"].shift() - df["EMA_12"].shift()) > (df["open"] / 100.0))
& (df["close"] < (df["BBL_20_2.0"] * 0.999))
)
# Condition #2 - Normal mode (Long).
if long_entry_condition_index == 2:
# Protections
long_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
long_entry_logic.append(df["protections_long_global"] == True)
long_entry_logic.append((df["RSI_3"] > 3.0) & (df["RSI_3_15m"] > 3.0))
long_entry_logic.append(
# 5m & 15m & 1h down move, 1h & 4h high, 4h overbought
(
(df["RSI_3"] > 5.0)
| (df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 40.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
| (df["ROC_9_4h"] < 20.0)
)
# 5m & 15m & 1h & 4h down move, 1h & 4h still not low enough, 1h still high
& (
(df["RSI_3"] > 5.0)
| (df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 40.0)
| (df["AROONU_14_1h"] < 20.0)
| (df["AROONU_14_4h"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 1h & 4h down move, 15m downtrend, 1h still not low enough
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 30.0)
| (df["CMF_20_15m"] > -0.25)
| (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
)
# 5m & 15m & 1h down move, 15m still high, 1h & 4h high
& (
(df["RSI_3"] > 5.0)
| (df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["AROONU_14_4h"] < 90.0)
)
# 5m & 15m & 4h down move, 15m downtrend, 1d high, 1h & 4h still not low enough
& (
(df["RSI_3"] > 10.0)
| (df["RSI_3_15m"] > 10.0)
| (df["RSI_14_4h"] < 10.0)
| (df["CMF_20_15m"] > -0.20)
| (df["STOCHRSIk_14_14_3_3_1d"] < 90.0)
| (df["CCI_20_1h"] < -150.0)
| (df["CCI_20_4h"] < -250.0)
)
# 15m & 1h & 4h down move, 4h still not low enough
& ((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 15.0) | (df["RSI_14_4h"] < 30.0))
# 15m & 1h down move, 4h still high
& ((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 10.0) | (df["RSI_14_4h"] < 50.0))
# 15m & 1h & 4h down move, 15m & 1h downtrend
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 50.0)
| (df["CMF_20_15m"] > -0.5)
| (df["CCI_20_change_pct_15m"] > -0.0)
| (df["CCI_20_change_pct_1h"] > -0.0)
)
# 15m & 1h & 4h down move, 1h still not low enough, 4h still high
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 40.0)
)
# 15m & 1h & 4h down move, 1h & 4h high
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 55.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 80.0)
)
# 15m & 1h & 4h down move, 1h & 4h still not low enough
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m & 1h & 4h down move, 1h & 4h still high, 1h high
& (
(df["RSI_3_15m"] > 5.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_1h"] < 75.0)
)
# 15m & 4h down move, 1h still not low enough
& ((df["RSI_3_15m"] > 5.0) | (df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 30.0))
# 15m & 1h & 4h & 1d down move, 1h & 4h still not low enough
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 10.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_3_1d"] > 25.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
)
# 15m & 1h & 4h down move, 1h still high, 1h downtrend
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 10.0)
| (df["RSI_3_4h"] > 30.0)
| (df["AROONU_14_1h"] < 40.0)
| (df["ROC_9_1h"] > -20.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h downtrend
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_3_4h"] > 35.0)
| (df["CMF_20_15m"] > -0.30)
| (df["CMF_20_1h"] > -0.30)
| (df["CMF_20_4h"] > -0.25)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h still high, 1h still high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 15.0)
| (df["RSI_14_15m"] < 20.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 40.0)
)
# 15m & 1h down move, 1h & 4h & 1d high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["AROONU_14_1d"] < 100.0)
)
# 15m & 1h down move, 1h & 4h still high, 15m & 1h downtrend
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_15m"] > -0.25)
| (df["CMF_20_1h"] > -0.25)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 1d overbought
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["ROC_9_1d"] < 30.0)
)
# 15m & 1h & 4h down move, 1h & 4h still high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 4h still high, 1h high still high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 50.0)
| (df["AROONU_14_15m"] < 20.0)
| (df["AROONU_14_4h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["AROONU_14_4h"] < 90.0)
)
# 15m & 1h & 4h down move, 1h & 4h still not low enough, 1d high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_1d"] < 90.0)
)
# 15m & 1h & 4h down move, 1h still high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 35.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 1h & 4h down move, 15m downtrend, 1d high, 1h & 4h downtrend
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_15m"] > -0.25)
| (df["STOCHRSIk_14_14_3_3_1d"] < 90.0)
| (df["CCI_20_1h"] < -150.0)
| (df["CCI_20_4h"] < -250.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 1h high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
)
# 15m & 1h down move, 1h & 4h still high, 1d high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_1d"] < 80.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still not low enough, 1 high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["AROONU_14_1h"] < 70.0)
)
# 15m & 1h down move, 1h & 4h still high, 1h & 4h high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 60.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m & 1h down move, 1h still high, 4h high & overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_1h"] < 40.0)
| (df["AROONU_14_4h"] < 85.0)
| (df["ROC_9_4h"] < 40.0)
)
# 15m & 1h & 4h down move, 1h & 4h still not low enough
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 10.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 35.0)
)
# 15m & 1h & 4h & 1d down move, 1h & 4h still not low enough
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 20.0)
| (df["RSI_3_1d"] > 40.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 35.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h still high, 1h high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 80.0)
)
# 15m & 1h & 4h down move, 1h & 4h downtrend, 1h & 4h still high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 40.0)
| (df["CMF_20_1h"] > -0.0)
| (df["CMF_20_4h"] > -0.25)
| (df["AROONU_14_1h"] < 40.0)
| (df["AROONU_14_4h"] < 50.0)
)
# 15m & 1h & 4h down move, 1h & 4h still high, 1d overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["ROC_9_1d"] < 50.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h stil high, 1h & 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["AROONU_14_4h"] < 100.0)
| (df["ROC_9_4h"] < 20.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_14_15m"] < 35.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 90.0)
)
# 15m & 4h & 1d down move, 15m still not low enough, 1h still high, 4h downtrend
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_4h"] > 15.0)
| (df["RSI_3_1d"] > 15.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["ROC_9_4h"] > -10.0)
)
# 15m & 1h down move, 4h high, 1h & 4h high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["AROONU_14_4h"] < 70.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h still high, 1h high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_1h"] < 70.0)
)
# 15m & 1h & 4h down move, 1h still not low enough, 4h still high, 1d downtrend
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 25.0)
| (df["AROONU_14_1h"] < 20.0)
| (df["AROONU_14_4h"] < 50.0)
| (df["ROC_9_1d"] > -30.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 25.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 60.0)
| (df["AROONU_14_4h"] < 90.0)
)
# 15m & 1h down move, 15m still not low enough, 1h still high, 4h high & overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["ROC_9_4h"] < 50.0)
)
# 15m & 1h down move, 15m & 1h & 4h still high, 4h overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 40.0)
| (df["AROONU_14_4h"] < 85.0)
| (df["ROC_9_4h"] < 80.0)
)
# 15m & 1h down move, 15m still high, 1h & 4h high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 65.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 60.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 90.0)
)
# 1h down move, 15m still high, 1h & 4h high, 4h overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 60.0)
| (df["RSI_14_4h"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
| (df["ROC_9_4h"] < 40.0)
)
# 15m & 1h down move, 15m downtrend, 1h & 4h high
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 50.0)
| (df["CMF_20_15m"] > -0.30)
| (df["AROONU_14_1h"] < 70.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 35.0)
| (df["RSI_14_1h"] < 40.0)
| (df["AROONU_14_1h"] < 70.0)
)
# 15m & 1h & 4h down move, 1h still high, 4h high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 60.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 50.0)
)
# 15m & 1h & 4h down move, 15m high
& (
(df["RSI_3_15m"] > 45.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 45.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 70.0)
)
# 1h & 4h & 1d down move, 1h & 4h still not low enough
& (
(df["RSI_3_1h"] > 10.0)
| (df["RSI_3_4h"] > 10.0)
| (df["RSI_3_1d"] > 20.0)
| (df["RSI_14_1h"] < 20.0)
| (df["RSI_14_4h"] < 30.0)
| (df["AROONU_14_1h"] < 20.0)
)
# 1h down move, 4h high, 1d overbought
& ((df["RSI_3_1h"] > 10.0) | (df["AROONU_14_4h"] < 60.0) | (df["ROC_9_1d"] < 50.0))
# 1h & 4h & 1d down move, 4h downtrend, 1d downtrend
& (
(df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_3_1d"] > 30.0)
| (df["CMF_20_4h"] > -0.40)
| (df["ROC_9_1d"] > -50.0)
)
# 1h down move, 1h downtrend, 1d overbought
& ((df["RSI_3_1h"] > 30.0) | (df["ROC_9_1h"] > -25.0) | (df["ROC_9_1d"] < 200.0))
# 1h down move, 1h & 1d overbought
& ((df["RSI_3_1h"] > 50.0) | (df["ROC_9_1h"] < 20.0) | (df["ROC_9_1d"] < 80.0))
# 4h down move, 4h still high
& ((df["RSI_3_4h"] > 10.0) | (df["AROONU_14_4h"] < 50.0))
# 1d down move, 4h downtrend, 1h high
& ((df["RSI_3_1d"] > 10.0) | (df["CMF_20_4h"] > -0.30) | (df["AROONU_14_1h"] < 80.0))
& (
# 1d green, 15m down move, 1h & 4h still high, 4h overbought
(df["change_pct_1d"] < 30.0)
| (df["RSI_3_15m"] > 15.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["ROC_9_4h"] < 50.0)
)
)
# Logic
long_entry_logic.append(
(df["AROONU_14"] < 25.0)
& (df["STOCHRSIk_14_14_3_3"] < 20.0)
& (df["AROONU_14_15m"] < 25.0)
& (df["close"] < (df["EMA_20"] * 0.944))
)
# Condition #3 - Normal mode (Long).
if long_entry_condition_index == 3:
# Protections
long_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
long_entry_logic.append(df["protections_long_global"] == True)
long_entry_logic.append(
# 5m & 15m down move, 15m & 1h & 4h still high, 15m & 4h high, 1h & 4h still high
(
(df["RSI_14"] < 5.0)
| (df["RSI_3_15m"] > 20.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 5m & 15m & dh down move, 15m & 1h still high, 15m high
& (
(df["RSI_3"] > 5.0)
| (df["RSI_3_15m"] > 25.0)
| (df["RSI_3_4h"] > 25.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 40.0)
)
# 5m & 15m & 4h down move, 15m still not low enough, 1h & 4h still high, 15m still high
& (
(df["RSI_3"] > 10.0)
| (df["RSI_3_15m"] > 20.0)
| (df["RSI_3_4h"] > 20.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 50.0)
)
# 5m & 15m & 1h down move, 15m still high, 4h high, 1d overbought
& (
(df["RSI_3"] > 10.0)
| (df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 50.0)
| (df["AROONU_14_15m"] < 40.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["ROC_9_1d"] < 40.0)
)
# 5m & 15m & 4h down move, 15m & 1h & 4h still high, 15m & 1h & 4h high
& (
(df["RSI_3"] > 10.0)
| (df["RSI_3_15m"] > 25.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_1h"] < 60.0)
| (df["AROONU_14_4h"] < 60.0)
)
# 15m & 1h & 4h down move, 1h & 4h still not low enough, 1h still high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 5m & 15m & 4h & 1d down move, 15m & 4h still not low enough, 4h downtrend
& (
(df["RSI_3"] > 10.0)
| (df["RSI_3_15m"] > 30.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_3_1d"] > 40.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
| (df["ROC_9_4h"] > -10.0)
)
# 15m down move, 15m still not low enough, 1h high
& (
(df["RSI_3_15m"] > 10.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
)
# 5m & 15m & 1h down move, 15m still not low enough, 1h high
& (
(df["RSI_3"] > 15.0)
| (df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["AROONU_14_15m"] < 40.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h still high, 15m still not low enough, 1h high
& (
(df["RSI_3_15m"] > 10.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 30.0)
| (df["AROONU_14_1h"] < 70.0)
)
# 15m & 1h & 4h down move, 15m & 1h still not low enough, 15m & 1h still high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 1h high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_1h"] < 70.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 65.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_1h"] < 85.0)
| (df["AROONU_14_4h"] < 85.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 1d overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["ROC_9_1d"] < 80.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h still high, 4h overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["ROC_9_4h"] < 50.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 4h overbought
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["ROC_9_4h"] < 20.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 1h high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 15m & 1h & 4h down move, 15m still high, 1h still high, 4h high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 65.0)
| (df["RSI_3_1d"] > 65.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m & 4h down move, 15m still high, 1h still high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_4h"] > 15.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m & 4h down move, 15m still high, 1h still high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_4h"] > 20.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 1d down move, 15m & 1h & 4h still high, 15m still high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1d"] > 20.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 50.0)
)
# 15m & 1h & 4h down move, 15m high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_4h"] > 20.0)
| (df["AROONU_14_15m"] < 60.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 4h high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_1h"] < 70.0)
)
# 15m & 1h & 4h down move, 1h & 4h still high, 1h high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 15m & 1h & 4h down move, 15m still not low enough, 1h & 4h still high, 15m high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_3_4h"] > 30.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 60.0)
)
# 15m & 4h down move, 15m still high, 1h high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_4h"] > 20.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 15m & 4h down move, 15m & 4h still high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_4h"] > 35.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 50.0)
)
# 15m & 4h down move, 15m & 1h & 4h still high, 15m & 4h high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 60.0)
)
# 15m & 4h down move, 15m & 1h & 4h still high, 15m high, 1d overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["ROC_9_1d"] < 50.0)
)
# 15m down move, 1h & 4h high, 15m high, 1d overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_14_1h"] < 60.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["ROC_9_1d"] < 50.0)
)
# 15m down move, 15m & 1h & 4h still high, 15m downtrend, 15m & 1h high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["CMF_20_15m"] > -0.10)
| (df["AROONU_14_15m"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 90.0)
)
# 15m down move, 15m & 1h & 4h still high, 1h high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 15m down move, 15m & 1h & 4h high, 1h & 4h overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["AROONU_14_15m"] < 70.0)
| (df["AROONU_14_1h"] < 85.0)
| (df["AROONU_14_4h"] < 85.0)
| (df["ROC_9_1h"] < 50.0)
| (df["ROC_9_4h"] < 50.0)
)
# 15m & 1h & 4h down move, 15m high
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 30.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 60.0)
)
# 15m & 1h & 4h down move, 4h high
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 60.0)
| (df["AROONU_14_4h"] < 75.0)
)
# 15m ^ 1h down move, 15m still high, 1h & 4h high
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 35.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_1h"] < 85.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m & 1h down move, 15m & 1h high
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 35.0)
| (df["AROONU_14_15m"] < 70.0)
| (df["AROONU_14_1h"] < 100.0)
)
# 15m & 1h down move, 15m still high, 4h high & overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 45.0)
| (df["AROONU_14_15m"] < 40.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["ROC_9_4h"] < 40.0)
)
# 15m & 1h down move, 15m & 1h still high, 4h downtrend, 15m still not low enough, 1h high
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["CMF_20_4h"] > -0.20)
| (df["AROONU_14_15m"] < 30.0)
| (df["AROONU_14_1h"] < 80.0)
)
# 15m & 4h down move, 15m downtrend, 15m high
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_4h"] > 40.0)
| (df["CMF_20_15m"] > -0.30)
| (df["AROONU_14_15m"] < 60.0)
)
# 15m & 4h down move, 15m high
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_4h"] > 40.0)
| (df["RSI_14_15m"] < 40.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 60.0)
)
# 15m & 4h down move, 15m & 1h & 4h still high, 15m high, 1h & 4h still not low enough, 1d overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 20.0)
| (df["ROC_9_1d"] < 50.0)
)
# 15m & 4h down move, 15m & 1h still high, 4h high & overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 60.0)
| (df["ROC_9_4h"] < 50.0)
)
# 15m down move, 15m still not low enough, 4h high & overbought
& (
(df["RSI_3_15m"] > 25.0)
| (df["AROONU_14_15m"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
| (df["ROC_9_4h"] < 50.0)
)
# 15m down move, 15m high, 4h downtrend
& ((df["RSI_3_15m"] > 25.0) | (df["AROONU_14_15m"] < 70.0) | (df["ROC_9_4h"] > -40.0))
# 15m down move, 1h high, 4h overbought
& ((df["RSI_3_15m"] > 25.0) | (df["AROONU_14_1h"] < 70.0) | (df["ROC_9_4h"] < 40.0))
# 15m & 1h & 4h down move, 15m & 1h high 4h downtrend
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 40.0)
| (df["RSI_3_4h"] > 20.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 60.0)
| (df["ROC_9_4h"] > -20.0)
)
# 15m & 1h down move, 15m & 1h & 4h still high, 1h & 4h downtrend, 15m stil high, 1h high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_1h"] > -0.10)
| (df["CMF_20_4h"] > -0.10)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_1h"] < 90.0)
)
# 15m & 1h & 4h & 1d down move, 15m & 1h & 4h still not low enough, 15m still high, 1d downtrend
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_3_4h"] > 50.0)
| (df["RSI_3_1d"] > 15.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["AROONU_14_15m"] < 40.0)
| (df["ROC_9_1d"] > -40.0)
)
# 15m & 1h down move, 15m & 1h & 4h still high, 1h & 4h downtrend, 15m still high, 1h & 4h high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_1h"] > -0.10)
| (df["CMF_20_4h"] > -0.10)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_1h"] < 85.0)
| (df["AROONU_14_4h"] < 90.0)
)
# 15m & 1h down move, 15m still high, 1h & 4h high, 15m & 4h high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 55.0)
| (df["RSI_14_15m"] < 45.0)
| (df["RSI_14_1h"] < 55.0)
| (df["RSI_14_4h"] < 60.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 80.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 15m high, 4h downtrend
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 60.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 60.0)
| (df["ROC_9_4h"] > -20.0)
)
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 1h high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 65.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
)
# 15m & 1h down move, 15m & 1h & 4h still high, 15m & 1h still not low enough, 4h high, 1d overbought
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 65.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 30.0)
| (df["AROONU_14_1h"] < 30.0)
| (df["AROONU_14_4h"] < 80.0)
| (df["ROC_9_1d"] < 150.0)
)
# 15m & 1h & 4h & 1d down move, 15m still not low enough, 1h & 4h still high, 15m still high, 4h high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 55.0)
| (df["RSI_3_1d"] > 55.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 40.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_4h"] < 70.0)
)
# 15m & 1h & 4h down move, 15m high, 1h still high, 4h high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_3_4h"] > 50.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 15m & 1h & 4h down move, 15m & 1h high, 1d downtrend
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_14_1h"] > 50.0)
| (df["RSI_14_4h"] > 65.0)
| (df["AROONU_14_15m"] < 70.0)
| (df["AROONU_14_1h"] < 100.0)
| (df["ROC_9_1d"] > -25.0)
)
# 15m & 1h down move, 15m & 1h still high, 15m still not low enough, 1h high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 40.0)
| (df["AROONU_14_15m"] < 20.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 15m & 4h down move, 15m still high, 1h & 4h high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_4h"] > 30.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_1h"] < 70.0)
| (df["AROONU_14_4h"] < 70.0)
)
# 15m & 4h down move, 4h overbought
& ((df["RSI_3_15m"] > 30.0) | (df["RSI_3_4h"] > 60.0) | (df["ROC_9_4h"] < 100.0))
# 15m & 1h & 4h down move, 15m & 1h & 4h still high, 15m & 1h still not low enough, 4h high
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 30.0)
| (df["AROONU_14_1h"] < 30.0)
| (df["AROONU_14_4h"] < 70.0)
)
# 15m & 1h down move, 15m & 1h & 4h still high, 1h & 4h downtrend, 15m still high, 4h high & overbought
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_1h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_1h"] > -0.0)
| (df["CMF_20_4h"] > -0.1)
| (df["AROONU_14_15m"] < 40.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["ROC_9_4h"] < 10.0)
)
# 15m & 4h down move, 4m downtrend, 15m high, 4h still high
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_4h"] > 35.0)
| (df["CMF_20_4h"] > -0.20)
| (df["STOCHRSIk_14_14_3_3_15m"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m & 4h down move, 15m & 1h & 4h still high, 1d overbought
& (
(df["RSI_3_15m"] > 35.0)
| (df["RSI_3_4h"] > 60.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
| (df["ROC_9_1d"] < 50.0)
)
# 15m & 1h down move, 15m & 1h & 4h still high, 15m & 4h high, 15m & 1h still not low enough, 4h overbought
& (
(df["RSI_3_15m"] > 45.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
| (df["ROC_9_4h"] < 20.0)
)
# 15m & 4h down move, 15m & 1h & 4h still high
& (
(df["RSI_3_15m"] > 45.0)
| (df["RSI_3_4h"] > 10.0)
| (df["AROONU_14_15m"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
)
# 15m & 4h down move, 15m & 4h high
& (
(df["RSI_3_15m"] > 45.0)
| (df["RSI_3_4h"] > 20.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 60.0)
)
# 15m & 4h down move, 15m still not low enough, 1h still high, 4h high, 4h downtrend, 4h overbought
& (
(df["RSI_3_15m"] > 45.0)
| (df["RSI_3_4h"] > 65.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 40.0)
| (df["RSI_14_4h"] < 50.0)
| (df["CMF_20_4h"] > -0.10)
| (df["AROONU_14_15m"] < 40.0)
| (df["AROONU_14_4h"] < 70.0)
| (df["ROC_9_4h"] < 20.0)
)
# 15m down move, 15m & 1h high
& (
(df["RSI_3_15m"] > 45.0)
| (df["RSI_14_15m"] < 50.0)
| (df["RSI_14_1h"] < 60.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_1h"] < 100.0)
)
# 15m & 1h & 4h down move, 15m & 1h high
& (
(df["RSI_3_15m"] > 50.0)
| (df["RSI_3_1h"] > 50.0)
| (df["RSI_3_4h"] > 50.0)
| (df["AROONU_14_15m"] < 70.0)
| (df["AROONU_14_1h"] < 100.0)
)
# 15m down move, 15m & 1h & 4h still high, 15m & 4h high
& (
(df["RSI_3_15m"] > 50.0)
| (df["RSI_14_15m"] < 50.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 50.0)
| (df["AROONU_14_15m"] < 60.0)
| (df["AROONU_14_4h"] < 85.0)
)
# 1h & 4h down move, 15m still high
& ((df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 40.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0))
# 1h & 4h down move, 15m still high
& ((df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 10.0) | (df["AROONU_14_15m"] < 50.0))
# 4h down move, 15m still high, 1h still high
& ((df["RSI_3_4h"] > 3.0) | (df["AROONU_14_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0))
# 4h down move, 15m high, 4h still not low enough
& (
(df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 80.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 4h & 1d down move, 15m & 1h & 4h still not low enough, 15m high
& (
(df["RSI_3_4h"] > 20.0)
| (df["RSI_3_1d"] > 20.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["RSI_14_4h"] < 30.0)
| (df["STOCHRSIk_14_14_3_3_15m"] < 60.0)
)
# 4h down move, 15m stil high, 1h high, 4h & 1d downtrend
& (
(df["RSI_3_4h"] > 20.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
| (df["ROC_9_4h"] > -25.0)
| (df["ROC_9_1d"] > -50.0)
)
# drop in the last 1 hour
& (df["close"] > (df["close_max_12"] * 0.65))
)
# Logic
long_entry_logic.append(
(df["RSI_20"] < df["RSI_20"].shift(1))
& (df["RSI_4"] < 45.0)
& (df["RSI_14"] > 32.0)
& (df["AROONU_14"] < 10.0)
& (df["STOCHRSIk_14_14_3_3"] < 10.0)
& (df["close"] < df["SMA_16"] * 0.965)
& (df["close"] < df["SMA_16_1h"] * 0.985)
)
# Condition #4 - Normal mode (Long).
if long_entry_condition_index == 4:
# Protections
long_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
long_entry_logic.append(df["protections_long_global"] == True)
long_entry_logic.append(df["RSI_3_1h"] <= 95.0)
long_entry_logic.append(df["RSI_3_4h"] <= 80.0)
long_entry_logic.append(df["RSI_3_1d"] <= 80.0)
long_entry_logic.append(df["RSI_14_1h"] < 80.0)
long_entry_logic.append(df["RSI_14_4h"] < 80.0)
long_entry_logic.append(df["RSI_14_1d"] < 90.0)
# 5m down move, 15m still not low enough
long_entry_logic.append((df["RSI_3"] > 3.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 20.0))
# 5m down move, 1h still high, 1d high
long_entry_logic.append(
(df["RSI_3"] > 3.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0) | (df["AROONU_14_1d"] < 90.0)
)
# 5m down move, 1h still high
long_entry_logic.append((df["RSI_3"] > 3.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0))
# 5m & 1h & 1d down move
long_entry_logic.append((df["RSI_3"] > 5.0) | (df["RSI_3_1h"] > 10.0) | (df["RSI_3_1d"] > 20.0))
# 5m & 1h down move, 4h high
long_entry_logic.append((df["RSI_3"] > 10.0) | (df["RSI_3_1h"] > 30.0) | (df["AROONU_14_4h"] < 80.0))
# 5m & 4h down move, 4h still not low enough
long_entry_logic.append((df["RSI_3"] > 10.0) | (df["RSI_3_4h"] > 15.0) | (df["AROONU_14_4h"] < 30.0))
# 15m & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_4h"] > 20.0) | (df["AROONU_14_4h"] < 40.0))
# 15m & 4h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 3.0) | (df["RSI_3_4h"] > 40.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m down move, 1h still high
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0))
# 15m & 1h down move, 1h still not low enough
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 10.0) | (df["AROONU_14_1h"] < 20.0))
# 15m & 1h down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 20.0)
)
# 15m & 1h down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
)
# 15m down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0))
# 15m & 1h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m & 1h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m & 1h down move, 1h still high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 30.0) | (df["AROONU_14_1h"] < 50.0))
# 15m & 4h down move, 1h still not low enough
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 15.0) | (df["AROONU_14_1h"] < 30.0))
# 15m down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0))
# 15m & 1h down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 25.0) | (df["RSI_3_1h"] > 35.0) | (df["AROONU_14_1h"] < 80.0))
# 15m down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 25.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 80.0))
# 1h & 4h down move
long_entry_logic.append((df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 10.0))
# 1h & 4h down move, drop in the last hour
long_entry_logic.append(
(df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 20.0) | (df["close"] > (df["close_max_12"] * 0.90))
)
# 1h down move, 1h still not low enough, 4h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 5.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 25.0) | (df["AROONU_14_4h"] < 60.0)
)
# 1h down move, 15m still high
long_entry_logic.append((df["RSI_3_1h"] > 5.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0))
# 1h & 4h down move, 15m high
long_entry_logic.append(
(df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 70.0)
)
# 1h & 4h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 20.0) | (df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 1h & 4h & 1d down move
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["RSI_3_4h"] > 25.0) | (df["RSI_3_1d"] > 5.0))
# 1h down move, 15m still not low enough, 4h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 1h down move, 1h high
long_entry_logic.append((df["RSI_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0))
# 1h & 4h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 35.0) | (df["RSI_3_4h"] > 40.0) | (df["AROONU_14_4h"] < 85.0))
# 1h down move, 1h & 4h high
long_entry_logic.append((df["RSI_3_1h"] > 55.0) | (df["AROONU_14_1h"] < 75.0) | (df["AROONU_14_4h"] < 90.0))
# 4h down move, 15m still high, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0) | (df["AROONU_14_4h"] < 25.0)
)
# 4h down move, drop in last 1h
long_entry_logic.append((df["RSI_3_4h"] > 15.0) | (df["close"] > (df["close_max_12"] * 0.85)))
# 4h & 1d down move, 15m still high
long_entry_logic.append(
(df["RSI_3_4h"] > 20.0) | (df["RSI_3_1d"] > 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 40.0)
)
# 15m still high, 1h & 4h high
long_entry_logic.append(
(df["RSI_14_15m"] < 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0) | (df["AROONU_14_4h"] < 90.0)
)
# 5m not low enough, 15m still high, 4h high
long_entry_logic.append(
(df["STOCHRSIk_14_14_3_3"] < 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 40.0) | (df["AROONU_14_4h"] < 85.0)
)
# 1h red, 1h high
long_entry_logic.append(
(df["change_pct_1h"] > -5.0) | (df["AROONU_14_1h"] < 70.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 4h down move, drop but not yet near the previous lows
long_entry_logic.append(
(df["RSI_3_4h"] > 25.0)
| (df["close"] > (df["high_max_12_4h"] * 0.50))
| (df["close"] < (df["low_min_24_4h"] * 1.10))
)
# 1d overbought, drop but not yet near the previous lows in last 12 days
long_entry_logic.append(
(df["ROC_9_1d"] < 200.0)
| (df["close"] > (df["high_max_12_1d"] * 0.50))
| (df["close"] < (df["low_min_12_1d"] * 1.25))
)
# pump, drop but not yet near the previous lows
long_entry_logic.append(
(((df["high_max_6_1d"] - df["low_min_6_1d"]) / df["low_min_6_1d"]) < 6.0)
| (df["close"] > (df["high_max_6_4h"] * 0.85))
| (df["close"] < (df["low_min_6_1d"] * 1.25))
)
# big drop in last 24 hours, 1h still high
long_entry_logic.append(
(df["close"] > (df["high_max_24_1h"] * 0.50)) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# big drop in last 4 hours, 4h still not low enough
long_entry_logic.append(
(df["close"] > (df["high_max_24_4h"] * 0.50)) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# big drop in last 4 hours, 1h down move
long_entry_logic.append((df["close"] > (df["high_max_24_4h"] * 0.30)) | (df["RSI_3_1h"] > 10.0))
# big drop in the last 6 days, 1d down move
long_entry_logic.append((df["close"] > (df["high_max_6_1d"] * 0.30)) | (df["RSI_3_1d"] > 15.0))
# big drop in the last 20 days, 1h down move
long_entry_logic.append((df["close"] > (df["high_max_20_1d"] * 0.10)) | (df["RSI_3_1h"] > 20.0))
# big drop in the last 30 days, 4h still high
long_entry_logic.append(
(df["close"] > (df["high_max_30_1d"] * 0.05)) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# Logic
long_entry_logic.append(df["AROONU_14"] < 25.0)
long_entry_logic.append(df["AROONU_14_15m"] < 25.0)
long_entry_logic.append(df["close"] < (df["EMA_9"] * 0.946))
long_entry_logic.append(df["close"] < (df["EMA_20"] * 0.960))
# Condition #5 - Normal mode (Long).
if long_entry_condition_index == 5:
# Protections
long_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
long_entry_logic.append(df["protections_long_global"] == True)
# 5m & 1h & 4h down move
long_entry_logic.append((df["RSI_3"] > 3.0) | (df["RSI_3_1h"] > 3.0) | (df["RSI_3_4h"] > 10.0))
# 5m down move, 1h & 4h still high
long_entry_logic.append(
(df["RSI_3"] > 3.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 5m down move, 1h high
long_entry_logic.append((df["RSI_3"] > 5.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0))
# 5m & 1h down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3"] > 10.0) | (df["RSI_3_1h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
)
# 5m & 1h down move, 4h high
long_entry_logic.append((df["RSI_3"] > 10.0) | (df["RSI_3_1h"] > 30.0) | (df["AROONU_14_4h"] < 80.0))
# 5m down move, 1h still high, 4h high
long_entry_logic.append(
(df["RSI_3"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0) | (df["AROONU_14_4h"] < 90.0)
)
# 15m & 1h & 4h down move
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 20.0) | (df["RSI_3_4h"] > 20.0))
# 15m & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_4h"] > 30.0) | (df["RSI_14_4h"] < 40.0))
# 15m & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_4h"] > 30.0) | (df["AROONU_14_4h"] < 40.0))
# 15m down move, 15m still not low enough, 1h still high
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["AROONU_14_15m"] < 25.0) | (df["AROONU_14_1h"] < 50.0))
# 15m down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["AROONU_14_4h"] < 70.0))
# 15m down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0))
# 15m & 1h & 4h down move
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 25.0))
# 15m & 1h & 4h down move
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 15.0))
# 15m & 4h down move, 15m still not low enough
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_4h"] > 15.0) | (df["AROONU_14_15m"] < 30.0))
# 15m & 1d down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["RSI_3_1d"] > 5.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
)
# 15m & 1h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
)
# 15m & 1h down move, 1h still not low enough
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 15.0) | (df["AROONU_14_1h"] < 20.0))
# 15m & 4h down move, 15m still high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 20.0) | (df["AROONU_14_15m"] < 50.0))
# 15m down move, 15m still not low enough, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["AROONU_14_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m down move, 15m still high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["AROONU_14_15m"] < 50.0))
# 15m down move, 15m still not low enough, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 20.0) | (df["AROONU_14_4h"] < 50.0)
)
# 15m & 1h down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
)
# 15m & 1h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
)
# 15m & 1h down move, 1h still high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 25.0) | (df["AROONU_14_1h"] < 50.0))
# 15m & 1h down move, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
)
# 15m & 4h down move, 1h still not low enough
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 15.0) | (df["AROONU_14_1h"] < 30.0))
# 15m & 1h & 1d down move
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 20.0) | (df["RSI_3_1d"] > 20.0))
# 15m & 1h down move, 1h still high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 20.0) | (df["AROONU_14_1h"] < 50.0))
# 15m & 1h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 1h down move, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
)
# 15m down move, 1h still high, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["AROONU_14_1h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 20.0) | (df["AROONU_14_4h"] < 50.0))
# 15m down move, 15m still high, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0) | (df["AROONU_14_4h"] < 50.0)
)
# 15m down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["AROONU_14_1h"] < 75.0))
# 15m down move, 4h stil high, 1d overbought
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["AROONU_14_4h"] < 50.0) | (df["ROC_9_1d"] < 100.0))
# 15m & 1h down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 20.0) | (df["RSI_3_1h"] > 25.0) | (df["AROONU_14_1h"] < 70.0))
# 15m & 1h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 20.0) | (df["RSI_3_1h"] > 40.0) | (df["AROONU_14_4h"] < 80.0))
# 15m & 1h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["RSI_3_1h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 1h down move, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["RSI_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m down move, 15m & 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["AROONU_14_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m down move, 15m still high, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 30.0) | (df["AROONU_14_15m"] < 40.0) | (df["AROONU_14_1h"] < 90.0)
)
# 15m down move, 15m & 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 30.0) | (df["AROONU_14_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m down move, 15m still not low enough, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 30.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0) | (df["AROONU_14_1h"] < 50.0)
)
# 15m down move, 1h & 4h high
long_entry_logic.append((df["RSI_3_15m"] > 30.0) | (df["AROONU_14_1h"] < 80.0) | (df["AROONU_14_4h"] < 90.0))
# 15m down move, 15m & 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 35.0) | (df["AROONU_14_15m"] < 50.0) | (df["AROONU_14_4h"] < 50.0)
)
# 1h & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_1h"] > 3.0) | (df["RSI_3_4h"] > 15.0) | (df["RSI_14_4h"] < 40.0))
# 1h & 4h down move, 1h still not low enough
long_entry_logic.append((df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 20.0) | (df["AROONU_14_1h"] < 35.0))
# 1h & 4h down move, 1d overbought
long_entry_logic.append((df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 20.0) | (df["ROC_9_1d"] < 40.0))
# 1h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 5.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0))
# 1h & 4h down move, 1d low
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 10.0) | (df["CMF_20_1d"] > -0.2))
# 1h & 1d down move, 5m moving down
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_1d"] > 15.0) | (df["ROC_2"] > -0.0))
# 1h down move, 1h high
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["AROONU_14_1h"] < 70.0))
# 1h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["AROONU_14_4h"] < 70.0))
# 1h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0))
# 1h & 4h down move
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 5.0))
# 1h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 25.0) | (df["AROONU_14_4h"] < 90.0))
# 1h down move, 1h still high, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 35.0) | (df["AROONU_14_1h"] < 50.0) | (df["AROONU_14_4h"] < 90.0))
# 4h down move, 15m still high, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0) | (df["AROONU_14_4h"] < 25.0)
)
# 4h down move, drop in last 1h
long_entry_logic.append((df["RSI_3_4h"] > 15.0) | (df["close"] > (df["close_max_12"] * 0.85)))
# 4h & 1d down move, 15m still high
long_entry_logic.append(
(df["RSI_3_4h"] > 20.0) | (df["RSI_3_1d"] > 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 40.0)
)
# 4h down move, 1h high, 4h still high
long_entry_logic.append((df["RSI_3_4h"] > 20.0) | (df["AROONU_14_1h"] < 75.0) | (df["AROONU_14_4h"] < 50.0))
# 1d down move, 1h still not low enough
long_entry_logic.append((df["RSI_3_1d"] > 5.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 20.0))
# 1d down move, 4h high, 1d downtrend
long_entry_logic.append((df["RSI_3_1d"] > 20.0) | (df["AROONU_14_4h"] < 75.0) | (df["ROC_2_1d"] > -30.0))
# 1h down move, drop but not yet near the previous lows
long_entry_logic.append(
(df["RSI_3_1h"] > 20.0)
| (df["close"] > (df["high_max_12_4h"] * 0.50))
| (df["close"] < (df["low_min_24_4h"] * 1.25))
)
# 4h down move, drop but not yet near the previous lows
long_entry_logic.append(
(df["RSI_3_4h"] > 25.0)
| (df["close"] > (df["high_max_12_4h"] * 0.50))
| (df["close"] < (df["low_min_24_4h"] * 1.10))
)
# 4h high, drop but not yet near the previous lows
long_entry_logic.append(
(df["AROONU_14_4h"] < 70.0)
| (df["close"] > (df["high_max_6_4h"] * 0.80))
| (df["close"] < (df["low_min_24_4h"] * 1.25))
)
# 1d overbought, drop but not yet near the previous lows in last 12 days
long_entry_logic.append(
(df["ROC_9_1d"] < 100.0)
| (df["close"] > (df["high_max_12_1d"] * 0.50))
| (df["close"] < (df["low_min_12_1d"] * 1.25))
)
# 1d top wick, 4h still high
long_entry_logic.append((df["top_wick_pct_1d"] < 50.0) | (df["AROONU_14_4h"] < 50.0))
# pump, drop but not yet near the previous lows
long_entry_logic.append(
(((df["high_max_6_1d"] - df["low_min_6_1d"]) / df["low_min_6_1d"]) < 6.0)
| (df["close"] > (df["high_max_6_4h"] * 0.85))
| (df["close"] < (df["low_min_6_1d"] * 1.25))
)
# big drop in last 6 hours, 1d overbought
long_entry_logic.append((df["close"] > (df["high_max_6_1h"] * 0.65)) | (df["ROC_9_1d"] < 50.0))
# big drop in last 12 hours, 1d overbought
long_entry_logic.append((df["close"] > (df["high_max_12_1h"] * 0.50)) | (df["ROC_9_1d"] < 50.0))
# big drop in last 4 hours, 4h down move
long_entry_logic.append((df["close"] > (df["high_max_24_4h"] * 0.50)) | (df["RSI_3_4h"] > 10.0))
# big drop in last 24 hours, 1h still high
long_entry_logic.append(
(df["close"] > (df["high_max_24_1h"] * 0.50)) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# big drop in last 4 days, 1h high
long_entry_logic.append(
(df["close"] > (df["high_max_24_4h"] * 0.20)) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# big drop in the last 6 days, 1d down move
long_entry_logic.append((df["close"] > (df["high_max_6_1d"] * 0.30)) | (df["RSI_3_1d"] > 15.0))
# big drop in the last 12 days, 4h still high
long_entry_logic.append((df["close"] > (df["high_max_12_1d"] * 0.25)) | (df["AROONU_14_4h"] < 50.0))
# big drop in the last 30 days, 4h down move
long_entry_logic.append((df["close"] > (df["high_max_30_1d"] * 0.15)) | (df["RSI_3_4h"] > 15.0))
# big drop in the last 30 days
long_entry_logic.append((df["close"] > (df["high_max_30_1d"] * 0.05)))
# Logic
long_entry_logic.append(df["RSI_3"] < 50.0)
long_entry_logic.append(df["AROONU_14"] < 25.0)
long_entry_logic.append(df["AROOND_14"] > 75.0)
long_entry_logic.append(df["STOCHRSIk_14_14_3_3"] < 30.0)
long_entry_logic.append(df["EMA_26"] > df["EMA_12"])
long_entry_logic.append((df["EMA_26"] - df["EMA_12"]) > (df["open"] * 0.030))
long_entry_logic.append((df["EMA_26"].shift() - df["EMA_12"].shift()) > (df["open"] / 100.0))
# Condition #6 - Normal mode (Long).
if long_entry_condition_index == 6:
# Protections
long_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
long_entry_logic.append(df["protections_long_global"] == True)
# big drop in the last hour
long_entry_logic.append(df["close"] > (df["close_max_12"] * 0.50))
# 5m & 15m down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3"] > 3.0) | (df["RSI_3_15m"] > 3.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 5m & 15m down move, 1h still high
long_entry_logic.append((df["RSI_3"] > 3.0) | (df["RSI_3_15m"] > 15.0) | (df["AROONU_14_1h"] < 50.0))
# 5m & 15m down move, 4h still high
long_entry_logic.append(
(df["RSI_3"] > 3.0) | (df["RSI_3_15m"] > 15.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 5m & 1h down move, 4h still not low enough
long_entry_logic.append((df["RSI_3"] > 3.0) | (df["RSI_3_1h"] > 10.0) | (df["AROONU_14_4h"] < 20.0))
# 5m & 1h down move, 4h still high
long_entry_logic.append((df["RSI_3"] > 3.0) | (df["RSI_3_1h"] > 25.0) | (df["AROONU_14_4h"] < 50.0))
# 5m & 4h down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3"] > 3.0) | (df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 10.0)
)
# 5m down move, 15m still not low enough
long_entry_logic.append((df["RSI_3"] > 3.0) | (df["RSI_14_15m"] < 30.0))
# 5m down move, 15m still not low enough
long_entry_logic.append((df["RSI_3"] > 3.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0))
# 5m down move, 1h still high
long_entry_logic.append((df["RSI_3"] > 3.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0))
# 5m down move, 4h high
long_entry_logic.append((df["RSI_3"] > 5.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0))
# 5m & 15m down move, 1h still high
long_entry_logic.append(
(df["RSI_3"] > 5.0) | (df["RSI_3_15m"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 5m & 15m down move, 4h high
long_entry_logic.append((df["RSI_3"] > 5.0) | (df["RSI_3_15m"] > 25.0) | (df["AROONU_14_4h"] < 70.0))
# 5m & 15m down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3"] > 5.0) | (df["RSI_3_15m"] > 30.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
)
# 5m & 1h & 1d down move
long_entry_logic.append((df["RSI_3"] > 5.0) | (df["RSI_3_1h"] > 10.0) | (df["RSI_3_1d"] > 15.0))
# 5h & 4h down move
long_entry_logic.append((df["RSI_3"] > 5.0) | (df["RSI_3_4h"] > 5.0))
# 5m & 4h down move, 1h still high
long_entry_logic.append(
(df["RSI_3"] > 5.0) | (df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 5m & 4h down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3"] > 5.0) | (df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 5m down move, 15m still high, 1h high
long_entry_logic.append((df["RSI_3"] > 5.0) | (df["RSI_14_15m"] < 40.0) | (df["AROONU_14_1h"] < 80.0))
# 5m down move, 15m not low enough, 1h high
long_entry_logic.append(
(df["RSI_3"] > 5.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 90.0)
)
# 5m & 15m down move, 15m still high
long_entry_logic.append((df["RSI_3"] > 10.0) | (df["RSI_3_15m"] > 25.0) | (df["AROONU_14_15m"] < 50.0))
# 5m & 1h down move, 4h still high
long_entry_logic.append(
(df["RSI_3"] > 10.0) | (df["RSI_3_1h"] > 35.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 5m down move, 15m still not low enough, 1h high
long_entry_logic.append((df["RSI_3"] > 10.0) | (df["AROONU_14_15m"] < 30.0) | (df["AROONU_14_1h"] < 90.0))
# 5m down move, 15m still not low enough, 1h high
long_entry_logic.append(
(df["RSI_3"] > 10.0) | (df["AROONU_14_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 5m down move, 15m & 1h still not low enough
long_entry_logic.append(
(df["RSI_3"] > 10.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
)
# 5m down move, 1h still high, 4h high
long_entry_logic.append(
(df["RSI_3"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0) | (df["AROONU_14_4h"] < 95.0)
)
# 5m down move, 15m still high, 1h high
long_entry_logic.append(
(df["RSI_3"] > 15.0) | (df["RSI_14_15m"] < 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 90.0)
)
# 5m down move, 15m still not low enough, 4h high
long_entry_logic.append((df["RSI_3"] > 15.0) | (df["AROONU_14_15m"] < 30.0) | (df["AROONU_14_4h"] < 90.0))
# 5m down move, 15m still not low enough, 4h high
long_entry_logic.append(
(df["RSI_3"] > 15.0) | (df["AROONU_14_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
)
# 5m down move, 15m & 4h still high
long_entry_logic.append(
(df["RSI_3"] > 15.0) | (df["AROONU_14_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 5m down move, 15m still not low enough, 4h high
long_entry_logic.append(
(df["RSI_3"] > 15.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0) | (df["AROONU_14_4h"] < 90.0)
)
# 5m down move, 15m & 1h high
long_entry_logic.append((df["RSI_3"] > 20.0) | (df["AROONU_14_15m"] < 50.0) | (df["AROONU_14_1h"] < 90.0))
# 5m down move, 15m & 4h high
long_entry_logic.append(
(df["RSI_3"] > 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 75.0) | (df["AROONU_14_4h"] < 90.0)
)
# 5m down move, 15m & 4h high
long_entry_logic.append((df["RSI_3"] > 20.0) | (df["AROONU_14_15m"] < 75.0) | (df["AROONU_14_4h"] < 85.0))
# 15m & 1h & 4h down move
long_entry_logic.append((df["RSI_3_15m"] > 2.0) | (df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 40.0))
# 15m & 1h down move, 4h still not low enough
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 5.0) | (df["RSI_14_4h"] < 35.0))
# 15m & 1h down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 15m & 4h down move, 1h & 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 3.0) | (df["RSI_3_4h"] > 40.0) | (df["RSI_14_1h"] < 40.0) | (df["RSI_14_4h"] < 40.0)
)
# 15m & 1h down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 10.0)
)
# 15m & 1h down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
)
# 15m & 1h & 4h down move
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 20.0) | (df["RSI_3_4h"] > 20.0))
# 15m & 1h down move, 1h still high
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 25.0) | (df["AROONU_14_1h"] < 50.0))
# 15m & 1h down move, 15m still high
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 40.0) | (df["AROONU_14_15m"] < 40.0))
# 15m & 1h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 45.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 4h down move, 15m still not low enough
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_4h"] > 5.0) | (df["AROONU_14_15m"] < 25.0))
# 15m & 4h down move, 1d overbought
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_4h"] > 30.0) | (df["ROC_9_1d"] < 80.0))
# 15m & 4h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["RSI_3_4h"] > 35.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 4h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["RSI_3_4h"] > 45.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m & 1h & 4h down move
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 10.0))
# 15m & 1h down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
)
# 15m & 1h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 10.0) | (df["AROONU_14_4h"] < 50.0))
# 15m & 1h & 4h down move
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 25.0))
# 15m & 1h & 1d down move
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 15.0) | (df["RSI_3_1d"] > 25.0))
# 15m & 1h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
)
# 15m & 4h down move, 1d overbought
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 20.0) | (df["ROC_9_1d"] < 20.0))
# 15m & 1h down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 35.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
)
# 15m & 1h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 1h down move, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 15m & 4h down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 10.0)
)
# 15m & 4h down move, 1h still not low enough
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 15.0) | (df["AROONU_14_1h"] < 30.0))
# 15m & 4h down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 25.0)
)
# 15m & 4h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m & 4h down move, 1d high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 25.0) | (df["AROONU_14_1d"] < 90.0))
# 15m & 4h down move, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 60.0)
)
# 15m & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 30.0) | (df["AROONU_14_4h"] < 50.0))
# 15m & 4h down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 15m & 4h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 45.0) | (df["AROONU_14_4h"] < 70.0))
# 15m & 1d down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1d"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 25.0)
)
# 15m down move, 15m still not low enough, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["AROONU_14_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
)
# 15m down move, 15m still high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0))
# 15m down move, 1h still not low enough, 1d overbought
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 20.0) | (df["ROC_9_1d"] < 80.0)
)
# 15m down move, 1h & 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0) | (df["AROONU_14_4h"] < 50.0)
)
# 15m down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0))
# 15m & 1h down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
)
# 15m & 1h down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
)
# 15m & 1h & 1d down move
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 20.0) | (df["RSI_3_1d"] > 20.0))
# 15m down move, 15m still not low enough, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
)
# 15m & 1h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 35.0) | (df["AROONU_14_4h"] < 70.0))
# 15m & 1h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 35.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m & 1h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 45.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 4h down move, 15m still high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 15.0) | (df["AROONU_14_15m"] < 30.0))
# 15m & 4h down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
)
# 15m & 4h down move, 15m still high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 40.0)
)
# 15m & 4h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 50.0) | (df["AROONU_14_4h"] < 50.0))
# 15m & 1d down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_1d"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
)
# 15m down move, 4h stil high, 1d overbought
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["AROONU_14_4h"] < 50.0) | (df["ROC_9_1d"] < 100.0))
# 15m & 1h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["RSI_3_1h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m & 1h down move, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["RSI_3_1h"] > 45.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 15m down move, 15m still not low enough, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["AROONU_14_15m"] < 30.0) | (df["AROONU_14_1h"] < 85.0)
)
# 15m down move, 15m & 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["AROONU_14_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m down move, 15m & 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["AROONU_14_15m"] < 50.0) | (df["AROONU_14_4h"] < 50.0)
)
# 15m down move, 15m still high, 1d high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["AROONU_14_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 90.0)
)
# 15m down move, 1h still high, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["AROONU_14_1h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m down move, 1h & 4h high
long_entry_logic.append((df["RSI_3_15m"] > 20.0) | (df["AROONU_14_1h"] < 70.0) | (df["AROONU_14_4h"] < 90.0))
# 15m down move, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["AROONU_14_1h"] < 75.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 90.0)
)
# 15m & 1h down move, 15m still high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["RSI_3_1h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 40.0)
)
# 15m & 1h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["RSI_3_1h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m & 1h & 4h down move, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["RSI_3_1h"] > 50.0) | (df["RSI_3_4h"] > 55.0) | (df["AROONU_14_4h"] < 80.0)
)
# 15m & 4h down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 25.0) | (df["RSI_3_4h"] > 25.0) | (df["AROONU_14_1h"] < 70.0))
# 15m & 4h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 25.0) | (df["RSI_3_4h"] > 45.0) | (df["AROONU_14_4h"] < 70.0))
# 15m & 1d down move, 1d still high
long_entry_logic.append((df["RSI_3_15m"] > 25.0) | (df["RSI_3_1d"] > 30.0) | (df["ROC_9_1d"] < 20.0))
# 15m down move, 15m still high, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 25.0) | (df["RSI_14_15m"] < 40.0) | (df["AROONU_14_4h"] < 90.0))
# 15m down move, 15m high
long_entry_logic.append((df["RSI_3_15m"] > 25.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 70.0))
# 15m down move, 1h high, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0) | (df["AROONU_14_4h"] < 40.0)
)
# 15m down move, 1h & 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 15m & 1h down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 30.0) | (df["RSI_3_1h"] > 50.0) | (df["AROONU_14_1h"] < 70.0))
# 15m down move, 15m still high, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 30.0) | (df["RSI_14_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 90.0)
)
# 15m down move, 15m still high, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 30.0) | (df["AROONU_14_15m"] < 50.0) | (df["AROONU_14_1h"] < 90.0)
)
# 15m down move, 15m still high, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 30.0) | (df["AROONU_14_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 15m down move, 15m high
long_entry_logic.append((df["RSI_3_15m"] > 30.0) | (df["AROONU_14_15m"] < 70.0))
# 15m down move, 15m still not low enough, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 30.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 15m down move, 15m & 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 30.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 60.0) | (df["AROONU_14_4h"] < 80.0)
)
# 15m down move, 1h high, 1d overbought
long_entry_logic.append((df["RSI_3_15m"] > 30.0) | (df["AROONU_14_1h"] < 70.0) | (df["ROC_9_1d"] < 100.0))
# 15m down move, 1h still high, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0) | (df["AROONU_14_4h"] < 90.0)
)
# 15m down move, 4h & 1d high
long_entry_logic.append(
(df["RSI_3_15m"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 60.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 90.0)
)
# 15m down move, 15m & 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 35.0) | (df["AROONU_14_15m"] < 60.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m down move, 15m & 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 35.0) | (df["AROONU_14_15m"] < 70.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m down move, 15m & 1d high
long_entry_logic.append(
(df["RSI_3_15m"] > 35.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 70.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 90.0)
)
# 15m & 1h down move, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 40.0) | (df["RSI_3_1h"] > 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 60.0)
)
# 15m down move, 15m still high, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 40.0) | (df["AROONU_14_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
)
# 15m down move, 15m high, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 40.0) | (df["AROONU_14_15m"] < 70.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m down move, 1h still high, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 40.0) | (df["AROONU_14_1h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m down move, 15m still high, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 50.0) | (df["AROONU_14_15m"] < 60.0) | (df["AROONU_14_1h"] < 90.0)
)
# 15m down move, 15m still high, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 50.0) | (df["AROONU_14_15m"] < 60.0) | (df["AROONU_14_4h"] < 90.0)
)
# 15m down move, 15m high, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 50.0) | (df["AROONU_14_15m"] < 80.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 1h & 4h & 1d down move
long_entry_logic.append((df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 10.0) | (df["RSI_3_1d"] > 20.0))
# 1h & 4h & 1d down move
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 15.0) | (df["RSI_3_1d"] > 15.0))
# 1h & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 10.0) | (df["AROONU_14_4h"] < 50.0))
# 1h & 4h down move, 1h still high
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 25.0) | (df["AROONU_14_1h"] < 40.0))
# 1h & 4h down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 1h & 4h down move, 1h still high
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["RSI_3_1d"] > 10.0) | (df["AROONU_14_1h"] < 40.0))
# 1h & 1d down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 10.0) | (df["RSI_3_1d"] > 25.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
)
# 1h down move, 15m & 1h still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 15.0) | (df["AROONU_14_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
)
# 1h & 4h down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 20.0) | (df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
)
# 1h & 4h & 1d down move
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["RSI_3_4h"] > 25.0) | (df["RSI_3_1d"] > 5.0))
# 1h & 4h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 20.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 1h down move, 15m & 4h still now lot enough
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["AROONU_14_15m"] < 30.0) | (df["AROONU_14_4h"] < 30.0))
# 1h down move, 1h still high, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 25.0) | (df["AROONU_14_1h"] < 50.0) | (df["AROONU_14_4h"] < 80.0))
# 1h, 4h still high, 1d downtrend
long_entry_logic.append((df["RSI_3_1h"] > 25.0) | (df["AROONU_14_4h"] < 50.0) | (df["ROC_9_1d"] > -50.0))
# 1h down move, 1h still not low enough, 4h high
long_entry_logic.append(
(df["RSI_3_1h"] > 35.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 1h & 4h down move, 15m high
long_entry_logic.append((df["RSI_3_1h"] > 40.0) | (df["RSI_3_4h"] > 45.0) | (df["AROONU_14_15m"] < 70.0))
# 1h down move, 15m high
long_entry_logic.append((df["RSI_3_1h"] > 45.0) | (df["AROONU_14_15m"] < 80.0))
# 1h down move, 4h high, 1d overbought
long_entry_logic.append((df["RSI_3_1h"] > 55.0) | (df["RSI_14_4h"] < 80.0) | (df["ROC_9_1d"] < 150.0))
# 1h down move, 15m & 4h high
long_entry_logic.append((df["RSI_3_1h"] > 65.0) | (df["AROONU_14_15m"] < 60.0) | (df["AROONU_14_4h"] < 80.0))
# 4h down move, 4h still not low enough
long_entry_logic.append((df["RSI_3_4h"] > 5.0) | (df["AROONU_14_4h"] < 20.0))
# 4h down move, 5m going down
long_entry_logic.append((df["RSI_3_4h"] > 5.0) | (((df["EMA_12"] - df["EMA_26"]) / df["EMA_26"]) > -0.02))
# 4h down move, 15m high
long_entry_logic.append((df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0))
# 4h & 1d down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3_4h"] > 20.0) | (df["RSI_3_1d"] > 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
)
# 4h down move, 15m still high, 1d downtrend
long_entry_logic.append(
(df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0) | (df["ROC_9_1d"] > -50.0)
)
# 4h down move, 15m high, 1h still high
long_entry_logic.append(
(df["RSI_3_4h"] > 20.0) | (df["AROONU_14_15m"] < 70.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 4h down move, 15m still high, 1h high
long_entry_logic.append((df["RSI_3_4h"] > 30.0) | (df["AROONU_14_15m"] < 30.0) | (df["AROONU_14_1h"] < 90.0))
# 4h down move, 15m high
long_entry_logic.append((df["RSI_3_4h"] > 30.0) | (df["AROONU_14_15m"] < 80.0))
# 4h down move, 4h still not low enough, 1d overbought
long_entry_logic.append(
(df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 25.0) | (df["ROC_9_1d"] < 50.0)
)
# 4h down move, 4h still high, 4h overbought
long_entry_logic.append((df["RSI_3_4h"] > 60.0) | (df["AROONU_14_4h"] < 50.0) | (df["ROC_9_4h"] < 80.0))
# 1d down move, 15m still high, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_1d"] > 15.0) | (df["AROONU_14_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 1d down move, 1h & 4h high
long_entry_logic.append((df["RSI_3_1d"] > 20.0) | (df["AROONU_14_1h"] < 80.0) | (df["AROONU_14_4h"] < 90.0))
# 1d down move, 1h high, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_1d"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 1d down move, 4h high, 1d downtrend
long_entry_logic.append((df["RSI_3_1d"] > 20.0) | (df["AROONU_14_4h"] < 75.0) | (df["ROC_2_1d"] > -30.0))
# 15m still high, 4h & 1d high
long_entry_logic.append(
(df["RSI_14_15m"] < 40.0) | (df["AROONU_14_4h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 90.0)
)
# 15m still not low enough, 4h high & overbought
long_entry_logic.append((df["AROONU_14_15m"] < 30.0) | (df["AROONU_14_4h"] < 80.0) | (df["ROC_9_4h"] < 80.0))
# 15m still not low enough, 4h high, 1d overbought
long_entry_logic.append(
(df["AROONU_14_15m"] < 30.0) | (df["AROONU_14_4h"] < 80.0) | (df["ROC_9_1d"] < 150.0)
)
# 15m still high, 1h high
long_entry_logic.append(
(df["AROONU_14_15m"] < 50.0) | (df["AROONU_14_1h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 15m still high, 4h high
long_entry_logic.append(
(df["AROONU_14_15m"] < 50.0) | (df["AROONU_14_1h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 60.0)
)
# 15m & 1h still high, 1d overbought
long_entry_logic.append(
(df["AROONU_14_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0) | (df["ROC_9_1d"] < 80.0)
)
# 15m high, 1d overbought
long_entry_logic.append((df["AROONU_14_15m"] < 70.0) | (df["ROC_9_1d"] < 100.0))
# 15m high, 1h high
long_entry_logic.append((df["AROONU_14_15m"] < 85.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0))
# 15m still high, 1h & 4h high
long_entry_logic.append(
(df["STOCHRSIk_14_14_3_3_15m"] < 30.0) | (df["AROONU_14_1h"] < 80.0) | (df["AROONU_14_4h"] < 90.0)
)
# 15m still not low enough, 4h still high, 1d overbought
long_entry_logic.append(
(df["STOCHRSIk_14_14_3_3_15m"] < 30.0) | (df["AROONU_14_4h"] < 50.0) | (df["ROC_9_1d"] < 80.0)
)
# 1h down move, drop but not yet near the previous lows
long_entry_logic.append(
(df["RSI_3_1h"] > 25.0)
| (df["close"] > (df["high_max_12_4h"] * 0.60))
| (df["close"] < (df["low_min_24_4h"] * 1.25))
)
# 1h high, drop but not yet near the previous lows
long_entry_logic.append(
(df["AROONU_14_1h"] < 80.0)
| (df["close"] > (df["high_max_12_4h"] * 0.50))
| (df["close"] < (df["low_min_24_4h"] * 1.25))
)
# 4h high, drop but not yet near the previous lows
long_entry_logic.append(
(df["AROONU_14_4h"] < 70.0)
| (df["close"] > (df["high_max_6_4h"] * 0.80))
| (df["close"] < (df["low_min_24_4h"] * 1.25))
)
# 4h overbought, drop but not yet near the previous lows
long_entry_logic.append(
(df["ROC_9_4h"] < 50.0)
| (df["close"] > (df["high_max_12_4h"] * 0.60))
| (df["close"] < (df["low_min_24_4h"] * 1.25))
)
# pump, drop but not yet near the previous lows
long_entry_logic.append(
(((df["high_max_12_1d"] - df["low_min_12_1d"]) / df["low_min_12_1d"]) < 2.0)
| (df["close"] > (df["high_max_6_1d"] * 0.60))
| (df["close"] < (df["low_min_12_1d"] * 1.25))
)
# 1d overbought, drop but not yet near the previous lows in last 12 days
long_entry_logic.append(
(df["ROC_9_1d"] < 200.0)
| (df["close"] > (df["high_max_12_1d"] * 0.50))
| (df["close"] < (df["low_min_12_1d"] * 1.25))
)
# 5m red, 1h still high
long_entry_logic.append((df["change_pct"] > -5.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0))
# 4h top wick, 1h & 4h high
long_entry_logic.append(
(df["top_wick_pct_4h"] < 25.0) | (df["AROONU_14_1h"] < 70.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 85.0)
)
# 1d top wick, 15m still high
long_entry_logic.append((df["top_wick_pct_1d"] < 50.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0))
# 1d top wick, 4h still high
long_entry_logic.append((df["top_wick_pct_1d"] < 50.0) | (df["AROONU_14_4h"] < 50.0))
# pump, drop but not yet near the previous lows
long_entry_logic.append(
(((df["high_max_6_1d"] - df["low_min_6_1d"]) / df["low_min_6_1d"]) < 6.0)
| (df["close"] > (df["high_max_6_4h"] * 0.85))
| (df["close"] < (df["low_min_6_1d"] * 1.25))
)
# big drop in last 48 hours, 4h down move
long_entry_logic.append((df["close"] > (df["high_max_12_4h"] * 0.30)) | (df["RSI_3_4h"] > 15.0))
# big drop in the last 6 days, 1d down move
long_entry_logic.append((df["close"] > (df["high_max_6_1d"] * 0.30)) | (df["RSI_3_1d"] > 15.0))
# big drop in the last 20 days, 1h high
long_entry_logic.append(
(df["close"] > (df["high_max_20_1d"] * 0.40)) | (df["STOCHRSIk_14_14_3_3_1h"] < 60.0)
)
# big drop in the last 20 days, 4h still high
long_entry_logic.append(
(df["close"] > (df["high_max_20_1d"] * 0.25)) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# big drop in the last 20 days, 1h down move
long_entry_logic.append((df["close"] > (df["high_max_20_1d"] * 0.10)) | (df["RSI_3_1h"] > 20.0))
# big drop in the last 30 days, 4h down move, 4h still high
long_entry_logic.append(
(df["close"] > (df["high_max_30_1d"] * 0.25)) | (df["RSI_3_4h"] > 45.0) | (df["RSI_14_4h"] < 40.0)
)
# big drop in the last 30 days, 1h high
long_entry_logic.append(
(df["close"] > (df["high_max_30_1d"] * 0.20)) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
)
# big drop in the last 30 days, 1h still high
long_entry_logic.append(
(df["close"] > (df["high_max_30_1d"] * 0.05)) | (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
)
# big drop in the last 30 days, 4h still high
long_entry_logic.append(
(df["close"] > (df["high_max_30_1d"] * 0.05)) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# big drop in the last 30 days
long_entry_logic.append((df["close"] > (df["high_max_30_1d"] * 0.01)))
# Logic
long_entry_logic.append(df["RSI_20"] < df["RSI_20"].shift(1))
long_entry_logic.append(df["RSI_3"] < 46.0)
long_entry_logic.append(df["STOCHRSIk_14_14_3_3"] < 20.0)
long_entry_logic.append(df["AROONU_14_15m"] < 75.0)
long_entry_logic.append(df["close"] < df["SMA_16"] * 0.952)
# Condition #21 - Pump mode (Long).
if long_entry_condition_index == 21:
# Protections
long_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
long_entry_logic.append(df["protections_long_global"] == True)
# 5m down move, 15m still not low enough, 4h high
long_entry_logic.append(
(df["RSI_3"] > 10.0) | (df["AROONU_14_15m"] < 20.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m & 1h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 20.0) | (df["AROONU_14_4h"] < 80.0))
# 15m down move, 1h & 4h high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["AROONU_14_1h"] < 80.0) | (df["AROONU_14_4h"] < 90.0))
# 15m & 1h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 35.0) | (df["AROONU_14_4h"] < 90.0))
# 15m & 1h down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 40.0) | (df["AROONU_14_1h"] < 90.0))
# 15m down move, 15m still high, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_14_15m"] < 45.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 85.0)
)
# 15m down move, 15m still not low enough, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["AROONU_14_15m"] < 25.0) | (df["AROONU_14_4h"] < 90.0)
)
# 15m & 1h down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 20.0) | (df["RSI_3_1h"] > 45.0) | (df["AROONU_14_1h"] < 80.0))
# 15m down move, 15m still not low enough, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["AROONU_14_15m"] < 30.0) | (df["AROONU_14_1h"] < 90.0)
)
# 15m down move, 15m still not low enough, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["AROONU_14_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m down move, 1h high, 1h overbought
long_entry_logic.append((df["RSI_3_15m"] > 20.0) | (df["AROONU_14_1h"] < 70.0) | (df["ROC_9_1h"] < 15.0))
# 15m down move, 15m still high, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 30.0) | (df["RSI_14_15m"] < 50.0) | (df["AROONU_14_1h"] < 70.0))
# 15m down move, 4h high & overbought
long_entry_logic.append(
(df["RSI_3_15m"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0) | (df["ROC_9_4h"] < 80.0)
)
# 1h down move, 4h high, 1d overbought
long_entry_logic.append(
(df["RSI_3_1h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 80.0) | (df["ROC_9_1d"] < 250.0)
)
# 1h down move, 4h high, 1d overbought
long_entry_logic.append(
(df["RSI_3_1h"] > 45.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0) | (df["ROC_9_1d"] < 100.0)
)
# 1h down move, 4h high, 1d overbought
long_entry_logic.append(
(df["RSI_3_1h"] > 45.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0) | (df["ROC_9_1d"] < 50.0)
)
# 4h & 1d down move
long_entry_logic.append((df["RSI_3_4h"] > 15.0) | (df["RSI_3_1d"] > 15.0))
# 4h down move, 1h high
long_entry_logic.append((df["RSI_3_4h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 90.0))
# 15m still high, 4h high & overbought
long_entry_logic.append(
(df["RSI_14_15m"] < 45.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0) | (df["ROC_9_4h"] < 50.0)
)
# 15m still high, 1h & 4h high
long_entry_logic.append(
(df["RSI_14_15m"] < 50.0) | (df["AROONU_14_1h"] < 80.0) | (df["AROONU_14_4h"] < 90.0)
)
# 15m still high, 1h & overbought
long_entry_logic.append(
(df["RSI_14_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0) | (df["ROC_9_1h"] < 40.0)
)
# 1h & 4h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 35.0) | (df["RSI_3_4h"] > 55.0) | (df["AROONU_14_4h"] < 80.0))
# 5m down move, 4h high
long_entry_logic.append((df["ROC_2"] > -5.0) | (df["AROONU_14_4h"] < 90.0))
# 1h red, 4h big green, 1h still high
long_entry_logic.append(
(df["change_pct_1h"] > -5.0) | (df["change_pct_4h"] < 40.0) | (df["AROONU_14_4h"] < 50.0)
)
# 1h P&D
long_entry_logic.append((df["change_pct_1h"] > -10.0) | (df["change_pct_1h"].shift(12) < 10.0))
# 4h P&D, 4h overbought
long_entry_logic.append(
(df["change_pct_4h"] > -2.0) | (df["change_pct_4h"].shift(48) < 20.0) | (df["ROC_9_4h"] < 50.0)
)
# 4h P&D, 4h high
long_entry_logic.append(
(df["change_pct_4h"] > -10.0) | (df["change_pct_4h"].shift(48) < 20.0) | (df["AROONU_14_4h"] < 90.0)
)
# 1d top wick, 4h still high
long_entry_logic.append((df["top_wick_pct_1d"] < 50.0) | (df["AROONU_14_4h"] < 50.0))
# big drop in last 4 days, 1h high
long_entry_logic.append(
(df["close"] > (df["high_max_24_4h"] * 0.40)) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# big drop in the last 12 days, 1h still high
long_entry_logic.append(
(df["close"] > (df["high_max_12_1d"] * 0.20)) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# big drop in the last 12 days, 1h still high
long_entry_logic.append((df["close"] > (df["high_max_12_1d"] * 0.10)) | (df["AROONU_14_1h"] < 50.0))
# big drop in the last 20 days, 4h high
long_entry_logic.append((df["close"] > (df["high_max_20_1d"] * 0.15)) | (df["AROONU_14_4h"] < 90.0))
# Logic
long_entry_logic.append(df["AROONU_14"] < 25.0)
long_entry_logic.append(df["STOCHRSIk_14_14_3_3"] < 20.0)
long_entry_logic.append(df["AROONU_14_15m"] < 50.0)
long_entry_logic.append(df["close"] < df["EMA_16"] * 0.942)
long_entry_logic.append(((df["EMA_50"] - df["EMA_200"]) / df["close"] * 100.0) > 7.0)
# Condition #41 - Quick mode (Long).
if long_entry_condition_index == 41:
# Protections
long_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
long_entry_logic.append(df["protections_long_global"] == True)
# big drop in the last hour, 5m down move
long_entry_logic.append((df["close"] > (df["close_max_12"] * 0.75)) | (df["RSI_3"] > 3.0))
# big drop in the last hour
long_entry_logic.append(df["close"] > (df["close_max_12"] * 0.50))
# 5m down move, 15m still not low enough
long_entry_logic.append((df["RSI_3"] > 3.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 20.0))
# 5m down move, 15m still not low enough, 1h still high
long_entry_logic.append(
(df["RSI_3"] > 3.0) | (df["AROONU_14_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 5m down move, 1h & 4h still high
long_entry_logic.append(
(df["RSI_3"] > 3.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 5m & 15m & 1h down move
long_entry_logic.append((df["RSI_3"] > 5.0) | (df["RSI_3_15m"] > 50.0) | (df["RSI_3_1h"] > 15.0))
# 5m down move, 15m still not low enough, 4h high
long_entry_logic.append(
(df["RSI_3"] > 10.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 5m down move, 15m & 1h still high
long_entry_logic.append(
(df["RSI_3"] > 20.0) | (df["AROONU_14_15m"] < 60.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m & 1h down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 10.0)
)
# 15m & 1h down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
)
# 15m & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_4h"] > 30.0) | (df["AROONU_14_4h"] < 40.0))
# 15m down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0))
# 15m & 1h & 4h down move
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 10.0))
# 15m & 1h down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
)
# 15m & 1h down move, 1h still high
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 30.0) | (df["AROONU_14_1h"] < 50.0))
# 15m & 1d down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["RSI_3_1d"] > 5.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
)
# 15m down move, 15m still not low enough, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["AROONU_14_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
)
# 15m down move, 15m & 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["AROONU_14_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m & 1h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m & 1h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 1h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 25.0) | (df["AROONU_14_4h"] < 60.0))
# 15m & 1h down move, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 15m & 4h down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 15m & 4h down move, 15m still high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 20.0) | (df["AROONU_14_15m"] < 50.0))
# 15m down move, 15m & 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["AROONU_14_15m"] < 40.0) | (df["AROONU_14_4h"] < 50.0)
)
# 15m & 1h down move, 1d high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 90.0)
)
# 15m & 1h & 1d down move
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 20.0) | (df["RSI_3_1d"] > 20.0))
# 15m down move, 15m still high, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["AROONU_14_15m"] < 40.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 60.0)
)
# 15m down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["AROONU_14_1h"] < 75.0))
# 15m down move, 4h high, 1d overbought
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 75.0) | (df["ROC_9_1d"] < 80.0)
)
# 15m & 1h down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 20.0) | (df["RSI_3_1h"] > 20.0) | (df["AROONU_14_1h"] < 70.0))
# 15m & 1h down move, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["RSI_3_1h"] > 35.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
long_entry_logic.append((df["RSI_3_15m"] > 20.0) | (df["RSI_3_1h"] > 40.0) | (df["AROONU_14_4h"] < 80.0))
# 15m down move, 15m still not low enough, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["AROONU_14_15m"] < 40.0) | (df["AROONU_14_1h"] < 85.0)
)
# 15m & 1h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 25.0) | (df["RSI_3_1h"] > 25.0) | (df["AROONU_14_4h"] < 80.0))
# 15m & 1h & 4h down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["RSI_3_1h"] > 30.0) | (df["RSI_3_4h"] > 30.0) | (df["AROONU_14_15m"] < 30.0)
)
# 15m & 1h down move, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["RSI_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 15m down move, 15m & 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["AROONU_14_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m down move, 1h still not low enough, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 25.0) | (df["AROONU_14_1h"] < 30.0) | (df["AROONU_14_4h"] < 80.0))
# 15m & 1h down move, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 30.0) | (df["RSI_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m down move, 1h high. 1d overbought
long_entry_logic.append((df["RSI_3_15m"] > 30.0) | (df["AROONU_14_1h"] < 70.0) | (df["ROC_9_1d"] < 100.0))
# 15m down move, 1h & 4h high
long_entry_logic.append((df["RSI_3_15m"] > 30.0) | (df["AROONU_14_1h"] < 80.0) | (df["AROONU_14_4h"] < 90.0))
# 15m down move, 15m high, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 35.0) | (df["AROONU_14_15m"] < 70.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 15m down move, 4h high & overbought
long_entry_logic.append(
(df["RSI_3_15m"] > 35.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0) | (df["ROC_9_4h"] < 50.0)
)
# 1h down move, 15m still high
long_entry_logic.append((df["RSI_3_1h"] > 3.0) | (df["AROONU_14_15m"] < 40.0))
# 1h down move, 1h still not low enough
long_entry_logic.append((df["RSI_3_1h"] > 3.0) | (df["AROONU_14_1h"] < 30.0))
# 1h & 4h down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 20.0)
)
# 1h & 4h down move, drop in the last hour
long_entry_logic.append(
(df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 20.0) | (df["close"] > (df["close_max_12"] * 0.90))
)
# 1h & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 30.0) | (df["RSI_14_4h"] < 40.0))
# 1h & 4h down move, 1h still high
long_entry_logic.append((df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 40.0) | (df["AROONU_14_1h"] < 40.0))
# 1h & 4h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 45.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 1h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 5.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0))
# 1h & 4h down move, 1d high
long_entry_logic.append(
(df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 80.0)
)
# 1h & 4h down move, 4h still not low enough
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 15.0) | (df["AROONU_14_4h"] < 20.0))
# 1h & 4h & 1d down move
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 15.0) | (df["RSI_3_1d"] > 15.0))
# 1h & 4h down move, 1h still high
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 25.0) | (df["AROONU_14_1h"] < 50.0))
# 1h & 4h down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 45.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
)
# 1h & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 45.0) | (df["AROONU_14_4h"] < 70.0))
# 1h down move, 1h high
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["AROONU_14_1h"] < 70.0))
# 1h & 4h down move, 1h high
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 35.0) | (df["AROONU_14_1h"] < 70.0))
# 1h down move, 1h still not low enough, 4h high
long_entry_logic.append(
(df["RSI_3_1h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 20.0) | (df["AROONU_14_4h"] < 50.0)
)
# 1h down move, 1h high
long_entry_logic.append(
(df["RSI_3_1h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0) | (df["AROONU_14_1h"] < 80.0)
)
# 1h down move, 1h still high
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0))
# 1h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0))
# 1h down move, 1h still high, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["AROONU_14_1h"] < 40.0) | (df["AROONU_14_4h"] < 85.0))
# 1h down move, 1h still high, 1d overbought
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["AROONU_14_1h"] < 50.0) | (df["ROC_9_1d"] < 50.0))
# 1h & 4h down move, 15m still not low enough
long_entry_logic.append((df["RSI_3_1h"] > 25.0) | (df["RSI_3_4h"] > 10.0) | (df["AROONU_14_15m"] < 25.0))
# 1h & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_1h"] > 25.0) | (df["RSI_3_4h"] > 25.0) | (df["AROONU_14_4h"] < 50.0))
# 1h, 4h still high, 1d downtrend
long_entry_logic.append((df["RSI_3_1h"] > 25.0) | (df["AROONU_14_4h"] < 50.0) | (df["ROC_9_1d"] > -50.0))
# 1h down move, 1h & 4h high
long_entry_logic.append((df["RSI_3_1h"] > 30.0) | (df["AROONU_14_1h"] < 75.0) | (df["AROONU_14_4h"] < 90.0))
# 1h down move, 1h & 4h high
long_entry_logic.append(
(df["RSI_3_1h"] > 40.0) | (df["AROONU_14_1h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 85.0)
)
# 4h down move, 15m still high, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0) | (df["AROONU_14_4h"] < 25.0)
)
# 4h down move, 15m & 1h high
long_entry_logic.append(
(df["RSI_3_4h"] > 15.0) | (df["AROONU_14_15m"] < 60.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 60.0)
)
# 4h down move, drop in last 1h
long_entry_logic.append((df["RSI_3_4h"] > 15.0) | (df["close"] > (df["close_max_12"] * 0.85)))
# 4h & 1d down move, 15m still high
long_entry_logic.append(
(df["RSI_3_4h"] > 20.0) | (df["RSI_3_1d"] > 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 40.0)
)
# 1d down move, 1h still not low enough
long_entry_logic.append((df["RSI_3_1d"] > 5.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 20.0))
# 1d down move, 1h still high
long_entry_logic.append((df["RSI_3_1d"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0))
# 1h down move, drop but not yet near the previous lows
long_entry_logic.append(
(df["RSI_3_1h"] > 30.0)
| (df["close"] > (df["high_max_12_4h"] * 0.50))
| (df["close"] < (df["low_min_24_4h"] * 1.10))
)
# 1d overbought, drop but not yet near the previous lows
long_entry_logic.append(
(df["ROC_9_1d"] < 50.0)
| (df["close"] > (df["high_max_12_4h"] * 0.75))
| (df["close"] < (df["low_min_24_4h"] * 1.25))
)
# 1h down move, drop but not yet near the previous lows in last 6 days
long_entry_logic.append(
(df["RSI_3_1h"] > 15.0)
| (df["close"] > (df["high_max_6_1d"] * 0.50))
| (df["close"] < (df["low_min_6_1d"] * 1.25))
)
# 1d red, 4h down move, 1h still high
long_entry_logic.append(
(df["change_pct_1d"] > -30.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 1d top wick, 1h down move, 4h still high
long_entry_logic.append(
(df["top_wick_pct_1d"] < 50.0) | (df["RSI_3_1h"] > 50.0) | (df["AROONU_14_4h"] < 50.0)
)
# big drop in last 6 hours, 1d overbought
long_entry_logic.append((df["close"] > (df["high_max_6_1h"] * 0.65)) | (df["ROC_9_1d"] < 50.0))
# big drop in last 24 hours, 4h down move
long_entry_logic.append((df["close"] > (df["high_max_24_1h"] * 0.50)) | (df["RSI_3_4h"] > 10.0))
# big drop in last 4 hours, 4h still not low enough
long_entry_logic.append(
(df["close"] > (df["high_max_24_4h"] * 0.50)) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# big drop in last 4 days, 4h down move
long_entry_logic.append((df["close"] > (df["high_max_24_4h"] * 0.20)) | (df["RSI_3_4h"] > 20.0))
# big drop in the last 30 days, 4h down move, 4h still high
long_entry_logic.append(
(df["close"] > (df["high_max_30_1d"] * 0.25)) | (df["RSI_3_4h"] > 45.0) | (df["RSI_14_4h"] < 40.0)
)
# big drop in the last 30 days, 1h downtrend
long_entry_logic.append((df["close"] > (df["high_max_30_1d"] * 0.10)) | (df["RSI_3_1h"] > 10.0))
# big drop in the last 30 days, 1h high
long_entry_logic.append((df["close"] > (df["high_max_30_1d"] * 0.10)) | (df["AROONU_14_1h"] < 80.0))
# big drop in the last 30 days
long_entry_logic.append((df["close"] > (df["high_max_30_1d"] * 0.01)))
# Logic
long_entry_logic.append(df["RSI_14"] < 36.0)
long_entry_logic.append(df["AROONU_14"] < 25.0)
long_entry_logic.append(df["AROOND_14"] > 75.0)
long_entry_logic.append(df["EMA_9"] < (df["EMA_26"] * 0.960))
# Condition #42 - Quick mode (Long).
if long_entry_condition_index == 42:
# Protections
long_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
long_entry_logic.append(df["protections_long_global"] == True)
long_entry_logic.append(df["RSI_3_1h"] <= 95.0)
long_entry_logic.append(df["RSI_3_4h"] <= 80.0)
long_entry_logic.append(df["RSI_3_1d"] <= 80.0)
long_entry_logic.append(df["RSI_14_1h"] < 80.0)
long_entry_logic.append(df["RSI_14_4h"] < 80.0)
long_entry_logic.append(df["RSI_14_1d"] < 90.0)
# 5m & 1h down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3"] > 5.0) | (df["RSI_3_1h"] > 5.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
)
# 15m & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_4h"] > 30.0) | (df["RSI_14_4h"] < 40.0))
# 15m & 4h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 3.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
)
# 15m & 1h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 15.0) | (df["AROONU_14_4h"] < 50.0))
# 15m & 1h down move, 1h still high
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 30.0) | (df["AROONU_14_1h"] < 50.0))
# 15m & 4h down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["RSI_3_4h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
)
# 1h & 4h down move, 4h still not low enough
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 10.0) | (df["AROONU_14_4h"] < 30.0))
# 15m & 1h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
)
# 15m & 1h & 4h down move
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 15.0))
# 15m & 4h down move, 1d downtrend
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 10.0) | (df["CMF_20_1d"] > -0.4))
# 15m & 4h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m down move, 15m & 4h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 10.0) | (df["AROONU_14_4h"] < 30.0)
)
# 15m & 4h down move, 1d high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 20.0) | (df["AROONU_14_1d"] < 70.0))
# 15m & 1h down move, 1h still high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 25.0) | (df["AROONU_14_1h"] < 60.0))
# 15m & 4h down move, 15m still high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
)
# 15m & 4h down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
)
# 15m & 4h down move, 15m still high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
)
# 15m & 4h down move, 1d high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 80.0)
)
# 15m & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 20.0) | (df["RSI_3_4h"] > 25.0) | (df["AROONU_14_4h"] < 50.0))
# 15m & 4h down move, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 15m & 4h down move, 1d overbought
long_entry_logic.append((df["RSI_3_15m"] > 20.0) | (df["RSI_3_4h"] > 30.0) | (df["ROC_9_1d"] < 50.0))
# 15m & 1h down move, 15m still high
long_entry_logic.append((df["RSI_3_15m"] > 25.0) | (df["RSI_3_1h"] > 25.0) | (df["AROONU_14_15m"] < 50.0))
# 15m & 4h down move, 15m still high
long_entry_logic.append(
(df["RSI_3_15m"] > 30.0) | (df["RSI_3_4h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 40.0)
)
# 15m & 4h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 30.0) | (df["RSI_3_4h"] > 50.0) | (df["AROONU_14_4h"] < 85.0))
# 15m & 4h down move, 15m high
long_entry_logic.append(
(df["RSI_3_15m"] > 40.0) | (df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 60.0)
)
# 15m down move, 15m still high, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 50.0) | (df["AROONU_14_15m"] < 50.0) | (df["AROONU_14_4h"] < 70.0)
)
# 1h & 4h down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 3.0) | (df["RSI_3_4h"] > 3.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
)
# 1h & 4h down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 3.0) | (df["RSI_3_4h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 1h & 4h down move, 4h still not low enough
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 15.0) | (df["AROONU_14_4h"] < 20.0))
# 1h & 4h down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 20.0)
)
# 1h & 4h down move, 4h still not low enough
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 20.0) | (df["RSI_14_4h"] < 30.0))
# 1h & 4h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 40.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 1h & 1d down move, 5m moving down
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_1d"] > 15.0) | (df["ROC_2"] > -0.0))
# 1h & 4h down move, 1h still high
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 15.0) | (df["AROONU_14_1h"] < 50.0))
# 1h & 4h & 1d down move
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 25.0) | (df["RSI_3_1d"] > 25.0))
# 1h & 4h down move, 15m still high
long_entry_logic.append(
(df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
)
# 1h & 1d down move, 1d still high
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["RSI_3_1d"] > 15.0) | (df["AROONU_14_1d"] < 50.0))
# 1h down move, 1h high
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["AROONU_14_1h"] < 70.0))
# 1h down move, 1h still not low enough, 4h high
long_entry_logic.append(
(df["RSI_3_1h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 10.0) | (df["AROONU_14_4h"] < 50.0)
)
# 1h & 4h down move, 4h high
long_entry_logic.append(
(df["RSI_3_1h"] > 20.0) | (df["RSI_3_4h"] > 40.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
)
# 1h & 1d down move, 1d high
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["RSI_3_1d"] > 20.0) | (df["AROONU_14_1d"] < 70.0))
# 1h & 1d down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 20.0) | (df["RSI_3_1d"] > 25.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
)
# 1h down move, 15m sitll not low enough, 1d high
long_entry_logic.append(
(df["RSI_3_1h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0) | (df["AROONU_14_1d"] < 90.0)
)
# 1h & 4h down move, 15m high
long_entry_logic.append(
(df["RSI_3_1h"] > 25.0) | (df["RSI_3_4h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 80.0)
)
# 1h & 4h down move, 15m high
long_entry_logic.append(
(df["RSI_3_1h"] > 25.0) | (df["RSI_3_4h"] > 35.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 75.0)
)
# 1h down move, 15m still not low enough, 1h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 20.0) | (df["AROONU_14_1h"] < 40.0)
)
# 1h down move, 4h high & overbought
long_entry_logic.append((df["RSI_3_1h"] > 30.0) | (df["AROONU_14_4h"] < 70.0) | (df["ROC_9_4h"] < 50.0))
# 1h & 4h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 35.0) | (df["RSI_3_4h"] > 40.0) | (df["AROONU_14_4h"] < 85.0))
# 1h & 4h down move, 4h high
long_entry_logic.append(
(df["RSI_3_1h"] > 35.0) | (df["RSI_3_4h"] > 45.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 1h down move, 1h & 4h high
long_entry_logic.append((df["RSI_3_1h"] > 45.0) | (df["AROONU_14_1h"] < 70.0) | (df["AROONU_14_4h"] < 100.0))
# 4h & 1d down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3_4h"] > 5.0) | (df["RSI_3_1d"] > 15.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
)
# 4h down move, 15m still high
long_entry_logic.append((df["RSI_3_4h"] > 5.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 40.0))
# 4h down move, 5m going down
long_entry_logic.append((df["RSI_3_4h"] > 5.0) | (((df["EMA_12"] - df["EMA_26"]) / df["EMA_26"]) > -0.02))
# 4h down move, drop in last 1h
long_entry_logic.append((df["RSI_3_4h"] > 15.0) | (df["close"] > (df["close_max_12"] * 0.85)))
# 4h & 1d down move, 1d still high
long_entry_logic.append(
(df["RSI_3_4h"] > 20.0) | (df["RSI_3_1d"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 50.0)
)
# 4h down move, 15m still not low enough, 4h high
long_entry_logic.append(
(df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0) | (df["AROONU_14_4h"] < 70.0)
)
# 4h down move, 15m & 4h still high
long_entry_logic.append(
(df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 4h down move, 15m high
long_entry_logic.append((df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 75.0))
# 4h down move, 15m & 4h high
long_entry_logic.append(
(df["RSI_3_4h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 70.0) | (df["AROONU_14_4h"] < 70.0)
)
# 4h down move, 15m & 4h still high
long_entry_logic.append(
(df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 4h down move, 15m still not low enough, 4h high
long_entry_logic.append(
(df["RSI_3_4h"] > 40.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 20.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
)
# 1d down move, 15m & 4h still high
long_entry_logic.append(
(df["RSI_3_1d"] > 10.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 1d down move, 15m still high, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_1d"] > 15.0) | (df["AROONU_14_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 15m & 1h still high, 4h high
long_entry_logic.append(
(df["STOCHRSIk_14_14_3_3_15m"] < 50.0) | (df["AROONU_14_1h"] < 50.0) | (df["AROONU_14_4h"] < 85.0)
)
# 15m & 4h high, 1d downtrend
long_entry_logic.append(
(df["STOCHRSIk_14_14_3_3_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0) | (df["ROC_9_1d"] > -40.0)
)
# 1d overbought, drop but not yet near the previous lows in last 12 days
long_entry_logic.append(
(df["ROC_9_1d"] < 200.0)
| (df["close"] > (df["high_max_12_1d"] * 0.50))
| (df["close"] < (df["low_min_12_1d"] * 1.25))
)
# big drop in last 4 days, 1d down move
long_entry_logic.append((df["close"] > (df["high_max_24_4h"] * 0.20)) | (df["RSI_3_1d"] > 20.0))
# big drop in the last 4 days, 1h down move
long_entry_logic.append((df["close"] > (df["high_max_24_4h"] * 0.50)) | (df["RSI_3_1h"] > 15.0))
# big drop in last 4 hours, 4h still not low enough
long_entry_logic.append(
(df["close"] > (df["high_max_24_4h"] * 0.50)) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# big drop in the last 4 days, 1d high
long_entry_logic.append((df["close"] > (df["high_max_24_4h"] * 0.50)) | (df["AROONU_14_1d"] < 75.0))
# big drop in the last 6 days, 4h still high
long_entry_logic.append((df["close"] > (df["high_max_6_1d"] * 0.25)) | (df["AROONU_14_4h"] < 50.0))
# big drop in the last 30 days, 4h down move, 4h still high
long_entry_logic.append(
(df["close"] > (df["high_max_30_1d"] * 0.25)) | (df["RSI_3_4h"] > 45.0) | (df["RSI_14_4h"] < 40.0)
)
# big drop in the last 30 days, 4h down move
long_entry_logic.append((df["close"] > (df["high_max_30_1d"] * 0.20)) | (df["RSI_3_4h"] > 20.0))
# big drop in the last 30 days, 1h down move
long_entry_logic.append((df["close"] > (df["high_max_30_1d"] * 0.05)) | (df["RSI_3_1h"] > 15.0))
# big drop in the last 30 days, 15m still high
long_entry_logic.append((df["close"] > (df["high_max_30_1d"] * 0.05)) | (df["AROONU_14_15m"] < 50.0))
# big drop in the last 30 days
long_entry_logic.append((df["close"] > (df["high_max_30_1d"] * 0.01)))
# 1d top wick, 1h down move
long_entry_logic.append((df["top_wick_pct_1d"] < 30.0) | (df["RSI_3_1h"] > 20.0))
# Logic
long_entry_logic.append(df["WILLR_14"] < -50.0)
long_entry_logic.append(df["STOCHRSIk_14_14_3_3"] < 20.0)
long_entry_logic.append(df["WILLR_84_1h"] < -70.0)
long_entry_logic.append(df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
long_entry_logic.append(df["BBB_20_2.0_1h"] > 16.0)
long_entry_logic.append(df["close_max_48"] >= (df["close"] * 1.10))
# Condition #43 - Quick mode (Long).
if long_entry_condition_index == 43:
# Protections
long_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
long_entry_logic.append(df["protections_long_global"] == True)
long_entry_logic.append(df["RSI_14_1h"] < 80.0)
long_entry_logic.append(df["RSI_14_4h"] < 80.0)
long_entry_logic.append(df["RSI_14_1d"] < 90.0)
# 5m & 1h & 4h down move
long_entry_logic.append((df["RSI_3"] > 3.0) | (df["RSI_3_1h"] > 3.0) | (df["RSI_3_4h"] > 20.0))
# 5m & 1h down move, 1h still high
long_entry_logic.append((df["RSI_3"] > 3.0) | (df["RSI_3_1h"] > 10.0) | (df["AROONU_14_1h"] < 50.0))
# 5m down move, 15m still not low enough, 1h still high
long_entry_logic.append(
(df["RSI_3"] > 3.0) | (df["AROONU_14_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 5m & 4h & 1d down move
long_entry_logic.append((df["RSI_3"] > 3.0) | (df["RSI_3_4h"] > 20.0) | (df["RSI_3_1d"] > 20.0))
# 5m down move, 1h & 4h still high
long_entry_logic.append(
(df["RSI_3"] > 3.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 5m down move, 4h high, 1d overbought
long_entry_logic.append((df["RSI_3"] > 3.0) | (df["AROONU_14_4h"] < 80.0) | (df["ROC_9_1d"] < 80.0))
# 5m down move, 15m still high
long_entry_logic.append((df["RSI_3"] > 5.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0))
# 5m down move, 1h high
long_entry_logic.append((df["RSI_3"] > 5.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0))
# 5m down move, 1h still high, 4h high
long_entry_logic.append(
(df["RSI_3"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0) | (df["AROONU_14_4h"] < 90.0)
)
# 5m down move, 15m & 1h still high
long_entry_logic.append(
(df["RSI_3"] > 20.0) | (df["AROONU_14_15m"] < 60.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m & 1h & 1d down move
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 10.0) | (df["RSI_3_1d"] > 30.0))
# 15m & 1h down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
)
# 15m & 1h & 4h down move
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 15.0))
# 15m & 1h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m & 1h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
)
# 15m & 1h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 35.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0))
# 15m & 1h & 4h down move
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 15.0))
# 15m & 1h down move, 1d high
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 20.0) | (df["AROONU_14_1d"] < 70.0))
# 15m & 1h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 5m & 4h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m & 1d down move
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1d"] > 5.0))
# 15m down move, 15m still high
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["AROONU_14_15m"] < 50.0))
# 15m down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["AROONU_14_4h"] < 90.0))
# 15m & 1h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 25.0) | (df["AROONU_14_4h"] < 60.0))
# 15m & 1h down move 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 1h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 35.0) | (df["AROONU_14_4h"] < 75.0))
# 15m & 4h down move, 15m still high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 20.0) | (df["AROONU_14_15m"] < 50.0))
# 15m & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 30.0) | (df["AROONU_14_4h"] < 40.0))
# 15m down move, 1h & 4h high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["AROONU_14_1h"] < 80.0) | (df["AROONU_14_4h"] < 90.0))
# 15m down move, 1h still not low enough, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 20.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m & 1h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m & 1h down move, 1h still high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 20.0) | (df["AROONU_14_1h"] < 50.0))
# 15m & 1h down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 30.0) | (df["AROONU_14_1h"] < 70.0))
# 15m & 1h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 30.0) | (df["AROONU_14_4h"] < 90.0))
# 15m & 1h down move, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m & 1h down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 20.0) | (df["RSI_3_1h"] > 25.0) | (df["AROONU_14_1h"] < 70.0))
# 15m & 1h down move, 15m still high
long_entry_logic.append((df["RSI_3_15m"] > 20.0) | (df["RSI_3_1h"] > 35.0) | (df["AROONU_14_15m"] < 40.0))
# 15m & 1h down move, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["RSI_3_1h"] > 40.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
)
# 15m & 1h down move, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["RSI_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
)
# 15m & 1h down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 30.0) | (df["RSI_3_1h"] > 45.0) | (df["AROONU_14_1h"] < 70.0))
# 1h & 4h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 3.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 1h & 4h down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 5.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
)
# 1h & 4h down move, drop in the last hour
long_entry_logic.append(
(df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 20.0) | (df["close"] > (df["close_max_12"] * 0.90))
)
# 1h & 1d down move, 5m moving down
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_1d"] > 15.0) | (df["ROC_2"] > -0.0))
# 1h & 4h & 1d down move
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 15.0) | (df["RSI_3_1d"] > 15.0))
# 1h & 4h down move, 1h still high
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 45.0) | (df["AROONU_14_1h"] < 50.0))
# 1h & 1d down move, 1d still high
long_entry_logic.append(
(df["RSI_3_1h"] > 15.0) | (df["RSI_3_1d"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 45.0)
)
# 1h & 4h down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 20.0) | (df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
)
# 1h down move, 1h & 1d high
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["AROONU_14_1h"] < 60.0) | (df["AROONU_14_1d"] < 90.0))
# 1h, 4h still high, 1d downtrend
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["AROONU_14_4h"] < 50.0) | (df["ROC_9_1d"] > -50.0))
# 4h down move, 15m still high, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0) | (df["AROONU_14_4h"] < 25.0)
)
# 1d down move, 1h still high
long_entry_logic.append((df["RSI_3_1d"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0))
# 1d down move, 1h still high, 4h high
long_entry_logic.append((df["RSI_3_1d"] > 20.0) | (df["AROONU_14_1h"] < 50.0) | (df["AROONU_14_4h"] < 85.0))
# 1d top wick, 1h down move, 4h still high
long_entry_logic.append(
(df["top_wick_pct_1d"] < 50.0) | (df["RSI_3_1h"] > 50.0) | (df["AROONU_14_4h"] < 50.0)
)
# 4h high, drop but not yet near the previous lows
long_entry_logic.append(
(df["AROONU_14_4h"] < 70.0)
| (df["close"] > (df["high_max_6_4h"] * 0.80))
| (df["close"] < (df["low_min_24_4h"] * 1.25))
)
# 1d red, drop but not yet near the previous lows in last 12 days
long_entry_logic.append(
(df["change_pct_1d"] > -20.0)
| (df["close"] > (df["high_max_12_1d"] * 0.50))
| (df["close"] < (df["low_min_12_1d"] * 1.25))
)
# 1d overbought, drop but not yet near the previous lows in last 12 days
long_entry_logic.append(
(df["ROC_9_1d"] < 200.0)
| (df["close"] > (df["high_max_12_1d"] * 0.50))
| (df["close"] < (df["low_min_12_1d"] * 1.25))
)
# pump, drop but not yet near the previous lows
long_entry_logic.append(
(((df["high_max_6_1d"] - df["low_min_6_1d"]) / df["low_min_6_1d"]) < 6.0)
| (df["close"] > (df["high_max_6_4h"] * 0.85))
| (df["close"] < (df["low_min_6_1d"] * 1.25))
)
# big drop in the last 30 days
long_entry_logic.append((df["close"] > (df["high_max_30_1d"] * 0.01)))
# Logic
long_entry_logic.append(df["RSI_14"] < 40.0)
long_entry_logic.append(df["MFI_14"] < 40.0)
long_entry_logic.append(df["AROONU_14"] < 25.0)
long_entry_logic.append(df["EMA_26"] > df["EMA_12"])
long_entry_logic.append((df["EMA_26"] - df["EMA_12"]) > (df["open"] * 0.024))
long_entry_logic.append((df["EMA_26"].shift() - df["EMA_12"].shift()) > (df["open"] / 100.0))
long_entry_logic.append(df["close"] < (df["EMA_20"] * 0.958))
long_entry_logic.append(df["close"] < (df["BBL_20_2.0"] * 0.992))
# Condition #44 - Quick mode (Long).
if long_entry_condition_index == 44:
# Protections
long_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
long_entry_logic.append(df["protections_long_global"] == True)
# 15m & 1h down move
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 20.0))
# 15m & 1h down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
)
# 15m & 4h & 1d down move
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_4h"] > 15.0) | (df["RSI_3_1d"] > 15.0))
# 15m & 4h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 20.0) | (df["AROONU_14_4h"] < 90.0))
# 1h & 4h down move
long_entry_logic.append((df["RSI_3_1h"] > 3.0) | (df["RSI_3_4h"] > 15.0))
# 1h down move, 4h still high
long_entry_logic.append((df["RSI_3_1h"] > 3.0) | (df["AROONU_14_4h"] < 50.0))
# 1h down move, 4h still not low enough
long_entry_logic.append((df["RSI_3_1h"] > 3.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0))
# 1h & 4h down move, 1d high
long_entry_logic.append(
(df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 90.0)
)
# 1h & 4h down move, 1h still not low enough
long_entry_logic.append((df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 30.0) | (df["AROONU_14_1h"] < 20.0))
# 1h & 4h down move, 1d high
long_entry_logic.append((df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 30.0) | (df["AROONU_14_1d"] < 85.0))
# 15m & 1h & 4h down move, 1d overbought
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 20.0) | (df["RSI_3_4h"] > 20.0) | (df["ROC_9_1d"] < 30.0)
)
# 15m & 1h & 4h down move, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 20.0) | (df["RSI_3_4h"] > 30.0) | (df["AROONU_14_4h"] < 70.0)
)
# 15m & 1h & 4h down move, 4h overbought
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 20.0) | (df["RSI_3_4h"] > 45.0) | (df["ROC_9_4h"] < 25.0)
)
# 15m & 4h down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 1h & 4h down move
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 15.0))
# 1h & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 35.0) | (df["AROONU_14_4h"] < 50.0))
# 1h & 1d down move
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_1d"] > 10.0))
# 1h & 1d down move, 5m moving down
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_1d"] > 15.0) | (df["ROC_2"] > -0.0))
# 1h & 1d down move, 4h still high
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_1d"] > 30.0) | (df["AROONU_14_4h"] < 50.0))
# 1h down move, 1h still not low enough
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 30.0))
# 1h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["AROONU_14_4h"] < 70.0))
# 1h down move, 4h still high
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0))
# 1h & 4h & 1d down move
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 20.0) | (df["RSI_3_1d"] > 30.0))
# 1h & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 20.0) | (df["AROONU_14_4h"] < 50.0))
# 1h & 4h & 1d down move
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 25.0) | (df["RSI_3_1d"] > 25.0))
# 1h & 4h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 45.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 14 down move, 1h still high
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["AROONU_14_1h"] < 50.0))
# 1h down move, 1h still high
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0))
# 1h down move, 4h still high, 1d overbought
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["AROONU_14_4h"] < 50.0) | (df["ROC_9_1d"] < 80.0))
# 1h down move, 4h & 1d high
long_entry_logic.append(
(df["RSI_3_1h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 80.0)
)
# 1h down move, 1h & 4h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 20.0) | (df["AROONU_14_1h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
)
# 1h down move, 1h high
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["AROONU_14_1h"] < 70.0))
# 1h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["AROONU_14_4h"] < 85.0))
# 1h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 80.0))
# 1h & 4h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 25.0) | (df["RSI_3_4h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 1h down move, 1h high
long_entry_logic.append((df["RSI_3_1h"] > 25.0) | (df["AROONU_14_1h"] < 80.0))
# 1h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 30.0) | (df["RSI_14_4h"] < 70.0) | (df["AROONU_14_4h"] < 90.0))
# 4h down move, 1h still high
long_entry_logic.append((df["RSI_3_4h"] > 3.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0))
# 4h down move, 1h still high
long_entry_logic.append((df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0))
# 1d down move, 4h high
long_entry_logic.append((df["RSI_3_1d"] > 25.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0))
# 1d P&D, 1d high
long_entry_logic.append(
(df["change_pct_1d"] > -10.0)
| (df["change_pct_1d"].shift(288) < 10.0)
| (df["STOCHRSIk_14_14_3_3_1d"] < 80.0)
)
# 1d top wick, 4h still high
long_entry_logic.append((df["top_wick_pct_1d"] < 40.0) | (df["AROONU_14_4h"] < 50.0))
# pump, drop but not yet near the previous lows
long_entry_logic.append(
(((df["high_max_24_4h"] - df["low_min_24_4h"]) / df["low_min_24_4h"]) < 2.0)
| (df["close"] > (df["high_max_6_4h"] * 0.75))
| (df["close"] < (df["low_min_24_4h"] * 1.25))
)
# pump, drop but not yet near the previous lows
long_entry_logic.append(
(((df["high_max_12_1d"] - df["low_min_12_1d"]) / df["low_min_12_1d"]) < 2.0)
| (df["close"] > (df["high_max_24_4h"] * 0.70))
| (df["close"] < (df["low_min_12_1d"] * 1.25))
)
# drop but not yet near the previous lows
long_entry_logic.append(
(df["close"] > (df["high_max_24_4h"] * 0.50)) | (df["close"] < (df["low_min_6_1d"] * 1.25))
)
# drop but not yet near the previous lows in last 12 days
long_entry_logic.append(
(df["close"] > (df["high_max_12_1d"] * 0.50)) | (df["close"] < (df["low_min_12_1d"] * 1.25))
)
# big drop in last hour
long_entry_logic.append(df["close"] > (df["close_max_12"] * 0.50))
# big drop in last hour, 1d down move
long_entry_logic.append((df["close"] > (df["close_max_12"] * 0.85)) | (df["RSI_3_1d"] > 15.0))
# big drop in the last 12 hours
long_entry_logic.append((df["close"] > (df["high_max_12_1h"] * 0.50)))
# big drop in the last 12 hours, 4h high
long_entry_logic.append((df["close"] > (df["high_max_12_1h"] * 0.70)) | (df["AROONU_14_4h"] < 70.0))
# big drop in the last 2 days, 1d down move
long_entry_logic.append((df["close"] > (df["high_max_12_4h"] * 0.30)) | (df["RSI_3_1d"] > 30.0))
# big drop in the last 4 days, 1d overbought
long_entry_logic.append((df["close"] > (df["high_max_24_4h"] * 0.50)) | (df["ROC_9_1d"] < 100.0))
# big drop in the last 4 days, 4h down move
long_entry_logic.append((df["close"] > (df["high_max_24_4h"] * 0.20)) | (df["RSI_3_4h"] > 20.0))
# big drop in the last 6 days, 1d down move
long_entry_logic.append((df["close"] > (df["high_max_6_1d"] * 0.30)) | (df["RSI_3_1d"] > 15.0))
# big drop in the last 12 days, 1h down move
long_entry_logic.append((df["close"] > (df["high_max_12_1d"] * 0.25)) | (df["RSI_3_1h"] > 15.0))
# big drop in the last 20 days
long_entry_logic.append((df["close"] > (df["high_max_20_1d"] * 0.10)))
# big drop in the last 20 days, 1h down move
long_entry_logic.append((df["close"] > (df["high_max_20_1d"] * 0.30)) | (df["RSI_3_1h"] > 10.0))
# Logic
long_entry_logic.append(df["RSI_3"] < 40.0)
long_entry_logic.append(df["RSI_3_15m"] < 50.0)
long_entry_logic.append(df["AROONU_14_15m"] < 25.0)
long_entry_logic.append(df["AROOND_14_15m"] > 75.0)
long_entry_logic.append(df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
long_entry_logic.append(df["EMA_26_15m"] > df["EMA_12_15m"])
long_entry_logic.append((df["EMA_26_15m"] - df["EMA_12_15m"]) > (df["open_15m"] * 0.035))
long_entry_logic.append((df["EMA_26_15m"].shift() - df["EMA_12_15m"].shift()) > (df["open_15m"] / 100.0))
# Condition #45 - Quick mode (Long).
if long_entry_condition_index == 45:
# Protections
long_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
long_entry_logic.append(df["protections_long_global"] == True)
# 5m & 15m down move, 4h still high
long_entry_logic.append(
(df["RSI_3"] > 3.0) | (df["RSI_3_15m"] > 15.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m & 1h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 5m & 4h & 1d down move
long_entry_logic.append((df["RSI_3"] > 3.0) | (df["RSI_3_4h"] > 20.0) | (df["RSI_3_1d"] > 20.0))
# 15m & 1h down move, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 60.0)
)
# 15m & 4h down move
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_4h"] > 10.0))
# 15m & 4h down move, 4h still not low enough
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_4h"] > 30.0) | (df["RSI_14_4h"] < 35.0))
# 15m & 1h down move
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 15.0))
# 15m & 1h down move, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 40.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
)
# 15m down move, 1h still not low enough
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["AROONU_14_1h"] < 30.0))
# 15m down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["AROONU_14_4h"] < 90.0))
# 15m & 1h & 1d down move
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 10.0) | (df["RSI_3_1d"] > 10.0))
# 15m & 1h down move, 1d overbought
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 20.0) | (df["ROC_9_1d"] < 30.0))
# 15m & 1h down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 45.0) | (df["AROONU_14_1h"] < 80.0))
# 15m & 4h down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 15m & 1h down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 30.0) | (df["RSI_3_1h"] > 30.0) | (df["AROONU_14_1h"] < 70.0))
# 15m & 4h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
)
# 15m & 1h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 15.0) | (df["AROONU_14_4h"] < 70.0))
# 15m down move, 1h & 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["AROONU_14_1h"] < 70.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 1h down move, 4h still not low enough
long_entry_logic.append((df["RSI_3_1h"] > 3.0) | (df["AROONU_14_4h"] < 30.0))
# 1h & 4h down move, 1h still not low enough
long_entry_logic.append((df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 30.0) | (df["AROONU_14_1h"] < 20.0))
# 1h down move, 1h still not low enough
long_entry_logic.append((df["RSI_3_1h"] > 5.0) | (df["AROONU_14_1h"] < 30.0))
# 1h down move, 1h still not low enough
long_entry_logic.append((df["RSI_3_1h"] > 5.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 25.0))
# 1h & 4h down move
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 15.0))
# 1h & 4h down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 1h & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 25.0) | (df["AROONU_14_4h"] < 50.0))
# 1h & 4h down move, 4h still not low enough
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 30.0) | (df["RSI_14_4h"] < 40.0))
# 1h & 4h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 40.0) | (df["AROONU_14_4h"] < 60.0))
# 1h & 1d down move, 5m moving down
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_1d"] > 15.0) | (df["ROC_2"] > -0.0))
# 1h & 1d down move, 4h still high
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_1d"] > 30.0) | (df["AROONU_14_4h"] < 50.0))
# 15m & 1d down move, 1d high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1d"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 70.0)
)
# 1h & 4h down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 3.0) | (df["RSI_3_4h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 1h down move, 1h still not low enough, 1d high
long_entry_logic.append(
(df["RSI_3_1h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 20.0) | (df["AROONU_14_1d"] < 85.0)
)
# 1h down move, 1h still not low enough
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 25.0))
# 1h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["AROONU_14_4h"] < 85.0))
# 1h & 4h down move, 1d high
long_entry_logic.append(
(df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 70.0)
)
# 1h & 4h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 25.0) | (df["RSI_3_4h"] > 40.0) | (df["AROONU_14_4h"] < 70.0))
# 1h & 4h & 1d down move
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 20.0) | (df["RSI_3_1d"] > 30.0))
# 1h down move, 1h still high
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["AROONU_14_1h"] < 50.0))
# 1h down move, 1h still high
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 30.0))
# 1h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["AROONU_14_4h"] < 90.0))
# 1h down move, 4h still high
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0))
# 1h & 4h down move, 1h high
long_entry_logic.append(
(df["RSI_3_1h"] > 25.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 60.0)
)
# 1h down move, 1h high
long_entry_logic.append((df["RSI_3_1h"] > 25.0) | (df["AROONU_14_1h"] < 70.0))
# 1h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 80.0))
# 1h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 30.0) | (df["RSI_14_4h"] < 80.0))
# 14 down move, 1h high
long_entry_logic.append((df["RSI_3_1h"] > 30.0) | (df["AROONU_14_1h"] < 80.0))
# 1h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 30.0) | (df["AROONU_14_4h"] < 80.0))
# 1h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 80.0))
# 1h down move, 4h & 1d high
long_entry_logic.append(
(df["RSI_3_1h"] > 35.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 80.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 80.0)
)
# 1h down move, 1h still high, 1d overbought
long_entry_logic.append((df["RSI_3_1h"] > 40.0) | (df["AROONU_14_1h"] < 50.0) | (df["ROC_9_1d"] < 50.0))
# 1h down move, 1h & 4h high
long_entry_logic.append((df["RSI_3_1h"] > 45.0) | (df["AROONU_14_1h"] < 70.0) | (df["AROONU_14_4h"] < 90.0))
# 1h down move, 1h & 4h high
long_entry_logic.append(
(df["RSI_3_1h"] > 60.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0) | (df["AROONU_14_4h"] < 90.0)
)
# 4h & 1d down move, 1d still high
long_entry_logic.append(
(df["RSI_3_4h"] > 10.0) | (df["RSI_3_1d"] > 25.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 50.0)
)
# 4h downmove, 4h still high
long_entry_logic.append((df["RSI_3_4h"] > 10.0) | (df["AROONU_14_4h"] < 40.0))
# 4h down move, 1h still not low enough
long_entry_logic.append((df["RSI_3_4h"] > 15.0) | (df["AROONU_14_1h"] < 30.0))
# 4h down move, 1d high
long_entry_logic.append((df["RSI_3_4h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 90.0))
# 4h down move, 1h high
long_entry_logic.append((df["RSI_3_4h"] > 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0))
# 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_4h"] > 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0))
# 4h down move, 4h high
long_entry_logic.append((df["RSI_3_4h"] > 55.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 80.0))
# 1d down move, 1h still not low enough
long_entry_logic.append((df["RSI_3_1d"] > 5.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 30.0))
# 1d down move, 1h still not low enough
long_entry_logic.append((df["RSI_3_1d"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 30.0))
# 1d down move, 4h still high
long_entry_logic.append((df["RSI_3_1d"] > 15.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0))
# 15m still high, 1h & 4h high
long_entry_logic.append(
(df["RSI_14_15m"] < 40.0) | (df["AROONU_14_1h"] < 80.0) | (df["AROONU_14_4h"] < 90.0)
)
# 4h high, 1d overbought
long_entry_logic.append((df["AROONU_14_4h"] < 70.0) | (df["ROC_9_1d"] < 80.0))
# 4h high & overbought
long_entry_logic.append((df["AROONU_14_4h"] < 90.0) | (df["ROC_9_4h"] < 80.0))
# 1d top wick, 4h still high
long_entry_logic.append((df["top_wick_pct_1d"] < 40.0) | (df["AROONU_14_4h"] < 50.0))
# pump, 4h still high
long_entry_logic.append(
(((df["high_max_24_4h"] - df["low_min_24_4h"]) / df["low_min_24_4h"]) < 2.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# pump, drop but not yet near the previous lows
long_entry_logic.append(
(((df["high_max_24_4h"] - df["low_min_24_4h"]) / df["low_min_24_4h"]) < 2.0)
| (df["close"] > (df["high_max_6_4h"] * 0.75))
| (df["close"] < (df["low_min_24_4h"] * 1.25))
)
# pump, drop but not yet near the previous lows
long_entry_logic.append(
(((df["high_max_12_1d"] - df["low_min_12_1d"]) / df["low_min_12_1d"]) < 2.0)
| (df["close"] > (df["high_max_24_4h"] * 0.70))
| (df["close"] < (df["low_min_12_1d"] * 1.25))
)
# big drop in last hour
long_entry_logic.append(df["close"] > (df["close_max_12"] * 0.50))
# big drop in last hour, 1d down move
long_entry_logic.append((df["close"] > (df["close_max_12"] * 0.80)) | (df["RSI_3_1d"] > 15.0))
# big drop in the last 12 hours, 4h still high
long_entry_logic.append((df["close"] > (df["high_max_12_1h"] * 0.50)) | (df["AROONU_14_4h"] < 50.0))
# big drop in the last 6 days, 1h still high
long_entry_logic.append((df["close"] > (df["high_max_6_1d"] * 0.25)) | (df["AROONU_14_1h"] < 50.0))
# big drop in the last 12 days, 1h down move
long_entry_logic.append((df["close"] > (df["high_max_12_1d"] * 0.45)) | (df["RSI_3_1h"] > 5.0))
# big drop in the last 12 days, 4h down move
long_entry_logic.append((df["close"] > (df["high_max_12_1d"] * 0.40)) | (df["RSI_3_4h"] > 15.0))
# big drop in the last 12 days, 1h still high
long_entry_logic.append((df["close"] > (df["high_max_12_1d"] * 0.25)) | (df["AROONU_14_1h"] < 75.0))
# big drop in the last 20 days, 1h down move
long_entry_logic.append((df["close"] > (df["high_max_20_1d"] * 0.35)) | (df["RSI_3_1h"] > 10.0))
# big drop in the last 20 days, 1h down move
long_entry_logic.append((df["close"] > (df["high_max_20_1d"] * 0.25)) | (df["RSI_3_1h"] > 15.0))
# big drop in the last 20 days, 1h down move
long_entry_logic.append((df["close"] > (df["high_max_20_1d"] * 0.10)) | (df["RSI_3_1h"] > 20.0))
# big drop in the last 30 days, 4h down move, 4h still high
long_entry_logic.append(
(df["close"] > (df["high_max_30_1d"] * 0.25)) | (df["RSI_3_4h"] > 45.0) | (df["RSI_14_4h"] < 40.0)
)
# Logic
long_entry_logic.append(df["RSI_3"] < 50.0)
long_entry_logic.append(df["AROONU_14_15m"] < 25.0)
long_entry_logic.append(df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
long_entry_logic.append(df["close_15m"] < (df["EMA_20_15m"] * 0.924))
# Condition #46 - Quick mode (Long).
if long_entry_condition_index == 46:
# Protections
long_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
long_entry_logic.append(df["protections_long_global"] == True)
# 5m & 1h down move
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 5.0))
# 15m & 4h down move
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_4h"] > 10.0))
# 15m & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_4h"] > 30.0) | (df["AROONU_14_4h"] < 50.0))
# 15m & 1h & 4h down move
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 30.0))
# 15m & 1h & 4h down move
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 20.0) | (df["RSI_3_4h"] > 20.0))
# 15m & 1h down move, 1h still high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 20.0) | (df["AROONU_14_1h"] < 40.0))
# 15m & 1h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
)
# 15m & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 20.0) | (df["AROONU_14_4h"] < 50.0))
# 15m down move, 4h still high, 1d high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["AROONU_14_4h"] < 50.0) | (df["AROONU_14_1d"] < 90.0))
# 15m & 1h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 20.0) | (df["AROONU_14_4h"] < 60.0))
# 15m & 4h down move, 1h still high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 15.0) | (df["AROONU_14_1h"] < 40.0))
# 15m & 1h & 1d down move, 1h still not low enough, 1d high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 20.0)
| (df["RSI_3_1d"] > 30.0)
| (df["RSI_14_1h"] < 30.0)
| (df["AROONU_14_1d"] < 80.0)
)
# 15m & 1h down move, 4h still high, 4h overbought
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["RSI_3_1h"] > 20.0) | (df["AROONU_14_4h"] < 50.0) | (df["ROC_9_4h"] < 10.0)
)
# 15m down move, 1h & 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["AROONU_14_1h"] < 40.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m & 1h & 4h down move, 1d high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["RSI_3_1h"] > 25.0) | (df["RSI_3_4h"] > 25.0) | (df["ROC_9_1d"] < 70.0)
)
# 15m & 4h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 25.0) | (df["RSI_3_4h"] > 45.0) | (df["AROONU_14_4h"] < 85.0))
# 15m & 1h down move, 15m still not low enough
long_entry_logic.append((df["RSI_3_15m"] > 30.0) | (df["RSI_3_1h"] > 30.0) | (df["AROONU_14_15m"] < 15.0))
# 1h down move, 1h still not low enough, 1d high
long_entry_logic.append((df["RSI_3_1h"] > 3.0) | (df["AROONU_14_1h"] < 20.0) | (df["AROONU_14_1d"] < 90.0))
# 1h & 4h down move
long_entry_logic.append((df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 10.0))
# 1h & 4h down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 1h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 5.0) | (df["AROONU_14_4h"] < 70.0))
# 1h & 4h down move, 4h still not low enough
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 20.0) | (df["RSI_14_4h"] < 30.0))
# 1h & 4h down move, 4h still not low enough
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 30.0) | (df["RSI_14_4h"] < 40.0))
# 1h & 4h down move, 4h still not low enough
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 30.0) | (df["AROONU_14_4h"] < 30.0))
# 1h & 4h & 1d down move
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 30.0) | (df["RSI_3_1d"] > 30.0))
# 1h & 4h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 45.0) | (df["AROONU_14_4h"] < 70.0))
# 1h & 4h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 45.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
)
# 1h & 1d down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 10.0) | (df["RSI_3_1d"] > 25.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 1h & 1d down move, 4h still high
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_1d"] > 30.0) | (df["AROONU_14_4h"] < 50.0))
# 1h down move, 1h still high
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["AROONU_14_1h"] < 50.0))
# 1h down move, 4h still high, 1d high
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["AROONU_14_4h"] < 60.0) | (df["AROONU_14_1d"] < 90.0))
# 1h & 4h & 1d down move
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 20.0) | (df["RSI_3_1d"] > 30.0))
# 1h & 4h down move, 4h still not low enough
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 20.0) | (df["AROONU_14_4h"] < 30.0))
# 1h & 4h down move, 1d overbought
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 20.0) | (df["ROC_9_1d"] < 50.0))
# 1h & 4h & 1d down move
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 25.0) | (df["RSI_3_1d"] > 25.0))
# 1h & 4h down move, 1h & 4h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 40.0) | (df["RSI_14_1h"] < 40.0) | (df["RSI_14_4h"] < 50.0)
)
# 1h & 4h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 45.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 1h & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 50.0) | (df["AROONU_14_4h"] < 40.0))
# 1h & 1d down move, 1d still high
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["RSI_3_1d"] > 15.0) | (df["AROONU_14_1d"] < 50.0))
# 1h down move, 1h still high, 1d overbought
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["AROONU_14_1h"] < 40.0) | (df["ROC_9_1d"] < 50.0))
# 1h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0))
# 1h & 4h down move, 1h still not low enough
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["RSI_3_4h"] > 20.0) | (df["AROONU_14_1h"] < 30.0))
# 1h & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["RSI_3_4h"] > 20.0) | (df["RSI_14_4h"] < 40.0))
# 1h & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["RSI_3_4h"] > 20.0) | (df["AROONU_14_4h"] < 50.0))
# 1h & 4h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["RSI_3_4h"] > 45.0) | (df["AROONU_14_4h"] < 65.0))
# 1h & 1d down move, 1d high
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["RSI_3_1d"] > 20.0) | (df["AROONU_14_1d"] < 70.0))
# 1h down move, 1h still high, 1d high
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["AROONU_14_1h"] < 40.0) | (df["AROONU_14_1d"] < 90.0))
# 1h down move, 4h & 1d high
long_entry_logic.append(
(df["RSI_3_1h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 80.0)
)
# 1h & 4h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 25.0) | (df["RSI_3_4h"] > 40.0) | (df["AROONU_14_4h"] < 70.0))
# 1h down move, 15m still not low enough, 4h high
long_entry_logic.append(
(df["RSI_3_1h"] > 25.0) | (df["RSI_14_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 60.0)
)
# 1h & 4h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 25.0) | (df["RSI_3_4h"] > 35.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 1h down move, 1h high
long_entry_logic.append((df["RSI_3_1h"] > 25.0) | (df["AROONU_14_1h"] < 60.0))
# 1h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 25.0) | (df["AROONU_14_4h"] < 80.0))
# 1h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0))
# 1h & 4h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 35.0) | (df["RSI_3_4h"] > 55.0) | (df["AROONU_14_4h"] < 80.0))
# 1h down move, 1h & 4h high
long_entry_logic.append((df["RSI_3_1h"] > 35.0) | (df["AROONU_14_1h"] < 70.0) | (df["AROONU_14_4h"] < 90.0))
# 4h & 1d down move
long_entry_logic.append((df["RSI_3_4h"] > 10.0) | (df["RSI_3_1d"] > 20.0))
# 4h & 1d down move, 1d high
long_entry_logic.append((df["RSI_3_4h"] > 10.0) | (df["RSI_3_1d"] > 50.0) | (df["AROONU_14_1d"] < 90.0))
# 4h & 1d down move, 1d low
long_entry_logic.append((df["RSI_3_4h"] > 15.0) | (df["RSI_3_1d"] > 25.0) | (df["CMF_20_1d"] > -0.2))
# 4h down move, 4h high
long_entry_logic.append((df["RSI_3_4h"] > 30.0) | (df["AROONU_14_4h"] < 90.0))
# 4h down move, 4h & 1d high
long_entry_logic.append(
(df["RSI_3_4h"] > 35.0) | (df["AROONU_14_4h"] < 60.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 90.0)
)
# 4h top wick, 1h down move, 1h still high
long_entry_logic.append(
(df["top_wick_pct_4h"] < 20.0) | (df["RSI_3_1h"] > 45.0) | (df["AROONU_14_1h"] < 50.0)
)
# pump, drop but not yet near the previous lows
long_entry_logic.append(
(((df["high_max_6_1d"] - df["low_min_6_1d"]) / df["low_min_6_1d"]) < 2.0)
| (df["close"] > (df["high_max_12_4h"] * 0.50))
| (df["close"] < (df["low_min_24_4h"] * 1.05))
)
# 1d overbought, drop but not yet near the previous lows
long_entry_logic.append(
(df["ROC_9_1d"] < 50.0)
| (df["close"] > (df["high_max_6_1d"] * 0.70))
| (df["close"] < (df["low_min_12_1d"] * 1.25))
)
# 1d overbought, drop but not yet near the previous lows
long_entry_logic.append(
(((df["high_max_12_1d"] - df["low_min_12_1d"]) / df["low_min_12_1d"]) < 2.5)
| (df["close"] > (df["high_max_6_1d"] * 0.60))
| (df["close"] < (df["low_min_12_1d"] * 1.25))
)
# big drop in the last 2 days, 1d down move
long_entry_logic.append((df["close"] > (df["high_max_12_4h"] * 0.30)) | (df["RSI_3_1d"] > 30.0))
# big drop in the last 12 days, 1h down move
long_entry_logic.append((df["close"] > (df["high_max_12_1d"] * 0.30)) | (df["RSI_3_1h"] > 20.0))
# big drop in the last 12 days, 4h still high
long_entry_logic.append(
(df["close"] > (df["high_max_12_1d"] * 0.40)) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# big drop in the last 20 days, 1h down move
long_entry_logic.append((df["close"] > (df["high_max_20_1d"] * 0.40)) | (df["RSI_3_1h"] > 10.0))
# big drop in the last 20 days, 4h down move
long_entry_logic.append((df["close"] > (df["high_max_20_1d"] * 0.10)) | (df["RSI_3_4h"] > 25.0))
# big drop in the last 30 days, 4h down move
long_entry_logic.append((df["close"] > (df["high_max_30_1d"] * 0.40)) | (df["RSI_3_4h"] > 15.0))
# big drop in the last 30 days, 4h still not low enough
long_entry_logic.append(
(df["close"] > (df["high_max_30_1d"] * 0.25)) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# Logic
long_entry_logic.append(df["RSI_3"] < 40.0)
long_entry_logic.append(df["RSI_3_15m"] < 50.0)
long_entry_logic.append(df["WILLR_14_15m"] < -50.0)
long_entry_logic.append(df["AROONU_14_15m"] < 25.0)
long_entry_logic.append(df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
long_entry_logic.append(df["WILLR_84_1h"] < -70.0)
long_entry_logic.append(df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
long_entry_logic.append(df["BBB_20_2.0_1h"] > 12.0)
long_entry_logic.append(df["close_max_48"] >= (df["close"] * 1.10))
# Condition #61 - Rebuy mode (Long).
if long_entry_condition_index == 61:
# Protections
long_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
long_entry_logic.append(df["protections_long_global"] == True)
# 5m & 15m down move, 4h high
long_entry_logic.append((df["RSI_3"] > 10.0) | (df["RSI_3_15m"] > 20.0) | (df["AROONU_14_4h"] < 85.0))
# 15m & 1h down move
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 10.0))
# 15m & 1d down move
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_1d"] > 10.0))
# 15m down move, 15m still not low enough
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["AROONU_14_15m"] < 30.0))
# 15m & 1h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 5.0) | (df["AROONU_14_4h"] < 70.0))
# 15m & 1h down move, 1h still high
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 25.0) | (df["AROONU_14_1h"] < 50.0))
# 15m & 1h down move, 4h stil high
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 20.0) | (df["AROONU_14_4h"] < 50.0))
# 15m down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["AROONU_14_1h"] < 80.0))
# 15m & 1h down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
)
# 15m & 1h down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 30.0) | (df["AROONU_14_1h"] < 70.0))
# 15m & 1h down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 35.0) | (df["AROONU_14_1h"] < 80.0))
# 15m & 4h & 1d down move
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 10.0) | (df["RSI_3_1d"] > 40.0))
# 15m down move, 15m high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["AROONU_14_15m"] < 70.0))
# 15m down move, 4h still high, 1d overbought
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["AROONU_14_4h"] < 50.0) | (df["ROC_9_1d"] < 50.0))
# 15m down move, 1d overbought
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["ROC_9_1d"] < 80.0))
# 15m & 1h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 40.0) | (df["AROONU_14_4h"] < 80.0))
# 15m down move, 15m still high, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["AROONU_14_15m"] < 50.0) | (df["AROONU_14_1h"] < 85.0)
)
# 15m down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["AROONU_14_4h"] < 90.0))
# 15m down move, 15m still not low enough, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["AROONU_14_15m"] < 30.0) | (df["AROONU_14_1h"] < 90.0)
)
# 15m down move, 15m high, 1d overbought
long_entry_logic.append((df["RSI_3_15m"] > 25.0) | (df["AROONU_14_15m"] < 60.0) | (df["ROC_9_1d"] < 150.0))
# 15m down move, 15m still high, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 30.0) | (df["AROONU_14_15m"] < 50.0) | (df["AROONU_14_1h"] < 80.0)
)
# 15m down move, 15m still high, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 30.0) | (df["AROONU_14_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
)
# 1h & 1d down move, 4h still high
long_entry_logic.append(
((df["RSI_3_1h"] > 3.0) | (df["RSI_3_1d"] > 15.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0))
)
# 1h & 4h down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
)
# 1h & 4h down move, 1d overbought
long_entry_logic.append((df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 20.0) | (df["ROC_9_1d"] < 40.0))
# 1h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 5.0) | (df["AROONU_14_4h"] < 70.0))
# 1h & 4h down move, 1h low
long_entry_logic.append(
(df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 10.0) | (df["CMF_20_1h"] > -0.4) | (df["CMF_20_4h"] > -0.4)
)
# 1h & 4h down move, 4h downtrend
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 10.0) | (df["ROC_9_4h"] > -40.0))
# 1h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["AROONU_14_4h"] < 80.0))
# 1h down move, 1h still high
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["AROONU_14_1h"] < 50.0))
# 1h down move, 1h still high
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0))
# 1h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["AROONU_14_4h"] < 80.0))
# 1h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 25.0) | (df["AROONU_14_4h"] < 90.0))
# 1h down move, 1h high
long_entry_logic.append((df["RSI_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0))
# 1h down move, 1h still high, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 45.0) | (df["AROONU_14_1h"] < 50.0) | (df["AROONU_14_4h"] < 90.0))
# 1h down move, 1h & 1d high
long_entry_logic.append((df["RSI_3_1h"] > 45.0) | (df["AROONU_14_1h"] < 90.0) | (df["AROONU_14_1d"] < 90.0))
# 1h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 55.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0))
# 4h down move, 4h still not low enough
long_entry_logic.append((df["RSI_3_4h"] > 10.0) | (df["AROONU_14_4h"] < 25.0))
# 4h down move, 4h high
long_entry_logic.append((df["RSI_3_4h"] > 20.0) | (df["AROONU_14_4h"] < 70.0))
# 1d down move, 1h still not low enough
long_entry_logic.append((df["RSI_3_1d"] > 5.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 20.0))
# 15m still high, 4h high
long_entry_logic.append((df["RSI_14_15m"] < 40.0) | (df["RSI_14_4h"] < 90.0))
# 15m still high, 4h high
long_entry_logic.append((df["AROONU_14_15m"] < 50.0) | (df["AROONU_14_4h"] < 90.0))
# 5m down move, 15m & 1h down move, 15m still high
long_entry_logic.append(
(df["ROC_9"] > -15.0) | (df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 35.0) | (df["AROONU_14_15m"] < 50.0)
)
# 1d green with top wick, 1d low
long_entry_logic.append(
(df["change_pct_1d"] < 25.0) | (df["top_wick_pct_1d"] < 10.0) | (df["CMF_20_1d"] > -0.2)
)
# 1d top wick, 4h still high
long_entry_logic.append((df["top_wick_pct_1d"] < 40.0) | (df["AROONU_14_4h"] < 50.0))
# pump, 4h high
long_entry_logic.append(
(((df["high_max_24_4h"] - df["low_min_24_4h"]) / df["low_min_24_4h"]) < 2.0) | (df["AROONU_14_4h"] < 70.0)
)
# pump, drop but not yet near the previous lows
long_entry_logic.append(
(((df["high_max_24_4h"] - df["low_min_24_4h"]) / df["low_min_24_4h"]) < 2.0)
| (df["close"] > (df["high_max_12_4h"] * 0.60))
| (df["close"] < (df["low_min_24_4h"] * 1.10))
)
# pump, 1d overbought
long_entry_logic.append(
(((df["high_max_6_1d"] - df["low_min_6_1d"]) / df["low_min_6_1d"]) < 3.0) | (df["ROC_9_1d"] < 100.0)
)
# big drop in last 6 hours, 1d overbought
long_entry_logic.append((df["close"] > (df["high_max_6_1h"] * 0.65)) | (df["ROC_9_1d"] < 50.0))
# big drop in last 12 hours, 1d overbought
long_entry_logic.append((df["close"] > (df["high_max_12_1h"] * 0.50)) | (df["ROC_9_1d"] < 50.0))
# big drop in the last 4 days, 4h down move
long_entry_logic.append((df["close"] > (df["high_max_24_4h"] * 0.20)) | (df["RSI_3_4h"] > 20.0))
# big drop in the last 6 days, 1d down move
long_entry_logic.append((df["close"] > (df["high_max_6_1d"] * 0.20)) | (df["RSI_3_1d"] > 15.0))
# big drop in the last 20 days, 1d down move
long_entry_logic.append((df["close"] > (df["high_max_20_1d"] * 0.15)) | (df["RSI_3_1d"] > 10.0))
# big drop in the last 20 days, 1d down move
long_entry_logic.append((df["close"] > (df["high_max_20_1d"] * 0.25)) | (df["RSI_3_1d"] > 30.0))
# big drop in the last 20 days, 4h still high
long_entry_logic.append(
(df["close"] > (df["high_max_20_1d"] * 0.10)) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# big drop in the last 30 days, 1h down move
long_entry_logic.append((df["close"] > (df["high_max_30_1d"] * 0.15)) | (df["RSI_3_1h"] > 15.0))
# Logic
long_entry_logic.append(df["RSI_3"] < 50.0)
long_entry_logic.append(df["AROONU_14"] < 25.0)
long_entry_logic.append(df["AROOND_14"] > 75.0)
long_entry_logic.append(df["STOCHRSIk_14_14_3_3"] < 20.0)
long_entry_logic.append(df["ROC_2"] > -5.0)
long_entry_logic.append(df["EMA_26"] > df["EMA_12"])
long_entry_logic.append((df["EMA_26"] - df["EMA_12"]) > (df["open"] * 0.030))
long_entry_logic.append((df["EMA_26"].shift() - df["EMA_12"].shift()) > (df["open"] / 100.0))
# Condition #62 - Rebuy mode (Long).
if long_entry_condition_index == 62:
# Protections
long_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
long_entry_logic.append(df["protections_long_global"] == True)
# 5m & 1h down move, 4h still high
long_entry_logic.append(
(df["RSI_3"] > 5.0) | (df["RSI_3_1h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
)
# 15m & 1h down move
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 3.0))
# 15m & 1h down move, 4h still not low enough
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 5.0) | (df["RSI_14_4h"] < 35.0))
# 15m & 1h & 4h down move
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 30.0))
# 15m & 4h & 1d down move
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_4h"] > 10.0) | (df["RSI_3_1d"] > 15.0))
# 15m & 1h down move, 1h still high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 10.0) | (df["AROONU_14_1h"] < 40.0))
# 15m & 1h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
)
# 15m & 1h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 20.0) | (df["AROONU_14_4h"] < 40.0))
# 15m & 1h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 25.0) | (df["AROONU_14_4h"] < 70.0))
# 15m & 1h down move, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
)
# 15m & 1h down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 20.0) | (df["RSI_3_1h"] > 40.0) | (df["AROONU_14_1h"] < 80.0))
# 15m & 3h down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
)
# 15m down move, 15m still not low enough, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 20.0) | (df["AROONU_14_4h"] < 90.0)
)
# 15m & 1h down move, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["RSI_3_1h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m down move, 15m still not low enough, 1d overbought
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 20.0) | (df["ROC_9_1d"] < 80.0)
)
# 1h & 4h down move
long_entry_logic.append((df["RSI_3_1h"] > 3.0) | (df["RSI_3_4h"] > 10.0))
# 1h & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_1h"] > 3.0) | (df["RSI_3_4h"] > 35.0) | (df["RSI_14_4h"] < 40.0))
# 1h & 4h down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 3.0) | (df["RSI_3_4h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 1h & 4h down move
long_entry_logic.append((df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 5.0))
# 1h & 4h down move, 1d still high
long_entry_logic.append(
(df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 50.0)
)
# 1h & 4h down move, 1h still high
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 15.0) | (df["AROONU_14_1h"] < 50.0))
# 1h & 4h & 1d down move
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 25.0) | (df["RSI_3_1d"] > 25.0))
# 1h down move, 1h & 4h high
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["AROONU_14_1h"] < 60.0) | (df["AROONU_14_4h"] < 60.0))
# 1h & 4h down move, 1h high
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["RSI_3_4h"] > 20.0) | (df["AROONU_14_1h"] < 70.0))
# 1h & 4h down move, 1d overbought
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["RSI_3_4h"] > 20.0) | (df["ROC_9_1d"] < 50.0))
# 1h & 4h down move, 1h still high
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["RSI_3_4h"] > 25.0) | (df["AROONU_14_1h"] < 50.0))
# 1h & 1d down move, 1d high
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["RSI_3_1d"] > 20.0) | (df["AROONU_14_1d"] < 70.0))
# 1h & 4h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 25.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
)
# 1h & 4h down move, 1h high
long_entry_logic.append((df["RSI_3_1h"] > 30.0) | (df["RSI_3_4h"] > 30.0) | (df["AROONU_14_1h"] < 70.0))
# 1h & 4h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 30.0) | (df["RSI_3_4h"] > 45.0) | (df["AROONU_14_4h"] < 90.0))
# 1h & 4h down move, 4h high
long_entry_logic.append(
(df["RSI_3_1h"] > 35.0) | (df["RSI_3_4h"] > 45.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 1h down move, 1h still high, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 45.0) | (df["AROONU_14_1h"] < 50.0) | (df["AROONU_14_4h"] < 90.0))
# 4h down move, 15m still high
long_entry_logic.append((df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0))
# 4h down move, 15m still high, 1h high
long_entry_logic.append((df["RSI_3_4h"] > 20.0) | (df["AROONU_14_15m"] < 50.0) | (df["AROONU_14_1h"] < 90.0))
# 4h down move, 15m still high, 4h high
long_entry_logic.append(
(df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 40.0) | (df["AROONU_14_4h"] < 90.0)
)
# 4h & 1d down move, 4h still high
long_entry_logic.append(
(df["RSI_3_4h"] > 25.0) | (df["RSI_3_1d"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
)
# 4h & 1d down move, 1d overbought
long_entry_logic.append((df["RSI_3_4h"] > 30.0) | (df["RSI_3_1d"] > 45.0) | (df["ROC_9_1d"] < 50.0))
# 4h down move, 15m still high, 4h high
long_entry_logic.append(
(df["RSI_3_4h"] > 45.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0) | (df["AROONU_14_4h"] < 70.0)
)
# 1d top wick, 1h down move, 4h still high
long_entry_logic.append(
(df["top_wick_pct_1d"] < 10.0) | (df["RSI_3_1h"] > 25.0) | (df["AROONU_14_4h"] < 50.0)
)
# 1d top wick, 4h down move, 4h high
long_entry_logic.append(
(df["top_wick_pct_1d"] < 10.0) | (df["RSI_3_4h"] > 60.0) | (df["AROONU_14_4h"] < 80.0)
)
# pump, drop but not yet near the previous lows
long_entry_logic.append(
(((df["high_max_24_4h"] - df["low_min_24_4h"]) / df["low_min_24_4h"]) < 2.0)
| (df["close"] > (df["high_max_12_4h"] * 0.60))
| (df["close"] < (df["low_min_24_4h"] * 1.10))
)
# big drop in the last hour
long_entry_logic.append(df["close"] > (df["close_max_12"] * 0.50))
# big drop in last 6 hours, 1d overbought
long_entry_logic.append((df["close"] > (df["high_max_6_1h"] * 0.65)) | (df["ROC_9_1d"] < 50.0))
# big drop in the last 4 days, 4h down move
long_entry_logic.append((df["close"] > (df["high_max_24_4h"] * 0.20)) | (df["RSI_3_4h"] > 20.0))
# big drop in the last 12 days, 15m & 4h down move
long_entry_logic.append(
(df["close"] > (df["high_max_12_1d"] * 0.40)) | (df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 10.0)
)
# big drop in the last 20 days, 15m & 1h down move
long_entry_logic.append(
(df["close"] > (df["high_max_20_1d"] * 0.40)) | (df["RSI_14_15m"] < 10.0) | (df["RSI_14_1h"] < 10.0)
)
# big drop in the last 20 days, 1d down move
long_entry_logic.append((df["close"] > (df["high_max_20_1d"] * 0.25)) | (df["RSI_3_1d"] > 30.0))
# big drop in the last 20 days, 4h still not low enough
long_entry_logic.append((df["close"] > (df["high_max_20_1d"] * 0.10)) | (df["RSI_14_4h"] < 30.0))
# big drop in the last 30 days, 1d down move
long_entry_logic.append((df["close"] > (df["high_max_30_1d"] * 0.20)) | (df["RSI_3_1d"] > 20.0))
# Logic
long_entry_logic.append(df["RSI_3"] < 40.0)
long_entry_logic.append(df["AROONU_14"] < 30.0)
long_entry_logic.append(df["STOCHRSIk_14_14_3_3"] < 20.0)
long_entry_logic.append(df["STOCHRSIk_14_14_3_3_15m"] < 70.0)
long_entry_logic.append(df["WILLR_84_1h"] < -70.0)
long_entry_logic.append(df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
long_entry_logic.append(df["BBB_20_2.0_1h"] > 12.0)
long_entry_logic.append(df["close_max_48"] >= (df["close"] * 1.12))
# Condition #101 - Rapid mode (Long).
if long_entry_condition_index == 101:
# Protections
long_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
long_entry_logic.append(df["protections_long_global"] == True)
long_entry_logic.append(df["RSI_14_1h"] < 80.0)
long_entry_logic.append(df["RSI_14_4h"] < 80.0)
long_entry_logic.append(df["RSI_14_1d"] < 80.0)
# big drop in the last hour
long_entry_logic.append(df["close"] > (df["close_max_12"] * 0.50))
# 5 & 15m down move, 1h high
long_entry_logic.append(
(df["RSI_3"] > 10.0) | (df["RSI_3_15m"] > 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 90.0)
)
# 5m down move, 1h & 4h high
long_entry_logic.append((df["RSI_3"] > 10.0) | (df["AROONU_14_1h"] < 85.0) | (df["AROONU_14_4h"] < 90.0))
# 15m & 1h down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 5.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 15m & 1h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 15.0) | (df["RSI_14_4h"] < 40.0))
# 15m & 4h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 30.0) | (df["AROONU_14_4h"] < 75.0))
# 15m & 1h down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 35.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
)
# 15m & 4h down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 3.0) | (df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 20.0)
)
# 15m & 4h down move, 4h still not low enough
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_4h"] > 25.0) | (df["AROONU_14_4h"] < 30.0))
# 15m & 4h down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 3.0) | (df["RSI_3_4h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 15m down move, 15m still not low enough, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 3.0) | (df["AROONU_14_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 15m down move, 15m still not low enough, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 3.0) | (df["AROONU_14_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 15m & 1h & 1d down move
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 10.0) | (df["RSI_3_1d"] > 20.0))
# 15m down move, 1h still not low enough, 1d high
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 30.0) | (df["AROONU_14_1d"] < 90.0)
)
# 15m & 1h down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
)
# 15m & 1h down move, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
)
# 15m & 1h down move, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 40.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
)
# 15m & 1h down move, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 15m & 1h down move, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m & 4h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["RSI_3_4h"] > 40.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m & 1d down move
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1d"] > 5.0))
# 15m & 1d down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["RSI_3_1d"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 15m down move, 1h still high, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["AROONU_14_1h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m & 1h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m & 1h down move, 1h still not low enough
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 25.0) | (df["AROONU_14_1h"] < 25.0))
# 15m & 1h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m & 1h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m & 1h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 35.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 1h down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 50.0) | (df["AROONU_14_1h"] < 80.0))
# 15m & 1h down move, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
)
# 15m & 4h down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 10.0)
)
# 15m & 4h down move, 1d high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 25.0) | (df["AROONU_14_1d"] < 85.0))
# 15m & 4h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 4h down move, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 15m & 1d down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1d"] > 25.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m down move, 15m still not low enough, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["AROONU_14_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m down move, 1h still high, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0) | (df["AROONU_14_4h"] < 85.0)
)
# 15m down move, 1h & 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 75.0)
)
# 15m & 1h down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
)
# 15m & 1h down move, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m & 1h down move, 1h still high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 40.0) | (df["AROONU_14_1h"] < 50.0))
# 15m & 4h & 1d down move
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 15.0) | (df["RSI_3_1d"] > 15.0))
# 15m & 4h down move, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
)
# 15m & 4h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 4h down move, 15m still not low enough
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 25.0) | (df["AROONU_14_15m"] < 30.0))
# 15m & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 50.0) | (df["AROONU_14_4h"] < 50.0))
# 15m down move, 15m still not low enough, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["AROONU_14_15m"] < 25.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
)
# 15m down move, 1h & 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0) | (df["AROONU_14_4h"] < 85.0)
)
# 15m down move, 4h high & overbought
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["AROONU_14_4h"] < 80.0) | (df["ROC_9_4h"] < 40.0))
# 15m & 1h down move, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["RSI_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m & 1d down move, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["RSI_3_1d"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 15m & 1h down move, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["RSI_3_1h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 60.0)
)
# 15m & 1h down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 25.0) | (df["RSI_3_1h"] > 60.0) | (df["AROONU_14_1h"] < 85.0))
# 15m down move, 15m still not low enough, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["AROONU_14_15m"] < 25.0) | (df["AROONU_14_4h"] < 60.0)
)
# 15m down move, 15m still not low enough, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0) | (df["AROONU_14_1h"] < 80.0)
)
# 15m & 1h down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 30.0) | (df["RSI_3_1h"] > 45.0) | (df["AROONU_14_1h"] < 70.0))
# 1h & 4h down move, 15m downtrend
long_entry_logic.append((df["RSI_3_1h"] > 3.0) | (df["RSI_3_4h"] > 3.0) | (df["ROC_9_15m"] > -30.0))
# 1h & 4h & 1d down move
long_entry_logic.append((df["RSI_3_1h"] > 3.0) | (df["RSI_3_4h"] > 15.0) | (df["RSI_3_1d"] > 25.0))
# 1h & 4h down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 20.0)
)
# 1h & 4h down move, 1d low
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 10.0) | (df["CMF_20_1d"] > -0.2))
# 1h & 4h down move, 4h still not low enough
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 15.0) | (df["AROONU_14_4h"] < 20.0))
# 1h & 4h down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 1h & 1d down move, 5m moving down
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_1d"] > 15.0) | (df["ROC_2"] > -0.0))
# 1h & 4h & 1d down move
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 20.0) | (df["RSI_3_1d"] > 30.0))
# 1h & 4h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 1h & 4h down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
)
# 1h & 4h down move, 1h still high
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["RSI_3_1d"] > 10.0) | (df["AROONU_14_1h"] < 40.0))
# 1h down move, 1h still not low enough, 4h high
long_entry_logic.append(
(df["RSI_3_1h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 20.0) | (df["AROONU_14_4h"] < 80.0)
)
# 1h & 4h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 25.0) | (df["RSI_3_4h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 1h & 4h down move, 1h high
long_entry_logic.append(
(df["RSI_3_1h"] > 25.0) | (df["RSI_3_4h"] > 60.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
)
# 1h & 4h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 30.0) | (df["RSI_3_4h"] > 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 1h down move, 15m high
long_entry_logic.append((df["RSI_3_1h"] > 35.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 80.0))
# 4h down move, 15m still high
long_entry_logic.append((df["RSI_3_4h"] > 5.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0))
# 4h down move, 15m 4h still high
long_entry_logic.append(
(df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 40.0) | (df["AROONU_14_4h"] < 50.0)
)
# 4h & 1d down move, 4h still high
long_entry_logic.append(
(df["RSI_3_4h"] > 40.0) | (df["RSI_3_1d"] > 10.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 1d down move, 15 still high
long_entry_logic.append((df["RSI_3_4h"] > 5.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 40.0))
# 1d down move, 1h still high, 4h high
long_entry_logic.append((df["RSI_3_1d"] > 20.0) | (df["AROONU_14_1h"] < 50.0) | (df["AROONU_14_4h"] < 85.0))
# 4h still high, 4h moving lower, 4h overbought
long_entry_logic.append(
(df["AROONU_14_4h"] < 50.0) | (df["AROONU_14_4h"] > df["AROONU_14_4h"].shift(48)) | (df["ROC_9_4h"] < 40.0)
)
# 1d red, 4h down move, 1h still high
long_entry_logic.append(
(df["change_pct_1d"] > -30.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# pump, drop but not yet near the previous lows
long_entry_logic.append(
(((df["high_max_24_4h"] - df["low_min_24_4h"]) / df["low_min_24_4h"]) < 2.0)
| (df["close"] > (df["high_max_6_4h"] * 0.75))
| (df["close"] < (df["low_min_24_4h"] * 1.25))
)
# 4h high, drop but not yet near the previous lows
long_entry_logic.append(
(df["AROONU_14_4h"] < 70.0)
| (df["close"] > (df["high_max_6_4h"] * 0.80))
| (df["close"] < (df["low_min_24_4h"] * 1.25))
)
# 4h high, drop but not yet near the previous lows
long_entry_logic.append(
(df["AROONU_14_4h"] < 80.0)
| (df["close"] > (df["high_max_6_4h"] * 0.85))
| (df["close"] < (df["low_min_24_4h"] * 1.25))
)
# 1h down move, drop but not yet near the previous lows
long_entry_logic.append(
(df["RSI_3_1h"] > 30.0)
| (df["close"] > (df["high_max_12_4h"] * 0.50))
| (df["close"] < (df["low_min_24_4h"] * 1.25))
)
# 1d overbought, drop but not yet near the previous lows
long_entry_logic.append(
(df["ROC_9_1d"] < 50.0)
| (df["close"] > (df["high_max_6_1d"] * 0.70))
| (df["close"] < (df["low_min_12_1d"] * 1.25))
)
# big drop in last 6 hours, 1d overbought
long_entry_logic.append((df["close"] > (df["high_max_6_1h"] * 0.65)) | (df["ROC_9_1d"] < 50.0))
# big drop in last 4 hours, 4h still not low enough
long_entry_logic.append(
(df["close"] > (df["high_max_24_4h"] * 0.50)) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# big drop in the last 4 days, 4h down move
long_entry_logic.append((df["close"] > (df["high_max_24_4h"] * 0.20)) | (df["RSI_3_4h"] > 20.0))
# big drop in the last 6 days, 1d down move
long_entry_logic.append((df["close"] > (df["high_max_6_1d"] * 0.30)) | (df["RSI_3_1d"] > 15.0))
# big drop in the last 12 days, 4h high
long_entry_logic.append(
(df["close"] > (df["high_max_12_1d"] * 0.50)) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# big drop in the last 30 days, 4h down move
long_entry_logic.append((df["close"] > (df["high_max_20_1d"] * 0.10)) | (df["RSI_3_4h"] > 30.0))
# big drop in the last 20 days, 1h still high
long_entry_logic.append((df["close"] > (df["high_max_20_1d"] * 0.05)) | (df["AROONU_14_1h"] < 50.0))
# big drop in the last 30 days, 1h down move
long_entry_logic.append((df["close"] > (df["high_max_30_1d"] * 0.25)) | (df["RSI_3_1h"] > 15.0))
# Logic
long_entry_logic.append(df["RSI_3"] > 3.0)
long_entry_logic.append(df["RSI_14"] < 36.0)
long_entry_logic.append(df["AROONU_14"] < 25.0)
long_entry_logic.append(df["STOCHRSIk_14_14_3_3"] < 20.0)
long_entry_logic.append(df["close"] < (df["SMA_16"] * 0.946))
long_entry_logic.append(df["AROONU_14_15m"] < 50.0)
# Condition #102 - Rapid mode (Long).
if long_entry_condition_index == 102:
# Protections
long_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
long_entry_logic.append(df["protections_long_global"] == True)
long_entry_logic.append(df["RSI_3"] < 46.0)
long_entry_logic.append(df["RSI_3_15m"] > 5.0)
long_entry_logic.append(df["RSI_3_1h"] > 10.0)
long_entry_logic.append(df["RSI_3_4h"] > 10.0)
# 5m & 15m down move, 4h still high
long_entry_logic.append(
(df["RSI_3"] > 3.0) | (df["RSI_3_15m"] > 15.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 5m & 15m down move, 15m still high
long_entry_logic.append((df["RSI_3"] > 3.0) | (df["RSI_3_15m"] > 20.0) | (df["AROONU_14_15m"] < 40.0))
# 5m & 15m down move, 1h still high
long_entry_logic.append(
(df["RSI_3"] > 3.0) | (df["RSI_3_15m"] > 25.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 5m & 1h down move, 4h still high
long_entry_logic.append((df["RSI_3"] > 3.0) | (df["RSI_3_1h"] > 25.0) | (df["AROONU_14_4h"] < 50.0))
# 5m & 4h & 1d down move
long_entry_logic.append((df["RSI_3"] > 3.0) | (df["RSI_3_4h"] > 20.0) | (df["RSI_3_1d"] > 20.0))
# 5m down move, 15m high
long_entry_logic.append((df["RSI_3"] > 3.0) | (df["AROONU_14_15m"] < 70.0))
# 5m down move, 15m & 1h still high
long_entry_logic.append(
(df["RSI_3"] > 3.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 40.0) | (df["AROONU_14_1h"] < 40.0)
)
# 5m down move, 1h high
long_entry_logic.append(
(df["RSI_3"] > 3.0) | (df["AROONU_14_1h"] < 70.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 5m & 1h down move, 1h high
long_entry_logic.append(
(df["RSI_3"] > 5.0) | (df["RSI_3_1h"] > 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 60.0)
)
# 5m & 4h down move, 4h high
long_entry_logic.append((df["RSI_3"] > 5.0) | (df["RSI_3_4h"] > 50.0) | (df["AROONU_14_4h"] < 70.0))
# 5m down move, 15m still high, 1h high
long_entry_logic.append((df["RSI_3"] > 5.0) | (df["RSI_14_15m"] < 40.0) | (df["AROONU_14_1h"] < 80.0))
# 5m down move, 15m still high, 1h high
long_entry_logic.append(
(df["RSI_3"] > 5.0) | (df["AROONU_14_15m"] < 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 5m down move, 15m & 4h high
long_entry_logic.append(
(df["RSI_3"] > 5.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 70.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 5m & 15m down move, 4h high
long_entry_logic.append((df["RSI_3"] > 10.0) | (df["RSI_3_15m"] > 20.0) | (df["AROONU_14_4h"] < 90.0))
# 5m & 15m down move, 1d high
long_entry_logic.append(
(df["RSI_3"] > 10.0) | (df["RSI_3_15m"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 80.0)
)
# 5m & 15m down move, 1h high
long_entry_logic.append(
(df["RSI_3"] > 10.0) | (df["RSI_3_15m"] > 25.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 90.0)
)
# 5m & 1h down move, 4h still high
long_entry_logic.append(
(df["RSI_3"] > 10.0) | (df["RSI_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 5m down move, 1h & 4h high
long_entry_logic.append((df["RSI_3"] > 10.0) | (df["AROONU_14_1h"] < 85.0) | (df["AROONU_14_4h"] < 90.0))
# 5m down move, 4h high, 1d high
long_entry_logic.append(
(df["RSI_3"] > 10.0) | (df["AROONU_14_4h"] < 60.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 90.0)
)
# 5m down move, 15m still high, 1h high
long_entry_logic.append(
(df["RSI_3"] > 15.0) | (df["RSI_14_15m"] < 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 90.0)
)
# 5m down move, 15m still high, 4h high
long_entry_logic.append(
(df["RSI_3"] > 15.0) | (df["RSI_14_15m"] < 40.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m & 1h down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
)
# 15m & 1h down move, 1h still high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 35.0) | (df["AROONU_14_1h"] < 50.0))
# 15m & 1h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 35.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 1h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 35.0) | (df["AROONU_14_4h"] < 70.0))
# 15m& 4h down move, 15m still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 40.0)
)
# 15m & 4h down move, 15m still high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 20.0) | (df["AROONU_14_15m"] < 50.0))
# 15m & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 25.0) | (df["AROONU_14_4h"] < 50.0))
# 15m & 4h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
)
# 15m & 4h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m & 4h down move, 1d high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 25.0) | (df["AROONU_14_1d"] < 85.0))
# 15m & 4h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 4h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 30.0) | (df["AROONU_14_4h"] < 70.0))
# 15m & 1d down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1d"] > 25.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m down move, 15m still not low enough, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["AROONU_14_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
)
# 15m & 1h down move, 1h still high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 40.0) | (df["AROONU_14_1h"] < 50.0))
# 15m & 1h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 45.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 1h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 45.0) | (df["AROONU_14_4h"] < 80.0))
# 15m & 1h down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 45.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
)
# 15m & 4h & 1d down move
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 15.0) | (df["RSI_3_1d"] > 15.0))
# 15m & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 20.0) | (df["AROONU_14_4h"] < 50.0))
# 15m & 4h down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 25.0)
)
# 15m & 4h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 35.0) | (df["AROONU_14_4h"] < 60.0))
# 15m & 4h down move, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 35.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 15m & 4h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 45.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m down move, 15m still not low enough, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_14_15m"] < 35.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m down move, 15m still not low enough, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["AROONU_14_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m down move, 15m & 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["AROONU_14_15m"] < 50.0) | (df["AROONU_14_4h"] < 50.0)
)
# 15m down move, 15m still high, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 15m down move, 1h still high, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 60.0)
)
# 15m down move, 4h still high 1d overbought
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["AROONU_14_4h"] < 50.0) | (df["ROC_9_1d"] < 50.0))
# 15m & 1h down move, 15m still not low enough
long_entry_logic.append((df["RSI_3_15m"] > 20.0) | (df["RSI_3_1h"] > 20.0) | (df["AROONU_14_15m"] < 30.0))
# 15m & 1h down move, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["RSI_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m & 1h down move, 15m high
long_entry_logic.append((df["RSI_3_15m"] > 20.0) | (df["RSI_3_1h"] > 40.0) | (df["AROONU_14_15m"] < 60.0))
# 15m & 4h down move, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 60.0)
)
# 15m & 4h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 20.0) | (df["RSI_3_4h"] > 60.0) | (df["AROONU_14_4h"] < 80.0))
# 15m & 1d down move, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["RSI_3_1d"] > 20.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m down move, 15m still not low enough, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 20.0) | (df["RSI_14_15m"] < 35.0) | (df["RSI_14_4h"] < 85.0))
# 15m down move, 15m still not low enough, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["AROONU_14_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
)
# 15m down move, 15m still not low enough, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["AROONU_14_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 15m down move, 15m still not low enough, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0) | (df["AROONU_14_1h"] < 50.0)
)
# 15m down move, 15m & 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["AROONU_14_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m down move, 1h & 4h high
long_entry_logic.append((df["RSI_3_15m"] > 20.0) | (df["AROONU_14_1h"] < 70.0) | (df["AROONU_14_4h"] < 90.0))
# 15m & 1h down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 25.0) | (df["RSI_3_1h"] > 25.0) | (df["AROONU_14_1h"] < 80.0))
# 15m & 1h down move, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["RSI_3_1h"] > 35.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
)
# 15m & 1h down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 25.0) | (df["RSI_3_1h"] > 60.0) | (df["AROONU_14_1h"] < 85.0))
# 15m & 4h down move, 15m still high
long_entry_logic.append((df["RSI_3_15m"] > 25.0) | (df["RSI_3_4h"] > 40.0) | (df["AROONU_14_15m"] < 50.0))
# 15m & 1d down move, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["RSI_3_1d"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
)
# 15m down move, 15m & 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["AROONU_14_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m down move, 15m still high, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["AROONU_14_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 15m down move, 15m high, 1d overbought
long_entry_logic.append((df["RSI_3_15m"] > 25.0) | (df["AROONU_14_15m"] < 70.0) | (df["ROC_9_1d"] < 100.0))
# 15m down move, 15m high
long_entry_logic.append((df["RSI_3_15m"] > 25.0) | (df["AROONU_14_15m"] < 85.0))
# 15m down move, 1h & 4h high
long_entry_logic.append((df["RSI_3_15m"] > 25.0) | (df["AROONU_14_1h"] < 80.0) | (df["AROONU_14_4h"] < 90.0))
# 15m down move, 1h & 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0) | (df["AROONU_14_4h"] < 90.0)
)
# 15m down move, 4h high, 1d overbought
long_entry_logic.append((df["RSI_3_15m"] > 25.0) | (df["AROONU_14_4h"] < 80.0) | (df["ROC_9_1d"] < 50.0))
# 15m & 1h down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 30.0) | (df["RSI_3_1h"] > 45.0) | (df["AROONU_14_1h"] < 70.0))
# 15m down move, 15m high, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 30.0) | (df["AROONU_14_15m"] < 70.0) | (df["AROONU_14_4h"] < 50.0)
)
# 15m down move, 15m still not low enough, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 30.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
)
# 15m down move, 1h still high, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 30.0) | (df["AROONU_14_1h"] < 50.0) | (df["AROONU_14_4h"] < 90.0))
# 15m down move, 15m & 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 35.0) | (df["AROONU_14_15m"] < 70.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 15m down move, 15m & 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 35.0) | (df["AROONU_14_15m"] < 70.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m down move, 15m still high, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 40.0) | (df["RSI_14_15m"] < 50.0) | (df["AROONU_14_1h"] < 80.0))
# 15m down move, 15m high, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 40.0) | (df["AROONU_14_15m"] < 70.0) | (df["AROONU_14_1h"] < 90.0)
)
# 15m down move, 15m high
long_entry_logic.append((df["RSI_3_15m"] > 45.0) | (df["AROONU_14_15m"] < 90.0))
# 1h & 4h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 1h & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 30.0) | (df["AROONU_14_4h"] < 40.0))
# 1h & 4h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 25.0) | (df["RSI_3_4h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 1h & 4h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 25.0) | (df["RSI_3_4h"] > 40.0) | (df["AROONU_14_4h"] < 70.0))
# 1h down move, 1h still not low enough, 4h high
long_entry_logic.append(
(df["RSI_3_1h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 1h down move, 4h high, 1d downtrend
long_entry_logic.append((df["RSI_3_1h"] > 30.0) | (df["AROONU_14_4h"] < 70.0) | (df["ROC_9_1d"] > -50.0))
# 1h & 4h down move, 4h high
long_entry_logic.append(
(df["RSI_3_1h"] > 35.0) | (df["RSI_3_4h"] > 55.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
)
# 1h down move, 4h high, 1d overbought
long_entry_logic.append((df["RSI_3_1h"] > 40.0) | (df["RSI_14_4h"] < 75.0) | (df["ROC_9_1d"] < 100.0))
# 4h down move, 4h still not low enough, 1d overbought
long_entry_logic.append((df["RSI_3_4h"] > 15.0) | (df["AROONU_14_4h"] < 30.0) | (df["ROC_9_1d"] < 100.0))
# 4h & 1d down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3_4h"] > 20.0) | (df["RSI_3_1d"] > 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
)
# 1d down move, 15m still not low enough, 1h still high
long_entry_logic.append(
(df["RSI_3_1d"] > 15.0) | (df["AROONU_14_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m still not low enough, 1h high, 1d overbought
long_entry_logic.append(
(df["AROONU_14_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0) | (df["ROC_9_1d"] < 100.0)
)
# 15m & 1h & 4h high
long_entry_logic.append(
(df["AROONU_14_15m"] < 70.0) | (df["AROONU_14_1h"] < 80.0) | (df["AROONU_14_4h"] < 90.0)
)
# 15m high
long_entry_logic.append((df["AROONU_14_15m"] < 80.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 60.0))
# 15m & 4h high
long_entry_logic.append((df["AROONU_14_15m"] < 80.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0))
# 15m high, 1d overbought
long_entry_logic.append((df["AROONU_14_15m"] < 80.0) | (df["ROC_9_1d"] < 50.0))
# 15m & 4h high
long_entry_logic.append((df["AROONU_14_15m"] < 90.0) | (df["AROONU_14_4h"] < 70.0))
# 15m & 1h high
long_entry_logic.append((df["AROONU_14_15m"] < 90.0) | (df["AROONU_14_1h"] < 90.0))
# 1h still high, 4h high & overbought
long_entry_logic.append((df["AROONU_14_1h"] < 50.0) | (df["AROONU_14_4h"] < 90.0) | (df["ROC_9_4h"] < 80.0))
# 4h high & overbought
long_entry_logic.append(
(df["AROONU_14_4h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 85.0) | (df["ROC_9_4h"] < 50.0)
)
# 5m red, 1h still high
long_entry_logic.append((df["change_pct"] > -5.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0))
# 1d top wick, 4h down move, 4h still high
long_entry_logic.append(
(df["top_wick_pct_1d"] < 30.0) | (df["RSI_3_4h"] > 60.0) | (df["AROONU_14_4h"] < 50.0)
)
# pump, drop but not yet near the previous lows
long_entry_logic.append(
(((df["high_max_24_4h"] - df["low_min_24_4h"]) / df["low_min_24_4h"]) < 2.0)
| (df["close"] > (df["high_max_6_4h"] * 0.75))
| (df["close"] < (df["low_min_24_4h"] * 1.25))
)
# 4h high, drop but not yet near the previous lows
long_entry_logic.append(
(df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
| (df["close"] > (df["close_max_48"] * 0.85))
| (df["close"] < (df["low_min_24_1h"] * 1.25))
)
# 4h high, drop but not yet near the previous lows
long_entry_logic.append(
(df["AROONU_14_4h"] < 70.0)
| (df["close"] > (df["high_max_6_4h"] * 0.80))
| (df["close"] < (df["low_min_24_4h"] * 1.25))
)
# 1d overbought, drop but not yet near the previous lows
long_entry_logic.append(
(df["ROC_9_1d"] < 50.0)
| (df["close"] > (df["high_max_6_1d"] * 0.70))
| (df["close"] < (df["low_min_12_1d"] * 1.25))
)
# big drop in the last 4 days, 4h down move
long_entry_logic.append((df["close"] > (df["high_max_24_4h"] * 0.20)) | (df["RSI_3_4h"] > 20.0))
# big drop in the last 12 days, 1h high
long_entry_logic.append(
(df["close"] > (df["high_max_12_1d"] * 0.30)) | (df["STOCHRSIk_14_14_3_3_1h"] < 90.0)
)
# big drop in the last 20 days, 1d down move
long_entry_logic.append((df["close"] > (df["high_max_20_1d"] * 0.40)) | (df["RSI_3_1d"] > 30.0))
# big drop in the last 30 days, 4h down move, 4h still high
long_entry_logic.append(
(df["close"] > (df["high_max_30_1d"] * 0.25)) | (df["RSI_3_4h"] > 45.0) | (df["RSI_14_4h"] < 40.0)
)
# big drop in the last 30 days, 1h high
long_entry_logic.append(
(df["close"] > (df["high_max_30_1d"] * 0.20)) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
)
# Logic
long_entry_logic.append(df["WILLR_14"] < -95.0)
long_entry_logic.append(df["STOCHRSIk_14_14_3_3"] < 10.0)
long_entry_logic.append(df["close"] < (df["BBL_20_2.0"] * 0.999))
long_entry_logic.append(df["close"] < (df["EMA_20"] * 0.960))
# Condition #103 - Rapid mode (Long).
if long_entry_condition_index == 103:
# Protections
long_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
long_entry_logic.append(df["protections_long_global"] == True)
long_entry_logic.append(df["ROC_2"] > -0.0)
# 15m down move, 4h high, 1d overbought
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0) | (df["ROC_9_1d"] < 80.0)
)
# 15m & 1h & 4h down move
long_entry_logic.append((df["RSI_3_15m"] > 20.0) | (df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 20.0))
# 15m & 4h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 1h down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 40.0) | (df["AROONU_14_1h"] < 70.0))
# 15m & 1h down move, 15m high
long_entry_logic.append((df["RSI_3_15m"] > 20.0) | (df["RSI_3_1h"] > 45.0) | (df["AROONU_14_15m"] < 70.0))
# 15m & 4h down move, 15m still high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
)
# 15m down move, 15m still high, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["RSI_14_15m"] < 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 15m down move, 15m still high, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 20.0) | (df["RSI_14_15m"] < 40.0) | (df["AROONU_14_4h"] < 90.0))
# 15m down move, 15m still high, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["AROONU_14_15m"] < 50.0) | (df["AROONU_14_4h"] < 90.0)
)
# 15m down move, 15m high, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["AROONU_14_15m"] < 70.0) | (df["AROONU_14_4h"] < 50.0)
)
# 15m down move, 15m & 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m down move, 1h & 1d high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 90.0)
)
# 15m down move, 4h & 1d high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["AROONU_14_4h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 90.0)
)
# 15m & 1h down move, 15m high
long_entry_logic.append((df["RSI_3_15m"] > 30.0) | (df["RSI_3_1h"] > 30.0) | (df["AROONU_14_15m"] < 70.0))
# 15m down move, 15m & 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 30.0) | (df["AROONU_14_15m"] < 70.0) | (df["AROONU_14_1h"] < 90.0)
)
# 15m down move, 1h & 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0) | (df["AROONU_14_4h"] < 90.0)
)
# 15m & 1h down move, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 35.0) | (df["RSI_3_1h"] > 45.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
)
# 15m down move, 15m still high, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 35.0) | (df["AROONU_14_15m"] < 50.0) | (df["AROONU_14_4h"] < 80.0)
)
# 15m down move, 15m & 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 35.0) | (df["AROONU_14_15m"] < 70.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
)
# 15m down move, 1h high, 4h overbought
long_entry_logic.append((df["RSI_3_15m"] > 35.0) | (df["AROONU_14_1h"] < 85.0) | (df["ROC_9_4h"] < 80.0))
# 1h & 4h down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
)
# 1h & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 20.0) | (df["AROONU_14_4h"] < 40.0))
# 1h down move, 15m still not low enough, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["AROONU_14_15m"] < 25.0) | (df["AROONU_14_4h"] < 80.0))
# 1h down move, 4h & 1d high
long_entry_logic.append(
(df["RSI_3_1h"] > 30.0) | (df["AROONU_14_4h"] < 70.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 80.0)
)
# 1h down move, 15m & 1h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 40.0) | (df["AROONU_14_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 1h down move, 1h still high, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 40.0) | (df["AROONU_14_1h"] < 50.0) | (df["AROONU_14_4h"] < 90.0))
# 1h down move, 15m & 1h still high
long_entry_logic.append((df["RSI_3_1h"] > 50.0) | (df["AROONU_14_15m"] < 50.0) | (df["AROONU_14_1h"] < 85.0))
# 1h down move, 15m & 1h still high
long_entry_logic.append(
(df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 4h down move, 15m still high, 4h high
long_entry_logic.append(
(df["RSI_3_4h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0) | (df["AROONU_14_4h"] < 70.0)
)
# 4h down move, 15m still not low enough, 4h high
long_entry_logic.append((df["RSI_3_4h"] > 35.0) | (df["AROONU_14_15m"] < 30.0) | (df["AROONU_14_4h"] < 70.0))
# 4h down move, 15m still high, 1h high
long_entry_logic.append((df["RSI_3_4h"] > 60.0) | (df["AROONU_14_15m"] < 50.0) | (df["AROONU_14_1h"] < 90.0))
# 1d down move, 4h high
long_entry_logic.append((df["RSI_3_1d"] > 10.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 80.0))
# 1d down move, 15m still high, 1h high
long_entry_logic.append((df["RSI_3_1d"] > 15.0) | (df["AROONU_14_15m"] < 50.0) | (df["AROONU_14_1h"] < 85.0))
# 15m still high, 1h & 4h high
long_entry_logic.append(
(df["RSI_14_15m"] < 40.0) | (df["AROONU_14_1h"] < 80.0) | (df["AROONU_14_4h"] < 90.0)
)
# 15m & 1h still high, 4h high
long_entry_logic.append(
(df["RSI_14_15m"] < 45.0) | (df["AROONU_14_1h"] < 40.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 15m still high, 4h high & overbought
long_entry_logic.append((df["RSI_14_15m"] < 50.0) | (df["AROONU_14_4h"] < 90.0) | (df["ROC_9_4h"] < 80.0))
# 15m still high, 1h high, 4h still high
long_entry_logic.append(
(df["AROONU_14_15m"] < 50.0) | (df["AROONU_14_1h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m still high, 1d high
long_entry_logic.append((df["AROONU_14_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 90.0))
# 15m & 1h & 4h high
long_entry_logic.append(
(df["AROONU_14_15m"] < 70.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0) | (df["AROONU_14_4h"] < 90.0)
)
# 15m & 1h
long_entry_logic.append((df["AROONU_14_15m"] < 70.0) | (df["AROONU_14_1h"] < 90.0))
# 15m still high, 1h high
long_entry_logic.append(
(df["STOCHRSIk_14_14_3_3_15m"] < 40.0)
| (df["AROONU_14_1h"] < 90.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 90.0)
)
# 15m still high, 1d high
long_entry_logic.append((df["STOCHRSIk_14_14_3_3_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 90.0))
# 1d top wick, 4h high
long_entry_logic.append((df["top_wick_pct_1d"] < 30.0) | (df["AROONU_14_4h"] < 90.0))
# pump, 4h overbought
long_entry_logic.append(
(((df["high_max_6_1h"] - df["low_min_6_1h"]) / df["low_min_6_1h"]) < 0.5) | (df["ROC_9_4h"] < 50.0)
)
# pump, drop but not yet near the previous lows
long_entry_logic.append(
(((df["high_max_24_4h"] - df["low_min_24_4h"]) / df["low_min_24_4h"]) < 2.0)
| (df["close"] > (df["high_max_6_4h"] * 0.85))
| (df["close"] < (df["low_min_24_4h"] * 1.25))
)
# pump, 1h high
long_entry_logic.append(
(((df["high_max_24_4h"] - df["low_min_24_4h"]) / df["low_min_24_4h"]) < 4.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 90.0)
)
# big drop in the last 2 days, 1d down move
long_entry_logic.append((df["close"] > (df["high_max_12_4h"] * 0.30)) | (df["RSI_3_1d"] > 30.0))
# big drop in the last 12 days, 1h still high
long_entry_logic.append((df["close"] > (df["high_max_12_1d"] * 0.25)) | (df["AROONU_14_1h"] < 50.0))
# big drop in the last 12 days, 1h still not low enough
long_entry_logic.append(
(df["close"] > (df["high_max_12_1d"] * 0.10)) | (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
)
# big drop in the last 12 days, 15m still high
long_entry_logic.append((df["close"] > (df["high_max_12_1d"] * 0.20)) | (df["AROONU_14_15m"] < 50.0))
# big drop in the last 20 days, 4h down move
long_entry_logic.append((df["close"] > (df["high_max_20_1d"] * 0.10)) | (df["RSI_3_4h"] > 20.0))
# Logic
long_entry_logic.append(df["RSI_4"] < 45.0)
long_entry_logic.append(df["RSI_14"] > 35.0)
long_entry_logic.append(df["RSI_20"] < df["RSI_20"].shift(1))
long_entry_logic.append(df["AROONU_14"] < 25.0)
long_entry_logic.append(df["close"] < df["SMA_16"] * 0.960)
# Condition #104 - Rapid mode (Long).
if long_entry_condition_index == 104:
# Protections
long_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
long_entry_logic.append(df["protections_long_global"] == True)
# 15m & 4h & 1d down move
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_4h"] > 10.0) | (df["RSI_3_1d"] > 15.0))
# 5m & 1h down move, 1h still high
long_entry_logic.append(
(df["RSI_3"] > 5.0) | (df["RSI_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 1h down move
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 3.0))
# 15m & 1h down move, 4h still not low enough
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 5.0) | (df["RSI_14_4h"] < 35.0))
# 15m & 1h down move, 1j still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
)
# 15m & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_4h"] > 30.0) | (df["RSI_14_4h"] < 40.0))
# 15m & 1h & 4h down move
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 15.0))
# 15m & 1h & 4h down move, 15m downtrend
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 20.0) | (df["RSI_3_4h"] > 20.0) | (df["CMF_20_15m"] > -0.20)
)
# 15m & 1h down move, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 1h down move, 15m & 1h downtrend
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 10.0) | (df["CMF_20_15m"] > -0.40) | (df["CMF_20_1h"] > -0.40)
)
# 15m & 1h down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
)
# 15m & 1h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m & 1h down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 25.0) | (df["AROONU_14_1h"] < 80.0))
# 15m & 4h down move, 1h & 4h downtrend
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 10.0) | (df["CMF_20_1h"] > -0.20) | (df["CMF_20_4h"] > -0.20)
)
# 15m & 4h down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 15m & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 10.0) | (df["AROONU_14_4h"] < 40.0))
# 15m & 4h down move, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 15m & 4h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
)
# 15m & 4h down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
)
# 15m & 4h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 40.0) | (df["AROONU_14_4h"] < 80.0))
# 15m & 1h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 20.0) | (df["AROONU_14_4h"] < 40.0))
# 15m & 1h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 25.0) | (df["AROONU_14_4h"] < 70.0))
# 15m & 1h down move, 1h still high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 30.0) | (df["AROONU_14_1h"] < 40.0))
# 15m & 3h down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
)
# 15m & 1h down move, 1h still high
long_entry_logic.append((df["RSI_3_15m"] > 25.0) | (df["RSI_3_1h"] > 25.0) | (df["RSI_14_1h"] < 40.0))
# 15m down move, 15m still not low enough, 1d overbought
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 20.0) | (df["ROC_9_1d"] < 80.0)
)
# 1h & 4h down move
long_entry_logic.append((df["RSI_3_1h"] > 3.0) | (df["RSI_3_4h"] > 10.0))
# 1h & 4h down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 3.0) | (df["RSI_3_4h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 1h & 4h down move
long_entry_logic.append((df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 5.0))
# 1h & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 30.0) | (df["AROONU_14_4h"] < 50.0))
# 1h down move, 1h still high
long_entry_logic.append((df["RSI_3_1h"] > 5.0) | (df["AROONU_14_1h"] < 50.0))
# 1h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 5.0) | (df["AROONU_14_4h"] < 85.0))
# 1h & 4h down move, 1d still high
long_entry_logic.append(
(df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 50.0)
)
# 1h & 1d down move, 1h still moving lower
long_entry_logic.append(
(df["RSI_3_1h"] > 10.0) | (df["RSI_3_1d"] > 15.0) | (df["CCI_20_change_pct_1h"] > -0.0)
)
# 1h & 4h down move, 1h still high
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 15.0) | (df["AROONU_14_1h"] < 50.0))
# 1h & 4h & 1d down move
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 20.0) | (df["RSI_3_1d"] > 30.0))
# 1h & 4h down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
)
# 1h & 4h & 1d down move
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 25.0) | (df["RSI_3_1d"] > 25.0))
# 1h & 1d down move, 1d high
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["RSI_3_1d"] > 25.0) | (df["AROONU_14_1d"] < 70.0))
# 1h & 1d down move, 1d high
long_entry_logic.append(
(df["RSI_3_1h"] > 15.0) | (df["RSI_3_1d"] > 25.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 70.0)
)
# 1h down move, 1h & 4h high
long_entry_logic.append((df["RSI_3_1h"] > 15.0) | (df["AROONU_14_1h"] < 60.0) | (df["AROONU_14_4h"] < 60.0))
# 1h & 4h down move, 1d overbought
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["RSI_3_4h"] > 20.0) | (df["ROC_9_1d"] < 50.0))
# 1h & 4h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 20.0) | (df["RSI_3_4h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 1h & 1d down move, 1d high
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["RSI_3_1d"] > 20.0) | (df["AROONU_14_1d"] < 70.0))
# 1h down move, 1h still high, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["AROONU_14_1h"] < 50.0) | (df["AROONU_14_4h"] < 70.0))
# 1h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0))
# 1h & 4h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 30.0) | (df["RSI_3_4h"] > 45.0) | (df["AROONU_14_4h"] < 80.0))
# 1h & dh down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 30.0) | (df["RSI_3_4h"] > 50.0) | (df["AROONU_14_4h"] < 85.0))
# 4h down move, 15m not low enough, 1h still high
long_entry_logic.append(
(df["RSI_3_4h"] > 3.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 4h down move, 1h downtrend, 1h still not low enough
long_entry_logic.append((df["RSI_3_4h"] > 10.0) | (df["CMF_20_1h"] > -0.25) | (df["AROONU_14_1h"] < 30.0))
# 4h down move, 1h high
long_entry_logic.append((df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0))
# 4h down move, 4h still high, 1d overbought
long_entry_logic.append((df["RSI_3_4h"] > 30.0) | (df["AROONU_14_4h"] < 40.0) | (df["ROC_9_1d"] < 100.0))
# 1d down move, 1h still not low enough
long_entry_logic.append((df["RSI_3_1d"] > 5.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 20.0))
# 1d red, 4h down move, 1h still high
long_entry_logic.append(
(df["change_pct_1d"] > -30.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# pump, drop but not yet near the previous lows
long_entry_logic.append(
(((df["high_max_24_4h"] - df["low_min_24_4h"]) / df["low_min_24_4h"]) < 2.0)
| (df["close"] > (df["high_max_12_4h"] * 0.60))
| (df["close"] < (df["low_min_24_4h"] * 1.10))
)
# pump, drop but not yet near the previous lows
long_entry_logic.append(
(((df["high_max_12_1d"] - df["low_min_12_1d"]) / df["low_min_12_1d"]) < 5.0)
| (df["close"] > (df["high_max_6_1d"] * 0.30))
| (df["close"] < (df["low_min_12_1d"] * 1.25))
)
# big drop in the last hour
long_entry_logic.append(df["close"] > (df["close_max_12"] * 0.50))
# big drop in the last 12 days, 15m & 4h down move
long_entry_logic.append(
(df["close"] > (df["high_max_12_1d"] * 0.40)) | (df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 10.0)
)
# big drop in the last 20 days, 15m & 1h down move
long_entry_logic.append(
(df["close"] > (df["high_max_20_1d"] * 0.40)) | (df["RSI_14_15m"] < 10.0) | (df["RSI_14_1h"] < 10.0)
)
# big drop in the last 20 days, 1d down move
long_entry_logic.append((df["close"] > (df["high_max_20_1d"] * 0.25)) | (df["RSI_3_1d"] > 30.0))
# big drop in the last 20 days, 4h still not low enough
long_entry_logic.append((df["close"] > (df["high_max_20_1d"] * 0.10)) | (df["RSI_14_4h"] < 30.0))
# big drop in the last 30 days, 4h down move
long_entry_logic.append((df["close"] > (df["high_max_30_1d"] * 0.25)) | (df["RSI_3_4h"] > 20.0))
# Logic
long_entry_logic.append(df["RSI_3"] < 40.0)
long_entry_logic.append(df["AROONU_14"] < 25.0)
long_entry_logic.append(df["STOCHRSIk_14_14_3_3"] < 20.0)
long_entry_logic.append(df["AROONU_14_15m"] < 25.0)
long_entry_logic.append(df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
long_entry_logic.append(df["close"] < df["EMA_16"] * 0.975)
long_entry_logic.append(((df["EMA_50"] - df["EMA_200"]) / df["close"] * 100.0) < -5.5)
# Condition #120 - Grind mode (Long).
if long_entry_condition_index == 120:
# Protections
long_entry_logic.append(num_open_long_grind_mode < self.grind_mode_max_slots)
long_entry_logic.append(df["protections_long_global"] == True)
long_entry_logic.append(is_pair_long_grind_mode)
long_entry_logic.append(df["RSI_3"] <= 50.0)
long_entry_logic.append(df["RSI_3_15m"] >= 20.0)
long_entry_logic.append(df["RSI_3_1h"] >= 10.0)
long_entry_logic.append(df["RSI_3_4h"] >= 10.0)
long_entry_logic.append(df["RSI_14_1h"] < 80.0)
long_entry_logic.append(df["RSI_14_4h"] < 80.0)
long_entry_logic.append(df["RSI_14_1d"] < 80.0)
# Logic
long_entry_logic.append(df["STOCHRSIk_14_14_3_3"] < 20.0)
long_entry_logic.append(df["WILLR_14"] < -80.0)
long_entry_logic.append(df["AROONU_14"] < 25.0)
long_entry_logic.append(df["close"] < (df["EMA_20"] * 0.978))
# Condition #141 - Top Coins mode (Long).
if long_entry_condition_index == 141:
# Protections
long_entry_logic.append(is_pair_long_top_coins_mode)
long_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
long_entry_logic.append(df["protections_long_global"] == True)
long_entry_logic.append(df["RSI_14_1h"] < 80.0)
long_entry_logic.append(df["RSI_14_4h"] < 80.0)
long_entry_logic.append(df["RSI_14_1d"] < 90.0)
# 5m & 4h down move
long_entry_logic.append((df["RSI_3"] > 3.0) | (df["RSI_3_4h"] > 10.0))
# 5m down move, 4h high
long_entry_logic.append((df["RSI_3"] > 3.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0))
# 5m & 1h down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3"] > 5.0) | (df["RSI_3_1h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
)
# 5m & 1h down move, 15m still high
long_entry_logic.append((df["RSI_3"] > 5.0) | (df["RSI_3_1h"] > 20.0) | (df["AROONU_14_15m"] < 50.0))
# 5m & 1h down move, 1h still high
long_entry_logic.append((df["RSI_3"] > 5.0) | (df["RSI_3_1h"] > 35.0) | (df["AROONU_14_1h"] < 50.0))
# 15m & 1h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_4h"] > 20.0) | (df["AROONU_14_4h"] < 40.0))
# 15m & 1h down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 30.0) | (df["AROONU_14_1h"] < 80.0))
# 15m & 4h down move, 15m still not low enough
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_4h"] > 15.0) | (df["AROONU_14_15m"] < 30.0))
# 15m down move, 15m still not low enough, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["AROONU_14_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m down move, 1h high, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["AROONU_14_1h"] < 70.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m & 1h & 4h down move, 1d overbought
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 25.0) | (df["RSI_3_4h"] > 35.0) | (df["ROC_9_1d"] < 50.0)
)
# 15m & 1h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 25.0) | (df["AROONU_14_4h"] < 50.0))
# 15m & 1h & 4h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 30.0) | (df["RSI_3_4h"] > 30.0) | (df["AROONU_14_4h"] < 50.0)
)
# 15m & 4h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m & 4h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 4h down move, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 60.0)
)
# 15m & 4h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 30.0) | (df["AROONU_14_4h"] < 70.0))
# 15m & 4h down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 25.0)
)
# 15m & 4h down move, 15m high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 40.0) | (df["AROONU_14_15m"] < 70.0))
# 15m down move, 15m still high 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["AROONU_14_15m"] < 50.0) | (df["AROONU_14_4h"] < 70.0)
)
# 1h & 4h down move, 1h high
long_entry_logic.append(
(df["RSI_3_1h"] > 60.0) | (df["RSI_3_4h"] > 60.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 60.0)
)
# 15m down move, 15m & 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["AROONU_14_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 60.0)
)
# 15m & 4h down move, 15m still high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
)
# 15m down move, 15m & 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["AROONU_14_15m"] < 70.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 1h & 4h & 1d down move
long_entry_logic.append((df["RSI_3_1h"] > 3.0) | (df["RSI_3_4h"] > 15.0) | (df["RSI_3_1d"] > 25.0))
# 1h & 4h down move, 1h still high
long_entry_logic.append((df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 30.0) | (df["AROONU_14_1h"] < 50.0))
# 1h down move, 15m still not low enough, 1h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 5.0) | (df["AROONU_14_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 1h & 4h down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
)
# 1h & 4h down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 10.0) | (df["RSI_3_1d"] > 15.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 1h down move, 1h still high, 4h high
long_entry_logic.append(
(df["RSI_3_1h"] > 15.0) | (df["AROONU_14_1h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 4h down move, 15m still not low enough, 4h still not low enough
long_entry_logic.append((df["RSI_3_4h"] > 10.0) | (df["AROONU_14_15m"] < 30.0) | (df["AROONU_14_4h"] < 20.0))
# 4h down move, 15m still not low enough, 4h still high
long_entry_logic.append(
(df["RSI_3_4h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0) | (df["AROONU_14_4h"] < 40.0)
)
# 15m & 1h & 4h high
long_entry_logic.append(
(df["AROONU_14_15m"] < 70.0) | (df["AROONU_14_1h"] < 90.0) | (df["AROONU_14_4h"] < 90.0)
)
# Logic
long_entry_logic.append(df["RSI_20"] < df["RSI_20"].shift(1))
long_entry_logic.append(df["RSI_3"] < 30.0)
long_entry_logic.append(df["AROONU_14"] < 25.0)
long_entry_logic.append(df["close"] < df["SMA_16"] * 0.956)
# Condition #142 - Top Coins mode (Long).
if long_entry_condition_index == 142:
# Protections
long_entry_logic.append(is_pair_long_top_coins_mode)
long_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
long_entry_logic.append(df["protections_long_global"] == True)
# 5m & 15m down move, 4h high
long_entry_logic.append(
(df["RSI_3"] > 3.0) | (df["RSI_3_15m"] > 5.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
)
# 5m & 4h down move
long_entry_logic.append((df["RSI_3"] > 3.0) | (df["RSI_3_4h"] > 10.0))
# 5m & 1h & 4h down move
long_entry_logic.append((df["RSI_3"] > 5.0) | (df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 20.0))
# 5m & 1h down move, 1h still high
long_entry_logic.append((df["RSI_3"] > 5.0) | (df["RSI_3_1h"] > 35.0) | (df["AROONU_14_1h"] < 50.0))
# 15m & 1h down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
)
# 15m & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_4h"] > 20.0) | (df["AROONU_14_4h"] < 40.0))
# 15m & 1h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 25.0) | (df["AROONU_14_4h"] < 50.0))
# 15m & 1h down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 30.0) | (df["AROONU_14_1h"] < 80.0))
# 15m & 4h down move, 15m still not low enough
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_4h"] > 15.0) | (df["AROONU_14_15m"] < 30.0))
# 15m & 4h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 1h & 4h down move, 1d overbought
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 25.0) | (df["RSI_3_4h"] > 35.0) | (df["ROC_9_1d"] < 50.0)
)
# 15m & 1h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m & 1h & 4h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 30.0) | (df["RSI_3_4h"] > 30.0) | (df["AROONU_14_4h"] < 50.0)
)
# 15m & 1h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 55.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 60.0)
)
# 15m & 4h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m & 4h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 4h down move, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 15m down move, 15m still not low enough, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["AROONU_14_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m down move, 15m still not low enough, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["AROONU_14_15m"] < 30.0) | (df["AROONU_14_4h"] < 60.0)
)
# 15m & 1h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 4h down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 25.0)
)
# 15m & 4h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 4h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 35.0) | (df["AROONU_14_4h"] < 60.0))
# 15m & 4h down move, 15m high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 40.0) | (df["AROONU_14_15m"] < 70.0))
# 15m & 4h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 45.0) | (df["AROONU_14_4h"] < 85.0))
# 15m & 4h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 45.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m down move, 15m still not low enough, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m down move, 15m & 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 1h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["RSI_3_1h"] > 35.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m & 4h down move, 15m still high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["RSI_3_4h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
)
# 15m down move, 15m & 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["AROONU_14_15m"] < 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m down move, 15m & 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["AROONU_14_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
)
# 15m down move, 15m still not low enough, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0) | (df["AROONU_14_1h"] < 70.0)
)
# 15m down move, 15m still high, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 30.0) | (df["AROONU_14_15m"] < 50.0) | (df["RSI_14_4h"] < 80.0))
# 15m down move, 15m still high, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 45.0) | (df["AROONU_14_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 85.0)
)
# 1h & 4h & 1d down move
long_entry_logic.append((df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 20.0) | (df["RSI_3_1d"] > 25.0))
# 1h & 4h down move, 4h still not low enough
long_entry_logic.append((df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 10.0) | (df["RSI_14_4h"] < 30.0))
# 1h & 4h down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
)
# 1h & 4h down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 10.0) | (df["RSI_3_1d"] > 15.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 1h & 4h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 1h & 4h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 1h down move, 4h still high, 1d high
long_entry_logic.append(
(df["RSI_3_1h"] > 15.0) | (df["RSI_14_4h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 90.0)
)
# 1h & 4h down move, 15m high
long_entry_logic.append((df["RSI_3_1h"] > 25.0) | (df["RSI_3_4h"] > 30.0) | (df["AROONU_14_15m"] < 70.0))
# 4h & 1d down move, 1h still high
long_entry_logic.append(
(df["RSI_3_4h"] > 5.0) | (df["RSI_3_1d"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 4h down move, 15m still not low enough, 4h still not low enough
long_entry_logic.append((df["RSI_3_4h"] > 10.0) | (df["AROONU_14_15m"] < 30.0) | (df["AROONU_14_4h"] < 20.0))
# 4h down move, 15m still not low enough, 1h still high
long_entry_logic.append(
(df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 4h & 1d down move, 15m still high
long_entry_logic.append(
(df["RSI_3_4h"] > 15.0) | (df["RSI_3_1d"] > 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 40.0)
)
# 4h down move, 15m still not low enough, 4h still high
long_entry_logic.append(
(df["RSI_3_4h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0) | (df["AROONU_14_4h"] < 40.0)
)
# 4h down move, 15m still high, 1h high
long_entry_logic.append(
(df["RSI_3_4h"] > 30.0) | (df["AROONU_14_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
)
# 15m & 1h & 4h high
long_entry_logic.append(
(df["AROONU_14_15m"] < 50.0) | (df["AROONU_14_1h"] < 90.0) | (df["AROONU_14_4h"] < 90.0)
)
# Logic
long_entry_logic.append(df["RSI_4"] < 46.0)
long_entry_logic.append(df["RSI_20"] < df["RSI_20"].shift(1))
long_entry_logic.append(df["close"] < df["SMA_16"] * 0.958)
# Condition #143 - Top Coins mode (Long).
if long_entry_condition_index == 143:
# Protections
long_entry_logic.append(is_pair_long_top_coins_mode)
long_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
long_entry_logic.append(df["protections_long_global"] == True)
long_entry_logic.append(df["RSI_14_1h"] < 80.0)
long_entry_logic.append(df["RSI_14_4h"] < 80.0)
long_entry_logic.append(df["RSI_14_1d"] < 90.0)
# 5m & 4h down move
long_entry_logic.append((df["RSI_3"] > 3.0) | (df["RSI_3_4h"] > 10.0))
# 15m & 1h down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 30.0) | (df["AROONU_14_1h"] < 80.0))
# 5m & 1h down move, 1h still high
long_entry_logic.append((df["RSI_3"] > 5.0) | (df["RSI_3_1h"] > 35.0) | (df["AROONU_14_1h"] < 50.0))
# 15m & 1h & 4h strong downtrend
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 20.0))
# 15m & 1h down move, 1h still not low enough
long_entry_logic.append(
(df["RSI_3_15m"] > 3.0) | (df["RSI_3_1h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 20.0)
)
# 15m & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 3.0) | (df["RSI_3_4h"] > 20.0) | (df["AROONU_14_4h"] < 40.0))
# 15m & 4h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 5.0) | (df["RSI_3_4h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 1h & 4h down move
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 20.0))
# 15m & 1h & 4h down move, 1d overbought
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 25.0) | (df["RSI_3_4h"] > 35.0) | (df["ROC_9_1d"] < 50.0)
)
# 15m & 4h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 30.0) | (df["AROONU_14_4h"] < 70.0))
# 15 & 1h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m down move, 15m & 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 10.0) | (df["AROONU_14_15m"] < 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 1h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m down move, 15m still high 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["AROONU_14_15m"] < 50.0) | (df["AROONU_14_4h"] < 70.0)
)
# 15m & 1h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["RSI_3_1h"] > 35.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 1h & 4h & 1d down move
long_entry_logic.append((df["RSI_3_1h"] > 3.0) | (df["RSI_3_4h"] > 15.0) | (df["RSI_3_1d"] > 25.0))
# 1h & 4h down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 10.0) | (df["RSI_3_1d"] > 15.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 1h & 4h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 4h & 1d down move, 1h still high
long_entry_logic.append((df["RSI_3_4h"] > 10.0) | (df["RSI_3_1d"] > 10.0) | (df["AROONU_14_1h"] < 50.0))
# 4h down move, 1h & 4h downtrend
long_entry_logic.append((df["RSI_3_4h"] > 3.0) | (df["CMF_20_1h"] > -0.20) | (df["CMF_20_4h"] > -0.25))
# Logic
long_entry_logic.append(df["RSI_3"] < 40.0)
long_entry_logic.append(df["STOCHRSIk_14_14_3_3"] < 20.0)
long_entry_logic.append(df["EMA_26"] > df["EMA_12"])
long_entry_logic.append((df["EMA_26"] - df["EMA_12"]) > (df["open"] * 0.020))
long_entry_logic.append((df["EMA_26"].shift() - df["EMA_12"].shift()) > (df["open"] / 100.0))
# Condition #144 - Top Coins mode (Long).
if long_entry_condition_index == 144:
# Protections
long_entry_logic.append(is_pair_long_top_coins_mode)
long_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
long_entry_logic.append(df["protections_long_global"] == True)
long_entry_logic.append(df["RSI_14_1h"] < 80.0)
long_entry_logic.append(df["RSI_14_4h"] < 80.0)
long_entry_logic.append(df["RSI_14_1d"] < 80.0)
# 5m & 1h down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3"] > 3.0) | (df["RSI_3_1h"] > 15.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
)
# 15m & 1h & 4h down move
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 30.0) | (df["RSI_3_4h"] > 40.0))
# 5m & 1h down move, 1h still high
long_entry_logic.append((df["RSI_3"] > 5.0) | (df["RSI_3_1h"] > 35.0) | (df["AROONU_14_1h"] < 50.0))
# 5m & 4h & 1d down move
long_entry_logic.append((df["RSI_3"] > 5.0) | (df["RSI_3_4h"] > 5.0) | (df["RSI_3_1d"] > 10.0))
# 15m & 1h & 4h down move
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_1h"] > 15.0) | (df["RSI_3_4h"] > 30.0))
# 15m & 4h down move, 4h still not low enough
long_entry_logic.append((df["RSI_3_15m"] > 5.0) | (df["RSI_3_4h"] > 15.0) | (df["AROONU_14_4h"] < 30.0))
# 15m & 1h & 4h down move
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 10.0) | (df["RSI_3_4h"] > 10.0))
# 15m & 1h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 10.0) | (df["AROONU_14_4h"] < 70.0))
# 15m & 1h down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 20.0) | (df["AROONU_14_1h"] < 70.0))
# 15m down move, 15m still high 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 15.0) | (df["AROONU_14_15m"] < 50.0) | (df["AROONU_14_4h"] < 70.0)
)
# 1h & 4h down move, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_1h"] > 10.0) | (df["RSI_3_1d"] > 15.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 1h & 4h & 1d down move, 4h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 20.0) | (df["RSI_3_4h"] > 20.0) | (df["RSI_3_1d"] > 35.0) | (df["AROONU_14_4h"] < 40.0)
)
# 1h & 4h down move, 4h high
long_entry_logic.append(
(df["RSI_3_1h"] > 20.0) | (df["RSI_3_4h"] > 60.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 85.0)
)
# 1h & 4h down move, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 45.0) | (df["AROONU_14_1h"] < 60.0) | (df["AROONU_14_4h"] < 90.0))
# 4h & 1d down move, 15m still not low enough
long_entry_logic.append(
(df["RSI_3_4h"] > 5.0) | (df["RSI_3_1d"] > 15.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 20.0)
)
# Logic
long_entry_logic.append(df["WILLR_14"] < -50.0)
long_entry_logic.append(df["STOCHRSIk_14_14_3_3"] < 30.0)
long_entry_logic.append(df["STOCHRSIk_14_14_3_3_15m"] < 30.0)
long_entry_logic.append(df["STOCHRSIk_14_14_3_3_1h"] < 30.0)
long_entry_logic.append(df["BBB_20_2.0_1h"] > 12.0)
long_entry_logic.append(df["close_max_48"] >= (df["close"] * 1.10))
# Condition #161 - Scalp mode (Long).
if long_entry_condition_index == 161:
# Protections
long_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
long_entry_logic.append(df["protections_long_global"] == True)
# 5m down move, 15m high
long_entry_logic.append((df["RSI_3"] > 15.0) | (df["AROONU_14_15m"] < 80.0))
# 15m & 1h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 25.0) | (df["RSI_3_1h"] > 35.0) | (df["AROONU_14_4h"] < 70.0))
# 15m & 4h down move, 4h still high
long_entry_logic.append((df["RSI_3_15m"] > 25.0) | (df["RSI_3_4h"] > 50.0) | (df["AROONU_14_4h"] < 50.0))
# 15m down move, 15m high
long_entry_logic.append((df["RSI_3_15m"] > 25.0) | (df["AROONU_14_15m"] < 80.0))
# 15m down move, 4h still high, 1d high
long_entry_logic.append(
(df["RSI_3_15m"] > 25.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0) | (df["AROONU_14_1d"] < 90.0)
)
# 15m & 1h down move, 15m still high
long_entry_logic.append((df["RSI_3_15m"] > 30.0) | (df["RSI_3_1h"] > 60.0) | (df["AROONU_14_15m"] < 50.0))
# 15m down move, 15m & 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 30.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m & 4h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 35.0) | (df["RSI_3_4h"] > 60.0) | (df["AROONU_14_4h"] < 80.0))
# 15m & 1h down move, 1h high
long_entry_logic.append((df["RSI_3_15m"] > 40.0) | (df["RSI_3_1h"] > 40.0) | (df["AROONU_14_1h"] < 70.0))
# 15m & 1h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 40.0) | (df["RSI_3_1h"] > 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m & 1h down move, 4h high
long_entry_logic.append((df["RSI_3_15m"] > 40.0) | (df["RSI_3_1h"] > 60.0) | (df["AROONU_14_4h"] < 80.0))
# 15m & 4h down move, 15m high
long_entry_logic.append(
(df["RSI_3_15m"] > 40.0) | (df["RSI_3_4h"] > 40.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0)
)
# 15m & 4h down move, 15m high
long_entry_logic.append(
(df["RSI_3_15m"] > 40.0) | (df["RSI_3_4h"] > 60.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 70.0)
)
# 15m down move, 15m & 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 40.0) | (df["AROONU_14_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m down move, 15m & 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 40.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m down move, 4h still high, 1d overbought
long_entry_logic.append((df["RSI_3_15m"] > 40.0) | (df["AROONU_14_4h"] < 50.0) | (df["ROC_9_1d"] < 100.0))
# 15m & 1h down move, 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 45.0) | (df["RSI_3_1h"] > 45.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m down move, 15m high, 1d overbought
long_entry_logic.append((df["RSI_3_15m"] > 45.0) | (df["AROONU_14_15m"] < 60.0) | (df["ROC_9_1d"] < 50.0))
# 15m down move, 15m high, 4h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 45.0) | (df["AROONU_14_15m"] < 70.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m down move, 15m & 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 45.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 45.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 15m down move, 15m still not low enough, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 50.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 15m down move, 15m still high, 1d overbought
long_entry_logic.append((df["RSI_3_15m"] > 50.0) | (df["AROONU_14_15m"] < 50.0) | (df["ROC_9_1d"] < 50.0))
# 15m down move, 15m still high, 1h high
long_entry_logic.append(
(df["RSI_3_15m"] > 55.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 15m down move, 15m still high, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 55.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0) | (df["AROONU_14_4h"] < 85.0)
)
# 15m down move, 15m & 1h still high
long_entry_logic.append(
(df["RSI_3_15m"] > 55.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 1h down move, 4h still high, 1d high
long_entry_logic.append(
(df["RSI_3_1h"] > 25.0) | (df["AROONU_14_4h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 90.0)
)
# 1h & 4h down move, 1h still high
long_entry_logic.append((df["RSI_3_1h"] > 30.0) | (df["RSI_3_4h"] > 65.0) | (df["AROONU_14_1h"] < 50.0))
long_entry_logic.append(
(df["RSI_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 90.0)
)
# 1h & 4h down move, 4h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 35.0) | (df["RSI_3_4h"] > 55.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 1h & 4h down move, 4h high
long_entry_logic.append(
(df["RSI_3_1h"] > 35.0) | (df["RSI_3_4h"] > 60.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
)
# 1h down move, 15m & 1h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 40.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 1h down move, 1h still high, 4h high
long_entry_logic.append(
(df["RSI_3_1h"] > 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 1h down move, 1h high
long_entry_logic.append((df["RSI_3_1h"] > 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 60.0))
# 1h down move, 4h & 1d high
long_entry_logic.append((df["RSI_3_1h"] > 40.0) | (df["AROONU_14_4h"] < 85.0) | (df["AROONU_14_1d"] < 90.0))
# 1h down move, 1h still high, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 45.0) | (df["AROONU_14_1h"] < 50.0) | (df["AROONU_14_4h"] < 90.0))
# 1h down move, 1h high
long_entry_logic.append((df["RSI_3_1h"] > 45.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 60.0))
# 1h & 4h down move, 15m high
long_entry_logic.append((df["RSI_3_1h"] > 50.0) | (df["RSI_3_4h"] > 60.0) | (df["AROONU_14_15m"] < 70.0))
# 1h down move, 15m still high, 4h high
long_entry_logic.append((df["RSI_3_1h"] > 50.0) | (df["AROONU_14_15m"] < 50.0) | (df["AROONU_14_4h"] < 80.0))
# 1h down move, 15m high, 1h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 50.0) | (df["AROONU_14_15m"] < 70.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0)
)
# 1h down move, 15m still high, 4h high
long_entry_logic.append(
(df["RSI_3_1h"] > 50.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 80.0)
)
# 1h down move, 15m & 1h high
long_entry_logic.append(
(df["RSI_3_1h"] > 50.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 60.0) | (df["AROONU_14_1h"] < 60.0)
)
# 1h down move, 1h & 1d high
long_entry_logic.append(
(df["RSI_3_1h"] > 50.0) | (df["AROONU_14_1h"] < 70.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 80.0)
)
# 1h down move, 4h still high, 1d high
long_entry_logic.append(
(df["RSI_3_1h"] > 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 90.0)
)
# 1h down move, 5m up move, 1h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 60.0) | (df["RSI_3"] < 60.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 1h down move, 15m still not low enough, 4h high
long_entry_logic.append(
(df["RSI_3_1h"] > 60.0) | (df["AROONU_14_15m"] < 70.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 1h down move, 15m still not low enough, 1h high
long_entry_logic.append(
(df["RSI_3_1h"] > 60.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0) | (df["AROONU_14_1h"] < 70.0)
)
# 1h down move, 15m still not low enough, 1h high
long_entry_logic.append(
(df["RSI_3_1h"] > 60.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 60.0)
)
# 1h down move, 15m & 4h still high
long_entry_logic.append(
(df["RSI_3_1h"] > 60.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 1h down move, 15m & 1h high
long_entry_logic.append((df["RSI_3_1h"] > 60.0) | (df["AROONU_14_15m"] < 70.0) | (df["AROONU_14_1h"] < 90.0))
# 1h down move, 1h still high, 4h high
long_entry_logic.append(
(df["RSI_3_1h"] > 60.0) | (df["AROONU_14_1h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
)
# 1h down move, 1h high, 4h still high
long_entry_logic.append((df["RSI_3_1h"] > 60.0) | (df["AROONU_14_1h"] < 80.0) | (df["AROONU_14_4h"] < 40.0))
# 1h down move, 1h still high, 4h high
long_entry_logic.append(
(df["RSI_3_1h"] > 60.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0) | (df["AROONU_14_4h"] < 70.0)
)
# 1h down move, 1h & 1d high
long_entry_logic.append(
(df["RSI_3_1h"] > 60.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0) | (df["AROONU_14_1d"] < 90.0)
)
# 1h down move, 4h & 1d high
long_entry_logic.append((df["RSI_3_1h"] > 60.0) | (df["RSI_14_4h"] < 70.0) | (df["RSI_14_1d"] < 80.0))
# 15m & 1h & 4h down move, 4h high
long_entry_logic.append(
(df["RSI_3_15m"] > 50.0) | (df["RSI_3_1h"] > 65.0) | (df["RSI_3_4h"] > 65.0) | (df["AROONU_14_4h"] < 85.0)
)
# 4h down move, 15m high
long_entry_logic.append((df["RSI_3_4h"] > 20.0) | (df["AROONU_14_15m"] < 80.0))
# 4h down move, 1h high
long_entry_logic.append((df["RSI_3_4h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0))
# 4h down move, 15m & 4h still high
long_entry_logic.append((df["RSI_3_4h"] > 30.0) | (df["AROONU_14_15m"] < 50.0) | (df["AROONU_14_4h"] < 50.0))
# 4h down move, 1h & 4h still high
long_entry_logic.append(
(df["RSI_3_4h"] > 35.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0) | (df["AROONU_14_4h"] < 50.0)
)
# 4h down move, 15m & 1h high
long_entry_logic.append(
(df["RSI_3_4h"] > 40.0) | (df["AROONU_14_15m"] < 80.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 4h down move, 15m still high, 1h high
long_entry_logic.append(
(df["RSI_3_4h"] > 40.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
)
# 4h down move, 1h & 4h still high
long_entry_logic.append(
(df["RSI_3_4h"] > 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0) | (df["RSI_14_4h"] < 50.0)
)
# 4h down move, 1h still high, 4h still moving down
long_entry_logic.append(
(df["RSI_3_4h"] > 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0) | (df["CCI_20_change_pct_4h"] > -0.0)
)
# 4h down move, 1h high, 4h still high
long_entry_logic.append((df["RSI_3_4h"] > 45.0) | (df["AROONU_14_1h"] < 70.0) | (df["AROONU_14_4h"] < 50.0))
# 4h down move, 15m high, 4h still high
long_entry_logic.append(
(df["RSI_3_4h"] > 50.0) | (df["AROONU_14_15m"] < 70.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 40.0)
)
# 4h down move, 15m still high, 1h high
long_entry_logic.append(
(df["RSI_3_4h"] > 50.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 4h down move, 15m & 4h still high
long_entry_logic.append(
(df["RSI_3_4h"] > 50.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0) | (df["AROONU_14_4h"] < 50.0)
)
# 4h down move, 15m high, 4h still not low enough
long_entry_logic.append(
(df["RSI_3_4h"] > 50.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 70.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0)
)
# 4h down move, 1h still high, 4h high
long_entry_logic.append(
(df["RSI_3_4h"] > 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0) | (df["AROONU_14_4h"] < 70.0)
)
# 4h down move, 15m & 4h high
long_entry_logic.append((df["RSI_3_4h"] > 60.0) | (df["AROONU_14_15m"] < 70.0) | (df["AROONU_14_4h"] < 70.0))
# 4h down move, 15m high, 4h still high
long_entry_logic.append((df["RSI_3_4h"] > 60.0) | (df["AROONU_14_15m"] < 80.0) | (df["AROONU_14_4h"] < 40.0))
# 4h down move, 15m still high, 1h high
long_entry_logic.append(
(df["RSI_3_4h"] > 60.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0) | (df["AROONU_14_1h"] < 70.0)
)
# 4h down move, 15m still high, 4h high
long_entry_logic.append(
(df["RSI_3_4h"] > 60.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0)
)
# 4h down move, 15m & 4h high
long_entry_logic.append(
(df["RSI_3_4h"] > 60.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 70.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 60.0)
)
# 4h down move, 1h & 4h high
long_entry_logic.append(
(df["RSI_3_4h"] > 60.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0) | (df["AROONU_14_4h"] < 70.0)
)
# 4h down move, 4h still high, 1d high
long_entry_logic.append(
(df["RSI_3_4h"] > 60.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 80.0)
)
# 15m high, 4h high
long_entry_logic.append((df["AROONU_14_15m"] < 70.0) | (df["AROONU_14_4h"] < 85.0))
# 15m high, 4h still high
long_entry_logic.append((df["AROONU_14_15m"] < 80.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0))
# 15m high, 1h still high
long_entry_logic.append((df["STOCHRSIk_14_14_3_3_15m"] < 70.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0))
# 15m & 4h high
long_entry_logic.append((df["STOCHRSIk_14_14_3_3_15m"] < 70.0) | (df["AROONU_14_4h"] < 70.0))
# 15m high, 1h still not low enough
long_entry_logic.append((df["STOCHRSIk_14_14_3_3_15m"] < 80.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 30.0))
# 1d green with top wick, 1d overbought
long_entry_logic.append(
(df["change_pct_1d"] < 25.0) | (df["top_wick_pct_1d"] < 25.0) | (df["ROC_9_1d"] < 50.0)
)
# Logic
long_entry_logic.append(df["RSI_14"] < 50.0)
long_entry_logic.append(df["AROONU_14_15m"] < 90.0)
long_entry_logic.append(df["STOCHRSIk_14_14_3_3_15m"] < 90.0)
long_entry_logic.append(
(df["SMA_21"].shift(1) < df["SMA_200"].shift(1).infer_objects(copy=False).fillna(np.nan))
& df["SMA_200"].shift(1).notna()
)
long_entry_logic.append(
(df["SMA_21"] > df["SMA_200"].infer_objects(copy=False).fillna(np.nan)) & df["SMA_200"].notna()
)
long_entry_logic.append(
(df["close"] > df["EMA_200_1h"].infer_objects(copy=False).fillna(np.nan)) & df["EMA_200_1h"].notna()
)
long_entry_logic.append(
(df["close"] > df["EMA_200_4h"].infer_objects(copy=False).fillna(np.nan)) & df["EMA_200_4h"].notna()
)
long_entry_logic.append(df["BBB_20_2.0"] > 1.5)
long_entry_logic.append(df["BBB_20_2.0_1h"] > 6.0)
# Condition #162 - Scalp mode (Long).
if long_entry_condition_index == 162:
# Protections
long_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
long_entry_logic.append(df["protections_long_global"] == True)
long_entry_logic.append(
(df["RSI_3"] > 5.0) & (df["RSI_3_15m"] > 5.0) & (df["ROC_9_15m"] > -10.0) & (df["ROC_9_1d"] < 200.0)
)
long_entry_logic.append(
# 15m & 1h down move, 4h high
((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0))
# 15m & 4h down move, 1h still high
& ((df["RSI_3_15m"] > 10.0) | (df["RSI_3_4h"] > 40.0) | (df["RSI_14_1h"] < 50.0))
# 15m & 1d down move, 4h high
& ((df["RSI_3_15m"] > 10.0) | (df["RSI_3_1d"] > 20.0) | (df["AROONU_14_4h"] < 90.0))
# 15m down move, 15m high
& ((df["RSI_3_15m"] > 10.0) | (df["AROONU_14_15m"] < 70.0))
# 15m & 1h down move, 15m still not low enough
& ((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0))
# 15m & 1h down nove, 1h still high
& ((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0))
# 15m & 1h down move, 4h high
& ((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 30.0) | (df["AROONU_14_4h"] < 100.0))
# 15m & 1h down move, 4h high
& ((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 35.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0))
# 15m & 1h down move, 1h high
& ((df["RSI_3_15m"] > 20.0) | (df["RSI_3_1h"] > 25.0) | (df["AROONU_14_1h"] < 70.0))
# 15m down move, 4h high & overbought
& ((df["RSI_3_15m"] > 20.0) | (df["AROONU_14_4h"] < 70.0) | (df["ROC_9_4h"] < 50.0))
# 15m & 1h down move, 4h high
& ((df["RSI_3_15m"] > 25.0) | (df["RSI_3_1h"] > 25.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0))
# 15m down move, 15m high, 1d overbought
& ((df["RSI_3_15m"] > 25.0) | (df["AROONU_14_15m"] < 60.0) | (df["ROC_9_1d"] < 150.0))
# 15m down move, 1h & 4h high
& ((df["RSI_3_15m"] > 35.0) | (df["AROONU_14_1h"] < 80.0) | (df["RSI_14_4h"] < 80.0))
# 1h & 4h down move, 1h still high
& ((df["RSI_3_1h"] > 3.0) | (df["RSI_3_4h"] > 25.0) | (df["AROONU_14_1h"] < 40.0))
# 1h & 4h down move, 4h high
& ((df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 20.0) | (df["AROONU_14_4h"] < 60.0))
# 1h & 4h down move, 4h high
& ((df["RSI_3_1h"] > 5.0) | (df["RSI_3_4h"] > 30.0) | (df["AROONU_14_4h"] < 90.0))
# 1h down move, 1h high, 1d overbought
& ((df["RSI_3_1h"] > 25.0) | (df["AROONU_14_1h"] < 60.0) | (df["ROC_9_1d"] < 100.0))
# 1h down move, 1h high
& ((df["RSI_3_1h"] > 25.0) | (df["AROONU_14_1h"] < 90.0))
# 1h & 4h down move, 4h high
& ((df["RSI_3_1h"] > 30.0) | (df["RSI_3_4h"] > 35.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0))
# 1h down move, 1h high, 4h overbought
& ((df["RSI_3_1h"] > 30.0) | (df["AROONU_14_1h"] < 60.0) | (df["ROC_9_4h"] < 50.0))
# 1h down move, 4h high, 1d overbought
& ((df["RSI_3_1h"] > 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0) | (df["ROC_9_1d"] < 150.0))
# 4h & 1d down move
& ((df["RSI_3_4h"] > 5.0) | (df["RSI_3_1d"] > 10.0))
# 4h & 1d down move, 4h still not low enough
& ((df["RSI_3_4h"] > 20.0) | (df["RSI_3_1d"] > 20.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 30.0))
# 1d down move, 1h high
& ((df["RSI_3_1d"] > 3.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0))
# 1d down move, 15m still high
& ((df["RSI_3_1d"] > 3.0) | (df["AROONU_14_15m"] < 50.0))
# 1d down move, 15m still high, 1h high
& ((df["RSI_3_1d"] > 10.0) | (df["AROONU_14_15m"] < 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0))
# 1d down move, 1h & 4h high
& ((df["RSI_3_1d"] > 10.0) | (df["AROONU_14_1h"] < 70.0) | (df["AROONU_14_4h"] < 90.0))
# 1d down move, 4h high
& ((df["RSI_3_1d"] > 20.0) | (df["RSI_14_4h"] < 80.0))
# 1h P&D, 1h down move
& ((df["change_pct_1h"] > -10.0) | (df["change_pct_1h"].shift(12) < 10.0) | (df["RSI_3_1h"] > 50.0))
# 4h P&D, 4h high
& ((df["change_pct_4h"] > -15.0) | (df["change_pct_4h"].shift(48) < 30.0) | (df["AROONU_14_4h"] < 90.0))
# 4h green, 15m & 1h down move
& ((df["change_pct_4h"] < 10.0) | (df["RSI_3_15m"] > 10.0) | (df["RSI_3_1h"] > 35.0))
# 4h green, 1h down move
& ((df["change_pct_4h"] < 40.0) | (df["RSI_3_1h"] > 50.0))
# 4h green with top wick
& ((df["change_pct_4h"] < 50.0) | (df["change_pct_4h"] < 50.0))
# 1d green with top wick, 15m still high
& ((df["change_pct_1d"] < 10.0) | (df["top_wick_pct_1d"] < 8.0) | (df["AROONU_14_15m"] < 50.0))
# 1d green, 4h down move, 4h still high
& ((df["change_pct_1d"] < 40.0) | (df["RSI_3_4h"] > 35.0) | (df["AROONU_14_4h"] < 50.0))
# 1d green with top wick, 4h down move
& ((df["change_pct_1d"] < 40.0) | (df["top_wick_pct_1d"] < 8.0) | (df["RSI_3_4h"] > 55.0))
# 1d top wick, 4h still high
& ((df["top_wick_pct_1d"] < 50.0) | (df["AROONU_14_4h"] < 50.0))
# big drop in last 4 days, 1d down move
& ((df["close"] > (df["high_max_24_4h"] * 0.20)) | (df["RSI_3_1d"] > 20.0))
# big drop in the last 20 days, 4h down move
& ((df["close"] > (df["high_max_20_1d"] * 0.15)) | (df["RSI_3_4h"] > 20.0))
# big drop in the last 20 days, 1d down move
& ((df["close"] > (df["high_max_20_1d"] * 0.05)) | (df["RSI_3_1d"] > 20.0))
# big drop in the last 20 days, 1h still high
& ((df["close"] > (df["high_max_20_1d"] * 0.05)) | (df["STOCHRSIk_14_14_3_3_1h"] < 45.0))
# big drop in the last 20 days, 4h high
& ((df["close"] > (df["high_max_20_1d"] * 0.05)) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0))
)
# Logic
long_entry_logic.append(
(df["AROONU_14"] < 25.0)
& (df["AROOND_14"] > 75.0)
& (df["STOCHRSIk_14_14_3_3"] < 30.0)
& (df["EMA_26"] > df["EMA_12"])
& ((df["EMA_26"] - df["EMA_12"]) > (df["open"] * 0.030))
& ((df["EMA_26"].shift() - df["EMA_12"].shift()) > (df["open"] / 100.0))
& (df["close"] < df["SMA_9"])
)
# Condition #163 - Scalp mode (Long).
if long_entry_condition_index == 163:
# Protections
long_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
long_entry_logic.append(df["protections_long_global"] == True)
long_entry_logic.append((df["RSI_3"] > 10.0) & (df["RSI_3_15m"] > 10.0) & (df["RSI_3_1h"] > 20.0))
long_entry_logic.append(
# 5m & 15m & 4h down mnove, 4h high
((df["RSI_3"] > 15.0) | (df["RSI_3_15m"] > 20.0) | (df["RSI_3_4h"] > 40.0) | (df["AROONU_14_4h"] < 80.0))
# 5m & 15m & 1d down move, 1h high
& ((df["RSI_3"] > 15.0) | (df["RSI_3_15m"] > 25.0) | (df["RSI_3_1d"] > 25.0) | (df["AROONU_14_1h"] < 90.0))
# 5m & 1h down move, 15m still high, 4h high
& (
(df["RSI_3"] > 20.0) | (df["RSI_3_1h"] > 40.0) | (df["RSI_14_15m"] < 40.0) | (df["AROONU_14_4h"] < 100.0)
)
# 5m & 1h & 15m down move, 1h still not low enough
& ((df["RSI_3"] > 15.0) | (df["RSI_3_1h"] > 30.0) | (df["RSI_3_1d"] > 15.0) | (df["AROONU_14_1h"] < 30.0))
# 15m & 4h down move, 4h high
& ((df["RSI_3"] > 15.0) | (df["RSI_3_4h"] > 35.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0))
# 5m & 4h down move, 15m high
& ((df["RSI_3"] > 15.0) | (df["RSI_3_4h"] > 45.0) | (df["AROONU_14_15m"] < 60.0))
# 15m & 1h down move, 1h high
& ((df["RSI_3_15m"] > 12.0) | (df["RSI_3_1h"] > 40.0) | (df["AROONU_14_1h"] < 100.0))
# 15m & 1h & 4h & 1d down move
& ((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 25.0) | (df["RSI_3_4h"] > 25.0) | (df["RSI_3_1d"] > 25.0))
# 15m & 1h down move, 1h & 4h high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 25.0)
| (df["AROONU_14_1h"] < 75.0)
| (df["AROONU_14_4h"] < 100.0)
)
# 15m & 1h & 4h down move, 1d overbought
& ((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 30.0) | (df["RSI_3_4h"] > 35.0) | (df["ROC_9_1d"] < 40.0))
# 15m & 1h & 4h down move, 1h downtrend, 4h high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 30.0)
| (df["RSI_3_4h"] > 55.0)
| (df["CMF_20_1h"] > -0.10)
| (df["AROONU_14_4h"] < 80.0)
)
# 15m & 1h down move, 15m high
& ((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 30.0) | (df["AROONU_14_15m"] < 60.0))
# 15m & 1h down move, 4h high
& ((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 30.0) | (df["RSI_14_4h"] < 85.0))
# 15m & 1h down move, 15m still high
& ((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 30.0) | (df["AROONU_14_15m"] < 40.0))
# 15m & 1h down move, 1h high
& ((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 30.0) | (df["AROONU_14_1h"] < 80.0))
# 15m & 1h & 4h down move, 4h high
& ((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 35.0) | (df["RSI_3_4h"] > 65.0) | (df["MFI_14_4h"] < 85.0))
# 15m & 1h down move, 15m high
& ((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 35.0) | (df["AROONU_14_15m"] < 70.0))
# 15m & 1h down move, 1h high
& ((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 35.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 85.0))
# 15m & 1h down move, 4h high & overbought
& ((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 45.0) | (df["RSI_14_4h"] < 70.0) | (df["ROC_9_4h"] < 50.0))
# 15m & 4h down move, 15m high
& ((df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] > 30.0) | (df["AROONU_14_15m"] < 60.0))
# 15m down move, 4h & 1d up move, 1d downtrend
& ((df["RSI_3_15m"] > 15.0) | (df["RSI_3_4h"] < 90.0) | (df["RSI_3_1d"] < 80.0) | (df["CMF_20_1d"] > -0.2))
# 15m & 1d down move, 4h high
& ((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1d"] > 10.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 70.0))
# 15m & 1d down move, 1d overbought
& ((df["RSI_3_15m"] > 15.0) | (df["RSI_3_1d"] > 40.0) | (df["ROC_9_1d"] < 50.0))
# 15m down move, 15m still not low enough, 4h high
& (
(df["RSI_3_15m"] > 15.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0)
)
# 15m down move, 15m & 1h high
& (
(df["RSI_3_15m"] > 15.0) | (df["STOCHRSIk_14_14_3_3_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0)
)
# 15m down move, 1h high, 1d overbought
& ((df["RSI_3_15m"] > 15.0) | (df["AROONU_14_1h"] < 90.0) | (df["ROC_9_1d"] < 80.0))
# 15m down move, 1h high, 1d overbought
& ((df["RSI_3_15m"] > 15.0) | (df["AROONU_14_1h"] < 100.0) | (df["ROC_9_1d"] < 40.0))
# 15m & 1h & 1d down move, 15m high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 35.0)
| (df["RSI_3_1d"] > 40.0)
| (df["AROONU_14_15m"] < 60.0)
)
# 15m & 1h down move, 15m still not low enough, 1h & 4h high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1h"] > 40.0)
| (df["AROONU_14_15m"] < 30.0)
| (df["AROONU_14_1h"] < 80.0)
| (df["AROONU_14_4h"] < 80.0)
)
# 15m & 1h down move, 1h & 4h still high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_3_1d"] > 15.0)
| (df["AROONU_14_1h"] < 50.0)
| (df["AROONU_14_4h"] < 50.0)
)
# 15m down move, 1h high, 1d overbought
& ((df["RSI_3_15m"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 70.0) | (df["ROC_9_1d"] < 150.0))
# 15m down move, 1h high & overbought
& ((df["RSI_3_15m"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0) | (df["ROC_9_1h"] < 20.0))
# 15m down move, 1h high, 1d overbought
& ((df["RSI_3_15m"] > 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0) | (df["ROC_9_1d"] < 100.0))
# 15m down move, 4h high
& (
(df["RSI_3_15m"] > 15.0)
| (df["RSI_14_4h"] < 70.0)
| (df["STOCHRSIk_14_14_3_3_4h"] < 90.0)
| (df["EMA_9"] < (df["EMA_26"] * 0.972))
)
# 15m down move, 4h high and downtrend
& ((df["RSI_3_15m"] > 15.0) | (df["CMF_20_4h"] > -0.2) | (df["AROONU_14_4h"] < 80.0))
# 15m & 4h down move, 15m high
& ((df["RSI_3_15m"] > 20.0) | (df["RSI_3_4h"] > 25.0) | (df["AROONU_14_15m"] < 60.0))
# 15m & 1h down move, 1h downtrend, 1h downtrend, 15m still high, 1h high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_3_1h"] > 35.0)
| (df["CMF_20_1h"] > -0.10)
| (df["AROONU_14_15m"] < 40.0)
| (df["AROONU_14_1h"] < 85.0)
)
# 15m & 1h down move, 4h high & overbought
& ((df["RSI_3_15m"] > 20.0) | (df["RSI_3_1h"] > 45.0) | (df["RSI_14_4h"] < 70.0) | (df["ROC_9_4h"] < 50.0))
# 15m down move, 15m still high, 4h high
& (
(df["RSI_3_15m"] > 20.0)
| (df["RSI_14_15m"] < 40.0)
| (df["RSI_14_4h"] < 75.0)
| (df["AROONU_14_4h"] < 100.0)
)
# 15m down move, 1h & 4h high, 1f overbought
& (
(df["RSI_3_15m"] > 20.0)
| (df["AROONU_14_1h"] < 85.0)
| (df["RSI_14_4h"] < 70.0)
| (df["ROC_9_1d"] < 80.0)
)
# 15m down move, 4h downtrend, 4h overbought
& ((df["RSI_3_15m"] > 20.0) | (df["CMF_20_4h"] > -0.0) | (df["ROC_9_4h"] < 40.0))
# 15m & 1h down move, 15m still not low enough, 1h & 4h high
& (
(df["RSI_3_15m"] > 30.0)
| (df["RSI_3_1h"] > 45.0)
| (df["RSI_14_15m"] < 30.0)
| (df["RSI_14_1h"] < 50.0)
| (df["RSI_14_4h"] < 70.0)
| (df["AROONU_14_15m"] < 20.0)
| (df["AROONU_14_1h"] < 60.0)
| (df["AROONU_14_4h"] < 100.0)
)
# 15m & 4h down move, 4h overbought
& ((df["RSI_3_15m"] > 30.0) | (df["RSI_3_4h"] > 60.0) | (df["ROC_9_4h"] < 60.0))
# 1h & 1d down move, 1d high
& ((df["RSI_3_1h"] > 25.0) | (df["RSI_3_1d"] > 30.0) | (df["AROONU_14_1d"] < 90.0))
# 1h down move, 15m downtrend, 4h still high
& ((df["RSI_3_1h"] > 25.0) | (df["CMF_20_15m"] > -0.4) | (df["AROONU_14_4h"] < 50.0))
# 1h down move, 4h downtrend, 4h high
& ((df["RSI_3_1h"] > 25.0) | (df["CMF_20_4h"] > -0.25) | (df["AROONU_14_4h"] < 70.0))
# 1h down move, 1h high, 1d downtrend
& ((df["RSI_3_1h"] > 25.0) | (df["AROONU_14_1h"] < 90.0) | (df["CMF_20_1d"] > -0.2))
# 1h down move, 15m & 4h high
& ((df["RSI_3_1h"] > 30.0) | (df["AROONU_14_15m"] < 60.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 95.0))
# 1h down move, 1h high
& ((df["RSI_3_1h"] > 30.0) | (df["MFI_14_1h"] < 80.0) | (df["AROONU_14_1h"] < 90.0))
# 1h down move, 1h & 4h high
& ((df["RSI_3_1h"] > 30.0) | (df["AROONU_14_1h"] < 80.0) | (df["AROONU_14_4h"] < 100.0))
# 1h down move, 1h high, 1d downtrend
& ((df["RSI_3_1h"] > 30.0) | (df["AROONU_14_1h"] < 90.0) | (df["CMF_20_1d"] > -0.2))
# 1h down move, 1h highm 1d overbought
& ((df["RSI_3_1h"] > 30.0) | (df["AROONU_14_1h"] < 90.0) | (df["ROC_9_1d"] < 40.0))
# 1h & 4h down move, 1h still high, 4h high
& ((df["RSI_3_1h"] > 35.0) | (df["RSI_3_4h"] > 60.0) | (df["RSI_14_1h"] < 50.0) | (df["RSI_14_4h"] < 70.0))
# 1h down move, 1h high, 4h & 1d overbought
& (
(df["RSI_3_1h"] > 35.0) | (df["AROONU_14_1h"] < 70.0) | (df["ROC_9_4h"] < 40.0) | (df["ROC_9_1d"] < 40.0)
)
# 1h down move, 1h high, 4h overbought
& ((df["RSI_3_1h"] > 40.0) | (df["AROONU_14_1h"] < 70.0) | (df["ROC_9_4h"] < 40.0))
# 1h down move, 1h & 4h high
& ((df["RSI_3_1h"] > 40.0) | (df["AROONU_14_1h"] < 80.0) | (df["AROONU_14_4h"] < 80.0))
# 1h & 4h down move, 1h & 4h high
& (
(df["RSI_3_1h"] > 50.0)
| (df["RSI_3_4h"] > 65.0)
| (df["AROONU_14_1h"] < 85.0)
| (df["AROONU_14_4h"] < 100.0)
)
# 1h down move, 15m & 1h high
& ((df["RSI_3_1h"] > 50.0) | (df["AROONU_14_15m"] < 60.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0))
# 1h down move, 15m & 1h high, 1d downtrend
& (
(df["RSI_3_1h"] > 60.0)
| (df["AROONU_14_15m"] < 65.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
| (df["CMF_20_1d"] > -0.0)
)
# 4h down move, 15m high
& ((df["RSI_3_4h"] > 3.0) | (df["AROONU_14_15m"] < 50.0))
# 4h down move, 15m still not low enough, 4h downtrend
& ((df["RSI_3_4h"] > 10.0) | (df["AROONU_14_15m"] < 30.0) | (df["CMF_20_4h"] > -0.30))
# 4h down move, 15m & 1h still not low enough
& ((df["RSI_3_4h"] > 10.0) | (df["AROONU_14_15m"] < 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 25.0))
# 4h down move, 1h still high, 4h downtrend
& ((df["RSI_3_4h"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0) | (df["CMF_20_4h"] > -0.3))
# 4h & 1d down move, 1h & 4h low
& ((df["RSI_3_4h"] > 25.0) | (df["RSI_3_1d"] > 25.0) | (df["CMF_20_1h"] > -0.3) | (df["CMF_20_4h"] > -0.4))
# 4h down move, 4h high & overbought
& ((df["RSI_3_4h"] > 50.0) | (df["AROONU_14_4h"] < 85.0) | (df["ROC_9_4h"] < 10.0))
# 4h down move, 15m still high, 1d overbought
& ((df["RSI_3_4h"] > 55.0) | (df["AROONU_14_15m"] < 40.0) | (df["ROC_9_1d"] < 100.0))
# 4h & 1d down move, 4h high, 1d overbought
& (
(df["RSI_3_4h"] > 60.0) | (df["RSI_3_1d"] > 60.0) | (df["AROONU_14_4h"] < 75.0) | (df["ROC_9_1d"] < 40.0)
)
# 1d down move, 1h high
& ((df["RSI_3_1d"] > 5.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0))
# 1d down move, 15m & 1h still high
& ((df["RSI_3_1d"] > 10.0) | (df["RSI_14_15m"] < 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 50.0))
# 1d down move, 1h & 4h high
& ((df["RSI_3_1d"] > 10.0) | (df["AROONU_14_1h"] < 80.0) | (df["AROONU_14_4h"] < 90.0))
# 1d down move, 1h & 4h still high
& ((df["RSI_3_1d"] > 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 40.0) | (df["AROONU_14_4h"] < 40.0))
# 1d down move, 1h high, 1d overbought
& ((df["RSI_3_1d"] > 60.0) | (df["AROONU_14_1h"] < 80.0) | (df["ROC_9_1d"] < 80.0))
# 1d down move, 15m still high, 1d overbought
& ((df["RSI_3_1d"] > 65.0) | (df["AROONU_14_15m"] < 40.0) | (df["ROC_9_1d"] < 100.0))
# 5m still high, 1h down move, 15m still high, 1h high
& (
(df["RSI_3"] < 40.0)
| (df["RSI_3_1h"] > 30.0)
| (df["AROONU_14_15m"] < 50.0)
| (df["AROONU_14_4h"] < 90.0)
)
# 5m still high, 15m high
& ((df["RSI_3"] < 45.0) | (df["AROONU_14_15m"] < 70.0))
# 5m still high, 1h down move, 4h high
& ((df["RSI_3"] < 50.0) | (df["RSI_3_1h"] > 30.0) | (df["AROONU_14_4h"] < 100.0))
# 15m down move, 1h high
& ((df["RSI_14_15m"] > 25.0) | (df["STOCHRSIk_14_14_3_3_1h"] < 80.0))
# 15m down move, 4h & 1d high
& (
(df["RSI_14_15m"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1d"] < 70.0)
)
# 1h downtrend, 4h high, 1d downtrend
& ((df["CMF_20_1h"] > -0.2) | (df["STOCHRSIk_14_14_3_3_4h"] < 90.0) | (df["CMF_20_1d"] > -0.25))
# 4h top wick, 15m & 1h down move
& ((df["top_wick_pct_4h"] < 10.0) | (df["RSI_3_15m"] > 15.0) | (df["RSI_3_1h"] > 40.0))
# 4h top wick, 1h down move, 1h high
& ((df["top_wick_pct_4h"] < 10.0) | (df["RSI_3_1h"] > 30.0) | (df["AROONU_14_1h"] < 70.0))
# 1d red, 1h down move, 1h still high
& ((df["change_pct_1d"] > -15.0) | (df["RSI_3_1h"] > 25.0) | (df["AROONU_14_1h"] < 50.0))
# 1d P&D, 1h high
& (
(df["change_pct_1d"] > -15.0)
| (df["change_pct_1d"].shift(288) < 15.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 80.0)
)
# 1d P&D, 1d downtrend
& ((df["change_pct_1d"] > -5.0) | (df["change_pct_1d"].shift(288) < 30.0) | (df["CMF_20_1d"] > -0.1))
# 1d P&D, 15m high
& ((df["change_pct_1d"] > -10.0) | (df["change_pct_1d"].shift(288) < 40.0) | (df["AROONU_14_15m"] < 50.0))
# 1d P&D, 1h high
& (
(df["change_pct_1d"] > -10.0)
| (df["change_pct_1d"].shift(288) < 40.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 70.0)
)
# 1d red with top wick, 1h high
& ((df["change_pct_1d"] > -10.0) | (df["top_wick_pct_1d"] < 10.0) | (df["AROONU_14_1h"] < 80.0))
# 1d green, 4m down move, 4h high
& ((df["change_pct_1d"] < 25.0) | (df["RSI_3_4h"] > 50.0) | (df["AROONU_14_4h"] < 80.0))
# 1d green with top wick, 1d low
& ((df["change_pct_1d"] < 25.0) | (df["top_wick_pct_1d"] < 10.0) | (df["CMF_20_1d"] > -0.2))
# 1d top wick, 1h still high
& ((df["top_wick_pct_1d"] < 25.0) | (df["AROONU_14_1h"] < 50.0))
# 1d top wick, 4h still high
& ((df["top_wick_pct_1d"] < 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 50.0))
# 1d top wick, 1h down move
& ((df["top_wick_pct_1d"] < 50.0) | (df["RSI_3_1h"] > 30.0))
# big drop in the last 12 days, 1h down move, 1h high
& ((df["close"] > (df["high_max_12_1d"] * 0.35)) | (df["RSI_3_1h"] > 35.0) | (df["AROONU_14_1h"] < 70.0))
# big drop in the last 20 days, 1h down move, 1h high
& (
(df["close"] > (df["high_max_20_1d"] * 0.30))
| (df["RSI_3_1h"] > 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] < 75.0)
)
)
# Logic
long_entry_logic.append(
(df["RSI_14"] < 30.0)
& (df["AROONU_14"] < 25.0)
& (df["AROOND_14"] > 75.0)
& (df["STOCHRSIk_14_14_3_3"] < 20.0)
& (df["EMA_9"] < (df["EMA_26"] * 0.982))
& (df["close"] < df["SMA_9"])
)
###############################################################################################
# LONG ENTRY CONDITIONS ENDS HERE
###############################################################################################
long_entry_logic.append(df["volume"] > 0)
item_long_entry = reduce(lambda x, y: x & y, long_entry_logic)
df.loc[item_long_entry, "enter_tag"] += f"{long_entry_condition_index} "
long_entry_conditions.append(item_long_entry)
df.loc[:, "enter_long"] = item_long_entry
if long_entry_conditions:
df.loc[:, "enter_long"] = reduce(lambda x, y: x | y, long_entry_conditions)
###############################################################################################
# SHORT ENTRY CONDITIONS STARTS HERE
###############################################################################################
# ______ __ __ ______ _______ ________ ________ __ __ ________ ________ _______
# / \| \ | \/ \| | \ | | \ | | | | \
# | $$$$$$| $$ | $| $$$$$$| $$$$$$$\$$$$$$$$ | $$$$$$$| $$\ | $$\$$$$$$$| $$$$$$$| $$$$$$$\
# | $$___\$| $$__| $| $$ | $| $$__| $$ | $$ | $$__ | $$$\| $$ | $$ | $$__ | $$__| $$
# \$$ \| $$ $| $$ | $| $$ $$ | $$ | $$ \ | $$$$\ $$ | $$ | $$ \ | $$ $$
# _\$$$$$$| $$$$$$$| $$ | $| $$$$$$$\ | $$ | $$$$$ | $$\$$ $$ | $$ | $$$$$ | $$$$$$$\
# | \__| $| $$ | $| $$__/ $| $$ | $$ | $$ | $$_____| $$ \$$$$ | $$ | $$_____| $$ | $$
# \$$ $| $$ | $$\$$ $| $$ | $$ | $$ | $$ | $$ \$$$ | $$ | $$ | $$ | $$
# \$$$$$$ \$$ \$$ \$$$$$$ \$$ \$$ \$$ \$$$$$$$$\$$ \$$ \$$ \$$$$$$$$\$$ \$$
#
for enabled_short_entry_signal in self.short_entry_signal_params:
short_entry_condition_index = int(enabled_short_entry_signal.split("_")[3])
item_short_buy_protection_list = [True]
if self.short_entry_signal_params[f"{enabled_short_entry_signal}"]:
# Short Entry Conditions Starts Here
# -----------------------------------------------------------------------------------------
# IMPORTANT: Short Condition Descriptions are not for shorts. These are for longs but completely mirrored opposite side
# Please dont change these comment descriptions. With these descriptions we are comparing long/short positions.
short_entry_logic = []
short_entry_logic.append(reduce(lambda x, y: x & y, item_short_buy_protection_list))
# Condition #501 - Normal mode (Short).
if short_entry_condition_index == 501:
# Protections
short_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
short_entry_logic.append(df["protections_short_global"] == True)
short_entry_logic.append(df["global_protections_short_pump"] == True)
short_entry_logic.append(df["global_protections_short_dump"] == True)
short_entry_logic.append(df["RSI_3_1h"] >= 5.0)
short_entry_logic.append(df["RSI_3_4h"] >= 20.0)
short_entry_logic.append(df["RSI_3_1d"] >= 20.0)
short_entry_logic.append(df["RSI_14_1h"] > 20.0)
short_entry_logic.append(df["RSI_14_4h"] > 20.0)
short_entry_logic.append(df["RSI_14_1d"] > 10.0)
# 5m up move, 4h still not high enough
short_entry_logic.append((df["RSI_3"] < 97.0) | (df["AROONU_14_4h"] > 60.0))
# 5m up move, 4h still low
short_entry_logic.append((df["RSI_3"] < 97.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 50.0))
# 5m & 15m strong up move
short_entry_logic.append((df["RSI_3"] < 95.0) | (df["RSI_3_15m"] < 95.0))
# 5m & 1h up move, 1d uptrend
short_entry_logic.append((df["RSI_3"] < 95.0) | (df["RSI_3_1h"] < 90.0) | (df["ROC_9_1d"] < 100.0))
# 5m up move, 15m & 1h still not high enough
short_entry_logic.append((df["RSI_3"] < 95.0) | (df["AROOND_14_15m"] < 25.0) | (df["AROOND_14_1h"] < 25.0))
# 4m up move, 1h & 4h still low
short_entry_logic.append(
(df["RSI_3"] < 95.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 70.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 60.0)
)
# 4m & 1h up move, 1h still low
short_entry_logic.append(
(df["RSI_3"] < 90.0) | (df["RSI_3_1h"] < 80.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0)
)
# 15m & 1h up move, 4h low
short_entry_logic.append((df["RSI_3"] < 90.0) | (df["RSI_3_1h"] < 80.0) | (df["AROONU_14_4h"] > 20.0))
# 5m up move, 15m & 1h uptrend
short_entry_logic.append((df["RSI_3"] < 90.0) | (df["CMF_20_15m"] < 0.30) | (df["CMF_20_1h"] < 0.30))
# 5m up move, 15m stil low
short_entry_logic.append((df["RSI_3"] < 90.0) | (df["AROONU_14_15m"] > 50.0))
# 5m up move, 15m & 1h still not high enough
short_entry_logic.append(
(df["RSI_3"] < 90.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 60.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 75.0)
)
# 15m up move, 1h low
short_entry_logic.append((df["RSI_3_15m"] < 97.0) | (df["AROONU_14_1h"] > 30.0))
# 15m & 1h up move, 4h still going up
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["RSI_3_1h"] < 95.0) | (df["CCI_20_change_pct_4h"] < -0.0)
)
# 15m & 1h up move, 4h still not high enough
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["RSI_3_1h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 80.0)
)
# 15m & 1h up move, 4h still not high enough
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["RSI_3_1h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 50.0)
)
# 15m & 1h up move, 1h still low
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["RSI_3_1h"] < 70.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0)
)
# 15m & 4h up move, 1h still not high enough
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["RSI_3_4h"] < 95.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 75.0)
)
# 15m up move, 15m stil not high enough, 1h low
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 70.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 10.0)
)
# 15m up move, 1h still not high enough, 4h low
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 70.0) | (df["AROONU_14_4h"] > 20.0)
)
# 15m up move, 1h & 4h still not high enough
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 70.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 80.0)
)
# 15m up move, 4h still not high enough
short_entry_logic.append((df["RSI_3_15m"] < 95.0) | (df["AROONU_14_4h"] > 70.0))
# 15m up move, 1h up move, 1h still not high enough
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["RSI_3_change_pct_1h"] < 80.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0)
)
# 15m & 1h up move, 1h still not high enough
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["RSI_3_1h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 70.0)
)
# 15m & 1h up move, 1h not high enough
short_entry_logic.append((df["RSI_3_15m"] < 90.0) | (df["RSI_3_1h"] < 90.0) | (df["AROOND_14_1h"] < 50.0))
# 15m & 1h up move, 1d stil not high enough
short_entry_logic.append((df["RSI_3_15m"] < 90.0) | (df["RSI_3_1h"] < 90.0) | (df["RSI_14_1h"] > 80.0))
# 15m & 1h up move, 15m still not high enough
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["RSI_3_1h"] < 80.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 60.0)
)
# 15m & 4h up move, 1h still not high enough
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["RSI_3_4h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 80.0)
)
# 15m & 4h up move, 1h still not high enough
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["RSI_3_4h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 90.0)
)
# 15m & 4h up move, 1d low
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["RSI_3_4h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1d"] > 20.0)
)
# 15m & 4h up move, 4h not high enough
short_entry_logic.append((df["RSI_3_15m"] < 90.0) | (df["RSI_3_4h"] < 90.0) | (df["AROOND_14_4h"] < 50.0))
# 15m & 4h up move, 1h low
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["RSI_3_4h"] < 70.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 20.0)
)
# 15m & 4h up move, 4h low
short_entry_logic.append((df["RSI_3_15m"] < 90.0) | (df["RSI_3_4h"] < 60.0) | (df["AROONU_14_4h"] > 30.0))
# 15m up move, 1h & 4h low
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["AROONU_14_1h"] > 40.0) | (df["AROONU_14_4h"] > 10.0)
)
# 15m up move, 1h still low, 4h low
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["AROONU_14_1h"] > 60.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 30.0)
)
# 15m up move, 1h low, 4h still not high enough
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 70.0)
)
# 15m & 1h up move, 4h low
short_entry_logic.append(
(df["RSI_3_15m"] < 85.0) | (df["RSI_3_1h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 20.0)
)
# 15m & 1h up move, 1d still low
short_entry_logic.append(
(df["RSI_3_15m"] < 85.0) | (df["RSI_3_1h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_1d"] > 60.0)
)
# 15m & 1h up move, 1h low
short_entry_logic.append(
(df["RSI_3_15m"] < 85.0) | (df["RSI_3_1h"] < 70.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 30.0)
)
# 15m & 1h up move, 4h low
short_entry_logic.append(
(df["RSI_3_15m"] < 85.0) | (df["RSI_3_1h"] < 70.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 30.0)
)
# 15m & 4h down move, 4h still not high enough
short_entry_logic.append(
(df["RSI_3_15m"] < 85.0) | (df["RSI_3_4h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 75.0)
)
# 15m & 4h up move, 15m low
short_entry_logic.append(
(df["RSI_3_15m"] < 85.0) | (df["RSI_3_4h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 50.0)
)
# 15m & 1h up move, 1h still not high enough
short_entry_logic.append((df["RSI_3_15m"] < 80.0) | (df["RSI_3_1h"] < 70.0) | (df["AROONU_14_1h"] > 60.0))
# 15m & 4h up move, 15m still low
short_entry_logic.append((df["RSI_3_15m"] < 80.0) | (df["RSI_3_4h"] < 80.0) | (df["AROONU_14_15m"] > 50.0))
# 15m up move, 15m still not high enough, 1h still low
short_entry_logic.append(
(df["RSI_3_15m"] < 70.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 90.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0)
)
# 1h up move, 4h low
short_entry_logic.append((df["RSI_3_1h"] < 95.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 30.0))
# 1h & 4h up move, 4h still not high enough
short_entry_logic.append((df["RSI_3_1h"] < 95.0) | (df["RSI_3_4h"] < 95.0) | (df["UO_7_14_28_4h"] > 60.0))
# 1h & 4h up move, 4h still low
short_entry_logic.append(
(df["RSI_3_1h"] < 95.0) | (df["RSI_3_4h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 50.0)
)
# 1h & 4h up move, 4h uptrend
short_entry_logic.append((df["RSI_3_1h"] < 95.0) | (df["RSI_3_4h"] < 85.0) | (df["ROC_9_4h"] < 40.0))
# 1h & 1d strong up move
short_entry_logic.append((df["RSI_3_1h"] < 95.0) | (df["RSI_3_1d"] < 95.0))
# 1h & 4h strong up move
short_entry_logic.append((df["RSI_3_1h"] < 95.0) | (df["MFI_14_1h"] < 95.0) | (df["RSI_3_4h"] < 95.0))
# 1h strong up move, 15m still move higher
short_entry_logic.append((df["RSI_3_1h"] < 95.0) | (df["CCI_20_change_pct_15m"] < -0.0))
# 1h & 4h up move, 1h still low
short_entry_logic.append(
(df["RSI_3_1h"] < 90.0) | (df["RSI_3_4h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0)
)
# 1h & 4h up move, 1d still not high enough
short_entry_logic.append(
(df["RSI_3_1h"] < 90.0) | (df["RSI_3_4h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1d"] > 70.0)
)
# 1h up move, 1h still not high enough, 1d low
short_entry_logic.append(
(df["RSI_3_1h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 70.0) | (df["STOCHRSIk_14_14_3_3_1d"] > 30.0)
)
# 1h up move, 15m & 4h still low
short_entry_logic.append(
(df["RSI_3_1h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 50.0)
)
# 1h & 4h up move, 15m still not high enough
short_entry_logic.append((df["RSI_3_1h"] < 85.0) | (df["RSI_3_4h"] < 85.0) | (df["AROOND_14_15m"] < 50.0))
# 1h & 4h up move, 15m still not high enough
short_entry_logic.append(
(df["RSI_3_1h"] < 85.0) | (df["RSI_3_4h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 90.0)
)
# 1h up move, 15m still not high enough, 1h still low
short_entry_logic.append(
(df["RSI_3_1h"] < 80.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 80.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0)
)
# 1h up move, 1h still low
short_entry_logic.append((df["RSI_3_1h"] < 80.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 40.0))
# 4h & 1d strong up move
short_entry_logic.append((df["RSI_3_4h"] < 95.0) | (df["RSI_3_1d"] < 95.0))
# 4h up move, 15m still low, 1h not high enough
short_entry_logic.append(
(df["RSI_3_4h"] < 95.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 50.0) | (df["AROOND_14_1h"] < 25.0)
)
# 4h up move, 1h still low
short_entry_logic.append((df["RSI_3_4h"] < 90.0) | (df["AROONU_14_1h"] > 40.0))
# 1d up move, 1h & 4h still not low enough
short_entry_logic.append(
(df["RSI_3_1d"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 80.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 50.0)
)
# 15m & 1h uptrend, 4h still low
short_entry_logic.append(
(df["CMF_20_15m"] < 0.30) | (df["CMF_20_1h"] < 0.30) | (df["STOCHRSIk_14_14_3_3_4h"] > 60.0)
)
# 5m green, 15m still not high enough
short_entry_logic.append((df["change_pct"] < 5.0) | (df["AROOND_14_15m"] < 50.0))
# 5m green, 15m still not high enough
short_entry_logic.append((df["change_pct"] < 5.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 90.0))
# big pump in the last 4 hours, 15m still low
short_entry_logic.append((df["close"] < (df["close_min_48"] * 1.50)) | (df["AROONU_14_15m"] > 50.0))
# Logic
short_entry_logic.append(df["EMA_12"] > df["EMA_26"])
short_entry_logic.append((df["EMA_12"] - df["EMA_26"]) > (df["open"] * 0.030))
short_entry_logic.append((df["EMA_12"].shift() - df["EMA_26"].shift()) > (df["open"] / 100.0))
short_entry_logic.append(df["close"] > (df["BBU_20_2.0"] * 1.004))
# Condition #502 - Normal mode (Short).
if short_entry_condition_index == 502:
# Protections
short_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
short_entry_logic.append(df["protections_short_global"] == True)
# 5m & 15m & 1h & 4h up move
short_entry_logic.append(
(df["RSI_3"] < 97.0) | (df["RSI_3_15m"] < 90.0) | (df["RSI_3_1h"] < 90.0) | (df["RSI_3_4h"] < 80.0)
)
# 5m & 4h up move
short_entry_logic.append((df["RSI_3"] < 97.0) | (df["RSI_3_4h"] < 95.0))
# 5m up move, 4h still not high enough
short_entry_logic.append((df["RSI_3"] < 97.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 80.0))
# 5m & 15m strong up move
short_entry_logic.append((df["RSI_3"] < 95.0) | (df["RSI_3_15m"] < 95.0))
# 5m & 15m up move, 4h low
short_entry_logic.append((df["RSI_3"] < 95.0) | (df["RSI_3_15m"] < 90.0) | (df["AROONU_14_4h"] > 30.0))
# 5m & 1h & 4h down move
short_entry_logic.append((df["RSI_3"] < 95.0) | (df["RSI_3_1h"] < 90.0) | (df["RSI_3_4h"] < 90.0))
# 5m & 1h up move, 15m still not high enough
short_entry_logic.append(
(df["RSI_3"] < 95.0) | (df["RSI_3_1h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 70.0)
)
# 5m up move, 15m still low
short_entry_logic.append((df["RSI_3"] < 95.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 50.0))
# 5m up move, 4h low
short_entry_logic.append((df["RSI_3"] < 90.0) | (df["AROONU_14_4h"] > 20.0))
# 15m & 1h down move, 4h still not high enough
short_entry_logic.append(
(df["RSI_3_15m"] < 97.0) | (df["RSI_3_1h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 80.0)
)
# 15m up move, 1h still low
short_entry_logic.append((df["RSI_3_15m"] < 97.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 60.0))
# 15m & 1h & 4h up move
short_entry_logic.append((df["RSI_3_15m"] < 95.0) | (df["RSI_3_1h"] < 90.0) | (df["RSI_3_4h"] < 85.0))
# 15m & 1h up move, 4h still low
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["RSI_3_1h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 60.0)
)
# 15m up move, 1h still low
short_entry_logic.append((df["RSI_3_15m"] < 95.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 40.0))
# 15m up move, 4h still not high enough
short_entry_logic.append((df["RSI_3_15m"] < 95.0) | (df["AROONU_14_4h"] > 70.0))
# 15m & 1h & 4h up move
short_entry_logic.append((df["RSI_3_15m"] < 90.0) | (df["RSI_3_1h"] < 90.0) | (df["RSI_3_4h"] < 90.0))
# 15m & 1h up move, 15m still not high enough
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["RSI_3_1h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 80.0)
)
# 15m & 1h up move, 1d low
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["RSI_3_1h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1d"] > 40.0)
)
# 15m & 1h up move, 1h still not high enough
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["RSI_3_1h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 80.0)
)
# 15m & 4h up move, 1d low
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["RSI_3_4h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1d"] > 30.0)
)
# 15m up move, 1h still low
short_entry_logic.append((df["RSI_3_15m"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0))
# 15m & 1h up move, 1h still low
short_entry_logic.append(
(df["RSI_3_15m"] < 85.0) | (df["RSI_3_1h"] < 65.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 60.0)
)
# 15m up move, 1h low
short_entry_logic.append((df["RSI_3_15m"] < 85.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 30.0))
# 15m up move, 1h low
short_entry_logic.append((df["RSI_3_15m"] < 80.0) | (df["AROONU_14_1h"] > 10.0))
# 15m up move, 4h still low
short_entry_logic.append((df["RSI_3_15m"] < 80.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 30.0))
# 1h & 1d strong up move
short_entry_logic.append((df["RSI_3_1h"] < 95.0) | (df["RSI_3_1d"] < 95.0))
# 1h up move, 1h still not high enough
short_entry_logic.append((df["RSI_3_1h"] < 95.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 70.0))
# 1h up move, 4h still low, 1h moving higher
short_entry_logic.append(
(df["RSI_3_1h"] < 95.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 60.0) | (df["CCI_20_change_pct_1h"] < -0.0)
)
# 1h up move, 1d low
short_entry_logic.append((df["RSI_3_1h"] < 95.0) | (df["RSI_14_1d"] > 40.0))
# 1h strong up move, 15m still move higher
short_entry_logic.append((df["RSI_3_1h"] < 95.0) | (df["CCI_20_change_pct_15m"] < -0.0))
# 1h up move, relative stable before the hour
short_entry_logic.append((df["RSI_3_1h"] < 95.0) | (df["close_min_12"] > (df["close_min_48"] * 1.10)))
# 1h up move, 1d low
short_entry_logic.append((df["RSI_3_1h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1d"] > 10.0))
# 1h up move, 4h still low
short_entry_logic.append((df["RSI_3_1h"] < 85.0) | (df["AROONU_14_4h"] > 50.0))
# 1h up move, 1h still not high enough
short_entry_logic.append((df["RSI_3_1h"] < 80.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 70.0))
# 1h up move, 4h still low, 1h still moving higher
short_entry_logic.append(
(df["RSI_3_1h"] < 80.0) | (df["RSI_14_4h"] > 60.0) | (df["CCI_20_change_pct_1h"] < -0.0)
)
# 1h up move, 4h low
short_entry_logic.append((df["RSI_3_1h"] < 80.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 20.0))
# 1h up move, 4h low
short_entry_logic.append((df["RSI_3_1h"] < 80.0) | (df["AROONU_14_4h"] > 10.0))
# 1h up move, 1h still low
short_entry_logic.append((df["RSI_3_1h"] < 75.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0))
# 1h up move, 4h low
short_entry_logic.append((df["RSI_3_1h"] < 70.0) | (df["RSI_14_4h"] > 40.0))
# 1h up move, 1h low
short_entry_logic.append((df["RSI_3_1h"] < 60.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 20.0))
# 4h up move, 1d still low
short_entry_logic.append((df["RSI_3_4h"] < 97.0) | (df["RSI_14_1d"] > 50.0))
# 4h up move, 1h still not high enough
short_entry_logic.append((df["RSI_3_4h"] < 95.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 70.0))
# 4h up move, 4h still not high enough
short_entry_logic.append((df["RSI_3_4h"] < 95.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 80.0))
# 4h up move, 15m still not high enough, 4h moving higher
short_entry_logic.append(
(df["RSI_3_4h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 80.0) | (df["CCI_20_change_pct_4h"] < 0.0)
)
# 4h up move, 15m still low
short_entry_logic.append((df["RSI_3_4h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 50.0))
# 4h up move, 1h still low
short_entry_logic.append((df["RSI_3_4h"] < 90.0) | (df["AROONU_14_1h"] > 40.0))
# 4h up move, 4h still not high enough
short_entry_logic.append((df["RSI_3_4h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 75.0))
# 4h up move, 4h still not high enough
short_entry_logic.append((df["RSI_3_4h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 70.0))
# 4h up move, 1h low
short_entry_logic.append((df["RSI_3_4h"] < 75.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 20.0))
# 1d up move, 1h still not high enough
short_entry_logic.append((df["RSI_3_1d"] < 95.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 90.0))
# 1d up move, 1h still low
short_entry_logic.append((df["RSI_3_1d"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0))
# 1d up move, 4h still low
short_entry_logic.append((df["RSI_3_1d"] < 80.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 40.0))
# 15m low, 1h still low
short_entry_logic.append((df["AROONU_14_15m"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0))
# 15m low, 4h low
short_entry_logic.append((df["AROONU_14_15m"] > 20.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 20.0))
# 15m still low, 1h low
short_entry_logic.append((df["AROONU_14_15m"] > 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 30.0))
# 15m still not high enough, 4h low
short_entry_logic.append((df["STOCHRSIk_14_14_3_3_15m"] > 70.0) | (df["AROONU_14_4h"] > 10.0))
# 1h & 4h low
short_entry_logic.append((df["AROONU_14_1h"] > 20.0) | (df["AROONU_14_4h"] > 20.0))
# 1h & 4h low
short_entry_logic.append((df["AROONU_14_1h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 20.0))
# 1h low, 1d low
short_entry_logic.append((df["AROONU_14_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1d"] > 30.0))
# 1h & 4h low
short_entry_logic.append((df["STOCHRSIk_14_14_3_3_1h"] > 20.0) | (df["AROONU_14_4h"] > 20.0))
# 1d big green, 1d still not high enough
short_entry_logic.append((df["change_pct_1d"] < 30.0) | (df["RSI_14_1d"] > 65.0))
# rise in the last hour, relatively stable before the hour
short_entry_logic.append(
(df["close"] < (df["close_min_12"] * 1.10)) | (df["close_min_12"] > (df["close_min_48"] * 1.10))
)
# big pump in the last 6 days, 4h still not high enough
short_entry_logic.append((df["close"] < (df["low_min_6_1d"] * 4.0)) | (df["STOCHRSIk_14_14_3_3_4h"] > 80.0))
# big pump in the last 20 days, 1h up move
short_entry_logic.append((df["close"] < (df["low_min_20_1d"] * 6.0)) | (df["RSI_3_1h"] < 90.0))
# Logic
short_entry_logic.append(df["AROOND_14"] < 25.0)
short_entry_logic.append(df["STOCHRSIk_14_14_3_3"] > 80.0)
short_entry_logic.append(df["close"] > (df["EMA_20"] * 1.060))
short_entry_logic.append(df["close"] > (df["BBU_20_2.0"] * 0.995))
short_entry_logic.append(df["AROOND_14_15m"] < 25.0)
# Condition #503 - Normal mode (Short).
if short_entry_condition_index == 503:
# Protections
short_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
short_entry_logic.append(df["RSI_3_1h"] >= 5.0)
short_entry_logic.append(df["RSI_3_4h"] >= 20.0)
short_entry_logic.append(df["RSI_3_1d"] >= 20.0)
short_entry_logic.append(df["RSI_14_1h"] > 20.0)
short_entry_logic.append(df["RSI_14_4h"] > 20.0)
short_entry_logic.append(df["RSI_14_1d"] > 10.0)
# 5m strong down move
short_entry_logic.append((df["RSI_3"] < 98.0) | (df["ROC_9"] < 50.0))
# 5m down move, 4h still high
short_entry_logic.append(
(df["RSI_3"] < 90.0) | (df["MFI_14"] > 10.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 30.0)
)
# 5m & 1h down move, 1h still high
short_entry_logic.append(
(df["RSI_3"] < 90.0) | (df["RSI_3_1h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 70.0)
)
# 5m down move, 4h downtrend, 1h still high
short_entry_logic.append(
(df["RSI_3"] < 95.0) | (df["RSI_3_4h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 30.0)
)
# 5m & 4h strong down move, 4h still not low enough
short_entry_logic.append(
(df["RSI_3"] < 95.0) | (df["RSI_3_1h"] < 95.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 60.0)
)
# 5m down move, 1h high, 1d overbought
short_entry_logic.append((df["RSI_3"] < 90.0) | (df["ROC_9_1h"] < 15.0) | (df["ROC_9_1d"] > -40.0))
# 5m down move, 1h & 4h high
short_entry_logic.append(
(df["RSI_3"] < 90.0) | (df["UO_7_14_28_1h"] > 40.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 30.0)
)
# 5m down move, 1h high, 4h downtrend
short_entry_logic.append(
(df["RSI_3"] < 98.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 10.0) | (df["ROC_9_4h"] < 10.0)
)
# 5m & 1h down move, 4h down
short_entry_logic.append((df["RSI_3"] < 90.0) | (df["RSI_3_1h"] < 85.0) | (df["CMF_20_4h"] > -0.2))
# 5m down move, 1h high
short_entry_logic.append((df["RSI_14_change_pct"] < 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 30.0))
# 5m down move, 1h high
short_entry_logic.append((df["RSI_14_change_pct"] < 40.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 30.0))
# 15m & 1h down move, 4h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["RSI_3_1h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 50.0)
)
# 15m down move, 15m still not low enough, 1h & 4h still not low enough
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0)
| (df["AROOND_14_15m"] < 25.0)
| (df["STOCHRSIk_14_14_3_3_1h"] > 75.0)
| (df["MFI_14_4h"] > 50.0)
)
# 5m & 1h down move, 1h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["RSI_3_1h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0)
)
# 15m & 4h down move, 1h still not low
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["RSI_3_4h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 70.0)
)
# 15m & 4h down move, 4h still not low enough
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["RSI_3_4h"] < 80.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 60.0)
)
# 15m down move, 1h & 4h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0) | (df["RSI_14_4h"] > 50.0)
)
# 15m & 1h & 4h down move
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["RSI_3_change_pct_1h"] > -60.0) | (df["RSI_3_change_pct_4h"] > -40.0)
)
# 15m down move, 1d downtrend, 1h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["ROC_9_1d"] > -25.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 30.0)
)
# 15m & 1d down move, 1h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["RSI_3_1d"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 30.0)
)
# 15m & 4h down move, 1h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["RSI_3_4h"] < 95.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0)
)
# 15m down move, 15m still not low enough, 4h down move
short_entry_logic.append((df["RSI_3_15m"] < 90.0) | (df["AROOND_14_15m"] < 50.0) | (df["RSI_3_4h"] < 85.0))
# 15m down move, 1h still high, 1d strong downtrend
short_entry_logic.append((df["RSI_3_15m"] < 80.0) | (df["AROOND_14_1h"] < 25.0) | (df["MFI_14_1d"] < 90.0))
# 15m down move, 1h still high, 1d downtrend
short_entry_logic.append(
(df["RSI_3_15m"] < 85.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 30.0) | (df["ROC_9_1d"] < 50.0)
)
# 15m down move, 4h still high, 1d downtrend
short_entry_logic.append(
(df["RSI_3_15m"] < 85.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 30.0) | (df["ROC_9_1d"] < 50.0)
)
# 15m & 4h down move, 1d downtrend
short_entry_logic.append((df["RSI_3_15m"] < 85.0) | (df["RSI_3_4h"] < 85.0) | (df["ROC_9_1d"] > -70.0))
# 15m down move, 15m not low enough, 1h overbought
short_entry_logic.append(
(df["RSI_14_change_pct_15m"] > -40.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 90.0) | (df["RSI_14_1h"] > 30.0)
)
# 15m strong down move, 1h still high
short_entry_logic.append((df["ROC_9_15m"] < 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0))
# 15m downtrend, 1h & 4h still high
short_entry_logic.append(
(df["ROC_9_15m"] < 10.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 50.0)
)
# 15m & 1h & 4h down move
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["RSI_3_1h"] < 95.0) | (df["CCI_20_change_pct_4h"] < 0.0)
)
# 15m strong down move
short_entry_logic.append((df["RSI_3_15m"] < 90.0) | (df["MFI_14_15m"] < 85.0) | (df["AROOND_14_15m"] < 25.0))
# 14m down move, 4h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 80.0) | (df["AROOND_14_15m"] < 50.0) | (df["UO_7_14_28_4h"] > 50.0)
)
# 15m down move, 1h stil high, 1d overbought
short_entry_logic.append((df["RSI_3_15m"] < 85.0) | (df["AROOND_14_1h"] < 25.0) | (df["ROC_9_1d"] > -80.0))
# 15m down move, 1h high, 1d overbought
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 30.0) | (df["ROC_9_1d"] > -50.0)
)
# 1h & 4h down move, 4h still high
short_entry_logic.append(
(df["RSI_3_1h"] < 90.0) | (df["RSI_3_change_pct_4h"] < 65.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 50.0)
)
# 1h & 4h down move, 4h still high
short_entry_logic.append(
(df["RSI_3_1h"] < 90.0) | (df["RSI_3_4h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_4h"] < 10.0)
)
# 1h down move, 4h still not low enough, 1d overbought
short_entry_logic.append((df["RSI_3_1h"] < 90.0) | (df["AROOND_14_4h"] < 25.0) | (df["ROC_9_1d"] > -120.0))
# 1h down move, 1h still not low enough, 4h still not low
short_entry_logic.append(
(df["RSI_3_1h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 70.0) | (df["RSI_14_4h"] > 50.0)
)
# 1h down move, 4h still high
short_entry_logic.append((df["RSI_3_1h"] < 95.0) | (df["RSI_14_4h"] > 60.0))
# 1h down move, 4h still high, 1d downtrend
short_entry_logic.append(
(df["RSI_3_1h"] < 80.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 30.0) | (df["ROC_9_1d"] < 50.0)
)
# 1h down move, 4h still high, 1d downtrend
short_entry_logic.append(
(df["RSI_3_change_pct_1h"] > -65.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 30.0) | (df["ROC_9_1d"] < 50.0)
)
# 4h & 1d down move, 1h still high
short_entry_logic.append(
(df["RSI_3_4h"] < 90.0) | (df["ROC_2_1d"] < 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0)
)
# 15m still high, 1h down move, 4h high
short_entry_logic.append(
(df["AROOND_14_15m"] < 50.0) | (df["RSI_3_change_pct_1h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 30.0)
)
# 15m still high, 1h & 4h down move, 4h still high
short_entry_logic.append(
(df["AROOND_14_15m"] < 50.0)
| (df["RSI_3_1h"] < 85.0)
| (df["RSI_3_4h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_4h"] > 80.0)
)
# 15m & 1h still high, 4h overbought
short_entry_logic.append(
(df["AROOND_14_15m"] < 50.0) | (df["AROOND_14_1h"] < 50.0) | (df["ROC_9_4h"] > -40.0)
)
# 15m still high, 1h down move, 1d downtrend
short_entry_logic.append(
(df["STOCHRSIk_14_14_3_3_15m"] > 30.0) | (df["RSI_3_4h"] < 90.0) | (df["ROC_9_1d"] < 50.0)
)
# 1h & 4h still high, 1d strong down move
short_entry_logic.append(
(df["STOCHRSIk_14_14_3_3_1h"] > 50.0) | (df["UO_7_14_28_4h"] > 55.0) | (df["RSI_3_1d"] < 90.0)
)
# 1h still high, 4h & 1d downtrend
short_entry_logic.append((df["AROOND_14_1h"] < 25.0) | (df["ROC_9_4h"] < 20.0) | (df["ROC_9_1d"] < 50.0))
# 4h moving down, 1d P&D
short_entry_logic.append(
(df["ROC_9_4h"] < 30.0) | (df["RSI_3_change_pct_1d"] < 50.0) | (df["ROC_9_1d"] > -50.0)
)
# 1d strong downtrend, 4h still high
short_entry_logic.append(
(df["ROC_2_1d"] < 20.0) | (df["ROC_9_1d"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 70.0)
)
# 1d P&D, 1d overbought
short_entry_logic.append(
(df["ROC_2_1d"] < 10.0) | (df["ROC_9_1d"] > -50.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 5.0)
)
# 1h red, previous 1h green, 1h overbought
short_entry_logic.append(
(df["change_pct_1h"] < 1.0) | (df["change_pct_1h"].shift(12) > -5.0) | (df["RSI_14_1h"].shift(12) < 80.0)
)
# 1h red, 1h stil high, 4h downtrend
short_entry_logic.append(
(df["change_pct_1h"] < 5.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0) | (df["ROC_9_4h"] > -25.0)
)
# 4h red, 15m down move, 4h still high
short_entry_logic.append(
(df["change_pct_4h"] < 5.0) | (df["RSI_3_15m"] < 90.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 30.0)
)
# 4h red, previous 4h green, 4h overbought
short_entry_logic.append(
(df["change_pct_4h"] < 5.0) | (df["change_pct_4h"].shift(48) > -5.0) | (df["ROC_9_4h"].shift(48) > -25.0)
)
# 4h red, 4h still not low enough, 1h downtrend, 1h overbought
short_entry_logic.append(
(df["change_pct_4h"] < 10.0)
| (df["AROOND_14_4h"] < 25.0)
| (df["ROC_9_1h"] < 20.0)
| (df["ROC_9_1d"] > -40.0)
)
# 4h red, 4h still high, 1d downtrend
short_entry_logic.append(
(df["change_pct_4h"] < 10.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 30.0) | (df["ROC_9_1d"] < 40.0)
)
# 1d P&D, 1d overbought
short_entry_logic.append(
(df["change_pct_1d"] < 10.0) | (df["change_pct_1d"].shift(288) > -10.0) | (df["ROC_9_1d"] > -100.0)
)
# 1d P&D, 4h still high
short_entry_logic.append(
(df["change_pct_1d"] < 15.0) | (df["change_pct_1d"].shift(288) > -15.0) | (df["AROOND_14_4h"] < 50.0)
)
short_entry_logic.append(
(df["RSI_3_1h"] < 90.0) | (df["RSI_3_4h"] < 95.0) | (df["CCI_20_change_pct_4h"] < 0.0)
)
# Logic
short_entry_logic.append(df["RSI_20"] > df["RSI_20"].shift(1))
short_entry_logic.append(df["RSI_4"] > 54.0)
short_entry_logic.append(df["AROOND_14"] < 25.0)
short_entry_logic.append(df["close"] > df["SMA_16"] * 1.058)
# Condition #504 - Normal mode (Short).
if short_entry_condition_index == 504:
# Protections
short_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
short_entry_logic.append(df["RSI_3_1h"] >= 5.0)
short_entry_logic.append(df["RSI_3_4h"] >= 20.0)
short_entry_logic.append(df["RSI_3_1d"] >= 20.0)
short_entry_logic.append(df["RSI_14_1h"] > 20.0)
short_entry_logic.append(df["RSI_14_4h"] > 20.0)
short_entry_logic.append(df["RSI_14_1d"] > 10.0)
# 15m & 1h down move, 4h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0)
| (df["MFI_14_15m"] < 90.0)
| (df["RSI_3_1h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_4h"] > 50.0)
)
# 15m & 1h down move, 4h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["MFI_14_15m"] < 85.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 30.0)
)
# 14m & 4h down move, 4h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["RSI_3_4h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 60.0)
)
# 15m down move, 1h & 4h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["UO_7_14_28_1h"] < 45.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 30.0)
)
# 1h strong down move, 4h still high
short_entry_logic.append(
(df["RSI_3_1h"] < 95.0) | (df["RSI_14_change_pct_1h"] < 40.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 30.0)
)
# 1h strong down move, 4h down move, 4h still high
short_entry_logic.append(
(df["RSI_3_1h"] < 95.0) | (df["RSI_3_change_pct_4h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 50.0)
)
# 1h & 4h down move, 4h still not low enough
short_entry_logic.append(
(df["RSI_3_1h"] < 95.0) | (df["RSI_3_4h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 75.0)
)
# 1h & 4h down move, 4h still not low enough
short_entry_logic.append((df["RSI_3_1h"] < 95.0) | (df["RSI_3_4h"] < 75.0) | (df["AROOND_14_4h"] < 50.0))
# 15m down move, 1h strong downtrend
short_entry_logic.append((df["RSI_3_15m"] < 95.0) | (df["RSI_3_1h"] < 95.0) | (df["MFI_14_1h"] > 5.0))
# 15m downtrend, 4h down move, 4h stil high
short_entry_logic.append(
(df["ROC_9_15m"] > -20.0) | (df["RSI_3_4h"] < 75.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 30.0)
)
# Logic
short_entry_logic.append(df["AROOND_14"] < 25.0)
short_entry_logic.append(df["AROOND_14_15m"] < 25.0)
short_entry_logic.append(df["close"] > (df["EMA_9"] * 1.058))
short_entry_logic.append(df["close"] > (df["EMA_20"] * 1.040))
# Condition #541 - Quick mode (Short).
if short_entry_condition_index == 541:
# Protections
short_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
# 5m & 15m down move, 4h still high
short_entry_logic.append(
(df["RSI_3"] < 95.0) | (df["RSI_3_change_pct_15m"] < 50.0) | (df["RSI_14_4h"] > 50.0)
)
# 5m & 15m & 1h down move
short_entry_logic.append((df["RSI_3"] < 95.0) | (df["RSI_3_15m"] < 95.0) | (df["RSI_3_1h"] < 95.0))
# 5m strong down move
short_entry_logic.append((df["RSI_3"] < 98.0) | (df["ROC_9"] < 50.0))
# 15m & 1h strong down move & downtrend
short_entry_logic.append((df["RSI_3_15m"] < 95.0) | (df["RSI_3_1h"] < 95.0) | (df["MFI_14_1h"] > 5.0))
# 15m strong down move, 4h high
short_entry_logic.append((df["RSI_3_15m"] < 95.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 10.0))
# 15m & 1h down move
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["RSI_3_1h"] < 95.0) | (df["CCI_20_change_pct_1h"] > 0.0)
)
# 15m & 1h down move, 4h high
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["RSI_3_1h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 30.0)
)
# 15m & 1h down move, 4h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["RSI_3_change_pct_1h"] < 50.0) | (df["MFI_14_4h"] > 50.0)
)
# 15m strong down move, 1h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["MFI_14_15m"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0)
)
# 15m & 1h down move, 1h not low enough
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["RSI_3_1h"] < 95.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 80.0)
)
# 15m down move, 1h strong down move
short_entry_logic.append((df["RSI_3_15m"] < 95.0) | (df["RSI_14_change_pct_1h"] < 70.0))
# 15m down move, 4h & 1d downtrend
short_entry_logic.append((df["RSI_3_15m"] < 95.0) | (df["ROC_9_4h"] < 30.0) | (df["ROC_9_1d"] < 50.0))
# 15m down move, 1h strong down move, 4h stil high
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["RSI_3_1h"] < 95.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 50.0)
)
# 15m down move, 1h & 4h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 85.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 50.0)
)
# 15m down move, 1h downtrend, 4h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["ROC_9_1h"] < 20.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 50.0)
)
# 15m & 1h down move, 4h high
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["RSI_3_1h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 30.0)
)
# 15m down move, 1h down move, 4h high
short_entry_logic.append(
(df["RSI_3_15m"] < 85.0) | (df["RSI_3_change_pct_1h"] < 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 10.0)
)
# 1m down move, 1h still dropping, 4h overbought
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["CCI_20_change_pct_1h"] < 0.0) | (df["RSI_14_4h"] > 20.0)
)
# 15m down move, 1h high
short_entry_logic.append((df["RSI_3_change_pct_15m"] < 70.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 10.0))
# 1h strong down move, 4h high
short_entry_logic.append((df["RSI_3_1h"] < 95.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 10.0))
# 1h down move, 4h downtrend, 4h not low enough
short_entry_logic.append(
(df["RSI_3_1h"] < 95.0) | (df["CMF_20_4h"] > -0.25) | (df["STOCHRSIk_14_14_3_3_4h"] > 70.0)
)
# 1h down move, 4h high, 1d overbought
short_entry_logic.append((df["RSI_3_1h"] < 90.0) | (df["RSI_14_4h"] > 40.0) | (df["ROC_9_1d"] > -50.0))
# 1h down move, 4h strong down move
short_entry_logic.append((df["RSI_3_1h"] < 95.0) | (df["RSI_14_change_pct_4h"] < 40.0))
# 1h & 4h down move, 4h still going down
short_entry_logic.append(
(df["RSI_3_1h"] < 95.0) | (df["RSI_3_4h"] < 95.0) | (df["CCI_20_change_pct_4h"] < 0.0)
)
# 1h & 4h down move, 4h still not low enough
short_entry_logic.append(
(df["RSI_3_1h"] < 95.0) | (df["RSI_3_change_pct_4h"] < 65.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 70.0)
)
# 1h down move, 4h down move, 4h P&D
short_entry_logic.append(
(df["RSI_3_1h"] < 90.0) | (df["RSI_3_change_pct_4h"] < 70.0) | (df["RSI_14_4h"].shift(48) > 30.0)
)
# 1h & 4h down move, 4h still not low enough, 1d still high
short_entry_logic.append(
(df["RSI_3_1h"] < 90.0)
| (df["RSI_3_change_pct_4h"] < 50.0)
| (df["AROOND_14_4h"] < 25.0)
| (df["STOCHRSIk_14_14_3_3_1d"] > 60.0)
)
# 1h down move, 1h still high, 1d going down
short_entry_logic.append(
(df["RSI_3_1h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0) | (df["ROC_2_1d"] > -50.0)
)
# 4h downtrend, 4h still high, 1d strong downtrend
short_entry_logic.append(
(df["RSI_3_4h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 70.0) | (df["ROC_9_1d"] < 60.0)
)
# 15m down move, 1h strong down move, 1d overbought
short_entry_logic.append(
(df["MFI_14_15m"] < 80.0) | (df["RSI_3_change_pct_1h"] < 80.0) | (df["ROC_9_1d"] > -50.0)
)
# 1h not low enough, 4h high, 1d strong downtrend
short_entry_logic.append(
(df["STOCHRSIk_14_14_3_3_1h"] > 70.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 10.0) | (df["ROC_9_1d"] < 60.0)
)
# 1h down move, 4h still high, 1d downtrend
short_entry_logic.append(
(df["RSI_3_change_pct_1h"] < 65.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 30.0) | (df["ROC_9_1d"] < 50.0)
)
# 15m strong down move, 1h still high
short_entry_logic.append((df["ROC_9_15m"] < 15.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 30.0))
# 15m downtrend, 4h down move, 4h stil high
short_entry_logic.append(
(df["ROC_9_15m"] < 15.0) | (df["RSI_3_4h"] < 75.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 30.0)
)
# 1h downtrend, 4h overbought
short_entry_logic.append((df["ROC_2_1h"] < 5.0) | (df["RSI_14_4h"] > 20.0) | (df["ROC_9_4h"] > -25.0))
# 1h P&D, 4h still high
short_entry_logic.append(
(df["ROC_2_1h"] < 10.0) | (df["ROC_9_1h"] > -5.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 30.0)
)
# 1h downtrend, 4h down move, 1d downtrend
short_entry_logic.append((df["ROC_9_1h"] < 40.0) | (df["RSI_3_4h"] < 90.0) | (df["ROC_9_1d"] < 50.0))
short_entry_logic.append((df["ROC_9_4h"] > -200.0) | (df["RSI_14_4h"] > 20.0))
# 4h down move, 1d P&D
short_entry_logic.append((df["ROC_9_4h"] < 20.0) | (df["ROC_2_1d"] < 20.0) | (df["ROC_9_1d"] > -50.0))
# 1h P&D, 4h overbought
short_entry_logic.append(
(df["change_pct_1h"] < 2.0) | (df["change_pct_1h"].shift(12) > 2.0) | (df["RSI_14_4h"] > 20.0)
)
# 1h P&D, 1d overbought
short_entry_logic.append(
(df["change_pct_1h"] < 5.0) | (df["change_pct_1h"].shift(12) > -5.0) | (df["ROC_9_1d"] > -100.0)
)
# 1h & 4h red, 1h not low enough
short_entry_logic.append(
(df["change_pct_1h"] < 10.0) | (df["change_pct_4h"] < 10.0) | (df["MFI_14_1h"] > 50.0)
)
# 1h red, 1h still not low enough, 1d down move
short_entry_logic.append((df["change_pct_1h"] < 15.0) | (df["MFI_14_1h"] > 50.0) | (df["RSI_3_1d"] < 90.0))
# 4h red, previous 4h green, 4h overbought
short_entry_logic.append(
(df["change_pct_4h"] < 5.0) | (df["change_pct_4h"].shift(48) > -5.0) | (df["RSI_14_4h"].shift(48) > 20.0)
)
# 1d P&D, 1d overbought
short_entry_logic.append(
(df["change_pct_1d"] < 10.0) | (df["change_pct_1d"].shift(288) > -10.0) | (df["ROC_9_1d"] > -100.0)
)
# 1d P&D, 4h still high
short_entry_logic.append(
(df["change_pct_1d"] < 15.0) | (df["change_pct_1d"].shift(288) > -15.0) | (df["AROOND_14_4h"] < 50.0)
)
# Logic
short_entry_logic.append(df["RSI_14"] > 64.0)
short_entry_logic.append(df["AROOND_14"] < 25.0)
short_entry_logic.append(df["AROONU_14"] > 75.0)
short_entry_logic.append(df["EMA_9"] > (df["EMA_26"] * 1.040))
# Condition #542 - Quick mode (Short).
if short_entry_condition_index == 542:
# Protections
short_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
short_entry_logic.append(df["protections_short_global"] == True)
# 5m & 15m up move, 15m stil low
short_entry_logic.append((df["RSI_3"] < 90.0) | (df["RSI_3_15m"] < 80.0) | (df["AROONU_14_15m"] > 60.0))
# 15m & 1h up move, 4h still low
short_entry_logic.append((df["RSI_3_15m"] < 95.0) | (df["RSI_3_1h"] < 95.0) | (df["RSI_14_4h"] > 60.0))
# 15m & 1h up move, 4h still not high enough
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["RSI_3_1h"] < 95.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 80.0)
)
# 15m & 1h up move, 1h still moving higher
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["RSI_3_1h"] < 90.0) | (df["CCI_20_change_pct_1h"] < -0.0)
)
# 15m & 4h up move, 4h still moving higher
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["RSI_3_4h"] < 95.0) | (df["CCI_20_change_pct_4h"] < -0.0)
)
# 15m up move, 15m still not high enough, 1d uptrend
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 80.0) | (df["ROC_9_1d"] < 80.0)
)
# 15m & 4h up move, 15m still not high enough
short_entry_logic.append(
(df["RSI_3_15m"] < 85.0) | (df["RSI_3_4h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 70.0)
)
# 15m & 4h up move, 4h still not high enough
short_entry_logic.append((df["RSI_3_15m"] < 85.0) | (df["RSI_3_4h"] < 80.0) | (df["RSI_14_4h"] > 60.0))
# 15m up move, 15m still not high enough, 4h still low
short_entry_logic.append(
(df["RSI_3_15m"] < 85.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 80.0) | (df["AROONU_14_4h"] > 50.0)
)
# 15m & 1h up move, 15m still low
short_entry_logic.append((df["RSI_3_15m"] < 70.0) | (df["RSI_3_1h"] < 70.0) | (df["AROONU_14_15m"] > 40.0))
# 15m & 1h up move, 15m still low
short_entry_logic.append(
(df["RSI_3_15m"] < 70.0) | (df["RSI_3_1h"] < 70.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 40.0)
)
# # 15m & 1h up move, 4h low
short_entry_logic.append((df["RSI_3_15m"] < 70.0) | (df["RSI_3_1h"] < 60.0) | (df["AROONU_14_4h"] > 40.0))
# 1h & 1d up move, 1h still moving higher
short_entry_logic.append(
(df["RSI_3_1h"] < 97.0) | (df["RSI_3_1d"] < 95.0) | (df["CCI_20_change_pct_1h"] < -0.0)
)
# 1h & 4h up move, 15m still not high enough
short_entry_logic.append(
(df["RSI_3_1h"] < 95.0) | (df["RSI_3_4h"] < 95.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 80.0)
)
# 1h & 4h up move, 1d uptrend
short_entry_logic.append((df["RSI_3_1h"] < 95.0) | (df["RSI_3_4h"] < 95.0) | (df["ROC_9_1d"] < 100.0))
# 1h & 4h up move, 1d still low
short_entry_logic.append((df["RSI_3_1h"] < 95.0) | (df["RSI_3_4h"] < 85.0) | (df["RSI_14_1d"] > 50.0))
# 1h up move, 4h still low, 1h still moving higher
short_entry_logic.append(
(df["RSI_3_1h"] < 95.0) | (df["RSI_14_4h"] > 60.0) | (df["CCI_20_change_pct_1h"] < -0.0)
)
# 1h up move, 4h low
short_entry_logic.append((df["RSI_3_1h"] < 95.0) | (df["AROONU_14_4h"] > 10.0))
# 1h & 4h up move, 1h still moving higher
short_entry_logic.append(
(df["RSI_3_1h"] < 90.0) | (df["RSI_3_4h"] < 85.0) | (df["CCI_20_change_pct_1h"] < -0.0)
)
# 1h & 4h up move, 4h still not high enough
short_entry_logic.append(
(df["RSI_3_1h"] < 90.0) | (df["RSI_3_4h"] < 70.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 80.0)
)
# 1h & 1d up move, 15m still low
short_entry_logic.append(
(df["RSI_3_1h"] < 90.0) | (df["RSI_3_1d"] < 90.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 60.0)
)
# 1h up move, 4h low
short_entry_logic.append((df["RSI_3_1h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 30.0))
# 1h up move, 4h still low, 1h still moving higher
short_entry_logic.append(
(df["RSI_3_1h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 60.0) | (df["CCI_20_change_pct_1h"] < -0.0)
)
# 1h & 4h up move, 4h still moving higher
short_entry_logic.append(
(df["RSI_3_1h"] < 85.0) | (df["RSI_3_4h"] < 80.0) | (df["CCI_20_change_pct_4h"] < -0.0)
)
# 1h up move, 15m low
short_entry_logic.append((df["RSI_3_1h"] < 85.0) | (df["AROONU_14_15m"] > 40.0))
# 1h up move, 4h still not high enough, 1d low
short_entry_logic.append((df["RSI_3_1h"] < 85.0) | (df["AROONU_14_4h"] > 80.0) | (df["RSI_14_1d"] > 40.0))
# 4h up move, 1d low
short_entry_logic.append((df["RSI_3_4h"] < 95.0) | (df["RSI_14_1d"] > 40.0))
# 4h down move, 15m still not high enough, 1d low
short_entry_logic.append(
(df["RSI_3_4h"] < 95.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 80.0) | (df["AROOND_14_1d"] < 75.0)
)
# 4h up move, 15m low
short_entry_logic.append((df["RSI_3_4h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 45.0))
# 4h up move, 15m still not high enough
short_entry_logic.append((df["RSI_3_4h"] < 85.0) | (df["AROONU_14_15m"] > 60.0))
# 4h up move, 15m low
short_entry_logic.append((df["RSI_3_4h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 30.0))
# 4h up move, 15m still low, 4h still not high enough
short_entry_logic.append(
(df["RSI_3_4h"] < 80.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 60.0) | (df["AROONU_14_4h"] > 80.0)
)
# 4h up move, 15m still low, 4h still not high enough
short_entry_logic.append(
(df["RSI_3_4h"] < 75.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 60.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 80.0)
)
# 1d up move, 4h low
short_entry_logic.append((df["RSI_3_1d"] < 85.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 40.0))
# 15m & 4h still not high enough
short_entry_logic.append((df["STOCHRSIk_14_14_3_3_15m"] > 70.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 70.0))
# 1d bot wick, 4h still not high enough
short_entry_logic.append((df["bot_wick_pct_1d"] < 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 80.0))
# rise in the last 12 hours, relatively stable before the 12 hours
short_entry_logic.append(
(df["close"] < (df["low_min_12_1h"] * 1.30)) | (df["low_min_12_1h"] > (df["low_min_24_1h"] * 1.10))
)
# big pump in the last 30 days, 4h up move
short_entry_logic.append((df["close"] < (df["low_min_30_1d"] * 4.0)) | (df["RSI_3_4h"] < 85.0))
# Logic
short_entry_logic.append(df["WILLR_14"] > -50.0)
short_entry_logic.append(df["AROONU_14"] > 75.0)
short_entry_logic.append(df["AROOND_14"] < 25.0)
short_entry_logic.append(df["STOCHRSIk_14_14_3_3"] > 80.0)
short_entry_logic.append(df["WILLR_84_1h"] > -30.0)
short_entry_logic.append(df["STOCHRSIk_14_14_3_3_1h"] > 80.0)
short_entry_logic.append(df["BBB_20_2.0_1h"] > 20.0)
short_entry_logic.append(df["close_min_48"] <= (df["close"] * 0.90))
# Condition #543 - Rapid mode (Short).
if short_entry_condition_index == 543:
# Protections
short_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
short_entry_logic.append(df["RSI_14_1h"] > 20.0)
short_entry_logic.append(df["RSI_14_4h"] > 20.0)
short_entry_logic.append(df["RSI_14_1d"] > 10.0)
# 5m strong down move
short_entry_logic.append((df["RSI_3"] < 98.0) | (df["ROC_9"] < 50.0))
# 15m down move, 1h down move, 1h still not low enough
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["RSI_3_change_pct_1h"] < 60.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0)
)
# 15m down move, 1h down move, 4h still not low enough
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["RSI_3_change_pct_1h"] < 40.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 30.0)
)
# 5m down move, 1h down, 4h high
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["CMF_20_1h"] < 0.2) | (df["STOCHRSIk_14_14_3_3_4h"] > 50.0)
)
# 15m down move, 1h still not low enough, 4h high
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["AROOND_14_1h"] < 25.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 10.0)
)
# 15m down move, 1h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["OBV_change_pct_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 30.0)
)
# 5m & 1h strong down move, 1h still not low enough
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["RSI_3_1h"] < 95.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 70.0)
)
# 5m & 1h strong downtrend
short_entry_logic.append((df["RSI_3_15m"] < 95.0) | (df["RSI_3_1h"] < 95.0) | (df["MFI_14_1h"] < 90.0))
# 15m & 1h down move, 4h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0)
| (df["RSI_3_1h"] < 80.0)
| (df["STOCHRSIk_14_14_3_3_4h"] > 70.0)
| (df["AROOND_14_4h"] < 50.0)
)
# 15m & 1h down move, 4h still high, 4h downtrend
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["RSI_3_1h"] < 90.0) | (df["UO_7_14_28_4h"] > 60.0) | (df["ROC_9_4h"] < 20.0)
)
# 15m & 1h down move, 1d strong downtrend
short_entry_logic.append((df["RSI_3_15m"] < 95.0) | (df["RSI_3_1h"] < 90.0) | (df["ROC_9_1d"] < 50.0))
# 15m & 4h down move, 4h still not low enough
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["RSI_3_4h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 55.0)
)
# 15m down move, 15m still not low enough, 1h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 85.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 30.0)
)
# 15m & 1h down move, 1h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 85.0) | (df["RSI_3_1h"] < 75.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 30.0)
)
# 15m down move, 15m still not low enoug, 1h high
short_entry_logic.append(
(df["RSI_3_15m"] < 85.0) | (df["AROOND_14_15m"] < 25.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 10.0)
)
# 15m down move, 1h downtrend, 4h overbought
short_entry_logic.append((df["RSI_3_15m"] < 85.0) | (df["ROC_9_1h"] < 5.0) | (df["ROC_9_4h"] > -35.0))
# 1h & 4h down move, 4h still not low enough
short_entry_logic.append(
(df["RSI_3_1h"] < 95.0) | (df["RSI_3_4h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 75.0)
)
# 1h & 4h down move, 4h still high
short_entry_logic.append(
(df["RSI_3_1h"] < 95.0) | (df["RSI_3_change_pct_4h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 50.0)
)
# 1h & 4h down move, 4h still not low enough
short_entry_logic.append(
(df["RSI_3_1h"] < 95.0) | (df["RSI_3_change_pct_4h"] < 65.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 70.0)
)
# 1h down move, 1h still not low enough, 4h still not low
short_entry_logic.append(
(df["RSI_3_1h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 70.0) | (df["RSI_14_4h"] > 50.0)
)
# 1h down move, 1h not low enough, 1h still high
short_entry_logic.append(
(df["RSI_3_1h"] < 85.0) | (df["AROOND_14_1h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 50.0)
)
# 4h down move, 15m still not low enough, 1h still high
short_entry_logic.append(
(df["RSI_3_4h"] < 80.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 70.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 30.0)
)
# 4h down move, 4h still high, 1d downtrend
short_entry_logic.append(
(df["RSI_3_4h"] < 75.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 50.0) | (df["ROC_9_1d"] < 50.0)
)
# 4h & 1d down move, 1d strong downtrend
short_entry_logic.append((df["RSI_3_4h"] < 90.0) | (df["RSI_3_1d"] < 90.0) | (df["ROC_9_1d"] < 60.0))
# 4h overbought, 1h still high, 1d downtrend
short_entry_logic.append(
(df["ROC_9_4h"] > -50.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 70.0) | (df["ROC_9_1d"] < 50.0)
)
# 4h red, previous 4h green, 4h overbought
short_entry_logic.append(
(df["change_pct_4h"] < 5.0) | (df["change_pct_4h"].shift(48) > -5.0) | (df["RSI_14_4h"].shift(48) > 20.0)
)
# 4h red, 4h moving down, 4h still high, 1d downtrend
short_entry_logic.append(
(df["change_pct_4h"] < 10.0)
| (df["CCI_20_change_pct_4h"] < 0.0)
| (df["STOCHRSIk_14_14_3_3_4h"] > 50.0)
| (df["ROC_9_1d"] < 40.0)
)
# Logic
short_entry_logic.append(df["RSI_14"] > 60.0)
short_entry_logic.append(df["MFI_14"] > 60.0)
short_entry_logic.append(df["AROOND_14"] < 25.0)
short_entry_logic.append(df["EMA_26"] < df["EMA_12"])
short_entry_logic.append((df["EMA_26"] - df["EMA_12"]) > (df["open"] * 0.024))
short_entry_logic.append((df["EMA_26"].shift() - df["EMA_12"].shift()) > (df["open"] / 100.0))
short_entry_logic.append(df["close"] < (df["EMA_20"] * 0.958))
short_entry_logic.append(df["close"] < (df["BBL_20_2.0"] * 0.992))
# # Condition #620 - Grind mode (Short).
# if short_entry_condition_index == 620:
# # Protections
# short_entry_logic.append(num_open_short_grind_mode < self.grind_mode_max_slots)
# short_entry_logic.append(is_pair_short_grind_mode)
# short_entry_logic.append(df["RSI_3"] <= 40.0)
# short_entry_logic.append(df["RSI_3_15m"] >= 10.0)
# short_entry_logic.append(df["RSI_3_1h"] >= 5.0)
# short_entry_logic.append(df["RSI_3_4h"] >= 5.0)
# short_entry_logic.append(df["RSI_14_1h"] < 85.0)
# short_entry_logic.append(df["RSI_14_4h"] < 85.0)
# short_entry_logic.append(df["RSI_14_1d"] < 85.0)
# short_entry_logic.append(df["close_max_48"] >= (df["close"] * 1.10))
# # Logic
# short_entry_logic.append(df["STOCHRSIk_14_14_3_3"] > 80.0)
# short_entry_logic.append(df["WILLR_14"] > -20.0)
# short_entry_logic.append(df["AROOND_14"] < 25.0)
# Condition #641 - Top Coins mode (Short).
if short_entry_condition_index == 641:
# Protections
short_entry_logic.append(is_pair_short_top_coins_mode)
short_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
short_entry_logic.append(df["RSI_3_1h"] >= 5.0)
short_entry_logic.append(df["RSI_3_4h"] >= 20.0)
short_entry_logic.append(df["RSI_3_1d"] >= 20.0)
short_entry_logic.append(df["RSI_14_1h"] > 20.0)
short_entry_logic.append(df["RSI_14_4h"] > 20.0)
short_entry_logic.append(df["RSI_14_1d"] > 10.0)
# 5m down move, 1h still not low enough, 4h high
short_entry_logic.append(
(df["RSI_3"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 90.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 30.0)
)
# 5m down move, 1h high, 4h still not low enough
short_entry_logic.append(
(df["RSI_3"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 90.0)
)
# 15m down move, 15m still not low enough, 1h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["AROOND_14_15m"] < 25.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0)
)
# 15m & 1h down move, 1d still not low enough
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["RSI_3_1h"] < 95.0) | (df["STOCHRSIk_14_14_3_3_1d"] > 70.0)
)
# 15m & 1h down move, 1h still not low enough
short_entry_logic.append(
(df["RSI_3_15m"] < 85.0) | (df["RSI_3_1h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 70.0)
)
# 15m down move, 1h high, 4h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 85.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 75.0)
)
# 15m & 1h down move, 4h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 80.0) | (df["RSI_3_1h"] < 70.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 50.0)
)
# 15m down move, 1h still not low enough, 4h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 75.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 80.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 60.0)
)
# 1h & 4h & 1d down move
short_entry_logic.append((df["RSI_3_1h"] < 95.0) | (df["RSI_3_4h"] < 90.0) | (df["RSI_3_1d"] < 80.0))
# 1h & 4h down move, 15m not low enough
short_entry_logic.append(
(df["RSI_3_1h"] < 90.0) | (df["RSI_3_4h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 75.0)
)
# 1h down move, 1h still not low enough, 4h still high
short_entry_logic.append(
(df["RSI_3_1h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 90.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 50.0)
)
# 1h & 4h down move, 1h still not low enough
short_entry_logic.append(
(df["RSI_3_1h"] < 85.0) | (df["RSI_3_4h"] < 75.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 90.0)
)
# 1h & 4h down move, 4h still high
short_entry_logic.append(
(df["RSI_3_1h"] < 85.0) | (df["RSI_3_4h"] < 75.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 50.0)
)
# 1h & 4h down move, 1h still not low enough
short_entry_logic.append(
(df["RSI_3_1h"] < 80.0) | (df["RSI_3_4h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 75.0)
)
# 1h & 4h down move, 4h still not low enough
short_entry_logic.append(
(df["RSI_3_1h"] < 80.0) | (df["RSI_3_4h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 75.0)
)
# 1h down move, 1h & 4h still not low enough
short_entry_logic.append(
(df["RSI_3_1h"] < 80.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 90.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 70.0)
)
# 4h down move, 15m still high, 1h still not low enough
short_entry_logic.append(
(df["RSI_3_4h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 75.0)
)
# 4h down move, 15m & 4h still not low enough
short_entry_logic.append(
(df["RSI_3_4h"] < 15.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 80.0)
)
# Logic
short_entry_logic.append(df["RSI_20"] > df["RSI_20"].shift(1))
short_entry_logic.append(df["RSI_3"] > 70.0)
short_entry_logic.append(df["AROOND_14"] < 25.0)
short_entry_logic.append(df["close"] > df["SMA_16"] * 1.044)
# Condition #642 - Top Coins mode (Short).
if short_entry_condition_index == 642:
# Protections
short_entry_logic.append(is_pair_short_top_coins_mode)
short_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
# 5m & 1h & 4h down move
short_entry_logic.append((df["RSI_3"] < 90.0) | (df["RSI_3_1h"] < 95.0) | (df["RSI_3_4h"] < 90.0))
# 5m down move, 15m & 4h still high
short_entry_logic.append(
(df["RSI_3"] < 90.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 60.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 60.0)
)
# 5m down move, 15m still high, 1h high
short_entry_logic.append(
(df["RSI_3"] < 85.0) | (df["AROOND_14_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 20.0)
)
# 15m & 1h down move, 1h still not low enough
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["RSI_3_1h"] < 95.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 90.0)
)
# 15m & 1h down move, 1d still not low enough
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["RSI_3_1h"] < 95.0) | (df["STOCHRSIk_14_14_3_3_1d"] > 70.0)
)
# 15m strong down move, 4h high
short_entry_logic.append((df["RSI_3_15m"] < 95.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 20.0))
# 15m & 1h down move, 1h still not low enough
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["RSI_3_1h"] < 80.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 80.0)
)
# 15m down move, 15m stil high, 1h still not low enough
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 80.0)
)
# 15m down move, 1h & 4h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 60.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 60.0)
)
# 15m & 1h down move, 4h still not low enough
short_entry_logic.append(
(df["RSI_3_15m"] < 95.0) | (df["RSI_3_1h"] < 70.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 50.0)
)
# 15m down move, 15m still not low enough, 4h high
short_entry_logic.append(
(df["RSI_3_15m"] < 85.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 80.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 20.0)
)
# 15m down move, 4h still high, 1d high
short_entry_logic.append(
(df["RSI_3_15m"] < 85.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 60.0) | (df["STOCHRSIk_14_14_3_3_1d"] > 30.0)
)
# 15m & 4h down move, 1d still high
short_entry_logic.append(
(df["RSI_3_15m"] < 85.0) | (df["RSI_3_4h"] < 75.0) | (df["STOCHRSIk_14_14_3_3_1d"] > 50.0)
)
# 15m & 1h down move, 4h still not low enough
short_entry_logic.append(
(df["RSI_3_15m"] < 80.0) | (df["RSI_3_1h"] < 80.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 70.0)
)
# 15m & 1h down move, 4h still not low enough
short_entry_logic.append(
(df["RSI_3_15m"] < 75.0) | (df["RSI_3_1h"] < 75.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 70.0)
)
# 15m & 4h down move, 4h still not low enough
short_entry_logic.append(
(df["RSI_3_15m"] < 75.0) | (df["RSI_3_4h"] < 75.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 80.0)
)
# 15m down move, 1h still high, 4h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 75.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 80.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 60.0)
)
# 15m down move, 1h still not low enough, 4h high
short_entry_logic.append(
(df["RSI_3_15m"] < 75.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 90.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 30.0)
)
# 15m down move, 1h high, 4h still not low enough
short_entry_logic.append(
(df["RSI_3_15m"] < 75.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 90.0)
)
# 15m down move, 4h high, 1d stil high
short_entry_logic.append(
(df["RSI_3_15m"] < 75.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1d"] > 50.0)
)
# 15m & 4h down move, 1h still not low enough
short_entry_logic.append(
(df["RSI_3_15m"] < 70.0) | (df["RSI_3_4h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 70.0)
)
# 15m & 4h down move, 1h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 70.0) | (df["RSI_3_4h"] < 80.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0)
)
# 15m down move, 15m still high 4h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 70.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 70.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 50.0)
)
# 15m down move, 1h still high, 4h high
short_entry_logic.append(
(df["RSI_3_15m"] < 70.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 10.0)
)
# 1h & 4h down move, 1h still not low enough
short_entry_logic.append(
(df["RSI_3_1h"] < 95.0) | (df["RSI_3_4h"] < 95.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 90.0)
)
# 1h & 4h down move, 4h still not low enough
short_entry_logic.append(
(df["RSI_3_1h"] < 95.0) | (df["RSI_3_4h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 80.0)
)
# 1h & 4h down move, 1h still not low enough
short_entry_logic.append(
(df["RSI_3_1h"] < 90.0) | (df["RSI_3_4h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 90.0)
)
# 1h & 4h down move, 4h still not low enough
short_entry_logic.append(
(df["RSI_3_1h"] < 90.0) | (df["RSI_3_4h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 80.0)
)
# 1h & 4h down move, 1h still not low enough
short_entry_logic.append(
(df["RSI_3_1h"] < 90.0) | (df["RSI_3_4h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 85.0)
)
# 1h & 4h down move, 1d still high
short_entry_logic.append(
(df["RSI_3_1h"] < 90.0) | (df["RSI_3_4h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_1d"] > 50.0)
)
# 1h & 4h down move, 4h still not low enough
short_entry_logic.append(
(df["RSI_3_1h"] < 85.0) | (df["RSI_3_4h"] < 75.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 85.0)
)
# 1h down move, 4h still high, 1d high
short_entry_logic.append(
(df["RSI_3_1h"] < 80.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 60.0) | (df["STOCHRSIk_14_14_3_3_1d"] > 30.0)
)
# 1h & 4h down move, 1h still not low enough
short_entry_logic.append(
(df["RSI_3_1h"] < 80.0) | (df["RSI_3_4h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 75.0)
)
# 1h & 4h down move, 15m still high
short_entry_logic.append(
(df["RSI_3_1h"] < 80.0) | (df["RSI_3_4h"] < 80.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 50.0)
)
# 1h & 4h down move, 4h still not low enough
short_entry_logic.append(
(df["RSI_3_1h"] < 75.0) | (df["RSI_3_4h"] < 90.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 75.0)
)
# 1h & 4h down move, 1h still high
short_entry_logic.append(
(df["RSI_3_1h"] < 70.0) | (df["RSI_3_4h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 60.0)
)
# 1h down move, 1h still not low enough, 4h still high
short_entry_logic.append(
(df["RSI_3_1h"] < 70.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 80.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 50.0)
)
# 4h down move, 15m still high, 1h still not low enough
short_entry_logic.append(
(df["RSI_3_4h"] < 85.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 60.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 80.0)
)
# 4h down move, 15m still high, 4h still not low enough
short_entry_logic.append(
(df["RSI_3_4h"] < 75.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 75.0)
)
# 4h down move, 1h still not low enough, 1d still high
short_entry_logic.append(
(df["RSI_3_4h"] < 25.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 70.0) | (df["STOCHRSIk_14_14_3_3_1d"] > 50.0)
)
# 15m & 1h still high, 4h high
short_entry_logic.append(
(df["STOCHRSIk_14_14_3_3_15m"] > 70.0)
| (df["STOCHRSIk_14_14_3_3_1h"] > 70.0)
| (df["STOCHRSIk_14_14_3_3_4h"] > 10.0)
)
# 15m still high, 1h & 1d high
short_entry_logic.append(
(df["STOCHRSIk_14_14_3_3_15m"] > 60.0)
| (df["STOCHRSIk_14_14_3_3_1h"] > 30.0)
| (df["STOCHRSIk_14_14_3_3_1d"] > 30.0)
)
# 15m & 4h high
short_entry_logic.append((df["STOCHRSIk_14_14_3_3_15m"] > 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 20.0))
# 15m high, 1h & 4h still not low enough
short_entry_logic.append(
(df["STOCHRSIk_14_14_3_3_15m"] > 30.0)
| (df["STOCHRSIk_14_14_3_3_1h"] > 75.0)
| (df["STOCHRSIk_14_14_3_3_4h"] > 75.0)
)
# 15m & 4h high
short_entry_logic.append((df["STOCHRSIk_14_14_3_3_15m"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 30.0))
# 1h & 4h still high, 1d high
short_entry_logic.append(
(df["STOCHRSIk_14_14_3_3_1h"] > 70.0)
| (df["STOCHRSIk_14_14_3_3_4h"] > 70.0)
| (df["STOCHRSIk_14_14_3_3_1d"] > 50.0)
)
# 1h & 4h high
short_entry_logic.append((df["STOCHRSIk_14_14_3_3_1h"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 10.0))
# 1h & 4h high
short_entry_logic.append((df["STOCHRSIk_14_14_3_3_1h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 20.0))
# 4h & 1d high
short_entry_logic.append((df["STOCHRSIk_14_14_3_3_4h"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1d"] > 20.0))
# 1d red, 1d high
short_entry_logic.append((df["change_pct_1d"] < 5.0) | (df["STOCHRSIk_14_14_3_3_1d"] > 20.0))
# 1d P&D, 1d high
short_entry_logic.append(
(df["change_pct_1d"] < 10.0)
| (df["change_pct_1d"].shift(288) > -10.0)
| (df["STOCHRSIk_14_14_3_3_1d"] > 50.0)
)
# Logic
short_entry_logic.append(df["RSI_4"] > 54.0)
short_entry_logic.append(df["RSI_20"] > df["RSI_20"].shift(1))
short_entry_logic.append(df["close"] > df["SMA_16"] * 1.042)
# Condition #661 - Scalp mode (Short).
if short_entry_condition_index == 661:
# Protections
short_entry_logic.append(df["num_empty_288"] <= allowed_empty_candles_288)
# 15m down move, 15m high
short_entry_logic.append((df["RSI_3_15m"] < 75.0) | (df["AROOND_14_15m"] < 80.0))
# 15m & 1h down move, 15m still high
short_entry_logic.append((df["RSI_3_15m"] < 70.0) | (df["RSI_3_1h"] < 40.0) | (df["AROOND_14_15m"] < 50.0))
# 15m down move, 15m & 4h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 70.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 50.0)
)
# 15m & 1h down move, 1h high
short_entry_logic.append((df["RSI_3_15m"] < 60.0) | (df["RSI_3_1h"] < 60.0) | (df["AROOND_14_1h"] < 70.0))
# 15m & 1h down move, 1h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 60.0) | (df["RSI_3_1h"] < 60.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0)
)
# 15m & 1h down move, 4h high
short_entry_logic.append((df["RSI_3_15m"] < 60.0) | (df["RSI_3_1h"] < 40.0) | (df["AROOND_14_4h"] < 80.0))
# 15m & 4h down move, 15m high
short_entry_logic.append(
(df["RSI_3_15m"] < 60.0) | (df["RSI_3_4h"] < 60.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 50.0)
)
# 15m & 4h down move, 15m high
short_entry_logic.append(
(df["RSI_3_15m"] < 60.0) | (df["RSI_3_4h"] < 40.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 30.0)
)
# 15m down move, 15m & 1h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 60.0) | (df["AROOND_14_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0)
)
# 15m down move, 15m & 1h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 60.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0)
)
# 15m down move, 4h still high, 1d overbought
short_entry_logic.append((df["RSI_3_15m"] < 60.0) | (df["AROOND_14_4h"] < 50.0) | (df["ROC_9_1d"] > -100.0))
# 15m down move, 15m high, 4h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 55.0) | (df["AROOND_14_15m"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 50.0)
)
# 15m down move, 15m & 1h still high
short_entry_logic.append(
(df["RSI_3_15m"] < 55.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 55.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 60.0)
)
# 15m down move, 15m still not low enough, 4h high
short_entry_logic.append(
(df["RSI_3_15m"] < 50.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 70.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 10.0)
)
# 1h down move, 4h still high, 1d high
short_entry_logic.append(
(df["RSI_3_1h"] < 75.0) | (df["AROOND_14_4h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1d"] > 10.0)
)
short_entry_logic.append(
(df["RSI_3_1h"] < 70.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 60.0) | (df["STOCHRSIk_14_14_3_3_1d"] > 10.0)
)
# 1h & 4h down move, 4h high
short_entry_logic.append(
(df["RSI_3_1h"] < 65.0) | (df["RSI_3_4h"] < 40.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 20.0)
)
# 1h down move, 15m & 1h still high
short_entry_logic.append(
(df["RSI_3_1h"] < 60.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0)
)
# 1h down move, 1h still high, 4h high
short_entry_logic.append(
(df["RSI_3_1h"] < 60.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 70.0)
)
# 1h down move, 1h high
short_entry_logic.append((df["RSI_3_1h"] < 60.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 40.0))
# 1h down move, 4h & 1d high
short_entry_logic.append((df["RSI_3_1h"] < 60.0) | (df["AROOND_14_4h"] < 85.0) | (df["AROOND_14_1d"] < 90.0))
# 1h down move, 1h still high, 4h high
short_entry_logic.append((df["RSI_3_1h"] < 55.0) | (df["AROOND_14_1h"] < 50.0) | (df["AROOND_14_4h"] < 90.0))
# 1h down move, 1h high
short_entry_logic.append((df["RSI_3_1h"] < 55.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 40.0))
# 1h & 4h down move, 15m high
short_entry_logic.append((df["RSI_3_1h"] < 50.0) | (df["RSI_3_4h"] < 40.0) | (df["AROOND_14_15m"] < 70.0))
# 1h down move, 15m still high, 4h high
short_entry_logic.append(
(df["RSI_3_1h"] < 50.0) | (df["AROOND_14_15m"] < 50.0) | (df["AROOND_14_4h"] < 80.0)
)
# 1h down move, 15m high, 1h still high
short_entry_logic.append(
(df["RSI_3_1h"] < 50.0) | (df["AROOND_14_15m"] < 70.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 60.0)
)
# 1h down move, 15m still high, 4h high
short_entry_logic.append(
(df["RSI_3_1h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 20.0)
)
# 1h down move, 15m & 1h high
short_entry_logic.append(
(df["RSI_3_1h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 40.0) | (df["AROOND_14_1h"] < 60.0)
)
# 1h down move, 1h & 1d high
short_entry_logic.append(
(df["RSI_3_1h"] < 50.0) | (df["AROOND_14_1h"] < 70.0) | (df["STOCHRSIk_14_14_3_3_1d"] > 20.0)
)
# 1h down move, 4h still high, 1d high
short_entry_logic.append(
(df["RSI_3_1h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 50.0) | (df["STOCHRSIk_14_14_3_3_1d"] > 10.0)
)
# 1h down move, 5m up move, 1h still high
short_entry_logic.append(
(df["RSI_3_1h"] < 40.0) | (df["RSI_3"] > 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0)
)
# 1h down move, 15m still not low enough, 1h high
short_entry_logic.append(
(df["RSI_3_1h"] < 40.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 70.0) | (df["AROOND_14_1h"] < 70.0)
)
# 1h down move, 15m still not low enough, 1h high
short_entry_logic.append(
(df["RSI_3_1h"] < 40.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 70.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 40.0)
)
# 1h down move, 15m & 4h still high
short_entry_logic.append(
(df["RSI_3_1h"] < 40.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 50.0)
)
# 1h down move, 15m & 1h high
short_entry_logic.append(
(df["RSI_3_1h"] < 40.0) | (df["AROOND_14_15m"] < 70.0) | (df["AROOND_14_1h"] < 90.0)
)
# 1h down move, 1h still high, 4h high
short_entry_logic.append(
(df["RSI_3_1h"] < 40.0) | (df["AROOND_14_1h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 10.0)
)
# 1h down move, 1h high, 4h still high
short_entry_logic.append((df["RSI_3_1h"] < 40.0) | (df["AROOND_14_1h"] < 80.0) | (df["AROOND_14_4h"] < 40.0))
# 1h down move, 1h still high, 4h high
short_entry_logic.append(
(df["RSI_3_1h"] < 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 60.0) | (df["AROOND_14_4h"] < 70.0)
)
# 1h down move, 1h & 1d high
short_entry_logic.append(
(df["RSI_3_1h"] < 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 30.0) | (df["AROOND_14_1d"] < 90.0)
)
# 1h down move, 4h & 1d high
short_entry_logic.append((df["RSI_3_1h"] < 40.0) | (df["RSI_14_4h"] > 30.0) | (df["RSI_14_1d"] > 20.0))
# 4h down move, 15m high
short_entry_logic.append((df["RSI_3_4h"] < 80.0) | (df["AROOND_14_15m"] < 80.0))
# 4h down move, 1h high
short_entry_logic.append((df["RSI_3_4h"] < 75.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 20.0))
# 4h down move, 1h & 4h still high
short_entry_logic.append(
(df["RSI_3_4h"] < 65.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0) | (df["AROOND_14_4h"] < 50.0)
)
# 4h down move, 15m & 1h high
short_entry_logic.append(
(df["RSI_3_4h"] < 60.0) | (df["AROOND_14_15m"] < 80.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 30.0)
)
# 4h down move, 15m still high, 1h high
short_entry_logic.append(
(df["RSI_3_4h"] < 60.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 60.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 20.0)
)
# 4h down move, 1h still high, 4h still moving down
short_entry_logic.append(
(df["RSI_3_4h"] < 60.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0) | (df["CCI_20_change_pct_4h"] < 0.0)
)
# 4h down move, 1h high, 4h still high
short_entry_logic.append((df["RSI_3_4h"] < 55.0) | (df["AROOND_14_1h"] < 70.0) | (df["AROOND_14_4h"] < 50.0))
# 4h down move, 15m high, 4h still high
short_entry_logic.append(
(df["RSI_3_4h"] < 50.0) | (df["AROOND_14_15m"] < 70.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 60.0)
)
# 4h down move, 15m still high, 1h high
short_entry_logic.append(
(df["RSI_3_4h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 60.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 30.0)
)
# 4h down move, 15m & 4h still high
short_entry_logic.append(
(df["RSI_3_4h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 50.0) | (df["AROOND_14_4h"] < 50.0)
)
# 4h down move, 15m high, 4h still not low enough
short_entry_logic.append(
(df["RSI_3_4h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 70.0)
)
# 4h down move, 1h still high, 4h high
short_entry_logic.append(
(df["RSI_3_4h"] < 50.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 50.0) | (df["AROOND_14_4h"] < 70.0)
)
# 4h down move, 15m & 4h high
short_entry_logic.append(
(df["RSI_3_4h"] < 40.0) | (df["AROOND_14_15m"] < 70.0) | (df["AROOND_14_4h"] < 70.0)
)
# 4h down move, 15m high, 4h still high
short_entry_logic.append(
(df["RSI_3_4h"] < 40.0) | (df["AROOND_14_15m"] < 80.0) | (df["AROOND_14_4h"] < 40.0)
)
# 4h down move, 15m still high, 4h high
short_entry_logic.append(
(df["RSI_3_4h"] < 40.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 50.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 30.0)
)
# 4h down move, 15m & 4h high
short_entry_logic.append(
(df["RSI_3_4h"] < 40.0) | (df["STOCHRSIk_14_14_3_3_15m"] > 30.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 40.0)
)
# 4h down move, 1h & 4h high
short_entry_logic.append(
(df["RSI_3_4h"] < 40.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 30.0) | (df["AROOND_14_4h"] < 70.0)
)
# 4h down move, 4h still high, 1d high
short_entry_logic.append(
(df["RSI_3_4h"] < 40.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 50.0) | (df["STOCHRSIk_14_14_3_3_1d"] > 20.0)
)
# 15m high, 4h high
short_entry_logic.append((df["AROOND_14_15m"] < 70.0) | (df["AROOND_14_4h"] < 85.0))
# 15m high, 4h still high
short_entry_logic.append((df["AROOND_14_15m"] < 80.0) | (df["STOCHRSIk_14_14_3_3_4h"] > 50.0))
# 15m high, 1h still high
short_entry_logic.append((df["STOCHRSIk_14_14_3_3_15m"] > 30.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 60.0))
# 15m & 4h high
short_entry_logic.append((df["STOCHRSIk_14_14_3_3_15m"] > 30.0) | (df["AROOND_14_4h"] < 70.0))
# 15m high, 1h still not low enough
short_entry_logic.append((df["STOCHRSIk_14_14_3_3_15m"] > 20.0) | (df["STOCHRSIk_14_14_3_3_1h"] > 70.0))
# Logic
short_entry_logic.append(df["RSI_14"] > 50.0)
short_entry_logic.append(df["AROOND_14_15m"] < 90.0)
short_entry_logic.append(df["STOCHRSIk_14_14_3_3_15m"] > 10.0)
if isinstance(df["SMA_200"].iloc[-1], np.float64):
short_entry_logic.append(df["SMA_21"].shift(1) > df["SMA_200"].shift(1))
short_entry_logic.append(df["SMA_21"] < df["SMA_200"])
else:
short_entry_logic.append(pd.Series([False]))
if isinstance(df["EMA_200_1h"].iloc[-1], np.float64):
short_entry_logic.append(df["close"] < df["EMA_200_1h"])
else:
short_entry_logic.append(pd.Series([False]))
if isinstance(df["EMA_200_4h"].iloc[-1], np.float64):
short_entry_logic.append(df["close"] < df["EMA_200_4h"])
else:
short_entry_logic.append(pd.Series([False]))
short_entry_logic.append(df["BBB_20_2.0_1h"] > 4.0)
###############################################################################################
# SHORT ENTRY CONDITIONS ENDS HERE
###############################################################################################
short_entry_logic.append(df["volume"] > 0)
item_short_entry = reduce(lambda x, y: x & y, short_entry_logic)
df.loc[item_short_entry, "enter_tag"] += f"{short_entry_condition_index} "
short_entry_conditions.append(item_short_entry)
df.loc[:, "enter_short"] = item_short_entry
if short_entry_conditions:
df.loc[:, "enter_short"] = reduce(lambda x, y: x | y, short_entry_conditions)
return df
###############################################################################################
# COMMON FUNCTIONS FOR BOTH LONG AND SHORT SIDE ENDS HERE
###############################################################################################
# /$$ /$$$$$$ /$$ /$$ /$$$$$$ /$$$$$$ /$$$$$$ /$$$$$$$ /$$$$$$$$
# | $$ /$$__ $$| $$$ | $$ /$$__ $$ /$$__ $$|_ $$_/| $$__ $$| $$_____/
# | $$ | $$ \ $$| $$$$| $$| $$ \__/ | $$ \__/ | $$ | $$ \ $$| $$
# | $$ | $$ | $$| $$ $$ $$| $$ /$$$$ | $$$$$$ | $$ | $$ | $$| $$$$$
# | $$ | $$ | $$| $$ $$$$| $$|_ $$ \____ $$ | $$ | $$ | $$| $$__/
# | $$ | $$ | $$| $$\ $$$| $$ \ $$ /$$ \ $$ | $$ | $$ | $$| $$
# | $$$$$$$$| $$$$$$/| $$ \ $$| $$$$$$/ | $$$$$$/ /$$$$$$| $$$$$$$/| $$$$$$$$
# |________/ \______/ |__/ \__/ \______/ \______/ |______/|_______/ |________/
# Long Side Functions for handling long orders
# ---------------------------------------------------------------------------------------------
###############################################################################################
# LONG EXIT FUNCTIONS STARTS HERE
###############################################################################################
#
# /$$ /$$$$$$ /$$ /$$ /$$$$$$ /$$$$$$$$ /$$ /$$ /$$$$$$ /$$$$$$$$
# | $$ /$$__ $$| $$$ | $$ /$$__ $$ | $$_____/| $$ / $$|_ $$_/|__ $$__/
# | $$ | $$ \ $$| $$$$| $$| $$ \__/ | $$ | $$/ $$/ | $$ | $$
# | $$ | $$ | $$| $$ $$ $$| $$ /$$$$ | $$$$$ \ $$$$/ | $$ | $$
# | $$ | $$ | $$| $$ $$$$| $$|_ $$ | $$__/ >$$ $$ | $$ | $$
# | $$ | $$ | $$| $$\ $$$| $$ \ $$ | $$ /$$/\ $$ | $$ | $$
# | $$$$$$$$| $$$$$$/| $$ \ $$| $$$$$$/ | $$$$$$$$| $$ \ $$ /$$$$$$ | $$
# |________/ \______/ |__/ \__/ \______/ |________/|__/ |__/|______/ |__/
#
# Long Exit Normal
# ---------------------------------------------------------------------------------------------
def long_exit_normal(
self,
pair: str,
current_rate: float,
profit_stake: float,
profit_ratio: float,
profit_current_stake_ratio: float,
profit_init_ratio: float,
max_profit: float,
max_loss: float,
filled_entries,
filled_exits,
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
# if the profit is negative skip checking these
if profit_init_ratio > 0.0:
# Original sell signals
sell, signal_name = self.long_exit_signals(
self.long_normal_mode_name,
profit_init_ratio,
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.long_exit_main(
self.long_normal_mode_name,
profit_init_ratio,
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.long_exit_williams_r(
self.long_normal_mode_name,
profit_init_ratio,
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,
)
# Downtrend/descending based sells
if not sell:
sell, signal_name = self.long_exit_dec(
self.long_normal_mode_name,
profit_init_ratio,
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.long_exit_stoploss(
self.long_normal_mode_name,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
max_profit,
max_loss,
filled_entries,
filled_exits,
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.exit_profit_target(
self.long_normal_mode_name,
pair,
trade,
current_time,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
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 previous_sell_reason in [f"exit_{self.long_normal_mode_name}_stoploss_u_e"]:
if profit_ratio > (previous_profit + 0.005):
mark_pair, mark_signal = self.mark_profit_target(
self.long_normal_mode_name,
pair,
True,
previous_sell_reason,
trade,
current_time,
current_rate,
profit_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_ratio, current_time)
elif (profit_init_ratio > (previous_profit + 0.001)) and (
previous_sell_reason not in [f"exit_{self.long_normal_mode_name}_stoploss_doom"]
):
# Update the target, raise it.
mark_pair, mark_signal = self.mark_profit_target(
self.long_normal_mode_name,
pair,
True,
previous_sell_reason,
trade,
current_time,
current_rate,
profit_init_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_init_ratio, 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
previous_sell_reason = ""
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"]
previous_sell_reason = self.target_profit_cache.data[pair]["sell_reason"]
if signal_name in [
f"exit_{self.long_normal_mode_name}_stoploss_doom",
f"exit_{self.long_normal_mode_name}_stoploss_u_e",
] and (
previous_sell_reason
not in [
f"exit_{self.long_normal_mode_name}_stoploss_doom",
f"exit_profit_{self.long_normal_mode_name}_stoploss_u_e",
]
):
mark_pair, mark_signal = self.mark_profit_target(
self.long_normal_mode_name,
pair,
sell,
signal_name,
trade,
current_time,
current_rate,
profit_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_ratio, current_time)
else:
# Just sell it, without maximize
return True, f"{signal_name}"
elif (previous_profit is None) or (previous_profit < profit_init_ratio):
mark_pair, mark_signal = self.mark_profit_target(
self.long_normal_mode_name,
pair,
sell,
signal_name,
trade,
current_time,
current_rate,
profit_init_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_init_ratio, current_time)
else:
# Just sell it, without maximize
return True, f"{signal_name}"
else:
if profit_init_ratio >= 0.005:
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 < profit_init_ratio):
mark_signal = f"exit_profit_{self.long_normal_mode_name}_max"
self._set_profit_target(pair, mark_signal, current_rate, profit_init_ratio, current_time)
if signal_name not in [
f"exit_profit_{self.long_normal_mode_name}_max",
f"exit_{self.long_normal_mode_name}_stoploss_doom",
f"exit_{self.long_normal_mode_name}_stoploss_u_e",
]:
if sell and (signal_name is not None):
return True, f"{signal_name}"
# Here ends exit signal conditions for long_exit_normal
return False, None
# Long Exit Pump
# ---------------------------------------------------------------------------------------------
def long_exit_pump(
self,
pair: str,
current_rate: float,
profit_stake: float,
profit_ratio: float,
profit_current_stake_ratio: float,
profit_init_ratio: float,
max_profit: float,
max_loss: float,
filled_entries,
filled_exits,
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
# if the profit is negative skip checking these
if profit_init_ratio > 0.0:
# Original sell signals
sell, signal_name = self.long_exit_signals(
self.long_pump_mode_name,
profit_init_ratio,
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.long_exit_main(
self.long_pump_mode_name,
profit_init_ratio,
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.long_exit_williams_r(
self.long_pump_mode_name,
profit_init_ratio,
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,
)
# Downtrend/descending based sells
if not sell:
sell, signal_name = self.long_exit_dec(
self.long_pump_mode_name,
profit_init_ratio,
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.long_exit_stoploss(
self.long_pump_mode_name,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
max_profit,
max_loss,
filled_entries,
filled_exits,
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.exit_profit_target(
self.long_pump_mode_name,
pair,
trade,
current_time,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
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 previous_sell_reason in [f"exit_{self.long_pump_mode_name}_stoploss_u_e"]:
if profit_ratio > (previous_profit + 0.005):
mark_pair, mark_signal = self.mark_profit_target(
self.long_pump_mode_name,
pair,
True,
previous_sell_reason,
trade,
current_time,
current_rate,
profit_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_ratio, current_time)
elif (profit_init_ratio > (previous_profit + 0.001)) and (
previous_sell_reason not in [f"exit_{self.long_pump_mode_name}_stoploss_doom"]
):
# Update the target, raise it.
mark_pair, mark_signal = self.mark_profit_target(
self.long_pump_mode_name,
pair,
True,
previous_sell_reason,
trade,
current_time,
current_rate,
profit_init_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_init_ratio, 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 signal_name in [
f"exit_{self.long_pump_mode_name}_stoploss_doom",
f"exit_{self.long_pump_mode_name}_stoploss_u_e",
]:
mark_pair, mark_signal = self.mark_profit_target(
self.long_pump_mode_name,
pair,
sell,
signal_name,
trade,
current_time,
current_rate,
profit_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_ratio, current_time)
else:
# Just sell it, without maximize
return True, f"{signal_name}"
elif (previous_profit is None) or (previous_profit < profit_init_ratio):
mark_pair, mark_signal = self.mark_profit_target(
self.long_pump_mode_name,
pair,
sell,
signal_name,
trade,
current_time,
current_rate,
profit_init_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_init_ratio, current_time)
else:
# Just sell it, without maximize
return True, f"{signal_name}"
else:
if profit_init_ratio >= 0.005:
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 < profit_init_ratio):
mark_signal = f"exit_profit_{self.long_pump_mode_name}_max"
self._set_profit_target(pair, mark_signal, current_rate, profit_init_ratio, current_time)
if signal_name not in [
f"exit_profit_{self.long_pump_mode_name}_max",
f"exit_{self.long_pump_mode_name}_stoploss_doom",
f"exit_{self.long_pump_mode_name}_stoploss_u_e",
]:
if sell and (signal_name is not None):
return True, f"{signal_name}"
# Here ends exit signal conditions for long_exit_pump
return False, None
# Long Exit Quick
# ---------------------------------------------------------------------------------------------
def long_exit_quick(
self,
pair: str,
current_rate: float,
profit_stake: float,
profit_ratio: float,
profit_current_stake_ratio: float,
profit_init_ratio: float,
max_profit: float,
max_loss: float,
filled_entries,
filled_exits,
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
# if the profit is negative skip checking these
if profit_init_ratio > 0.0:
# Original sell signals
sell, signal_name = self.long_exit_signals(
self.long_quick_mode_name,
profit_init_ratio,
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.long_exit_main(
self.long_quick_mode_name,
profit_init_ratio,
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.long_exit_williams_r(
self.long_quick_mode_name,
profit_init_ratio,
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,
)
# Downtrend/descending based sells
if not sell:
sell, signal_name = self.long_exit_dec(
self.long_quick_mode_name,
profit_init_ratio,
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.long_exit_stoploss(
self.long_quick_mode_name,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
max_profit,
max_loss,
filled_entries,
filled_exits,
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 >= profit_init_ratio > 0.02) and (last_candle["RSI_14"] > 78.0):
sell, signal_name = True, f"exit_{self.long_quick_mode_name}_q_1"
elif (0.09 >= profit_init_ratio > 0.02) and (last_candle["MFI_14"] > 84.0):
sell, signal_name = True, f"exit_{self.long_quick_mode_name}_q_2"
elif (0.09 >= profit_init_ratio > 0.02) and (last_candle["WILLR_14"] >= -0.1):
sell, signal_name = True, f"exit_{self.long_quick_mode_name}_q_3"
elif (
(0.09 >= profit_init_ratio > 0.02)
and (last_candle["RSI_14"] >= 72.0)
and (last_candle["RSI_3"] > 90.0)
and (last_candle["RSI_3_15m"] > 90.0)
):
sell, signal_name = True, f"exit_{self.long_quick_mode_name}_q_4"
elif (0.09 >= profit_init_ratio > 0.02) and (last_candle["RSI_3_15m"] > 96.0):
sell, signal_name = True, f"exit_{self.long_quick_mode_name}_q_5"
elif (0.09 >= profit_init_ratio > 0.02) and (last_candle["RSI_3"] > 85.0) and (last_candle["RSI_3_15m"] > 85.0):
sell, signal_name = True, f"exit_{self.long_quick_mode_name}_q_6"
elif (0.09 >= profit_init_ratio > 0.02) and (last_candle["RSI_3"] > 90.0) and (last_candle["RSI_3_15m"] > 80.0):
sell, signal_name = True, f"exit_{self.long_quick_mode_name}_q_7"
elif (0.09 >= profit_init_ratio > 0.02) and (last_candle["RSI_3"] > 92.0) and (last_candle["RSI_3_15m"] > 75.0):
sell, signal_name = True, f"exit_{self.long_quick_mode_name}_q_8"
elif (0.09 >= profit_init_ratio > 0.02) and (last_candle["RSI_3"] > 94.0) and (last_candle["RSI_3_15m"] > 70.0):
sell, signal_name = True, f"exit_{self.long_quick_mode_name}_q_9"
elif (0.09 >= profit_init_ratio > 0.02) and (last_candle["RSI_3"] > 99.0):
sell, signal_name = True, f"exit_{self.long_quick_mode_name}_q_10"
# 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.exit_profit_target(
self.long_quick_mode_name,
pair,
trade,
current_time,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
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 previous_sell_reason in [f"exit_{self.long_quick_mode_name}_stoploss_u_e"]:
if profit_ratio > (previous_profit + 0.001):
mark_pair, mark_signal = self.mark_profit_target(
self.long_quick_mode_name,
pair,
True,
previous_sell_reason,
trade,
current_time,
current_rate,
profit_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_ratio, current_time)
elif (profit_init_ratio > (previous_profit + 0.001)) and (
previous_sell_reason not in [f"exit_{self.long_quick_mode_name}_stoploss_doom"]
):
# Update the target, raise it.
mark_pair, mark_signal = self.mark_profit_target(
self.long_quick_mode_name,
pair,
True,
previous_sell_reason,
trade,
current_time,
current_rate,
profit_init_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_init_ratio, 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
previous_sell_reason = ""
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"]
previous_sell_reason = self.target_profit_cache.data[pair]["sell_reason"]
if signal_name in [
f"exit_{self.long_quick_mode_name}_stoploss_doom",
f"exit_{self.long_quick_mode_name}_stoploss_u_e",
] and (
previous_sell_reason
not in [
f"exit_{self.long_quick_mode_name}_stoploss_doom",
f"exit_profit_{self.long_quick_mode_name}_stoploss_u_e",
]
):
mark_pair, mark_signal = self.mark_profit_target(
self.long_quick_mode_name,
pair,
sell,
signal_name,
trade,
current_time,
current_rate,
profit_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_ratio, current_time)
else:
# Just sell it, without maximize
return True, f"{signal_name}"
elif (previous_profit is None) or (previous_profit < profit_init_ratio):
mark_pair, mark_signal = self.mark_profit_target(
self.long_quick_mode_name,
pair,
sell,
signal_name,
trade,
current_time,
current_rate,
profit_init_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_init_ratio, current_time)
else:
# Just sell it, without maximize
return True, f"{signal_name}"
else:
if profit_init_ratio >= 0.005:
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 < profit_init_ratio):
mark_signal = f"exit_profit_{self.long_quick_mode_name}_max"
self._set_profit_target(pair, mark_signal, current_rate, profit_init_ratio, current_time)
if signal_name not in [
f"exit_profit_{self.long_quick_mode_name}_max",
f"exit_{self.long_quick_mode_name}_stoploss_doom",
f"exit_{self.long_quick_mode_name}_stoploss_u_e",
]:
if sell and (signal_name is not None):
return True, f"{signal_name}"
# Here ends exit signal conditions for long_exit_quick
return False, None
# Long Exit Rebuy
# ---------------------------------------------------------------------------------------------
def long_exit_rebuy(
self,
pair: str,
current_rate: float,
profit_stake: float,
profit_ratio: float,
profit_current_stake_ratio: float,
profit_init_ratio: float,
max_profit: float,
max_loss: float,
filled_entries,
filled_exits,
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:
is_backtest = self.dp.runmode.value in ["backtest", "hyperopt"]
sell = False
# Original sell signals
sell, signal_name = self.long_exit_signals(
self.long_rebuy_mode_name,
profit_current_stake_ratio,
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.long_exit_main(
self.long_rebuy_mode_name,
profit_current_stake_ratio,
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.long_exit_williams_r(
self.long_rebuy_mode_name,
profit_current_stake_ratio,
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,
)
# Downtrend/descending based sells
if not sell:
sell, signal_name = self.long_exit_dec(
self.long_rebuy_mode_name,
profit_current_stake_ratio,
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:
if (
profit_stake
< -(
filled_entries[0].cost
* (self.stop_threshold_futures_rebuy if self.is_futures_mode else self.stop_threshold_spot_rebuy)
# / (trade.leverage if self.is_futures_mode else 1.0)
)
# temporary
and (trade.open_date_utc.replace(tzinfo=None) >= datetime(2024, 9, 13) or is_backtest)
):
sell, signal_name = True, f"exit_{self.long_rebuy_mode_name}_stoploss_doom"
# 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.exit_profit_target(
self.long_rebuy_mode_name,
pair,
trade,
current_time,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
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 previous_sell_reason in [f"exit_{self.long_rebuy_mode_name}_stoploss_u_e"]:
if profit_ratio > (previous_profit + 0.001):
mark_pair, mark_signal = self.mark_profit_target(
self.long_rebuy_mode_name,
pair,
True,
previous_sell_reason,
trade,
current_time,
current_rate,
profit_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_ratio, current_time)
elif (profit_init_ratio > (previous_profit + 0.001)) and (
previous_sell_reason not in [f"exit_{self.long_rebuy_mode_name}_stoploss_doom"]
):
# Update the target, raise it.
mark_pair, mark_signal = self.mark_profit_target(
self.long_rebuy_mode_name,
pair,
True,
previous_sell_reason,
trade,
current_time,
current_rate,
profit_init_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_init_ratio, 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 signal_name in [
f"exit_{self.long_rebuy_mode_name}_stoploss_doom",
f"exit_{self.long_rebuy_mode_name}_stoploss_u_e",
]:
mark_pair, mark_signal = self.mark_profit_target(
self.long_rebuy_mode_name,
pair,
sell,
signal_name,
trade,
current_time,
current_rate,
profit_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_ratio, current_time)
else:
# Just sell it, without maximize
return True, f"{signal_name}"
elif (previous_profit is None) or (previous_profit < profit_init_ratio):
mark_pair, mark_signal = self.mark_profit_target(
self.long_rebuy_mode_name,
pair,
sell,
signal_name,
trade,
current_time,
current_rate,
profit_init_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_init_ratio, current_time)
else:
# Just sell it, without maximize
return True, f"{signal_name}"
else:
if profit_init_ratio >= 0.005:
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 < profit_init_ratio):
mark_signal = f"exit_profit_{self.long_rebuy_mode_name}_max"
self._set_profit_target(pair, mark_signal, current_rate, profit_init_ratio, current_time)
if signal_name not in [
f"exit_profit_{self.long_rebuy_mode_name}_max",
f"exit_{self.long_rebuy_mode_name}_stoploss_doom",
f"exit_{self.long_rebuy_mode_name}_stoploss_u_e",
]:
if sell and (signal_name is not None):
return True, f"{signal_name}"
# Here ends exit signal conditions for long_exit_rebuy
return False, None
# Long Exit High Profit
# ---------------------------------------------------------------------------------------------
def long_exit_high_profit(
self,
pair: str,
current_rate: float,
profit_stake: float,
profit_ratio: float,
profit_current_stake_ratio: float,
profit_init_ratio: float,
max_profit: float,
max_loss: float,
filled_entries,
filled_exits,
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.long_exit_signals(
self.long_high_profit_mode_name,
profit_init_ratio,
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.long_exit_main(
self.long_high_profit_mode_name,
profit_init_ratio,
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.long_exit_williams_r(
self.long_high_profit_mode_name,
profit_init_ratio,
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.long_exit_stoploss(
self.long_high_profit_mode_name,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
max_profit,
max_loss,
filled_entries,
filled_exits,
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.exit_profit_target(
self.long_high_profit_mode_name,
pair,
trade,
current_time,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
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 previous_sell_reason in [f"exit_{self.long_high_profit_mode_name}_stoploss_u_e"]:
if profit_ratio > (previous_profit + 0.001):
mark_pair, mark_signal = self.mark_profit_target(
self.long_high_profit_mode_name,
pair,
True,
previous_sell_reason,
trade,
current_time,
current_rate,
profit_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_ratio, current_time)
elif (profit_init_ratio > (previous_profit + 0.001)) and (
previous_sell_reason not in [f"exit_{self.long_high_profit_mode_name}_stoploss_doom"]
):
# Update the target, raise it.
mark_pair, mark_signal = self.mark_profit_target(
self.long_high_profit_mode_name,
pair,
True,
previous_sell_reason,
trade,
current_time,
current_rate,
profit_init_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_init_ratio, 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 signal_name in [
f"exit_{self.long_high_profit_mode_name}_stoploss_doom",
f"exit_{self.long_high_profit_mode_name}_stoploss_u_e",
]:
mark_pair, mark_signal = self.mark_profit_target(
self.long_high_profit_mode_name,
pair,
sell,
signal_name,
trade,
current_time,
current_rate,
profit_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_ratio, current_time)
else:
# Just sell it, without maximize
return True, f"{signal_name}"
elif (previous_profit is None) or (previous_profit < profit_init_ratio):
mark_pair, mark_signal = self.mark_profit_target(
self.long_high_profit_mode_name,
pair,
sell,
signal_name,
trade,
current_time,
current_rate,
profit_init_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_init_ratio, current_time)
else:
# Just sell it, without maximize
return True, f"{signal_name}"
else:
if profit_init_ratio >= 0.03:
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 < profit_init_ratio):
mark_signal = f"exit_profit_{self.long_high_profit_mode_name}_max"
self._set_profit_target(pair, mark_signal, current_rate, profit_init_ratio, current_time)
if signal_name not in [
f"exit_profit_{self.long_high_profit_mode_name}_max",
# f"exit_{self.long_high_profit_mode_name}_stoploss_doom",
# f"exit_{self.long_high_profit_mode_name}_stoploss_u_e",
]:
if sell and (signal_name is not None):
return True, f"{signal_name}"
# Here ends exit signal conditions for long_exit_high_profit
return False, None
# Long Exit Rapid
# ---------------------------------------------------------------------------------------------
def long_exit_rapid(
self,
pair: str,
current_rate: float,
profit_stake: float,
profit_ratio: float,
profit_current_stake_ratio: float,
profit_init_ratio: float,
max_profit: float,
max_loss: float,
filled_entries,
filled_exits,
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:
is_backtest = self.is_backtest_mode()
sell = False
signal_name = None
# if the profit is negative skip checking these
if profit_init_ratio > 0.0:
# Original sell signals
sell, signal_name = self.long_exit_signals(
self.long_rapid_mode_name,
profit_init_ratio,
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.long_exit_main(
self.long_rapid_mode_name,
profit_init_ratio,
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.long_exit_williams_r(
self.long_rapid_mode_name,
profit_init_ratio,
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,
)
# Downtrend/descending based sells
if not sell:
sell, signal_name = self.long_exit_dec(
self.long_rapid_mode_name,
profit_init_ratio,
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 exit logic
if not sell:
if (0.09 >= profit_init_ratio > 0.005) and (last_candle["RSI_14"] > 78.0):
sell, signal_name = True, f"exit_{self.long_rapid_mode_name}_rpd_1"
elif (0.09 >= profit_init_ratio > 0.005) and (last_candle["MFI_14"] > 84.0):
sell, signal_name = True, f"exit_{self.long_rapid_mode_name}_rpd_2"
elif (0.09 >= profit_init_ratio > 0.005) and (last_candle["WILLR_14"] >= -0.1):
sell, signal_name = True, f"exit_{self.long_rapid_mode_name}_rpd_3"
elif (
(0.09 >= profit_init_ratio > 0.005)
and (last_candle["RSI_14"] >= 72.0)
and (last_candle["RSI_3"] > 90.0)
and (last_candle["RSI_3_15m"] > 90.0)
):
sell, signal_name = True, f"exit_{self.long_rapid_mode_name}_rpd_4"
elif (0.09 >= profit_init_ratio > 0.005) and (last_candle["RSI_3_15m"] > 96.0):
sell, signal_name = True, f"exit_{self.long_rapid_mode_name}_rpd_5"
elif (0.09 >= profit_init_ratio > 0.005) and (last_candle["RSI_3"] > 85.0) and (last_candle["RSI_3_15m"] > 85.0):
sell, signal_name = True, f"exit_{self.long_rapid_mode_name}_rpd_6"
elif (0.09 >= profit_init_ratio > 0.005) and (last_candle["RSI_3"] > 90.0) and (last_candle["RSI_3_15m"] > 80.0):
sell, signal_name = True, f"exit_{self.long_rapid_mode_name}_rpd_7"
elif (0.09 >= profit_init_ratio > 0.005) and (last_candle["RSI_3"] > 92.0) and (last_candle["RSI_3_15m"] > 75.0):
sell, signal_name = True, f"exit_{self.long_rapid_mode_name}_rpd_8"
elif (0.09 >= profit_init_ratio > 0.005) and (last_candle["RSI_3"] > 94.0) and (last_candle["RSI_3_15m"] > 70.0):
sell, signal_name = True, f"exit_{self.long_rapid_mode_name}_rpd_9"
elif (0.09 >= profit_init_ratio > 0.005) and (last_candle["RSI_3"] > 99.0):
sell, signal_name = True, f"exit_{self.long_rapid_mode_name}_rpd_10"
# Stoplosses
if (
(
self.stops_enable
and (
profit_stake
< -(
filled_entries[0].cost
* (self.stop_threshold_rapid_futures if self.is_futures_mode else self.stop_threshold_rapid_spot)
)
)
)
# temporary
and (trade.open_date_utc.replace(tzinfo=None) >= datetime(2024, 9, 13) or is_backtest)
):
sell, signal_name = True, f"exit_{self.long_rapid_mode_name}_stoploss_doom"
# 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.exit_profit_target(
self.long_rapid_mode_name,
pair,
trade,
current_time,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
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 previous_sell_reason in [f"exit_{self.long_rapid_mode_name}_stoploss_u_e"]:
if profit_ratio > (previous_profit + 0.001):
mark_pair, mark_signal = self.mark_profit_target(
self.long_rapid_mode_name,
pair,
True,
previous_sell_reason,
trade,
current_time,
current_rate,
profit_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_ratio, current_time)
elif (profit_init_ratio > (previous_profit + 0.001)) and (
previous_sell_reason not in [f"exit_{self.long_rapid_mode_name}_stoploss_doom"]
):
# Update the target, raise it.
mark_pair, mark_signal = self.mark_profit_target(
self.long_rapid_mode_name,
pair,
True,
previous_sell_reason,
trade,
current_time,
current_rate,
profit_init_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_init_ratio, 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
previous_sell_reason = ""
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"]
previous_sell_reason = self.target_profit_cache.data[pair]["sell_reason"]
if signal_name in [
f"exit_{self.long_rapid_mode_name}_stoploss_doom",
f"exit_{self.long_rapid_mode_name}_stoploss_u_e",
] and (
previous_sell_reason
not in [
f"exit_{self.long_rapid_mode_name}_stoploss_doom",
f"exit_profit_{self.long_rapid_mode_name}_stoploss_u_e",
]
):
mark_pair, mark_signal = self.mark_profit_target(
self.long_rapid_mode_name,
pair,
sell,
signal_name,
trade,
current_time,
current_rate,
profit_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_ratio, current_time)
else:
# Just sell it, without maximize
return True, f"{signal_name}"
elif (previous_profit is None) or (previous_profit < profit_init_ratio):
mark_pair, mark_signal = self.mark_profit_target(
self.long_rapid_mode_name,
pair,
sell,
signal_name,
trade,
current_time,
current_rate,
profit_init_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_init_ratio, current_time)
else:
# Just sell it, without maximize
return True, f"{signal_name}"
else:
if profit_init_ratio >= 0.005:
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 < profit_init_ratio):
mark_signal = f"exit_profit_{self.long_rapid_mode_name}_max"
self._set_profit_target(pair, mark_signal, current_rate, profit_init_ratio, current_time)
if signal_name not in [
f"exit_profit_{self.long_rapid_mode_name}_max",
f"exit_{self.long_rapid_mode_name}_stoploss_doom",
f"exit_{self.long_rapid_mode_name}_stoploss_u_e",
]:
if sell and (signal_name is not None):
return True, f"{signal_name}"
# Here ends exit signal conditions for long_exit_rapid
return False, None
# Long Exit Grind
# ---------------------------------------------------------------------------------------------
def long_exit_grind(
self,
pair: str,
current_rate: float,
profit_stake: float,
profit_ratio: float,
profit_current_stake_ratio: float,
profit_init_ratio: float,
max_profit: float,
max_loss: float,
filled_entries,
filled_exits,
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:
if profit_init_ratio > 0.25:
return True, f"exit_{self.long_grind_mode_name}_g"
# Here ends exit signal conditions for long_exit_grind
return False, None
# Long Exit Top Coins
# ---------------------------------------------------------------------------------------------
def long_exit_top_coins(
self,
pair: str,
current_rate: float,
profit_stake: float,
profit_ratio: float,
profit_current_stake_ratio: float,
profit_init_ratio: float,
max_profit: float,
max_loss: float,
filled_entries,
filled_exits,
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.long_exit_signals(
self.long_top_coins_mode_name,
profit_init_ratio,
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.long_exit_main(
self.long_top_coins_mode_name,
profit_init_ratio,
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.long_exit_williams_r(
self.long_top_coins_mode_name,
profit_init_ratio,
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,
)
# Downtrend/descending based sells
if not sell:
sell, signal_name = self.long_exit_dec(
self.long_top_coins_mode_name,
profit_init_ratio,
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.long_exit_stoploss(
self.long_top_coins_mode_name,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
max_profit,
max_loss,
filled_entries,
filled_exits,
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.exit_profit_target(
self.long_top_coins_mode_name,
pair,
trade,
current_time,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
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 previous_sell_reason in [f"exit_{self.long_top_coins_mode_name}_stoploss_u_e"]:
if profit_ratio > (previous_profit + 0.005):
mark_pair, mark_signal = self.mark_profit_target(
self.long_top_coins_mode_name,
pair,
True,
previous_sell_reason,
trade,
current_time,
current_rate,
profit_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_ratio, current_time)
elif (profit_init_ratio > (previous_profit + 0.001)) and (
previous_sell_reason not in [f"exit_{self.long_top_coins_mode_name}_stoploss_doom"]
):
# Update the target, raise it.
mark_pair, mark_signal = self.mark_profit_target(
self.long_top_coins_mode_name,
pair,
True,
previous_sell_reason,
trade,
current_time,
current_rate,
profit_init_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_init_ratio, 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
previous_sell_reason = ""
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"]
previous_sell_reason = self.target_profit_cache.data[pair]["sell_reason"]
if signal_name in [
f"exit_{self.long_top_coins_mode_name}_stoploss_doom",
f"exit_{self.long_top_coins_mode_name}_stoploss_u_e",
] and (
previous_sell_reason
not in [
f"exit_{self.long_top_coins_mode_name}_stoploss_doom",
f"exit_profit_{self.long_top_coins_mode_name}_stoploss_u_e",
]
):
mark_pair, mark_signal = self.mark_profit_target(
self.long_top_coins_mode_name,
pair,
sell,
signal_name,
trade,
current_time,
current_rate,
profit_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_ratio, current_time)
else:
# Just sell it, without maximize
return True, f"{signal_name}"
elif (previous_profit is None) or (previous_profit < profit_init_ratio):
mark_pair, mark_signal = self.mark_profit_target(
self.long_top_coins_mode_name,
pair,
sell,
signal_name,
trade,
current_time,
current_rate,
profit_init_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_init_ratio, current_time)
else:
# Just sell it, without maximize
return True, f"{signal_name}"
else:
if profit_init_ratio >= 0.005:
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 < profit_init_ratio):
mark_signal = f"exit_profit_{self.long_top_coins_mode_name}_max"
self._set_profit_target(pair, mark_signal, current_rate, profit_init_ratio, current_time)
if signal_name not in [
f"exit_profit_{self.long_top_coins_mode_name}_max",
f"exit_{self.long_top_coins_mode_name}_stoploss_doom",
f"exit_{self.long_top_coins_mode_name}_stoploss_u_e",
]:
if sell and (signal_name is not None):
return True, f"{signal_name}"
# Here ends exit signal conditions for long_exit_top_coins
return False, None
# Long Exit Scalp
# ---------------------------------------------------------------------------------------------
def long_exit_scalp(
self,
pair: str,
current_rate: float,
profit_stake: float,
profit_ratio: float,
profit_current_stake_ratio: float,
profit_init_ratio: float,
max_profit: float,
max_loss: float,
filled_entries,
filled_exits,
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.long_exit_signals(
self.long_scalp_mode_name,
profit_init_ratio,
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.long_exit_main(
self.long_scalp_mode_name,
profit_init_ratio,
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.long_exit_williams_r(
self.long_scalp_mode_name,
profit_init_ratio,
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,
)
# Downtrend/descending based sells
if not sell:
sell, signal_name = self.long_exit_dec(
self.long_scalp_mode_name,
profit_init_ratio,
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 exit logic
if not sell:
# Stoplosses
if profit_stake < -(
filled_entries[0].cost
* (self.stop_threshold_scalp_futures if self.is_futures_mode else self.stop_threshold_scalp_spot)
# / (trade.leverage if self.is_futures_mode else 1.0)
):
sell, signal_name = True, f"exit_{self.long_scalp_mode_name}_stoploss_doom"
# 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.exit_profit_target(
self.long_scalp_mode_name,
pair,
trade,
current_time,
current_rate,
profit_stake,
profit_ratio,
profit_current_stake_ratio,
profit_init_ratio,
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 previous_sell_reason in [f"exit_{self.long_scalp_mode_name}_stoploss_u_e"]:
if profit_ratio > (previous_profit + 0.005):
mark_pair, mark_signal = self.mark_profit_target(
self.long_scalp_mode_name,
pair,
True,
previous_sell_reason,
trade,
current_time,
current_rate,
profit_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_ratio, current_time)
elif (profit_init_ratio > (previous_profit + 0.001)) and (
previous_sell_reason not in [f"exit_{self.long_scalp_mode_name}_stoploss_doom"]
):
# Update the target, raise it.
mark_pair, mark_signal = self.mark_profit_target(
self.long_scalp_mode_name,
pair,
True,
previous_sell_reason,
trade,
current_time,
current_rate,
profit_init_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_init_ratio, 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 signal_name in [
f"exit_{self.long_scalp_mode_name}_stoploss_doom",
f"exit_{self.long_scalp_mode_name}_stoploss_u_e",
]:
mark_pair, mark_signal = self.mark_profit_target(
self.long_scalp_mode_name,
pair,
sell,
signal_name,
trade,
current_time,
current_rate,
profit_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_ratio, current_time)
else:
# Just sell it, without maximize
return True, f"{signal_name}"
elif (previous_profit is None) or (previous_profit < profit_init_ratio):
mark_pair, mark_signal = self.mark_profit_target(
self.long_scalp_mode_name,
pair,
sell,
signal_name,
trade,
current_time,
current_rate,
profit_init_ratio,
last_candle,
previous_candle_1,
)
if mark_pair:
self._set_profit_target(pair, mark_signal, current_rate, profit_init_ratio, current_time)
else:
# Just sell it, without maximize
return True, f"{signal_name}"
else:
if profit_init_ratio >= 0.005:
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 < profit_init_ratio):
mark_signal = f"exit_profit_{self.long_scalp_mode_name}_max"
self._set_profit_target(pair, mark_signal, current_rate, profit_init_ratio, current_time)
if signal_name not in [
f"exit_profit_{self.long_scalp_mode_name}_max",
f"exit_{self.long_scalp_mode_name}_stoploss_doom",
f"exit_{self.long_scalp_mode_name}_stoploss_u_e",
]:
if sell and (signal_name is not None):
return True, f"{signal_name}"
# Here ends exit signal conditions for long_exit_derisk
return False, None
# Long Exit Signals
# ---------------------------------------------------------------------------------------------
def long_exit_signals(
self,
mode_name: str,
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"] > 84.0)
and (last_candle["close"] > last_candle["BBU_20_2.0"])
and (previous_candle_1["close"] > previous_candle_1["BBU_20_2.0"])
and (previous_candle_2["close"] > previous_candle_2["BBU_20_2.0"])
and (previous_candle_3["close"] > previous_candle_3["BBU_20_2.0"])
and (previous_candle_4["close"] > previous_candle_4["BBU_20_2.0"])
):
if last_candle["close"] > last_candle["EMA_200"]:
if current_profit > 0.01:
return True, f"exit_{mode_name}_1_1_1"
else:
if current_profit > 0.01:
return True, f"exit_{mode_name}_1_2_1"
# Sell signal 2
elif (
(last_candle["RSI_14"] > 86.0)
and (last_candle["close"] > last_candle["BBU_20_2.0"])
and (previous_candle_1["close"] > previous_candle_1["BBU_20_2.0"])
and (previous_candle_2["close"] > previous_candle_2["BBU_20_2.0"])
):
if last_candle["close"] > last_candle["EMA_200"]:
if current_profit > 0.01:
return True, f"exit_{mode_name}_2_1_1"
else:
if current_profit > 0.01:
return True, f"exit_{mode_name}_2_2_1"
# Sell signal 3
elif last_candle["RSI_14"] > 88.0:
if last_candle["close"] > last_candle["EMA_200"]:
if current_profit > 0.01:
return True, f"exit_{mode_name}_3_1_1"
else:
if current_profit > 0.01:
return True, f"exit_{mode_name}_3_2_1"
# Sell signal 4
elif (last_candle["RSI_14"] > 84.0) and (last_candle["RSI_14_1h"] > 80.0):
if last_candle["close"] > last_candle["EMA_200"]:
if current_profit > 0.01:
return True, f"exit_{mode_name}_4_1_1"
else:
if current_profit > 0.01:
return True, f"exit_{mode_name}_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, f"exit_{mode_name}_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, f"exit_{mode_name}_7_1_1"
# else:
# if current_profit > 0.01:
# return True, f"exit_{mode_name}_7_2_1"
# Sell signal 8
elif last_candle["close"] > last_candle["BBU_20_2.0_1h"] * 1.14:
if last_candle["close"] > last_candle["EMA_200"]:
if current_profit > 0.01:
return True, f"exit_{mode_name}_8_1_1"
else:
if current_profit > 0.01:
return True, f"exit_{mode_name}_8_2_1"
# Here ends exit signal conditions for long_exit_signals
return False, None
# Long Exit Main
# ---------------------------------------------------------------------------------------------
def long_exit_main(
self,
mode_name: str,
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["EMA_200"]:
if 0.01 > current_profit >= 0.001:
if last_candle["RSI_14"] < 10.0:
return True, f"exit_{mode_name}_o_0"
elif 0.02 > current_profit >= 0.01:
if last_candle["RSI_14"] < 28.0:
return True, f"exit_{mode_name}_o_1"
elif 0.03 > current_profit >= 0.02:
if last_candle["RSI_14"] < 30.0:
return True, f"exit_{mode_name}_o_2"
elif 0.04 > current_profit >= 0.03:
if last_candle["RSI_14"] < 32.0:
return True, f"exit_{mode_name}_o_3"
elif 0.05 > current_profit >= 0.04:
if last_candle["RSI_14"] < 34.0:
return True, f"exit_{mode_name}_o_4"
elif 0.06 > current_profit >= 0.05:
if last_candle["RSI_14"] < 36.0:
return True, f"exit_{mode_name}_o_5"
elif 0.07 > current_profit >= 0.06:
if last_candle["RSI_14"] < 38.0:
return True, f"exit_{mode_name}_o_6"
elif 0.08 > current_profit >= 0.07:
if last_candle["RSI_14"] < 40.0:
return True, f"exit_{mode_name}_o_7"
elif 0.09 > current_profit >= 0.08:
if last_candle["RSI_14"] < 42.0:
return True, f"exit_{mode_name}_o_8"
elif 0.1 > current_profit >= 0.09:
if last_candle["RSI_14"] < 44.0:
return True, f"exit_{mode_name}_o_9"
elif 0.12 > current_profit >= 0.1:
if last_candle["RSI_14"] < 46.0:
return True, f"exit_{mode_name}_o_10"
elif 0.2 > current_profit >= 0.12:
if last_candle["RSI_14"] < 44.0:
return True, f"exit_{mode_name}_o_11"
elif current_profit >= 0.2:
if last_candle["RSI_14"] < 42.0:
return True, f"exit_{mode_name}_o_12"
elif last_candle["close"] < last_candle["EMA_200"]:
if 0.01 > current_profit >= 0.001:
if last_candle["RSI_14"] < 12.0:
return True, f"exit_{mode_name}_u_0"
elif 0.02 > current_profit >= 0.01:
if last_candle["RSI_14"] < 30.0:
return True, f"exit_{mode_name}_u_1"
elif 0.03 > current_profit >= 0.02:
if last_candle["RSI_14"] < 32.0:
return True, f"exit_{mode_name}_u_2"
elif 0.04 > current_profit >= 0.03:
if last_candle["RSI_14"] < 34.0:
return True, f"exit_{mode_name}_u_3"
elif 0.05 > current_profit >= 0.04:
if last_candle["RSI_14"] < 36.0:
return True, f"exit_{mode_name}_u_4"
elif 0.06 > current_profit >= 0.05:
if last_candle["RSI_14"] < 38.0:
return True, f"exit_{mode_name}_u_5"
elif 0.07 > current_profit >= 0.06:
if last_candle["RSI_14"] < 40.0:
return True, f"exit_{mode_name}_u_6"
elif 0.08 > current_profit >= 0.07:
if last_candle["RSI_14"] < 42.0:
return True, f"exit_{mode_name}_u_7"
elif 0.09 > current_profit >= 0.08:
if last_candle["RSI_14"] < 44.0:
return True, f"exit_{mode_name}_u_8"
elif 0.1 > current_profit >= 0.09:
if last_candle["RSI_14"] < 46.0:
return True, f"exit_{mode_name}_u_9"
elif 0.12 > current_profit >= 0.1:
if last_candle["RSI_14"] < 48.0:
return True, f"exit_{mode_name}_u_10"
elif 0.2 > current_profit >= 0.12:
if last_candle["RSI_14"] < 46.0:
return True, f"exit_{mode_name}_u_11"
elif current_profit >= 0.2:
if last_candle["RSI_14"] < 44.0:
return True, f"exit_{mode_name}_u_12"
# Here ends exit signal conditions for long_exit_main
return False, None
# Long Exit Williams R
# ---------------------------------------------------------------------------------------------
def long_exit_williams_r(
self,
mode_name: str,
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["WILLR_480"] > -0.1) and (last_candle["WILLR_14"] >= -1.0) and (last_candle["RSI_14"] > 75.0):
return True, f"exit_{mode_name}_w_0_1"
elif (last_candle["WILLR_14"] >= -1.0) and (last_candle["RSI_14"] > 84.0):
return True, f"exit_{mode_name}_w_0_2"
elif (last_candle["WILLR_14"] >= -1.0) and (last_candle["RSI_14"] < 40.0):
return True, f"exit_{mode_name}_w_0_3"
elif (
(last_candle["WILLR_14"] >= -1.0)
and (last_candle["RSI_14"] > 80.0)
and (last_candle["ROC_9_1h"] < -0.0)
and (last_candle["ROC_9_4h"] > 20.0)
):
return True, f"exit_{mode_name}_w_0_4"
elif (
(last_candle["RSI_3"] > 99.0)
and (last_candle["WILLR_14"] > -4.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 50.0))
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 70.0)
):
return True, f"exit_{mode_name}_w_0_5"
elif (
(last_candle["RSI_3"] > 98.0)
and (last_candle["WILLR_14"] > -1.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] < -5.0))
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 80.0)
):
return True, f"exit_{mode_name}_w_0_6"
elif (
(last_candle["RSI_3"] > 90.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_14_4h"] > 60.0)
and (last_candle["CMF_20_1h"] < -0.0)
and (last_candle["CMF_20_4h"] < -0.0)
):
return True, f"exit_{mode_name}_w_0_7"
elif (
(last_candle["RSI_3"] > 90.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 25.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 20.0)
):
return True, f"exit_{mode_name}_w_0_8"
elif (
(last_candle["RSI_3"] > 88.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["ROC_9_1h"] < -5.0)
and (last_candle["ROC_9_4h"] > 10.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 40.0)
):
return True, f"exit_{mode_name}_w_0_9"
elif (
(last_candle["RSI_3"] > 96.0)
and (last_candle["WILLR_14"] > -16.0)
and (last_candle["AROONU_14_4h"] > 50.0)
and (last_candle["CCI_20_change_pct_4h"] < -0.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 90.0)
)
):
return True, f"exit_{mode_name}_w_0_10"
elif (
(last_candle["RSI_3"] > 98.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["RSI_3_1h"] < 30.0)
and (last_candle["RSI_3_4h"] < 25.0)
):
return True, f"exit_{mode_name}_w_0_11"
elif (
(last_candle["RSI_3"] > 99.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["RSI_3_4h"] < 40.0)
and (last_candle["AROONU_14_4h"] > 50.0)
):
return True, f"exit_{mode_name}_w_0_12"
elif (
(last_candle["RSI_3"] > 99.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 50.0)
and (last_candle["RSI_3_4h"] < 50.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 70.0)
)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 50.0))
):
return True, f"exit_{mode_name}_w_0_13"
elif (
(last_candle["RSI_3"] > 95.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 60.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 80.0))
):
return True, f"exit_{mode_name}_w_0_14"
elif (
(last_candle["RSI_3"] > 95.0)
and (last_candle["WILLR_480"] > -25.0)
and (last_candle["RSI_14"] < 48.0)
and (last_candle["RSI_14_4h"] > 70.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 80.0)
and (isinstance(last_candle["ROC_9_4h"], np.float64) and (last_candle["ROC_9_4h"] > 100.0))
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 100.0))
):
return True, f"exit_{mode_name}_w_0_15"
elif (
(last_candle["RSI_3"] > 88.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["RSI_3_1h"] < 40.0)
and (last_candle["AROONU_14_4h"] > 75.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 30.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 30.0)
):
return True, f"exit_{mode_name}_w_0_16"
elif (
(last_candle["RSI_3"] > 98.0)
and (last_candle["WILLR_14"] > -4.0)
and (last_candle["AROONU_14_4h"] > 75.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 70.0)
):
return True, f"exit_{mode_name}_w_0_17"
elif (
(last_candle["RSI_3"] > 90.0)
and (last_candle["WILLR_14"] > -20.0)
and (last_candle["AROONU_14_4h"] > 50.0)
and (last_candle["top_wick_pct_1d"] > 20.0)
):
return True, f"exit_{mode_name}_w_0_18"
elif 0.02 > current_profit >= 0.01:
if last_candle["WILLR_480"] > -0.2:
return True, f"exit_{mode_name}_w_1_1"
elif (last_candle["WILLR_14"] >= -1.0) and (last_candle["RSI_14"] > 78.0):
return True, f"exit_{mode_name}_w_1_2"
elif (last_candle["WILLR_14"] >= -2.0) and (last_candle["RSI_14"] < 46.0):
return True, f"exit_{mode_name}_w_1_3"
elif (
(last_candle["WILLR_14"] >= -2.0)
and (last_candle["RSI_14"] > 78.0)
and (last_candle["ROC_9_1h"] < -0.0)
and (last_candle["ROC_9_4h"] > 20.0)
):
return True, f"exit_{mode_name}_w_1_4"
elif (
(last_candle["RSI_3"] > 98.0)
and (last_candle["WILLR_14"] > -6.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 50.0))
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 70.0)
):
return True, f"exit_{mode_name}_w_1_5"
elif (
(last_candle["RSI_3"] > 96.0)
and (last_candle["WILLR_14"] > -2.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] < -5.0))
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 80.0)
):
return True, f"exit_{mode_name}_w_1_6"
elif (
(last_candle["RSI_3"] > 88.0)
and (last_candle["WILLR_14"] > -4.0)
and (last_candle["RSI_14_4h"] > 60.0)
and (last_candle["CMF_20_1h"] < -0.0)
and (last_candle["CMF_20_4h"] < -0.0)
):
return True, f"exit_{mode_name}_w_1_7"
elif (
(last_candle["RSI_3"] > 88.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 25.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 20.0)
):
return True, f"exit_{mode_name}_w_1_8"
elif (
(last_candle["RSI_3"] > 86.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["ROC_9_1h"] < -5.0)
and (last_candle["ROC_9_4h"] > 10.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 40.0)
):
return True, f"exit_{mode_name}_w_1_9"
elif (
(last_candle["RSI_3"] > 94.0)
and (last_candle["WILLR_14"] > -18.0)
and (last_candle["AROONU_14_4h"] > 50.0)
and (last_candle["CCI_20_change_pct_4h"] < -0.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 90.0)
)
):
return True, f"exit_{mode_name}_w_1_10"
elif (
(last_candle["RSI_3"] > 88.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 30.0)
and (last_candle["RSI_3_4h"] < 25.0)
):
return True, f"exit_{mode_name}_w_1_11"
elif (
(last_candle["RSI_3"] > 98.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_4h"] < 40.0)
and (last_candle["AROONU_14_4h"] > 50.0)
):
return True, f"exit_{mode_name}_w_1_12"
elif (
(last_candle["RSI_3"] > 98.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 50.0)
and (last_candle["RSI_3_4h"] < 50.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 70.0)
)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 50.0))
):
return True, f"exit_{mode_name}_w_1_13"
elif (
(last_candle["RSI_3"] > 90.0)
and (last_candle["WILLR_14"] > -4.0)
and (last_candle["RSI_3_1h"] < 60.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 80.0))
):
return True, f"exit_{mode_name}_w_1_14"
elif (
(last_candle["RSI_3"] > 50.0)
and (last_candle["WILLR_480"] > -25.0)
and (last_candle["RSI_14"] < 50.0)
and (last_candle["RSI_14_4h"] > 70.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 80.0)
and (isinstance(last_candle["ROC_9_4h"], np.float64) and (last_candle["ROC_9_4h"] > 100.0))
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 100.0))
):
return True, f"exit_{mode_name}_w_1_15"
elif (
(last_candle["RSI_3"] > 86.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 40.0)
and (last_candle["AROONU_14_4h"] > 75.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 30.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 30.0)
):
return True, f"exit_{mode_name}_w_1_16"
elif (
(last_candle["RSI_3"] > 96.0)
and (last_candle["WILLR_14"] > -6.0)
and (last_candle["AROONU_14_4h"] > 75.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 70.0)
):
return True, f"exit_{mode_name}_w_1_17"
elif (
(last_candle["RSI_3"] > 88.0)
and (last_candle["WILLR_14"] > -20.0)
and (last_candle["AROONU_14_4h"] > 50.0)
and (last_candle["top_wick_pct_1d"] > 20.0)
):
return True, f"exit_{mode_name}_d_1_18"
elif 0.03 > current_profit >= 0.02:
if last_candle["WILLR_480"] > -0.3:
return True, f"exit_{mode_name}_w_2_1"
elif (last_candle["WILLR_14"] >= -1.0) and (last_candle["RSI_14"] > 77.0):
return True, f"exit_{mode_name}_w_2_2"
elif (last_candle["WILLR_14"] >= -2.0) and (last_candle["RSI_14"] < 48.0):
return True, f"exit_{mode_name}_w_2_3"
elif (
(last_candle["WILLR_14"] >= -5.0)
and (last_candle["RSI_14"] > 75.0)
and (last_candle["ROC_9_1h"] < -0.0)
and (last_candle["ROC_9_4h"] > 20.0)
):
return True, f"exit_{mode_name}_w_2_4"
elif (
(last_candle["RSI_3"] > 98.0)
and (last_candle["WILLR_14"] > -8.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 50.0))
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 70.0)
):
return True, f"exit_{mode_name}_w_2_5"
elif (
(last_candle["RSI_3"] > 94.0)
and (last_candle["WILLR_14"] > -4.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] < -5.0))
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 80.0)
):
return True, f"exit_{mode_name}_w_2_6"
elif (
(last_candle["RSI_3"] > 86.0)
and (last_candle["WILLR_14"] > -6.0)
and (last_candle["RSI_14_4h"] > 60.0)
and (last_candle["CMF_20_1h"] < -0.0)
and (last_candle["CMF_20_4h"] < -0.0)
):
return True, f"exit_{mode_name}_w_2_7"
elif (
(last_candle["RSI_3"] > 86.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 25.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 20.0)
):
return True, f"exit_{mode_name}_w_2_8"
elif (
(last_candle["RSI_3"] > 84.0)
and (last_candle["WILLR_14"] > -4.0)
and (last_candle["ROC_9_1h"] < -5.0)
and (last_candle["ROC_9_4h"] > 10.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 40.0)
):
return True, f"exit_{mode_name}_w_2_9"
elif (
(last_candle["RSI_3"] > 92.0)
and (last_candle["WILLR_14"] > -20.0)
and (last_candle["AROONU_14_4h"] > 50.0)
and (last_candle["CCI_20_change_pct_4h"] < -0.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 90.0)
)
):
return True, f"exit_{mode_name}_w_2_10"
elif (
(last_candle["RSI_3"] > 86.0)
and (last_candle["WILLR_14"] > -4.0)
and (last_candle["RSI_3_1h"] < 30.0)
and (last_candle["RSI_3_4h"] < 25.0)
):
return True, f"exit_{mode_name}_w_2_11"
elif (
(last_candle["RSI_3"] > 96.0)
and (last_candle["WILLR_14"] > -4.0)
and (last_candle["RSI_3_4h"] < 40.0)
and (last_candle["AROONU_14_4h"] > 50.0)
):
return True, f"exit_{mode_name}_w_2_12"
elif (
(last_candle["RSI_3"] > 96.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 50.0)
and (last_candle["RSI_3_4h"] < 50.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 70.0)
)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 50.0))
):
return True, f"exit_{mode_name}_w_2_13"
elif (
(last_candle["RSI_3"] > 88.0)
and (last_candle["WILLR_14"] > -6.0)
and (last_candle["RSI_3_1h"] < 60.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 80.0))
):
return True, f"exit_{mode_name}_w_2_14"
elif (
(last_candle["RSI_3"] > 48.0)
and (last_candle["WILLR_480"] > -25.0)
and (last_candle["RSI_14"] < 52.0)
and (last_candle["RSI_14_4h"] > 70.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 80.0)
and (isinstance(last_candle["ROC_9_4h"], np.float64) and (last_candle["ROC_9_4h"] > 100.0))
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 100.0))
):
return True, f"exit_{mode_name}_w_2_15"
elif (
(last_candle["RSI_3"] > 84.0)
and (last_candle["WILLR_14"] > -4.0)
and (last_candle["RSI_3_1h"] < 40.0)
and (last_candle["AROONU_14_4h"] > 75.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 30.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 30.0)
):
return True, f"exit_{mode_name}_w_2_16"
elif (
(last_candle["RSI_3"] > 94.0)
and (last_candle["WILLR_14"] > -8.0)
and (last_candle["AROONU_14_4h"] > 75.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 70.0)
):
return True, f"exit_{mode_name}_w_2_17"
elif (
(last_candle["RSI_3"] > 86.0)
and (last_candle["WILLR_14"] > -20.0)
and (last_candle["AROONU_14_4h"] > 50.0)
and (last_candle["top_wick_pct_1d"] > 20.0)
):
return True, f"exit_{mode_name}_w_2_18"
elif 0.04 > current_profit >= 0.03:
if last_candle["WILLR_480"] > -0.4:
return True, f"exit_{mode_name}_w_3_1"
elif (last_candle["WILLR_14"] >= -1.0) and (last_candle["RSI_14"] > 76.0):
return True, f"exit_{mode_name}_w_3_2"
elif (last_candle["WILLR_14"] >= -2.0) and (last_candle["RSI_14"] < 50.0):
return True, f"exit_{mode_name}_w_3_3"
elif (
(last_candle["WILLR_14"] >= -5.0)
and (last_candle["RSI_14"] > 75.0)
and (last_candle["ROC_9_1h"] < -0.0)
and (last_candle["ROC_9_4h"] > 20.0)
):
return True, f"exit_{mode_name}_w_3_4"
elif (
(last_candle["RSI_3"] > 96.0)
and (last_candle["WILLR_14"] > -10.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 50.0))
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 70.0)
):
return True, f"exit_{mode_name}_w_3_5"
elif (
(last_candle["RSI_3"] > 92.0)
and (last_candle["WILLR_14"] > -6.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] < -5.0))
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 80.0)
):
return True, f"exit_{mode_name}_w_3_6"
elif (
(last_candle["RSI_3"] > 84.0)
and (last_candle["WILLR_14"] > -8.0)
and (last_candle["RSI_14_4h"] > 60.0)
and (last_candle["CMF_20_1h"] < -0.0)
and (last_candle["CMF_20_4h"] < -0.0)
):
return True, f"exit_{mode_name}_w_3_7"
elif (
(last_candle["RSI_3"] > 84.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 25.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 20.0)
):
return True, f"exit_{mode_name}_w_3_8"
elif (
(last_candle["RSI_3"] > 82.0)
and (last_candle["WILLR_14"] > -6.0)
and (last_candle["ROC_9_1h"] < -5.0)
and (last_candle["ROC_9_4h"] > 10.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 40.0)
):
return True, f"exit_{mode_name}_w_3_9"
elif (
(last_candle["RSI_3"] > 90.0)
and (last_candle["WILLR_14"] > -22.0)
and (last_candle["AROONU_14_4h"] > 50.0)
and (last_candle["CCI_20_change_pct_4h"] < -0.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 90.0)
)
):
return True, f"exit_{mode_name}_w_3_10"
elif (
(last_candle["RSI_3"] > 84.0)
and (last_candle["WILLR_14"] > -6.0)
and (last_candle["RSI_3_1h"] < 30.0)
and (last_candle["RSI_3_4h"] < 25.0)
):
return True, f"exit_{mode_name}_w_3_11"
elif (
(last_candle["RSI_3"] > 94.0)
and (last_candle["WILLR_14"] > -6.0)
and (last_candle["RSI_3_4h"] < 40.0)
and (last_candle["AROONU_14_4h"] > 50.0)
):
return True, f"exit_{mode_name}_w_3_12"
elif (
(last_candle["RSI_3"] > 94.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 50.0)
and (last_candle["RSI_3_4h"] < 50.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 70.0)
)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 50.0))
):
return True, f"exit_{mode_name}_w_3_13"
elif (
(last_candle["RSI_3"] > 86.0)
and (last_candle["WILLR_14"] > -8.0)
and (last_candle["RSI_3_1h"] < 60.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 80.0))
):
return True, f"exit_{mode_name}_w_3_14"
elif (
(last_candle["RSI_3"] > 46.0)
and (last_candle["WILLR_480"] > -25.0)
and (last_candle["RSI_14"] < 54.0)
and (last_candle["RSI_14_4h"] > 70.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 80.0)
and (isinstance(last_candle["ROC_9_4h"], np.float64) and (last_candle["ROC_9_4h"] > 100.0))
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 100.0))
):
return True, f"exit_{mode_name}_w_3_15"
elif (
(last_candle["RSI_3"] > 82.0)
and (last_candle["WILLR_14"] > -6.0)
and (last_candle["RSI_3_1h"] < 40.0)
and (last_candle["AROONU_14_4h"] > 75.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 30.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 30.0)
):
return True, f"exit_{mode_name}_w_3_16"
elif (
(last_candle["RSI_3"] > 92.0)
and (last_candle["WILLR_14"] > -10.0)
and (last_candle["AROONU_14_4h"] > 75.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 70.0)
):
return True, f"exit_{mode_name}_w_3_17"
elif (
(last_candle["RSI_3"] > 84.0)
and (last_candle["WILLR_14"] > -20.0)
and (last_candle["AROONU_14_4h"] > 50.0)
and (last_candle["top_wick_pct_1d"] > 20.0)
):
return True, f"exit_{mode_name}_w_3_18"
elif 0.05 > current_profit >= 0.04:
if last_candle["WILLR_480"] > -0.5:
return True, f"exit_{mode_name}_w_4_1"
elif (last_candle["WILLR_14"] >= -1.0) and (last_candle["RSI_14"] > 75.0):
return True, f"exit_{mode_name}_w_4_2"
elif (last_candle["WILLR_14"] >= -2.0) and (last_candle["RSI_14"] < 52.0):
return True, f"exit_{mode_name}_w_4_3"
elif (
(last_candle["WILLR_14"] >= -5.0)
and (last_candle["RSI_14"] > 75.0)
and (last_candle["ROC_9_1h"] < -0.0)
and (last_candle["ROC_9_4h"] > 20.0)
):
return True, f"exit_{mode_name}_w_4_4"
elif (
(last_candle["RSI_3"] > 94.0)
and (last_candle["WILLR_14"] > -12.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 50.0))
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 70.0)
):
return True, f"exit_{mode_name}_w_4_5"
elif (
(last_candle["RSI_3"] > 90.0)
and (last_candle["WILLR_14"] > -8.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] < -5.0))
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 80.0)
):
return True, f"exit_{mode_name}_w_4_6"
elif (
(last_candle["RSI_3"] > 82.0)
and (last_candle["WILLR_14"] > -10.0)
and (last_candle["RSI_14_4h"] > 60.0)
and (last_candle["CMF_20_1h"] < -0.0)
and (last_candle["CMF_20_4h"] < -0.0)
):
return True, f"exit_{mode_name}_w_4_7"
elif (
(last_candle["RSI_3"] > 82.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 25.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 20.0)
):
return True, f"exit_{mode_name}_w_4_8"
elif (
(last_candle["RSI_3"] > 80.0)
and (last_candle["WILLR_14"] > -8.0)
and (last_candle["ROC_9_1h"] < -5.0)
and (last_candle["ROC_9_4h"] > 10.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 40.0)
):
return True, f"exit_{mode_name}_w_4_9"
elif (
(last_candle["RSI_3"] > 88.0)
and (last_candle["WILLR_14"] > -24.0)
and (last_candle["AROONU_14_4h"] > 50.0)
and (last_candle["CCI_20_change_pct_4h"] < -0.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 90.0)
)
):
return True, f"exit_{mode_name}_w_4_10"
elif (
(last_candle["RSI_3"] > 82.0)
and (last_candle["WILLR_14"] > -8.0)
and (last_candle["RSI_3_1h"] < 30.0)
and (last_candle["RSI_3_4h"] < 25.0)
):
return True, f"exit_{mode_name}_w_4_11"
elif (
(last_candle["RSI_3"] > 92.0)
and (last_candle["WILLR_14"] > -8.0)
and (last_candle["RSI_3_4h"] < 40.0)
and (last_candle["AROONU_14_4h"] > 50.0)
):
return True, f"exit_{mode_name}_w_4_12"
elif (
(last_candle["RSI_3"] > 92.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 50.0)
and (last_candle["RSI_3_4h"] < 50.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 70.0)
)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 50.0))
):
return True, f"exit_{mode_name}_w_4_13"
elif (
(last_candle["RSI_3"] > 84.0)
and (last_candle["WILLR_14"] > -10.0)
and (last_candle["RSI_3_1h"] < 60.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 80.0))
):
return True, f"exit_{mode_name}_w_4_14"
elif (
(last_candle["RSI_3"] > 44.0)
and (last_candle["WILLR_480"] > -25.0)
and (last_candle["RSI_14"] < 56.0)
and (last_candle["RSI_14_4h"] > 70.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 80.0)
and (isinstance(last_candle["ROC_9_4h"], np.float64) and (last_candle["ROC_9_4h"] > 100.0))
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 100.0))
):
return True, f"exit_{mode_name}_w_4_15"
elif (
(last_candle["RSI_3"] > 80.0)
and (last_candle["WILLR_14"] > -8.0)
and (last_candle["RSI_3_1h"] < 40.0)
and (last_candle["AROONU_14_4h"] > 75.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 30.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 30.0)
):
return True, f"exit_{mode_name}_w_4_16"
elif (
(last_candle["RSI_3"] > 90.0)
and (last_candle["WILLR_14"] > -12.0)
and (last_candle["AROONU_14_4h"] > 75.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 70.0)
):
return True, f"exit_{mode_name}_w_4_17"
elif (
(last_candle["RSI_3"] > 82.0)
and (last_candle["WILLR_14"] > -20.0)
and (last_candle["AROONU_14_4h"] > 50.0)
and (last_candle["top_wick_pct_1d"] > 20.0)
):
return True, f"exit_{mode_name}_w_4_18"
elif 0.06 > current_profit >= 0.05:
if last_candle["WILLR_480"] > -0.6:
return True, f"exit_{mode_name}_w_5_1"
elif (last_candle["WILLR_14"] >= -1.0) and (last_candle["RSI_14"] > 74.0):
return True, f"exit_{mode_name}_w_5_2"
elif (last_candle["WILLR_14"] >= -2.0) and (last_candle["RSI_14"] < 54.0):
return True, f"exit_{mode_name}_w_5_3"
elif (
(last_candle["WILLR_14"] >= -10.0)
and (last_candle["RSI_14"] > 70.0)
and (last_candle["ROC_9_1h"] < -0.0)
and (last_candle["ROC_9_4h"] > 20.0)
):
return True, f"exit_{mode_name}_w_5_4"
elif (
(last_candle["RSI_3"] > 92.0)
and (last_candle["WILLR_14"] > -14.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 50.0))
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 70.0)
):
return True, f"exit_{mode_name}_w_5_5"
elif (
(last_candle["RSI_3"] > 88.0)
and (last_candle["WILLR_14"] > -10.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] < -5.0))
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 80.0)
):
return True, f"exit_{mode_name}_w_5_6"
elif (
(last_candle["RSI_3"] > 80.0)
and (last_candle["WILLR_14"] > -12.0)
and (last_candle["RSI_14_4h"] > 60.0)
and (last_candle["CMF_20_1h"] < -0.0)
and (last_candle["CMF_20_4h"] < -0.0)
):
return True, f"exit_{mode_name}_w_5_7"
elif (
(last_candle["RSI_3"] > 80.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 25.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 20.0)
):
return True, f"exit_{mode_name}_w_5_8"
elif (
(last_candle["RSI_3"] > 78.0)
and (last_candle["WILLR_14"] > -10.0)
and (last_candle["ROC_9_1h"] < -5.0)
and (last_candle["ROC_9_4h"] > 10.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 40.0)
):
return True, f"exit_{mode_name}_w_5_9"
elif (
(last_candle["RSI_3"] > 86.0)
and (last_candle["WILLR_14"] > -26.0)
and (last_candle["AROONU_14_4h"] > 50.0)
and (last_candle["CCI_20_change_pct_4h"] < -0.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 90.0)
)
):
return True, f"exit_{mode_name}_w_5_10"
elif (
(last_candle["RSI_3"] > 80.0)
and (last_candle["WILLR_14"] > -10.0)
and (last_candle["RSI_3_1h"] < 30.0)
and (last_candle["RSI_3_4h"] < 25.0)
):
return True, f"exit_{mode_name}_w_5_11"
elif (
(last_candle["RSI_3"] > 90.0)
and (last_candle["WILLR_14"] > -10.0)
and (last_candle["RSI_3_4h"] < 40.0)
and (last_candle["AROONU_14_4h"] > 50.0)
):
return True, f"exit_{mode_name}_w_5_12"
elif (
(last_candle["RSI_3"] > 90.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 50.0)
and (last_candle["RSI_3_4h"] < 50.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 70.0)
)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 50.0))
):
return True, f"exit_{mode_name}_w_5_13"
elif (
(last_candle["RSI_3"] > 82.0)
and (last_candle["WILLR_14"] > -12.0)
and (last_candle["RSI_3_1h"] < 60.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 80.0))
):
return True, f"exit_{mode_name}_w_5_14"
elif (
(last_candle["RSI_3"] > 42.0)
and (last_candle["WILLR_480"] > -25.0)
and (last_candle["RSI_14"] < 58.0)
and (last_candle["RSI_14_4h"] > 70.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 80.0)
and (isinstance(last_candle["ROC_9_4h"], np.float64) and (last_candle["ROC_9_4h"] > 100.0))
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 100.0))
):
return True, f"exit_{mode_name}_w_5_15"
elif (
(last_candle["RSI_3"] > 78.0)
and (last_candle["WILLR_14"] > -10.0)
and (last_candle["RSI_3_1h"] < 40.0)
and (last_candle["AROONU_14_4h"] > 75.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 30.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 30.0)
):
return True, f"exit_{mode_name}_w_5_16"
elif (
(last_candle["RSI_3"] > 88.0)
and (last_candle["WILLR_14"] > -14.0)
and (last_candle["AROONU_14_4h"] > 75.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 70.0)
):
return True, f"exit_{mode_name}_w_5_17"
elif (
(last_candle["RSI_3"] > 80.0)
and (last_candle["WILLR_14"] > -20.0)
and (last_candle["AROONU_14_4h"] > 50.0)
and (last_candle["top_wick_pct_1d"] > 20.0)
):
return True, f"exit_{mode_name}_w_5_18"
elif 0.07 > current_profit >= 0.06:
if last_candle["WILLR_480"] > -0.7:
return True, f"exit_{mode_name}_w_6_1"
elif (last_candle["WILLR_14"] >= -1.0) and (last_candle["RSI_14"] > 75.0):
return True, f"exit_{mode_name}_w_6_2"
elif (last_candle["WILLR_14"] >= -2.0) and (last_candle["RSI_14"] < 52.0):
return True, f"exit_{mode_name}_w_6_3"
elif (
(last_candle["WILLR_14"] >= -15.0)
and (last_candle["RSI_14"] > 70.0)
and (last_candle["ROC_9_1h"] < -0.0)
and (last_candle["ROC_9_4h"] > 20.0)
):
return True, f"exit_{mode_name}_w_6_4"
elif (
(last_candle["RSI_3"] > 94.0)
and (last_candle["WILLR_14"] > -12.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 50.0))
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 70.0)
):
return True, f"exit_{mode_name}_w_6_5"
elif (
(last_candle["RSI_3"] > 90.0)
and (last_candle["WILLR_14"] > -8.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] < -5.0))
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 80.0)
):
return True, f"exit_{mode_name}_w_6_6"
elif (
(last_candle["RSI_3"] > 82.0)
and (last_candle["WILLR_14"] > -10.0)
and (last_candle["RSI_14_4h"] > 60.0)
and (last_candle["CMF_20_1h"] < -0.0)
and (last_candle["CMF_20_4h"] < -0.0)
):
return True, f"exit_{mode_name}_w_6_7"
elif (
(last_candle["RSI_3"] > 82.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 25.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 20.0)
):
return True, f"exit_{mode_name}_w_6_8"
elif (
(last_candle["RSI_3"] > 80.0)
and (last_candle["WILLR_14"] > -8.0)
and (last_candle["ROC_9_1h"] < -5.0)
and (last_candle["ROC_9_4h"] > 10.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 40.0)
):
return True, f"exit_{mode_name}_w_6_9"
elif (
(last_candle["RSI_3"] > 88.0)
and (last_candle["WILLR_14"] > -24.0)
and (last_candle["AROONU_14_4h"] > 50.0)
and (last_candle["CCI_20_change_pct_4h"] < -0.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 90.0)
)
):
return True, f"exit_{mode_name}_w_6_10"
elif (
(last_candle["RSI_3"] > 82.0)
and (last_candle["WILLR_14"] > -8.0)
and (last_candle["RSI_3_1h"] < 30.0)
and (last_candle["RSI_3_4h"] < 25.0)
):
return True, f"exit_{mode_name}_w_6_11"
elif (
(last_candle["RSI_3"] > 92.0)
and (last_candle["WILLR_14"] > -8.0)
and (last_candle["RSI_3_4h"] < 40.0)
and (last_candle["AROONU_14_4h"] > 50.0)
):
return True, f"exit_{mode_name}_w_6_12"
elif (
(last_candle["RSI_3"] > 92.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 50.0)
and (last_candle["RSI_3_4h"] < 50.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 70.0)
)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 50.0))
):
return True, f"exit_{mode_name}_w_6_13"
elif (
(last_candle["RSI_3"] > 84.0)
and (last_candle["WILLR_14"] > -10.0)
and (last_candle["RSI_3_1h"] < 60.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 80.0))
):
return True, f"exit_{mode_name}_w_6_14"
elif (
(last_candle["RSI_3"] > 44.0)
and (last_candle["WILLR_480"] > -25.0)
and (last_candle["RSI_14"] < 56.0)
and (last_candle["RSI_14_4h"] > 70.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 80.0)
and (isinstance(last_candle["ROC_9_4h"], np.float64) and (last_candle["ROC_9_4h"] > 100.0))
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 100.0))
):
return True, f"exit_{mode_name}_w_6_15"
elif (
(last_candle["RSI_3"] > 80.0)
and (last_candle["WILLR_14"] > -8.0)
and (last_candle["RSI_3_1h"] < 40.0)
and (last_candle["AROONU_14_4h"] > 75.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 30.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 30.0)
):
return True, f"exit_{mode_name}_w_6_16"
elif (
(last_candle["RSI_3"] > 90.0)
and (last_candle["WILLR_14"] > -12.0)
and (last_candle["AROONU_14_4h"] > 75.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 70.0)
):
return True, f"exit_{mode_name}_w_6_17"
elif (
(last_candle["RSI_3"] > 82.0)
and (last_candle["WILLR_14"] > -20.0)
and (last_candle["AROONU_14_4h"] > 50.0)
and (last_candle["top_wick_pct_1d"] > 20.0)
):
return True, f"exit_{mode_name}_w_6_18"
elif 0.08 > current_profit >= 0.07:
if last_candle["WILLR_480"] > -0.8:
return True, f"exit_{mode_name}_w_7_1"
elif (last_candle["WILLR_14"] >= -1.0) and (last_candle["RSI_14"] > 76.0):
return True, f"exit_{mode_name}_w_7_2"
elif (last_candle["WILLR_14"] >= -2.0) and (last_candle["RSI_14"] < 50.0):
return True, f"exit_{mode_name}_w_7_3"
elif (
(last_candle["WILLR_14"] >= -15.0)
and (last_candle["RSI_14"] > 70.0)
and (last_candle["ROC_9_1h"] < -0.0)
and (last_candle["ROC_9_4h"] > 20.0)
):
return True, f"exit_{mode_name}_w_7_4"
elif (
(last_candle["RSI_3"] > 96.0)
and (last_candle["WILLR_14"] > -10.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 50.0))
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 70.0)
):
return True, f"exit_{mode_name}_w_7_5"
elif (
(last_candle["RSI_3"] > 92.0)
and (last_candle["WILLR_14"] > -6.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] < -5.0))
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 80.0)
):
return True, f"exit_{mode_name}_w_7_6"
elif (
(last_candle["RSI_3"] > 84.0)
and (last_candle["WILLR_14"] > -8.0)
and (last_candle["RSI_14_4h"] > 60.0)
and (last_candle["CMF_20_1h"] < -0.0)
and (last_candle["CMF_20_4h"] < -0.0)
):
return True, f"exit_{mode_name}_w_7_7"
elif (
(last_candle["RSI_3"] > 84.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 25.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 20.0)
):
return True, f"exit_{mode_name}_w_7_8"
elif (
(last_candle["RSI_3"] > 82.0)
and (last_candle["WILLR_14"] > -6.0)
and (last_candle["ROC_9_1h"] < -5.0)
and (last_candle["ROC_9_4h"] > 10.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 40.0)
):
return True, f"exit_{mode_name}_w_7_9"
elif (
(last_candle["RSI_3"] > 90.0)
and (last_candle["WILLR_14"] > -22.0)
and (last_candle["AROONU_14_4h"] > 50.0)
and (last_candle["CCI_20_change_pct_4h"] < -0.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 90.0)
)
):
return True, f"exit_{mode_name}_w_7_10"
elif (
(last_candle["RSI_3"] > 84.0)
and (last_candle["WILLR_14"] > -6.0)
and (last_candle["RSI_3_1h"] < 30.0)
and (last_candle["RSI_3_4h"] < 25.0)
):
return True, f"exit_{mode_name}_w_7_11"
elif (
(last_candle["RSI_3"] > 94.0)
and (last_candle["WILLR_14"] > -6.0)
and (last_candle["RSI_3_4h"] < 40.0)
and (last_candle["AROONU_14_4h"] > 50.0)
):
return True, f"exit_{mode_name}_w_7_12"
elif (
(last_candle["RSI_3"] > 94.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 50.0)
and (last_candle["RSI_3_4h"] < 50.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 70.0)
)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 50.0))
):
return True, f"exit_{mode_name}_w_7_13"
elif (
(last_candle["RSI_3"] > 86.0)
and (last_candle["WILLR_14"] > -8.0)
and (last_candle["RSI_3_1h"] < 60.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 80.0))
):
return True, f"exit_{mode_name}_w_7_14"
elif (
(last_candle["RSI_3"] > 46.0)
and (last_candle["WILLR_480"] > -25.0)
and (last_candle["RSI_14"] < 54.0)
and (last_candle["RSI_14_4h"] > 70.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 80.0)
and (isinstance(last_candle["ROC_9_4h"], np.float64) and (last_candle["ROC_9_4h"] > 100.0))
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 100.0))
):
return True, f"exit_{mode_name}_w_7_15"
elif (
(last_candle["RSI_3"] > 82.0)
and (last_candle["WILLR_14"] > -6.0)
and (last_candle["RSI_3_1h"] < 40.0)
and (last_candle["AROONU_14_4h"] > 75.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 30.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 30.0)
):
return True, f"exit_{mode_name}_w_7_16"
elif (
(last_candle["RSI_3"] > 92.0)
and (last_candle["WILLR_14"] > -10.0)
and (last_candle["AROONU_14_4h"] > 75.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 70.0)
):
return True, f"exit_{mode_name}_w_7_17"
elif (
(last_candle["RSI_3"] > 84.0)
and (last_candle["WILLR_14"] > -20.0)
and (last_candle["AROONU_14_4h"] > 50.0)
and (last_candle["top_wick_pct_1d"] > 20.0)
):
return True, f"exit_{mode_name}_w_7_18"
elif 0.09 > current_profit >= 0.08:
if last_candle["WILLR_480"] > -0.9:
return True, f"exit_{mode_name}_w_8_1"
elif (last_candle["WILLR_14"] >= -1.0) and (last_candle["RSI_14"] > 77.0):
return True, f"exit_{mode_name}_w_8_2"
elif (last_candle["WILLR_14"] >= -2.0) and (last_candle["RSI_14"] < 48.0):
return True, f"exit_{mode_name}_w_8_3"
elif (
(last_candle["WILLR_14"] >= -15.0)
and (last_candle["RSI_14"] > 70.0)
and (last_candle["ROC_9_1h"] < -0.0)
and (last_candle["ROC_9_4h"] > 20.0)
):
return True, f"exit_{mode_name}_w_8_4"
elif (
(last_candle["RSI_3"] > 98.0)
and (last_candle["WILLR_14"] > -8.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 50.0))
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 70.0)
):
return True, f"exit_{mode_name}_w_8_5"
elif (
(last_candle["RSI_3"] > 94.0)
and (last_candle["WILLR_14"] > -4.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] < -5.0))
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 80.0)
):
return True, f"exit_{mode_name}_w_8_6"
elif (
(last_candle["RSI_3"] > 86.0)
and (last_candle["WILLR_14"] > -6.0)
and (last_candle["RSI_14_4h"] > 60.0)
and (last_candle["CMF_20_1h"] < -0.0)
and (last_candle["CMF_20_4h"] < -0.0)
):
return True, f"exit_{mode_name}_w_8_7"
elif (
(last_candle["RSI_3"] > 86.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 25.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 20.0)
):
return True, f"exit_{mode_name}_w_8_8"
elif (
(last_candle["RSI_3"] > 84.0)
and (last_candle["WILLR_14"] > -4.0)
and (last_candle["ROC_9_1h"] < -5.0)
and (last_candle["ROC_9_4h"] > 10.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 40.0)
):
return True, f"exit_{mode_name}_w_8_9"
elif (
(last_candle["RSI_3"] > 92.0)
and (last_candle["WILLR_14"] > -20.0)
and (last_candle["AROONU_14_4h"] > 50.0)
and (last_candle["CCI_20_change_pct_4h"] < -0.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 90.0)
)
):
return True, f"exit_{mode_name}_w_8_10"
elif (
(last_candle["RSI_3"] > 86.0)
and (last_candle["WILLR_14"] > -4.0)
and (last_candle["RSI_3_1h"] < 30.0)
and (last_candle["RSI_3_4h"] < 25.0)
):
return True, f"exit_{mode_name}_w_8_11"
elif (
(last_candle["RSI_3"] > 96.0)
and (last_candle["WILLR_14"] > -4.0)
and (last_candle["RSI_3_4h"] < 40.0)
and (last_candle["AROONU_14_4h"] > 50.0)
):
return True, f"exit_{mode_name}_w_8_12"
elif (
(last_candle["RSI_3"] > 96.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 50.0)
and (last_candle["RSI_3_4h"] < 50.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 70.0)
)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 50.0))
):
return True, f"exit_{mode_name}_w_8_13"
elif (
(last_candle["RSI_3"] > 88.0)
and (last_candle["WILLR_14"] > -6.0)
and (last_candle["RSI_3_1h"] < 60.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 80.0))
):
return True, f"exit_{mode_name}_w_8_14"
elif (
(last_candle["RSI_3"] > 48.0)
and (last_candle["WILLR_480"] > -25.0)
and (last_candle["RSI_14"] < 52.0)
and (last_candle["RSI_14_4h"] > 70.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 80.0)
and (isinstance(last_candle["ROC_9_4h"], np.float64) and (last_candle["ROC_9_4h"] > 100.0))
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 100.0))
):
return True, f"exit_{mode_name}_w_8_15"
elif (
(last_candle["RSI_3"] > 84.0)
and (last_candle["WILLR_14"] > -4.0)
and (last_candle["RSI_3_1h"] < 40.0)
and (last_candle["AROONU_14_4h"] > 75.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 30.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 30.0)
):
return True, f"exit_{mode_name}_w_8_16"
elif (
(last_candle["RSI_3"] > 94.0)
and (last_candle["WILLR_14"] > -8.0)
and (last_candle["AROONU_14_4h"] > 75.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 70.0)
):
return True, f"exit_{mode_name}_w_8_17"
elif (
(last_candle["RSI_3"] > 86.0)
and (last_candle["WILLR_14"] > -20.0)
and (last_candle["AROONU_14_4h"] > 50.0)
and (last_candle["top_wick_pct_1d"] > 20.0)
):
return True, f"exit_{mode_name}_w_8_18"
elif 0.1 > current_profit >= 0.09:
if last_candle["WILLR_480"] > -1.0:
return True, f"exit_{mode_name}_w_9_1"
elif (last_candle["WILLR_14"] >= -1.0) and (last_candle["RSI_14"] > 78.0):
return True, f"exit_{mode_name}_w_9_2"
elif (last_candle["WILLR_14"] >= -2.0) and (last_candle["RSI_14"] < 46.0):
return True, f"exit_{mode_name}_w_9_3"
elif (
(last_candle["WILLR_14"] >= -15.0)
and (last_candle["RSI_14"] > 70.0)
and (last_candle["ROC_9_1h"] < -0.0)
and (last_candle["ROC_9_4h"] > 20.0)
):
return True, f"exit_{mode_name}_w_9_4"
elif (
(last_candle["RSI_3"] > 98.0)
and (last_candle["WILLR_14"] > -6.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 50.0))
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 70.0)
):
return True, f"exit_{mode_name}_w_9_5"
elif (
(last_candle["RSI_3"] > 96.0)
and (last_candle["WILLR_14"] > -2.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] < -5.0))
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 80.0)
):
return True, f"exit_{mode_name}_w_9_6"
elif (
(last_candle["RSI_3"] > 88.0)
and (last_candle["WILLR_14"] > -4.0)
and (last_candle["RSI_14_4h"] > 60.0)
and (last_candle["CMF_20_1h"] < -0.0)
and (last_candle["CMF_20_4h"] < -0.0)
):
return True, f"exit_{mode_name}_w_9_7"
elif (
(last_candle["RSI_3"] > 88.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 25.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 20.0)
):
return True, f"exit_{mode_name}_w_9_8"
elif (
(last_candle["RSI_3"] > 86.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["ROC_9_1h"] < -5.0)
and (last_candle["ROC_9_4h"] > 10.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 40.0)
):
return True, f"exit_{mode_name}_w_9_9"
elif (
(last_candle["RSI_3"] > 94.0)
and (last_candle["WILLR_14"] > -18.0)
and (last_candle["AROONU_14_4h"] > 50.0)
and (last_candle["CCI_20_change_pct_4h"] < -0.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 90.0)
)
):
return True, f"exit_{mode_name}_w_9_10"
elif (
(last_candle["RSI_3"] > 88.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 30.0)
and (last_candle["RSI_3_4h"] < 25.0)
):
return True, f"exit_{mode_name}_w_9_11"
elif (
(last_candle["RSI_3"] > 98.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_4h"] < 40.0)
and (last_candle["AROONU_14_4h"] > 50.0)
):
return True, f"exit_{mode_name}_w_9_12"
elif (
(last_candle["RSI_3"] > 98.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 50.0)
and (last_candle["RSI_3_4h"] < 50.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 70.0)
)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 50.0))
):
return True, f"exit_{mode_name}_w_9_13"
elif (
(last_candle["RSI_3"] > 90.0)
and (last_candle["WILLR_14"] > -4.0)
and (last_candle["RSI_3_1h"] < 60.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 80.0))
):
return True, f"exit_{mode_name}_w_9_14"
elif (
(last_candle["RSI_3"] > 50.0)
and (last_candle["WILLR_480"] > -25.0)
and (last_candle["RSI_14"] < 50.0)
and (last_candle["RSI_14_4h"] > 70.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 80.0)
and (isinstance(last_candle["ROC_9_4h"], np.float64) and (last_candle["ROC_9_4h"] > 100.0))
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 100.0))
):
return True, f"exit_{mode_name}_w_9_15"
elif (
(last_candle["RSI_3"] > 86.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 40.0)
and (last_candle["AROONU_14_4h"] > 75.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 30.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 30.0)
):
return True, f"exit_{mode_name}_w_9_16"
elif (
(last_candle["RSI_3"] > 96.0)
and (last_candle["WILLR_14"] > -6.0)
and (last_candle["AROONU_14_4h"] > 75.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 70.0)
):
return True, f"exit_{mode_name}_w_9_17"
elif (
(last_candle["RSI_3"] > 88.0)
and (last_candle["WILLR_14"] > -20.0)
and (last_candle["AROONU_14_4h"] > 50.0)
and (last_candle["top_wick_pct_1d"] > 20.0)
):
return True, f"exit_{mode_name}_w_9_18"
elif 0.12 > current_profit >= 0.1:
if last_candle["WILLR_480"] > -1.1:
return True, f"exit_{mode_name}_w_10_1"
elif (last_candle["WILLR_14"] >= -1.0) and (last_candle["RSI_14"] > 79.0):
return True, f"exit_{mode_name}_w_10_2"
elif (last_candle["WILLR_14"] >= -2.0) and (last_candle["RSI_14"] < 44.0):
return True, f"exit_{mode_name}_w_10_3"
elif (
(last_candle["WILLR_14"] >= -15.0)
and (last_candle["RSI_14"] > 70.0)
and (last_candle["ROC_9_1h"] < -0.0)
and (last_candle["ROC_9_4h"] > 20.0)
):
return True, f"exit_{mode_name}_w_10_4"
elif (
(last_candle["RSI_3"] > 98.0)
and (last_candle["WILLR_14"] > -4.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 50.0))
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 70.0)
):
return True, f"exit_{mode_name}_w_10_5"
elif (
(last_candle["RSI_3"] > 98.0)
and (last_candle["WILLR_14"] > -1.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] < -5.0))
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 80.0)
):
return True, f"exit_{mode_name}_w_10_6"
elif (
(last_candle["RSI_3"] > 90.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_14_4h"] > 60.0)
and (last_candle["CMF_20_1h"] < -0.0)
and (last_candle["CMF_20_4h"] < -0.0)
):
return True, f"exit_{mode_name}_w_10_7"
elif (
(last_candle["RSI_3"] > 90.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 25.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 20.0)
):
return True, f"exit_{mode_name}_w_10_8"
elif (
(last_candle["RSI_3"] > 88.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["ROC_9_1h"] < -5.0)
and (last_candle["ROC_9_4h"] > 10.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 40.0)
):
return True, f"exit_{mode_name}_w_10_9"
elif (
(last_candle["RSI_3"] > 96.0)
and (last_candle["WILLR_14"] > -16.0)
and (last_candle["AROONU_14_4h"] > 50.0)
and (last_candle["CCI_20_change_pct_4h"] < -0.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 90.0)
)
):
return True, f"exit_{mode_name}_w_10_10"
elif (
(last_candle["RSI_3"] > 90.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["RSI_3_1h"] < 30.0)
and (last_candle["RSI_3_4h"] < 25.0)
):
return True, f"exit_{mode_name}_w_10_11"
elif (
(last_candle["RSI_3"] > 99.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["RSI_3_4h"] < 40.0)
and (last_candle["AROONU_14_4h"] > 50.0)
):
return True, f"exit_{mode_name}_w_10_12"
elif (
(last_candle["RSI_3"] > 99.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 50.0)
and (last_candle["RSI_3_4h"] < 50.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 70.0)
)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 50.0))
):
return True, f"exit_{mode_name}_w_10_13"
elif (
(last_candle["RSI_3"] > 92.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 60.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 80.0))
):
return True, f"exit_{mode_name}_w_10_14"
elif (
(last_candle["RSI_3"] > 52.0)
and (last_candle["WILLR_480"] > -25.0)
and (last_candle["RSI_14"] < 48.0)
and (last_candle["RSI_14_4h"] > 70.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 80.0)
and (isinstance(last_candle["ROC_9_4h"], np.float64) and (last_candle["ROC_9_4h"] > 100.0))
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 100.0))
):
return True, f"exit_{mode_name}_w_10_15"
elif (
(last_candle["RSI_3"] > 88.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["RSI_3_1h"] < 40.0)
and (last_candle["AROONU_14_4h"] > 75.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 30.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 30.0)
):
return True, f"exit_{mode_name}_w_10_16"
elif (
(last_candle["RSI_3"] > 98.0)
and (last_candle["WILLR_14"] > -4.0)
and (last_candle["AROONU_14_4h"] > 75.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 70.0)
):
return True, f"exit_{mode_name}_w_10_17"
elif (
(last_candle["RSI_3"] > 90.0)
and (last_candle["WILLR_14"] > -20.0)
and (last_candle["AROONU_14_4h"] > 50.0)
and (last_candle["top_wick_pct_1d"] > 20.0)
):
return True, f"exit_{mode_name}_w_10_18"
elif 0.2 > current_profit >= 0.12:
if last_candle["WILLR_480"] > -0.4:
return True, f"exit_{mode_name}_w_11_1"
elif (last_candle["WILLR_14"] >= -1.0) and (last_candle["RSI_14"] > 80.0):
return True, f"exit_{mode_name}_w_11_2"
elif (last_candle["WILLR_14"] >= -2.0) and (last_candle["RSI_14"] < 42.0):
return True, f"exit_{mode_name}_w_11_3"
elif (
(last_candle["WILLR_14"] >= -15.0)
and (last_candle["RSI_14"] > 70.0)
and (last_candle["ROC_9_1h"] < -0.0)
and (last_candle["ROC_9_4h"] > 20.0)
):
return True, f"exit_{mode_name}_w_11_4"
elif (
(last_candle["RSI_3"] > 98.0)
and (last_candle["WILLR_14"] > -2.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 50.0))
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 70.0)
):
return True, f"exit_{mode_name}_w_11_5"
elif (
(last_candle["RSI_3"] > 99.0)
and (last_candle["WILLR_14"] > -1.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] < -5.0))
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 80.0)
):
return True, f"exit_{mode_name}_w_11_6"
elif (
(last_candle["RSI_3"] > 92.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["RSI_14_4h"] > 60.0)
and (last_candle["CMF_20_1h"] < -0.0)
and (last_candle["CMF_20_4h"] < -0.0)
):
return True, f"exit_{mode_name}_w_11_7"
elif (
(last_candle["RSI_3"] > 92.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 25.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 20.0)
):
return True, f"exit_{mode_name}_w_11_8"
elif (
(last_candle["RSI_3"] > 90.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["ROC_9_1h"] < -5.0)
and (last_candle["ROC_9_4h"] > 10.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 40.0)
):
return True, f"exit_{mode_name}_w_11_9"
elif (
(last_candle["RSI_3"] > 98.0)
and (last_candle["WILLR_14"] > -14.0)
and (last_candle["AROONU_14_4h"] > 50.0)
and (last_candle["CCI_20_change_pct_4h"] < -0.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 90.0)
)
):
return True, f"exit_{mode_name}_w_11_10"
elif (
(last_candle["RSI_3"] > 92.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["RSI_3_1h"] < 30.0)
and (last_candle["RSI_3_4h"] < 25.0)
):
return True, f"exit_{mode_name}_w_11_11"
elif (
(last_candle["RSI_3"] > 99.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["RSI_3_4h"] < 40.0)
and (last_candle["AROONU_14_4h"] > 50.0)
):
return True, f"exit_{mode_name}_w_11_12"
elif (
(last_candle["RSI_3"] > 99.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["RSI_3_1h"] < 50.0)
and (last_candle["RSI_3_4h"] < 50.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 70.0)
)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 50.0))
):
return True, f"exit_{mode_name}_w_11_13"
elif (
(last_candle["RSI_3"] > 94.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["RSI_3_1h"] < 60.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 80.0))
):
return True, f"exit_{mode_name}_w_11_14"
elif (
(last_candle["RSI_3"] > 54.0)
and (last_candle["WILLR_480"] > -25.0)
and (last_candle["RSI_14"] < 46.0)
and (last_candle["RSI_14_4h"] > 70.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 80.0)
and (isinstance(last_candle["ROC_9_4h"], np.float64) and (last_candle["ROC_9_4h"] > 100.0))
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 100.0))
):
return True, f"exit_{mode_name}_w_11_15"
elif (
(last_candle["RSI_3"] > 90.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["RSI_3_1h"] < 40.0)
and (last_candle["AROONU_14_4h"] > 75.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 30.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 30.0)
):
return True, f"exit_{mode_name}_w_11_16"
elif (
(last_candle["RSI_3"] > 99.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["AROONU_14_4h"] > 75.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 70.0)
):
return True, f"exit_{mode_name}_w_11_17"
elif (
(last_candle["RSI_3"] > 92.0)
and (last_candle["WILLR_14"] > -20.0)
and (last_candle["AROONU_14_4h"] > 50.0)
and (last_candle["top_wick_pct_1d"] > 20.0)
):
return True, f"exit_{mode_name}_w_11_18"
elif current_profit >= 0.2:
if last_candle["WILLR_480"] > -0.2:
return True, f"exit_{mode_name}_w_12_1"
elif (last_candle["WILLR_14"] >= -1.0) and (last_candle["RSI_14"] > 81.0):
return True, f"exit_{mode_name}_w_12_2"
elif (last_candle["WILLR_14"] >= -2.0) and (last_candle["RSI_14"] < 40.0):
return True, f"exit_{mode_name}_w_12_3"
elif (
(last_candle["WILLR_14"] >= -1.0)
and (last_candle["RSI_14"] > 80.0)
and (last_candle["ROC_9_1h"] < -0.0)
and (last_candle["ROC_9_4h"] > 20.0)
):
return True, f"exit_{mode_name}_w_12_4"
elif (
(last_candle["RSI_3"] > 99.0)
and (last_candle["WILLR_14"] > -1.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 50.0))
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 70.0)
):
return True, f"exit_{mode_name}_w_12_5"
elif (
(last_candle["RSI_3"] > 99.0)
and (last_candle["WILLR_14"] > -1.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] < -5.0))
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 80.0)
):
return True, f"exit_{mode_name}_w_12_6"
elif (
(last_candle["RSI_3"] > 94.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["RSI_14_4h"] > 60.0)
and (last_candle["CMF_20_1h"] < -0.0)
and (last_candle["CMF_20_4h"] < -0.0)
):
return True, f"exit_{mode_name}_w_12_7"
elif (
(last_candle["RSI_3"] > 94.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 25.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 20.0)
):
return True, f"exit_{mode_name}_w_12_8"
elif (
(last_candle["RSI_3"] > 92.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["ROC_9_1h"] < -5.0)
and (last_candle["ROC_9_4h"] > 10.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 40.0)
):
return True, f"exit_{mode_name}_w_12_9"
elif (
(last_candle["RSI_3"] > 99.0)
and (last_candle["WILLR_14"] > -12.0)
and (last_candle["AROONU_14_4h"] > 50.0)
and (last_candle["CCI_20_change_pct_4h"] < -0.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 90.0)
)
):
return True, f"exit_{mode_name}_w_12_10"
elif (
(last_candle["RSI_3"] > 94.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["RSI_3_1h"] < 30.0)
and (last_candle["RSI_3_4h"] < 25.0)
):
return True, f"exit_{mode_name}_w_12_11"
elif (
(last_candle["RSI_3"] > 99.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["RSI_3_4h"] < 40.0)
and (last_candle["AROONU_14_4h"] > 50.0)
):
return True, f"exit_{mode_name}_w_12_12"
elif (
(last_candle["RSI_3"] > 99.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["RSI_3_1h"] < 50.0)
and (last_candle["RSI_3_4h"] < 50.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 70.0)
)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 50.0))
):
return True, f"exit_{mode_name}_w_12_13"
elif (
(last_candle["RSI_3"] > 96.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["RSI_3_1h"] < 60.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 80.0))
):
return True, f"exit_{mode_name}_w_12_14"
elif (
(last_candle["RSI_3"] > 56.0)
and (last_candle["WILLR_480"] > -25.0)
and (last_candle["RSI_14"] < 44.0)
and (last_candle["RSI_14_4h"] > 70.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 80.0)
and (isinstance(last_candle["ROC_9_4h"], np.float64) and (last_candle["ROC_9_4h"] > 100.0))
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 100.0))
):
return True, f"exit_{mode_name}_w_12_15"
elif (
(last_candle["RSI_3"] > 92.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["RSI_3_1h"] < 40.0)
and (last_candle["AROONU_14_4h"] > 75.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 30.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 30.0)
):
return True, f"exit_{mode_name}_w_12_16"
elif (
(last_candle["RSI_3"] > 99.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["AROONU_14_4h"] > 75.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 70.0)
):
return True, f"exit_{mode_name}_w_12_17"
elif (
(last_candle["RSI_3"] > 94.0)
and (last_candle["WILLR_14"] > -20.0)
and (last_candle["AROONU_14_4h"] > 50.0)
and (last_candle["top_wick_pct_1d"] > 20.0)
):
return True, f"exit_{mode_name}_w_12_18"
# Here ends exit signal conditions for long_exit_williams_r
return False, None
# Long Exit Dec
# ---------------------------------------------------------------------------------------------
def long_exit_dec(
self,
mode_name: str,
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["WILLR_14"] > -1.0)
and (last_candle["RSI_14"] > 78.0)
and (
isinstance(last_candle["EMA_200_1h"], np.float64) and (last_candle["EMA_12_1h"] < last_candle["EMA_200_1h"])
)
and (
isinstance(last_candle["EMA_200_4h"], np.float64) and (last_candle["EMA_12_4h"] < last_candle["EMA_200_4h"])
)
and (last_candle["KST_10_15_20_30_10_10_10_15_1h"] < last_candle["KSTs_9_1h"])
and (last_candle["KST_10_15_20_30_10_10_10_15_4h"] < last_candle["KSTs_9_4h"])
):
return True, f"exit_{mode_name}_d_0_1"
elif (
(last_candle["WILLR_14"] > -1.0)
and (last_candle["RSI_14"] > 78.0)
and (last_candle["CMF_20_1h"] < -0.0)
and (
isinstance(last_candle["EMA_200_1h"], np.float64) and (last_candle["EMA_12_1h"] < last_candle["EMA_200_1h"])
)
and (
isinstance(last_candle["EMA_200_4h"], np.float64) and (last_candle["EMA_12_4h"] < last_candle["EMA_200_4h"])
)
):
return True, f"exit_{mode_name}_d_0_2"
elif (
(last_candle["WILLR_14"] > -1.0)
and (last_candle["STOCHRSIk_14_14_3_3"] > 99.0)
and (last_candle["CMF_20_1h"] < -0.0)
and (last_candle["CMF_20_4h"] < -0.0)
and (
(last_candle["STOCHRSIk_14_14_3_3_4h"] > 20.0) and (last_candle["STOCHRSIk_14_14_3_3_change_pct_4h"] < -10.0)
)
):
return True, f"exit_{mode_name}_d_0_3"
elif (
(last_candle["WILLR_14"] > -1.0)
and (last_candle["RSI_14"] > 78.0)
and (last_candle["STOCHRSIk_14_14_3_3"] > 95.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 70.0)
and (
isinstance(last_candle["EMA_200_1h"], np.float64) and (last_candle["EMA_12_1h"] < last_candle["EMA_200_1h"])
)
and (
isinstance(last_candle["EMA_200_4h"], np.float64) and (last_candle["EMA_12_4h"] < last_candle["EMA_200_4h"])
)
):
return True, f"exit_{mode_name}_d_0_4"
elif (
(last_candle["WILLR_14"] > -1.0)
and (last_candle["RSI_14"] > 78.0)
and (last_candle["ROC_9_1h"] < -5.0)
and (last_candle["ROC_9_4h"] < -5.0)
):
return True, f"exit_{mode_name}_d_0_5"
elif (
(last_candle["RSI_3"] > 95.0)
and (last_candle["STOCHRSIk_14_14_3_3"] > 95.0)
and (last_candle["RSI_14"] < 40.0)
and (last_candle["ROC_9_1h"] < -10.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 50.0))
):
return True, f"exit_{mode_name}_d_0_6"
elif (
(last_candle["RSI_14"] < 50.0)
and (last_candle["STOCHRSIk_14_14_3_3"] > 95.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 50.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] < -40.0))
):
return True, f"exit_{mode_name}_d_0_7"
elif (
(last_candle["WILLR_14"] > -1.0)
and (last_candle["STOCHRSIk_14_14_3_3"] > 99.0)
and (last_candle["CMF_20_1h"] < -0.1)
and (last_candle["CMF_20_4h"] < -0.1)
and (last_candle["change_pct_1d"] < -5.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 15.0))
):
return True, f"exit_{mode_name}_d_0_8"
elif (
(last_candle["WILLR_14"] > -1.0)
and (last_candle["RSI_3"] > 99.0)
and (last_candle["change_pct_4h"] < -5.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 30.0))
):
return True, f"exit_{mode_name}_d_0_9"
elif (
(last_candle["WILLR_14"] > -1.0)
and (last_candle["RSI_14"] < 50.0)
and (last_candle["ROC_9_1h"] < -10.0)
and (last_candle["ROC_9_4h"] < -10.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 10.0))
):
return True, f"exit_{mode_name}_d_0_10"
elif (
(last_candle["RSI_3"] > 95.0)
and (last_candle["RSI_14"] < 45.0)
and (last_candle["ROC_9_15m"] < -10.0)
and (last_candle["ROC_9_1h"] < -10.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] < -20.0))
):
return True, f"exit_{mode_name}_d_0_11"
elif (
(last_candle["RSI_3"] > 95.0)
and (last_candle["RSI_14"] < 50.0)
and (last_candle["RSI_3_4h"] < 10.0)
and (last_candle["ROC_9_1h"] < -20.0)
and (last_candle["ROC_9_4h"] < -20.0)
):
return True, f"exit_{mode_name}_d_0_12"
elif (last_candle["RSI_3"] > 99.0) and (last_candle["RSI_3_4h"] < 5.0) and (last_candle["ROC_9_4h"] < -25.0):
return True, f"exit_{mode_name}_d_0_13"
elif (
(last_candle["RSI_3"] > 99.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["RSI_3_4h"] < 5.0)
and (last_candle["AROONU_14_4h"] > 25.0)
):
return True, f"exit_{mode_name}_d_0_14"
elif (last_candle["RSI_3"] > 99.0) and (last_candle["RSI_14"] > 78.0) and (last_candle["ROC_9_4h"] < -30.0):
return True, f"exit_{mode_name}_d_0_15"
elif (
(last_candle["RSI_3"] > 99.0)
and (last_candle["AROONU_14_4h"] > 25.0)
and (last_candle["ROC_9_4h"] < -25.0)
and (last_candle["AROONU_14_1d"] > 50.0)
and (last_candle["change_pct_1d"] < -15.0)
):
return True, f"exit_{mode_name}_d_0_16"
elif (
(last_candle["RSI_3"] > 99.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["RSI_3_1h"] < 10.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 90.0)
and (last_candle["ROC_9_4h"] > 30.0)
):
return True, f"exit_{mode_name}_d_0_17"
elif (
(last_candle["RSI_3"] > 95.0)
and (last_candle["RSI_14"] > 75.0)
and (last_candle["RSI_3_4h"] < 20.0)
and (last_candle["ROC_2_1d"] < -50.0)
):
return True, f"exit_{mode_name}_d_0_18"
elif (
(last_candle["RSI_3"] > 99.0)
and (last_candle["RSI_14"] > 78.0)
and (last_candle["RSI_3_4h"] < 10.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 70.0)
)
):
return True, f"exit_{mode_name}_d_0_19"
elif (
(last_candle["RSI_3"] > 90.0)
and (last_candle["RSI_14"] < 40.0)
and (last_candle["RSI_3_1h"] < 10.0)
and (last_candle["AROONU_14_1h"] > 25.0)
):
return True, f"exit_{mode_name}_d_0_20"
elif (
(last_candle["RSI_3"] > 95.0)
and (last_candle["RSI_14"] < 40.0)
and (last_candle["RSI_3_1h"] < 20.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 90.0)
):
return True, f"exit_{mode_name}_d_0_21"
elif (
(last_candle["RSI_3"] > 99.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["change_pct_4h"] < -5.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 50.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] < -30.0))
):
return True, f"exit_{mode_name}_d_0_22"
elif (
(last_candle["RSI_3"] > 98.0)
and (last_candle["WILLR_14"] > -5.0)
and (last_candle["RSI_3_1h"] < 15.0)
and (last_candle["RSI_3_1d"] < 5.0)
):
return True, f"exit_{mode_name}_d_0_23"
elif (
(last_candle["RSI_3"] > 99.0)
and (last_candle["RSI_14"] > 78.0)
and (last_candle["WILLR_14"] > -5.0)
and (last_candle["RSI_3_4h"] < 30.0)
and (last_candle["AROONU_14_4h"] > 75.0)
):
return True, f"exit_{mode_name}_d_0_24"
elif (
(last_candle["RSI_3"] > 95.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_4h"] < 10.0)
and (last_candle["ROC_9_4h"] < -15.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 50.0)
)
):
return True, f"exit_{mode_name}_d_0_25"
elif (
(last_candle["RSI_3"] > 95.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["RSI_3_4h"] < 15.0)
and (last_candle["ROC_9_4h"] < -20.0)
):
return True, f"exit_{mode_name}_d_0_26"
elif (
(last_candle["RSI_3"] > 95.0)
and (last_candle["RSI_14"] < 50.0)
and (last_candle["RSI_3_1h"] < 20.0)
and (last_candle["RSI_3_4h"] < 20.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 20.0)
):
return True, f"exit_{mode_name}_d_0_27"
elif (
(last_candle["RSI_3"] > 95.0)
and (last_candle["RSI_14"] < 50.0)
and (last_candle["RSI_3_15m"] < 10.0)
and (last_candle["ROC_9_4h"] > 50.0)
):
return True, f"exit_{mode_name}_d_0_28"
elif (
(last_candle["RSI_3"] > 95.0)
and (last_candle["RSI_14"] < 50.0)
and (last_candle["RSI_3_1h"] < 20.0)
and (last_candle["RSI_3_4h"] < 20.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 30.0)
):
return True, f"exit_{mode_name}_d_0_29"
elif (
(last_candle["RSI_3"] > 99.0)
and (last_candle["RSI_3_1h"] < 25.0)
and (last_candle["RSI_3_4h"] < 10.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 70.0)
):
return True, f"exit_{mode_name}_d_0_30"
elif (
(last_candle["RSI_3"] > 95.0)
and (last_candle["RSI_14"] < 50.0)
and (last_candle["RSI_3_1h"] < 15.0)
and (last_candle["RSI_3_4h"] < 15.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 25.0)
):
return True, f"exit_{mode_name}_d_0_31"
elif (
(last_candle["RSI_3"] > 95.0)
and (last_candle["RSI_3_1h"] < 15.0)
and (last_candle["ROC_2_4h"] < -30.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 30.0)
):
return True, f"exit_{mode_name}_d_0_32"
elif (
(last_candle["RSI_3"] > 95.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["ROC_2_1h"] < -10.0)
and (last_candle["ROC_9_1h"] > 30.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 50.0)
):
return True, f"exit_{mode_name}_d_0_33"
elif (
(last_candle["RSI_3"] > 65.0)
and (last_candle["RSI_3_15m"] < 30.0)
and (last_candle["RSI_14_1h"] > 80.0)
and (last_candle["ROC_9_1h"] > 40.0)
):
return True, f"exit_{mode_name}_d_0_34"
elif (
(last_candle["RSI_3"] > 95.0)
and (last_candle["WILLR_14"] > -5.0)
and (last_candle["RSI_3_1d"] < 25.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 75.0)
):
return True, f"exit_{mode_name}_d_0_35"
elif (
(last_candle["RSI_3"] > 95.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["ROC_9_4h"] < -25.0)
and (last_candle["RSI_3_1d"] < 25.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 50.0)
):
return True, f"exit_{mode_name}_d_0_36"
elif (
(last_candle["RSI_3"] > 84.0)
and (last_candle["RSI_14"] < 50.0)
and (last_candle["RSI_3_1h"] < 20.0)
and (last_candle["RSI_3_1d"] < 25.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 50.0)
):
return True, f"exit_{mode_name}_d_0_37"
elif (
(last_candle["RSI_3"] > 90.0)
and (last_candle["WILLR_14"] > -10.0)
and (last_candle["RSI_3_4h"] < 10.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 20.0)
):
return True, f"exit_{mode_name}_d_0_38"
elif (
(last_candle["RSI_3"] > 99.0)
and (last_candle["WILLR_14"] > -1.0)
and (last_candle["CMF_20_4h"] < -0.0)
and (last_candle["RSI_3_4h"] < 10.0)
):
return True, f"exit_{mode_name}_d_0_39"
elif (
(last_candle["RSI_3"] > 98.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1h"] < 30.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 30.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 90.0)
)
):
return True, f"exit_{mode_name}_d_0_40"
elif (
(last_candle["RSI_3"] > 98.0)
and (last_candle["WILLR_14"] > -5.0)
and (last_candle["RSI_3_1h"] < 30.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 25.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 50.0))
):
return True, f"exit_{mode_name}_d_0_41"
elif (
(last_candle["RSI_3"] > 95.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 30.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 40.0))
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 70.0)
)
):
return True, f"exit_{mode_name}_d_0_42"
elif (
(last_candle["RSI_3"] > 95.0)
and (last_candle["RSI_14"] < 50.0)
and (last_candle["RSI_3_1h"] < 15.0)
and (last_candle["RSI_3_4h"] < 40.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 90.0)
)
):
return True, f"exit_{mode_name}_d_0_43"
elif (
(last_candle["RSI_3"] > 90.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_4h"] < 30.0)
and (last_candle["RSI_3_1d"] < 25.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] < -30.0))
):
return True, f"exit_{mode_name}_d_0_44"
elif (last_candle["RSI_3"] > 96.0) and (last_candle["WILLR_14"] > -4.0) and (last_candle["RSI_3_1h"] < 10.0):
return True, f"exit_{mode_name}_d_0_45"
elif (
(last_candle["RSI_3"] > 98.0)
and (last_candle["RSI_3_1h"] < 15.0)
and (last_candle["RSI_3_4h"] < 10.0)
and (last_candle["ROC_2_1d"] < -20.0)
):
return True, f"exit_{mode_name}_d_0_46"
elif (
(last_candle["RSI_3"] > 98.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 80.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 40.0)
and (last_candle["change_pct_1d"] < -5.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] < -5.0))
):
return True, f"exit_{mode_name}_d_0_47"
elif (
(last_candle["RSI_3"] > 70.0)
and (last_candle["RSI_14"] < 42.0)
and (last_candle["RSI_3_1h"] < 30.0)
and (last_candle["RSI_3_4h"] < 20.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 50.0)
):
return True, f"exit_{mode_name}_d_0_48"
elif (
(last_candle["RSI_3"] > 95.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_4h"] < 20.0)
and (last_candle["change_pct_1d"] < -5.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 50.0)
)
):
return True, f"exit_{mode_name}_d_0_49"
elif (
(last_candle["RSI_3"] > 80.0)
and (last_candle["WILLR_14"] > -2.0)
and (last_candle["RSI_3_1d"] < 10.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 90.0)
):
return True, f"exit_{mode_name}_d_0_50"
elif (
(last_candle["RSI_3"] > 68.0)
and (last_candle["RSI_14"] < 44.0)
and (last_candle["RSI_3_4h"] < 20.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 50.0)
):
return True, f"exit_{mode_name}_d_0_51"
elif (
(last_candle["RSI_3"] > 95.0)
and (last_candle["RSI_14"] > 62.0)
and (last_candle["WILLR_14"] > -10.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 70.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] < -15.0))
):
return True, f"exit_{mode_name}_d_0_52"
elif (
(last_candle["RSI_3"] > 95.0)
and (last_candle["RSI_14"] < 50.0)
and (last_candle["WILLR_14"] > -5.0)
and (last_candle["RSI_3_1h"] < 20.0)
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 50.0)
and (
isinstance(last_candle["STOCHRSIk_14_14_3_3_1d"], np.float64)
and (last_candle["STOCHRSIk_14_14_3_3_1d"] > 50.0)
)
):
return True, f"exit_{mode_name}_d_0_53"
elif (
(last_candle["RSI_3"] > 80.0)
and (last_candle["RSI_14"] < 44.0)
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 50.0)
and (last_candle["ROC_9_4h"] < -10.0)
and (last_candle["change_pct_1d"] < -10.0)
):
return True, f"exit_{mode_name}_d_0_54"
elif (
(last_candle["RSI_3"] > 98.0)
and (last_candle["WILLR_14"] > -12.0)
and (last_candle["ROC_9_4h"] < -5.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] > 10.0))
and (last_candle["STOCHRSIk_14_14_3_3_1h"] > 50.0)
):
return True, f"exit_{mode_name}_d_0_55"
elif (
(last_candle["RSI_3"] > 95.0)
and (last_candle["RSI_14"] < 50.0)
and (last_candle["RSI_3_1h"] < 30.0)
and (last_candle["RSI_3_4h"] < 25.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] < -30.0))
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 10.0)
):
return True, f"exit_{mode_name}_d_0_56"
elif (
(last_candle["RSI_3"] > 50.0)
and (last_candle["RSI_14"] < 34.0)
and (isinstance(last_candle["ROC_9_1d"], np.float64) and (last_candle["ROC_9_1d"] < -30.0))
and (last_candle["STOCHRSIk_14_14_3_3_4h"] > 70.0)
):
return True, f"exit_{mode_name}_d_0_57"
elif (
(last_candle["RSI_3"] > 95.0)
and (last_candle["RSI_3_1h"] < 30.0)
and (last_candle["RSI_3_4h"] < 30.0)
and (isinstance(last_candle["ROC_9_1d"], np