缠论公式集

合集下载

缠论公式

缠论公式

{N1:1,100,10;N2:1,100,10;DISP:=1,3,2};N1:=10;N2:=10;DISP:=2;K:=IF(PERIOD=5,1,{日}IF(PERIOD=6,1,{周}IF(PERIOD=7,1,{月}IF(PERIOD=8,1,{多分钟}IF(PERIOD=9,1,{多日}IF(PERIOD=10,1,{季}IF(PERIOD=11,2,{年}IF(PERIOD=4,1,{60F}IF(PERIOD=3,1,{30F}IF(PERIOD=2,1,{15F}IF(PERIOD=1,1{5F},1{1F})))))))))))/10;P1:=PEAK(1,K*N1,1);P2:=PEAK(1,K*N1,2);WP1:=PEAKBARS(1,K*N1,1);WP2:=PEAKBARS(1,K*N1,2);T1:=TROUGH(2,K*N2,1);T2:=TROUGH(2,K*N2,2);WT1:=TROUGHBARS(2,K*N2,1);WT2:=TROUGHBARS(2,K*N2,2);TJ1:=P1>T1 AND P2>T2 ;ZD:=MAX(T1,T2);ZG:=MIN(P1,P2);LL:=MIN(T1,T2);HH:=MAX(P1,P2);TJ2:=FILTER(ZG>ZD,2);TJ3:=ZG=REF(ZG,BARSLAST(TJ2)) OR ZD=REF(ZD,BARSLAST(TJ2));TJ4:=TJ1&&TJ2&&NOT(TJ3);TJ5:=BETWEEN(ZD,REF(ZD,REF(BARSLAST(TJ4),1)),REF(ZG,REF(BARSLAST(TJ4),1))); TJ6:=BETWEEN(ZG,REF(ZD,REF(BARSLAST(TJ4),1)),REF(ZG,REF(BARSLAST(TJ4),1))); TJ7:=ZG>REF(ZG,REF(BARSLAST(TJ4),1))&&ZD<REF(ZD,REF(BARSLAST(TJ4),1));TJ8:=TJ4&&NOT(TJ5 OR TJ6 OR TJ7);ZSD:=IF(TJ8,ZD,DRAWNULL);ZSG:=IF(TJ8,ZG,DRAWNULL);ZSH:=IF(TJ8,HH,DRAWNULL);ZSL:=IF(TJ8,LL,DRAWNULL);STICKLINE(TJ8,ZSH,ZSL,0,-1),COLORMAGENTA;STICKLINE(TJ8,ZSD,ZSG,IF(DISP=1,3,0),1),COLORMAGENTA;DRAWTEXT(DISP=2,ZSH,'中枢'),COLORRED;中枢高:PLOYLINE(DISP=2,REF(ZSD,BARSLAST(TJ8))),CROSSDOT,COLORLIRED;中枢低:PLOYLINE(DISP=2,REF(ZSG,BARSLAST(TJ8))),CROSSDOT,COLORLIGREEN;中枢最高:PLOYLINE(DISP=2,REF(ZSH,BARSLAST(TJ8))),POINTDOT,COLORRED;中枢最低:PLOYLINE(DISP=2,REF(ZSL,BARSLAST(TJ8))),POINTDOT,COLORGREEN;趋势高:PLOYLINE(DISP=3,ZIG(1,K*N1)),COLORLIBLUE;趋势低:PLOYLINE(DISP=3,ZIG(2,K*N2)),COLORLIBLUE;局部低点预选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);预判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=1AND 大值周期>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((距前低天Y A<4 AND HHV(缺口判断,距前低天YA)!=1) OR REF(低保留X,距前低天YA)=0,1,0);判断YX:=IF(局部高点预选C=1 AND REF(距前低天Y A,1)<=REF(距前高天Y A,1) AND 预判YX=1 AND 大值周期>REF(小值周期,距前低天YA+1) AND 大值周期>REF(小值周期,距前低天YA) AND 大值周期>REF(大值周期,距前高天YA),1,0);高保留YXA:=IF(局部高点预选C=1 AND REF(距前低天Y A,1)>REF(距前高天YA,1) AND HHV(H,距前低天Y A+1)>REF(HHV(H,距前低天YA+1),1),1,0);高保留YXB:=IF(局部高点预选C=1 AND REF(距前低天YA,1)<=REF(距前高天Y A,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((距前高天Y A<4 AND HHV(缺口判断,距前高天Y A)!=1) OR REF(高保留YXA,距前高天YA)=0,1,0);判断YXA:=IF(局部低点预选C=-1 AND REF(距前高天YA,1)<=REF(距前低天YA,1) AND 预判YXA=1 AND 小值周期>REF(大值周期,距前高天Y A+1) AND 小值周期>REF(大值周期,距前高天YA) AND 小值周期>REF(小值周期,距前低天Y A),-1,0);低保留YXA:=IF(局部低点预选C=-1 AND REF(距前高天YA,1)>REF(距前低天YA,1) AND LLV(L,距前高天Y A+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(缺口判断,距前高天Y A)=-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;DRAWLINE(极点保留=-1,局部极点,极点保留=1,局部极点,0)COLORLIRED;DRAWLINE(极点保留=1,局部极点,极点保留=-1,局部极点,0)COLORYELLOW;DD1:=BARSLAST(ABS(极点保留)!=1);DRAWTEXT(极点保留=1,局部极点,'*'),COLORGREEN;DRAWTEXT(极点保留=-1,局部极点,'*'),COLORRED;MA5:MA(CLOSE,5),COLORFF00FF,LINETHICK2;判:IF(MA5<REF(MA5,1),MA5,DRAWNULL),COLORWHITE,LINETHICK2;。

目前最准确的通达信缠论分笔公式

目前最准确的通达信缠论分笔公式

目前最准确的通达信缠论分笔公式-CAL-FENGHAI.-(YICAI)-Company One1目前见到的最准确的通达信缠论分笔公式参数:老笔=1,使用老笔定义,默认为0,使用新笔定义G:=MA(C,5);D:=MA(C,10);HH:=REF(H,5)=HHV(H,11);LL:=REF(L,5)=LLV(L,11);FG01:=BACKSET(HH,6)>BACKSET(HH,5) ;FD01:=BACKSET(LL,6)>BACKSET(LL,5) ;FG02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND G>D,FG01, IF(BARSLAST(FD01)>BARSLAST(FG01),FG01,0));FD02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND D>G,FD01, IF(BARSLAST(FG01)>BARSLAST(FD01),FD01,0));FG0:=FG02 AND H=HHV(H,BARSLAST(FD02));FD0:=FD02 AND L=LLV(L,BARSLAST(FG02));GP:IF(FG0,H,DRAWNULL),CIRCLEDOT,COLORCYAN;DP:IF(FD0,L,DRAWNULL),CIRCLEDOT,COLORCYAN;GQ:=L>REF(H,1) AND DAY!=REF(DAY,1);DQ:=H<REF(L,1) AND DAY!=REF(DAY,1);GQL:=REF(L,BARSLAST(GQ));DQH:=REF(H,BARSLAST(DQ));FGH:=REF(H,BARSLAST(FG0));FGL:=REF(L,BARSLAST(FG0));FGH1:=REF(H,BARSLAST(FG0)+1);FGL1:=REF(L,BARSLAST(FG0)+1);FGH2:=REF(H,BARSLAST(FG0)+2);FGL2:=REF(L,BARSLAST(FG0)+2);FDH:=REF(H,BARSLAST(FD0));FDL:=REF(L,BARSLAST(FD0));FDH1:=REF(H,BARSLAST(FD0)+1);FDL1:=REF(L,BARSLAST(FD0)+1);FDH2:=REF(H,BARSLAST(FD0)+2);FDL2:=REF(L,BARSLAST(FD0)+2);FGZH:=IF(FGL<=FGL1,FGH2,FGH1);FGZL:=IF(FGH1<FGL,FGL,IF(FGL<=FGL1,FGL2,FGL1));FDZH:=IF(FDL1>FDH,FDH,IF(FDH>=FDH1,FDH2,FDH1));FDZL:=IF(FDH>=FDH1,FDL2,FDL1);FG1:=FGH>FDZH AND FG0;FD1:=FDL<FGZL AND FD0;FG:=FG1 AND FGH>FDH AND FGL>FDL AND FGL1>FDL;FD:=FD1 AND FDL<FGL AND FDH<FGH AND FDH1<FGH;BH0:=(H<=REF(H,1) AND L>=REF(L,1)) OR (H>=REF(H,1) AND L<=REF(L,1)); BHG:=COUNT(BH0,BARSLAST(FD0));BHD:=COUNT(BH0,BARSLAST(FG0));BGQ:=COUNT(GQ,BARSLAST(FD0));BDQ:=COUNT(DQ,BARSLAST(FG0));BK0:=IF(BHG>0,BHG+2+老笔,IF(BHD,BHD+2+老笔,3));BK:=IF(BGQ,BK0-BGQ,IF(BDQ,BK0-BDQ,BK0));G1X:=(FG AND BARSLAST(FD)>BK);D1X:=(FD AND BARSLAST(FG)>BK);G1:=(FG0 AND REF(H,BARSLAST(FG0))>=REF(H,BARSLAST(G1X)) AND BARSLAST(D1X)>BARSLAST(G1X))OR (FG1 AND COUNT(GQ,BARSLAST(FD1))>0 ANDREF(H,BARSLAST(FG1))>REF(H,BARSLAST(G1X)));D1:=(FD0 AND REF(L,BARSLAST(FD0))<=REF(L,BARSLAST(D1X)) AND BARSLAST(G1X)>BARSLAST(D1X))OR (FD1 AND COUNT(DQ,BARSLAST(FG1))>0 ANDREF(L,BARSLAST(FD1))<REF(H,BARSLAST(D1X)));G1H:=IF(BARSLAST(D1)>BARSLAST(G1),REF(H,BARSLAST(G1)),REF(H,BARSLAST(D 1))),;D1L:=IF(BARSLAST(G1)>BARSLAST(D1),REF(L,BARSLAST(D1)),REF(L,BARSLAST(G1) ));G2:=G1 AND H=HHV(G1H,BARSLAST(D1)+1) AND H>REF(H,1) AND BARSLAST(D1)>BARSLAST(G1);D2:=D1 AND L=LLV(D1L,BARSLAST(G1)+1) AND L<REF(L,1) ANDBARSLAST(G1)>BARSLAST(D1);G3:=G2 OR (FG0 AND REF(H,BARSLAST(FG0))>REF(H,BARSLAST(G2)) AND BARSLAST(D2)>BARSLAST(G2));D3:=D2 OR (FD0 AND REF(L,BARSLAST(FD0))<REF(L,BARSLAST(D2)) AND BARSLAST(G2)>BARSLAST(D2));GPB:IF(G1X,H,DRAWNULL),CIRCLEDOT,COLORYELLOW;DPB:IF(D1X,L,DRAWNULL),CIRCLEDOT,COLORYELLOW;{画线}NN:=G3;UU:=D3;L1:DRAWLINE(UU,L,NN, H,0),COLORLIGREEN;L2:DRAWLINE(NN,H,UU,L,0),COLORLIGREEN;{标示端点数值}{DRAWNUMBER(L1 AND L2 AND NN ,H,H),COLORLIRED;DRAWNUMBER(L1 AND L2 AND UU ,L,L),COLORLIMAGENTA;};。

通达信缠论指标公式----“缠中套利”

通达信缠论指标公式----“缠中套利”

通达信缠论指标公式----“缠中套利”老笔:=1;XA_1:=MA(CLOSE,5);XA_2:=MA(CLOSE,10);XA_3:=REF(HIGH,5)=HHV(HIGH,11);XA_4:=REF(LOW,5)=LLV(LOW,11);XA_5:=BACKSET(XA_3,6)>BACKSET(XA_3,5);XA_6:=BACKSET(XA_4,6)>BACKSET(XA_4,5);XA_7:=IF(BARSLAST(XA_5)=BARSLAST(XA_6) AND XA_1>XA_2,XA_5,IF(BARSLAST(XA_6)>BARSLAST(XA_5),XA_5,0));XA_8:=IF(BARSLAST(XA_5)=BARSLAST(XA_6) AND XA_2>XA_1,XA_6,IF(BARSLAST(XA_5)>BARSLAST(XA_6),XA_6,0));XA_9:=XA_7 AND HIGH=HHV(HIGH,BARSLAST(XA_8));XA_10:=XA_8 AND LOW=LLV(LOW,BARSLAST(XA_7));GP:IF(XA_9,HIGH,DRAWNULL),CIRCLEDOT,COLORCYAN;DP:IF(XA_10,LOW,DRAWNULL),CIRCLEDOT,COLORCYAN;XA_11:=LOW>REF(HIGH,1) AND DAY!=REF(DAY,1);XA_12:=HIGH<REF(LOW,1) AND DAY!=REF(DAY,1);XA_13:=REF(LOW,BARSLAST(XA_11));XA_14:=REF(HIGH,BARSLAST(XA_12));XA_15:=REF(HIGH,BARSLAST(XA_9));XA_16:=REF(LOW,BARSLAST(XA_9));XA_17:=REF(HIGH,BARSLAST(XA_9)+1);XA_18:=REF(LOW,BARSLAST(XA_9)+1);XA_19:=REF(HIGH,BARSLAST(XA_9)+2);XA_20:=REF(LOW,BARSLAST(XA_9)+2);XA_21:=REF(HIGH,BARSLAST(XA_10));XA_22:=REF(LOW,BARSLAST(XA_10));XA_23:=REF(HIGH,BARSLAST(XA_10)+1);XA_24:=REF(LOW,BARSLAST(XA_10)+1);XA_25:=REF(HIGH,BARSLAST(XA_10)+2);XA_26:=REF(LOW,BARSLAST(XA_10)+2);XA_27:=IF(XA_16<=XA_18,XA_19,XA_17);XA_28:=IF(XA_17<XA_16,XA_16,IF(XA_16<=XA_18,XA_20,XA _18));XA_29:=IF(XA_24>XA_21,XA_21,IF(XA_21>=XA_23,XA_25,XA _23));XA_30:=IF(XA_21>=XA_23,XA_26,XA_24);XA_31:=XA_15>XA_29 AND XA_9;XA_32:=XA_22<XA_28 AND XA_10;XA_33:=XA_31 AND XA_15>XA_21 AND XA_16>XA_22 AND XA_18>XA_22;XA_34:=XA_32 AND XA_22<XA_16 AND XA_21<XA_15 AND XA_23<XA_15;XA_35:=HIGH<=REF(HIGH,1) AND LOW>=REF(LOW,1) OR (HIGH>=REF(HIGH,1) AND LOW<=REF(LOW,1));XA_36:=COUNT(XA_35,BARSLAST(XA_10));XA_37:=COUNT(XA_35,BARSLAST(XA_9));XA_38:=COUNT(XA_11,BARSLAST(XA_10));XA_39:=COUNT(XA_12,BARSLAST(XA_9));XA_40:=IF(XA_36>0,XA_36+2+老笔,IF(XA_37,XA_37+2+老笔,3));XA_41:=IF(XA_38,XA_40-XA_38,IF(XA_39,XA_40-XA_39,XA_40));XA_42:=XA_33 AND BARSLAST(XA_34)>XA_41;XA_43:=XA_34 AND BARSLAST(XA_33)>XA_41;XA_44:=XA_9 AND REF(HIGH,BARSLAST(XA_9))>=REF(HIGH,BARSLAST(XA_42))AND BARSLAST(XA_43)>BARSLAST(XA_42) OR (XA_31 AND COUNT(XA_11,BARSLAST(XA_32))>0 AND REF(HIGH,BARSLAST(XA_31))>REF(HIGH,BARSLAST(XA_42)));XA_45:=XA_10 AND REF(LOW,BARSLAST(XA_10))<=REF(LOW,BARSLAST(XA_43)) AND BARSLAST(XA_42)>BARSLAST(XA_43) OR (XA_32 AND COUNT(XA_12,BARSLAST(XA_31))>0 AND REF(LOW,BARSLAST(XA_32))<REF(HIGH,BARSLAST(XA_43)));XA_46:=IF(BARSLAST(XA_45)>BARSLAST(XA_44),REF(HIGH, BARSLAST(XA_44)),REF(HIGH,BARSLAST(XA_45)));XA_47:=IF(BARSLAST(XA_44)>BARSLAST(XA_45),REF(LOW,B ARSLAST(XA_45)),REF(LOW,BARSLAST(XA_44)));XA_48:=XA_44 AND HIGH=HHV(XA_46,BARSLAST(XA_45)+1) AND HIGH>REF(HIGH,1) AND BARSLAST(XA_45)>BARSLAST(XA_44);XA_49:=XA_45 AND LOW=LLV(XA_47,BARSLAST(XA_44)+1) AND LOW<REF(LOW,1) AND BARSLAST(XA_44)>BARSLAST(XA_45);XA_50:=XA_48 OR (XA_9 AND REF(HIGH,BARSLAST(XA_9))>REF(HIGH,BARSLAST(XA_48)) AND BARSLAST(XA_49)>BARSLAST(XA_48));XA_51:=XA_49 OR (XA_10 AND REF(LOW,BARSLAST(XA_10))<REF(LOW,BARSLAST(XA_49)) AND BARSLAST(XA_48)>BARSLAST(XA_49));GPB:IF(XA_42,HIGH,DRAWNULL),CIRCLEDOT,COLORYELLOW;DPB:IF(XA_43,LOW,DRAWNULL),CIRCLEDOT,COLORYELLOW;XA_52:=XA_50;XA_53:=XA_51;L1:DRAWLINE(XA_53,LOW,XA_52,HIGH,0),COLORYELLOW;L2:DRAWLINE(XA_52,HIGH,XA_53,LOW,0),COLORWHITE;XA_54:=CLOSE;XA_55:=FILTER(BACKSET(FILTER(REF(XA_54,10)=HHV(XA_54, 2*10+1),10),10+1),10);XA_56:=FILTER(BACKSET(FILTER(REF(XA_54,10)=LLV(XA_54,2 *10+1),10),10+1),10);XA_57:=REF(CLOSE,BARSLAST(XA_55));XA_58:=REF(CLOSE,BARSLAST(XA_56));XA_59:=BARSLAST(XA_55)<BARSLAST(XA_56) AND NOT(XA_55);XA_60:=BARSLAST(XA_55)>BARSLAST(XA_56) AND NOT(XA_56);波段顶:IF(XA_59,XA_57,XA_57),POINTDOT,COLORLIGREEN,LINETHICK 4;波段底:IF(XA_60,XA_58,XA_58),POINTDOT,COLORMAGENTA,LINETHI CK4;。

缠论中枢划线(笔和线段)主图指标公式-优化后

缠论中枢划线(笔和线段)主图指标公式-优化后

KU1:=IF(HIGH=HHV(HIGH,3),1,0);KD1:=IF(LOW=LLV(LOW,3),1,0);UL:=IF(REF(KU1,2)=1 AND REF(KU1,1)=0AND KU1=0,REF(HIGH,2),REF(HIGH,2+BARSLAST(REF(KU1,2)=1AND REF(KU1,1)=0 AND KU1=0)));DL:=IF(REF(KD1,2)=1 AND REF(KD1,1)=0 AND KD1=0,REF(LOW,2),REF(LOW,2+BARSLAST(REF(KD1,2)=1AND REF(KD1,1)=0 AND KD1=0)));HV:=H>UL AND H>REF(H,1) ;LV:=L<DL AND L<REF(L,1) ;GP:=BARSLAST(HV);DP:=BARSLAST(LV);IP:=IF(GP=0,DP,GP)>3;HV1:=HV AND IP AND H>=HHV(H,BARSLAST(LV));LV1:=LV AND IP AND L<=LLV(L,BARSLAST(HV));DRAWLINE(LV1,LOW,HV1, HIGH,0),COLORYELLOW,LINETHICK2;DRAWLINE(HV1,HIGH,LV1, LOW,0),COLORMAGENTA,LINETHICK2;N1:=10;N2:=10;DISP:=2;K:=1;P1:=PEAK(1,K*N1,1);P2:=PEAK(1,K*N1,2);WP1:=PEAKBARS(1,K*N1,1);WP2:=PEAKBARS(1,K*N1,2);T1:=TROUGH(2,K*N2,1);T2:=TROUGH(2,K*N2,2);WT1:=TROUGHBARS(2,K*N2,1);WT2:=TROUGHBARS(2,K*N2,2);TJ1:=P1>T1 AND P2>T2 ;ZD:=MAX(T1,T2);ZG:=MIN(P1,P2);LL:=MIN(T1,T2);HH:=MAX(P1,P2);TJ2:=FILTER(ZG>ZD,2);TJ3:=ZG=REF(ZG,BARSLAST(TJ2)) OR ZD=REF(ZD,BARSLAST(TJ2));TJ4:=TJ1 AND TJ2 AND NOT(TJ3);TJ5:=BETWEEN(ZD,REF(ZD,REF(BARSLAST(TJ4),1)),REF(ZG,REF(BARSLAST(TJ4),1)));TJ6:=BETWEEN(ZG,REF(ZD,REF(BARSLAST(TJ4),1)),REF(ZG,REF(BARSLAST(TJ4),1)));TJ7:=ZG>REF(ZG,REF(BARSLAST(TJ4),1)) AND ZD<REF(ZD,REF(BARSLAST(TJ4),1));TJ8:=TJ4 AND NOT(TJ5 OR TJ6 OR TJ7);ZSD:=IF(TJ8,ZD,REF(ZD,1));ZSG:=IF(TJ8,ZG,REF(ZG,1));ZSH:=IF(TJ8,HH,REF(HH,1));ZSL:=IF(TJ8,LL,REF(LL,1));STICKLINE(TJ8,ZSH,ZSL,0,-1);STICKLINE(TJ8,ZSD,ZSG,IF(DISP=1,3,0),1),COLORMAGENTA;DRAWTEXT(DISP=2,ZSH,''),COLORWHITE;中枢高:ZSG,COLORMAGENTA;IF(DISP=2,REF(ZSG,BARSLAST(TJ8)),DRAWNULL),CIRCLEDOT,COLORMAGENTA; 中枢低:ZSD,COLORYELLOW;IF(DISP=2,REF(ZSD,BARSLAST(TJ8)),DRAWNULL),CIRCLEDOT,COLORYELLOW; 中枢最高:ZSH,COLORRED;IF(DISP=2,REF(ZSH,BARSLAST(TJ8)),DRAWNULL),POINTDOT,COLORRED;中枢最低:ZSL,COLORGREEN;IF(DISP=2,REF(ZSL,BARSLAST(TJ8)),DRAWNULL),POINTDOT,COLORGREEN; MA5:MA(CLOSE,5),COLORFF00FF,LINETHICK1;命真好:=MA5>REF(MA5,1);命真坏:=MA5<REF(MA5,1);DRAWBAND(MA5,RGB(255,96,96),REF(MA5,1),RGB(0,224,224));。

缠论选股公式(一笔回调出现底分型)

缠论选股公式(一笔回调出现底分型)

缠论选股公式(⼀笔回调出现底分型)缠中说禅底分型:底分型(简称底)定义:第⼆K线低点是相邻三K线低点中最低的,⽽⾼点也是相邻三K线⾼点中最低的。

叫底分型。

⼀笔回调出现底分型⽰意图:公式源码:{笔底分型 选股 预警 确保向下笔成⽴后的底分型}V00:= HIGHV01:= HIGHREF(LOW,1);V02:= HIGH>REF(HIGH,1) AND LOWV03:= HIGH>REF(HIGH,1) AND LOW>REF(LOW,1);V04:= REF(HIGH,2) < HIGH AND REF(LOW,2) < LOWAND REF(HIGH,2) > REF(HIGH,1) AND REF(LOW,2) < REF(LOW,1);V1:= COUNT(V00,6)>=3 AND COUNT(V01 OR V02,5)=0 AND LLVBARS(LOW,6) = 1 AND HHVBARS(HIGH,6) >= 5 AND V03;V2:= COUNT(V00,7)>=3 AND COUNT(V01 OR V02,6)=1 AND LLVBARS(LOW,7) = 2 AND HHVBARS(HIGH,7) >= 6 AND V04;V3:= COUNT(V00,7)>=3 AND COUNT(V01 OR V02,6)=1 AND LLVBARS(LOW,7) = 1 AND HHVBARS(HIGH,7) >= 6 AND V03;V4:= COUNT(V00,8)>=3 AND COUNT(V01 OR V02,7)<=2 AND LLVBARS(LOW,8) = 2 AND HHVBARS(HIGH,8) >= 7 AND V04;V5:= COUNT(V00,8)>=3 AND COUNT(V01 OR V02,7)<=2 AND LLVBARS(LOW,8) = 1 AND HHVBARS(HIGH,8) >= 7 AND V03;V6:= COUNT(V00,9)>=3 AND COUNT(V01 OR V02,8)<=3 AND LLVBARS(LOW,9) = 2 AND HHVBARS(HIGH,9) >= 8 AND V04;V7:= COUNT(V00,9)>=3 AND COUNT(V01 OR V02,8)<=3 AND LLVBARS(LOW,9) = 1 AND HHVBARS(HIGH,9) >= 8 AND V03;V8:= COUNT(V00,10)>=3 AND COUNT(V01 OR V02,9)<=4 AND LLVBARS(LOW,10) = 2 AND HHVBARS(HIGH,10) >= 9 AND V04;V9:= COUNT(V00,10)>=3 AND COUNT(V01 OR V02,9)<=4 AND LLVBARS(LOW,10) = 1 AND HHVBARS(HIGH,10) >= 9 AND V03;V10:= COUNT(V00,11)>=3 AND COUNT(V01 OR V02,10)<=5 ANDLLVBARS(LOW,11) = 2 AND HHVBARS(HIGH,11) >= 10 AND V04;XG: V1 OR V2 OR V3 OR V4 OR V5 OR V6 OR V7 OR V8 OR V9 OR V10;选股意向图:。

目前最准确的缠论分笔公式

目前最准确的缠论分笔公式

目前见到的最准确的xx缠论分笔公式参数:老笔=1,使用老笔定义,默认为0,使用新笔定义G:=MA(C,5);D:=MA(C,10);HH:=REF(H,5)=HHV(H,11);LL:=REF(L,5)=LLV(L,11);FG01:=BACKSET(HH,6)>BACKSET(HH,5) ;FD01:=BACKSET(LL,6)>BACKSET(LL,5) ;FG02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND G>D,FG01, IF(BARSLAST(FD01)>BARSLAST(FG01),FG01,0));FD02:=IF(BARSLAST(FG01)=BARSLAST(FD01) AND D>G,FD01, IF(BARSLAST(FG01)>BARSLAST(FD01),FD01,0));FG0:=FG02 AND H=HHV(H,BARSLAST(FD02));FD0:=FD02 AND L=LLV(L,BARSLAST(FG02));GP:IF(FG0,H,DRAWNULL),CIRCLEDOT,COLORCYAN;DP:IF(FD0,L,DRAWNULL),CIRCLEDOT,COLORCYAN;GQ:=L>REF(H,1) AND DAY!=REF(DAY,1);DQ:=H<REF(L,1) AND DAY!=REF(DAY,1);GQL:=REF(L,BARSLAST(GQ));DQH:=REF(H,BARSLAST(DQ));FGH:=REF(H,BARSLAST(FG0));FGL:=REF(L,BARSLAST(FG0));FGL1:=REF(L,BARSLAST(FG0)+1);FGH2:=REF(H,BARSLAST(FG0)+2);FGL2:=REF(L,BARSLAST(FG0)+2);FDH:=REF(H,BARSLAST(FD0));FDL:=REF(L,BARSLAST(FD0));FDH1:=REF(H,BARSLAST(FD0)+1);FDL1:=REF(L,BARSLAST(FD0)+1);FDH2:=REF(H,BARSLAST(FD0)+2);FDL2:=REF(L,BARSLAST(FD0)+2);FGZH:=IF(FGL<=FGL1,FGH2,FGH1);FGZL:=IF(FGH1<FGL,FGL,IF(FGL<=FGL1,FGL2,FGL1));FDZH:=IF(FDL1>FDH,FDH,IF(FDH>=FDH1,FDH2,FDH1));FDZL:=IF(FDH>=FDH1,FDL2,FDL1);FG1:=FGH>FDZH AND FG0;FD1:=FDL<FGZL AND FD0;FG:=FG1 AND FGH>FDH AND FGL>FDL AND FGL1>FDL;FD:=FD1 AND FDL<FGL AND FDH<FGH AND FDH1<FGH;BH0:=(H<=REF(H,1) AND L>=REF(L,1)) OR (H>=REF(H,1) AND L<=REF(L,1)); BHG:=COUNT(BH0,BARSLAST(FD0));BHD:=COUNT(BH0,BARSLAST(FG0));BDQ:=COUNT(DQ,BARSLAST(FG0));BK0:=IF(BHG>0,BHG+2+老笔,IF(BHD,BHD+2+老笔,3));BK:=IF(BGQ,BK0-BGQ,IF(BDQ,BK0-BDQ,BK0));G1X:=(FG AND BARSLAST(FD)>BK);D1X:=(FD AND BARSLAST(FG)>BK);G1:=(FG0 AND REF(H,BARSLAST(FG0))>=REF(H,BARSLAST(G1X)) AND BARSLAST(D1X)>BARSLAST(G1X))OR (FG1 AND COUNT(GQ,BARSLAST(FD1))>0 ANDREF(H,BARSLAST(FG1))>REF(H,BARSLAST(G1X)));D1:=(FD0 AND REF(L,BARSLAST(FD0))<=REF(L,BARSLAST(D1X)) AND BARSLAST(G1X)>BARSLAST(D1X))OR (FD1 AND COUNT(DQ,BARSLAST(FG1))>0 ANDREF(L,BARSLAST(FD1))<REF(H,BARSLAST(D1X)));G1H:=IF(BARSLAST(D1)>BARSLAST(G1),REF(H,BARSLAST(G1)),REF(H,BARSLAST(D 1))),;D1L:=IF(BARSLAST(G1)>BARSLAST(D1),REF(L,BARSLAST(D1)),REF(L,BARSLAST(G1) ));G2:=G1 AND H=HHV(G1H,BARSLAST(D1)+1) AND H>REF(H,1) AND BARSLAST(D1)>BARSLAST(G1);D2:=D1 AND L=LLV(D1L,BARSLAST(G1)+1) AND L<REF(L,1) ANDBARSLAST(G1)>BARSLAST(D1);G3:=G2 OR (FG0 AND REF(H,BARSLAST(FG0))>REF(H,BARSLAST(G2)) AND BARSLAST(D2)>BARSLAST(G2));D3:=D2 OR (FD0 AND REF(L,BARSLAST(FD0))<REF(L,BARSLAST(D2)) AND BARSLAST(G2)>BARSLAST(D2));GPB:IF(G1X,H,DRAWNULL),CIRCLEDOT,COLORYELLOW;DPB:IF(D1X,L,DRAWNULL),CIRCLEDOT,COLORYELLOW;{画线}NN:=G3;UU:=D3;L1:DRAWLINE(UU,L,NN, H,0),COLORLIGREEN;L2:DRAWLINE(NN,H,UU,L,0),COLORLIGREEN;{标示端点数值}{DRAWNUMBER(L1 AND L2 AND NN ,H,H),COLORLIRED;DRAWNUMBER(L1 AND L2 AND UU ,L,L),COLORLIMAGENTA;};。

缠论指标公式

缠论指标公式

缠论指标公式
缠论指标公式是分析金融价格波动的一种技术工具,常用于股市、期货市场的短期交易。

它基于中国著名技术分析师缠大大(缠中说禅)提出的缠论理论,通过对价格走势的盘整特征进行统计和分析,以确定交易信号和趋势转折点。

缠论指标公式的主要构成包括缠论基本面、缠论线段、缠论角度和缠论波动等指标。

下面一一介绍这些指标的公式和特点:
1. 缠论基本面:缠论基本面指标是通过对价格走势进行涨跌幅度统计,判断价格波动是否出现盘整、突破或转折的关键指标。

它通过计算价格的涨跌幅度、最高价和最低价的差异等参数,发现价格走势中的突破点和盘整点。

2. 缠论线段:缠论线段指标主要用于判断价格走势的趋势和支撑阻力位。

它通过计算价格走势的波动极值,确定线段的高点和低点,从而判断市场的趋势和阻力位。

3. 缠论角度:缠论角度指标是根据价格走势的斜率和趋势进行计算,判断市场的强弱和趋势的变化。

它通过计算价格走势的角度和斜率,确定市场的强势、弱势和趋势转折的点位。

4. 缠论波动:缠论波动指标是用来评估价格波动的强弱和风险的指标。

它通过计算价格波动的振幅、摆幅和震荡指标,确定市场的波动性和风险水平。

总的来说,缠论指标公式是一套完整的技术体系,通过对价格走势的统计和分析,判断市场的趋势和交易机会。

然而,使用缠论指标需要结合其他技术分析工具和基本面分析,以提高准确性和可靠性。

投资者在使用缠论指标时,应该对市场的风险有所了解,并根据自己的交易经验和风险偏好进行操作。

缠论画笔技术指标公式

缠论画笔技术指标公式

缠论画笔技术指标公式1. 笔的构造:笔的构造:笔是缠论分析的基本要素之一。

它由价格的高点和低点构成,并满足一定的要求。

下面是笔的构造公式:- 笔的高点:\[High(n) > High(n+1)\]- 笔的低点:\[Low(n) < Low(n+1)\]其中,\[n\] 表示当前的价格位置。

2. 筹码分布:筹码分布:筹码分布是指在股票市场中不同投资者所持有的筹码的分布情况。

它可以通过缠论画笔技术指标进行分析。

以下是筹码分布的计算公式:- 主力筹码分布:\[Main\_Chips = \sum Volume * Price\_Change\] - 散户筹码分布:\[Retail\_Chips = \sum Volume\]其中,\[Volume\] 表示成交量,\[Price\_Change\] 表示价格变动。

3. 趋势判断:趋势判断:通过缠论画笔技术指标,我们可以判断股票市场的趋势方向,并做出相应的决策。

以下是趋势判断的公式:- 上涨趋势:\[High(n) > High(n+1)\]- 下跌趋势:\[Low(n) < Low(n+1)\]根据趋势的判断,我们可以选择合适的交易策略,如买入或卖出。

4. 形态分析:形态分析:缠论画笔技术指标还可以用于分析股价的形态,并判断未来的价格走势。

以下是形态分析的公式:- 反弹形态:\[Low(n) > Low(n+1)\]- 跳空形态:\[High(n) < Low(n+1)\]根据形态的特征,我们可以预测价格的反弹或跳空行为。

以上是缠论画笔技术指标的一些常用公式,通过它们我们可以对股票市场进行分析和预测。

然而,在使用这些指标时,我们应该注意市场的复杂性和不确定性,同时结合其他分析方法进行综合判断,以提高预测的准确性和决策的成功率。

缠论公式集

缠论公式集

段成选股var1:="chzhshch@kxian";{处理K线}var2:="chzhshch@bi";{处理笔关系}var3:="chzhshch@duan";{处理段关系}var4:="chzhshch@duan2";{处理更高级别段关系}bi1:=if(c>0,BARSLAST(var2<0),BARSLAST(var2>0));{已完成笔向上}bi2:=if(c>0,BARSLAST(var2>0),BARSLAST(var2<0));{已完成笔向下}bidi:=ref(l,SUMBARS(bi1=0,1)-1);{当前之前(如果在点上算自身1次)第n个笔低点的值} bigao:=ref(h,SUMBARS(bi2=0,1)-1);{当前之前(如果在点上算自身1次)第n个笔高点的值} duan1:=if(c>0,BARSLAST(var3<0),BARSLAST(var3>0));{已完成段向上}duan2:=if(c>0,BARSLAST(var3>0),BARSLAST(var3<0));{已完成段向下}duanA:=if(c>0,BARSLAST(var4<0),BARSLAST(var4>0));{已完成更高级段向上}duanB:=if(c>0,BARSLAST(var4>0),BARSLAST(var4<0));{已完成更高级段向下}未完成笔往下:BARSLAST(var2>0)<BARSLAST(var2<0);未完成段往下:BARSLAST(var3>0)<BARSLAST(var3<0);未完成笔向上:BARSLAST(var2>0)>BARSLAST(var2<0);未完成段向上:BARSLAST(var3<0)>BARSLAST(var3>0);TYP:=(HIGH+LOW+CLOSE)/3;CCI:=(TYP-MA(TYP,18))/(0.015*AVEDEV(TYP,18));DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);DEA:=EMA(DIF,9);MACD:=(DIF-DEA)*2;f30段上选股:未完成段向上=1 and CCI<-100;F30段下二买:未完成段往下=1 and dea>0 AND CCI<-100;MACD底背离选股公式——通达信、同花顺底背离,通达信版、同花顺版}DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);DEA:=EMA(DIFF,9);MACD:=2*(DIFF-DEA);QZQ:=BARSLAST(REF(MACD,1)<0 AND MACD>0);QM:=LLVBARS(MACD,QZQ+20);MQDZ:=IF(QM>QZQ,REF(MACD,QM),0);XG1:=MACD<0 AND MACD>MQDZAND CLOSE=LLV(CLOSE,QZQ+20) AND MQDZ<0;XG:REF(XG1,1)=1 AND MACD>REF(MACD,1);{双底背离,通达信版、同花顺版}DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);DEA:=EMA(DIFF,9);MACD:=2*(DIFF-DEA);QZQ:=BARSLAST(REF(MACD,1)<0 AND MACD>0); QM:=LLVBARS(MACD,QZQ+20);MQDZ:=IF(QM>QZQ,REF(MACD,QM),0);QF:=LLVBARS(DIFF,QZQ+20);DQDZ:=IF(QF>QZQ,REF(DIFF,QF),0);XG1:=MACD<0 AND MACD>MQDZ AND DIFF<0 AND DIFF>DQDZAND CLOSE=LLV(CLOSE,QZQ+20) AND MQDZ<0 AND DQDZ<0;XG:REF(XG1,1)=1 AND MACD>REF(MACD,1);注:底双背离是指MACD(绿柱)和DIFF(黄白线)都底背离。

