OPEN-SOURCE SCRIPT
Bearish Fibonacci Extension Distance Table

### 📉 **Bearish Fibonacci Extension Distance Table – Pine Script Indicator**
This TradingView indicator calculates and displays **bearish Fibonacci extension targets** based on recent price swings, specifically designed for traders looking to **analyze downside potential** in a trending market. Unlike traditional Fibonacci retracement tools that help identify pullbacks, this version projects likely **price targets below current levels** using Fibonacci ratios commonly followed by institutional and retail traders alike.
#### 🔧 **How It Works:**
* **Swing Calculation**:
The script looks back over a user-defined period (`swingLen`, default 20 bars) to find:
* `B`: The **highest high** in the lookback (start of bearish move)
* `A`: The **lowest low** in the same period (end of bearish swing)
* `C`: The **current high**, serving as the base for projecting future downside levels.
* **Bearish Extensions**:
It then calculates Fibonacci extension levels **below** the current high using standard ratios:
* **100%**, **127.2%**, **161.8%**, **200%**, and **261.8%**
* **Distance Calculation**:
For each level, the indicator computes:
* The **target price**
* The **distance (in %)** between the current close and each Fibonacci level
* **Visual Output**:
A live, auto-updating **data table** is shown in the **top-right corner** of the chart. This provides at-a-glance insight into how far current price is from each bearish target, with color-coded levels for clarity.
#### 📊 **Use Cases**:
* Identify **bearish continuation targets** in downtrending or correcting markets.
* Help manage **take-profit** zones for short trades.
* Assess **risk-reward** scenarios when entering bearish positions.
* Combine with indicators like RSI, OBV, or MACD for **confluence-based setups**.
#### ⚙️ **Inputs**:
* `Swing Lookback`: Number of bars to consider for calculating the swing high and swing low.
* `Show Table`: Toggle to display or hide the Fibonacci level table.
---
### 🧠 Example Interpretation:
Suppose the stock is trading at ₹180 and the 161.8% Fibonacci extension level is ₹165 with a -8.3% distance — this suggests the price may continue down to ₹165, offering a potential 8% short opportunity if confirmed by other indicators.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。