OPEN-SOURCE SCRIPT

Time-Based VWAP (TVWAP)

(TVWAP) Indicator
The Time-Based Volume Weighted Average Price (TVWAP) indicator is a customized version of VWAP designed for intraday trading sessions with defined start and end times. Unlike the traditional VWAP, which calculates the volume-weighted average price over an entire trading day, this indicator allows you to focus on specific time periods, such as ICT kill zones (e.g., London Open, New York Open, Power Hour). It helps crypto scalpers and advanced traders identify price deviations relative to volume during key trading windows.

Key Features:
Custom Time Interval:

You can set the exact start and end times for the VWAP calculation using input settings for hours and minutes (24-hour format).
Ideal for analyzing short, high-liquidity periods.
Dynamic Accumulation of Price and Volume:

The indicator resets at the beginning of the specified session and accumulates price-volume data until the end of the session.
Ensures that the TVWAP reflects the weighted average price specific to the chosen session.
Visual Representation:

The indicator plots the TVWAP line only during the specified time window, providing a clear visual reference for price action during that period.
Outside the session, the TVWAP line is hidden (na).
Use Cases:
ICT Scalp Trading:
Monitor price rebalances or potential liquidity sweeps near TVWAP during important trading sessions.

Mean Reversion Strategies:
Detect pullbacks toward the session’s average price for potential entry points.

Breakout Confirmation:
Confirm price direction relative to TVWAP during kill zones or high-volume times to determine if a breakout is supported by volume.

Inputs:
Start Hour/Minute: The time when the TVWAP calculation starts.
End Hour/Minute: The time when the TVWAP calculation ends.
Technical Explanation:
The indicator uses the timestamp function to create time markers for the session start and end.
During the session, the price-volume (close * volume) is accumulated along with the total volume.
TVWAP is calculated as:

TVWAP = (Sum of (Price × Volume)) ÷ (Sum of Volume)


Once the session ends, the TVWAP resets for the next trading period.
Customization Ideas:
Alerts: Add notifications when the price touches or deviates significantly from TVWAP.
Different Colors: Use different line colors based on upward or downward trends.
Multiple Sessions: Add support for multiple TVWAP lines for different time periods (e.g., London + New York).
Trend AnalysisVolatilityVolume

开源脚本

本着真正的TradingView精神,此脚本的作者已将其开源,以便交易者可以理解和验证它。向作者致敬!您可以免费使用它,但在出版物中重复使用此代码受网站规则约束。 您可以收藏它以在图表上使用。

想在图表上使用此脚本?


更多:

免责声明