文华财经WH6高低点自动连线指标公式源码:
局部低点预选A:=BACKSET(LLV(L,5)<REF(LLV(L,4),1),4);
局部低点预选B:=BACKSET(局部低点预选A=0 AND REF(局部低点预选A,1)=1,2);
局部低点预选C:=IF(局部低点预选B=1 AND REF(局部低点预选B,1)=0,-1,0);
局部高点预选A:=BACKSET(HHV(H,5)>REF(HHV(H,4),1),4);
局部高点预选B:=BACKSET(局部高点预选A=0 AND REF(局部高点预选A,1)=1,2);
局部高点预选C:=IF(局部高点预选B=1 AND REF(局部高点预选B,1)=0,1,0);
局部极点A:=局部低点预选C+局部高点预选C;
AAAA:=IF(局部低点预选C=-1,L,NULL), CIRCLEDOT, COLORRED;
DRAWTEXT(局部低点预选C=-1,L,’●’),COLORBLACK,FONTSIZE20,VALIGN1;
DRAWTEXT(局部高点预选C=1,H,’●’),COLORBLACK,FONTSIZE20,VALIGN1;
缺口判断:=IF(L>REF(H,1),1,IF(H<REF(L,1),-1,0));
距前高天:=BARSLAST(局部高点预选C=1);
距前低天:=BARSLAST(局部低点预选C=-1);
小值周期:=NEWLBARS(L,1);
大值周期:=NEWHBARS(H,1);
低保留AA:=IF(局部低点预选C=-1 AND REF(距前高天,1)>REF(距前低天,1) AND LLV(L,距前高天+1)<REF(LLV(L,距前高天+1),1),-1,0);
低保留AB:=IF(局部低点预选C=-1 AND REF(距前高天,1)<=REF(距前低天,1) AND (距前高天>=4 OR LLV(缺口判断,距前高天)=-1 OR LLV(L,距前低天+2)<REF(LLV(L,距前低天+1),1)),-1,0);
低保留S:=IF((低保留AA=-1 OR 低保留AB=-1) AND L<REF(H,距前高天+1),-1,0);
//{云析赢指标公式网,指标公式,指标源码,指标编写教程、指标破解指标论坛。www.zbgs518.com}
预判:=IF((距前低天<4 AND HHV(缺口判断,距前低天)<>1) OR REF(低保留S,距前低天)=0,1,0);
判断:=IF(局部高点预选C=1 AND REF(距前低天,1)<=REF(距前高天,1) AND 预判=1 AND 大值周期>REF(小值周期,距前低天+1) AND 大值周期>REF(小值周期,距前低天) AND 大值周期>REF(大值周期,距前高天),1,0);
高保留A:=IF(局部高点预选C=1 AND REF(距前低天,1)>REF(距前高天,1) AND HHV(H,距前低天+1)>REF(HHV(H,距前低天+1),1),1,0);
高保留B:=IF(局部高点预选C=1 AND REF(距前低天,1)<=REF(距前高天,1) AND REF(低保留S,距前低天)=-1 AND (距前低天>=4 OR HHV(缺口判断,距前低天)=1),1,0);
高保留:=IF((高保留A=1 OR 高保留B=1 OR 判断=1) AND H>REF(L,距前低天+1),1,0);
预判A:=IF((距前高天<4 AND HHV(缺口判断,距前高天)<>1) OR REF(高保留,距前高天)=0,1,0);
判断A:=IF(局部低点预选C=-1 AND REF(距前高天,1)<=REF(距前低天,1) AND 预判A=1 AND 小值周期>REF(大值周期,距前高天+1) AND 小值周期>REF(大值周期,距前高天) AND 小值周期>REF(小值周期,距前低天),-1,0);
低保留A:=IF(局部低点预选C=-1 AND REF(距前高天,1)>REF(距前低天,1) AND LLV(L,距前高天+1)<REF(LLV(L,距前高天+1),1),-1,0);
低保留B:=IF(局部低点预选C=-1 AND REF(距前高天,1)<=REF(距前低天,1) AND (距前高天>=4 OR LLV(缺口判断,距前高天)=-1 OR 判断A=-1),-1,0);
低保留:=IF((低保留A=-1 OR 低保留B=-1) AND L<REF(H,距前高天+1),-1,0);
AAAD:=IF(高保留=1 AND 低保留=-1 AND H>REF(H,REF(距前高天,1)+2),1,IF(高保留=1 AND 低保留=-1 AND L<REF(L,REF(距前低天,1)+2),-1,0));
极点保留:=IF(AAAD=0,高保留+低保留,AAAD);
局部极点:=IF(极点保留=-1,L,IF(极点保留=1,H,NULL)) ,CIRCLEDOT, COLORYELLOW;
P:=IF(ISLASTBAR&&BARSLAST(极点保留=-1)<BARSLAST(极点保留-1),H,L);
DRAWLINE1(CROSS(BACKSET(极点保留=1,BARSLAST(极点保留=-1)+1),0.5),局部极点,CROSS(BACKSET(极点保留=-1,BARSLAST(极点保留=1)+1),0.5)||ISLASTBAR,IF(ISLASTBAR,P,局部极点),0),COLORRED,LINETHICK3;
DRAWLINE1(CROSS(BACKSET(极点保留=-1,BARSLAST(极点保留=1)+1),0.5),局部极点,CROSS(BACKSET(极点保留=1,BARSLAST(极点保留=-1)+1),0.5)||ISLASTBAR,IF(ISLASTBAR,P,局部极点),0),COLORBLUE,LINETHICK3;