OPEN-SOURCE SCRIPT
Greer Gap

# Greer Gap Indicator (No mitigation: i.e. removing false signals)
## Summary
The **Greer Gap Indicator** identifies **Fair Value Gaps (FVGs)** and introduces specialized **Greer Bull Gaps (Blue)** and **Greer Bear Gaps (Orange)** to highlight high-probability trading opportunities. Unlike traditional FVG indicators, it avoids hindsight bias by not removing historical gaps based on future price action, ensuring transparency in signal accuracy. Built upon LuxAlgo’s FVG logic, it adds unique filtering: only the first Greer Gap after an opposite gap is plotted if its level (min for Bull, max for Bear) is not higher/lower than the previous Greer Gap of the same type, while all valid gaps are recorded for comparison. Traders can use these gaps as support/resistance or entry signals, customizable via timeframe, look back, and display options.
## Description
This indicator detects and displays **Fair Value Gaps (FVGs)** on the chart, with a focus on specialized **Greer Gaps**:
- **Bullish Gaps (Green)**: Areas where the low of the current candle is above the high of a previous candle (look back period), indicating potential upward momentum.
- **Bearish Gaps (Red)**: Areas where the high of the current candle is below the low of a previous candle, indicating potential downward momentum.
- **Greer Bull Gaps (Blue)**: A bullish gap that is above the latest bearish gap's max. Only the first such gap after a bearish gap is plotted if it meets criteria (not higher than the previous Greer Bull Gap's min), but all valid ones are recorded for comparison.
- **Greer Bear Gaps (Orange)**: A bearish gap that is below the latest bullish gap's min. Only the first such gap after a bullish gap is plotted if it meets criteria (not lower than the previous Greer Bear Gap's max), but all valid ones are recorded.
## How It Works
The script uses a dynamic look back period to detect FVGs. It maintains a record of all detected gaps and applies additional logic for Greer Gaps:
- **Greer Bull Gaps**: Checks if the new bullish gap's min is above the latest bearish gap's max. Plots only if it's the first since the last bearish gap and its min is <= previous Greer Bull min (or first one).
- **Greer Bear Gaps**: Checks if the new bearish gap's max is below the latest bullish gap's min. Plots only if it's the first since the last bullish gap and its max is >= previous Greer Bear max (or first one).
- **Resets**: A new bearish gap resets the Greer Bull Gap flag, and a new bullish gap resets the Greer Bear Gap flag.
## How to Use
- **Timeframe**: Set a higher timeframe (e.g., 'D' for daily) to detect gaps from that timeframe on the current chart.
- **Look back Period**: Adjust to change gap detection sensitivity (default: 34). Use 2 if you want to compare to LuxAlgo
- **Extend**: Controls how far right the gap boxes extend.
- **Show Options**: Toggle visibility of all bullish/bearish gaps or Greer Gaps.
- **Colors**: Customize colors for each gap type.
- **Application**: Use Greer Gaps as potential support/resistance levels or entry signals, but combine with other analysis for confirmation.
## Originality and Credits
This script is inspired by and builds upon the **"Fair Value Gap [LuxAlgo]"** indicator by LuxAlgo (available on TradingView: [LuxAlgo FVG](tradingview.com/script/jWY4Uiez-Fair-Value-Gap-LuxAlgo/)).
**Credits**: Thanks to LuxAlgo for the core FVG detection logic.
**Significant Changes**:
- Added **Greer Bull and Bear Gap** logic for filtered, directional gaps with reset mechanisms.
- Introduced recording of all valid Greer Gaps without plotting all, to compare levels without hindsight bias.
- **No mitigation/removal of gaps**: Unlike LuxAlgo's approach, which mitigates (removes or alters) gaps based on future price action (e.g., when filled), this can create a hindsight bias where incorrect signals disappear over time. If a signal is used for a trade and later removed due to new data, it doesn't reflect real-time performance accurately. The Greer Gap avoids this by using gap comparisons to validate signals without altering historical boxes, ensuring transparency in when signals were right or wrong.
## Summary
The **Greer Gap Indicator** identifies **Fair Value Gaps (FVGs)** and introduces specialized **Greer Bull Gaps (Blue)** and **Greer Bear Gaps (Orange)** to highlight high-probability trading opportunities. Unlike traditional FVG indicators, it avoids hindsight bias by not removing historical gaps based on future price action, ensuring transparency in signal accuracy. Built upon LuxAlgo’s FVG logic, it adds unique filtering: only the first Greer Gap after an opposite gap is plotted if its level (min for Bull, max for Bear) is not higher/lower than the previous Greer Gap of the same type, while all valid gaps are recorded for comparison. Traders can use these gaps as support/resistance or entry signals, customizable via timeframe, look back, and display options.
## Description
This indicator detects and displays **Fair Value Gaps (FVGs)** on the chart, with a focus on specialized **Greer Gaps**:
- **Bullish Gaps (Green)**: Areas where the low of the current candle is above the high of a previous candle (look back period), indicating potential upward momentum.
- **Bearish Gaps (Red)**: Areas where the high of the current candle is below the low of a previous candle, indicating potential downward momentum.
- **Greer Bull Gaps (Blue)**: A bullish gap that is above the latest bearish gap's max. Only the first such gap after a bearish gap is plotted if it meets criteria (not higher than the previous Greer Bull Gap's min), but all valid ones are recorded for comparison.
- **Greer Bear Gaps (Orange)**: A bearish gap that is below the latest bullish gap's min. Only the first such gap after a bullish gap is plotted if it meets criteria (not lower than the previous Greer Bear Gap's max), but all valid ones are recorded.
## How It Works
The script uses a dynamic look back period to detect FVGs. It maintains a record of all detected gaps and applies additional logic for Greer Gaps:
- **Greer Bull Gaps**: Checks if the new bullish gap's min is above the latest bearish gap's max. Plots only if it's the first since the last bearish gap and its min is <= previous Greer Bull min (or first one).
- **Greer Bear Gaps**: Checks if the new bearish gap's max is below the latest bullish gap's min. Plots only if it's the first since the last bullish gap and its max is >= previous Greer Bear max (or first one).
- **Resets**: A new bearish gap resets the Greer Bull Gap flag, and a new bullish gap resets the Greer Bear Gap flag.
## How to Use
- **Timeframe**: Set a higher timeframe (e.g., 'D' for daily) to detect gaps from that timeframe on the current chart.
- **Look back Period**: Adjust to change gap detection sensitivity (default: 34). Use 2 if you want to compare to LuxAlgo
- **Extend**: Controls how far right the gap boxes extend.
- **Show Options**: Toggle visibility of all bullish/bearish gaps or Greer Gaps.
- **Colors**: Customize colors for each gap type.
- **Application**: Use Greer Gaps as potential support/resistance levels or entry signals, but combine with other analysis for confirmation.
## Originality and Credits
This script is inspired by and builds upon the **"Fair Value Gap [LuxAlgo]"** indicator by LuxAlgo (available on TradingView: [LuxAlgo FVG](tradingview.com/script/jWY4Uiez-Fair-Value-Gap-LuxAlgo/)).
**Credits**: Thanks to LuxAlgo for the core FVG detection logic.
**Significant Changes**:
- Added **Greer Bull and Bear Gap** logic for filtered, directional gaps with reset mechanisms.
- Introduced recording of all valid Greer Gaps without plotting all, to compare levels without hindsight bias.
- **No mitigation/removal of gaps**: Unlike LuxAlgo's approach, which mitigates (removes or alters) gaps based on future price action (e.g., when filled), this can create a hindsight bias where incorrect signals disappear over time. If a signal is used for a trade and later removed due to new data, it doesn't reflect real-time performance accurately. The Greer Gap avoids this by using gap comparisons to validate signals without altering historical boxes, ensuring transparency in when signals were right or wrong.
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。
開源腳本
本著TradingView的真正精神,此腳本的創建者將其開源,以便交易者可以查看和驗證其功能。向作者致敬!雖然您可以免費使用它,但請記住,重新發佈程式碼必須遵守我們的網站規則。
免責聲明
這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。