3 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 | from datetime import datetime, timedelta import talib.abstract as ta import pandas_ta as pta from freqtrade.persistence import Trade from freqtrade.strategy.interface import IStrategy from pandas import DataFrame from freqtrade.strategy import DecimalParameter, IntParameter, stoploss_from_open from functools import reduce import warnings warnings.simplefilter(action="ignore", category=RuntimeWarning) ## Bull version, No stoploss, Just do it class GeneTrader_10(IStrategy): minimal_roi = { "0": 1 } timeframe = '5m' process_only_new_candles = True startup_candle_count = 240 trailing_stop = False trailing_stop_positive = 0.002 trailing_stop_positive_offset = 0.05 trailing_only_offset_is_reached = True use_custom_stoploss = True order_types = { 'entry': 'market', 'exit': 'market', 'emergency_exit': 'market', 'force_entry': 'market', 'force_exit': "market", 'stoploss': 'market', 'stoploss_on_exchange': False, 'stoploss_on_exchange_interval': 60, 'stoploss_on_exchange_market_ratio': 0.99 } # Hyperopt Parameters # hard stoploss profit pHSL = DecimalParameter(-0.2, -0.04, default=-0.2, space='sell', optimize=True) # profit threshold 1, trigger point, SL_1 is used pPF_1 = DecimalParameter(0.008, 0.02, default=0.015, space='sell', optimize=True) pSL_1 = DecimalParameter(0.008, 0.02, default=0.013, space='sell', optimize=True) # profit threshold 2, SL_2 is used pPF_2 = DecimalParameter(0.04, 0.1, default=0.04, space='sell', optimize=True) pSL_2 = DecimalParameter(0.02, 0.07, default=0.057, space='sell', optimize=True) stoploss_opt = DecimalParameter(-0.6, -0.1, default=-0.27, space='sell', optimize=True) stoploss = stoploss_opt.value pMinProfit = DecimalParameter(-0.3, 0.0, default=-0.288, space='sell', optimize=True) pCurrentProfit = DecimalParameter(-0.1, 0.2, default=0.092, space='sell', optimize=True) buy_rsi_fast_32 = IntParameter(20.0, 70.0, default=65, space='buy', optimize=True) buy_rsi_32 = IntParameter(15.0, 50.0, default=36, space='buy', optimize=True) buy_sma15_32 = DecimalParameter(0.9, 1.0, default=0.9, space='buy', optimize=True) buy_cti_32 = DecimalParameter(-1.0, 1.0, default=0.78, space='buy', optimize=True) sell_fastx = IntParameter(50.0, 100.0, default=89, space='sell', optimize=True) sell_loss_cci = IntParameter(0.0, 600.0, default=448, space='sell', optimize=True) sell_loss_cci_profit = DecimalParameter(-0.15, 0.0, default=-0.08, space='sell', optimize=True) buy_new_rsi_fast = IntParameter(20.0, 70.0, default=57, space='buy', optimize=True) buy_new_rsi = IntParameter(15.0, 50.0, default=15, space='buy', optimize=True) buy_new_sma15 = DecimalParameter(0.9, 1.0, default=0.965, space='buy', optimize=True) sell_cci = IntParameter(0.0, 600.0, default=156, space='sell', optimize=True) time_sell_4_3 = IntParameter(2.0, 6.0, default=6, space='sell', optimize=True) time_sell_10_7 = IntParameter(6.0, 12.0, default=6, space='sell', optimize=True) def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: # buy_1 indicators dataframe['sma_15'] = ta.SMA(dataframe, timeperiod=15) dataframe['cti'] = pta.cti(dataframe["close"], length=20) dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14) dataframe['rsi_fast'] = ta.RSI(dataframe, timeperiod=4) dataframe['rsi_slow'] = ta.RSI(dataframe, timeperiod=20) # profit sell indicators stoch_fast = ta.STOCHF(dataframe, 5, 3, 0, 3, 0) dataframe['fastk'] = stoch_fast['fastk'] dataframe['cci'] = ta.CCI(dataframe, timeperiod=20) dataframe['ma120'] = ta.MA(dataframe, timeperiod=120) dataframe['ma240'] = ta.MA(dataframe, timeperiod=240) return dataframe def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: conditions = [] dataframe.loc[:, 'enter_tag'] = '' buy_1 = ( (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift(1)) & (dataframe['rsi_fast'] < self.buy_rsi_fast_32.value) & (dataframe['rsi'] > self.buy_rsi_32.value) & (dataframe['close'] < dataframe['sma_15'] * self.buy_sma15_32.value) & (dataframe['cti'] < self.buy_cti_32.value) ) buy_new = ( (dataframe['rsi_slow'] < dataframe['rsi_slow'].shift(1)) & (dataframe['rsi_fast'] < self.buy_new_rsi_fast.value) & (dataframe['rsi'] > self.buy_new_rsi.value) & (dataframe['close'] < dataframe['sma_15'] * self.buy_new_sma15.value) & (dataframe['cti'] < self.buy_cti_32.value) ) conditions.append(buy_1) dataframe.loc[buy_1, 'enter_tag'] += 'buy_1' conditions.append(buy_new) dataframe.loc[buy_new, 'enter_tag'] += 'buy_new' if conditions: dataframe.loc[ reduce(lambda x, y: x | y, conditions), 'enter_long'] = 1 return dataframe def custom_exit(self, pair: str, trade: 'Trade', current_time: 'datetime', current_rate: float, current_profit: float, **kwargs): dataframe, _ = self.dp.get_analyzed_dataframe(pair=pair, timeframe=self.timeframe) current_candle = dataframe.iloc[-1].squeeze() min_profit = trade.calc_profit_ratio(trade.min_rate) current_profit_threshold = self.pCurrentProfit.value if current_profit > 0: if current_candle["fastk"] > self.sell_fastx.value: return "fastk_profit_sell" if min_profit <= self.pMinProfit.value: # 使用 pMinProfit 超参数 if current_profit > self.sell_loss_cci_profit.value: if current_candle["cci"] > self.sell_loss_cci.value: return "cci_loss_sell" if current_profit >= current_profit_threshold: # 使用 pCurrentProfit 超参数 if current_candle["cci"] > self.sell_cci.value: return "cci_loss_sell_fast" if current_time - timedelta(hours=self.time_sell_4_3.value) > trade.open_date_utc: if current_profit > -0.03: return "time_loss_sell_4_3" if current_time - timedelta(hours=self.time_sell_10_7.value) > trade.open_date_utc: if current_profit > -0.07: return "time_loss_sell_10_7" return None def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: dataframe.loc[:, ['exit_long', 'exit_tag']] = (0, 'long_out') return dataframe def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float: # hard stoploss profit HSL = self.pHSL.value PF_1 = self.pPF_1.value SL_1 = self.pSL_1.value PF_2 = self.pPF_2.value SL_2 = self.pSL_2.value # For profits between PF_1 and PF_2 the stoploss (sl_profit) used is linearly interpolated # between the values of SL_1 and SL_2. For all profits above PL_2 the sl_profit value # rises linearly with current profit, for profits below PF_1 the hard stoploss profit is used. if (current_profit > PF_2): sl_profit = SL_2 + (current_profit - PF_2) elif (current_profit > PF_1): sl_profit = SL_1 + ((current_profit - PF_1) * (SL_2 - SL_1) / (PF_2 - PF_1)) else: sl_profit = HSL # Only for hyperopt invalid return if (sl_profit >= current_profit): return -0.99 return stoploss_from_open(sl_profit, current_profit) |
Strategy League — fixed backtest that feeds the ranking
Export report Freqtrade logsRun finished · took 475.8s
ℹ️ This strategy uses a trailing stop / custom_stoploss() — freqtrade only
re-checks these once per 5m 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 →
- did not beat simply holding the market
- statistically significant edge (p=0.00)
- 100% of resampled runs stayed profitable
- profitable across 86% of rolling 3-month windows
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 |
|---|---|---|---|---|---|---|---|---|---|
| Dec 2025 | bearish trending low vol | 38 | -1.90 | -0.50 | 23 | 15 | 60.5 | -0.72 | 3h 08m |
| Nov 2025 | bearish trending high vol | 79 | +4.97 | 0.63 | 63 | 16 | 79.7 | -0.69 | 1h 47m |
| Oct 2025 | bearish trending low vol | 72 | +1.13 | 0.16 | 56 | 16 | 77.8 | -4.91 | 0h 50m |
| Sep 2025 | bullish choppy low vol | 13 | +0.90 | 0.69 | 12 | 1 | 92.3 | -0.14 | 2h 05m |
| Aug 2025 | bullish choppy low vol | 27 | +3.75 | 1.39 | 19 | 8 | 70.4 | -0.05 | 0h 14m |
| Jul 2025 | bullish choppy low vol | 15 | +1.35 | 0.90 | 13 | 2 | 86.7 | -0.09 | 0h 49m |
| Jun 2025 | bearish choppy low vol | 26 | -0.29 | -0.11 | 20 | 6 | 76.9 | -0.45 | 2h 17m |
| May 2025 | bullish trending low vol | 35 | +3.14 | 0.90 | 31 | 4 | 88.6 | -0.01 | 0h 43m |
| Apr 2025 | bullish choppy low vol | 31 | +2.32 | 0.75 | 29 | 2 | 93.5 | -0.57 | 1h 07m |
| Mar 2025 | bearish trending high vol | 69 | +2.79 | 0.40 | 58 | 11 | 84.1 | -1.52 | 2h 04m |
| Feb 2025 | bearish trending low vol | 110 | +0.53 | 0.05 | 88 | 22 | 80.0 | -2.93 | 1h 24m |
| Jan 2025 | bearish choppy low vol | 66 | +0.33 | 0.05 | 39 | 27 | 59.1 | -2.0 | 1h 33m |
| Dec 2024 | bullish trending low vol | 167 | +1.10 | 0.07 | 122 | 45 | 73.1 | -1.51 | 1h 52m |
| Nov 2024 | bullish trending low vol | 149 | +9.62 | 0.65 | 116 | 33 | 77.9 | -0.83 | 1h 08m |
| Oct 2024 | bullish choppy low vol | 41 | +5.86 | 1.43 | 38 | 3 | 92.7 | -1.14 | 0h 35m |
| Sep 2024 | bearish choppy low vol | 9 | +1.07 | 1.19 | 5 | 4 | 55.6 | -1.44 | 0h 07m |
| Aug 2024 | bearish choppy high vol | 48 | -3.56 | -0.74 | 33 | 15 | 68.8 | -2.17 | 2h 50m |
| Jul 2024 | bearish trending low vol | 40 | +1.26 | 0.31 | 23 | 17 | 57.5 | -0.92 | 0h 54m |
| Jun 2024 | bearish choppy low vol | 36 | +6.22 | 1.73 | 35 | 1 | 97.2 | -2.3 | 0h 39m |
| May 2024 | bullish choppy high vol | 2 | -0.18 | -0.88 | 1 | 1 | 50.0 | -2.43 | 3h 15m |
| Apr 2024 | bearish choppy high vol | 85 | -7.52 | -0.88 | 61 | 24 | 71.8 | -3.23 | 2h 07m |
| Mar 2024 | bullish trending high vol | 99 | +6.78 | 0.68 | 79 | 20 | 79.8 | -0.58 | 1h 08m |
| Feb 2024 | bullish trending low vol | 36 | +4.94 | 1.37 | 34 | 2 | 94.4 | -0.09 | 1h 06m |
| Jan 2024 | bearish choppy high vol | 56 | +3.07 | 0.55 | 41 | 15 | 73.2 | -0.63 | 1h 29m |
| Dec 2023 | bullish trending low vol | 64 | +10.86 | 1.70 | 56 | 8 | 87.5 | -0.33 | 0h 56m |
| Nov 2023 | bullish trending low vol | 66 | +5.48 | 0.83 | 61 | 5 | 92.4 | -0.19 | 1h 12m |
| Oct 2023 | bullish trending low vol | 14 | +1.82 | 1.30 | 11 | 3 | 78.6 | -0.02 | 0h 15m |
| Sep 2023 | bearish choppy low vol | 2 | +0.21 | 1.07 | 2 | 0 | 100.0 | 0.0 | 0h 20m |
| Aug 2023 | bearish choppy low vol | 32 | +3.27 | 1.02 | 30 | 2 | 93.8 | -0.56 | 1h 09m |
| Jul 2023 | bullish trending low vol | 28 | +1.69 | 0.60 | 21 | 7 | 75.0 | -0.23 | 2h 00m |
| Jun 2023 | bullish trending low vol | 67 | +5.39 | 0.80 | 58 | 9 | 86.6 | -0.09 | 1h 27m |
| May 2023 | bearish choppy low vol | 30 | +2.36 | 0.79 | 28 | 2 | 93.3 | -0.12 | 0h 57m |
| Apr 2023 | bullish trending low vol | 26 | +0.02 | 0.01 | 23 | 3 | 88.5 | -0.2 | 1h 49m |
| Mar 2023 | bullish trending high vol | 68 | +1.60 | 0.23 | 54 | 14 | 79.4 | -0.47 | 1h 44m |
| Feb 2023 | bullish trending low vol | 54 | +6.20 | 1.15 | 49 | 5 | 90.7 | -1.81 | 1h 07m |
| Jan 2023 | bullish trending low vol | 82 | +7.59 | 0.92 | 70 | 12 | 85.4 | -3.99 | 1h 17m |
| Dec 2022 | bearish trending low vol | 14 | +0.83 | 0.59 | 12 | 2 | 85.7 | -4.22 | 2h 08m |
| Nov 2022 | bearish trending high vol | 167 | -6.66 | -0.40 | 126 | 41 | 75.4 | -6.06 | 2h 12m |
| Oct 2022 | bullish choppy low vol | 18 | +1.01 | 0.56 | 14 | 4 | 77.8 | -2.72 | 1h 44m |
| Sep 2022 | bearish choppy high vol | 42 | -6.15 | -1.46 | 21 | 21 | 50.0 | -2.79 | 4h 02m |
| Aug 2022 | bullish choppy high vol | 60 | -2.69 | -0.45 | 40 | 20 | 66.7 | -0.81 | 2h 44m |
| Jul 2022 | bearish trending high vol | 55 | +4.43 | 0.81 | 50 | 5 | 90.9 | -0.07 | 1h 18m |
| Jun 2022 | bearish trending high vol | 169 | +8.73 | 0.52 | 134 | 35 | 79.3 | -2.37 | 2h 03m |
| May 2022 | bearish trending high vol | 224 | +2.33 | 0.10 | 177 | 47 | 79.0 | -5.38 | 1h 43m |
| Apr 2022 | bearish choppy high vol | 31 | +3.06 | 0.99 | 28 | 3 | 90.3 | -1.32 | 1h 17m |
| Mar 2022 | bullish choppy high vol | 25 | +4.18 | 1.67 | 22 | 3 | 88.0 | -2.55 | 0h 35m |
| Feb 2022 | bearish trending high vol | 53 | -0.77 | -0.15 | 38 | 15 | 71.7 | -2.64 | 2h 30m |
| Jan 2022 | bearish trending high vol | 103 | -0.55 | -0.05 | 79 | 24 | 76.7 | -2.69 | 2h 16m |
| Dec 2021 | bearish trending high vol | 61 | -5.49 | -0.90 | 46 | 15 | 75.4 | -3.75 | 1h 14m |
| Nov 2021 | bullish trending high vol | 57 | +7.01 | 1.23 | 49 | 8 | 86.0 | -0.89 | 1h 24m |
| Oct 2021 | bullish trending high vol | 35 | +1.04 | 0.30 | 27 | 8 | 77.1 | -1.26 | 3h 15m |
| Sep 2021 | bearish trending high vol | 246 | +17.14 | 0.70 | 196 | 50 | 79.7 | -8.95 | 1h 20m |
| Aug 2021 | bullish trending high vol | 107 | +12.93 | 1.21 | 97 | 10 | 90.7 | -8.4 | 0h 34m |
| Jul 2021 | bearish trending high vol | 54 | -2.08 | -0.38 | 43 | 11 | 79.6 | -8.66 | 2h 39m |
| Jun 2021 | bearish trending high vol | 177 | +1.95 | 0.11 | 147 | 30 | 83.1 | -8.67 | 1h 43m |
| May 2021 | bearish trending high vol | 677 | +8.82 | 0.13 | 543 | 134 | 80.2 | -16.22 | 1h 27m |
| Apr 2021 | bearish choppy high vol | 383 | +31.37 | 0.82 | 329 | 54 | 85.9 | -3.8 | 1h 03m |
| Mar 2021 | bullish choppy high vol | 161 | +16.86 | 1.05 | 142 | 19 | 88.2 | -0.3 | 1h 26m |
| Feb 2021 | bullish trending high vol | 568 | +70.11 | 1.23 | 493 | 75 | 86.8 | -4.59 | 0h 51m |
| Jan 2021 | bullish trending high vol | 573 | +63.05 | 1.10 | 479 | 94 | 83.6 | -3.86 | 1h 05m |
Yearly breakdown
| Year | Trades | Profit % | Avg % | Win | Loss | Win % | DD % | Avg dur |
|---|---|---|---|---|---|---|---|---|
| 2025 | 581 | +19.02 | 0.33 | 451 | 130 | 77.6 | -4.91 | 1h 31m |
| 2024 | 768 | +28.66 | 0.37 | 588 | 180 | 76.6 | -3.23 | 1h 28m |
| 2023 | 533 | +46.49 | 0.87 | 463 | 70 | 86.9 | -3.99 | 1h 18m |
| 2022 | 961 | +7.75 | 0.08 | 741 | 220 | 77.1 | -6.06 | 2h 04m |
| 2021 | 3099 | +222.71 | 0.72 | 2591 | 508 | 83.6 | -16.22 | 1h 14m |
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 | |
|---|---|---|---|
| 97 | review | enter_tag_overwrite | enter_tag/exit_tag is written by 2 separate assignments -- they share one column and run in source order, so a row matching more than one condition keeps only the LAST tag. Per-tag statistics won't mean what they appear to |
ran by Ron · took s
Lookahead analysis
freqtrade lookahead-analysis: detects strategies peeking at future candles.