OPEN-SOURCE SCRIPT

Fair Value Gap (FVG) Histogram [Kodeus]

76
The Fair Value Gap (FVG) Histogram is a tool designed to detect, visualize, and analyze Fair Value Gaps (FVGs) directly on your charts. It combines statistical distribution analysis with real-time signal detection, allowing traders to spot extreme imbalances, evaluate their significance, and track historical performance. This indicator is useful for traders who want to better understand the occurrence and magnitude of gaps in price action while integrating both directional bias and probability analysis.

snapshot
Pine Script®
// Bullish gap condition low[0] > high[2]

Pine Script®
// Bearish gap condition high[0] < low[2]


🔷 Key Features

Fair Value Gap Detection: Automatically identifies both bullish and bearish gaps based on price displacements.

Performance Window: Customizable lookback period to evaluate relative gap significance.

Extreme Gap Alerts: Highlight potential trading opportunities when gap magnitude exceeds historical thresholds.

Distribution Analysis: Generates a histogram of gap magnitudes across a user-defined sample size and bucket count.

Frequency Mapping: Optional display of bin frequencies to better understand signal clustering.

Gap Fading Option: Ability to fade minor/insignificant gaps for clearer visual focus.

🔷 Disclaimer

Use with Caution: This indicator is provided for educational and informational purposes only and should not be considered as financial advice. Users should exercise caution and perform their own analysis before making trading decisions based on the indicator's signals.

Not Financial Advice: The information provided by this indicator does not constitute financial advice, and the creator shall not be held responsible for any trading losses incurred as a result of using this indicator.

Backtesting Recommended: Traders are encouraged to backtest the indicator thoroughly on historical data before using it in live trading to assess its performance and suitability for their trading strategies.

Risk Management: Trading involves inherent risks, and users should implement proper risk management strategies, including but not limited to stop-loss orders and position sizing, to mitigate potential losses.

No Guarantees: The accuracy and reliability of the indicator's signals cannot be guaranteed, as they are based on historical price data and past performance may not be indicative of future results.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.