OPEN-SOURCE SCRIPT

Volume Price Trend (VPT)

已更新

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精神中,這個腳本的作者以開源的方式發佈,這樣交易員可以理解和驗證它。請向作者致敬!您可以免費使用它,但在出版物中再次使用這段程式碼將受到網站規則的約束。 您可以收藏它以在圖表上使用。

想在圖表上使用此腳本?

免責聲明