# ─── Coins & Timeframes ─────────────────────────────────────────────────────── COINS = ['BTC/USDT', 'ETH/USDT', 'SOL/USDT'] TIMEFRAMES = ['1h', '4h'] # ─── Capital & Risk ─────────────────────────────────────────────────────────── CAPITAL = 1000.0 # USD RISK_PCT = 0.02 # 2% risk per trade LEVERAGE = 5 # 5x leverage # ─── Backtest Combinations ──────────────────────────────────────────────────── RR_RATIOS = [1.5, 2.0, 3.0] SL_METHODS = ['candle_pct', 'candle_atr', 'atr'] # candle_pct : wick of last interim candle + 0.2% buffer # candle_atr : wick of last interim candle + 0.25 * ATR buffer # atr : entry ± 1.5 * ATR (pure ATR stop) # ─── SL Buffer Settings ─────────────────────────────────────────────────────── SL_BUFFER_PCT = 0.002 # 0.2% beyond wick (candle_pct method) SL_BUFFER_ATR_MULT = 0.25 # 0.25 * ATR beyond wick (candle_atr method) ATR_SL_MULTIPLIER = 1.5 # multiplier for pure ATR method # ─── Indicator Periods ──────────────────────────────────────────────────────── SWING_LOOKBACK = 5 EMA_SHORT = 12 EMA_MID = 21 EMA_LONG = 50 RSI_PERIOD = 14 MACD_FAST = 12 MACD_SLOW = 26 MACD_SIGNAL = 9 ATR_PERIOD = 14 ADX_PERIOD = 14 RVOL_PERIOD = 20 # ─── Filter Thresholds ──────────────────────────────────────────────────────── RVOL_THRESHOLD = 1.5 # volume must be 1.5x the average ADX_THRESHOLD = 20 # ADX must be above 20 (trending market) RSI_LONG_MIN = 50 # RSI must be above 50 for longs RSI_SHORT_MAX = 50 # RSI must be below 50 for shorts # ─── Multi-Timeframe Confirmation ───────────────────────────────────────────── HTF_MAP = {'1h': '4h', '4h': '1d'} # signal TF → higher TF for trend filter # ─── Retest Strategy ────────────────────────────────────────────────────────── RETEST_TIMEOUT_CANDLES = 20 # cancel setup if no retest within N candles # #2 ATR-based retest tolerance (replaces flat RETEST_TOLERANCE_PCT) RETEST_ATR_MULT = 0.5 # retest zone = 0.5x ATR from broken level # #3 Breakout candle quality BREAKOUT_BODY_MIN_PCT = 0.5 # body must be >= 50% of total candle range BREAKOUT_CLOSE_TOP_PCT = 0.7 # longs: close must be in top 30% of range # shorts: close must be in bottom 30% # #4 Retest depth invalidation RETEST_DEPTH_ATR_MULT = 1.0 # cancel if close moves >1 ATR beyond level # #8 RSI momentum floor/ceiling during retest phase RSI_RETEST_FLOOR = 40 # longs: RSI must not drop below 40 during pullback RSI_RETEST_CEIL = 60 # shorts: RSI must not rise above 60 during pullback # ─── Data ───────────────────────────────────────────────────────────────────── LOOKBACK_MONTHS = 60 # how many months of history to fetch (5 years)