OPEN-SOURCE SCRIPT
Silver Bullet & First/Last FVG

It is designed around the popular ICT (Inner Circle Trader) "Silver Bullet" concepts. Its main purpose is to highlight specific time-based trading windows on your chart and automatically detect and isolate the most significant Fair Value Gaps (FVGs) that form within those windows.
Here is a breakdown of its functionality:
1. Specific Time Sessions
The script monitors three specific 1-hour time windows (defaulting to New York time, but adjustable):
London Silver Bullet: 03:00 - 04:00
New York AM Silver Bullet: 10:00 - 11:00
New York PM Silver Bullet: 14:00 - 15:00
Each of these sessions can be toggled on/off individually, and their border colors customized.
2. Session Range Highlighting
When one of these 1-hour sessions begins, the script starts tracking the absolute Highest and Lowest price reached during that hour.
Once the session ends, it draws a large, semi-transparent box encapsulating that entire 1-hour price action range.
The box is labeled in the bottom right corner (e.g., "Lon SB" or "NY AM SB") so you can easily visually identify the Silver Bullet hour in hindsight.
3. First and Last FVG Detection
This is the most unique feature of the script. While standard indicators highlight every FVG, this script filters them based on the Silver Bullet sessions:
It continuously looks for standard 3-candle Fair Value Gaps (both bullish and bearish).
However, it only plots FVGs if they occur inside one of the active Silver Bullet sessions.
Furthermore, to reduce clutter, it only stores and plots the First FVG and the Last FVG that formed during that specific 1-hour window.
It automatically extends the boxes of these specific FVGs to match the right edge (end time) of the Silver Bullet session box.
4. Memory and Optimization
To prevent TradingView from throwing "too many drawings" errors or causing lag on your chart:
It uses a custom data structure (SBSessionData) to manage the state of each session cleanly.
At the start of every new day, it runs a cleanup function (clearDrawings()) that deletes older session boxes and FVGs if they exceed the user-defined sb_lookback limit (default 100 historical boxes).
Here is a breakdown of its functionality:
1. Specific Time Sessions
The script monitors three specific 1-hour time windows (defaulting to New York time, but adjustable):
London Silver Bullet: 03:00 - 04:00
New York AM Silver Bullet: 10:00 - 11:00
New York PM Silver Bullet: 14:00 - 15:00
Each of these sessions can be toggled on/off individually, and their border colors customized.
2. Session Range Highlighting
When one of these 1-hour sessions begins, the script starts tracking the absolute Highest and Lowest price reached during that hour.
Once the session ends, it draws a large, semi-transparent box encapsulating that entire 1-hour price action range.
The box is labeled in the bottom right corner (e.g., "Lon SB" or "NY AM SB") so you can easily visually identify the Silver Bullet hour in hindsight.
3. First and Last FVG Detection
This is the most unique feature of the script. While standard indicators highlight every FVG, this script filters them based on the Silver Bullet sessions:
It continuously looks for standard 3-candle Fair Value Gaps (both bullish and bearish).
However, it only plots FVGs if they occur inside one of the active Silver Bullet sessions.
Furthermore, to reduce clutter, it only stores and plots the First FVG and the Last FVG that formed during that specific 1-hour window.
It automatically extends the boxes of these specific FVGs to match the right edge (end time) of the Silver Bullet session box.
4. Memory and Optimization
To prevent TradingView from throwing "too many drawings" errors or causing lag on your chart:
It uses a custom data structure (SBSessionData) to manage the state of each session cleanly.
At the start of every new day, it runs a cleanup function (clearDrawings()) that deletes older session boxes and FVGs if they exceed the user-defined sb_lookback limit (default 100 historical boxes).
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.