Hello,
Tomasz provided code for the July issue of Technical Analysis of
Stock & Commodities magazine along with a picture of a chart. In the
picture there are buy/sell arrows which don't seem to be in the code.
I am wondering how I would plot this - do I need to write a seperate
code to plot the arrows as seperate overlay? Below is the code
Any help is appreciated.
Thanks in advance!
mike
// Volume Price Confirmation Indicator (VCPI) CODE
// volume weighted MA
function VWMA( array, period )
{
return Sum( array * V, period ) / Sum( V, period );
}
// Volume Price Confirmation Indicator
function VPCI( speriod, Lperiod )
{
Vw = VWMA( C, lperiod );
Vpc = Vw - MA( C, lperiod );
Vpr = VWMA( C, speriod ) / MA( C, speriod );
Vm = MA( V, speriod ) / MA( V, Lperiod );
return Vpc * Vpr * Vm;
}
// plot VPCI
speriod = Param("Short period", 5, 1, 50, 1 );
lperiod = Param("Long period", 20, 1, 100, 1 );
Vp = VPCI( speriod, Lperiod );
Plot( Vp, "VPCI"+ _PARAM_VALUES(), colorRed );
// and VPCI smoothed
aperiod = Param("Smoothing period", 20, 1, 30, 1 );
Vps = MA( Vp, aperiod);
Plot( Vps, "MA("+aperiod+")", colorBlue );
// simple trading system follows
Buy = Vp > Vps AND
ADX( 7 ) > 10 AND
MACD( 12, 26 ) > Signal( 12, 26, 9 );
Sell = Vps < Vp;