缠论中枢划线主图指标公式-优化后

缠论中枢划线主图指标公式-优化后

KU1:=IF(HIGH=HHV(HIGH,3),1,0);KD1:=IF(LOW=LLV(LOW,3),1,0);UL:=IF(REF(KU1,2)=1 AND REF(KU1,1)=0AND KU1=0,REF(HIGH,2),REF(HIGH,2+BARSLAST(REF(KU1,2)=1AND REF(KU1,1)=0 AND KU1=0)));DL:=IF(REF(KD1,2)=1 AND REF(KD1,1)=0 AND KD1=0,REF(LOW,2),REF(LOW,2+BARSLAST(REF(KD1,2)=1AND REF(KD1,1)=0 AND KD1=0)));HV:=H>UL AND H>REF(H,1) ;LV:=L<DL AND L<REF(L,1) ;GP:=BARSLAST(HV);DP:=BARSLAST(LV);IP:=IF(GP=0,DP,GP)>3;HV1:=HV AND IP AND H>=HHV(H,BARSLAST(LV));LV1:=LV AND IP AND L<=LLV(L,BARSLAST(HV));DRAWLINE(LV1,LOW,HV1, HIGH,0),COLORYELLOW,LINETHICK2;DRAWLINE(HV1,HIGH,LV1, LOW,0),COLORMAGENTA,LINETHICK2;N1:=10;N2:=10;DISP:=2;K:=1;P1:=PEAK(1,K*N1,1);P2:=PEAK(1,K*N1,2);WP1:=PEAKBARS(1,K*N1,1);WP2:=PEAKBARS(1,K*N1,2);T1:=TROUGH(2,K*N2,1);T2:=TROUGH(2,K*N2,2);WT1:=TROUGHBARS(2,K*N2,1);WT2:=TROUGHBARS(2,K*N2,2);TJ1:=P1>T1 AND P2>T2 ;ZD:=MAX(T1,T2);ZG:=MIN(P1,P2);LL:=MIN(T1,T2);HH:=MAX(P1,P2);TJ2:=FILTER(ZG>ZD,2);TJ3:=ZG=REF(ZG,BARSLAST(TJ2)) OR ZD=REF(ZD,BARSLAST(TJ2));TJ4:=TJ1 AND TJ2 AND NOT(TJ3);TJ5:=BETWEEN(ZD,REF(ZD,REF(BARSLAST(TJ4),1)),REF(ZG,REF(BARSLAST(TJ4),1)));TJ6:=BETWEEN(ZG,REF(ZD,REF(BARSLAST(TJ4),1)),REF(ZG,REF(BARSLAST(TJ4),1)));TJ7:=ZG>REF(ZG,REF(BARSLAST(TJ4),1)) AND ZD<REF(ZD,REF(BARSLAST(TJ4),1));TJ8:=TJ4 AND NOT(TJ5 OR TJ6 OR TJ7);ZSD:=IF(TJ8,ZD,REF(ZD,1));ZSG:=IF(TJ8,ZG,REF(ZG,1));ZSH:=IF(TJ8,HH,REF(HH,1));ZSL:=IF(TJ8,LL,REF(LL,1));STICKLINE(TJ8,ZSH,ZSL,0,-1);STICKLINE(TJ8,ZSD,ZSG,IF(DISP=1,3,0),1),COLORMAGENTA;DRAWTEXT(DISP=2,ZSH,''),COLORWHITE;中枢高:ZSG,COLORMAGENTA;IF(DISP=2,REF(ZSG,BARSLAST(TJ8)),DRAWNULL),CIRCLEDOT,COLORMAGENTA;中枢低:ZSD,COLORYELLOW;IF(DISP=2,REF(ZSD,BARSLAST(TJ8)),DRAWNULL),CIRCLEDOT,COLORYELLOW;中枢最高:ZSH,COLORRED;IF(DISP=2,REF(ZSH,BARSLAST(TJ8)),DRAWNULL),POINTDOT,COLORRED;中枢最低:ZSL,COLORGREEN;IF(DISP=2,REF(ZSL,BARSLAST(TJ8)),DRAWNULL),POINTDOT,COLORGREEN; MA5:MA(CLOSE,5),COLORFF00FF,LINETHICK1;命真好:=MA5>REF(MA5,1);命真坏:=MA5<REF(MA5,1);DRAWBAND(MA5,RGB(255,96,96),REF(MA5,1),RGB(0,224,224));。

