Below shows 1hr FVGs marked out. NOTE: this is not what the script does, this is for explanation only.
Below shows what the script will do. 1hr FVGs shown on 15min chart
added visibility settings for main FVGs. Now for example, you can choose to only show Daily FVGs on 1hr TF...or 1hr FVGs on 5 min TF etc.
added a MTF FVG which displays through the price chart. This gives the option of displaying two different FVGs on the same chart which don't overlap each other.
In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.