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 | import logging import talib.abstract as ta from pandas import DataFrame from freqtrade.strategy import DecimalParameter, IStrategy logger = logging.getLogger(__name__) class MandelbrotFibonacciStrategy(IStrategy): """ Mandelbrot + Fibonacci Strategy Uses Bill Williams-style fractals to define swing ranges and Fibonacci retracements to identify pullback zones in trend. """ INTERFACE_VERSION = 3 # Optimizable parameters fib_low = DecimalParameter(0.35, 0.45, default=0.382, space="buy", optimize=True) fib_high = DecimalParameter(0.55, 0.7, default=0.618, space="buy", optimize=True) volume_factor = DecimalParameter(0.8, 2.0, default=1.0, space="buy", optimize=True) # Fixed parameters timeframe = "1h" stoploss = -0.08 trailing_stop = True trailing_stop_positive = 0.015 trailing_stop_positive_offset = 0.03 trailing_only_offset_is_reached = True use_exit_signal = True exit_profit_only = False ignore_roi_if_entry_signal = False startup_candle_count = 210 can_short = False minimal_roi = { "0": 0.06, "360": 0.03, "720": 0.01 } def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: dataframe["ema_fast"] = ta.EMA(dataframe, timeperiod=50) dataframe["ema_slow"] = ta.EMA(dataframe, timeperiod=200) dataframe["volume_sma"] = dataframe["volume"].rolling(window=20).mean() fractal_high = ( (dataframe["high"] > dataframe["high"].shift(1)) & (dataframe["high"] > dataframe["high"].shift(2)) & (dataframe["high"] >= dataframe["high"].shift(-1)) & (dataframe["high"] >= dataframe["high"].shift(-2)) ) fractal_low = ( (dataframe["low"] < dataframe["low"].shift(1)) & (dataframe["low"] < dataframe["low"].shift(2)) & (dataframe["low"] <= dataframe["low"].shift(-1)) & (dataframe["low"] <= dataframe["low"].shift(-2)) ) dataframe["fractal_high"] = dataframe["high"].where(fractal_high).shift(2) dataframe["fractal_low"] = dataframe["low"].where(fractal_low).shift(2) dataframe["swing_high"] = dataframe["fractal_high"].ffill() dataframe["swing_low"] = dataframe["fractal_low"].ffill() dataframe["swing_range"] = dataframe["swing_high"] - dataframe["swing_low"] dataframe["fib_382_long"] = dataframe["swing_high"] - dataframe["swing_range"] * self.fib_low.value dataframe["fib_618_long"] = dataframe["swing_high"] - dataframe["swing_range"] * self.fib_high.value dataframe["fib_382_short"] = dataframe["swing_low"] + dataframe["swing_range"] * self.fib_low.value dataframe["fib_618_short"] = dataframe["swing_low"] + dataframe["swing_range"] * self.fib_high.value return dataframe def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: trend_up = (dataframe["ema_fast"] > dataframe["ema_slow"]) & (dataframe["close"] > dataframe["ema_slow"]) trend_down = (dataframe["ema_fast"] < dataframe["ema_slow"]) & (dataframe["close"] < dataframe["ema_slow"]) volume_ok = (dataframe["volume"] > dataframe["volume_sma"] * self.volume_factor.value) & ( dataframe["volume"] > 0 ) fib_long_low = dataframe[["fib_382_long", "fib_618_long"]].min(axis=1) fib_long_high = dataframe[["fib_382_long", "fib_618_long"]].max(axis=1) fib_short_low = dataframe[["fib_382_short", "fib_618_short"]].min(axis=1) fib_short_high = dataframe[["fib_382_short", "fib_618_short"]].max(axis=1) valid_range = dataframe["swing_range"] > 0 dataframe.loc[ ( valid_range & trend_up & volume_ok & (dataframe["close"] >= fib_long_low) & (dataframe["close"] <= fib_long_high) & (dataframe["close"] > dataframe["ema_fast"]) & (dataframe["close"] > dataframe["open"]) ), "enter_long" ] = 1 dataframe.loc[ ( valid_range & trend_down & volume_ok & (dataframe["close"] >= fib_short_low) & (dataframe["close"] <= fib_short_high) & (dataframe["close"] < dataframe["ema_fast"]) & (dataframe["close"] < dataframe["open"]) ), "enter_short" ] = 1 return dataframe def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: dataframe.loc[ ( ((dataframe["close"] < dataframe["ema_fast"]) & (dataframe["close"].shift(1) >= dataframe["ema_fast"].shift(1))) | (dataframe["close"] < dataframe["ema_slow"]) ), "exit_long" ] = 1 dataframe.loc[ ( ((dataframe["close"] > dataframe["ema_fast"]) & (dataframe["close"].shift(1) <= dataframe["ema_fast"].shift(1))) | (dataframe["close"] > dataframe["ema_slow"]) ), "exit_short" ] = 1 return dataframe |
Strategy League — fixed backtest that feeds the ranking
Export report Freqtrade logsRun finished · took 37.0s
ℹ️ This strategy uses a trailing stop — freqtrade only
re-checks these once per 1h candle by default, not against the price movement within it.
For a more accurate read, re-run this backtest locally with --timeframe-detail 1m
(or 5m — freqtrade's own docs use 5m detail for an hourly strategy as a lighter
alternative). 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 8% of rolling 3-month windows
- did not beat simply holding the market
- very deep drawdown (-91%)
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 |
|---|---|---|---|---|---|---|---|---|---|
| Mar 2024 | bullish trending high vol | 12 | -2.61 | -2.18 | 1 | 11 | 8.3 | -90.75 | 8h 10m |
| Feb 2024 | bullish trending low vol | 58 | -3.55 | -0.61 | 29 | 29 | 50.0 | -88.25 | 7h 58m |
| Jan 2024 | bearish choppy high vol | 43 | -0.20 | -0.05 | 20 | 23 | 46.5 | -85.71 | 5h 18m |
| Dec 2023 | bullish trending low vol | 67 | -1.39 | -0.21 | 30 | 37 | 44.8 | -85.18 | 7h 15m |
| Nov 2023 | bullish trending low vol | 56 | +0.11 | 0.02 | 28 | 28 | 50.0 | -85.03 | 7h 29m |
| Oct 2023 | bullish trending low vol | 42 | +1.01 | 0.24 | 21 | 21 | 50.0 | -84.95 | 9h 59m |
| Sep 2023 | bearish choppy low vol | 37 | -1.58 | -0.43 | 12 | 25 | 32.4 | -84.87 | 10h 26m |
| Aug 2023 | bearish choppy low vol | 36 | -3.49 | -0.97 | 4 | 32 | 11.1 | -82.92 | 6h 08m |
| Jul 2023 | bullish trending low vol | 93 | -1.80 | -0.19 | 40 | 53 | 43.0 | -80.89 | 7h 12m |
| Jun 2023 | bullish trending low vol | 59 | +0.79 | 0.13 | 26 | 33 | 44.1 | -79.67 | 6h 53m |
| May 2023 | bearish choppy low vol | 43 | -1.93 | -0.45 | 12 | 31 | 27.9 | -78.63 | 9h 03m |
| Apr 2023 | bullish trending low vol | 71 | -1.34 | -0.19 | 27 | 44 | 38.0 | -77.28 | 7h 57m |
| Mar 2023 | bullish trending high vol | 52 | -1.14 | -0.22 | 19 | 33 | 36.5 | -75.7 | 5h 57m |
| Feb 2023 | bullish trending low vol | 70 | -1.49 | -0.21 | 26 | 44 | 37.1 | -75.51 | 5h 18m |
| Jan 2023 | bullish trending low vol | 111 | +6.58 | 0.59 | 60 | 51 | 54.1 | -79.33 | 7h 49m |
| Dec 2022 | bearish trending low vol | 53 | -3.43 | -0.65 | 13 | 40 | 24.5 | -79.56 | 9h 07m |
| Nov 2022 | bearish trending high vol | 53 | -0.60 | -0.11 | 22 | 31 | 41.5 | -76.63 | 5h 29m |
| Oct 2022 | bullish choppy low vol | 55 | +1.55 | 0.28 | 26 | 29 | 47.3 | -77.99 | 8h 00m |
| Sep 2022 | bearish choppy high vol | 58 | -7.36 | -1.27 | 19 | 39 | 32.8 | -77.57 | 6h 53m |
| Aug 2022 | bullish choppy high vol | 69 | -3.00 | -0.43 | 25 | 44 | 36.2 | -69.88 | 6h 44m |
| Jul 2022 | bearish trending high vol | 113 | -4.56 | -0.40 | 55 | 58 | 48.7 | -67.03 | 6h 03m |
| Jun 2022 | bearish trending high vol | 59 | -0.21 | -0.03 | 28 | 31 | 47.5 | -65.21 | 5h 22m |
| May 2022 | bearish trending high vol | 22 | -0.69 | -0.31 | 12 | 10 | 54.5 | -63.11 | 5h 19m |
| Apr 2022 | bearish choppy high vol | 58 | -6.22 | -1.07 | 16 | 42 | 27.6 | -61.82 | 5h 04m |
| Mar 2022 | bullish choppy high vol | 114 | +2.43 | 0.21 | 61 | 53 | 53.5 | -60.22 | 9h 11m |
| Feb 2022 | bearish trending high vol | 74 | -5.41 | -0.73 | 32 | 42 | 43.2 | -58.21 | 7h 10m |
| Jan 2022 | bearish trending high vol | 42 | -2.40 | -0.57 | 18 | 24 | 42.9 | -53.05 | 5h 06m |
| Dec 2021 | bearish trending high vol | 67 | -1.02 | -0.15 | 30 | 37 | 44.8 | -50.76 | 6h 13m |
| Nov 2021 | bullish trending high vol | 75 | +0.09 | 0.01 | 33 | 42 | 44.0 | -52.2 | 6h 03m |
| Oct 2021 | bullish trending high vol | 136 | -6.69 | -0.49 | 50 | 86 | 36.8 | -50.16 | 6h 27m |
| Sep 2021 | bearish trending high vol | 83 | -6.65 | -0.80 | 37 | 46 | 44.6 | -43.49 | 5h 30m |
| Aug 2021 | bullish trending high vol | 148 | -1.14 | -0.08 | 72 | 76 | 48.6 | -38.1 | 6h 04m |
| Jul 2021 | bearish trending high vol | 92 | -7.82 | -0.85 | 40 | 52 | 43.5 | -37.6 | 5h 42m |
| Jun 2021 | bearish trending high vol | 46 | -8.34 | -1.81 | 15 | 31 | 32.6 | -28.6 | 6h 31m |
| May 2021 | bearish trending high vol | 95 | -2.94 | -0.31 | 46 | 49 | 48.4 | -23.28 | 4h 36m |
| Apr 2021 | bearish choppy high vol | 178 | -2.99 | -0.17 | 90 | 88 | 50.6 | -18.45 | 4h 04m |
| Mar 2021 | bullish choppy high vol | 109 | -1.25 | -0.11 | 52 | 57 | 47.7 | -17.28 | 5h 09m |
| Feb 2021 | bullish trending high vol | 154 | -7.83 | -0.51 | 85 | 69 | 55.2 | -13.79 | 4h 32m |
| Jan 2021 | bullish trending high vol | 228 | -1.77 | -0.08 | 128 | 100 | 56.1 | -6.45 | 3h 20m |
Yearly breakdown
| Year | Trades | Profit % | Avg % | Win | Loss | Win % | DD % | Avg dur |
|---|---|---|---|---|---|---|---|---|
| 2024 | 113 | -6.36 | -0.56 | 50 | 63 | 44.2 | -90.75 | 6h 58m |
| 2023 | 737 | -5.67 | -0.08 | 305 | 432 | 41.4 | -85.18 | 7h 28m |
| 2022 | 770 | -29.90 | -0.39 | 327 | 443 | 42.5 | -79.56 | 6h 51m |
| 2021 | 1411 | -48.35 | -0.34 | 678 | 733 | 48.1 | -52.2 | 5h 02m |
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
8 potential lookahead pattern(s) found · 2 to review
| Line | Pattern | Detail | |
|---|---|---|---|
| 54 | leak | negative_shift | shift() with negative periods reads future candles |
| 60 | |||
| 53 | |||
| 59 | |||
| 85 | leak | whole_series_reduction | .min() over the whole column sees future rows (use .rolling(window).min() for a causal value) |
| 86 | leak | whole_series_reduction | .max() over the whole column sees future rows (use .rolling(window).max() for a causal value) |
| 88 | leak | whole_series_reduction | .min() over the whole column sees future rows (use .rolling(window).min() for a causal value) |
| 89 | leak | whole_series_reduction | .max() over the whole column sees future rows (use .rolling(window).max() for a causal value) |
| 36 | review | startup_candles_too_small | startup_candle_count is 210, but EMA(timeperiod=200) needing 3x warmup needs at least 600 candles -- so the first 390+ 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 |
| 106 | review | short_without_can_short | writes enter_short, exit_short but can_short isn't True, so freqtrade never opens a short (it also requires futures/margin mode). Worse, freqtrade only takes a long when `not any([exit_long, enter_short])`, so every row you mark enter_short SUPPRESSES that candle's long entry and opens nothing in its place. |
ran by Ron · took s
Lookahead analysis
freqtrade lookahead-analysis: detects strategies peeking at future candles.