4 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 | 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 from functools import reduce import warnings warnings.simplefilter(action="ignore", category=RuntimeWarning) TMP_HOLD = [] TMP_HOLD1 = [] class Trader_4_1726727454_3078(IStrategy): minimal_roi = { "0": 1 } timeframe = '5m' process_only_new_candles = True startup_candle_count = 240 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 } stoploss = -0.25 trailing_stop = True trailing_stop_positive = 0.003 trailing_stop_positive_offset = 0.03 trailing_only_offset_is_reached = True buy_rsi_fast_32 = IntParameter(20, 70, default=66, space='buy', optimize=True) buy_rsi_32 = IntParameter(15, 50, default=17, space='buy', optimize=True) buy_sma15_32 = DecimalParameter(0.900, 1, default=0.935, decimals=3, space='buy', optimize=True) buy_cti_32 = DecimalParameter(-1, 1, default=0.51, decimals=2, space='buy', optimize=True) sell_fastx = IntParameter(50, 100, default=60, space='sell', optimize=True) sell_loss_cci = IntParameter(low=0, high=600, default=3, space='sell', optimize=True) sell_loss_cci_profit = DecimalParameter(-0.15, 0, default=-0.01, decimals=2, space='sell', optimize=True) def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: 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) 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) ) conditions.append(buy_1) dataframe.loc[buy_1, 'enter_tag'] += 'buy_1' if conditions: dataframe.loc[ reduce(lambda x, y: x | y, conditions), 'enter_long'] = 1 return dataframe def custom_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) if current_candle['close'] > current_candle["ma120"] or current_candle['close'] > current_candle["ma240"]: if trade.id not in TMP_HOLD: TMP_HOLD.append(trade.id) else: if trade.id not in TMP_HOLD1: TMP_HOLD1.append(trade.id) if current_profit > 0: if current_candle["fastk"] > self.sell_fastx.value: return "fastk_profit_sell" if min_profit > -0.06: if current_profit > -0.02: if current_candle["cci"] > self.sell_loss_cci.value: return "cci_loss_sell_2" if -0.06 > min_profit > -0.1: if current_profit > -0.05: if current_candle["cci"] > self.sell_loss_cci.value: return "cci_loss_sell_5" if min_profit <= -0.1: if current_profit > self.sell_loss_cci_profit.value: if current_candle["cci"] > self.sell_loss_cci.value: return "cci_loss_sell_10" if trade.id in TMP_HOLD and current_candle["close"] < current_candle["ma120"] and current_candle["close"] < current_candle["ma240"]: if current_time - timedelta(minutes=5) < trade.open_date_utc: try: TMP_HOLD.remove(trade.id) except: pass if trade.id in TMP_HOLD1: pass else: TMP_HOLD1.append(trade.id) else: return "ma120_sell" if trade.id in TMP_HOLD1: if current_candle["high"] > current_candle["ma120"] or current_candle["high"] > current_candle["ma240"]: if current_time - timedelta(minutes=5) > trade.open_date_utc: TMP_HOLD1.remove(trade.id) return "cross_120_or_240_sell" return None def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: dataframe.loc[:, ['exit_long', 'exit_tag']] = (0, 'long_out') return dataframe |
Strategy League — fixed backtest that feeds the ranking
Export report Freqtrade logsRun finished · took 403.7s
ℹ️ This strategy uses a trailing stop — 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 97% 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 |
|---|---|---|---|---|---|---|---|---|---|
| Nov 2025 | bearish trending high vol | 8 | +0.70 | 0.88 | 7 | 1 | 87.5 | -0.35 | 1h 46m |
| Oct 2025 | bearish trending low vol | 43 | +0.90 | 0.21 | 39 | 4 | 90.7 | -2.56 | 0h 04m |
| Apr 2025 | bullish choppy low vol | 1 | +0.04 | 0.35 | 1 | 0 | 100.0 | -0.02 | 0h 05m |
| Feb 2025 | bearish trending low vol | 19 | +2.02 | 1.06 | 15 | 4 | 78.9 | -0.04 | 0h 49m |
| Jan 2025 | bearish choppy low vol | 1 | +0.29 | 2.87 | 1 | 0 | 100.0 | 0.0 | 0h 10m |
| Dec 2024 | bullish trending low vol | 12 | +2.41 | 2.00 | 11 | 1 | 91.7 | -0.02 | 0h 22m |
| Nov 2024 | bullish trending low vol | 5 | +1.01 | 2.01 | 5 | 0 | 100.0 | 0.0 | 0h 23m |
| Aug 2024 | bearish choppy high vol | 18 | +4.69 | 2.61 | 18 | 0 | 100.0 | 0.0 | 0h 06m |
| Jul 2024 | bearish trending low vol | 4 | +0.72 | 1.79 | 4 | 0 | 100.0 | 0.0 | 0h 15m |
| Jun 2024 | bearish choppy low vol | 21 | +5.26 | 2.51 | 21 | 0 | 100.0 | -0.42 | 0h 02m |
| Apr 2024 | bearish choppy high vol | 23 | +1.68 | 0.73 | 19 | 4 | 82.6 | -0.5 | 0h 40m |
| Mar 2024 | bullish trending high vol | 15 | +2.68 | 1.78 | 15 | 0 | 100.0 | 0.0 | 0h 15m |
| Feb 2024 | bullish trending low vol | 5 | +1.37 | 2.74 | 5 | 0 | 100.0 | 0.0 | 0h 14m |
| Jan 2024 | bearish choppy high vol | 3 | +0.11 | 0.35 | 3 | 0 | 100.0 | 0.0 | 0h 13m |
| Dec 2023 | bullish trending low vol | 3 | +0.67 | 2.23 | 3 | 0 | 100.0 | 0.0 | 0h 15m |
| Nov 2023 | bullish trending low vol | 10 | +1.78 | 1.78 | 10 | 0 | 100.0 | 0.0 | 0h 22m |
| Aug 2023 | bearish choppy low vol | 9 | +1.02 | 1.13 | 9 | 0 | 100.0 | 0.0 | 0h 24m |
| Jul 2023 | bullish trending low vol | 2 | +0.13 | 0.63 | 2 | 0 | 100.0 | 0.0 | 0h 28m |
| Jun 2023 | bullish trending low vol | 21 | +2.36 | 1.12 | 19 | 2 | 90.5 | -0.1 | 0h 18m |
| Jan 2023 | bullish trending low vol | 10 | +1.44 | 1.44 | 10 | 0 | 100.0 | 0.0 | 0h 28m |
| Dec 2022 | bearish trending low vol | 1 | +0.12 | 1.17 | 1 | 0 | 100.0 | 0.0 | 0h 20m |
| Nov 2022 | bearish trending high vol | 56 | +6.51 | 1.16 | 47 | 9 | 83.9 | -1.92 | 1h 16m |
| Oct 2022 | bullish choppy low vol | 2 | +0.50 | 2.50 | 2 | 0 | 100.0 | 0.0 | 0h 20m |
| Sep 2022 | bearish choppy high vol | 2 | +0.10 | 0.51 | 1 | 1 | 50.0 | -0.03 | 1h 00m |
| Jul 2022 | bearish trending high vol | 1 | +0.00 | 0.04 | 1 | 0 | 100.0 | -0.06 | 0h 20m |
| Jun 2022 | bearish trending high vol | 7 | +1.13 | 1.61 | 6 | 1 | 85.7 | -0.18 | 0h 41m |
| May 2022 | bearish trending high vol | 46 | +6.57 | 1.43 | 44 | 2 | 95.7 | -1.99 | 0h 13m |
| Apr 2022 | bearish choppy high vol | 3 | -0.41 | -1.36 | 2 | 1 | 66.7 | -0.2 | 1h 33m |
| Feb 2022 | bearish trending high vol | 3 | +0.87 | 2.91 | 3 | 0 | 100.0 | 0.0 | 0h 12m |
| Jan 2022 | bearish trending high vol | 16 | +4.88 | 3.05 | 16 | 0 | 100.0 | -1.45 | 0h 10m |
| Dec 2021 | bearish trending high vol | 32 | -2.52 | -0.79 | 26 | 6 | 81.2 | -4.0 | 0h 22m |
| Nov 2021 | bullish trending high vol | 4 | +1.23 | 3.09 | 4 | 0 | 100.0 | -0.14 | 0h 01m |
| Oct 2021 | bullish trending high vol | 3 | -0.37 | -1.24 | 2 | 1 | 66.7 | -0.34 | 1h 13m |
| Sep 2021 | bearish trending high vol | 38 | +6.03 | 1.59 | 32 | 6 | 84.2 | -0.36 | 0h 33m |
| Aug 2021 | bullish trending high vol | 1 | +0.23 | 2.30 | 1 | 0 | 100.0 | 0.0 | 0h 20m |
| Jun 2021 | bearish trending high vol | 11 | +2.67 | 2.43 | 11 | 0 | 100.0 | 0.0 | 0h 16m |
| May 2021 | bearish trending high vol | 266 | +51.14 | 1.92 | 241 | 25 | 90.6 | -6.57 | 0h 22m |
| Apr 2021 | bearish choppy high vol | 91 | +25.03 | 2.75 | 86 | 5 | 94.5 | -1.36 | 0h 14m |
| Mar 2021 | bullish choppy high vol | 9 | +1.83 | 2.03 | 9 | 0 | 100.0 | 0.0 | 0h 13m |
| Feb 2021 | bullish trending high vol | 137 | +31.60 | 2.31 | 130 | 7 | 94.9 | -1.92 | 0h 17m |
| Jan 2021 | bullish trending high vol | 137 | +29.85 | 2.18 | 127 | 10 | 92.7 | -3.85 | 0h 13m |
Yearly breakdown
| Year | Trades | Profit % | Avg % | Win | Loss | Win % | DD % | Avg dur |
|---|---|---|---|---|---|---|---|---|
| 2025 | 72 | +3.95 | 0.55 | 63 | 9 | 87.5 | -2.56 | 0h 27m |
| 2024 | 106 | +19.93 | 1.88 | 101 | 5 | 95.3 | -0.5 | 0h 17m |
| 2023 | 55 | +7.40 | 1.34 | 53 | 2 | 96.4 | -0.1 | 0h 22m |
| 2022 | 137 | +20.27 | 1.48 | 123 | 14 | 89.8 | -1.99 | 0h 42m |
| 2021 | 729 | +146.72 | 2.01 | 669 | 60 | 91.8 | -6.57 | 0h 19m |
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 | |
|---|---|---|---|
| 72 | 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.