Multi-Level Fibonacci Retracement Strategy with ATR-Adaptive Stop-Loss
FMZQuant

FMZQuant @fmzquant

Joined:
Apr 25, 2024

Multi-Level Fibonacci Retracement Strategy with ATR-Adaptive Stop-Loss

Publish Date: May 28
1 1

Image description

Image description

Overview
The Multi-Level Fibonacci Retracement Strategy with ATR-Adaptive Stop-Loss is a quantitative trading approach that combines Fibonacci retracement levels with technical indicators. This strategy utilizes Fibonacci retracement levels (0%, 23.6%, 38.2%, 50%, 61.8%, 78.6%, 100%) and extension levels (161.8%, 261.8%, 423.6%) to identify potential support and resistance zones. The strategy integrates ATR-based dynamic stop-loss, fixed percentage take-profit, and Golden/Death Cross indicators as auxiliary references. Additionally, it incorporates a weekly profit cap and trade interval restrictions to optimize capital management and reduce overtrading risk.

Strategy Principles
The core logic of this strategy is based on identifying entry signals according to price position within specific Fibonacci level zones:

Fibonacci Level Calculation: Multiple Fibonacci retracement levels are automatically calculated based on the highest high and lowest low of the past 100 bars.

Trade Signal Generation:

  • Buy Signal: Price is between the 38.2% and 78.6% Fibonacci levels
  • Sell Signal: Price is between the 23.6% and 61.8% Fibonacci levels
  • Both signals are subject to a minimum trade interval restriction to prevent frequent trading

Moving Average Indicators:

  • Uses 50-period and 200-period Exponential Moving Averages (EMA)
  • Golden Cross forms when EMA50 crosses above EMA200 (bullish signal)
  • Death Cross forms when EMA50 crosses below EMA200 (bearish signal)

Risk Management Mechanisms:

  • Dynamic stop-loss based on 14-period ATR: Long SL = Entry Price - (ATR * 1.5), Short SL = Entry Price + (ATR * 1.5)
  • Fixed percentage take-profit (default 4%)
  • Weekly profit cap of 15%, after which no new positions are opened for the week

All trading decisions rely on price position within Fibonacci zones, supplemented by time filters and weekly profit restrictions to ensure reasonable trading frequency and risk management.

Strategy Advantages
Upon deep analysis, this strategy demonstrates several key advantages:

  1. Market Volatility Adaptation: By dynamically adjusting stop-loss levels through ATR, the strategy automatically adapts to different market conditions and volatility environments, allowing for wider stops during high volatility periods and tighter stops during low volatility.

  2. Multi-Level Support and Resistance Identification: By incorporating complete Fibonacci retracement and extension levels, the strategy can identify multiple potential price reversal points, improving the precision of entry points.

  3. Prevention of Overtrading: Through implementation of minimum trade intervals and weekly profit caps, the strategy effectively reduces the risk of overtrading, avoiding excessive trades during periods of high market uncertainty.

  4. Visualization of Trading Signals: The strategy plots all key levels and signals directly on the chart, including Fibonacci levels, Golden/Death crosses, and buy/sell signals, facilitating intuitive understanding of market conditions.

  5. Integrated Technical Indicators: By combining Fibonacci retracements, EMA crossovers, and ATR indicators, the strategy can confirm trading signals from multiple perspectives, reducing the risk of false signals.

  6. Flexible Parameter Adjustment: Key parameters such as take-profit percentage and trade intervals can be adjusted according to different markets and personal risk preferences, enhancing strategy adaptability.

