OPEN-SOURCE SCRIPT

Volume Price Trend (VPT)

由BiggWigg提供
已更新

The Volume Price Trend (VPT) is a technical analysis indicator that combines price and volume data. It's used to identify the direction of a trend or to confirm the strength of a trend. The indicator was developed on the premise that volume often precedes price.

Working of VPT:

VPT is calculated by adding or subtracting a multiple of the percentage change in the share price trend and current volume, depending upon the direction of the share price. The starting point of the VPT line is arbitrary.

The formula for calculating VPT is:

VPT = Previous VPT + Volume x (Today's Close - Previous Close)

This formula adds the total volume traded on the days the price went up, and subtracts the total volume on the days the price went down.

For each period:

If the closing price is higher than the previous closing price, the volume for that period is added to the previous VPT.
If the closing price is lower than the previous closing price, the volume for that period is subtracted from the previous VPT.
If the closing price is the same as the previous closing price, the volume for that period does not affect the VPT (i.e., it remains the same as the previous VPT).

Usage and Interpretation of VPT:

The primary use of the VPT is to help confirm the condition of prices. It’s usually used in combination with other technical analysis indicators. Here are some ways traders use the VPT:

Trend Confirmation: A rising VPT line typically confirms an uptrend as it shows that volume is increasing as prices increase. Conversely, a falling VPT line confirms a downtrend.

Divergences: Traders often look for divergences between the VPT and price movements as a sign of upcoming reversals. If prices are rising and the VPT is falling, it suggests that the upward trend may not sustain because it isn't being supported by volume. Similarly, if prices are falling and the VPT is rising, it suggests the downward trend may reverse soon.

Change in Trend: A sudden sharp increase in the VPT could signal a possible change in trend. This is based on the belief that volume changes before price.

In the script provided, the VPT is calculated and then rescaled to a 0-100 scale, which makes it easier to compare across different stocks or time periods. This script also colors the VPT line based on whether it's increasing or decreasing. The color is green when VPT is increasing, and red when it's decreasing.

Enjoy!
版本注释
Added an option for smoothing via SMA
Oscillators

开源脚本

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

想在图表上使用此脚本?

免责声明