Volume Price Trend (VPT or PVT)

Studies that have been contributed to the community by other users. If you’ve got something useful to share, that’s great!
Laurent
Posts: 159
Joined: 20 Nov 2010
Location: France
Has thanked: 76 times
Been thanked: 32 times

Volume Price Trend (VPT or PVT)

Postby Laurent » 10 Feb 2011

Just finished to write the VPT.
I hope my formulas are correct ;)

Here is the description:
http://en.wikipedia.org/wiki/Volume_Price_Trend

It looks like the OBV, if that interests somebody!

Code: Select all

// VPT - Volume Price Trend - Function

Inputs:
   Series1 ( NumericSeries ),   // Close
   Series2 ( NumericSeries );   // Volume or Ticks

if (CurrentBar >= 2) and (Series1[1] > 0) then
   VPT = VPT[1] + Series2 * ((Series1 - Series1[1]) / Series1[1])
else
   VPT = 0;


Code: Select all

// VPT - Volume Price Trend - Indicator

Inputs:
   ClosePrice ( Close ),
   AnyVol ( Volume ),
   Displace ( 0 );

Variables:
   MyVPT ( 0 );

MyVPT = VPT(ClosePrice, AnyVol);

Plot1[Displace](MyVPT, "VolumePriceTrend");

Return to “User Contributed Studies and Indicator Library”