Strategy Risks
Despite its well-designed structure, the strategy presents several potential risks:

  1. Lag in Retracement Identification: Fibonacci levels calculated based on the past 100 bars may not timely reflect the latest support and resistance levels in rapidly changing markets. Solution: Consider dynamically adjusting the lookback period or incorporating shorter-term technical indicators for faster response.

  2. Fixed Take-Profit Limiting Potential Gains: Using a fixed percentage take-profit may result in premature position closure during strong trends, limiting potential profits. Solution: Implement trailing stops or multi-tier take-profit strategies, allowing partial positions to ride trends further.

  3. EMA Crossover Lag: Golden and Death crosses are lagging indicators that may signal after trends have already been established. Solution: Use EMA crossovers as auxiliary confirmation rather than primary entry criteria, or consider using shorter-period moving averages.

  4. Parameter Sensitivity: Strategy performance may be highly sensitive to parameter settings such as Fibonacci levels, ATR multiplier, and take-profit percentage. Solution: Conduct thorough backtesting and parameter optimization to find parameter combinations that perform consistently under different market conditions.

  5. Weekly Profit Cap Limitation: The 15% weekly profit cap may cause missing important trading opportunities during extreme market conditions. Solution: Consider dynamically adjusting profit caps based on market volatility or setting conditions to allow breaching the profit limit in specific situations.

Strategy Optimization Directions
Based on in-depth analysis of the strategy logic, here are several possible optimization directions:

  1. Dynamic Fibonacci Period: The strategy currently uses a fixed 100-bar period to calculate Fibonacci levels. Consider automatically adjusting the calculation period based on market volatility, using shorter periods in high volatility markets and longer periods in stable markets to better capture key levels under current market conditions.

  2. Multi-Timeframe Confirmation: Introduce multi-timeframe analysis, requiring trade signals to be confirmed by Fibonacci levels across different timeframes, thereby reducing false signal rates and improving success rates.

  3. Trend Filter Integration: Add additional trend filters (such as ADX or Parabolic SAR), executing trades only when a clear trend direction is identified, avoiding losing trades in range-bound markets.

  4. Dynamic Take-Profit Mechanism: Replace fixed percentage take-profit with a stepped or trailing take-profit approach, allowing profits to expand during strong market movements while protecting existing gains.

  5. Volume Analysis: Integrate volume analysis, requiring significant volume changes to accompany reversals at key Fibonacci levels to increase signal reliability.

  6. Machine Learning Optimization: Use machine learning algorithms to automatically identify optimal Fibonacci trading zones and ATR multipliers, customizing parameters for different market conditions based on historical data.

  7. Dynamic Risk Exposure Adjustment: Automatically adjust position size based on strategy historical performance and current market conditions, increasing exposure when high-confidence signals appear and reducing exposure during high uncertainty.

These optimization directions aim to enhance strategy adaptability to different market conditions, improve signal quality, and refine risk management architecture, thereby achieving more stable and sustainable performance.

Summary
The Multi-Level Fibonacci Retracement Strategy with ATR-Adaptive Stop-Loss is a comprehensive trading system that combines classic technical analysis tools with modern risk management techniques. By utilizing Fibonacci retracement levels to identify potential reversal zones, integrating ATR dynamic stop-loss for risk control, and incorporating additional features such as Golden/Death crosses and weekly profit caps, the strategy provides traders with a structured trading framework.

Despite some inherent risks related to lag and parameter sensitivity, these risks can be effectively managed through the suggested optimization directions, particularly dynamic parameter adjustment and multi-timeframe confirmation. The strategy's main strengths lie in its adaptability and comprehensive risk management mechanisms, enabling it to maintain relatively stable performance across different market environments.

For traders seeking a structured trading approach based on technical analysis, this strategy provides a solid starting point that can be further customized and expanded according to individual risk preferences and market views. With careful parameter tuning and continuous performance monitoring, the strategy has the potential to become a valuable component in a trading portfolio.

Strategy source code

/*backtest
start: 2024-05-13 00:00:00
end: 2025-01-18 00:00:00
period: 1d
basePeriod: 1d
exchanges: [{"eid":"Futures_Binance","currency":"DOGE_USDT"}]
*/

//@version=5
strategy("Fibonacci + TP/SL Strategy [Backtest]", overlay=true, default_qty_type=strategy.percent_of_equity, default_qty_value=100)

take_profit_percent = input.float(4.0, minval=0.1, maxval=20, title="Kar Hedefi (%)")
min_bars_between_trades = input.int(10, title="Minimum Bar Aralığı")

lookback = 100
high_price = ta.highest(high, lookback)
low_price = ta.lowest(low, lookback)

