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が提供または承認する金融、投資、取引、またはその他の種類の助言もしくは推奨であることを意図したものではなく、またこれらに該当するものでもありません。詳細は利用規約をご覧ください。