缠论指标公式代码集锦

缠论指标公式代码集锦

缠论指标公式代码集锦//缠论分笔公式——————————KU1:=IF(HIGH=HHV(HIGH,3),1,0);KD1:=IF(LOW=LLV(LOW,3),1,0);UL:=IF(REF(KU1,2)=1 AND REF(KU1,1)=0ANDKU1=0,REF(HIGH,2),REF(HIGH,2+BARSLAST(REF(KU1,2)=1 AND REF(KU1,1)=0 AND KU1=0)));DL:=IF(REF(KD1,2)=1 AND REF(KD1,1)=0ANDKD1=0,REF(LOW,2),REF(LOW,2+BARSLAST(REF(KD1,2)=1 AND REF(KD1,1)=0 AND KD1=0)));HV:=H>UL AND H>REF(H,1) ;LV:=L<DL AND L<REF(L,1) ;GP:=BARSLAST(HV);DP:=BARSLAST(LV);IP:=IF(GP=0,DP,GP)>3;HV1:=HV AND IP AND H>=HHV(H,BARSLAST(LV));LV1:=LV AND IP AND L<=LLV(L,BARSLAST(HV));DRAWLINE(LV1,LOW,HV1,HIGH,0),COLORYELLOW,LINETHICK2;DRAWLINE(HV1,HIGH,LV1,LOW,0),COLORMAGENTA,LINETHICK2;——————————//自己修改后的版本——————————{N1:1,100,10;N2:1,100,10;DISP:=1,3,2};N1:=10;N2:=10;DISP:=2;K:=IF(PERIOD=5,1,{日}IF(PERIOD=6,1,{周}IF(PERIOD=7,1,{月}IF(PERIOD=8,1,{多分钟}IF(PERIOD=9,1,{多日}IF(PERIOD=10,1,{季}IF(PERIOD=11,2,{年}IF(PERIOD=4,1,{60F}IF(PERIOD=3,1,{30F}IF(PERIOD=2,1,{15F}IF(PERIOD=1,1{5F},1{1F})))))))))))/10;{这段是识别中枢}{P1:=PEAK(1,K*N1,1);P2:=PEAK(1,K*N1,2);WP1:=PEAKBARS(1,K*N1,1);WP2:=PEAKBARS(1,K*N1,2);T1:=TROUGH(2,K*N2,1);T2:=TROUGH(2,K*N2,2);WT1:=TROUGHBARS(2,K*N2,1);WT2:=TROUGHBARS(2,K*N2,2);TJ1:=P1>T1 AND P2>T2 ;ZD:=MAX(T1,T2);ZG:=MIN(P1,P2);LL:=MIN(T1,T2);HH:=MAX(P1,P2);TJ2:=FILTER(ZG>ZD,2);TJ3:=ZG=REF(ZG,BARSLAST(TJ2)) OR ZD=REF(ZD,BARSLAST(TJ2));TJ4:=TJ1&&TJ2&&NOT(TJ3);TJ5:=BETWEEN(ZD,REF(ZD,REF(BARSLAST(TJ4),1)),REF(ZG,RE F(BARSLAST(TJ4),1)));TJ6:=BETWEEN(ZG,REF(ZD,REF(BARSLAST(TJ4),1)),REF(ZG,RE F(BARSLAST(TJ4),1)));TJ7:=ZG>REF(ZG,REF(BARSLAST(TJ4),1))&&ZD<REF(ZD,REF( BARSLAST(TJ4),1));TJ8:=TJ4&&NOT(TJ5 OR TJ6 OR TJ7);ZSD:=IF(TJ8,ZD,DRAWNULL);ZSG:=IF(TJ8,ZG,DRAWNULL);ZSH:=IF(TJ8,HH,DRAWNULL);ZSL:=IF(TJ8,LL,DRAWNULL);STICKLINE(TJ8,ZSH,ZSL,0,-1),COLORMAGENTA;STICKLINE(TJ8,ZSD,ZSG,IF(DISP=1,3,0),1),COLORMAGENTA;DRAWTEXT(DISP=2,ZSH,'中枢'),COLORRED;中枢高:PLOYLINE(DISP=2,REF(ZSD,BARSLAST(TJ8))),CROSSDOT,COLO RLIRED;中枢低:PLOYLINE(DISP=2,REF(ZSG,BARSLAST(TJ8))),CROSSDOT,COLO RLIGREEN;中枢最高:PLOYLINE(DISP=2,REF(ZSH,BARSLAST(TJ8))),POINTDOT,COLO RRED;中枢最低:PLOYLINE(DISP=2,REF(ZSL,BARSLAST(TJ8))),POINTDOT,COLO RGREEN;}趋势高:PLOYLINE(DISP=3,ZIG(1,K*N1)),COLORLIBLUE;趋势低:PLOYLINE(DISP=3,ZIG(2,K*N2)),COLORLIBLUE;局部低点预选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);预判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;DRAWLINE(极点保留=-1,局部极点,极点保留=1,局部极点,0)COLORBLUE;DRAWLINE(极点保留=1,局部极点,极点保留=-1,局部极点,0)COLORBLUE;DD1:=BARSLAST(ABS(极点保留)!=1);{DRAWICON(极点保留=-1,局部极点-0.03,1);DRAWICON(极点保留=1,局部极点+0.03,2);}{MA5:MA(CLOSE,5),COLORFF00FF,LINETHICK2;判:IF(MA5<REF(MA5,1),MA5,DRAWNULL),COLORWHITE,LINETHI CK2;};——————————//缠论指标之三布林+顶底线段(通达信主图)这个指标是对付中阴阶段的开始和结束,很直观了。

