Chicago Illinois USA
Posts: 7 since Jul 2017
Thanks Given: 0
Thanks Received: 1
|
I have this code but the only thing that plots is the zeroline. Any suggestions?
Inputs:Period(130),Coef(.2),VCoef(2.5), SmoothingPeriods(3);
Vars:TP(0), Inter(0), VInter(0), CutOff(0), VAve(0), VMax(0), VC(0), MF(0),
DirectionalVolume( 0 ), myVFI(0);
TP = TypicalPrice;
if TP > 0 and TP[1] > 0 then
Inter = Log(TP) - Log(TP[1])
else Inter = 0;
VInter = StdDev( Inter, 30 );
CutOff = Coef * VInter * Close;
VAve = Average(V,50)[ 1 ];
VMax = VAve * VCoef;
VC = IFF( V < VMax , V, VMax );
MF = TP - TP[1];
DirectionalVolume = IFF( MF > CutOff, +VC, IFF( MF < -CutOff, -VC, 0 ) );
if VAve <> 0 then
myVFI = Summation( DirectionalVolume, Period ) / Vave
else myVFI = 0;
If SmoothingPeriods > 0 then myVFI = XAverage(myVFI, SmoothingPeriods)
else myVFI = myVFI;
Plot1(myVFI,"VFI",GREEN);
Plot2(0 ,"0");
|