The best part about quantitative trading is that you do not have to rely on any guru’s “trust me bro” course. You simply grab historical data, run it through a Python engine, and let the raw math strip away the marketing hype.

Today, we are diving into the biggest narrative battle in the modern trading space: ICT (Inner Circle Trader) Smart Money Concepts (SMC) vs. Classic Price Action.

The Genealogy: One Market Phenomenon, Three Generations

Before looking at the data, you must understand the lineage. When a key support or resistance level breaks and instantly reverses, it isn’t “new.” Three eras of trading legends looked at the exact same price action and gave it different names.

EraConcept NameTrading LegendNarrative
1930sThe Spring / UpthrustRichard Wyckoff”Composite Man” traps retail to absorb liquidity.
2000sFailed Breakout (F2)Al Brooks80% of breakouts fail; focus on trap mechanics.
2020sLiquidity SweepICT (SMC)Algorithms target stop-loss clusters to engineer liquidity.

Behind the Code: Translating Lore into Python

To keep this research objective, we mapped these trading schools into mathematical conditions using a systematic Python framework.

1. The Core Trap Logic (Wyckoff & Brooks)

We established a rolling 20-period high-low boundary. A raw trap triggers when the asset’s lowest price pierces below historical support, but bulls claw the price back to close inside the range.

# Defining structural support
df['Support'] = df['Low'].rolling(window=20).min().shift(1)

# The basic trap condition
if df['Low'].iloc[i] < df['Support'].iloc[i]:
    if df['Close'].iloc[i] > df['Support'].iloc[i]:
        df.at[df.index[i], 'Signal'] = 1

2. Injecting the Wyckoffian Volume Filter

A true Wyckoff Spring cannot happen on low volume. There must be a surge showing that large block orders are actively absorbing selling pressure.

# Volume Filter: 20% higher than 20-period moving average
df['Volume_MA'] = df['Volume'].rolling(window=20).mean().shift(1)
high_volume = df['Volume'].iloc[i] > (df['Volume_MA'].iloc[i] * 1.2)

if was_trap and high_volume:
    df.at[df.index[i], 'Confirmed_Spring'] = 1

3. Mathematical Definition of an ICT Fair Value Gap (FVG)

The “holy grail” of SMC is the FVG caused by displacement. Mathematically, it’s an absolute price imbalance where Bar 3’s Low is higher than Bar 1’s High.

# Bullish FVG: Bar 3 Low is higher than Bar 1 High
bar_1 = df.iloc[i - 2]
bar_3 = df.iloc[i]

if bar_3['Low'] > bar_1['High']:
    fvg_top = bar_3['Low']
    fvg_bottom = bar_1['High']

Algorithmic Benchmarking: Math vs. Hype

We converted these narratives into definitions and ran them through a backtesting engine on BTC-USD (1:2 Risk-to-Reward ratio).

Evolution StageStrategy ModelTotal TradesWin RateNet Return (R)
Stage 1Raw Breakout Trap18334.97%+9.00R
Stage 2Wyckoff (Sweep + Volume)10040.00%+20.00R
Stage 3Al Brooks (F2 + Volume)4548.89%+21.00R
Stage 4Pure ICT (Sweep + FVG)3132.26%-1.00R

Data Breakdown: Why the Pure ICT Model Failed

Our backtest revealed three structural flaws in the “SMC” approach:

  1. The Exhaustion Trap: ICT’s “displacement” (massive candles) is often a climactic exhaustion move. By the time the FVG forms, you are mathematically buying the local top.
  2. The Return-to-FVG Lag: The requirement for price to retrace to an FVG causes structural lag, destroying the momentum edge.
  3. Over-Filtering: Stacking too many hyper-specific visual patterns (Sweep + Displacement + FVG) leads to over-optimization on random statistical noise.

The Mathematical Winner: The Hybrid Model

The standout alpha-generator was a system combining Wyckoff’s volume confirmation with Al Brooks’ Failed Second Attempt (F2) rule.

  • It reduced noise.
  • It yielded a 48.89% win rate.
  • On a 1:2 RR, this represents an institutional-grade edge.

How to Use This Repository

Clone the Repo:

git clone https://github.com/aktanoli/liquidity-sweep.git

Install Dependencies:

pip install pandas numpy backtrader matplotlib

Run the Backtest:

python main.py --symbol BTC-USD --strategy hybrid

Conclusion

ICT did not invent a new way to read price. He engineered a brilliant marketing campaign. Renaming “Springs” to “Liquidity Sweeps” doesn’t change the underlying mechanics of order books. If you want a real edge: Stop chasing gurus and start testing data. Disclaimer: Trading involves risk. These results are based on historical data and do not guarantee future performance.