Count UpTickDownTicks for Amibroker (AFL)
thakkarps about 15 years ago Amibroker (AFL)
This is for short term trading
Indicator / Formula
Copy & Paste Friendly
UpTick = C > Ref(C, -1);
DnTick = C < Ref(C, -1);
// then, say you want to count all upticks since the selected bar in a chart
SelBI = SelectedValue(BarIndex()) ;
TotUpTick = 0;
for(i = SelBI; i < BarCount; i++)
{
TotUpTick = TotUpTick + UpTick[i];
}
ConsecCZ10UP = BarsSince(C <= Ref(C,-1));
ConsecCZ10Dn = BarsSince(C >= Ref(C,-1));
updncz10=(Conseccz10up-Conseccz10dn);
Plot(0,"",colorBlack,styleLine);
Plot(updncz10,"UptickDntick",IIf(updncz10>0,colorBlue,colorRed),styleHistogram|styleThick);
2 comments
Leave Comment
Please login here to leave a comment.
THNK VRY MUCH
Good Afl, those who are interested in such things, can also explore Lucas and given in this forum….