OPEN-SOURCE SCRIPT

Price Volume Trendline

The Price Volume Trendline indicator calculates and displays a linear regression trendline based on the product of volume and price (e.g., Volume * Close, Volume * Open, etc.) for a specified timeframe. The indicator helps visualize the relationship between price and volume movements over time.

Note - Please choose a timeframe to display the trendline.

Key Features:

Linear Regression: The trendline is computed using a linear regression of Volume * Price values over a user-defined length (length_trend), providing a smoothed representation of the trend.

Color Coding: The trendline color changes dynamically:
Green: When the slope of the trendline is positive (indicating an uptrend in Volume * Price).
Red: When the slope of the trendline is negative (indicating a downtrend in Volume * Price).
Customizable Timeframe: Users can choose the timeframe for the Volume * Price calculation (either "auto" for the chart's timeframe or a custom timeframe).

This indicator is useful for identifying long-term trends in the relationship between price and volume, highlighting bullish or bearish conditions based on both price and volume dynamics.

Please feel free to share your feedback. That would be appreciated!
Linear RegressionPrice Volume Trend (PVT)

开源脚本

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

想在图表上使用此脚本?

免责声明