缠论公式

缠论公式

主图顶周期:=TOPRANGE(H);底周期:=LOWRANGE(L);上内:=LLVBARS(H,顶周期);上外:=LLVBARS(L,顶周期);下内:=HHVBARS(L,底周期);下外:=HHVBARS(H,底周期);上力度:=HHV(L,上内+1)>LLV(H,上内+1);下力度:=HHV(L,下内+1)>LLV(H,下内+1);上包含:=COUNT(L>=REF(L,1),上外)>2 AND COUNT(H>=REF(H,1),上内)>2; 下包含:=COUNT(H<=REF(H,1),下外)>2 AND COUNT(L<=REF(L,1),下内)>2; 顶0:=顶周期 AND 上力度 AND 上包含 AND 上外>3;底0:=底周期 AND 下力度 AND 下包含 AND 下外>3;顶分天数:=BARSLAST(顶0);底分天数:=BARSLAST(底0);含中间K线:=IF(顶分天数=0,底分天数,顶分天数)>=3;顶:=顶0 AND 含中间K线 AND H=HHV(H,BARSLAST(底0));底:=底0 AND 含中间K线 AND L=LLV(L,BARSLAST(顶0));NOTEXT上笔划线: DRAWLINE(底,L,顶,H,0),COLORLIRED,LINETHICK1; NOTEXT下笔划线: DRAWLINE(顶,H,底,L,0),COLORLIGREEN,LINETHICK1; 分界点:=NOTEXT上笔划线 AND NOTEXT下笔划线;位置调整:=IF(PERIOD=11,0.02,{年}IF(PERIOD=10,0.02,{季}IF(PERIOD=9,0.02, {多日}IF(PERIOD=8,0.001,{多分钟}IF(PERIOD=7,0.02, {月}IF(PERIOD=6,0.01, {周}IF(PERIOD=5,0.005, {日}IF(PERIOD=4,0.002,{60F}IF(PERIOD=3,0.001,{30F}IF(PERIOD=2,0.001,{15F}IF(PERIOD=1,0.0003,{5F}IF(PERIOD=0,0.0002,{1F}0))))))))))));DRAWNUMBER(分界点 AND 顶,H+H*位置调整,H),COLORLIGREEN; DRAWNUMBER(分界点 AND 底,L,L),COLORLIMAGENTA;MACD{MACD扩展公式 *暴风音符* }{周期放大开关:1为普通模式,0为放大模式} 倍数:=IF(PERIOD=11,1,{年}IF(PERIOD=10,4,{季}IF(PERIOD=9,6, {多日}IF(PERIOD=8,10,{多分钟}IF(PERIOD=7,12,{月}IF(PERIOD=6,5, {周}IF(PERIOD=5,5, {日}IF(PERIOD=4,4, {60F}IF(PERIOD=3,8, {30F}IF(PERIOD=2,4, {15F}IF(PERIOD=1,6, {5F}IF(PERIOD=0,5, {1F}1))))))))))));N1:=IF(周期放大,12,12*倍数);N2:=IF(周期放大,26,26*倍数);N3:=IF(周期放大,9,9*倍数);DIFF:EMA(CLOSE,N1) - EMA(CLOSE,N2),COLORWHITE,NODRAW;DEA:EMA(DIFF,N3),COLORYELLOW,NODRAW;MACD: (DIFF-DEA)*2,COLORSTICK,NODRAW;红柱面积:IF(MACD>0,SUM(MACD,BARSLAST(MACD<0)),0),NODRAW,COLORRED;绿柱面积:ABS(IF(MACD<0,SUM(MACD,BARSLAST(MACD>0)),0)),NODRAW,COLORLIGREEN;MACD面积:=IF(MACD>0,红柱面积,绿柱面积),NODRAW,COLORFFFF00;位置:=MAX(HHV(DIFF,100),ABS(LLV(DIFF,100)));{柱变与交叉临界}开盘价格:=O,COLORYELLOW,NODRAW;收盘价格:=C,COLORYELLOW,NODRAW;最高价格:=H,COLORYELLOW,NODRAW;最低价格:=L,COLORYELLOW,NODRAW;振幅:=(H-L)/REF(C,1)*100,COLORYELLOW,NODRAW;柱变临界:REF((EMA(CLOSE,12)*1134-EMA(CLOSE,26)*910-DEA*702)/224,1),COLORLIMAGENTA,NODRAW;叉临界:351/28*(EMA(REF(DIFF,1),9)-11/13*EMA(REF(C,1),12)+25/27*EMA(REF(C,1),26)),COLORLIMAGENTA,NODRAW; 明日柱变临界: (EMA(CLOSE,12)*1134-EMA(CLOSE,26)*910-DEA*702)/224,COLORLIBLUE,NODRAW;明日交叉临界:351/28*(EMA(DIFF,9)-11/13*EMA(C,12)+25/27*EMA(C,26)),COLORLIBLUE,NODRAW;{MACD重建-避免遮挡}STICKLINE(MACD>0,0,MACD,1,0),COLORRED;STICKLINE(MACD<0,0,MACD,1,0),COLORGREEN;STICKLINE(MACD>0 AND MACD<=REF(MACD,1),0,MACD,1,0),COLORYELLOW;STICKLINE(MACD<0 AND MACD>=REF(MACD,1),0,MACD,1,0),COLORWHITE;NOTEXTDIFF:EMA(CLOSE,N1) - EMA(CLOSE,N2),COLORWHITE;NOTEXTDEA:EMA(DIFF,N3),COLORYELLOW;{数显开关:1为打开,0为关闭}DRAWNUMBER(数显开关=1 AND LONGCROSS(DEA,DIFF,3),位置*0.8,REF(红柱面积,1)),COLORRED;DRAWNUMBER(数显开关=1 AND LONGCROSS(DIFF,DEA,3),0-位置*0.5,REF(绿柱面积,1)),COLORGREEN;NOTEXTLMH: DRAWNUMBER(数显开关=1 AND ISLASTBAR AND MACD>0,位置*0.8,红柱面积),COLORRED;NOTEXTLML: DRAWNUMBER(数显开关=1 AND ISLASTBAR AND MACD<0,0-位置*0.5,绿柱面积),COLORGREEN;三线同图上:"RSI.RSI1",COLORCYAN;中:"I"/5,COLORWHITE;下:"KDJ.J"-100,COLORMAGENTA;{RSI CCI KDJ 三线同图-暴风音符 }NOTEXT1:IF(上<20,上,DRAWNULL),COLORRED,LINETHICK2;NOTEXT2:IF(上>80,上,DRAWNULL),COLORGREEN,LINETHICK2;NOTEXT3:IF(中<-35,中,DRAWNULL),COLORRED,LINETHICK2;NOTEXT4:IF(中>35,中,DRAWNULL),COLORGREEN,LINETHICK2;NOTEXT5:IF(下>-5,下,DRAWNULL),COLORGREEN,LINETHICK2;NOTEXT6:IF(下<-95,下,DRAWNULL),COLORRED,LINETHICK2;NOTEXT7:100;NOTEXT8:50;NOTEXT9:0,COLORLIRED;NOTEXT10:-50;NOTEXT11:-100;{}T1:=EXIST(上< 120,3) AND 上>REF(上,1);T2:=EXIST(中<-35,3) AND 中>REF(中,1);T3:=EXIST(下<-95,3) AND 下>REF(下,1);T4:=REF(V,1)<REF(MA(V,60),1)*0.66 AND REF(V,2)<REF(MA(V,60),2)*0.66; XG:=FILTER((T1 AND T2) OR (T1 AND T3) OR (T2 AND T3) AND T4,3); STICKLINE(XG,-100,100,0,-1),COLORRED;暴风CCI副图:TYP:= (HIGH+LOW+CLOSE)/3;BFCCI: (TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14)),COLORWHITE;红抄粉吸:BFCCI<-150 OR REF(BFCCI,1)<-150 AND BFCCI>REF(BFCCI,1),COLORLIRED,NODRAW;绿清黄减:BFCCI>150 OR REF(BFCCI,1)>150 AND BFCCI<REF(BFCCI,1),COLORLIGREEN,NODRAW;CCI底背离:EXIST(CCI<-200,4) AND CCI>REF(CCI,1) AND L=LLV(L,3) AND H>REF(L,2) AND L<REF(L,1)*0.99 AND L<REF(LLV(L,3),1)*0.99 AND CCI<-100,COLORLIMAGENTA,NODRAW;CCI顶背离:EXIST(CCI>200,4) AND CCI<REF(CCI,1) AND H=HHV(H,3) AND L<REF(H,2) AND H>REF(H,1)*1.01 AND H>REF(HHV(H,3),1)*1.01,COLORGREEN,NODRAW;STICKLINE(BFCCI>150 OR REF(BFCCI,1)>150 AND BFCCI<REF(BFCCI,1),200,250,3,0),COLORYELLOW;STICKLINE(BFCCI>200 OR REF(BFCCI,1)>200 AND BFCCI<REF(BFCCI,1),200,250,3,0),COLORGREEN;STICKLINE(BFCCI<-150 OR REF(BFCCI,1)<-150 AND BFCCI>REF(BFCCI,1),-200,-250,3,0),COLORLIRED;STICKLINE(BFCCI<-200 OR REF(BFCCI,1)<-200 AND BFCCI>REF(BFCCI,1),-200,-250,3,0),COLORRED;STICKLINE(CCI底背离,-200,200,0,-1),COLORLIMAGENTA;STICKLINE(CCI顶背离,-200,200,0,-1),COLORGREEN;NOTEXTCCIS200:200,COLORCYAN,LINETHICK2;NOTEXTCCIX200:-200,COLORLIRED,LINETHICK2;NOTEXTBFCCI:BFCCI,COLORWHITE,LINETHICK2;选股:TYP:= (HIGH+LOW+CLOSE)/3;CCI:= (TYP-MA(TYP,14))/(0.015*AVEDEV(TYP,14));CCI底背离:EXIST(CCI<-200,4) AND CCI>REF(CCI,1) AND L=LLV(L,3) AND H>REF(L,2) AND L<REF(L,1)*0.99 AND L<REF(LLV(L,3),1)*0.99;。

