OPEN-SOURCE SCRIPT

Fibonacci Reversal Finder

Purpose of the indicator
This indicator is designed to identify potential reversal points on a price chart using Fibonacci retracement levels combined with price action confirmation. It generates buy and sell signals based on retracement levels and price action patterns, providing entry points along with stop-loss (SL) and take-profit (TP) targets.

How It Works
1. Input Settings for Fibonacci Levels
  • The script allows the user to input Fibonacci retracement levels (default: 0.618 and 0.786).
  • These levels are extracted from a string and converted into an array for later calculations.


2. Convert String to Fibonacci Retracement Values
  • The script retrieves the two selected Fibonacci levels and ensures they are correctly converted to float values.


3. Detect Swing High and Swing Low
  • Identifies swing high and swing low over the past 20 bars.
  • These values serve as reference points for Fibonacci retracement calculations.


4. Calculate Fibonacci Retracement Levels
  • Computes retracement levels based on swing high/low and the selected Fibonacci ratios.


5. Price Action Confirmation (Optional)
  • The indicator checks for bullish engulfing and bearish engulfing candlestick patterns as an additional confirmation method.


6. Define Buy & Sell Conditions
  • Buy Signal: If price touches the Fibonacci support levels AND (optionally) a bullish engulfing pattern appears.
  • Sell Signal: If price reaches the Fibonacci resistance levels AND (optionally) a bearish engulfing pattern appears.


7. Calculate Stop-Loss (SL) and Take-Profit (TP)
  • SL (Stop Loss): For buy trades, the SL is set to the previous swing low; for sell trades, it's set to the previous swing high.
  • TP (Take Profit): Uses a 1:2 risk-reward ratio.


8. Improve Label Visibility
  • Adds an offset to move labels away from the candlestick, improving visibility.


9. Plot Buy/Sell Labels & Connecting Lines
  • Labels: Display buy/sell signals, entry price, SL, and TP.
  • Lines: Draw dotted connectors from the candlestick to the label for better clarity.



What This Indicator Can Do
✅ Identifies Reversal Points using Fibonacci retracements (0.618 & 0.786)
✅ Confirms Reversals with bullish/bearish engulfing candlestick patterns (optional)
✅ Plots Buy/Sell Labels with entry price, SL, and TP values
✅ Draws Lines connecting labels to the candlestick for visibility
✅ Uses a 1:2 Risk-Reward Ratio to determine Take-Profit levels

How to Use This Indicator
  1. Add the Indicator to your TradingView chart.
  2. Look for Buy/Sell Labels:
  3. Buy when price retraces to Fibonacci support and a bullish engulfing pattern appears.
  4. Sell when price retraces to Fibonacci resistance and a bearish engulfing pattern appears.
  5. Use the Stop-Loss (SL) & Take-Profit (TP) from the label to manage your trade.
  6. Combine with Other Indicators (e.g., RSI, MACD) for additional confirmation.

Clause de non-responsabilité