Fibonacci Retracement Indicator
Fibonacci retracement levels are horizontal lines that mark potential support and resistance zones, based on the key ratios from the Fibonacci number sequence.
What is the Fibonacci Retracement Indicator?​
Drawn between a significant high and low, Fibonacci retracement plots horizontal levels at ratios derived from the Fibonacci sequence, most commonly 23.6%, 38.2%, 50%, 61.8%, and 78.6%. The idea is that after a strong move, price often "retraces" a portion of that move before continuing in the original direction, and it tends to pause or reverse near these specific ratio levels.
How to Read Fibonacci Retracement​
- 61.8% level ("golden ratio"): the most closely watched retracement level; a bounce here is often read as a continuation signal
- 38.2% level: a shallower retracement, suggesting a strong underlying trend
- 50% level: not a true Fibonacci ratio, but widely watched as a psychological midpoint
- A close crossing back through a retracement level in the direction of the original trend is commonly used as an entry trigger
Best Use Cases​
- Identifying Potential Support/Resistance: retracement levels give traders specific price zones to watch for a reaction.
- Setting Entries within a Trend: waiting for a pullback to a Fibonacci level before entering in the trend's direction, rather than chasing price.
- Combining with Other Tools: Fibonacci levels are typically used alongside trendlines, candlestick patterns, or an indicator like RSI for confirmation, rather than as a standalone signal.
Fibonacci Retracement PineScript for TradingView​
Here's a ready-to-use Fibonacci retracement strategy template, using the 61.8% and 38.2% levels calculated off a rolling lookback window. Paste it into the Pine Editor, adjust the lookback length, target, and stop loss to your preference, and backtest it.
To learn how to add this pinescript in TradingView, click here.
This strategy is for demonstration purposes only and is not intended for actual trading. AlgoTest is not responsible for any profit or loss arising from the use of this sample strategy.
//@version=5
strategy("Fibonacci Retracement Strategy", overlay=true)
// Input parameters
fib_levels = input.bool(true, title="Show Fibonacci Levels")
n = input.int(20, title="Number of Historical Candles")
target_points = input.int(100, title="Target Points")
stop_loss_points = input.int(50, title="Stop Loss Points")
// Calculate Fibonacci levels
high_price = ta.highest(close, 20)
low_price = ta.lowest(close, 20)
range_ = high_price - low_price
fib618 = high_price - range_ * 0.618
fib382 = high_price - range_ * 0.382
// Strategy logic
long_condition = ta.crossover(close, fib618)
short_condition = ta.crossunder(close, fib382)
// Plot Fibonacci levels
plot(fib_levels ? fib618 : na , "61.8%", color=color.blue, trackprice=true)
plot(fib_levels ? fib382 : na , "38.2%", color=color.red, trackprice=true)
// Strategy entry and exit
if long_condition
strategy.entry("Long", strategy.long)
if short_condition
strategy.entry("Short", strategy.short)
// Calculate target and stop loss levels
long_target = strategy.position_avg_price + target_points
long_stop_loss = strategy.position_avg_price - stop_loss_points
short_target = strategy.position_avg_price - target_points
short_stop_loss = strategy.position_avg_price + stop_loss_points
// Strategy exit
strategy.exit("Long Exit", "Long", limit=long_target, stop=long_stop_loss)
strategy.exit("Short Exit", "Short", limit=short_target, stop=short_stop_loss)
Once you've backtested it, you can connect the alert to AlgoTest to automate live execution without manually watching the chart.
FAQ​
What are the main Fibonacci retracement levels?​
The most commonly used levels are 23.6%, 38.2%, 50%, 61.8%, and 78.6%. Of these, 61.8% and 38.2% are the most closely watched by traders.
Is Fibonacci retracement reliable?​
Fibonacci retracement is widely used, but like any technical tool its reliability depends on market context and confirmation from other indicators or price action; it works best as one input among several, not a standalone signal.
How do you draw Fibonacci retracement levels?​
Select a clear swing high and swing low on the chart, then draw the Fibonacci retracement tool between them. Most charting platforms, including TradingView, calculate and plot the standard levels automatically.
What is the 61.8% Fibonacci level used for?​
Often called the "golden ratio," the 61.8% level is the most watched retracement level: a bounce here, in the direction of the prior trend, is commonly treated as a continuation signal.
Can Fibonacci retracement be automated?​
Yes, since the levels are calculated mathematically from a recent high and low, they can be scripted and traded systematically, as shown in the PineScript template above.
For more insights and detailed analysis tools, visit AlgoTest Signals.