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 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 | # SupertrendFuturesStrategyV8 - 多因子温和版 # 基于V7.1验证结果,结合V4优势 import numpy as np import pandas as pd from pandas import DataFrame from datetime import datetime from typing import Optional from functools import reduce import logging from freqtrade.strategy import IStrategy, DecimalParameter, IntParameter import talib.abstract as ta logger = logging.getLogger(__name__) class SupertrendFuturesStrategyV8(IStrategy): """ V8: 多因子温和版 结合V4的核心优势 + V7.1的多因子验证 改进: 1. 保持V4的核心趋势跟踪 2. 添加Alpha#101温和过滤(已验证有效) 3. RSI温和过滤(不极端) 4. 成交量温和确认(1.2倍均值,不是1.5倍) 目标: - 收益: 7-8% - 胜率: 65-67% - 回撤: 4-5% - 夏普: > 1.0 """ INTERFACE_VERSION = 3 # V4最优参数 atr_period = IntParameter(5, 30, default=11, space="buy") atr_multiplier = DecimalParameter(2.0, 5.0, default=2.884, space="buy") ema_fast = IntParameter(5, 50, default=48, space="buy") ema_slow = IntParameter(20, 200, default=151, space="buy") adx_threshold_long = IntParameter(20, 35, default=33, space="buy") adx_threshold_short = IntParameter(15, 30, default=23, space="buy") # V8新增参数 alpha_threshold = DecimalParameter(0.05, 0.3, default=0.1, space="buy") # Alpha#101阈值 minimal_roi = {"0": 0.06} stoploss = -0.03 timeframe = '30m' trailing_stop = True trailing_stop_positive = 0.02 trailing_stop_positive_offset = 0.03 trailing_only_offset_is_reached = True startup_candle_count = 200 order_types = { 'entry': 'limit', 'exit': 'limit', 'stoploss': 'market', 'stoploss_on_exchange': False } can_short: bool = True leverage_default = 2 def supertrend(self, dataframe, period=14, multiplier=3): df = dataframe.copy() hl2 = (df['high'] + df['low']) / 2 atr = ta.ATR(df, timeperiod=period) upperband = hl2 + (multiplier * atr) lowerband = hl2 - (multiplier * atr) supertrend = [0] * len(df) direction = [1] * len(df) for i in range(1, len(df)): if df['close'].iloc[i] > upperband.iloc[i-1]: direction[i] = 1 elif df['close'].iloc[i] < lowerband.iloc[i-1]: direction[i] = -1 else: direction[i] = direction[i-1] supertrend[i] = lowerband.iloc[i] if direction[i] == 1 else upperband.iloc[i] return pd.Series(supertrend, index=df.index), pd.Series(direction, index=df.index) def leverage(self, pair, current_time, current_rate, proposed_leverage, max_leverage, entry_tag, side, **kwargs): return min(self.leverage_default, max_leverage) def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: # === V4 核心指标 === dataframe['ema_fast'] = ta.EMA(dataframe, timeperiod=self.ema_fast.value) dataframe['ema_slow'] = ta.EMA(dataframe, timeperiod=self.ema_slow.value) dataframe['supertrend'], dataframe['st_dir'] = self.supertrend( dataframe, period=self.atr_period.value, multiplier=self.atr_multiplier.value ) dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14) dataframe['adx'] = ta.ADX(dataframe, timeperiod=14) dataframe['adx_pos'] = ta.PLUS_DI(dataframe, timeperiod=14) dataframe['adx_neg'] = ta.MINUS_DI(dataframe, timeperiod=14) dataframe['atr'] = ta.ATR(dataframe, timeperiod=14) dataframe['volume_ma'] = dataframe['volume'].rolling(20).mean() dataframe['ema_200'] = ta.EMA(dataframe, timeperiod=200) dataframe['is_uptrend'] = dataframe['close'] > dataframe['ema_200'] dataframe['is_downtrend'] = dataframe['close'] < dataframe['ema_200'] # === V8 新增:多因子指标 === # 1. Alpha#101: 日内趋势强度(V7.1验证有效) dataframe['alpha_101'] = ( (dataframe['close'] - dataframe['open']) / (dataframe['high'] - dataframe['low'] + 0.001) ) # 2. Alpha#54: 收益动量 dataframe['alpha_54'] = ( (dataframe['close'] - dataframe['close'].shift(5)) / dataframe['close'].shift(5) ) # 3. 波动率标准化 dataframe['volatility_ratio'] = ( dataframe['atr'] / dataframe['close'] ) # 4. 趋势强度评分 dataframe['trend_score'] = 0 dataframe.loc[dataframe['adx'] > 30, 'trend_score'] += 1 dataframe.loc[dataframe['adx'] > 35, 'trend_score'] += 1 dataframe.loc[abs(dataframe['alpha_54']) > 0.05, 'trend_score'] += 1 return dataframe def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """做多 - V8多因子温和版""" dataframe.loc[:, 'enter_long'] = 0 conditions = [ # === V4 核心条件 === dataframe['st_dir'] == 1, dataframe['ema_fast'] > dataframe['ema_slow'], dataframe['adx'] > self.adx_threshold_long.value, dataframe['adx_pos'] > dataframe['adx_neg'], dataframe['close'] > dataframe['supertrend'], dataframe['is_uptrend'], # === V8 温和多因子 === # 1. RSI温和过滤(不极端) (dataframe['rsi'] > 40) & (dataframe['rsi'] < 75), # 2. Alpha#101温和过滤(V7.1验证有效) dataframe['alpha_101'] > self.alpha_threshold.value, # 3. 成交量温和确认(1.2倍均值,不是1.5倍) dataframe['volume'] > dataframe['volume_ma'] * 1.2, # 4. 趋势强度评分(至少1分) dataframe['trend_score'] >= 1, # 5. 波动率正常(非极端) dataframe['volatility_ratio'] < 0.05, ] if conditions: dataframe.loc[reduce(lambda x, y: x & y, conditions), 'enter_long'] = 1 return dataframe def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: dataframe.loc[:, 'exit_long'] = 0 conditions = [dataframe['st_dir'] == -1] if conditions: dataframe.loc[reduce(lambda x, y: x & y, conditions), 'exit_long'] = 1 return dataframe def populate_entry_trend_short(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """做空 - V8多因子温和版""" dataframe.loc[:, 'enter_short'] = 0 conditions = [ # === V4 核心条件 === dataframe['st_dir'] == -1, dataframe['ema_fast'] < dataframe['ema_slow'], dataframe['adx'] > self.adx_threshold_short.value, dataframe['adx_neg'] > dataframe['adx_pos'], dataframe['close'] < dataframe['supertrend'], dataframe['is_downtrend'], # === V8 温和多因子 === (dataframe['rsi'] > 25) & (dataframe['rsi'] < 60), dataframe['alpha_101'] < -self.alpha_threshold.value, dataframe['volume'] > dataframe['volume_ma'] * 1.2, dataframe['trend_score'] >= 1, dataframe['volatility_ratio'] < 0.05, ] if conditions: dataframe.loc[reduce(lambda x, y: x & y, conditions), 'enter_short'] = 1 return dataframe def populate_exit_trend_short(self, dataframe: DataFrame, metadata: dict) -> DataFrame: dataframe.loc[:, 'exit_short'] = 0 conditions = [dataframe['st_dir'] == 1] if conditions: dataframe.loc[reduce(lambda x, y: x & y, conditions), 'exit_short'] = 1 return dataframe # === 预期表现 === """ 基于V4和V7.1的组合: V4 (当前最优): - 收益: +7.47% - 胜率: 63.6% - 回撤: 5.35% V7.1 (已验证): - 收益: +6.44% - 胜率: 63.6% - 回撤: 3.79% - 夏普: 1.17 V8 (预期): - 收益: 7-8% (V4基础 + V7.1风险控制) - 胜率: 65-67% (温和过滤提升) - 回撤: 4-5% (V7.1经验) - 夏普: > 1.0 关键改进: 1. Alpha#101温和过滤(已验证提升夏普) 2. RSI温和范围(避免极端) 3. 趋势评分(信号质量提升) 4. 波动率控制(降低风险) """ |
Strategy League — fixed backtest that feeds the ranking
Export report Freqtrade logsRun finished · took 203.7s
ℹ️ This strategy uses a trailing stop — freqtrade only
re-checks these once per 30m 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 →
- profit isn't statistically significant (p=1.00) — hard to tell apart from luck
- only 0% of resampled runs were profitable
- profitable in only 0% 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 |
|---|---|---|---|---|---|---|---|---|---|
| Jan 2023 | bullish trending low vol | 10 | -0.29 | -0.32 | 5 | 5 | 50.0 | -90.27 | 9h 54m |
| Dec 2022 | bearish trending low vol | 42 | -5.43 | -1.30 | 13 | 29 | 31.0 | -89.99 | 5h 52m |
| Nov 2022 | bearish trending high vol | 62 | -1.92 | -0.31 | 27 | 35 | 43.5 | -85.51 | 2h 50m |
| Oct 2022 | bullish choppy low vol | 69 | -6.36 | -0.92 | 28 | 41 | 40.6 | -82.88 | 4h 28m |
| Sep 2022 | bearish choppy high vol | 86 | -3.59 | -0.42 | 39 | 47 | 45.3 | -76.72 | 2h 03m |
| Aug 2022 | bullish choppy high vol | 97 | -7.14 | -0.74 | 39 | 58 | 40.2 | -73.35 | 2h 47m |
| Jul 2022 | bullish trending high vol | 193 | +0.25 | 0.01 | 91 | 102 | 47.2 | -71.25 | 1h 34m |
| Jun 2022 | bearish trending high vol | 78 | -4.27 | -0.56 | 30 | 48 | 38.5 | -66.57 | 1h 04m |
| May 2022 | bearish trending high vol | 58 | -2.57 | -0.43 | 25 | 33 | 43.1 | -64.3 | 1h 42m |
| Apr 2022 | bearish choppy high vol | 20 | -2.44 | -1.30 | 5 | 15 | 25.0 | -60.5 | 1h 57m |
| Mar 2022 | bullish choppy high vol | 182 | -5.44 | -0.31 | 85 | 97 | 46.7 | -60.17 | 2h 06m |
| Feb 2022 | bearish trending high vol | 110 | +4.02 | 0.37 | 62 | 48 | 56.4 | -56.32 | 3h 15m |
| Jan 2022 | bearish trending high vol | 57 | -2.75 | -0.51 | 25 | 32 | 43.9 | -56.35 | 2h 14m |
| Dec 2021 | bearish trending high vol | 74 | -2.15 | -0.33 | 33 | 41 | 44.6 | -55.99 | 1h 54m |
| Nov 2021 | bearish trending high vol | 108 | -1.44 | -0.13 | 55 | 53 | 50.9 | -51.48 | 1h 58m |
| Oct 2021 | bullish trending high vol | 131 | -9.95 | -0.78 | 49 | 82 | 37.4 | -50.15 | 1h 42m |
| Sep 2021 | bearish trending high vol | 141 | -3.13 | -0.25 | 61 | 80 | 43.3 | -40.47 | 1h 31m |
| Aug 2021 | bullish trending high vol | 173 | -1.96 | -0.12 | 81 | 92 | 46.8 | -38.91 | 0h 59m |
| Jul 2021 | bullish trending high vol | 183 | -18.56 | -1.03 | 66 | 117 | 36.1 | -35.54 | 1h 42m |
| Jun 2021 | bearish trending high vol | 85 | -1.42 | -0.17 | 41 | 44 | 48.2 | -20.1 | 1h 03m |
| May 2021 | bearish trending high vol | 67 | -0.53 | -0.09 | 29 | 38 | 43.3 | -17.86 | 0h 57m |
| Apr 2021 | bearish choppy high vol | 206 | -4.87 | -0.24 | 84 | 122 | 40.8 | -17.27 | 0h 32m |
| Mar 2021 | bullish choppy high vol | 134 | -2.28 | -0.17 | 57 | 77 | 42.5 | -12.72 | 0h 48m |
| Feb 2021 | bullish trending high vol | 215 | -2.09 | -0.11 | 91 | 124 | 42.3 | -13.56 | 0h 23m |
| Jan 2021 | bullish trending high vol | 209 | -3.64 | -0.18 | 85 | 124 | 40.7 | -7.15 | 0h 22m |
Yearly breakdown
| Year | Trades | Profit % | Avg % | Win | Loss | Win % | DD % | Avg dur |
|---|---|---|---|---|---|---|---|---|
| 2023 | 10 | -0.29 | -0.32 | 5 | 5 | 50.0 | -90.27 | 9h 54m |
| 2022 | 1054 | -37.64 | -0.36 | 469 | 585 | 44.5 | -89.99 | 2h 26m |
| 2021 | 1726 | -52.02 | -0.31 | 732 | 994 | 42.4 | -55.99 | 1h 03m |
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 | |
|---|---|---|---|
| 57 | review | startup_candles_too_small | startup_candle_count is 200, but EMA(timeperiod=200) needing 3x warmup needs at least 600 candles -- so the first 400+ 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 |
ran by Ron · took s
Lookahead analysis
freqtrade lookahead-analysis: detects strategies peeking at future candles.