缠论中枢划线主图指标公式-优化后

缠论中枢划线主图指标公式-优化后

KU1:=IF(HIGH=HHV(HIGH,3),1,0);KD1:=IF(LOW=LLV(LOW,3),1,0);UL:=IF(REF(KU1,2)=1 AND REF(KU1,1)=0AND KU1=0,REF(HIGH,2),REF(HIGH,2+BARSLAST(REF(KU1,2)=1AND REF(KU1,1)=0 AND KU1=0)));DL:=IF(REF(KD1,2)=1 AND REF(KD1,1)=0 AND KD1=0,REF(LOW,2),REF(LOW,2+BARSLAST(REF(KD1,2)=1AND REF(KD1,1)=0 AND KD1=0)));HV:=H>UL AND H>REF(H,1) ;LV:=L<DL AND L<REF(L,1) ;GP:=BARSLAST(HV);DP:=BARSLAST(LV);IP:=IF(GP=0,DP,GP)>3;HV1:=HV AND IP AND H>=HHV(H,BARSLAST(LV));LV1:=LV AND IP AND L<=LLV(L,BARSLAST(HV));DRAWLINE(LV1,LOW,HV1, HIGH,0),COLORYELLOW,LINETHICK2;DRAWLINE(HV1,HIGH,LV1, LOW,0),COLORMAGENTA,LINETHICK2;N1:=10;N2:=10;DISP:=2;K:=1;P1:=PEAK(1,K*N1,1);P2:=PEAK(1,K*N1,2);WP1:=PEAKBARS(1,K*N1,1);WP2:=PEAKBARS(1,K*N1,2);T1:=TROUGH(2,K*N2,1);T2:=TROUGH(2,K*N2,2);WT1:=TROUGHBARS(2,K*N2,1);WT2:=TROUGHBARS(2,K*N2,2);TJ1:=P1>T1 AND P2>T2 ;ZD:=MAX(T1,T2);ZG:=MIN(P1,P2);LL:=MIN(T1,T2);HH:=MAX(P1,P2);TJ2:=FILTER(ZG>ZD,2);TJ3:=ZG=REF(ZG,BARSLAST(TJ2)) OR ZD=REF(ZD,BARSLAST(TJ2));TJ4:=TJ1 AND TJ2 AND NOT(TJ3);TJ5:=BETWEEN(ZD,REF(ZD,REF(BARSLAST(TJ4),1)),REF(ZG,REF(BARSLAST(TJ4),1)));TJ6:=BETWEEN(ZG,REF(ZD,REF(BARSLAST(TJ4),1)),REF(ZG,REF(BARSLAST(TJ4),1)));TJ7:=ZG>REF(ZG,REF(BARSLAST(TJ4),1)) AND ZD<REF(ZD,REF(BARSLAST(TJ4),1));TJ8:=TJ4 AND NOT(TJ5 OR TJ6 OR TJ7);ZSD:=IF(TJ8,ZD,REF(ZD,1));ZSG:=IF(TJ8,ZG,REF(ZG,1));ZSH:=IF(TJ8,HH,REF(HH,1));ZSL:=IF(TJ8,LL,REF(LL,1));STICKLINE(TJ8,ZSH,ZSL,0,-1);STICKLINE(TJ8,ZSD,ZSG,IF(DISP=1,3,0),1),COLORMAGENTA;DRAWTEXT(DISP=2,ZSH,''),COLORWHITE;中枢高:ZSG,COLORMAGENTA;IF(DISP=2,REF(ZSG,BARSLAST(TJ8)),DRAWNULL),CIRCLEDOT,COLORMAGENTA; 中枢低:ZSD,COLORYELLOW;IF(DISP=2,REF(ZSD,BARSLAST(TJ8)),DRAWNULL),CIRCLEDOT,COLORYELLOW; 中枢最高:ZSH,COLORRED;IF(DISP=2,REF(ZSH,BARSLAST(TJ8)),DRAWNULL),POINTDOT,COLORRED;中枢最低:ZSL,COLORGREEN;IF(DISP=2,REF(ZSL,BARSLAST(TJ8)),DRAWNULL),POINTDOT,COLORGREEN; MA5:MA(CLOSE,5),COLORFF00FF,LINETHICK1;命真好:=MA5>REF(MA5,1);命真坏:=MA5<REF(MA5,1);DRAWBAND(MA5,RGB(255,96,96),REF(MA5,1),RGB(0,224,224));。

