OPEN-SOURCE SCRIPT
FVG Pilot

What it does
Automatically detects and draws Fair Value Gaps (FVGs) on the chart.
Removes an FVG as soon as it’s invalidated (bullish FVG invalid if price closes below its lower bound; bearish FVG invalid if price closes above its upper bound).
Triggers alerts only during Silver Bullet (SB) sessions in Europe/Berlin time when a new FVG is created.
Optionally draws two thin vertical lines at the start and end of each SB session so you can see the windows at a glance.
Runs on confirmed bars to avoid repainting.
How FVGs are detected
Wick mode (default):
Bullish FVG when low > high[2] → gap [high[2], low]
Bearish FVG when high < low[2] → gap [high, low[2]]
Body mode (optional): uses candle bodies instead of wicks:
Bullish FVG when current body low > prior body high
Bearish FVG when current body high < prior body low
Silver Bullet sessions (Europe/Berlin)
Three configurable session windows (default examples):
SB1: 10:00–11:00
SB2: 02:00–03:00
SB3: 07:00–08:00
Alerts for new FVGs fire only inside these windows.
Session lines: a thin vertical line is drawn on the first bar inside a session (start) and on the first bar after a session (end).
Inputs
Show Bullish / Bearish FVGs
Use Bodies (instead of wicks)
Minimum FVG size (in ticks)
Box opacity
SB sessions: enable/disable each window and set times (Europe/Berlin)
Session line toggle + color/width
Alerts included
SB (Berlin): Bullish FVG created – fires only during SB sessions
SB (Berlin): Bearish FVG created – fires only during SB sessions
Bullish FVG invalidated – fires when a bullish FVG is invalidated (no time filter)
Bearish FVG invalidated – fires when a bearish FVG is invalidated (no time filter)
How to set alerts (TradingView)
Click Create Alert.
Condition: choose this indicator, then pick one of the alert conditions above.
Select your alert options (once per bar close is recommended), then Create.
Tips
If you don’t see boxes, reduce Minimum FVG size or lower opacity (e.g., 70–85).
Body mode is stricter; start with wicks if you want more signals.
SB windows use Europe/Berlin and automatically account for DST.
The script respects platform limits for drawings; if your chart is cluttered, zoom in or reduce active sessions.
Automatically detects and draws Fair Value Gaps (FVGs) on the chart.
Removes an FVG as soon as it’s invalidated (bullish FVG invalid if price closes below its lower bound; bearish FVG invalid if price closes above its upper bound).
Triggers alerts only during Silver Bullet (SB) sessions in Europe/Berlin time when a new FVG is created.
Optionally draws two thin vertical lines at the start and end of each SB session so you can see the windows at a glance.
Runs on confirmed bars to avoid repainting.
How FVGs are detected
Wick mode (default):
Bullish FVG when low > high[2] → gap [high[2], low]
Bearish FVG when high < low[2] → gap [high, low[2]]
Body mode (optional): uses candle bodies instead of wicks:
Bullish FVG when current body low > prior body high
Bearish FVG when current body high < prior body low
Silver Bullet sessions (Europe/Berlin)
Three configurable session windows (default examples):
SB1: 10:00–11:00
SB2: 02:00–03:00
SB3: 07:00–08:00
Alerts for new FVGs fire only inside these windows.
Session lines: a thin vertical line is drawn on the first bar inside a session (start) and on the first bar after a session (end).
Inputs
Show Bullish / Bearish FVGs
Use Bodies (instead of wicks)
Minimum FVG size (in ticks)
Box opacity
SB sessions: enable/disable each window and set times (Europe/Berlin)
Session line toggle + color/width
Alerts included
SB (Berlin): Bullish FVG created – fires only during SB sessions
SB (Berlin): Bearish FVG created – fires only during SB sessions
Bullish FVG invalidated – fires when a bullish FVG is invalidated (no time filter)
Bearish FVG invalidated – fires when a bearish FVG is invalidated (no time filter)
How to set alerts (TradingView)
Click Create Alert.
Condition: choose this indicator, then pick one of the alert conditions above.
Select your alert options (once per bar close is recommended), then Create.
Tips
If you don’t see boxes, reduce Minimum FVG size or lower opacity (e.g., 70–85).
Body mode is stricter; start with wicks if you want more signals.
SB windows use Europe/Berlin and automatically account for DST.
The script respects platform limits for drawings; if your chart is cluttered, zoom in or reduce active sessions.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。