Dynamic Fibonacci Retracement
Jan 17, 2023

The Dynamic Fibonacci Retracement indicator provides an automated way to plot Fibonacci levels that adjust in real-time based on price action and historical pivots. By tracking the most significant highs and lows within a user-defined period, the tool helps traders identify potential support and resistance zones without needing to manually redraw levels after every price move.
Usage
The Dynamic Fibonacci Retracement tool is used to identify key retracement levels during both bullish and bearish market phases. Unlike standard Fibonacci tools, it automatically detects trend reversals and updates its boundaries as price reaches new extremes.
- Trend Identification: The tool displays a dashed trendline and color-coded levels (green for bullish, red for bearish) to signify the current directional bias based on recent pivot points.
- Auto-Adjustment: If price breaks the current high or low established within the lookback range, the levels will expand or shift to reflect the new range.
- Level Customization: Users can toggle specific Fibonacci ratios (0.236, 0.382, 0.5, 0.618, 0.786) to focus on the retracement depths most relevant to their strategy.
Details
The script functions by identifying pivot highs and lows within a specified "Lookback Range." It monitors these pivots to determine the range for the 0% and 100% Fibonacci levels.
- Directional Logic: A bullish state is triggered when a new pivot low is formed or a previous high is breached. Conversely, a bearish state is triggered when a new pivot high is formed or a previous low is breached.
- Expansion: The tool uses a "getOuter" logic to ensure that even if a pivot is fixed, if the current price exceeds that pivot's value, the Fibonacci anchor point expands with the price to provide an accurate real-time retracement calculation.
Settings
General Settings
- Lookback Range: Determines the number of bars used to detect pivot highs and lows.
- Extend: Sets whether the Fibonacci lines extend to the right, left, both directions, or not at all.
- Width: Adjusts the thickness of the Fibonacci lines.
- Labels: Toggles the visibility of the ratio labels.
- Offset Right: Adjusts the horizontal position of the labels relative to the current bar.
- Prices: When enabled, the tool displays the specific price value alongside the Fibonacci ratio.
- Bull/Bear Color: Customizes the colors used for bullish and bearish trends.
Levels
- Use Trendline: Toggles the visibility of the dashed line connecting the 0% and 100% anchors.
- Fibonacci Ratios (0.236 - 0.786): Individual toggles and numerical inputs to enable, disable, or modify specific retracement levels.
FAQ
How do I access the Dynamic Fibonacci Retracement?
You can get access on the LuxAlgo Library for charting platforms like TradingView, MetaTrader (MT4/MT5), and NinjaTrader for free.
Can I use this for alert notifications?
Yes, the indicator includes built-in alert functionality that triggers when the trend direction changes between bullish and bearish.
Why do the levels move automatically?
The indicator is designed to be "dynamic," meaning it recalculates the range whenever the current price makes a new high or low relative to the selected lookback period, ensuring your Fibonacci levels are always up to date.
Free indicator
Get free access to this indicator on the platforms below.
Unlock the entire LuxAlgo Library
Every indicator, every strategy, full charts, and complete access to Quant — our AI agent.