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. اقرأ المزيد في شروط الاستخدام.