OPEN-SOURCE SCRIPT
ATK/DEF The Session Volume For Fair Value Gap

ATK/DEF — The Session Volume For Fair Value Gap is a quantitative market observation framework combining **Fair Value Gap (FVG), formation volume, and session volume**.
The framework organizes FVG formation and session activity into a unified view, allowing the displayed data to represent how price gaps and volume conditions are distributed across different sessions.
## Core Framework
**FVG + Formation Volume + Session Volume**
The system combines three primary components:
* Fair Value Gap structure
* Volume associated with FVG formation
* Session-based volume measurement
FVGs are detected using a three-bar price structure:
* Bullish FVG: `Low > High[2]`
* Bearish FVG: `High < Low[2]`
The minimum gap size can be adjusted through the FVG gap filter.
## FVG Formation Volume
Each detected FVG is associated with the combined volume of the three bars used to define the gap:
**FVG Formation Volume = Volume + Volume[1] + Volume[2]**
This value is displayed together with the corresponding FVG, providing a quantitative volume reference for the formation of the price gap.
The FVG itself represents a defined price gap structure. The associated formation volume provides an additional quantitative dimension for observing the conditions surrounding that gap.
Therefore, an FVG alone represents the existence of a price gap; the accompanying volume measurement adds another observable factor to the same formation.
## Session Volume
The framework separates volume into three session environments:
* Asia
* Europe
* US
For each session, the system records:
* Session volume
* Session open
* Session close
* Session volume magnitude
* Session-based price direction
Session volume is accumulated independently and represented after each session completes.
The session volume display provides a direct comparison of volume magnitude across the defined sessions within the current daily cycle.
## Session-Based FVG
Each FVG is assigned to the session of the middle bar used in its three-bar formation structure.
This allows every displayed FVG to retain its corresponding session context:
**Asia → Europe → US**
The FVG visualization therefore combines:
**Price Gap + Formation Volume + Session Context**
rather than treating every FVG as an isolated price structure.
## FVG Lifecycle
Detected FVGs remain visible according to the configured extension settings.
The framework can remove an FVG when price reaches the defined fill condition:
* Bullish FVG: price reaches the lower boundary
* Bearish FVG: price reaches the upper boundary
This provides a defined structural lifecycle for the displayed FVG regions.
## Quantitative Observation
The dashboard-free visual framework focuses on the relationship between:
**Session → Volume → FVG → Price Gap**
Session volume represents the measured volume accumulated during each defined session, while FVG formation volume represents the volume associated with the three-bar structure that creates the gap.
These measurements are displayed as quantitative observations rather than predefined market conclusions.
All classifications and visual elements are generated from the calculations and conditions defined within the script.
## Scope
This indicator is designed for **market observation and user-defined analysis only**.
The displayed FVG, formation volume, and session volume values are quantitative observations derived from price and volume data available to the script.
The framework organizes FVG formation and session activity into a unified view, allowing the displayed data to represent how price gaps and volume conditions are distributed across different sessions.
## Core Framework
**FVG + Formation Volume + Session Volume**
The system combines three primary components:
* Fair Value Gap structure
* Volume associated with FVG formation
* Session-based volume measurement
FVGs are detected using a three-bar price structure:
* Bullish FVG: `Low > High[2]`
* Bearish FVG: `High < Low[2]`
The minimum gap size can be adjusted through the FVG gap filter.
## FVG Formation Volume
Each detected FVG is associated with the combined volume of the three bars used to define the gap:
**FVG Formation Volume = Volume + Volume[1] + Volume[2]**
This value is displayed together with the corresponding FVG, providing a quantitative volume reference for the formation of the price gap.
The FVG itself represents a defined price gap structure. The associated formation volume provides an additional quantitative dimension for observing the conditions surrounding that gap.
Therefore, an FVG alone represents the existence of a price gap; the accompanying volume measurement adds another observable factor to the same formation.
## Session Volume
The framework separates volume into three session environments:
* Asia
* Europe
* US
For each session, the system records:
* Session volume
* Session open
* Session close
* Session volume magnitude
* Session-based price direction
Session volume is accumulated independently and represented after each session completes.
The session volume display provides a direct comparison of volume magnitude across the defined sessions within the current daily cycle.
## Session-Based FVG
Each FVG is assigned to the session of the middle bar used in its three-bar formation structure.
This allows every displayed FVG to retain its corresponding session context:
**Asia → Europe → US**
The FVG visualization therefore combines:
**Price Gap + Formation Volume + Session Context**
rather than treating every FVG as an isolated price structure.
## FVG Lifecycle
Detected FVGs remain visible according to the configured extension settings.
The framework can remove an FVG when price reaches the defined fill condition:
* Bullish FVG: price reaches the lower boundary
* Bearish FVG: price reaches the upper boundary
This provides a defined structural lifecycle for the displayed FVG regions.
## Quantitative Observation
The dashboard-free visual framework focuses on the relationship between:
**Session → Volume → FVG → Price Gap**
Session volume represents the measured volume accumulated during each defined session, while FVG formation volume represents the volume associated with the three-bar structure that creates the gap.
These measurements are displayed as quantitative observations rather than predefined market conclusions.
All classifications and visual elements are generated from the calculations and conditions defined within the script.
## Scope
This indicator is designed for **market observation and user-defined analysis only**.
The displayed FVG, formation volume, and session volume values are quantitative observations derived from price and volume data available to the script.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。