缠论三类买点选股公式

缠论三类买点选股公式

缠论三类买点选股公式
缠论是一种技术分析方法,可以用来选股和确定买点。

在缠论中,常用的三个买点选股公式是:顶背离买点、底背离买点和平台突破买点。

顶背离买点指的是在股票价格达到新高时,指标却没有达到新高,形成了一个高点和指标高点之间的背离。

这意味着市场可能出现反转的机会,投资者可以考虑在背离形成后卖出股票或者进行空仓操作,以防止损失。

底背离买点则是指在股票价格达到新低时,指标却没有达到新低,形成了一个低点和指标低点之间的背离。

类似于顶背离买点,底背离买点也意味着市场可能发生反转,投资者可以考虑在背离形成后买入股票或者进行多仓操作,以追求利润。

平台突破买点是指当股票价格长期在一个水平区间波动并且无明显趋势时,一旦突破该区间的上轨或下轨,就可以选择进行买入或卖出操作。

这种策略适用于股票价格波动较小的市场,因为价格在平台期间是相对稳定的,突破时可能意味着市场情绪的改变和价格变动的启动。

需要注意的是,在使用缠论三类买点选股公式时,投资者应结合其他技术分析工具和市场情况进行综合判断和决策。

此外,投资有风险,股市有涨有跌,投资者应具备风险意识并做好风险管理,以保护自身利益。

了解并运用缠论三类买点选股公式可以帮助投资者更好地把握市场机会,但在实际操作中还需注意市场的动态变化和个股的基本面情况,以实现长期稳健的投资收益。

缠论的分笔分段公式的汇总

缠论的分笔分段公式的汇总

缠论的分笔分段公式的汇总缠论总的分笔确实存在有不足之处,但是在实战中也不是一无是处,所以我们看待事物要具有客观性。

我们先来了解下分型,分型大家都知道分为顶分型以及底分型,当然我们想要运用公式来方便我们的投资,就要首先标记顶分型及底分型的顶部或底部,也就是节点。

{一、标记所有顶分型及底分型的顶部或底部,以下简称“节点”。

};{非包含关系的分型端点预选};分型顶0:=H>REF(H,1) AND L>REF(L,1);分型底0:=L{包含关系的K线处理:凡不符合上述类型的K线,均处于包含关系之中};{包含关系分为二种:一、当前K线包含前一根K线时,需进行合并处理;二、当前K线被前一根K线包含时,因不涉及端点,无需处理。

};分型顶1:=(H>=REF(H,1) AND L<=REF(L,1)) AND (BARSLAST(分型顶0)<barslast(分型底0));< p="" style="margin: 0px; padding: 0px;">分型底1:=(H>=REF(H,1) AND L<=REF(L,1)) AND (BARSLAST(分型底0)<barslast(分型顶0));< p="" style="margin: 0px; padding: 0px;">{将前述二种分型节点作为备选分型。

}分型顶2:=分型顶0 OR 分型顶1;分型底2:=分型底0 OR 分型底1;{对连续的同向分型节点,取最高点或最低点为本笔分型的节点,并向前过滤掉中间满足条件的分型。

};{注:过滤的目的是仅保留最后一次的最高最低节点分型,确保预选分型节点的唯一性。

}分型顶:=FILTERX(分型顶2 AND H=HHV(H,BARSLAST(分型底2)),BARSLAST(分型底2));分型底:=FILTERX(分型底2 AND L=LLV(L,BARSLAST(分型顶2)),BARSLAST(分型顶2));了解了分型的公司,我们在来看笔,对于形成笔的三个条件,在前面的文章中讲过,也就是力度、包含、数量。

精确缠论中枢公式

精确缠论中枢公式

