Double Fractal Breakout Strategy
The double fractal breakout strategy is a quantitative trading strategy based on technical pattern recognition. It identifies potential trend reversals by detecting double bottom and double top fractal formations…

Overview
The double fractal breakout strategy is a quantitative trading strategy based on technical pattern recognition. It identifies potential trend reversals by detecting double bottom and double top fractal formations, and generates buy and sell signals when prices break out of these fractals.
Strategy Logic
The core idea behind this strategy lies in fractal theory. The emergence of M-shaped or W-shaped short term turning points suggests a possible reversal of the prevailing trend. Specifically, bottom or top fractals form when 5 consecutive bars create particular high/low combinations of relative greater/lower highs/lows. For example, a top fractal forms when the highest prices of the former 2 bars are above those of the latter 3 bars.
The strategy generates long and short signals when prices break below bottom fractals and above top fractals respectively, as such breakouts indicate a higher likelihood of trend reversal.
Advantages
The main advantage of this strategy is its ability to detect potential trend reversal points, which can be very useful for trend-following trading systems. Additionally, the double fractal pattern provides more reliable trading signals compared to strategies relying solely on single bar patterns.
Risks
The major risk is that fractal detection does not guarantee price reversals with full certainty. Sometimes prices may just be making short-term corrections without real trend changes. Incorrect signals can lead to unnecessary losses in such cases. To mitigate this risk, other indicators like trading volumes can be used to verify the validity of reversal signals.
Enhancement
Possible ways to enhance this strategy include:
Adding filters like volume to avoid false reversals.
Tuning parameters to detect larger-degree double fractals and capture big trend turns.
Incorporating moving stop loss to reduce losses from bad trades.
Conclusion
The double fractal breakout strategy identifies potential price reversals by detecting specific technical patterns. As a technical indicator-driven approach, it can effectively track short and medium-term trends in the market and provide respectable risk-reward outcomes. It is a reliable and practical trading system overall.
Source Pine Script
/*backtest
start: 2023-12-01 00:00:00
end: 2023-12-31 23:59:59
period: 1h
basePeriod: 15m
exchanges: [{"eid":"Futures_Binance","currency":"BTC_USDT"}]
*/
//@version=4
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © ceyhun
strategy("Fractal Breakout Strategy", overlay=true)
FUp = high[4] < high[2] and high[3] < high[2] and high[1] < high[2] and high < high[2] or
high[5] < high[2] and high[4] < high[2] and high[3] <= high[2] and
high[1] < high[2] and high < high[2] or
high[6] < high[2] and high[5] < high[2] and high[4] <= high[2] and
high[3] <= high[2] and high[1] < high[2] and high < high[2] or
high[7] < high[2] and high[6] < high[2] and high[5] <= high[2] and
high[4] <= high[2] and high[3] <= high[2] and high[1] < high[2] and
high < high[2] or
high[8] < high[2] and high[7] < high[2] and high[6] <= high[2] and
high[5] <= high[2] and high[4] <= high[2] and high[3] <= high[2] and
high[1] < high[2] and high < high[2]
FractalUp = valuewhen(FUp, high[2], 1)
plot(FractalUp, color=#0000FF,title="FractalUp")
FDown = low[4] > low[2] and low[3] > low[2] and low[1] > low[2] and low > low[2] or
low[5] > low[2] and low[4] > low[2] and low[3] >= low[2] and low[1] > low[2] and
low > low[2] or
low[6] > low[2] and low[5] > low[2] and low[4] >= low[2] and low[3] >= low[2] and
low[1] > low[2] and low > low[2] or
low[7] > low[2] and low[6] > low[2] and low[5] >= low[2] and low[4] >= low[2] and
low[3] >= low[2] and low[1] > low[2] and low > low[2] or
low[8] > low[2] and low[7] > low[2] and low[6] >= low[2] and low[5] >= low[2] and
low[4] >= low[2] and low[3] >= low[2] and low[1] > low[2] and low > low[2]
FractalDown = valuewhen(FDown, low[2], 1)
plot(FractalDown, color=#FF0000,title="FractalDown")
if crossover(close, FractalUp)
strategy.entry("Long", strategy.long, comment="Long")
if crossunder(close, FractalDown)
strategy.entry("Short", strategy.short, comment="Short")
Published by ChaoZhang on the FMZ strategy square · last modified 2024-01-30. Collected in the Quant Trading Vault. Unvalidated research: re-test with your own data and costs before trusting it.
Build this with AgenKit
A spec is not a trading system. Paste this into your coding agent and AgenKit runs a specialist team — architecture, test-first build, risk gates, review — with paper trading on by default.
/agenkit build a production-grade trading bot with a backtest engine, risk controls and paper trading by default from strategies/Double-Fractal-Breakout-Strategy.md- npx agenkit install engineering-kit in your project
- Paste the command into your agent and approve each phase
- Get tests, backtest, risk controls and a paper-trading switch
Understand it first
Before you run this, read the lesson behind the idea and how to backtest it honestly. Specs like this one are the survivors of an unknown number of trials; deflate their results accordingly.
Related specs
- 5 Day Moving Average Channel Breakout Strategy Combined With Mileage ConceptPine Script · Breakout · 1d
- ATR Trailing Stops StrategyPine Script · Breakout · 1h
- ATR Trend Breakout StrategyPine Script · Breakout · 1d
- Adaptive Bollinger Breakout with Moving Average Quantitative Strategy SystemPine Script · Breakout · 1h
- Adaptive Channel Breakout StrategyPine Script · Breakout · 1d
- Adaptive Multi Period Trading Strategy Based on Wave Trend Momentum BreakoutPine Script · Breakout · 2h