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.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.