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.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.
Açık kaynak kodlu komut dosyası
Gerçek TradingView ruhuna uygun olarak, bu komut dosyasının oluşturucusu bunu açık kaynaklı hale getirmiştir, böylece yatırımcılar betiğin işlevselliğini inceleyip doğrulayabilir. Yazara saygı! Ücretsiz olarak kullanabilirsiniz, ancak kodu yeniden yayınlamanın Site Kurallarımıza tabi olduğunu unutmayın.
Feragatname
Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, işlem veya diğer türden tavsiye veya tavsiyeler anlamına gelmez ve teşkil etmez. Kullanım Şartları'nda daha fazlasını okuyun.