Basics
mode: futures
timeframe: 1d
interface version: 3
Settings
stoploss: -0.03
has minimal roi
process only new candles
startup candle count: 200
hyperopt
hyperopt params: 2
Indicators
SMA
talib
technical
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 | # pragma pylint: disable=missing-docstring, invalid-name, pointless-string-statement # flake8: noqa: F401 # isort: skip_file # --- Do not remove these imports --- import numpy as np import pandas as pd from pandas import DataFrame from typing import Optional, Union from freqtrade.strategy import ( IStrategy, IntParameter, ) # -------------------------------- # Add your lib to import here import talib.abstract as ta from technical import qtpylib # This class is a sample. Feel free to customize it. class QWQ(IStrategy): """ This is a custom strategy based on the given Tongda Xin code. More information in https://www.freqtrade.io/en/latest/strategy-customization/ You can: :return: a Dataframe with all mandatory indicators for the strategies - Rename the class name (Do not forget to update class_name) - Add any methods you want to build your strategy - Add any lib you need to build your strategy You must keep: - the lib in the section "Do not remove these libs" - the methods: populate_indicators, populate_entry_trend, populate_exit_trend You should keep: - timeframe, minimal_roi, stoploss, trailing_* """ # Strategy interface version - allow new iterations of the strategy interface. # Check the documentation or the Sample strategy to get the latest version. INTERFACE_VERSION = 3 # Can this strategy go short? can_short: bool = True # Minimal ROI designed for the strategy. # This attribute will be overridden if the config file contains "minimal_roi". minimal_roi = { "60": 0.01, "30": 0.02, "0": 0.04, } # Optimal stoploss designed for the strategy. # This attribute will be overridden if the config file contains "stoploss". stoploss = -0.03 # Trailing stoploss trailing_stop = False # Optimal timeframe for the strategy. timeframe = "1d" # Run "populate_indicators()" only for new candle. process_only_new_candles = True # These values can be overridden in the config. use_exit_signal = True exit_profit_only = False ignore_roi_if_entry_signal = False # Hyperoptable parameters buy_rsi = IntParameter(low=1, high=50, default=30, space="buy", optimize=True, load=True) sell_rsi = IntParameter(low=50, high=100, default=70, space="sell", optimize=True, load=True) # Number of candles the strategy requires before producing valid signals startup_candle_count: int = 200 # Optional order type mapping. order_types = { "entry": "limit", "exit": "limit", "stoploss": "market", "stoploss_on_exchange": False, } # Optional order time in force. order_time_in_force = {"entry": "GTC", "exit": "GTC"} plot_config = { "main_plot": { "sma1": {}, "sma2": {}, "bbiboll": {}, "upper": {}, "lower": {}, "long_stoploss": {"color": "red"}, "short_stoploss": {"color": "blue"}, }, "subplots": { "RSI": { "rsi": {"color": "red"}, }, }, } 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 """ # Define moving averages MA1 = 5 MA2 = 20 dataframe["sma1"] = ta.SMA(dataframe, timeperiod=MA1) dataframe["sma2"] = ta.SMA(dataframe, timeperiod=MA2) # Calculate BBIBOLL dataframe["bbiboll"] = ta.SMA((dataframe["high"] + dataframe["low"] + dataframe["close"]) / 3, timeperiod=5) dataframe["upper"] = dataframe["bbiboll"] + 2 * ta.STDDEV((dataframe["high"] + dataframe["low"] + dataframe["close"]) / 3, timeperiod=5) dataframe["lower"] = dataframe["bbiboll"] - 2 * ta.STDDEV((dataframe["high"] + dataframe["low"] + dataframe["close"]) / 3, timeperiod=5) # Calculate ATR # 使用 numpy 的 abs 函数来计算绝对值 dataframe["tr1"] = dataframe["high"] - dataframe["low"] dataframe["tr2"] = (dataframe["high"] - dataframe["close"].shift(1)).abs() dataframe["tr3"] = (dataframe["low"] - dataframe["close"].shift(1)).abs() dataframe["tr"] = dataframe[["tr1", "tr2", "tr3"]].max(axis=1) dataframe["atr14"] = ta.SMA(dataframe["tr"], timeperiod=14) # Calculate stoploss lines dataframe["long_stoploss"] = dataframe["close"] - 2 * dataframe["atr14"] dataframe["short_stoploss"] = dataframe["close"] + 2 * dataframe["atr14"] return dataframe def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Based on TA indicators, populates the entry signal for the given dataframe :param dataframe: DataFrame :param metadata: Additional information, like the currently traded pair :return: DataFrame with entry columns populated """ dataframe.loc[ ( (qtpylib.crossed_above(dataframe["sma1"], dataframe["sma2"])) # Signal: SMA1 crosses above SMA2 & (dataframe["close"] > dataframe["bbiboll"]) # Guard: Close above BBIBOLL & (dataframe["volume"] > 0) # Make sure Volume is not 0 ), "enter_long", ] = 1 dataframe.loc[ ( (qtpylib.crossed_above(dataframe["sma2"], dataframe["sma1"])) # Signal: SMA2 crosses above SMA1 & (dataframe["close"] < dataframe["bbiboll"]) # Guard: Close below BBIBOLL & (dataframe["volume"] > 0) # Make sure Volume is not 0 ), "enter_short", ] = 1 return dataframe def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Based on TA indicators, populates the exit signal for the given dataframe :param dataframe: DataFrame :param metadata: Additional information, like the currently traded pair :return: DataFrame with exit columns populated """ dataframe.loc[ ( (qtpylib.crossed_above(dataframe["sma2"], dataframe["sma1"])) # Signal: SMA2 crosses above SMA1 & (dataframe["close"] < dataframe["bbiboll"]) # Guard: Close below BBIBOLL & (dataframe["volume"] > 0) # Make sure Volume is not 0 ), "exit_long", ] = 1 dataframe.loc[ ( (qtpylib.crossed_above(dataframe["sma1"], dataframe["sma2"])) # Signal: SMA1 crosses above SMA2 & (dataframe["close"] > dataframe["bbiboll"]) # Guard: Close above BBIBOLL & (dataframe["volume"] > 0) # Make sure Volume ), "exit_short", ] = 1 return dataframe |
Strategy League — fixed backtest that feeds the ranking
Export report Freqtrade logsRun finished · took 18.2s
pairs 33 pairs
timerange 20210101-20260101
mode futures
timeframe 1d
stake 100 USDT
wallet 1000 USDT
max open trades 10
fee exchange lowest tier
total profit-90.03%
final wallet100 USDT
win rate46.1%
max drawdown-90.01%
market change+399.34%
vs market-489.37%
timeframe1d
profit factor0.75
expectancy ratio-0.137
sharpe-3.137
sortino-43.974
CAGR-36.9%
calmar-1.046
avg MFE+4.89%
avg MAE-4.18%
avg profit/trade-0.43%
avg duration9h 20m
best trade+4.14%
worst trade-5.09%
positive months16/59
consistent (3-mo)15.8%
worst 3-mo-15.98%
trades2166
revision1
likely annual return-38%
range (5th–95th)-47% … -27%
chance of profit0.0%
worst-5% outcome-50%
significance (p)1.0
risk of ruin0.0%
- profit isn't statistically significant (p=1.00) — hard to tell apart from luck
- only 0% of resampled runs were profitable
- profitable in only 16% of rolling 3-month windows
- did not beat simply holding the market
- very deep drawdown (-90%)
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 | 19 | -4.02 | -2.13 | 3 | 16 | 15.8 | -90.01 | 5h 03m |
| Oct 2025 | bearish trending low vol | 24 | -0.47 | -0.19 | 12 | 12 | 50.0 | -85.98 | 12h 00m |
| Sep 2025 | bullish choppy low vol | 29 | +2.11 | 0.70 | 21 | 8 | 72.4 | -87.79 | 14h 54m |
| Aug 2025 | bearish choppy low vol | 44 | -3.63 | -0.84 | 16 | 28 | 36.4 | -88.23 | 6h 33m |
| Jul 2025 | bullish choppy low vol | 26 | +0.73 | 0.27 | 14 | 12 | 53.8 | -86.58 | 9h 14m |
| Jun 2025 | bearish choppy low vol | 16 | -1.72 | -1.12 | 7 | 9 | 43.8 | -84.83 | 18h 00m |
| May 2025 | bullish trending low vol | 46 | +0.82 | 0.17 | 23 | 23 | 50.0 | -85.07 | 5h 44m |
| Apr 2025 | bullish choppy low vol | 25 | -1.40 | -0.57 | 11 | 14 | 44.0 | -84.15 | 9h 36m |
| Mar 2025 | bearish trending high vol | 30 | -0.51 | -0.17 | 14 | 16 | 46.7 | -82.52 | 8h 00m |
| Feb 2025 | bearish trending low vol | 39 | -2.00 | -0.52 | 15 | 24 | 38.5 | -82.01 | 3h 42m |
| Jan 2025 | bearish choppy low vol | 66 | -7.31 | -1.13 | 22 | 44 | 33.3 | -79.91 | 5h 27m |
| Dec 2024 | bullish trending low vol | 32 | -2.30 | -0.71 | 12 | 20 | 37.5 | -72.98 | 5h 15m |
| Nov 2024 | bullish trending low vol | 33 | +5.28 | 1.63 | 24 | 9 | 72.7 | -75.47 | 5h 49m |
| Oct 2024 | bullish choppy low vol | 38 | -3.39 | -0.93 | 15 | 23 | 39.5 | -75.61 | 16h 25m |
| Sep 2024 | bearish choppy low vol | 36 | +0.24 | 0.01 | 20 | 16 | 55.6 | -72.96 | 12h 40m |
| Aug 2024 | bearish choppy high vol | 43 | +7.86 | 1.85 | 36 | 7 | 83.7 | -80.12 | 8h 22m |
| Jul 2024 | bearish trending low vol | 56 | -2.86 | -0.55 | 25 | 31 | 44.6 | -80.46 | 8h 09m |
| Jun 2024 | bearish choppy low vol | 26 | -2.26 | -0.84 | 12 | 14 | 46.2 | -78.26 | 24h 55m |
| May 2024 | bullish choppy high vol | 40 | -3.69 | -0.96 | 18 | 22 | 45.0 | -75.16 | 13h 48m |
| Apr 2024 | bearish choppy high vol | 43 | -0.81 | -0.20 | 21 | 22 | 48.8 | -73.96 | 9h 29m |
| Mar 2024 | bullish trending high vol | 45 | +3.89 | 0.86 | 26 | 19 | 57.8 | -74.46 | 1h 36m |
| Feb 2024 | bullish trending low vol | 31 | -2.76 | -0.92 | 14 | 17 | 45.2 | -74.55 | 16h 15m |
| Jan 2024 | bearish choppy high vol | 51 | -1.87 | -0.40 | 24 | 27 | 47.1 | -71.79 | 8h 56m |
| Dec 2023 | bullish trending low vol | 46 | -5.98 | -1.32 | 15 | 31 | 32.6 | -69.91 | 12h 00m |
| Nov 2023 | bullish trending low vol | 25 | -2.14 | -0.85 | 10 | 15 | 40.0 | -64.61 | 6h 43m |
| Oct 2023 | bullish trending low vol | 57 | +2.56 | 0.46 | 38 | 19 | 66.7 | -65.02 | 17h 16m |
| Sep 2023 | bearish choppy low vol | 32 | -1.49 | -0.46 | 18 | 14 | 56.2 | -64.43 | 34h 30m |
| Aug 2023 | bearish choppy low vol | 27 | +1.18 | 0.44 | 18 | 9 | 66.7 | -64.5 | 20h 27m |
| Jul 2023 | bullish trending low vol | 52 | -7.98 | -1.56 | 18 | 34 | 34.6 | -64.02 | 16h 09m |
| Jun 2023 | bullish trending low vol | 47 | +0.98 | 0.21 | 28 | 19 | 59.6 | -58.0 | 14h 49m |
| May 2023 | bearish choppy low vol | 23 | -1.98 | -0.93 | 10 | 13 | 43.5 | -57.0 | 17h 44m |
| Apr 2023 | bullish trending low vol | 40 | +0.49 | 0.11 | 24 | 16 | 60.0 | -57.38 | 13h 48m |
| Mar 2023 | bullish trending high vol | 49 | +0.31 | 0.06 | 25 | 24 | 51.0 | -57.23 | 7h 50m |
| Feb 2023 | bullish trending low vol | 49 | +4.70 | 0.96 | 36 | 13 | 73.5 | -61.38 | 12h 15m |
| Jan 2023 | bullish trending low vol | 24 | -0.72 | -0.29 | 14 | 10 | 58.3 | -60.83 | 16h 00m |
| Dec 2022 | bearish trending low vol | 40 | -0.88 | -0.22 | 24 | 16 | 60.0 | -61.33 | 18h 00m |
| Nov 2022 | bearish trending high vol | 38 | -5.72 | -1.52 | 10 | 28 | 26.3 | -58.92 | 3h 47m |
| Oct 2022 | bullish choppy low vol | 45 | +3.99 | 0.92 | 34 | 11 | 75.6 | -58.34 | 18h 40m |
| Sep 2022 | bearish choppy high vol | 46 | -3.98 | -0.89 | 19 | 27 | 41.3 | -57.19 | 11h 29m |
| Aug 2022 | bullish choppy high vol | 29 | -2.79 | -1.01 | 9 | 20 | 31.0 | -53.2 | 3h 19m |
| Jul 2022 | bullish trending high vol | 59 | -0.95 | -0.17 | 28 | 31 | 47.5 | -54.42 | 5h 42m |
| Jun 2022 | bearish trending high vol | 31 | -1.14 | -0.35 | 12 | 19 | 38.7 | -51.61 | 1h 33m |
| May 2022 | bearish trending high vol | 11 | -1.95 | -1.80 | 2 | 9 | 18.2 | -48.3 | 2h 11m |
| Apr 2022 | bearish choppy high vol | 24 | +2.99 | 1.29 | 18 | 6 | 75.0 | -49.56 | 13h 00m |
| Mar 2022 | bullish choppy high vol | 51 | -5.67 | -1.15 | 17 | 34 | 33.3 | -49.73 | 8h 56m |
| Feb 2022 | bearish trending high vol | 48 | -5.17 | -1.11 | 16 | 32 | 33.3 | -43.67 | 4h 30m |
| Jan 2022 | bearish trending high vol | 33 | -0.50 | -0.17 | 14 | 19 | 42.4 | -40.23 | 1h 27m |
| Dec 2021 | bearish trending high vol | 34 | -4.31 | -1.25 | 11 | 23 | 32.4 | -37.99 | 7h 46m |
| Nov 2021 | bearish trending high vol | 36 | -3.60 | -0.98 | 12 | 24 | 33.3 | -33.77 | 2h 40m |
| Oct 2021 | bullish trending high vol | 45 | -5.87 | -1.23 | 14 | 31 | 31.1 | -30.37 | 5h 52m |
| Sep 2021 | bearish trending high vol | 47 | -4.28 | -0.98 | 17 | 30 | 36.2 | -24.58 | 4h 36m |
| Aug 2021 | bullish trending high vol | 12 | -1.45 | -1.22 | 4 | 8 | 33.3 | -19.89 | 8h 00m |
| Jul 2021 | bullish trending high vol | 59 | +2.77 | 0.47 | 33 | 26 | 55.9 | -22.09 | 3h 40m |
| Jun 2021 | bearish trending high vol | 26 | -1.38 | -0.48 | 10 | 16 | 38.5 | -22.78 | 1h 51m |
| May 2021 | bearish trending high vol | 42 | -8.43 | -2.10 | 6 | 36 | 14.3 | -19.84 | 0h 00m |
| Apr 2021 | bearish choppy high vol | 30 | -1.00 | -0.25 | 13 | 17 | 43.3 | -12.07 | 1h 36m |
| Mar 2021 | bullish choppy high vol | 36 | -6.55 | -1.90 | 7 | 29 | 19.4 | -10.39 | 4h 40m |
| Feb 2021 | bullish trending high vol | 18 | -1.33 | -0.76 | 6 | 12 | 33.3 | -4.46 | 0h 00m |
| Jan 2021 | bullish trending high vol | 17 | -2.71 | -1.61 | 4 | 13 | 23.5 | -2.89 | 2h 49m |
Yearly breakdown
| Year | Trades | Profit % | Avg % | Win | Loss | Win % | DD % | Avg dur |
|---|---|---|---|---|---|---|---|---|
| 2025 | 364 | -17.40 | -0.49 | 158 | 206 | 43.4 | -90.01 | 7h 55m |
| 2024 | 474 | -2.67 | -0.07 | 247 | 227 | 52.1 | -80.46 | 10h 20m |
| 2023 | 471 | -10.07 | -0.22 | 254 | 217 | 53.9 | -69.91 | 15h 20m |
| 2022 | 455 | -21.77 | -0.49 | 203 | 252 | 44.6 | -61.33 | 8h 17m |
| 2021 | 402 | -38.14 | -0.95 | 137 | 265 | 34.1 | -37.99 | 3h 39m |
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
1 potential lookahead pattern(s) found
| Line | Pattern | Detail | |
|---|---|---|---|
| 141 | leak | whole_series_reduction | .max() over the whole column sees future rows (use .rolling(window).max() for a causal value) |
ran by Ron · took s
Lookahead analysis
freqtrade lookahead-analysis: detects strategies peeking at future candles.