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 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 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 | from technical.util import resample_to_interval, resampled_merge from freqtrade.strategy import IStrategy from typing import Dict, List from functools import reduce from pandas import DataFrame from datetime import datetime import talib.abstract as ta import freqtrade.vendor.qtpylib.indicators as qtpylib class madrid_ribbon_1h(IStrategy): """ Madrid Ribbon 001 author@: Hessebo This strategy aims to follow emas. How to use it? """ INTERFACE_VERSION: int = 3 minimal_roi = { "60": 0.01, "30": 0.03, "20": 0.04, "0": 0.05 } can_short = True stoploss = -0.10 timeframe = '1h' trailing_stop = False trailing_stop_positive = 0.01 trailing_stop_positive_offset = 0.02 use_custom_stoploss = True def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float: if (current_profit > 0.3): return 0.01 elif (current_profit > 0.1): return 0.015 elif (current_profit > 0.06): return 0.01 elif (current_profit > 0.02): return 0.05 elif (current_profit > 0.01): return 0.003 return 0.15 process_only_new_candles = False use_exit_signal = True exit_profit_only = False ignore_roi_if_entry_signal = False order_types = { 'entry': 'limit', 'exit': 'limit', 'stoploss': 'market', 'stoploss_on_exchange': False } use_custom_stoploss = False def custom_stoploss(self, pair: str, trade: 'Trade', current_time: datetime, current_rate: float, current_profit: float, **kwargs) -> float: if (current_profit > 0.3): return 0.01 elif (current_profit > 0.1): return 0.015 elif (current_profit > 0.06): return 0.01 elif (current_profit > 0.02): return 0.05 elif (current_profit > 0.01): return 0.003 return 0.15 def informative_pairs(self): """ Define additional, informative pair/interval combinations to be cached from the exchange. These pair/interval combinations are non-tradeable, unless they are part of the whitelist as well. For more information, please consult the documentation :return: List of tuples in the format (pair, interval) Sample: return [("ETH/USDT", "5m"), ("BTC/USDT", "15m"), ] """ return [] def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Adds several different TA indicators to the given DataFrame Performance Note: For the best performance be frugal on the number of indicators you are using. Let uncomment only the indicator you are using in your strategies or your hyperopt configuration, otherwise you will waste your memory and CPU usage. """ bollinger = qtpylib.bollinger_bands(qtpylib.typical_price(dataframe), window=20, stds=2) dataframe['bb_lowerband'] = bollinger['lower'] dataframe['bb_middleband'] = bollinger['mid'] dataframe['bb_upperband'] = bollinger['upper'] stoch = ta.STOCH( dataframe, fastk_period=14, slowk_period=3, slowk_matype=0, slowd_period=3, slowd_matype=0, ) dataframe["slowd"] = stoch["slowd"] dataframe["slowk"] = stoch["slowk"] macd = ta.MACD( dataframe, fastperiod=12, fastmatype=0, slowperiod=26, slowmatype=0, signalperiod=9, signalmatype=0, ) dataframe["macd"] = macd["macd"] dataframe["macdsignal"] = macd["macdsignal"] dataframe["macdhist"] = macd["macdhist"] dataframe['ema_madrid'] = ta.EMA(dataframe, timeperiod=10) dataframe['ema5'] = ta.EMA(dataframe, timeperiod=5) dataframe['ema10'] = ta.EMA(dataframe, timeperiod=10) dataframe['ema15'] = ta.EMA(dataframe, timeperiod=15) dataframe['ema20'] = ta.EMA(dataframe, timeperiod=20) dataframe['ema25'] = ta.EMA(dataframe, timeperiod=25) dataframe['ema30'] = ta.EMA(dataframe, timeperiod=30) dataframe['ema35'] = ta.EMA(dataframe, timeperiod=35) dataframe['ema40'] = ta.EMA(dataframe, timeperiod=40) dataframe['ema45'] = ta.EMA(dataframe, timeperiod=45) dataframe['ema50'] = ta.EMA(dataframe, timeperiod=50) dataframe['ema55'] = ta.EMA(dataframe, timeperiod=55) dataframe['ema60'] = ta.EMA(dataframe, timeperiod=60) dataframe['ema65'] = ta.EMA(dataframe, timeperiod=65) dataframe['ema70'] = ta.EMA(dataframe, timeperiod=70) dataframe['ema75'] = ta.EMA(dataframe, timeperiod=75) dataframe['ema80'] = ta.EMA(dataframe, timeperiod=80) dataframe['ema85'] = ta.EMA(dataframe, timeperiod=85) dataframe['ema90'] = ta.EMA(dataframe, timeperiod=90) dataframe['ema95'] = ta.EMA(dataframe, timeperiod=95) dataframe['ema100'] = ta.EMA(dataframe, timeperiod=100) dataframe['ema200'] = ta.EMA(dataframe, timeperiod=200) dataframe["rsi"] = ta.RSI(dataframe, timeperiod=14) return dataframe def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Based on TA indicators, populates the buy signal for the given dataframe :param dataframe: DataFrame :return: DataFrame with buy column """ dataframe.loc[ ( (dataframe["rsi"] > 51) & (dataframe['ema5'] > dataframe['ema10']) & (dataframe['ema10'] > dataframe['ema15']) & (dataframe['ema15'] > dataframe['ema20']) & (dataframe['ema20'] > dataframe['ema25']) & (dataframe['ema25'] > dataframe['ema30']) & (dataframe['ema30'] > dataframe['ema35']) & (dataframe['ema35'] > dataframe['ema40']) & (dataframe['ema40'] > dataframe['ema45']) & (dataframe['ema45'] > dataframe['ema50']) & (dataframe['ema50'] > dataframe['ema55']) & (dataframe['ema55'] > dataframe['ema60']) & (dataframe['ema60'] > dataframe['ema65']) & (dataframe['ema65'] > dataframe['ema70']) & (dataframe['ema70'] > dataframe['ema75']) & (dataframe['ema75'] > dataframe['ema80']) & (dataframe['ema80'] > dataframe['ema85']) & (dataframe['ema85'] > dataframe['ema90']) & (dataframe['ema90'] > dataframe['ema95']) & (dataframe['ema95'] > dataframe['ema100']) & (dataframe['ema100'] > dataframe['ema200']) & (dataframe['close'] > dataframe['bb_middleband']) ), 'enter_long'] = 1 dataframe.loc[ ( (dataframe["rsi"] < 51) & (dataframe['ema5'] < dataframe['ema10']) & (dataframe['ema10'] < dataframe['ema15']) & (dataframe['ema15'] < dataframe['ema20']) & (dataframe['ema20'] < dataframe['ema25']) & (dataframe['ema25'] < dataframe['ema30']) & (dataframe['ema30'] < dataframe['ema35']) & (dataframe['ema35'] < dataframe['ema40']) & (dataframe['ema40'] < dataframe['ema45']) & (dataframe['ema45'] < dataframe['ema50']) & (dataframe['ema50'] < dataframe['ema55']) & (dataframe['ema55'] < dataframe['ema60']) & (dataframe['ema60'] < dataframe['ema65']) & (dataframe['ema65'] < dataframe['ema70']) & (dataframe['ema70'] < dataframe['ema75']) & (dataframe['ema75'] < dataframe['ema80']) & (dataframe['ema80'] < dataframe['ema85']) & (dataframe['ema85'] < dataframe['ema90']) & (dataframe['ema90'] < dataframe['ema95']) & (dataframe['ema95'] < dataframe['ema100']) & (dataframe['ema100'] < dataframe['ema200']) & (dataframe['close'] < dataframe['bb_middleband']) ), 'enter_short'] = 1 return dataframe def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Based on TA indicators, populates the sell signal for the given dataframe :param dataframe: DataFrame :return: DataFrame with buy column """ dataframe.loc[ ( qtpylib.crossed_above(dataframe['ema10'], dataframe['ema100']) ), 'exit_long'] = 1 dataframe.loc[ ( qtpylib.crossed_below(dataframe['ema10'], dataframe['ema100']) ), 'exit_short'] = 1 return dataframe |
Strategy League — fixed backtest that feeds the ranking
Export report Freqtrade logsRun finished · took 350.8s
ℹ️ This strategy uses a trailing stop / custom_stoploss() — 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 →
- statistically significant edge (p=0.00)
- 100% of resampled runs stayed profitable
- profitable across 97% of rolling 3-month windows
- comfortably beat buy-and-hold
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 |
|---|---|---|---|---|---|---|---|---|---|
| Jan 2026 | bullish trending low vol | 10 | -3.12 | -3.15 | 0 | 10 | 0.0 | -0.68 | 46h 06m |
| Dec 2025 | bearish trending low vol | 441 | +2.66 | 0.06 | 360 | 81 | 81.6 | -1.17 | 16h 04m |
| Nov 2025 | bearish trending high vol | 732 | +46.88 | 0.65 | 653 | 79 | 89.2 | -0.99 | 9h 38m |
| Oct 2025 | bearish trending low vol | 633 | +30.71 | 0.49 | 540 | 93 | 85.3 | -1.22 | 10h 57m |
| Sep 2025 | bullish choppy low vol | 373 | +11.55 | 0.31 | 304 | 69 | 81.5 | -1.94 | 20h 10m |
| Aug 2025 | bearish choppy low vol | 484 | -8.59 | -0.18 | 401 | 83 | 82.9 | -2.01 | 13h 38m |
| Jul 2025 | bullish choppy low vol | 643 | +26.72 | 0.42 | 568 | 75 | 88.3 | -1.06 | 11h 45m |
| Jun 2025 | bearish choppy low vol | 406 | -3.18 | -0.09 | 331 | 75 | 81.5 | -1.44 | 16h 40m |
| May 2025 | bullish trending low vol | 544 | +13.60 | 0.25 | 458 | 86 | 84.2 | -1.33 | 13h 25m |
| Apr 2025 | bullish choppy low vol | 535 | +25.18 | 0.47 | 458 | 77 | 85.6 | -1.49 | 12h 20m |
| Mar 2025 | bearish trending high vol | 629 | -3.63 | -0.06 | 516 | 113 | 82.0 | -2.67 | 11h 04m |
| Feb 2025 | bearish trending low vol | 782 | +59.30 | 0.77 | 682 | 100 | 87.2 | -2.91 | 8h 12m |
| Jan 2025 | bearish choppy low vol | 639 | -15.30 | -0.24 | 535 | 104 | 83.7 | -2.79 | 11h 11m |
| Dec 2024 | bullish trending low vol | 923 | +42.46 | 0.48 | 805 | 118 | 87.2 | -1.64 | 7h 14m |
| Nov 2024 | bullish trending low vol | 950 | +51.19 | 0.55 | 858 | 92 | 90.3 | -1.34 | 7h 22m |
| Oct 2024 | bullish choppy low vol | 359 | -0.51 | -0.03 | 293 | 66 | 81.6 | -1.76 | 21h 09m |
| Sep 2024 | bearish choppy low vol | 422 | +13.23 | 0.33 | 365 | 57 | 86.5 | -2.55 | 17h 04m |
| Aug 2024 | bearish choppy high vol | 678 | +33.06 | 0.51 | 596 | 82 | 87.9 | -3.22 | 9h 43m |
| Jul 2024 | bearish trending low vol | 558 | +21.57 | 0.39 | 480 | 78 | 86.0 | -1.99 | 13h 11m |
| Jun 2024 | bearish choppy low vol | 449 | +23.46 | 0.53 | 384 | 65 | 85.5 | -3.0 | 15h 59m |
| May 2024 | bullish choppy high vol | 404 | -5.95 | -0.15 | 330 | 74 | 81.7 | -2.73 | 17h 20m |
| Apr 2024 | bearish choppy high vol | 658 | +38.13 | 0.60 | 562 | 96 | 85.4 | -2.61 | 10h 46m |
| Mar 2024 | bullish trending high vol | 730 | +7.19 | 0.10 | 636 | 94 | 87.1 | -4.17 | 9h 15m |
| Feb 2024 | bullish trending low vol | 423 | -6.41 | -0.13 | 350 | 73 | 82.7 | -3.64 | 16h 37m |
| Jan 2024 | bearish choppy high vol | 590 | -5.09 | -0.08 | 494 | 96 | 83.7 | -3.36 | 12h 15m |
| Dec 2023 | bullish trending low vol | 650 | +13.73 | 0.22 | 556 | 94 | 85.5 | -3.68 | 11h 44m |
| Nov 2023 | bullish trending low vol | 492 | -13.10 | -0.26 | 399 | 93 | 81.1 | -3.57 | 14h 13m |
| Oct 2023 | bullish trending low vol | 379 | +14.75 | 0.40 | 329 | 50 | 86.8 | -1.17 | 19h 26m |
| Sep 2023 | bearish choppy low vol | 261 | +6.18 | 0.24 | 199 | 62 | 76.2 | -0.87 | 25h 45m |
| Aug 2023 | bearish choppy low vol | 405 | +27.30 | 0.68 | 339 | 66 | 83.7 | -1.13 | 18h 38m |
| Jul 2023 | bullish trending low vol | 310 | -0.51 | -0.01 | 244 | 66 | 78.7 | -1.47 | 23h 42m |
| Jun 2023 | bullish trending low vol | 452 | +13.88 | 0.31 | 377 | 75 | 83.4 | -1.27 | 16h 20m |
| May 2023 | bearish choppy low vol | 394 | +22.86 | 0.59 | 323 | 71 | 82.0 | -1.96 | 18h 37m |
| Apr 2023 | bullish trending low vol | 325 | -5.23 | -0.16 | 256 | 69 | 78.8 | -2.54 | 21h 39m |
| Mar 2023 | bullish trending high vol | 431 | +16.16 | 0.38 | 371 | 60 | 86.1 | -1.94 | 15h 41m |
| Feb 2023 | bullish trending low vol | 406 | +2.35 | 0.06 | 340 | 66 | 83.7 | -1.26 | 16h 34m |
| Jan 2023 | bullish trending low vol | 566 | +32.81 | 0.59 | 503 | 63 | 88.9 | -1.46 | 12h 50m |
| Dec 2022 | bearish trending low vol | 395 | +17.55 | 0.45 | 332 | 63 | 84.1 | -1.76 | 18h 44m |
| Nov 2022 | bearish trending high vol | 803 | +34.09 | 0.43 | 694 | 109 | 86.4 | -3.4 | 8h 01m |
| Oct 2022 | bullish choppy low vol | 446 | +11.68 | 0.27 | 374 | 72 | 83.9 | -2.22 | 16h 35m |
| Sep 2022 | bearish choppy high vol | 512 | -5.31 | -0.10 | 417 | 95 | 81.4 | -2.44 | 13h 59m |
| Aug 2022 | bullish choppy high vol | 557 | +24.05 | 0.44 | 479 | 78 | 86.0 | -1.51 | 12h 07m |
| Jul 2022 | bullish trending high vol | 669 | +2.51 | 0.04 | 581 | 88 | 86.8 | -3.93 | 10h 14m |
| Jun 2022 | bearish trending high vol | 1031 | +50.30 | 0.49 | 923 | 108 | 89.5 | -5.77 | 6h 06m |
| May 2022 | bearish trending high vol | 1060 | +45.08 | 0.43 | 912 | 148 | 86.0 | -6.41 | 5h 40m |
| Apr 2022 | bearish choppy high vol | 584 | +23.79 | 0.41 | 510 | 74 | 87.3 | -1.87 | 12h 38m |
| Mar 2022 | bullish choppy high vol | 552 | +19.02 | 0.35 | 490 | 62 | 88.8 | -6.01 | 12h 28m |
| Feb 2022 | bearish trending high vol | 681 | +9.21 | 0.15 | 597 | 84 | 87.7 | -6.6 | 8h 24m |
| Jan 2022 | bearish trending high vol | 868 | +51.41 | 0.60 | 766 | 102 | 88.2 | -5.26 | 7h 45m |
| Dec 2021 | bearish trending high vol | 796 | +31.29 | 0.40 | 703 | 93 | 88.3 | -3.74 | 8h 04m |
| Nov 2021 | bearish trending high vol | 660 | +8.76 | 0.14 | 570 | 90 | 86.4 | -8.23 | 10h 42m |
| Oct 2021 | bullish trending high vol | 562 | -13.75 | -0.25 | 463 | 99 | 82.4 | -5.86 | 12h 27m |
| Sep 2021 | bearish trending high vol | 835 | +13.39 | 0.16 | 731 | 104 | 87.5 | -7.07 | 7h 47m |
| Aug 2021 | bullish trending high vol | 855 | +27.99 | 0.33 | 759 | 96 | 88.8 | -3.59 | 7h 40m |
| Jul 2021 | bullish trending high vol | 703 | +31.41 | 0.46 | 631 | 72 | 89.8 | -14.04 | 9h 31m |
| Jun 2021 | bearish trending high vol | 994 | +30.56 | 0.32 | 867 | 127 | 87.2 | -12.55 | 5h 07m |
| May 2021 | bearish trending high vol | 1656 | +86.20 | 0.54 | 1420 | 236 | 85.7 | -17.99 | 3h 21m |
| Apr 2021 | bearish choppy high vol | 1093 | +16.96 | 0.16 | 938 | 155 | 85.8 | -22.65 | 5h 36m |
| Mar 2021 | bullish choppy high vol | 697 | -27.00 | -0.41 | 571 | 126 | 81.9 | -25.12 | 9h 31m |
| Feb 2021 | bullish trending high vol | 1369 | +53.84 | 0.41 | 1207 | 162 | 88.2 | -20.2 | 4h 09m |
| Jan 2021 | bullish trending high vol | 754 | -11.96 | -0.17 | 622 | 132 | 82.5 | -27.74 | 5h 11m |
Yearly breakdown
| Year | Trades | Profit % | Avg % | Win | Loss | Win % | DD % | Avg dur |
|---|---|---|---|---|---|---|---|---|
| 2026 | 10 | -3.12 | -3.15 | 0 | 10 | 0.0 | -0.68 | 46h 06m |
| 2025 | 6841 | +185.90 | 0.27 | 5806 | 1035 | 84.9 | -2.91 | 12h 16m |
| 2024 | 7144 | +212.33 | 0.31 | 6153 | 991 | 86.1 | -4.17 | 11h 51m |
| 2023 | 5071 | +131.18 | 0.27 | 4236 | 835 | 83.5 | -3.68 | 16h 59m |
| 2022 | 8158 | +283.38 | 0.35 | 7075 | 1083 | 86.7 | -6.6 | 9h 56m |
| 2021 | 10974 | +247.69 | 0.23 | 9482 | 1492 | 86.4 | -27.74 | 6h 40m |
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 · 3 thing(s) worth reviewing before trusting the numbers
| Line | Pattern | Detail | |
|---|---|---|---|
| 14 | review | missing_startup_candles | uses recursive indicators (EMA, MACD, RSI) but startup_candle_count is not set (default 0). Their value at a bar depends on all bars before it, so freqtrade trims no warmup and the backtest opens with unwarmed values that can't occur live. The longest lookback visible here is EMA(timeperiod=200) needing 3x warmup, so it needs at least that many. Set it to a few times the longest period and confirm with `freqtrade recursive-analysis` |
| 77 | review | dead_callback | custom_stoploss() is defined but use_custom_stoploss isn't True, and freqtrade only calls it when that flag is set -- the method never runs and every trade uses the static stoploss |
| 61 | review | unthrottled_candle_processing | process_only_new_candles is False, so populate_indicators/populate_entry_trend/populate_exit_trend re-run every throttle_secs (default 5s) even though their inputs -- closed candles -- haven't changed since the last run. This wastes CPU without changing any value; if the goal is order-book-level checks, put that logic in confirm_trade_entry/custom_exit instead, which already run every loop |
ran by Ron · took s
Lookahead analysis
Freqtrade logsno lookahead bias detected
20 signal(s) analysed · 0 biased entries · 0 biased exits
ran by Ron · took 157.6s