fib_0 = high_price
fib_236 = high_price - (high_price - low_price) * 0.236
fib_382 = high_price - (high_price - low_price) * 0.382
fib_50 = high_price - (high_price - low_price) * 0.5
fib_618 = high_price - (high_price - low_price) * 0.618
fib_786 = high_price - (high_price - low_price) * 0.786
fib_100 = low_price

fib_1618 = high_price + (high_price - low_price) * 0.618
fib_2618 = high_price + (high_price - low_price) * 1.618
fib_4236 = high_price + (high_price - low_price) * 2.618

var int last_trade_bar = na
can_trade = na(last_trade_bar) or (bar_index - last_trade_bar >= min_bars_between_trades)

buy_signal = close <= fib_382 and close >= fib_786 and can_trade
sell_signal = close <= fib_236 and close >= fib_618 and can_trade

ema50 = ta.ema(close, 50)
ema200 = ta.ema(close, 200)
golden_cross = ta.crossover(ema50, ema200)
death_cross = ta.crossunder(ema50, ema200)

plotshape(golden_cross, title="Golden Cross", location=location.belowbar, color=color.green, style=shape.triangleup, text="GC")
plotshape(death_cross, title="Death Cross", location=location.abovebar, color=color.red, style=shape.triangledown, text="DC")

atr = ta.atr(14)
sl_long = close - (atr * 1.5)
sl_short = close + (atr * 1.5)
tp_long = close * (1 + take_profit_percent / 100)
tp_short = close * (1 - take_profit_percent / 100)

max_weekly_return = 0.15
start_of_week = ta.change(time("1W")) != 0
var float week_start_equity = na
if start_of_week
    week_start_equity := strategy.equity
current_week_return = (strategy.equity - week_start_equity) / week_start_equity
can_trade_this_week = current_week_return <= max_weekly_return

if buy_signal and strategy.equity > 0 and can_trade_this_week
    strategy.entry("Long", strategy.long)
    strategy.exit("TP/SL Long", from_entry="Long", limit=tp_long, stop=sl_long)
    last_trade_bar := bar_index

if sell_signal and strategy.equity > 0 and can_trade_this_week
    strategy.entry("Short", strategy.short)
    strategy.exit("TP/SL Short", from_entry="Short", limit=tp_short, stop=sl_short)
    last_trade_bar := bar_index

plotshape(buy_signal, title="Buy Signal", location=location.belowbar, color=color.green, style=shape.labelup, text="BUY")
plotshape(sell_signal, title="Sell Signal", location=location.abovebar, color=color.red, style=shape.labeldown, text="SELL")

plot(fib_0, color=color.green, linewidth=2, title="Fib 0%")
plot(fib_236, color=color.blue, linewidth=2, title="Fib 23.6%")
plot(fib_382, color=color.blue, linewidth=2, title="Fib 38.2%")
plot(fib_50, color=color.red, linewidth=2, title="Fib 50%")
plot(fib_618, color=color.red, linewidth=2, title="Fib 61.8%")
plot(fib_786, color=color.orange, linewidth=2, title="Fib 78.6%")
plot(fib_100, color=color.green, linewidth=2, title="Fib 100%")
plot(fib_1618, color=color.orange, linewidth=2, title="Fib 161.8%")
plot(fib_2618, color=color.orange, linewidth=2, title="Fib 261.8%")
plot(fib_4236, color=color.orange, linewidth=2, title="Fib 423.6%")
Enter fullscreen mode Exit fullscreen mode

Strategy parameters

Image description

The original address: Multi-Level Fibonacci Retracement Strategy with ATR-Adaptive Stop-Loss

Comments 1 total

  • Rebecca Chow
    Rebecca ChowJun 19, 2025

    Fibonacci levels and ATR adaptive stops? Trading just got a math upgrade! 📊 Love how this strategy respects the market's OCD for neat retracement levels. But let's be honest—if price actually obeyed Fibs 100% of the time, we'd all be sipping margaritas by now. Solid logic, though! Just needs a 'panic button' for when the market forgets basic math.

Add comment