15 related strategies (⧉ identical code, ≈ similar name)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 | from freqtrade.strategy import IStrategy, IntParameter from pandas import DataFrame from datetime import datetime, timedelta from typing import Optional import talib.abstract as ta import pandas as pd class XRPStrategy(IStrategy): INTERFACE_VERSION = 3 timeframe = '15m' startup_candle_count = 200 stoploss = -0.03 trailing_stop = True trailing_stop_positive = 0.01 trailing_stop_positive_offset = 0.02 trailing_only_offset_is_reached = True use_custom_stoploss = False minimal_roi = { "0": 0.10, "480": 0.05, "960": 0.02, "1440": 0 } use_exit_signal = True exit_profit_only = False can_short = False buy_rsi_min = IntParameter(30, 50, default=35, space='buy') buy_rsi_max = IntParameter(50, 70, default=65, space='buy') buy_adx_min = IntParameter(10, 30, default=10, space='buy') # Slider 1–33 → score >= 3 (sélectif) # Slider 34–66 → score >= 2 (modéré) # Slider 67–100 → score >= 1 (agressif) buy_score_threshold = IntParameter(1, 100, default=20, space='buy', load=True) daily_drawdown_limit = -0.03 pair_cooldown_hours = 4 def informative_pairs(self): pairs = self.dp.current_whitelist() informative = [(pair, '5m') for pair in pairs] informative += [(pair, '1h') for pair in pairs] return informative def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: dataframe['adx'] = ta.ADX(dataframe, timeperiod=14) dataframe['signal_score'] = 0 dataframe.loc[dataframe['adx'] > 20, 'signal_score'] += 1 dataframe.loc[dataframe['adx'] > 30, 'signal_score'] += 1 inf5 = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe='5m') inf5['rsi'] = ta.RSI(inf5, timeperiod=14) inf5['ema20'] = ta.EMA(inf5, timeperiod=20) inf5['ema50'] = ta.EMA(inf5, timeperiod=50) inf5['volume_ok'] = inf5['volume'] > inf5['volume'].rolling(20).mean() inf5.rename(columns={ 'rsi': '5m_rsi', 'ema20': '5m_ema20', 'ema50': '5m_ema50', 'volume_ok': '5m_volume_ok' }, inplace=True) inf5_15 = inf5[['date', '5m_rsi', '5m_ema20', '5m_ema50', '5m_volume_ok']].copy() inf5_15['date'] = inf5_15['date'].dt.floor('15min') inf5_15 = inf5_15.groupby('date').last().reset_index() dataframe = dataframe.merge(inf5_15, on='date', how='left') dataframe.loc[ (dataframe['5m_rsi'] > 45) & (dataframe['5m_rsi'] < 60), 'signal_score' ] += 1 dataframe.loc[ dataframe['5m_ema20'] > dataframe['5m_ema50'], 'signal_score' ] += 1 inf1h = self.dp.get_pair_dataframe(pair=metadata['pair'], timeframe='1h') if len(inf1h) > 0: inf1h['ema20_1h'] = ta.EMA(inf1h, timeperiod=20) inf1h['ema50_1h'] = ta.EMA(inf1h, timeperiod=50) inf1h['ema200_1h'] = ta.EMA(inf1h, timeperiod=200) inf1h['rsi_1h'] = ta.RSI(inf1h, timeperiod=14) inf1h['date'] = pd.to_datetime(inf1h['date']) inf1h_15 = inf1h[['date', 'ema20_1h', 'ema50_1h', 'ema200_1h', 'rsi_1h']].copy() inf1h_15['date'] = inf1h_15['date'].dt.floor('15min') dataframe = dataframe.merge(inf1h_15, on='date', how='left') else: dataframe['ema20_1h'] = float('nan') dataframe['ema50_1h'] = float('nan') dataframe['ema200_1h'] = float('nan') dataframe['rsi_1h'] = float('nan') dataframe.ffill(inplace=True) return dataframe def _score_threshold_from_slider(self) -> int: v = self.buy_score_threshold.value if v <= 33: return 3 elif v <= 66: return 2 else: return 1 def _is_circuit_breaker_active(self, current_time: datetime) -> bool: if self.daily_drawdown_limit >= 0: return False try: from freqtrade.persistence import Trade start_of_day = current_time.replace(hour=0, minute=0, second=0, microsecond=0) closed_today = Trade.get_trades_proxy(is_open=False, open_date=start_of_day) daily_pnl = sum(t.close_profit_abs for t in closed_today if t.close_profit_abs) current_balance = self.wallets.get_free('USDT') + self.wallets.get_used('USDT') if current_balance <= 0: return False drawdown = daily_pnl / current_balance return drawdown < self.daily_drawdown_limit except Exception: return False def _is_pair_in_cooldown(self, pair: str, current_time: datetime) -> bool: if self.pair_cooldown_hours <= 0: return False try: from freqtrade.persistence import Trade cutoff = current_time - timedelta(hours=self.pair_cooldown_hours) recent_trades = Trade.get_trades_proxy(is_open=False, pair=pair) for t in recent_trades: if t.close_date_utc and t.close_date_utc >= cutoff: if t.exit_reason and 'stop_loss' in t.exit_reason.lower(): return True except Exception: pass return False def _had_recent_trailing_stop(self, pair: str, current_time: datetime) -> bool: try: from freqtrade.persistence import Trade cutoff = current_time - timedelta(hours=2) recent_trades = Trade.get_trades_proxy(is_open=False, pair=pair) for t in recent_trades: if t.close_date_utc and t.close_date_utc >= cutoff: if t.exit_reason == 'trailing_stop_loss' and t.close_profit > 0: return True except Exception: pass return False def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: min_score = self._score_threshold_from_slider() dataframe.loc[ ( # 1. Filtre tendance 1h (dataframe['close'] > dataframe['ema200_1h']) & # 2. Bougie verte obligatoire (dataframe['close'] > dataframe['open']) & # 3. Score signal selon slider (dataframe['signal_score'] >= min_score) & # 4. Conditions techniques de base (dataframe['adx'] > self.buy_adx_min.value) & (dataframe['5m_ema20'] > dataframe['5m_ema50']) & (dataframe['5m_rsi'] > self.buy_rsi_min.value) & (dataframe['5m_rsi'] < self.buy_rsi_max.value) & (dataframe['5m_volume_ok']) & (dataframe['volume'] > 0) ), 'enter_long'] = 1 return dataframe def confirm_trade_entry(self, pair: str, order_type: str, amount: float, rate: float, time_in_force: str, current_time: datetime, entry_tag: Optional[str], side: str, **kwargs) -> bool: if self._is_circuit_breaker_active(current_time): return False if self._is_pair_in_cooldown(pair, current_time): return False return True def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: dataframe.loc[ ( (dataframe['rsi_1h'] < 40) & (dataframe['ema20_1h'] < dataframe['ema50_1h']) ), 'exit_long'] = 1 return dataframe def custom_stake_amount(self, current_time: datetime, current_rate: float, proposed_stake: float, min_stake: Optional[float], max_stake: float, leverage: float, entry_tag: Optional[str], side: str, pair: str, **kwargs) -> float: try: dataframe, _ = self.dp.get_analyzed_dataframe(pair, self.timeframe) if len(dataframe) == 0: return proposed_stake score = int(dataframe.iloc[-1]['signal_score']) except Exception: return proposed_stake if score >= 4: pct = 1.20 elif score >= 2: pct = 1.00 else: pct = 0.80 if self._had_recent_trailing_stop(pair, current_time): pct = min(pct * 1.25, 1.50) stake = proposed_stake * pct if min_stake and stake < min_stake: stake = min_stake if stake > max_stake: stake = max_stake return stake def custom_exit(self, pair: str, trade, current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> Optional[str]: hours = (current_time - trade.open_date_utc).total_seconds() / 3600 if hours >= 1 and current_profit < -0.01: return "exit_1h_neg1pct" if hours >= 2 and current_profit < -0.005: return "exit_2h_neg05pct" if hours >= 3 and current_profit < 0: return "exit_3h_negative" return None |
Strategy League — fixed backtest that feeds the ranking
Export report Freqtrade logsRun finished · took 119.1s
ℹ️ This strategy uses a trailing stop — freqtrade only
re-checks these once per 15m candle by default, not against the price movement within it.
For a more accurate read, re-run this backtest locally with --timeframe-detail 1m. Freqle doesn't do this for every check here: multiplying every
League/sweep backtest by a finer detail timeframe is more compute than the sandbox can sustain
across every indexed strategy. why this matters →
- profit isn't statistically significant (p=1.00) — hard to tell apart from luck
- only 0% of resampled runs were profitable
- profitable in only 0% of rolling 3-month windows
- did not beat simply holding the market
- very deep drawdown (-90%)
Resampling the trade sequence 2,000× shows the spread of results this edge could plausibly produce — separating a dependable strategy from one that got lucky once.
Loading charts…
Monthly breakdown
| Month | Regime | Trades | Profit % | Avg % | Win | Loss | Win % | DD % | Avg dur |
|---|---|---|---|---|---|---|---|---|---|
| Jul 2021 | bearish trending high vol | 49 | -1.68 | -0.31 | 15 | 34 | 30.6 | -89.97 | 1h 45m |
| Jun 2021 | bearish trending high vol | 104 | -3.30 | -0.30 | 34 | 70 | 32.7 | -88.61 | 1h 27m |
| May 2021 | bearish trending high vol | 197 | -9.72 | -0.48 | 75 | 122 | 38.1 | -85.02 | 1h 11m |
| Apr 2021 | bearish choppy high vol | 426 | -15.78 | -0.36 | 163 | 263 | 38.3 | -75.83 | 1h 24m |
| Mar 2021 | bullish choppy high vol | 469 | -14.24 | -0.29 | 168 | 301 | 35.8 | -61.53 | 1h 35m |
| Feb 2021 | bullish trending high vol | 592 | -17.83 | -0.29 | 240 | 352 | 40.5 | -45.41 | 1h 13m |
| Jan 2021 | bullish trending high vol | 705 | -27.39 | -0.36 | 299 | 406 | 42.4 | -28.13 | 1h 05m |
Trade charts — best 2 and worst 2 performing pairs (full OHLC candles are expensive to render for every pair)
Backtests — over a market period
Backtest this strategy over a chosen crypto-cycle period. These don't affect the League ranking, and need that period's candle data downloaded.
Log in or sign up to run backtests.
| Period | Range | Total % | Win % | Max DD | Trades | |
|---|---|---|---|---|---|---|
| 2020 · DeFi Summer & Pre-Halving Rally | 20200101-20210101 | not run | ||||
| 2021 · Institutional Bull Market | 20210101-20220101 | not run | ||||
| 2022 · Post-Bull Crash & Macro Tightening | 20220101-20230101 | not run | ||||
| 2023–2024 · Recovery & ETF Anticipation | 20230101-20250101 | not run | ||||
| 2025–2026 · Current Cycle | 20250101-20260101 | not run | ||||
Walk forward
Out-of-sample backtest on recent data · 33 pairs · 20260101-20260701.
Backtest trust check
no lookahead patterns · 1 thing(s) worth reviewing before trusting the numbers
| Line | Pattern | Detail | |
|---|---|---|---|
| 11 | review | startup_candles_too_small | startup_candle_count is 200, but EMA(timeperiod=200) needing 3x warmup needs at least 600 candles -- so the first 400+ candles of every backtest use an indicator that hasn't warmed up. Recursive indicators (EMA/RSI/ADX/ATR) want several times their period, not exactly it |
ran by Ron · took s
Lookahead analysis
freqtrade lookahead-analysis: detects strategies peeking at future candles.