缠论主图+彩色MACD 通达信主图/副图指标 源码 贴图
{ K 0,1,0 设定参数}{缠论高低点}
局部低点预选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);
缺口判断:=IF(L REF(H,1),1,IF(H REF(L,1),-1,0));
距前高天:=BARSLAST(局部高点预选C=1);
距前低天:=BARSLAST(局部低点预选C=-1);
小值周期:=LOWRANGE(L);
大值周期:=TOPRANGE(H);
低保留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);
预判:=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);
距前高天A:=BARSLAST(高保留=1);
距前低天A:=BARSLAST(低保留=-1);{www.9m8.cn 九毛八公式指标网}
预判X:=IF((距前低天A 4 AND HHV(缺口判断,距前低天A)!=1) OR REF(低保留,距前低天A)=0,1,0);
判断X:=IF(局部高点预选C=1 AND REF(距前低天A,1) =REF(距前高天A,1) AND 预判X=1 AND 大值周期 REF(小值周期,距前低天A+1) AND 大值周期 REF(小值周期,距前低天A) AND 大值周期 REF(大值周期,距前高天A),1,0);
高保留XA:=IF(局部高点预选C=1 AND REF(距前低天A,1) REF(距前高天A,1) AND HHV(H,距前低天A+1) REF(HHV(H,距前低天A+1),1),1,0);
高保留XB:=IF(局部高点预选C=1 AND REF(距前低天A,1) =REF(距前高天A,1) AND REF(低保留,距前低天A)=-1 AND (距前低天A =4 OR HHV(缺口判断,距前低天A)=1),1,0);
高保留X:=IF((高保留XA=1 OR 高保留XB=1 OR 判断X=1) AND H REF(L,距前低天A+1),1,0);
预判XA:=IF((距前高天A 4 AND HHV(缺口判断,距前高天A)!=1) OR REF(高保留XA,距前高天A)=0,1,0);
判断XA:=IF(局部低点预选C=-1 AND REF(距前高天A,1) =REF(距前低天A,1) AND 预判XA=1 AND 小值周期 REF(大值周期,距前高天A+1) AND 小值周期 REF(大值周期,距前高天A) AND 小值周期 REF(小值周期,距前低天A),-1,0);
低保留XA:=IF(局部低点预选C=-1 AND REF(距前高天A,1) REF(距前低天A,1) AND LLV(L,距前高天A+1) REF(LLV(L,距前高天A+1),1),-1,0);
低保留XB:=IF(局部低点预选C=-1 AND REF(距前高天A,1) =REF(距前低天A,1) AND (距前高天A =4 OR LLV(缺口判断,距前高天A)=-1 OR 判断XA=-1),-1,0);
低保留X:=IF((低保留XA=-1 OR 低保留XB=-1) AND L REF(H,距前高天A+1),-1,0);
距前高天YA:=BARSLAST(高保留X=1);
距前低天YA:=BARSLAST(低保留X=-1);
预判YX:=IF((距前低天YA 4 AND HHV(缺口判断,距前低天YA)!=1) OR REF(低保留X,距前低天YA)=0,1,0);
判断YX:=IF(局部高点预选C=1 AND REF(距前低天YA,1) =REF(距前高天YA,1) AND 预判YX=1 AND 大值周期 REF(小值周期,距前低天YA+1) AND 大值周期 REF(小值周期,距前低天YA) AND 大值周期 REF(大值周期,距前高天YA),1,0);
高保留YXA:=IF(局部高点预选C=1 AND REF(距前低天YA,1) REF(距前高天YA,1) AND HHV(H,距前低天YA+1) REF(HHV(H,距前低天YA+1),1),1,0);
高保留YXB:=IF(局部高点预选C=1 AND REF(距前低天YA,1) =REF(距前高天YA,1) AND REF(低保留X,距前低天YA)=-1 AND (距前低天YA =4 OR HHV(缺口判断,距前低天YA)=1),1,0);
高保留YX:=IF((高保留YXA=1 OR 高保留YXB=1 OR 判断YX=1) AND H REF(L,距前低天YA+1),1,0);
预判YXA:=IF((距前高天YA 4 AND HHV(缺口判断,距前高天YA)!=1) OR REF(高保留YXA,距前高天YA)=0,1,0);
判断YXA:=IF(局部低点预选C=-1 AND REF(距前高天YA,1) =REF(距前低天YA,1) AND 预判YXA=1 AND 小值周期 REF(大值周期,距前高天YA+1) AND 小值周期 REF(大值周期,距前高天YA) AND 小值周期 REF(小值周期,距前低天YA),-1,0);
低保留YXA:=IF(局部低点预选C=-1 AND REF(距前高天YA,1) REF(距前低天YA,1) AND LLV(L,距前高天YA+1) REF(LLV(L,距前高天YA+1),1),-1,0);
低保留YXB:=IF(局部低点预选C=-1 AND REF(距前高天YA,1) =REF(距前低天YA,1) AND (距前高天YA =4 OR LLV(缺口判断,距前高天YA)=-1 OR 判断YXA=-1),-1,0);
低保留YX:=IF((低保留YXA=-1 OR 低保留YXB=-1) AND L REF(H,距前高天YA+1),-1,0);
AAAD:=IF(高保留YX=1 AND 低保留YX=-1 AND H REF(H,REF(距前高天YA,1)+2),1,IF(高保留YX=1 AND 低保留YX=-1 AND L REF(L,REF(距前低天YA,1)+2),-1,0));
极点保留:=IF(AAAD=0,高保留YX+低保留YX,AAAD);
局部极点:IF(极点保留=-1,L,IF(极点保留=1,H,DRAWNULL)),CIRCLEDOT,COLORYELLOW;
局部天数:BARSLAST(ABS(极点保留)),NODRAW;
局部换手:IF(极点保留=0,SUM( HSL.HSL ,局部天数),0),NODRAW;
局部涨跌:C/REF(C,局部天数)*100-100,NODRAW,COLORWHITE;
换手G:=VARCAT(VAR2STR(SUM( HSL.HSL ,BARSLAST(高保留X)),2),'%H ');
高点换手:=VARCAT(VARCAT(VARCAT(换手G,'('),VAR2STR(BARSLAST(高保留X),0)),'T)');
换手D:=VARCAT(VAR2STR(SUM( HSL.HSL ,BARSLAST(低保留X)),2),'%H ');
低点换手:=VARCAT(VARCAT(VARCAT(换手D,'('),VAR2STR(BARSLAST(低保留X),0)),'T)');
高跌幅:=IF(K=1,L/REF(H,BARSLAST(高保留X))*100-100,C/REF(C,BARSLAST(高保留X))*100-100);
低涨幅:=IF(K=1,H/REF(L,BARSLAST(低保留X))*100-100,C/REF(C,BARSLAST(低保留X))*100-100);
高跌幅A:=VARCAT(VAR2STR(高跌幅,2),'%F');
低涨幅A:=VARCAT(VAR2STR(低涨幅,2),'%F');
高点显示:=VARCAT(低点换手,低涨幅A);
低点显示:=VARCAT(高点换手,高跌幅A);
DRAWLINE(极点保留=-1,局部极点,极点保留=1,局部极点,0),COLORLIRED;
DRAWLINE(极点保留=1,局部极点,极点保留=-1,局部极点,0),COLORYELLOW;
{www.9m8.cn 九毛八公式指标网}
DRAWTEXT(极点保留=-1,L*0.99,低点显示),COLORGREEN;
DRAWTEXT(极点保留=1,H*1.01,高点显示),COLORYELLOW;
{彩色MACD}
VA:=IF(CLOSE REF(CLOSE,1),VOL,-VOL);
OBV1:=SUM(IF(CLOSE=REF(CLOSE,1),0,VA),0);
OBV2:=EMA(OBV1,3)-MA(OBV1,9);
OBV3:=EMA(IF(OBV2 0,OBV2,0),3);
MAC3:=MA(C,3);
SHORT:=12;LONG:=26;MID:=9;
DIF1:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG)COLORYELLOW ;
DEA1:EMA(DIF1,MID)COLORFF9900 ;
MACC:=(DIF1-DEA1)*2;{www.9m8.cn 九毛八公式指标网}
STICKLINE(OBV3 REF(OBV3,1) AND MAC3 REF(MAC3,1),0,MACC,2,0),COLORYELLOW;
{持币:STICKLINE((SAR(10,2,20) =H),MACD,0,1.5,0),COLORGREEN;
持股:STICKLINE((SAR(10,2,20) =L),0,MACD,1.5,0),COLORYELLOW;}
吸:=XLPL.NOTEXT吸,COLORA68064,CIRCLEDOT,LINETHICK3;
拉:=XLPL.NOTEXT拉,COLORRED,CIRCLEDOT,LINETHICK3;
派:=XLPL.NOTEXT派,COLORGREEN,CIRCLEDOT,LINETHICK3;
落:=XLPL.NOTEXT落,COLORWHITE,CIRCLEDOT,LINETHICK3;
STICKLINE(吸,0,MACC,1,0),COLORA68064;
STICKLINE(拉 OR 吸=拉,0,MACC,1,0),COLORRED;
STICKLINE(派,0,MACC,1,0),COLORGREEN;
STICKLINE(落,0,MACC,1,0),COLORWHITE;
入1:IF(DIF1 REF(DIF1,1),DIF1,DRAWNULL),COLORRED,LINETHICK1;
入2:IF(DIF1 REF(DIF1,1),DIF1,DRAWNULL),COLOR00FF00,LINETHICK1;