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 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 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 | """ ICT Smart Money Strategy — Freqtrade Implementation Rules: 1. MACRO TIME MATTERS — Trade only during high-reactivity windows 2. WAIT FOR STOP-HUNT — Liquidity sweep before entry 3. USE IFVG OR BREAKER ENTRY — IFVG = first, Breaker Block = second 4. TRADE ONLY PREMIUM/DISCOUNT ZONES — Sell premium, Buy discount 5. FOCUS ON 1-2 QUALITY TRADES — Clean 1:2 RR setups """ from freqtrade.strategy import IStrategy, IntParameter, DecimalParameter from pandas import DataFrame import talib.abstract as ta import numpy as np class ICTSmartMoneyStrategy(IStrategy): """ ICT Smart Money Concepts Strategy Combines: - Fair Value Gaps (FVG) detection - Breaker Block detection - Liquidity sweep / stop-hunt detection - Premium/Discount zone filtering - Macro time filtering (London/NY killzones) """ INTERFACE_VERSION = 3 timeframe = '15m' can_short = True # 1:2 Risk-Reward minimum minimal_roi = { "0": 0.06, # 6% immediate target (1:2 from 3% SL) "120": 0.04, # After 2 hours, accept 4% "240": 0.02, # After 4 hours, accept 2% "480": 0.01, # After 8 hours, accept 1% } stoploss = -0.03 # 3% stop loss (for 1:2 RR with 6% target) trailing_stop = True trailing_stop_positive = 0.015 trailing_stop_positive_offset = 0.035 trailing_only_offset_is_reached = True process_only_new_candles = True startup_candle_count: int = 100 # ── Parameters ────────────────────────────────────────────────────── # FVG detection fvg_lookback = IntParameter(3, 10, default=5, space="buy") fvg_min_size_pct = DecimalParameter(0.001, 0.01, default=0.003, decimals=3, space="buy") # Liquidity sweep detection swing_lookback = IntParameter(10, 30, default=20, space="buy") # Premium/Discount zone pd_lookback = IntParameter(30, 100, default=50, space="buy") # Volume confirmation vol_mult = DecimalParameter(1.0, 3.0, default=1.5, decimals=1, space="buy") # ── Macro Time Windows (UTC) ──────────────────────────────────────── # London Open Killzone: 07:00-10:00 UTC # NY Open Killzone: 12:30-15:00 UTC # London Close: 15:00-16:00 UTC LONDON_KZ = [7, 8, 9, 10] NY_KZ = [12, 13, 14, 15] LONDON_CLOSE = [16] # All allowed hours ALLOWED_HOURS = LONDON_KZ + NY_KZ + LONDON_CLOSE def populate_indicators(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """Calculate ICT/SMC indicators""" # ── Basic indicators ──────────────────────────────────────────── dataframe['atr'] = ta.ATR(dataframe, timeperiod=14) dataframe['rsi'] = ta.RSI(dataframe, timeperiod=14) dataframe['volume_mean'] = dataframe['volume'].rolling(20).mean() # ── Swing Highs/Lows (for liquidity levels) ──────────────────── lb = self.swing_lookback.value dataframe['swing_high'] = dataframe['high'].rolling(lb*2+1, center=True).max() dataframe['swing_low'] = dataframe['low'].rolling(lb*2+1, center=True).min() # Swing high/low at specific candles (not rolling window) dataframe['is_swing_high'] = ( (dataframe['high'] == dataframe['high'].rolling(lb*2+1, center=True).max()) & (dataframe['high'].shift(1) < dataframe['high']) & (dataframe['high'].shift(-1) < dataframe['high']) ) dataframe['is_swing_low'] = ( (dataframe['low'] == dataframe['low'].rolling(lb*2+1, center=True).min()) & (dataframe['low'].shift(1) > dataframe['low']) & (dataframe['low'].shift(-1) > dataframe['low']) ) # Track recent swing levels dataframe['last_swing_high'] = np.nan dataframe['last_swing_low'] = np.nan for i in range(len(dataframe)): if dataframe['is_swing_high'].iloc[i]: dataframe.loc[dataframe.index[i], 'last_swing_high'] = dataframe['high'].iloc[i] if dataframe['is_swing_low'].iloc[i]: dataframe.loc[dataframe.index[i], 'last_swing_low'] = dataframe['low'].iloc[i] dataframe['last_swing_high'] = dataframe['last_swing_high'].ffill() dataframe['last_swing_low'] = dataframe['last_swing_low'].ffill() # ── Fair Value Gap (FVG) Detection ────────────────────────────── # Bullish FVG: candle[i-1].high < candle[i+1].low (gap up) # Bearish FVG: candle[i-1].low > candle[i+1].high (gap down) dataframe['fvg_bullish'] = ( (dataframe['low'].shift(-1) > dataframe['high'].shift(1)) & ((dataframe['low'].shift(-1) - dataframe['high'].shift(1)) / dataframe['close'] > self.fvg_min_size_pct.value) ) dataframe['fvg_bearish'] = ( (dataframe['high'].shift(-1) < dataframe['low'].shift(1)) & ((dataframe['low'].shift(1) - dataframe['high'].shift(-1)) / dataframe['close'] > self.fvg_min_size_pct.value) ) # FVG midpoint (inversion level) dataframe['fvg_bull_mid'] = np.where( dataframe['fvg_bullish'], (dataframe['low'].shift(-1) + dataframe['high'].shift(1)) / 2, np.nan ) dataframe['fvg_bear_mid'] = np.where( dataframe['fvg_bearish'], (dataframe['low'].shift(1) + dataframe['high'].shift(-1)) / 2, np.nan ) dataframe['fvg_bull_mid'] = dataframe['fvg_bull_mid'].ffill() dataframe['fvg_bear_mid'] = dataframe['fvg_bear_mid'].ffill() # ── Breaker Block Detection ───────────────────────────────────── # Breaker = failed FVG that gets reclaimed # Bullish breaker: bearish candle that caused break below, then price reclaims dataframe['breaker_bull'] = ( (dataframe['close'] > dataframe['open']) & # Current bullish (dataframe['close'].shift(1) < dataframe['open'].shift(1)) & # Previous bearish (dataframe['low'] < dataframe['low'].shift(1)) & # Swept previous low (dataframe['close'] > dataframe['high'].shift(1)) & # Closed above previous high (dataframe['volume'] > dataframe['volume_mean'] * self.vol_mult.value) # Volume confirm ) dataframe['breaker_bear'] = ( (dataframe['close'] < dataframe['open']) & # Current bearish (dataframe['close'].shift(1) > dataframe['open'].shift(1)) & # Previous bullish (dataframe['high'] > dataframe['high'].shift(1)) & # Swept previous high (dataframe['close'] < dataframe['low'].shift(1)) & # Closed below previous low (dataframe['volume'] > dataframe['volume_mean'] * self.vol_mult.value) # Volume confirm ) # ── Liquidity Sweep / Stop Hunt Detection ─────────────────────── # Sweep = price takes out swing high/low then reverses dataframe['sweep_high'] = ( (dataframe['high'] > dataframe['last_swing_high'].shift(1)) & # Took out swing high (dataframe['close'] < dataframe['last_swing_high'].shift(1)) & # But closed below (rejection) (dataframe['close'] < dataframe['open']) # Bearish candle ) dataframe['sweep_low'] = ( (dataframe['low'] < dataframe['last_swing_low'].shift(1)) & # Took out swing low (dataframe['close'] > dataframe['last_swing_low'].shift(1)) & # But closed above (rejection) (dataframe['close'] > dataframe['open']) # Bullish candle ) # ── Premium/Discount Zone ─────────────────────────────────────── pd_lb = self.pd_lookback.value range_high = dataframe['high'].rolling(pd_lb).max() range_low = dataframe['low'].rolling(pd_lb).min() range_mid = (range_high + range_low) / 2 dataframe['range_mid'] = range_mid dataframe['range_high'] = range_high dataframe['range_low'] = range_low # Premium = above midpoint, Discount = below midpoint dataframe['in_premium'] = dataframe['close'] > range_mid dataframe['in_discount'] = dataframe['close'] < range_mid # Equilibrium zone (near midpoint ± 10% of range) range_size = range_high - range_low dataframe['in_equilibrium'] = ( (dataframe['close'] > range_mid - range_size * 0.1) & (dataframe['close'] < range_mid + range_size * 0.1) ) # ── Macro Time Filter ─────────────────────────────────────────── dataframe['hour'] = dataframe['date'].dt.hour dataframe['macro_time'] = dataframe['hour'].isin(self.ALLOWED_HOURS) # Enhanced: weight by killzone importance dataframe['in_london_kz'] = dataframe['hour'].isin(self.LONDON_KZ) dataframe['in_ny_kz'] = dataframe['hour'].isin(self.NY_KZ) dataframe['in_killzone'] = dataframe['in_london_kz'] | dataframe['in_ny_kz'] return dataframe def populate_entry_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Entry Logic: LONG (Discount zone): 1. Stop hunt / sweep low → IFVG entry OR 2. Breaker block bullish in discount zone 3. Must be in macro time window 4. Volume confirmation SHORT (Premium zone): 1. Stop hunt / sweep high → IFVG entry OR 2. Breaker block bearish in premium zone 3. Must be in macro time window 4. Volume confirmation """ # ── LONG Entry ────────────────────────────────────────────────── # Condition 1: Sweep low + FVG bullish (IFVG entry) long_sweep_ifvg = ( dataframe['sweep_low'] & (dataframe['close'] > dataframe['fvg_bull_mid']) & (dataframe['close'] < dataframe['range_mid']) # In discount zone ) # Condition 2: Breaker block bullish in discount long_breaker = ( dataframe['breaker_bull'] & (dataframe['close'] < dataframe['range_mid']) # In discount zone ) # Condition 3: FVG bullish touch in discount zone long_fvg_touch = ( (dataframe['low'] <= dataframe['fvg_bull_mid'] * 1.005) & # Price touched FVG (dataframe['low'] >= dataframe['fvg_bull_mid'] * 0.995) & (dataframe['close'] > dataframe['open']) & # Bullish candle (dataframe['close'] < dataframe['range_mid']) & # Discount zone (dataframe['volume'] > dataframe['volume_mean'] * self.vol_mult.value) ) # Combined long conditions long_entry = ( (long_sweep_ifvg | long_breaker | long_fvg_touch) & dataframe['macro_time'] & (dataframe['volume'] > 0) ) dataframe.loc[long_entry, 'enter_long'] = 1 # ── SHORT Entry ───────────────────────────────────────────────── # Condition 1: Sweep high + FVG bearish (IFVG entry) short_sweep_ifvg = ( dataframe['sweep_high'] & (dataframe['close'] < dataframe['fvg_bear_mid']) & (dataframe['close'] > dataframe['range_mid']) # In premium zone ) # Condition 2: Breaker block bearish in premium short_breaker = ( dataframe['breaker_bear'] & (dataframe['close'] > dataframe['range_mid']) # In premium zone ) # Condition 3: FVG bearish touch in premium zone short_fvg_touch = ( (dataframe['high'] >= dataframe['fvg_bear_mid'] * 0.995) & # Price touched FVG (dataframe['high'] <= dataframe['fvg_bear_mid'] * 1.005) & (dataframe['close'] < dataframe['open']) & # Bearish candle (dataframe['close'] > dataframe['range_mid']) & # Premium zone (dataframe['volume'] > dataframe['volume_mean'] * self.vol_mult.value) ) # Combined short conditions short_entry = ( (short_sweep_ifvg | short_breaker | short_fvg_touch) & dataframe['macro_time'] & (dataframe['volume'] > 0) ) dataframe.loc[short_entry, 'enter_short'] = 1 return dataframe def populate_exit_trend(self, dataframe: DataFrame, metadata: dict) -> DataFrame: """ Exit Logic: - Take profit at 1:2 RR (handled by ROI) - Exit on opposite zone breach - Exit on structure break """ # LONG exit: price enters premium zone + bearish signal dataframe.loc[ ( (dataframe['close'] > dataframe['range_mid']) & # Now in premium ( dataframe['sweep_high'] | # Sweep high rejection dataframe['breaker_bear'] | # Breaker bearish ((dataframe['rsi'] > 70) & (dataframe['close'] < dataframe['open'])) # RSI overbought + bearish ) ), 'exit_long' ] = 1 # SHORT exit: price enters discount zone + bullish signal dataframe.loc[ ( (dataframe['close'] < dataframe['range_mid']) & # Now in discount ( dataframe['sweep_low'] | # Sweep low rejection dataframe['breaker_bull'] | # Breaker bullish ((dataframe['rsi'] < 30) & (dataframe['close'] > dataframe['open'])) # RSI oversold + bullish ) ), 'exit_short' ] = 1 return dataframe |
Strategy League — fixed backtest that feeds the ranking
Export report Freqtrade logsRun finished · took 368.0s
ℹ️ 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 (-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 |
|---|---|---|---|---|---|---|---|---|---|
| Apr 2022 | bearish choppy high vol | 20 | -2.73 | -1.42 | 6 | 14 | 30.0 | -90.15 | 8h 34m |
| Mar 2022 | bullish choppy high vol | 46 | -1.74 | -0.37 | 27 | 19 | 58.7 | -87.42 | 9h 09m |
| Feb 2022 | bearish trending high vol | 45 | -2.25 | -0.52 | 24 | 21 | 53.3 | -85.94 | 7h 23m |
| Jan 2022 | bearish trending high vol | 52 | +1.01 | 0.17 | 33 | 19 | 63.5 | -85.67 | 6h 56m |
| Dec 2021 | bearish trending high vol | 49 | -2.57 | -0.52 | 27 | 22 | 55.1 | -84.63 | 7h 17m |
| Nov 2021 | bearish trending high vol | 79 | -4.35 | -0.52 | 44 | 35 | 55.7 | -81.84 | 7h 24m |
| Oct 2021 | bullish trending high vol | 106 | -0.79 | -0.06 | 65 | 41 | 61.3 | -78.83 | 6h 35m |
| Sep 2021 | bearish trending high vol | 78 | -3.16 | -0.40 | 40 | 38 | 51.3 | -77.79 | 7h 52m |
| Aug 2021 | bullish trending high vol | 108 | -1.55 | -0.13 | 65 | 43 | 60.2 | -76.36 | 5h 36m |
| Jul 2021 | bullish trending high vol | 93 | -1.24 | -0.13 | 56 | 37 | 60.2 | -74.32 | 7h 33m |
| Jun 2021 | bearish trending high vol | 141 | -8.21 | -0.61 | 67 | 74 | 47.5 | -70.91 | 5h 04m |
| May 2021 | bearish trending high vol | 205 | -19.48 | -0.97 | 80 | 125 | 39.0 | -62.5 | 3h 13m |
| Apr 2021 | bearish choppy high vol | 211 | -5.55 | -0.29 | 111 | 100 | 52.6 | -43.54 | 4h 36m |
| Mar 2021 | bullish choppy high vol | 213 | -2.55 | -0.11 | 128 | 85 | 60.1 | -41.08 | 5h 58m |
| Feb 2021 | bullish trending high vol | 171 | -7.33 | -0.43 | 79 | 92 | 46.2 | -35.24 | 3h 09m |
| Jan 2021 | bullish trending high vol | 280 | -27.66 | -1.00 | 106 | 174 | 37.9 | -27.66 | 3h 12m |
Yearly breakdown
| Year | Trades | Profit % | Avg % | Win | Loss | Win % | DD % | Avg dur |
|---|---|---|---|---|---|---|---|---|
| 2022 | 163 | -5.71 | -0.37 | 90 | 73 | 55.2 | -90.15 | 7h 53m |
| 2021 | 1734 | -84.44 | -0.49 | 868 | 866 | 50.1 | -84.63 | 4h 58m |
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
12 potential lookahead pattern(s) found · 2 to review
| Line | Pattern | Detail | |
|---|---|---|---|
| 106 | review | slow_loop | a `for i in range(len(...))` pass over the dataframe runs in Python for every candle of every pair. Vectorise it, or the run is likely to hit the sandbox timeout before producing a result |
| 88 | leak | center_rolling | rolling(center=True) window includes future values |
| 89 | |||
| 95 | leak | negative_shift | shift() with negative periods reads future candles |
| 100 | |||
| 119 | |||
| 123 | |||
| 130 | |||
| 135 | |||
| 120 | |||
| 124 | |||
| 93 | leak | center_rolling | rolling(center=True) window includes future values |
| 98 | |||
| 49 | review | startup_candles_too_small | startup_candle_count is 100, but ATR(timeperiod=14) needing 8x warmup needs at least 112 candles -- so the first 12+ 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.