Basics
mode: spot
timeframe: 15m
interface version: 3
Settings
stoploss: -0.06
has minimal roi
protections
process only new candles
startup candle count: 450
Indicators
Bollinger_Bands
EMA
RSI
talib
Concepts
mean_reversion
risk_management
Methods
protections
2 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 | """Regime-filtered Bollinger mean-reversion template — pure TA, no FreqAI. Hypothesis: in a confirmed uptrend (price above a long EMA), short, sharp dips that stretch BELOW the lower Bollinger Band and print an oversold RSI tend to revert toward the band's mean. Restricting entries to the uptrend regime is the load-bearing idea: it keeps the strategy OUT of falling markets (where buying dips is catching knives) and only buys pullbacks inside an upward drift. Exit is fast — a small fixed take-profit OR reversion to the band mean — so capital is recycled quickly and losers are cut by a hard stop. This archetype was selected because, on the project's own anchored 6-fold walk-forward over the cached BTC/ETH/SOL/BNB data, it is the only long-only shape that produced a positive, consistent risk-adjusted return through a bearish OOS window (it sits out the downtrends via the EMA regime filter). See the strategy README for the proxy-backtest evidence; the authoritative numbers come from running this through POST /strategies/validate. Template contract (BRD §8): - The structural shell (class name, populate_* methods, timeframe, stoploss, process_only_new_candles, protections) is hand-written and NOT LLM-editable. - Slots are marked ``# SLOT: <name> (type, range)`` and are the ONLY values the generator may substitute. Default literals let the template backtest as-is. - Slot names + ranges match ``bb_regime_reversion_template_schema.py`` exactly. BRD §1 v1 is spot-only, long-only — no short side, no margin, no leverage. """ # ruff: noqa: F401 (freqtrade/talib imports resolved only inside the container) # pyright: reportMissingImports=false from __future__ import annotations from typing import TYPE_CHECKING import talib.abstract as ta # type: ignore[import-not-found] from freqtrade.strategy import IStrategy # type: ignore[import-not-found] from freqtrade.vendor.qtpylib import indicators as qtpylib # type: ignore[import-not-found] if TYPE_CHECKING: from pandas import DataFrame class BbRegimeReversionTemplate(IStrategy): """Regime-filtered Bollinger + RSI mean-reversion. Entry (long-only spot): close <= lower Bollinger Band AND RSI < buy threshold AND close > trend EMA (uptrend regime). Exit: close >= middle Bollinger Band, OR a fixed take-profit (``minimal_roi``), OR the hard stoploss. """ # ─── Structural shell — DO NOT add to the slot list ──────────────────── INTERFACE_VERSION = 3 timeframe = "15m" process_only_new_candles = True can_short = False # BRD §1: spot-only, long-only use_exit_signal = True exit_profit_only = False ignore_roi_if_entry_signal = False startup_candle_count = 450 # >= ema_trend_period(<=400) + bb_period worst-case # ─── SLOT BLOCK ──────────────────────────────────────────────────────── # Generator replaces the RHS literal on each line below. Slot name in the # comment must match a field in BbRegimeReversionParams (schema). # Bollinger Bands window length (in candles of `timeframe`). bb_period: int = 20 # SLOT: bb_period (int, 10-50) # Standard deviations for the BB envelope. Wider → deeper, rarer dips. bb_std: float = 2.3 # SLOT: bb_std (float, 1.5-3.0) # RSI lookback. rsi_period: int = 14 # SLOT: rsi_period (int, 7-30) # RSI must be BELOW this on entry. Lower = stricter oversold (fewer, higher-quality). rsi_buy_threshold: int = 35 # SLOT: rsi_buy_threshold (int, 10-45) # Trend regime filter: only buy dips when close is ABOVE this EMA. ema_trend_period: int = 200 # SLOT: ema_trend_period (int, 50-400) # Fixed take-profit fraction (e.g. 0.025 = +2.5%). Wired into minimal_roi below. roi_target: float = 0.025 # SLOT: roi_target (float, 0.005-0.05) # Hard stoploss (negative fraction). E.g. -0.06 = exit at -6% from entry. stoploss: float = -0.06 # SLOT: stoploss (float, -0.10 to -0.02) # `minimal_roi` is built from the roi_target slot: a single flat take-profit at # +roi_target from entry (minute 0). Reverts-to-mean exits are handled by the # exit signal below; the hard stoploss caps losers. Referencing the slot here # keeps the take-profit in sync with whatever value the generator renders. minimal_roi = {"0": roi_target} # ─── In-container risk protection — structural shell, NOT a slot ─────── @property def protections(self) -> list[dict]: return [ { "method": "MaxDrawdown", "lookback_period_candles": 288, "trade_limit": 4, "stop_duration_candles": 12, "max_allowed_drawdown": 0.12, }, ] # ─── Indicators ──────────────────────────────────────────────────────── def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """Compute BB envelope, RSI, and the trend EMA the logic reads.""" bb = qtpylib.bollinger_bands( qtpylib.typical_price(dataframe), window=self.bb_period, stds=self.bb_std, ) dataframe["bb_lowerband"] = bb["lower"] dataframe["bb_middleband"] = bb["mid"] dataframe["bb_upperband"] = bb["upper"] dataframe["rsi"] = ta.RSI(dataframe, timeperiod=self.rsi_period) dataframe["ema_trend"] = ta.EMA(dataframe, timeperiod=self.ema_trend_period) return dataframe # ─── Entries ─────────────────────────────────────────────────────────── def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """Long entry: oversold dip below lower BB, but only in an uptrend regime.""" dataframe.loc[ ( (dataframe["close"] <= dataframe["bb_lowerband"]) & (dataframe["rsi"] < self.rsi_buy_threshold) & (dataframe["close"] > dataframe["ema_trend"]) & (dataframe["volume"] > 0) # exchange downtime guard ), "enter_long", ] = 1 return dataframe # ─── Exits ───────────────────────────────────────────────────────────── def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """Long exit: price reverted up to the middle band.""" dataframe.loc[ (dataframe["close"] >= dataframe["bb_middleband"]), "exit_long", ] = 1 return dataframe |
Strategy League — fixed backtest that feeds the ranking
Export report Freqtrade logsRun finished · took 161.7s
pairs 33 pairs
timerange 20210101-20260101
mode spot
timeframe 15m
stake 100 USDT
wallet 1000 USDT
max open trades 10
fee exchange lowest tier
total profit+11.82%
final wallet1118 USDT
win rate61.0%
max drawdown-29.62%
market change+457.08%
vs market-445.26%
timeframe15m
profit factor1.03
expectancy ratio0.01
break-even fee0.1083%
sharpe0.663
sortino0.664
CAGR+2.3%
calmar0.417
avg MFE+1.32%
avg MAE-1.62%
avg profit/trade0.02%
avg duration3h 36m
best trade+2.57%
worst trade-6.19%
win/loss streak30 / 14
positive months27/60
consistent (3-mo)39.7%
worst 3-mo-18.67%
trades7088
revision1
likely annual return+2%
range (5th–95th)-2% … +6%
chance of profit82.1%
worst-5% outcome-3%
significance (p)0.2309
risk of ruin0.0%
- profit isn't statistically significant (p=0.23) — hard to tell apart from luck
- profitable in only 40% of rolling 3-month windows
- did not beat simply holding the market
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 | 121 | -1.75 | -0.14 | 58 | 63 | 47.9 | -29.62 | 4h 11m |
| Nov 2025 | bearish trending high vol | 98 | +0.02 | 0.00 | 53 | 45 | 54.1 | -29.38 | 3h 38m |
| Oct 2025 | bearish trending low vol | 154 | -4.81 | -0.31 | 83 | 71 | 53.9 | -28.55 | 3h 45m |
| Sep 2025 | bullish choppy low vol | 109 | -1.17 | -0.11 | 52 | 57 | 47.7 | -25.71 | 3h 57m |
| Aug 2025 | bullish choppy low vol | 106 | -6.75 | -0.64 | 43 | 63 | 40.6 | -24.98 | 4h 51m |
| Jul 2025 | bullish choppy low vol | 150 | -4.88 | -0.32 | 80 | 70 | 53.3 | -20.52 | 4h 18m |
| Jun 2025 | bearish choppy low vol | 112 | -0.83 | -0.07 | 66 | 46 | 58.9 | -17.68 | 4h 09m |
| May 2025 | bullish trending low vol | 88 | -1.52 | -0.17 | 43 | 45 | 48.9 | -16.94 | 3h 48m |
| Apr 2025 | bullish choppy low vol | 149 | +2.66 | 0.18 | 89 | 60 | 59.7 | -17.74 | 3h 52m |
| Mar 2025 | bearish trending high vol | 144 | -1.41 | -0.10 | 86 | 58 | 59.7 | -18.11 | 3h 46m |
| Feb 2025 | bearish trending low vol | 77 | -5.75 | -0.75 | 35 | 42 | 45.5 | -16.77 | 4h 44m |
| Jan 2025 | bearish choppy low vol | 150 | -2.14 | -0.14 | 100 | 50 | 66.7 | -13.49 | 3h 32m |
| Dec 2024 | bullish trending low vol | 130 | +7.11 | 0.55 | 97 | 33 | 74.6 | -16.36 | 3h 08m |
| Nov 2024 | bullish trending low vol | 160 | +3.02 | 0.19 | 116 | 44 | 72.5 | -18.1 | 2h 50m |
| Oct 2024 | bullish choppy low vol | 147 | +0.47 | 0.03 | 92 | 55 | 62.6 | -18.86 | 3h 38m |
| Sep 2024 | bearish choppy low vol | 156 | +0.06 | 0.00 | 90 | 66 | 57.7 | -19.36 | 3h 58m |
| Aug 2024 | bearish choppy high vol | 127 | -2.79 | -0.22 | 71 | 56 | 55.9 | -18.97 | 4h 03m |
| Jul 2024 | bearish trending low vol | 132 | -0.75 | -0.06 | 75 | 57 | 56.8 | -16.8 | 3h 53m |
| Jun 2024 | bearish choppy low vol | 66 | -1.81 | -0.27 | 31 | 35 | 47.0 | -16.48 | 3h 56m |
| May 2024 | bullish choppy high vol | 106 | -0.60 | -0.06 | 60 | 46 | 56.6 | -15.76 | 3h 43m |
| Apr 2024 | bearish choppy high vol | 106 | -7.20 | -0.68 | 56 | 50 | 52.8 | -15.01 | 3h 41m |
| Mar 2024 | bullish trending high vol | 136 | -1.07 | -0.08 | 83 | 53 | 61.0 | -12.29 | 3h 12m |
| Feb 2024 | bullish trending low vol | 142 | +1.62 | 0.11 | 91 | 51 | 64.1 | -11.4 | 3h 44m |
| Jan 2024 | bearish choppy high vol | 119 | +0.95 | 0.08 | 67 | 52 | 56.3 | -12.41 | 3h 44m |
| Dec 2023 | bullish trending low vol | 155 | +3.45 | 0.22 | 96 | 59 | 61.9 | -13.32 | 3h 19m |
| Nov 2023 | bullish trending low vol | 161 | +5.24 | 0.33 | 113 | 48 | 70.2 | -16.68 | 3h 17m |
| Oct 2023 | bullish trending low vol | 124 | +0.18 | 0.01 | 78 | 46 | 62.9 | -18.64 | 3h 53m |
| Sep 2023 | bearish choppy low vol | 83 | +0.74 | 0.09 | 48 | 35 | 57.8 | -17.25 | 3h 29m |
| Aug 2023 | bearish choppy low vol | 73 | -3.11 | -0.43 | 27 | 46 | 37.0 | -17.22 | 4h 40m |
| Jul 2023 | bullish trending low vol | 97 | -2.14 | -0.22 | 54 | 43 | 55.7 | -16.38 | 3h 50m |
| Jun 2023 | bullish trending low vol | 139 | +2.80 | 0.20 | 89 | 50 | 64.0 | -16.08 | 3h 26m |
| May 2023 | bearish choppy low vol | 102 | -2.30 | -0.23 | 59 | 43 | 57.8 | -16.04 | 3h 52m |
| Apr 2023 | bullish trending low vol | 125 | -6.69 | -0.54 | 66 | 59 | 52.8 | -14.27 | 3h 41m |
| Mar 2023 | bullish trending high vol | 103 | -0.28 | -0.03 | 58 | 45 | 56.3 | -10.95 | 3h 27m |
| Feb 2023 | bullish trending low vol | 96 | -0.64 | -0.07 | 60 | 36 | 62.5 | -10.26 | 3h 32m |
| Jan 2023 | bullish trending low vol | 209 | +10.19 | 0.49 | 152 | 57 | 72.7 | -15.87 | 3h 29m |
| Dec 2022 | bearish trending low vol | 69 | -2.01 | -0.29 | 33 | 36 | 47.8 | -15.93 | 4h 47m |
| Nov 2022 | bearish trending high vol | 108 | +1.14 | 0.11 | 76 | 32 | 70.4 | -15.41 | 3h 36m |
| Oct 2022 | bullish choppy low vol | 84 | +0.44 | 0.05 | 52 | 32 | 61.9 | -16.59 | 4h 00m |
| Sep 2022 | bearish choppy high vol | 92 | -1.99 | -0.22 | 57 | 35 | 62.0 | -15.64 | 3h 35m |
| Aug 2022 | bullish choppy high vol | 116 | -0.33 | -0.03 | 65 | 51 | 56.0 | -14.42 | 3h 58m |
| Jul 2022 | bearish trending high vol | 145 | -0.66 | -0.05 | 78 | 67 | 53.8 | -16.03 | 4h 02m |
| Jun 2022 | bearish trending high vol | 69 | -7.58 | -1.10 | 24 | 45 | 34.8 | -13.7 | 4h 21m |
| May 2022 | bearish trending high vol | 86 | -2.46 | -0.29 | 55 | 31 | 64.0 | -11.12 | 3h 01m |
| Apr 2022 | bearish choppy high vol | 71 | -8.63 | -1.22 | 25 | 46 | 35.2 | -7.38 | 5h 15m |
| Mar 2022 | bullish choppy high vol | 145 | +1.31 | 0.09 | 97 | 48 | 66.9 | -2.64 | 3h 08m |
| Feb 2022 | bearish trending high vol | 108 | +1.04 | 0.10 | 69 | 39 | 63.9 | -3.43 | 3h 25m |
| Jan 2022 | bearish trending high vol | 89 | +2.29 | 0.26 | 56 | 33 | 62.9 | -4.85 | 3h 46m |
| Dec 2021 | bearish trending high vol | 110 | -2.52 | -0.23 | 68 | 42 | 61.8 | -4.87 | 3h 35m |
| Nov 2021 | bullish trending high vol | 102 | -3.47 | -0.34 | 64 | 38 | 62.7 | -4.05 | 3h 41m |
| Oct 2021 | bullish trending high vol | 126 | +3.20 | 0.25 | 76 | 50 | 60.3 | -1.01 | 3h 40m |
| Sep 2021 | bearish trending high vol | 102 | +5.15 | 0.51 | 76 | 26 | 74.5 | -1.78 | 2h 48m |
| Aug 2021 | bullish trending high vol | 194 | +14.94 | 0.77 | 146 | 48 | 75.3 | -3.73 | 3h 00m |
| Jul 2021 | bearish trending high vol | 115 | -3.83 | -0.33 | 70 | 45 | 60.9 | -4.8 | 3h 52m |
| Jun 2021 | bearish trending high vol | 84 | +4.87 | 0.58 | 67 | 17 | 79.8 | -2.11 | 2h 54m |
| May 2021 | bearish trending high vol | 114 | +5.18 | 0.46 | 81 | 33 | 71.1 | -3.91 | 2h 36m |
| Apr 2021 | bearish choppy high vol | 133 | -1.45 | -0.11 | 87 | 46 | 65.4 | -4.16 | 2h 43m |
| Mar 2021 | bullish choppy high vol | 126 | +8.08 | 0.64 | 94 | 32 | 74.6 | -1.73 | 3h 07m |
| Feb 2021 | bullish trending high vol | 104 | +8.70 | 0.84 | 84 | 20 | 80.8 | -2.62 | 1h 49m |
| Jan 2021 | bullish trending high vol | 144 | +12.28 | 0.85 | 110 | 34 | 76.4 | -2.96 | 2h 08m |
Yearly breakdown
| Year | Trades | Profit % | Avg % | Win | Loss | Win % | DD % | Avg dur |
|---|---|---|---|---|---|---|---|---|
| 2025 | 1458 | -28.33 | -0.19 | 788 | 670 | 54.0 | -29.62 | 4h 00m |
| 2024 | 1527 | -0.99 | -0.01 | 929 | 598 | 60.8 | -19.36 | 3h 36m |
| 2023 | 1467 | +7.44 | 0.05 | 900 | 567 | 61.3 | -18.64 | 3h 36m |
| 2022 | 1182 | -17.44 | -0.15 | 687 | 495 | 58.1 | -16.59 | 3h 49m |
| 2021 | 1454 | +51.13 | 0.35 | 1023 | 431 | 70.4 | -4.87 | 2h 59m |
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-bias patterns detected
ran by Ron · took s
Lookahead analysis
freqtrade lookahead-analysis: detects strategies peeking at future candles.