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");