OPEN-SOURCE SCRIPT
Fair Value Gap Continuation Framework

Overview
This strategy studies how price interacts with Fair Value Gaps (FVGs), which are areas that can form after strong directional price movement.
The script identifies potential imbalance zones and monitors future price interaction with those areas. Rather than entering immediately after a gap forms, the strategy waits for price to revisit the zone and show signs of continuing in the original direction.
The objective is to explore how imbalance zones may be incorporated into a rules-based trading framework.
What Is a Fair Value Gap?
A Fair Value Gap is commonly described as an area created when price moves rapidly, leaving a gap between portions of surrounding candles.
In this script:
Previously identified zones remain available for future analysis when price revisits them.
Strategy Logic
Gap Identification
The script searches for simple three-candle imbalance patterns that may indicate a Fair Value Gap.
Zone Retest
Once a gap has been identified, the strategy waits for price to return to that area.
Continuation Confirmation
A trade is considered only after price revisits the zone and closes back in the direction of the original move.
Risk Management
Stop-loss and target levels are calculated using ATR, allowing risk parameters to adapt to changing volatility conditions.
Features
Intended Use
This script is designed as an educational example demonstrating one approach to identifying and testing Fair Value Gap behavior.
It may be used to study:
Users may choose to modify parameters and test the script across different symbols and timeframes.
Notes
Fair Value Gap concepts are interpreted differently by different traders. This script provides one simplified implementation and should not be considered a complete representation of all Fair Value Gap methodologies.
Disclaimer
This script is provided for educational and research purposes only. It demonstrates one method of identifying and testing Fair Value Gap behavior using Pine Script. The script does not predict future market direction and should be evaluated through independent testing before being incorporated into any trading process.
This strategy studies how price interacts with Fair Value Gaps (FVGs), which are areas that can form after strong directional price movement.
The script identifies potential imbalance zones and monitors future price interaction with those areas. Rather than entering immediately after a gap forms, the strategy waits for price to revisit the zone and show signs of continuing in the original direction.
The objective is to explore how imbalance zones may be incorporated into a rules-based trading framework.
What Is a Fair Value Gap?
A Fair Value Gap is commonly described as an area created when price moves rapidly, leaving a gap between portions of surrounding candles.
In this script:
- Bullish gaps are identified after upward displacement.
- Bearish gaps are identified after downward displacement.
Previously identified zones remain available for future analysis when price revisits them.
Strategy Logic
Gap Identification
The script searches for simple three-candle imbalance patterns that may indicate a Fair Value Gap.
Zone Retest
Once a gap has been identified, the strategy waits for price to return to that area.
Continuation Confirmation
A trade is considered only after price revisits the zone and closes back in the direction of the original move.
Risk Management
Stop-loss and target levels are calculated using ATR, allowing risk parameters to adapt to changing volatility conditions.
Features
- Fair Value Gap detection
- Retest-based entries
- ATR-based risk management
- Trend continuation framework
- Research and testing focused design
Intended Use
This script is designed as an educational example demonstrating one approach to identifying and testing Fair Value Gap behavior.
It may be used to study:
- Price imbalances
- Retest behavior
- Trend continuation concepts
- Volatility-adjusted exits
Users may choose to modify parameters and test the script across different symbols and timeframes.
Notes
Fair Value Gap concepts are interpreted differently by different traders. This script provides one simplified implementation and should not be considered a complete representation of all Fair Value Gap methodologies.
Disclaimer
This script is provided for educational and research purposes only. It demonstrates one method of identifying and testing Fair Value Gap behavior using Pine Script. The script does not predict future market direction and should be evaluated through independent testing before being incorporated into any trading process.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。