精确缠论中枢公式{精确缠论中枢公式}{N1:1,100,10;N2:1,100,10;DISP:=1,3,2};n1:=10;n2:=10;DISP:=2;N1:=10;N2:=10;DISP:=2;K:=IF(PERIOD=5,1,{⽇}IF(PERIOD=6,1,{周}IF(PERIOD=7,1,{⽉}IF(PERIOD=8,1,{多分钟}IF(PERIOD=9,1,{多⽇}IF(PERIOD=10,1,{季}IF(PERIOD=11,2,{年}IF(PERIOD=4,1,{60F}IF(PERIOD=3,1,{30F}IF(PERIOD=2,1,{15F}IF(PERIOD=1,1{5F},1{1F})))))))))))/10;P1:=PEAK(1,K*N1,1);P2:=PEAK(1,K*N1,2);WP1:=PEAKBARS(1,K*N1,1);WP2:=PEAKBARS(1,K*N1,2);T1:=TROUGH(2,K*N2,1);T2:=TROUGH(2,K*N2,2);WT1:=TROUGHBARS(2,K*N2,1);WT2:=TROUGHBARS(2,K*N2,2);TJ1:=P1>T1 AND P2>T2 ;ZD:=MAX(T1,T2);ZG:=MIN(P1,P2);LL:=MIN(T1,T2);HH:=MAX(P1,P2);TJ2:=FILTER(ZG>ZD,2);TJ3:=ZG=REF(ZG,BARSLAST(TJ2)) OR ZD=REF(ZD,BARSLAST(TJ2));TJ4:=TJ1&&TJ2&&NOT(TJ3);TJ5:=BETWEEN(ZD,REF(ZD,REF(BARSLAST(TJ4),1)),REF(ZG,REF(BARSLAST(TJ4),1)));TJ6:=BETWEEN(ZG,REF(ZD,REF(BARSLAST(TJ4),1)),REF(ZG,REF(BARSLAST(TJ4),1)));TJ7:=ZG>REF(ZG,REF(BARSLAST(TJ4),1))&&ZD<REF(ZD,REF(BARSLAST(TJ4),1));TJ8:=TJ4&&NOT(TJ5 OR TJ6 OR TJ7);ZSD:=IF(TJ8,ZD,DRAWNULL);ZSG:=IF(TJ8,ZG,DRAWNULL);ZSH:=IF(TJ8,HH,DRAWNULL);ZSL:=IF(TJ8,LL,DRAWNULL);STICKLINE(TJ8,ZSH,ZSL,0,-1),COLORMAGENTA;STICKLINE(TJ8,ZSD,ZSG,IF(DISP=1,3,0),1),COLORMAGENTA;DRAWTEXT(DISP=2,ZSH,'中枢'),COLORWHITE;中枢⾼:PLOYLINE(DISP=2,REF(ZSD,BARSLAST(TJ8))),CIRCLEDOT,COLORLIRED;中枢低:PLOYLINE(DISP=2,REF(ZSG,BARSLAST(TJ8))),CIRCLEDOT,COLORLIGREEN;{中枢最⾼:PLOYLINE(DISP=2,REF(ZSH,BARSLAST(TJ8))),POINTDOT,COLORRED;中枢最低:PLOYLINE(DISP=2,REF(ZSL,BARSLAST(TJ8))),POINTDOT,COLORGREEN;}趋势⾼:PLOYLINE(DISP=3,ZIG(1,K*N1)),COLORLIBLUE;趋势低:PLOYLINE(DISP=3,ZIG(2,K*N2)),COLORLIBLUE;局部低点预选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);预判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 ⼩值周期>R EF(⼤值周期,距前⾼天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;DRAWLINE(极点保留=-1,局部极点,极点保留=1,局部极点,0)COLORLIRED;DRAWLINE(极点保留=1,局部极点,极点保留=-1,局部极点,0)COLORYELLOW;DD1:=BARSLAST(ABS(极点保留)!=1);{DRAWTEXT(极点保留=1,局部极点,'卖'),COLORGREEN;DRAWTEXT(极点保留=-1,局部极点,'买'),COLORRED;}MA5:MA(CLOSE,5),COLORFF00FF,LINETHICK2;判:IF(MA5<REF(MA5,1),MA5,DRAWNULL),COLORWHITE,LINETHICK2;缠论中枢公式 笔记⼀1、技术只是⽪⽑,是⼈⽤技术⽽不是技术⽤⼈,不成为⼀个⼈,技术越⾼,死得越惨。

缠论底分型选股公式:V00:=HIGH...

缠论底分型选股公式:V00:=HIGH...

缠论底分型选股公式:V00:=HIGH...缠论底分型选股公式:V00:= HIGH<REF(HIGH,1) AND LOW<REF(LOW,1);V01:= HIGH<REF(HIGH,1) AND LOW>REF(LOW,1);V02:= HIGH>REF(HIGH,1) AND LOW<REF(LOW,1);V03:= HIGH>REF(HIGH,1) AND LOW>REF(LOW,1);V04:= REF(HIGH,2) < HIGH AND REF(LOW,2) < LOW AND REF(HIGH,2) > REF(HIGH,1) AND REF(LOW,2) < REF(LOW,1);V1:= COUNT(V00,6)>=3 AND COUNT(V01 OR V02,5)=0 AND LLVBARS(LOW,6) = 1 AND HHVBARS(HIGH,6) >= 5 AND V03;V2:= COUNT(V00,7)>=3 AND COUNT(V01 OR V02,6)=1 AND LLVBARS(LOW,7) = 2 AND HHVBARS(HIGH,7) >= 6 AND V04;V3:= COUNT(V00,7)>=3 AND COUNT(V01 OR V02,6)=1 AND LLVBARS(LOW,7) = 1 AND HHVBARS(HIGH,7) >= 6 AND V03;V4:= COUNT(V00,8)>=3 AND COUNT(V01 OR V02,7)<=2 AND LLVBARS(LOW,8) = 2 AND HHVBARS(HIGH,8) >= 7 AND V04;V5:= COUNT(V00,8)>=3 AND COUNT(V01 OR V02,7)<=2 AND LLVBARS(LOW,8) = 1 AND HHVBARS(HIGH,8) >= 7 AND V03;V6:= COUNT(V00,9)>=3 AND COUNT(V01 OR V02,8)<=3 AND LLVBARS(LOW,9) = 2 AND HHVBARS(HIGH,9) >= 8 AND V04;V7:= COUNT(V00,9)>=3 AND COUNT(V01 OR V02,8)<=3 AND LLVBARS(LOW,9) = 1 AND HHVBARS(HIGH,9) >= 8 AND V03;V8:= COUNT(V00,10)>=3 AND COUNT(V01 OR V02,9)<=4 AND LLVBARS(LOW,10) = 2 AND HHVBARS(HIGH,10) >= 9 AND V04;V9:= COUNT(V00,10)>=3 AND COUNT(V01 OR V02,9)<=4 AND LLVBARS(LOW,10) = 1 AND HHVBARS(HIGH,10) >= 9 AND V03;V10:= COUNT(V00,11)>=3 AND COUNT(V01 OR V02,10)<=5 AND LLVBARS(LOW,11) = 2 AND HHVBARS(HIGH,11) >= 10 AND V04;XG: V1 OR V2 OR V3 OR V4 OR V5 OR V6 OR V7 OR V8 OR V9 OR V10;。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。

缠论公式集段成选股var1:=" chzhshch@kxian";{处理 K线}var2:=" chzhshch@b";{处理笔关系}var3:=" chzhshch@duan;{处理段关系}var4:=" chzhshch@duan2;{处理更高级别段关系}bi1:=if(c>0,BARSLAST(var2<0),BARSLAST(var2>0));{ bi2:=if(c>0,BARSLAST(var2>0),BARSLAST(var2<0) );{已完成笔向上}已完成笔向下}bidi:=ref(l,SUMBARS(bi1=0,1)-1);{当前之前(如果在点上算自身 1次)第n个笔低点的值}bigao:=ref(h,SUMBARS(bi2=0,1)-1);{当前之前(如果在点上算自身 1次)第n个笔高点的值}duan1:=if(c>0,BARSLAST(var3<0),BARSLAST(var3>0));{已完成段向上}dua n2:=if(c>0,BARSLAST(var3>0),BARSLAST(var3<0));{dua nA:=if(c>0,BARSLAST(var4<0),BARSLAST(var4>0));已完成段向下}已完成更高级段向上}dua nB:=if(c>0,BARSLAST(var4>0),BARSLAST(var4<0));{已完成更高级段向下}未完成笔往下:BARSLAST(var2>0)<BARSLAST(var2<0);未完成段往下:BARSLAST(var3>0)<BARSLAST(var3<0);未完成笔向上:BARSLAST(var2>0)>BARSLAST(var2<0);未完成段向上:BARSLAST(var3<0)>BARSLAST(var3>0);TYP:=(HIGH+L0W+CL0SE)/3;CCI:=(TYP-MA(TYP,18))/(0.015*AVEDEV(TYP,18));DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);DEA:=EMA(DIF,9);MACD:=(DIF-DEA)*2;f30段上选股:未完成段向上=1 and CCI<-100;F30段下二买:未完成段往下=1 and dea>0 AND CCI<-100;MAC[底背离选股公式一一通达信、同花顺底背离,通达信版、同花顺版}DIFF:=EMA(CL0SE,12) - EMA(CLOSE,26);DEA:=EMA(DIFF,9);MACD:=2*(DIFF-DEA);QZQ:=BARSLAST(REF(MACD,1)<0 AND MACD>0);QM:=LLVBARS(MACD,QZQ+20);MQDZ:=IF(QM>QZQ,REF(MACD,QM),0);XG1:=MACD<0 AND MACD>MQDZAND CL0SE=LLV(CL0SE,QZQ+20) AND MQDZ<0;XG:REF(XG1,1)=1 AND MACD>REF(MACD,1);{双底背离,通达信版、同花顺版}DIFF:=EMA(CL0SE,12) - EMA(CL0SE,26);DEA:=EMA(DIFF, 9);MACD:=2*(DIFF-DEA);QZQ:=BARSLAST(REF(MACD, 1)<0 AND MACD>0);QM:二LLVBARS04ACD, QZQ+20);MQDZ:=IF(QM>QZQ, REF(MACD, QM), 0);QF:=LLVBARS(DIFF, QZQ+20);DQDZ: =IF (QF>QZQ, REF (DIFF, QF), 0);XGl:=MACD<0 AND MACD>MQDZ AND DIFF<0 AND DIFF>DQDZ AND CL0SE=LLV(CLOSE, QZQ+20) AND MQDZ<0 AND DQDZ<0;XG:REF(XG1,1)=1 AND MACD>REF (MACD, 1);注:底双背离是指MACD (绿柱)和DIFF (黄白线)都底背离。

飞狐5/10均线面积主图公式源码这是在飞狐交易师主图上的5日和10日均线面积公式,有趋势平均力度,希望对大家有帮助。

