Fibonacci Retracement and Target Levels with Buy/Sell Signals

·

Enhanced Fibonacci Trading Indicator

This updated indicator combines Fibonacci retracement levels with clear BUY/SELL signals, helping traders identify potential entry and exit points based on key Fibonacci ratios. Below is a breakdown of its features and functionality.


Key Features

  1. Visual Fibonacci Levels

    • Plots classic retracement levels (23.6%, 38.2%, 50%, 61.8%, 100%) using distinct colors:

      • Green: 0% (high) and 100% (low)
      • Blue: 23.6% and 38.2%
      • Red: 50% and 61.8%
    • Extensions (161.8%, 261.8%, 423.6%) marked in orange for target projections.
  2. BUY/SELL Signal Labels

    • Uses plotshape() to display "BUY" (below bars) and "SELL" (above bars) labels.
    • Conditions:

      • BUY: Price near 23.6% retracement (close ≤ 23.6% and > 38.2%).
      • SELL: Price at/above 61.8% retracement (close ≥ 61.8% and < 50%).
  3. Customizable Inputs

    • Dynamically detects highest/lowest prices in the selected range.

How It Works

//@version=5
indicator("Fibonacci Retracement and Target Levels with Buy/Sell Signals", overlay=true)

// Price range detection
var float high_price = na
var float low_price = na
if (na(high_price) or high > high_price)
    high_price := high
if (na(low_price) or low < low_price)
    low_price := low

// Fibonacci calculations
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_100 = low_price

// Extensions
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

// Plotting levels (example)
plot(fib_618, color=color.red, linewidth=2, title="Fib 61.8%")

// Signals
buy_signal = (close <= fib_236 and close > fib_382)
sell_signal = (close >= fib_618 and close < fib_50)
plotshape(buy_signal, text="BUY", location=location.belowbar, color=color.green)
plotshape(sell_signal, text="SELL", location=location.abovebar, color=color.red)

Advantages for Traders

👉 Learn how Fibonacci strategies boost trading accuracy


FAQ

Q: How do I adjust the Fibonacci range?
A: The indicator auto-detects highs/lows, but you can manually set high_price and low_price in the script.

Q: Are false signals common?
A: Combine with volume or RSI to confirm signals. Fibonacci levels work best in trending markets.

Q: Can I use this for crypto?
A: Yes! It’s asset-agnostic. For crypto volatility, pair it with 👉 OKX’s advanced charting tools.


Best Practices

  1. Confirm with Trends: Use in alignment with the broader trend (e.g., buy near 23.6% in an uptrend).
  2. Risk Management: Place stops below 38.2% for BUY or above 50% for SELL.
  3. Combine Indicators: Pair with moving averages or MACD for higher accuracy.

This tool simplifies Fibonacci trading by merging technical levels with actionable signals, ideal for both beginners and experienced traders.

👉 Explore more trading strategies to maximize your Fibonacci edge.