OPEN-SOURCE SCRIPT
Cập nhật

ICT First Presented FVG with Volume Imbalance [1st P. FVG + VI]

940
The indicator identifies and highlights the first presented Fair Value Gap (FVG) occurringthe morning (09:30–10:00) and afternoon (13:30–14:00) session's first 30 minutes. It includes an optional feature to extend FVG zones when a volume imbalance (V.I.) is detected, providing additional context for areas of potential price inefficiency. This powerful combination helps traders identify significant market structure gaps that often act as support/resistance zones and potential price targets.

What is an FVG?
A Fair Value Gap, often abbreviated as FVG, is a price range on a chart where there is an inefficiency or imbalance in trading. This typically happens when price moves rapidly in one direction, leaving a gap between the wicks or bodies of three consecutive candles. For example, in a bullish move, if the low of the third candle is higher than the high of the first candle, the space between them is the FVG.

What is a Volume Imbalance?
A volume imbalance is a smaller, more precise inefficiency within price action, often visible as a "crack" or thin area in the price delivery. It represents a spot where the volume traded was not balanced between buyers and sellers, often seen as a thin wick or a gap between candle bodies.

FVG + Volume Imbalance:
When you have a fair value gap that contains a volume imbalance, it becomes a more significant area of interest. ICT teaches that you should not ignore a volume imbalance if it’s part of an FVG. In fact, you should use the volume imbalance in conjunction with the FVG to define your trading range more accurately


📊 Volume Imbalance Integration
  • Toggle Option: Enable/disable volume imbalance detection based on preference
  • Extended Boundaries: When enabled, FVG boundaries expand to include volume imbalance zones
  • Accurate Gap Sizing: Total gap calculation includes volume imbalance extensions
  • Multi-Scenario Support: Handles volume imbalances at start, end, or both sides of FVG formations


📈 Multiple Display Modes
  • Current Day: Shows only today's FVGs for clean chart analysis
  • Current Week: Displays all weekly FVGs for broader context
  • Forward Extension: Extends FVG boxes and CE, Upper/Lower Quadrant lines into the future


📊 Visualization
  • Bullish FVGs appear in semi-transparent blue or purple zones (depending on session).
  • Bearish FVGs appear in red or orange zones.
  • Optional dotted lines mark the CE (midpoint) of each FVG for additional reference.
  • Quadrant Division: Additional 25%/75% lines for large FVGs (configurable minimum gap size)


🎯 Smart Filtering
  • First Presentation Only: Only displays the initial FVG in each session, avoiding clutter
  • Minimum Gap Size: Configurable tick-based thresholds for AM and PM sessions
  • Core FVG Validation: Ensures only valid Fair Value Gaps are displayed


⚙️ Configuration Options
Display Settings
  • Show Mode: Current Day or Current Week view
  • Forward Extension: 1-500 bars projection
  • Day Labels: Toggle weekday labels in weekly mode
  • Text Color: Customizable label colors


Volume Imbalance Settings
  • Include Volume Imbalance: Master toggle for enhanced boundary calculation
  • Automatic Detection: Identifies imbalance scenarios without additional input


Session-Specific Settings
AM Session (09:30-10:00):
  • Enable/disable AM FVG detection
  • Customizable bullish/bearish colors
  • CE line visibility and coloring
  • Minimum gap size in ticks


PM Session (13:30-14:00):
  • Enable/disable PM FVG detection
  • Customizable bullish/bearish colors
  • CE line visibility and coloring
  • Minimum gap size in ticks


Quadrant Settings
  • Enable/Disable: Toggle quadrant line display
  • Minimum Gap: Tick threshold for quadrant activation
  • Line Style: Dotted, dashed, or solid
  • Color: Customizable quadrant line color



How It Works

FVG Boundary Calculation
  • Traditional FVG: High[2] to Low[0] (bullish) or Low[2] to High[0] (bearish)
  • Enhanced FVG: Extended boundaries to include volume imbalance zones when enabled
  • Total Gap Size: Calculated including any volume imbalance extensions


Volume Imbalance Detection
  • The indicator identifies volume imbalances by detecting bars where:
  • Bullish Imbalance: Current bar's body is completely above previous bar's body
  • Bearish Imbalance: Current bar's body is completely below previous bar's body


⚠️ Disclaimer
This script is a technical visualization tool only.
It does not provide financial advice, signals, or predictions. Always perform independent analysis and manage risk appropriately before making trading decisions.
Phát hành các Ghi chú
Key Features Added:
Weekly Days Toggle Group:
  • Added a new "Weekly Days" settings group with individual toggles for Monday through Friday
  • Organized in two inline rows (Mon-Tue-Wed and Thu-Fri) for better layout
  • All days default to true (enabled)


How It Works:
  • When "Current Week" mode is selected, the indicator will only show FVGs for the days that are toggled ON
  • For example, if you disable Tuesday and Thursday, you won't see any FVGs from those days in the weekly view
  • "Current Day" mode is unaffected by these settings
  • The day toggles are preserved across chart reloads


This gives you complete control over which days' FVGs are displayed in the weekly view, allowing you to focus on specific trading days or patterns that are most relevant to your strategy.


Day Check Function:
  • Created isDayEnabled() function that returns true if the current day is enabled in the weekly mode
  • Automatically handles weekends by returning false (they're not included in the toggles)


Weekly Mode Filter:
  • Added shouldProcessWeeklyFVG() function that checks if the current day should be processed in weekly mode
  • Returns true for "Current Day" mode and only returns true for "Current Week" mode if the specific day is enabled


Updated FVG Conditions:
  • Modified both AM and PM FVG detection conditions to include and shouldProcessWeeklyFVG()
  • This ensures that FVGs are only drawn for enabled days in weekly mode
Phát hành các Ghi chú
Minor Change
  • Changed the default quadrant color from yellow to gray
Phát hành các Ghi chú
Key Features Added:
AM Session CE Line Customization:
  • AM CE Style: Dropdown with dotted, dashed, solid options
  • AM CE Width: Integer input from 1 to 5


PM Session CE Line Customization:
  • PM CE Style: Dropdown with dotted, dashed, solid options
  • PM CE Width: Integer input from 1 to 5


Quadrant Line Width (Bonus):
  • Also added quadrantWidth input in the Quadrant Settings group
  • Allows you to control the thickness of quadrant lines as well


Now you can independently customize:

  • AM CE line style and thickness
  • PM CE line style and thickness
  • Quadrant line thickness (shared style with existing quadrant style setting)


This gives you complete control over the appearance of all lines in the indicator, allowing you to create visual hierarchies and emphasize certain elements based on your trading preferences.

Thông báo miễn trừ trách nhiệm

Thông tin và ấn phẩm không có nghĩa là và không cấu thành, tài chính, đầu tư, kinh doanh, hoặc các loại lời khuyên hoặc khuyến nghị khác được cung cấp hoặc xác nhận bởi TradingView. Đọc thêm trong Điều khoản sử dụng.