注意:这是主图技术指标,建公式时一定要把“主图叠加”勾选上!{5/10均线面积}MA5:MA(C, 5);MA10:MA(C, 10);均线差:=MA5-MA10;JC:=MA10-MA5;绿柱面积:=IF (均线差<0, SUM(均线差*0. l,BARSLAST(JC<0)),0);红柱面积:=IF (均线差>0, SUM(均线差*0. l,BARSLAST(JC>0)),0);均线面积:IF (均线差>0,红柱面积,绿柱面积),colorOOOOff, LINETHICKO;A1:=IF(均线差>0, 1,-1);A2:=REF(A1, 1);A3:=A1*A2;A4:=BARSLAST(A3<0);A5:=A4+1;趋势平均力度:(SUM(均线差,0)-REF(SUM(均线差,0), A5))/A5, colorFFOOFF, LINETHICKO; drawnumber (ref (均线差,l)>0 and 均线差〈=0 , HHV (H, 8), ref (红柱面积,1),3),ALIGN2, pxup20, colorred;drawnumber (ref (均线差,l)>0 and 均线差00 , HHV (H, 8), ref (趋势平均力度,1),3), ALIGN2, pxup45, colorffOOff;drawnumber (ref (均线差,l)<0 and 均线差>二0 , LLV (L, 8), ref (abs (绿柱面积),1), 3), ALIGN2, pxdn5, Color004A00;drawnumber (ref (均线差,l)<0 and 均线差>=0 , LLV (L, 8), ref (abs (趋势平均力度),1), 3), ALIGN2, pxdn30, colorffOOff;drawnumber(islastbar and 均线差 <0,LLV(L,5),abs( 绿柱面积),3),alig n2,pxd n5,Color004A00;drawnumber(islastbar and 均线差 <0,LLV(L,5),abs( 趋势平均力度),3),alig n2,pxd n30,Colorff00ff;drawnumber(islastbar and 均线差 >0,HHV(H,5),abs(红柱面积),3),align2,pxup20,colorred; drawnumber(islastbar and 均线差 >0,HHV(H,5),abs(趋势平均力度),3),alig n2,pxup45,colorff00ff;MAC[底背离选股公式一一飞狐、大智慧L2{底背离,飞狐版、大智慧L2版、大智慧经典(免费)版}DIFF:二EMA(CL0SE,12) - EMA(CLOSE,26);DEA:二EMA(DIFF,9);MACD:=2*(DIFF-DEA);QZQ:二BARSLAST(REF(MACD,1)<0 AND MACD>0);QM:二LLVBARS(MACD,QZQ+20);MQDZ:=IF(QM>QZQ,REF(MACD,QM),0);XG1:=MACD<0 AND MACD>MQDZAND CLOSE二LLV(CLOSE,QZQ+20) AND MQDZ<0;XG:REF(XG1,1)<>0 AND MACD>REF(MACD,1);{双底背离,飞狐版、大智慧L2版}DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);DEA:=EMA(DIFF,9);MACD:=2*(DIFF-DEA);QZQ:=BARSLAST(REF(MACD,1)<0 AND MACD>0);QM:=LLVBARS(MACD,QZQ+20);MQDZ:=IF(QM>QZQ,REF(MACD,QM),0);QF:=LLVBARS(DIFF,QZQ+20);DQDZ:=IF(QF>QZQ,REF(DIFF,QF),0);XG1:=MACD<0 AND MACD>MQDZ AND DIFF<0 AND DIFF>DQDZ AND CLOSE=LLV(CLOSE,QZQ+20) AND MQDZ<0 ANDDQDZ<0;XG:REF(XG1,1)<>0 AND MACD>REF(MACD,1);注:底双背离是指MAC(绿柱)和DIFF (黄白线)都底背离红绿柱面积公式一一飞狐和大智慧L2版{MACE红绿柱面积(飞狐版副图)参数默认值:p=26; s=12; m=9} DIFF1:=EMA(CLOSE,s) - EMA(CLOSE,p);DEA1:=EMA(DIFF1,m);MACD:2*(DIFF1-DEA1){,COLORSTICK} ,L INETHICK0; MACDhs:=IF(MACD>0 AND MACD>=REF(MACD,1),MACD,0); MACDhx:=IF(MACD>0 AND MACD<=REF(MACD,1),MACD,0); MACDlx:=IF(MACD<0 AND MACD<REF(MACD,1),MACD,0); MACDls:=IF(MACD<0 AND MACD>REF(MACD,1),MACD,0);STICKLINE(MACDhs>0,0,MACD,9,0),Color0000BB;STICKLINE(MACDhs>0,0,MACD,8,0),Color0000CC;STICKLINE(MACDhs>0,0,MACD,7,0),Color0011CC;STICKLINE(MACDhs>0,0,MACD,6,0),Color1122DD;STICKLINE(MACDhs>0,0,MACD,5,0),Color2233DD;STICKLINE(MACDhs>0,0,MACD,4,0),Color3344EE;STICKLINE(MACDhs>0,0,MACD,3,0),Color4455EE;STICKLINE(MACDhs>0,0,MACD,2,0),Color5566FF;STICKLINE(MACDhs>0,0,MACD,1,0),Color6677FF;STICKLINE(MACDhx>0,0,MACD,9,0),Color0077BB;STICKLINE(MACDhx>0,0,MACD,8,0),Color0088CC;STICKLINE(MACDhx>0,0,MACD,7,0),Color0099CC;STICKLINE(MACDhx>0,0,MACD,6,0),Color00AADD;STICKLINE(MACDhx>0,0,MACD,5,0),Color00BBDD;STICKLINE(MACDhx>0,0,MACD,4,0),Color00CCEE;STICKLINE(MACDhx>0,0,MACD,3,0),Color00DDEE;STICKLINE(MACDhx>0,0,MACD,2,0),Color00EEFF;STICKLINE(MACDhx>0,0,MACD,1,0),Color00FFFF;STICKLINE(MACDlx<0,MACD,0,9,0),Color770000;STICKLINE(MACDlx<0,MACD,0,8,0),Color881100;STICKLINE(MACDIx<0,MACD,0,7,0),Color992200;STICKLINE(MACDlx<0,MACD,0,6,0),ColorAA3300;STICKLINE(MACDlx<0,MACD,0,5,0),ColorBB4400;STICKLINE(MACDIx<0,MACD,0,4,0),ColorCC5500;STICKLINE(MACDIx<0,MACD,0,3,0),ColorDD6600;STICKLINE(MACDIx<0,MACD,0,2,0),ColorEE7700;STICKLINE(MACDIx<0,MACD,0,1,0),ColorFF8800;STICKLINE(MACDIs<0,MACD,0,9,0),Color005500;STICKLINE(MACDls<0,MACD,0,8,0),Color007700;STICKLINE(MACDls<0,MACD,0,7,0),Color009900;STICKLINE(MACDls<0,MACD,0,6,0),Color00AA00;STICKLINE(MACDIs<0,MACD,0,5,0),Color00BB00;STICKLINE(MACDIs<0,MACD,0,4,0),Color00CC00;STICKLINE(MACDIs<0,MACD,0,3,0),CoIor00DD00;STICKLINE(MACDIs<0,MACD,0,2,0),CoIor00EE00;STICKLINE(MACDIs<0,MACD,0,1,0),CoIor00FF00;DIFF:DIFF1,CoIor0000FF;DEA:DEA1,CoIorFF0000;红柱面积:IF(MACD>0,SUM(MACD,BARSLAST(MACD<0)),0),LINETHICK0,CoIor0000FF; 绿柱面积:IF(MACD<0,SUM(MACD,BARSLAST(MACD>0)),0),LINETHICK0,CoIor006000;{平均面积:IF(MACD>0,10*红柱面积/BARSLAST(MACD<0),1(绿柱面积 /BARSLAST(MACD>0)), LINETHICK0,ColorFF00FF;}DRAWNUMBER(ref(MACD,1)>0 and MACD<=0 ,HHV(MACD,4),r红柱面积,1),2),ALIGN1,pxup10,colorred;{DRAWNUMBER(ref(MACD,1)>0 and MACD<=0 ,HHV(MACD,4),re平均面积,1),2),ALIGN1,pxup35,ColorFF00FF;}DRAWNUMBER(ref(MACD,1)<0 and MACD>=0 ,LLV(MACD,4),ref(abs绿柱面积),1),2),ALIGN1,pxd n5,CoIor006000;{DRAWNUMBER(ref(MACD,1)<0 and MACD>=0 ,LLV(MACD,4),ref(abs平均面积),1),2),ALIGN1,pxd n30,CoIorFF00FF;}DRAWNUMBER(BARSTATUS=2 AND MACD<0,LLV(MACD 绿柱b g( 积),2),alig n2,pxd n5,CoIor006000; {DRAWNUMBER(BARSTATUS=2 AND MACD<0,LLV(MACD,平均面(积),2),alig n2,pxd n30,CoIorFF00FF;}DRAWNUMBER(BARSTATUS=2 AND MACD>0,HHV(MACD红柱面s(积),2),alig n2,pxup10,colorred;{DRAWNUMBER(BARSTATUS=2 AND MACD>0,HHV(MACD平均bs(积),2),alig n2,pxup35,ColorFF00FF;}DRAWNUMBER(MACD>0 AND MACD=HHV(MACD,BARSLAST(MACD<0)) AND MACD>=REFX(MACD,1) AN MACD>=REFX(MACD,2),MACD,MACD,2),alig n0,pxup20,ColorFF0000;DRAWNUMBER(MACD<0 AND MACD=LLV(MACD,BARSLAST(MACD>0)) AND MACD<=REFX(MACD,1) ANMACD<=REFX(MACD,2),MACD,MACD,2),alig n0,pxup10,ColorFF00FF;0,CoIor000000;{MACD红绿柱面积(大智慧L2版副图)参数默认值:p=26; s=12; m=9} DIFF:EMA(CLOSE,s) - EMA(CLOSE,p); DEA:EMA(DIFF,m);MACD:2*(DIFF-DEA){,COLORSTICK} ,L INETHICK0;MACDhs:=IF(MACD>0 AND MACD>REF(MACD,1),MACD,0);MACDhx:=IF(MACD>0 AND MACD<REF(MACD,1),MACD,0);MACDIx:=IF(MACD<0 AND MACD<REF(MACD,1),MACD,0);MACDls:=IF(MACD<0 AND MACD>REF(MACD,1),MACD,0);STICKLINE(MACDhs>0,0,MACD,9,0),Color0000BB;STICKLINE(MACDhs>0,0,MACD,8,0),Color0000CC;STICKLINE(MACDhs>0,0,MACD,7,0),Color0000CC;STICKLINE(MACDhs>0,0,MACD,6,0),Color0000DD;STICKLINE(MACDhs>0,0,MACD,5,0),Color0033DD;STICKLINE(MACDhs>0,0,MACD,4,0),Color3355EE;STICKLINE(MACDhs>0,0,MACD,3,0),Color6677EE;STICKLINE(MACDhs>0,0,MACD,2,0),Color8888FF;STICKLINE(MACDhs>0,0,MACD,1,0),Color9999FF;STICKLINE(MACDhx>0,0,MACD,9,0),Color0077BB;STICKLINE(MACDhx>0,0,MACD,8,0),Color0088CC;STICKLINE(MACDhx>0,0,MACD,7,0),Color0099CC;STICKLINE(MACDhx>0,0,MACD,6,0),Color00AADD;STICKLINE(MACDhx>0,0,MACD,5,0),Color11BBDD;STICKLINE(MACDhx>0,0,MACD,4,0),Color22CCEE;STICKLINE(MACDhx>0,0,MACD,3,0),Color33DDEE;STICKLINE(MACDhx>0,0,MACD,2,0),Color44EEFF;STICKLINE(MACDhx>0,0,MACD,1,0),Color55FFFF;STICKLINE(MACDlx<0,MACD,0,9,0),ColorBB0000;STICKLINE(MACDIx<0,MACD,0,8,0),ColorCC0000;STICKLINE(MACDIx<0,MACD,0,7,0),ColorCC2200;STICKLINE(MACDlx<0,MACD,0,6,0),ColorDD4400;STICKLINE(MACDlx<0,MACD,0,5,0),ColorDD6611;STICKLINE(MACDIx<0,MACD,0,4,0),ColorEE8822;STICKLINE(MACDlx<0,MACD,0,3,0),ColorEEAA33;STICKLINE(MACDIx<0,MACD,0,2,0),ColorFFBB44;STICKLINE(MACDlx<0,MACD,0,1,0),ColorFFCC55;STICKLINE(MACDIs<0,MACD,0,9,0),CoIor007700;STICKLINE(MACDIs<0,MACD,0,8,0),CoIor009900;STICKLINE(MACDIs<0,MACD,0,7,0),CoIor00AA00;STICKLINE(MACDIs<0,MACD,0,6,0),CoIor00BB00;STICKLINE(MACDIs<0,MACD,0,5,0),CoIor11CC11;STICKLINE(MACDIs<0,MACD,0,4,0),Color22DD22;STICKLINE(MACDIs<0,MACD,0,3,0),CoIor33FF33;STICKLINE(MACDIs<0,MACD,0,2,0),CoIor44EF44;STICKLINE(MACDIs<0,MACD,0,1,0),CoIor55FF55;绿柱面积:10*IF (MACD<O,SUM(MACD,BARSLAST(MACD>O)),O),LINETHICKO,ColorOOffOO; 红柱面积:10*IF (MACD>O,SUM(MACD,BARSLAST(MACD<O)),O),LINETHICK0,colorred; DRAWTEXT(ref(MACD,1)>0 andMACD<=0 ,HHV(MACD,8),''+ref(红柱面积,1)),ALIGN1,VALIGN1,colorred;DRAWTEXT(ref(MACD,1)<0 and MACD>=0 ,LLV(MACD,4),''+ref(abs(绿柱面积),1)),ALIGN1,ColorOOffOO;DRAWTEXT(BARSTATUS=2 AND MACD<0,LLV(MACD,8),”+绿柱面积)),align2,Color004A00; DRAWTEXT(BARSTATUS=2 AND MACD>0,HHV(MACD,4),”+红柱面积)),alig n2,VALIGN1,colorred;注:底双背离是指MAC(绿柱)和DIFF (黄白线)都底背离。

相关文档
最新文档