Help to identify peak and trough in a indicator

hmsanil

Active Member
#21
First thing, when you plot as indicator (means no price chart), what is the value shown on the Y-Axis ?

Does it tally with the price chart value ?
if not why ?
cause there is a Volume play in the formula.


To display the price chart and the non-tally indicator together, do the following:

Plot(Zigq,"zigq",colorWhite, styleOwnScale);
Hi

Thank you very much KelvinHand

I am getting it now.

Thanks again
 

casoni

Well-Known Member
#24
Hello giuditta,
here's the code

disp1=ParamToggle("Display Mode","Indicator Mode|Signal Mode",0);
PerChange = Param( "PerChange", 10, 0, 100, 1 );
a = C-2*Ref(H,-1) + Ref(L,-2);
s = V*(C-Ref(H,-1));
q=a+s;
set=LowestVisibleValue(q);
Pos=q-set;
zz=Zig(Pos,PerChange)+set;
dzz = zz - Ref(zz,-1);
pr=Ref(dzz,-1) > 0 AND dzz > 0 AND Ref(dzz,1) < 0;
ps=Ref(dzz,-1) < 0 AND dzz < 0 AND Ref(dzz,1) > 0;
x=Cum(1);
if(disp1==1)
{
xa = ValueWhen( pr, x-1, 1 );
Ya = ValueWhen(pr,H, 1 );
xb = ValueWhen(ps, x-1, 1 );
Yb = ValueWhen(ps, L, 1 );
r21=IIf(x>xa,ya,Null);
s21=IIf(x>xb,yb,Null);
Plot(R21,"",colorPaleGreen,24|styleNoLabel);
Plot(S21,"",colorPaleBlue,24|styleNoLabel);
SetBarFillColor(IIf(C>O,colorGreen,IIf(C<=O,colorRed,colorLightGrey)));
Plot(C,"Price",47,64,0,0,0,0);
}
else if(disp1==0)
{
Plot(ZZ,"zigq",colorWhite);
Plot(Q,"",4,6);
xa = ValueWhen( pr, x-1, 1 );
Ya = ValueWhen(pr,q, 1 );
xb = ValueWhen(ps, x-1, 1 );
Yb = ValueWhen(ps, q, 1 );
r21=IIf(x>xa,ya,Null);
s21=IIf(x>xb,yb,Null);
Plot(R21,"",colorPaleGreen,8|styleNoRescale|styleNoLabel);
Plot(S21,"",colorPaleBlue,8|styleNoRescale|styleNoLabel);
}
 

Similar threads