OPEN-SOURCE SCRIPT
1 HR Fair Value Gap

It draws 1-hour fair value gaps on your chart, no matter what timeframe you're looking at.
A fair value gap is a 3-candle imbalance: price moves so fast that the first and third candles don't overlap, leaving a gap. The code checks confirmed 1-hour candles and finds two kinds — bullish (gap up, `h3 < l1`) and bearish (gap down, `l3 > h1`).
When it finds one, it does two things: draws a colored box marking the gap, and draws a line at the 50% midpoint of that gap extended 24 hours to the right. The midline is the part you actually trade off of — where price is likely to return and react.
The `bars24h` piece just makes "24 hours" translate correctly to any chart, since 24 hours is 288 bars on a 5-minute chart but only 24 bars on a 1-hour chart. And the age-out at the bottom stops tracking each midline once it's 24 hours old, so old levels drop off.
That's the whole thing — pure levels, no signals, no bias, no alerts.
A fair value gap is a 3-candle imbalance: price moves so fast that the first and third candles don't overlap, leaving a gap. The code checks confirmed 1-hour candles and finds two kinds — bullish (gap up, `h3 < l1`) and bearish (gap down, `l3 > h1`).
When it finds one, it does two things: draws a colored box marking the gap, and draws a line at the 50% midpoint of that gap extended 24 hours to the right. The midline is the part you actually trade off of — where price is likely to return and react.
The `bars24h` piece just makes "24 hours" translate correctly to any chart, since 24 hours is 288 bars on a 5-minute chart but only 24 bars on a 1-hour chart. And the age-out at the bottom stops tracking each midline once it's 24 hours old, so old levels drop off.
That's the whole thing — pure levels, no signals, no bias, no alerts.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。