Volume Price Confirmation Indicator (VPCI) for ThinkorSwim

BenTen

BenTen

Administrative
Staff
VIP
VPCI or known as Volume Price Confirmation Indicator was developed by Buff Dormeier. It plots the relationship between the price trend and the volume.



You may find this excerpt interesting (full article):

> Fundamentally, the VPCI reveals the proportional imbalances between price trends and volume-adjusted price trends. An uptrend with increasing volume is a market characterized by greed supported by the fuel needed to grow. An uptrend without volume is complacent and reveals greed deprived of the fuel needed to sustain itself. Investors without the influx of other investors ( volume ) will eventually lose interest and the uptrend should eventually breakdown. A falling price trend reveals a market driven by fear. A falling price trend without volume reveals apathy, fear without increasing energy. Unlike greed, fear is self-sustaining, and may endure for long time periods without increasing fuel or energy. Adding energy to fear can be likened to adding fuel to a fire and is generally bearish until the VPCI reverses. In such cases, weak-minded investor's, overcome by fear, are becoming irrationally fearful until the selling climax reaches a state of maximum homogeneity. At this point, ownership held by weak investor’s has been purged, producing a type of heat death capitulation. These occurrences may be visualized by the VPCI falling below the lower standard deviation of a Bollinger Band of the VPCI, and then rising above the lower band, and forming a 'V' bottom.

thinkScript Code

Rich (BB code):
#//
#// @author LazyBear
#//
#// If you use this code in its orignal/modified form, do drop me a note.
#//
#study("Volume Price Confirmation Indicator [LazyBear]", shorttitle="VPCI_LB" )
# Converted to TOS by Rigel 2018.
#
declare lower;
input shortTerm = 5;
input longTerm = 20;
def agg=aggregationPeriod.MIN;
input src = close;
input BBlength = 20; #, title="BB Length"
input mult = 2.5;
def vpc = vwap(period=longTerm*agg) - Average(src, longTerm);
def vpr = vwap(period=shortTerm*agg) / Average(src, shortTerm);
def vm = Average(volume, shortTerm) / Average(volume, longTerm);

plot vpci = vpc * vpr * vm;
vpci.setDefaultColor(color.green);
plot zero=0;
zero.setdefaultColor(color.cyan);

input lengthMA=8 ; #, "VPCI MA Length"
plot MA = Average(vpci, lengthMA);
MA.setdefaultColor(color.pink);

def bb_s = vpci;
plot basis = Average(bb_s, BBlength);
def dev = (mult * StDev(bb_s, BBlength));
plot upper = (basis + dev);
plot lower = (basis - dev);
basis.setdefaultColor(color.white);
basis.setPaintingStrategy(PaintingStrategy.line);
basis.setStyle(curve.SHORT_DASH);

Shareable Link

https://tos.mx/DbMSRi

This indicator was converted to ThinkorSwim by rigel from the TradingView version developed by LazyBear.
 
Last edited:
netarchitech

netarchitech

Well-known member
VIP
Doesn't display for me. The code looks fine. No gripes from the compiler. Puzzling...

 
Last edited:
BenTen

BenTen

Administrative
Staff
VIP
@netarchitech I can see it on the 5 min and thats it. Not sure whats wrong with it on longer timeframes.

 
Last edited:
netarchitech

netarchitech

Well-known member
VIP
@BenTen I'll check it on the 5min...Thanks for the swift response :)

 
Last edited:
netarchitech

netarchitech

Well-known member
VIP
@BenTen No go on the 5min :( Oh well, there are plenty of other indicators :)

 
Last edited:
BenTen

BenTen

Administrative
Staff
VIP
@netarchitech That screenshot I posted was on the 5min.

 
Last edited:
netarchitech

netarchitech

Well-known member
VIP
@BenTen OK, thanks...Funny thing is this is the first time I've ever had an issue like this. Just in case it's something with my system I tested another new and interesting indicator...no problem whatsoever...weird...

 
Last edited:
BenTen

BenTen

Administrative
Staff
VIP
@netarchitech You have to enable pre-market if you haven't aldready

 
Last edited:
netarchitech

netarchitech

Well-known member
VIP
Aha! I'll give it a try :)

 
Last edited:
netarchitech

netarchitech

Well-known member
VIP
@BenTen I finally see it! On the 5 min... Thanks again, BenTen 😀

 
Last edited:
N

Nick

Active member
2019 Donor
VIP
Hi all, my preferred trading timeframe is Daily and got someone to help me to modify the codes accordingly. May i know if this indicator is suitable for Daily timeframe and request your assistance to validate if the parameters used are suitable for Daily timeframe?

What should i do if i want to change to weekly timeframe? Do i need to change to lengthMA if it is on weekly timeframe?

Code:
declare lower;

def vpc_new = (Sum(close * volume, 20) / (Sum(volume, 20))) - (Sum(close, 20) / 20);
def vpr_new = (Sum(close*volume,5)/(Sum(volume, 5)))/(Sum(close, 5)/5);
def vm_new = (Sum(volume, 5) / 5) / (Sum(volume, 20) / 20);
plot vpci_new = vpc_new * vpr_new * vm_new;
vpci_new.SetDefaultColor(Color.CYAN);

plot zero = 0;
zero.SetDefaultColor(Color.WHITE);

### if you want to plot moving average use the code below ###

input lengthMA=5 ; #, "VPCI MA Length"
plot MA = Average(vpci_new, lengthMA);
MA.setdefaultColor(color.pink);

Thanks
 
N

Nick

Active member
2019 Donor
VIP
Hi all, can someone help me to add the script for an Arrow Down whenever the VPCI cuts below MA and Arrow Up when ever VPCI Cuts Above the MA.
thanks
 
N

Ninja Bull

New member
@netarchitech I can see it on the 5 min and thats it. Not sure whats wrong with it on longer timeframes.


Hey Ben, I am not a coder, but I started to play around with this script. This is just a thought.

But I think the problem lies here:
input shortTerm = 5;
input longTerm = 20;

When I changed the shortTerm to 10 it worked on the 10 min chart.

This indicator is very good if you are Volume Profile trader.

Hopefully you can figure out what is wrong with it and make it work.

Thank you!
 

Similar threads

Top