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 | # Bollinger Bands 突破策略 # 原理:价格触及下轨买入,触及上轨卖出 # 适合:波动率变化的市场 from freqtrade.strategy import IStrategy, IntParameter, DecimalParameter from pandas import DataFrame import talib.abstract as ta from functools import reduce class BollingerBandsStrategy(IStrategy): INTERFACE_VERSION = 3 # 可优化参数 bb_period = IntParameter(15, 25, default=20, space="buy", optimize=True) bb_std = DecimalParameter(1.5, 2.5, default=2.0, space="buy", optimize=True) # 止盈止损 minimal_roi = {"0": 0.08} stoploss = -0.05 timeframe = '15m' trailing_stop = True trailing_stop_positive = 0.03 trailing_stop_positive_offset = 0.04 trailing_only_offset_is_reached = True startup_candle_count = 100 order_types = { 'entry': 'limit', 'exit': 'limit', 'stoploss': 'market', 'stoploss_on_exchange': False } def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: bollinger = ta.BBANDS(dataframe, timeperiod=self.bb_period.value, nbdevup=self.bb_std.value, nbdevdn=self.bb_std.value) dataframe['bb_lower'] = bollinger['lowerband'] dataframe['bb_middle'] = bollinger['middleband'] dataframe['bb_upper'] = bollinger['upperband'] dataframe['bb_width'] = (dataframe['bb_upper'] - dataframe['bb_lower']) / dataframe['bb_middle'] return dataframe def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: dataframe.loc[:, 'enter_long'] = 0 conditions = [ # 价格触及下轨 dataframe['close'] < dataframe['bb_lower'], # 带宽足够(非极端收敛) dataframe['bb_width'] > 0.02, ] 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['close'] > dataframe['bb_upper'], ] if conditions: dataframe.loc[reduce(lambda x, y: x & y, conditions), 'exit_long'] = 1 return dataframe |
Strategy League — fixed backtest that feeds the ranking
Export report Freqtrade logsRun finished · took 114.2s
ℹ️ This strategy uses a trailing stop — freqtrade only
re-checks these once per 15m 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 (-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 |
|---|---|---|---|---|---|---|---|---|---|
| May 2021 | bearish trending high vol | 74 | -10.21 | -1.38 | 37 | 37 | 50.0 | -90.8 | 5h 02m |
| Apr 2021 | bearish choppy high vol | 261 | -16.89 | -0.65 | 141 | 120 | 54.0 | -82.71 | 5h 12m |
| Mar 2021 | bullish choppy high vol | 223 | +0.72 | 0.03 | 148 | 75 | 66.4 | -71.13 | 7h 27m |
| Feb 2021 | bullish trending high vol | 761 | -43.65 | -0.57 | 435 | 326 | 57.2 | -71.7 | 4h 02m |
| Jan 2021 | bullish trending high vol | 785 | -20.14 | -0.26 | 481 | 304 | 61.3 | -36.82 | 4h 31m |
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.