飞狐三点定亁坤指标主图公式、源码
使用说明:
主图很清晰的表明了顶底点位置,大家一看就明白。
指标只是工具,要客观理性的去对待!
【飞狐】
//aad:=BACKSET(tjd,peakBARS(m,n,2));
//ad:=aad<REFX(aad,1);
//bbd:=BACKSET(tjd,peakBARS(m,n,1));
//bd:=bbd<REFX(bbd,1);
//v2:=if(bd,1,0);
//abd:LINEVALUE(ad,h,bd,h,0,0),linethick0;
//kkad:=refx(abd,1)-abd;
//DRAWSL(vv=abd and ad,h,kkad,la,0),colorgreen,linethick2;
//ccd:=sum(abd>vv and ref(abd,1)<ref(vv,1),BARSLAST(bd))=1 and peakBARS(m,n,1)=0 and peak(m,n,2)>=ref(abd,peakBARS(m,n,2));
//cd:=ccd>ref(ccd,1);
//bcd:=LINEVALUE(bd,h,cd,h,0,0),linethick0;
//kkbd:=refx(bcd,1)-bcd;
//DRAWSL(vv=abd and v2,h,kkbd,lb,0),COLORblue,linethick2;
//DRAWSL(cd,h,0,lc,0),COLORWHITE,linethick2;
//DRAWTEXT(vv=abd and ad,h*1.05,'A'),COLORWHITE;
//DRAWTEXT(vv=abd and v2,h*1.05,'B'),COLORWHITE;
//DRAWTEXT(cd,h*1.05,'C'),COLORWHITE;
//上升下降通道
hh:=hhv(h,0);
hhh:=h;
aa:=BARSLAST(h=hh[datacount]);
ba:=datacount-aa;
ja:=1;
tm1:=999999;
for i1=ba[datacount]+1 to datacount do begin k1:=(hh[datacount]-hhh[i1])/ja;
if k1<tm1 then begin tm1:=k1;
ts1:=ja;
end;
ja:=ja+1;
end;
//A1:LINEVALUE(h=hh[datacount] and aa=0,h,BARPOS=datacount-
aa[datacount]+ts1,h,0,0),colorffff54;
cha:=hhv(abs(l-a1),aa); //A2:a1-cha[datacount],colorffff54;
//AI:a1-cha[datacount]/2,colorffff54,LINEDASH;
ll:=llv(l,0); lll:=l;
a3:=BARSLAST(l=ll[datacount]);
b3:=datacount-a3; j3:=1;
tm3:=999999; for i3=b3[datacount]+1 to datacount do begin k3:=(lll[i3]-ll[datacount])/j3;
if k3<tm3 then begin tm3:=k3;
ts3:=j3; end; j3:=j3+1;
end;
//B1:LINEVALUE(l=ll[datacount] and a3=0,l,BARPOS=datacount-a3[datacount]+ts3,l,0,0),color5454ff;
chb:=hhv(abs(h-b1),a3); //b2:b1+chb[datacount],color5454ff; //bi:b1+chb[datacount]/2,color5454ff,LINEDASH;
zdj:low;