缠论公式集

合集下载

缠论分笔公式

缠论分笔公式

分笔1KU1:=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)=0AND 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;分笔2局部低点预选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;局部极点B:=IF(局部低点预选C=-1,-1,IF(局部高点预选C=1,1,0));缺口判断:=IF(L>REF(H,1),1,IF(H<REF(L,1),-1,0));距前高天:=BARSLAST(局部极点A=1);距前低天:=BARSLAST(局部极点A=-1);高保留A:=IF(局部极点A=1 AND REF(距前低天,1)>REF(距前高天,1) AND HHV(H,距前低天+1)>REF(HHV(H,距前低天+1),1),1,0);高保留B:=IF(局部极点A=1 AND REF(距前低天,1)<REF(距前高天,1) AND (距前低天>=4 OR HHV(缺口判断,距前低天)=1),1,0);低保留A:=IF(局部极点A=-1 AND REF(距前高天,1)>REF(距前低天,1) AND LLV(L,距前高天+1)<REF(LLV(L,距前高天+1),1),-1,0);低保留B:=IF(局部极点A=-1 AND REF(距前高天,1)<REF(距前低天,1) AND (距前高天>=4 OR LLV(缺口判断,距前高天)=-1),-1,0);极点保留:=低保留A+低保留B+高保留A+高保留B;局部极点:IF(极点保留=-1,L,IF(极点保留=1,H,DRAWNULL)) CIRCLEDOT COLORYELLOW; DRAWLINE(极点保留=-1,局部极点,极点保留=1,局部极点,0)COLORLIRED LINETHICK2; DRAWLINE(极点保留=1,局部极点,极点保留=-1,局部极点,0)COLORYELLOW LINETHICK2;分笔3{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=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)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;分笔4五日:=MA(C,5);十三日:=MA(C,13);二十一日:=MA(C,21);五十五日:=MA(C,55);一百四四:=MA(C,144);两百三三:=MA(C,233);局部低点预选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)COLORLIMAGENTA,LINETHICK1; DRAWLINE(极点保留=1,局部极点,极点保留=-1,局部极点,0)COLORLIMAGENTA,LINETHICK1;。

缠论公式集

缠论公式集

缠论公式集段成选股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 (黄白线)都底背离。

缠论公式(最完美自动画笔公式)主图

缠论公式(最完美自动画笔公式)主图

*缠论公式(最完美自动画笔公式)主图缠中说禅笔定理:任何的当下,在任何时间周期的K线图中,走势必然落在一确定的具有明确方向的笔当中(向上笔或向下笔),而在笔当中的位置,必然只有两种情况:1、在分型构造中。

2、分型构造确认后延伸为笔的过程中。

缠论定义示意图:总结:按照股市中所有走势都是笔于笔的连接,编写的此公式,(公式中也参考了别的同修的成果),应该是网络中最完美的了,本人把5日战法也一块编写了进去,花费了不少精力,希望大家看到也传播出去,希望能帮助到一些人。

有缘得之吧!公式源码:老笔:=0;M5:MA(CLOSE,5),COLORRED,LINETHICK3;MA20:MA(CLOSE,20),COLORLIBLUE,LINETHICK1.5;MA60:MA(CLOSE,50),COLORRED,LINETHICK3;M250:MA(CLOSE,200),COLORBLUE,LINETHICK4;IF(C>=M5,M5,DRAWNULL),COLORRED,LINETHICK3;IF(C<M5,M5,DRAWNULL),COLORGREEN,LINETHICK3;IF(C>=MA60,MA60,DRAWNULL),COLORRED,LINETHICK3;IF(C<MA60,MA60,DRAWNULL),COLORGREEN,LINETHICK3;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 AND REF(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 AND REF(L,BARSLAST(FD1))<REF(H,BARSLAST(D1X)));G1H:=IF(BARSLAST(D1)>BARSLAST(G1),REF(H,BARSLAST(G 1)),REF(H,BARSLAST(D1))),;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) AND BARSLAST(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)) ANDBARSLAST(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,LINETHICK2;L2:DRAWLINE(NN,H,UU,L,0),COLORYELLOW,LINETHICK4;{标示端点数值}{DRAWNUMBER(L1 AND L2 AND NN ,H,H),COLORLIRED;DRAWNUMBER(L1 AND L2 AND UU ,L,L),COLORLIMAGENTA;};主图效果图:。

大智慧缠论中枢公式

大智慧缠论中枢公式

大智慧缠论中枢公式
缠中说禅走势中枢的数学表达式:A、B、C,分别的高、低点是
a1\a2,b1\b2,c1\c2,则中枢的区间就是[max(a2,b2,c2),min
(a1,b1,c1)]。

中枢的形成有两种方式,第一种有a1=b1,b2=c2;第二种有
a2=b2,b1=c1。

但无论是哪种情况,中枢的公式都可以简化为[max
(a2,c2),min(a1,c1)]。

此外,走势中枢区间为方便起见,把与中枢方向一致的次级别走势类型称为Z走势段,按中枢中的时间顺序,分别记为Zn等,而相应的高、低点分别记为gn、dn。

特别地,再定义ZG= min(g1、g2),ZD=max(d1、d2),显然,[ZD,ZG]就是缠中说禅走势中枢的区间。

如需更多关于“大智慧缠论中枢公式”的信息,建议查阅大智慧股票软件官网或咨询其官方客服。

同时请注意,投资有风险,如果投资需谨慎。

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

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

目前最准确的通达信缠论分笔公式-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;};。

通达信缠论高低点主图指标公式

通达信缠论高低点主图指标公式

通达信缠论高低点主图指标公式K:=1;局部低点预选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;局部天数: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;DRAWTEXT(极点保留=-1,L*0.99,低点显示),COLORGREEN;DRAWTEXT(极点保留=1,H*1.01,高点显示),COLORYELLOW;DRAWNUMBER(极点保留=1,H,局部极点);DRAWNUMBER(极点保留=-1,L,局部极点),DRAWABOVE;。

通达信缠论中枢画线主图指标公式

通达信缠论中枢画线主图指标公式

通达信缠论中枢画线主图指标公式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,'中枢'),COLORWHITE;中枢高:PLOYLINE(DISP=2,REF(ZSD,BARSLAST(TJ8))),CIRCLEDOT,COLO RLIRED;中枢低:PLOYLINE(DISP=2,REF(ZSG,BARSLAST(TJ8))),CIRCLEDOT,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);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);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)COLORLIRED;DRAWLINE(极点保留=1,局部极点,极点保留=-1,局部极点,0)COLORYELLOW;DD1:=BARSLAST(ABS(极点保留)!=1);DRAWTEXT(极点保留=1,局部极点,'卖'),COLORGREEN;STICKLINE(极点保留=1,局部极点,局部极点,30,1),COLORCYAN;DRAWNUMBER(极点保留=1,局部极点,局部极点)COLORCYAN;DRAWTEXT(极点保留=-1,局部极点,'买'),COLORRED;STICKLINE(极点保留=-1,局部极点,局部极点,30,1),COLORRED;DRAWNUMBER(极点保留=-1,局部极点,局部极点)COLORRED;MA5:MA(CLOSE,5),COLORFF00FF,LINETHICK2;判:IF(MA5<REF(MA5,1),MA5,DRAWNULL),COLORWHITE,LINETHI CK2;。

缠论画笔指标公式

缠论画笔指标公式

缠论画笔指标公式
《缠论画笔指标公式》
缠论是一种技术分析技术,由法国大师罗拉利(Laloue)创建,有一些人称之为法国线(French Line)。

它需要将趋势线延伸出一个横坐标,然后根据一定的准则标出一定的点位,最后基于此作出一定的判断。

缠论画笔指标公式的主要用途是帮助投资者识别和判断趋势。

它可以有效的帮助投资者了解趋势的强弱,以及趋势的变化趋势。

缠论画笔指标公式的基本核心原理是,在趋势延续的时候,投资者可以了解哪些是正确的仓位,以及哪些是错误的仓位。

它的公式:
趋势线:
趋势线 = 前期最高点+(最高点-最低点)/2.
趋势线低点:
趋势线低点 = 前期最低点+(最高点-最低点)/2.
缠论:
缠论 =(当前价格-最低点)/(最高点-最低点)。

如果缠论指标超过趋势线高点,这意味着市场价格正处于严重的反弹阶段,投资者应当提高警惕性,密切关注价格变动动向。

反之,如果缠论指标低于趋势线低点,则意味着市场上的价格正处于急剧下跌的阶段,投资者应当考虑减仓。

- 1 -。

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

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

通达信缠论指标公式----“缠中套利”老笔:=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;};。

缠论公式集

缠论公式集

段成选股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));。

缠论分型公式

缠论分型公式

缠论分型公式
缠论分型公式是一种基于分型理论和K线形态的股票分析方法。

以下是缠论分型公式的编写方法:
1. 标记所有顶分型及底分型的顶部或底部,简称“节点”。

2. 非包含关系的分型端点预选:顶分型公式H>REF(H,1) AND L>REF(L,1);底分型公式L<REF(L,1) AND H<REF(H,1)。

3. 包含关系的K线处理:凡不符合上述类型的K线,均处于包含关系之中。

包含关系分为两种,一是当前K线包含前一根K线时,需进行合并处理;
二是当前K线被前一根K线包含时,因不涉及端点,无需处理。

4. 将前述二种分型节点作为备选分型。

5. 对连续的同向分型节点,取最高点或最低点为本笔分型的节点,并向前过滤掉中间满足条件的分型。

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

6. 分型顶:根据预选分型节点的最高价或最低价进行处理。

如果
H=HHV(H,BARSLAST(分型底2)),则取其为本笔分型的节点;如果
L=LLV(L,BARSLAST(分型顶2)),则取其为本笔分型的节点。

7. 分型底:根据预选分型节点的最高价或最低价进行处理。

如果
L=LLV(L,BARSLAST(分型顶2)),则取其为本笔分型的节点;如果
H=HHV(H,BARSLAST(分型底2)),则取其为本笔分型的节点。

8. 最后画出符合顶分型和底分型的黄色K线即可。

如需获取完整的缠论分型公式代码和操作流程,建议查阅缠论相关书籍或咨询专业人士。

缠论指标公式代码集锦

缠论指标公式代码集锦

缠论指标公式代码集锦//缠论分笔公式——————————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;};——————————//缠论指标之三布林+顶底线段(通达信主图)这个指标是对付中阴阶段的开始和结束,很直观了。

缠论画笔指标公式

缠论画笔指标公式

缠论画笔指标公式
缠论画笔指标公式,是一种技术分析指标,用于预测交易市场的走势。

基本公式如下:
1.计算当前价格与前一个价格的差值△P,若为正,则为向上画笔,反之,则为向下画笔。

2.计算当前价格的波动幅度△R,即最高价与最低价之差。

3.计算当前价格到达画笔起点的时间间隔△T。

4.根据以下公式计算画笔中心线:
(1)若为向上画笔,则中心线为前一画笔中心线加上当前画笔波动幅度的一半,即:
中心线=Pn-1+(△R/2)
(2)若为向下画笔,则中心线为前一画笔中心线减去当前画笔波动幅度的一半,即:
中心线=Pn-1-(△R/2)
5.计算画笔宽度,即画笔波动幅度的一半。

6.根据以上步骤,可以得出每个画笔的起点、中心线、宽度和方向,以帮助交易者进行预测和决策。

温馨提示:以上公式仅供参考,实际应用需要根据具体情况进行调整和优化。

缠论公式

缠论公式

主图顶周期:=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));。

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

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

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

注意:这是主图技术指标,建公式时一定要把&#8220;主图叠加&#8221;勾选上!{5/10均线面积}MA5:MA(C,5);MA10:MA(C,10);均线差:=MA5-MA10;JC:=MA10-MA5;绿柱面积:=IF (均线差&lt;0,SUM(均线差*0.1,BARSLAST(JC&lt;0)),0);红柱面积:=IF (均线差&gt;0,SUM(均线差*0.1,BARSLAST(JC&gt;0)),0);均线面积:IF(均线差&gt;0,红柱面积,绿柱面积),color0000ff,LINETHICK0;A1:=IF(均线差&gt;0,1,-1);A2:=REF(A1,1);A3:=A1*A2;A4:=BARSLAST(A3&lt;0);A5:=A4+1;趋势平均力度:(SUM(均线差,0)-REF(SUM(均线差,0),A5))/A5,colorFF00FF,LINETHICK0;drawnumber(ref(均线差,1)&gt;0 and 均线差&lt;=0 ,HHV(H,8),ref(红柱面积,1),3),ALIGN2,pxup20,colorred; drawnumber(ref(均线差,1)&gt;0 and 均线差&lt;=0 ,HHV(H,8),ref(趋势平均力度,1),3),ALIGN2,pxup45,colorff00ff;drawnumber(ref(均线差,1)&lt;0 and 均线差&gt;=0 ,LLV(L,8),ref(abs(绿柱面积),1),3),ALIGN2,pxdn5,Color004A00;drawnumber(ref(均线差,1)&lt;0 and 均线差&gt;=0 ,LLV(L,8),ref(abs(趋势平均力度),1),3),ALIGN2,pxdn30,colorff00ff;drawnumber(islastbar and 均线差&lt;0,LLV(L,5),abs(绿柱面积),3),align2,pxdn5,Color004A00;drawnumber(islastbar and 均线差&lt;0,LLV(L,5),abs(趋势平均力度),3),align2,pxdn30,Colorff00ff;drawnumber(islastbar and 均线差&gt;0,HHV(H,5),abs(红柱面积),3),align2,pxup20,colorred;drawnumber(islastbar and 均线差&gt;0,HHV(H,5),abs(趋势平均力度),3),align2,pxup45,colorff00ff;MACD底背离选股公式——飞狐、大智慧L2{底背离,飞狐版、大智慧L2版、大智慧经典(免费)版} DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);DEA:=EMA(DIFF,9);MACD:=2*(DIFF-DEA);QZQ:=BARSLAST(REF(MACD,1)&lt;0 AND MACD&gt;0); QM:=LLVBARS(MACD,QZQ+20);MQDZ:=IF(QM&gt;QZQ,REF(MACD,QM),0);XG1:=MACD&lt;0 AND MACD&gt;MQDZAND CLOSE=LLV(CLOSE,QZQ+20) AND MQDZ&lt;0; XG:REF(XG1,1)&lt;&gt;0 AND MACD&gt;REF(MACD,1);{双底背离,飞狐版、大智慧L2版}DIFF:=EMA(CLOSE,12) - EMA(CLOSE,26);DEA:=EMA(DIFF,9);MACD:=2*(DIFF-DEA);QZQ:=BARSLAST(REF(MACD,1)&lt;0 AND MACD&gt;0); QM:=LLVBARS(MACD,QZQ+20);MQDZ:=IF(QM&gt;QZQ,REF(MACD,QM),0);QF:=LLVBARS(DIFF,QZQ+20);DQDZ:=IF(QF&gt;QZQ,REF(DIFF,QF),0);XG1:=MACD&lt;0 AND MACD&gt;MQDZ AND DIFF&lt;0 AND DIFF&gt;DQDZAND CLOSE=LLV(CLOSE,QZQ+20) AND MQDZ&lt;0 AND DQDZ&lt;0;XG:REF(XG1,1)&lt;&gt;0 AND MACD&gt;REF(MACD,1);注:底双背离是指MACD(绿柱)和DIFF(黄白线)都底背离。

红绿柱面积公式——飞狐和大智慧L2版{MACD红绿柱面积(飞狐版副图)参数默认值:p=26;s=12;m=9}DIFF1:=EMA(CLOSE,s) - EMA(CLOSE,p);DEA1:=EMA(DIFF1,m);MACD:2*(DIFF1-DEA1){,COLORSTICK},LINETHICK0; MACDhs:=IF(MACD&gt;0 ANDMACD&gt;=REF(MACD,1),MACD,0);MACDhx:=IF(MACD&gt;0 ANDMACD&lt;=REF(MACD,1),MACD,0);MACDlx:=IF(MACD&lt;0 ANDMACD&lt;REF(MACD,1),MACD,0);MACDls:=IF(MACD&lt;0 ANDMACD&gt;REF(MACD,1),MACD,0);STICKLINE(MACDhs&gt;0,0,MACD,9,0),Color0000BB; STICKLINE(MACDhs&gt;0,0,MACD,8,0),Color0000CC; STICKLINE(MACDhs&gt;0,0,MACD,7,0),Color0011CC; STICKLINE(MACDhs&gt;0,0,MACD,6,0),Color1122DD; STICKLINE(MACDhs&gt;0,0,MACD,5,0),Color2233DD; STICKLINE(MACDhs&gt;0,0,MACD,4,0),Color3344EE; STICKLINE(MACDhs&gt;0,0,MACD,3,0),Color4455EE; STICKLINE(MACDhs&gt;0,0,MACD,2,0),Color5566FF; STICKLINE(MACDhs&gt;0,0,MACD,1,0),Color6677FF; STICKLINE(MACDhx&gt;0,0,MACD,9,0),Color0077BB; STICKLINE(MACDhx&gt;0,0,MACD,8,0),Color0088CC; STICKLINE(MACDhx&gt;0,0,MACD,7,0),Color0099CC; STICKLINE(MACDhx&gt;0,0,MACD,6,0),Color00AADD; STICKLINE(MACDhx&gt;0,0,MACD,5,0),Color00BBDD; STICKLINE(MACDhx&gt;0,0,MACD,4,0),Color00CCEE; STICKLINE(MACDhx&gt;0,0,MACD,3,0),Color00DDEE; STICKLINE(MACDhx&gt;0,0,MACD,2,0),Color00EEFF; STICKLINE(MACDhx&gt;0,0,MACD,1,0),Color00FFFF; STICKLINE(MACDlx&lt;0,MACD,0,9,0),Color770000; STICKLINE(MACDlx&lt;0,MACD,0,8,0),Color881100;STICKLINE(MACDlx&lt;0,MACD,0,7,0),Color992200; STICKLINE(MACDlx&lt;0,MACD,0,6,0),ColorAA3300; STICKLINE(MACDlx&lt;0,MACD,0,5,0),ColorBB4400; STICKLINE(MACDlx&lt;0,MACD,0,4,0),ColorCC5500; STICKLINE(MACDlx&lt;0,MACD,0,3,0),ColorDD6600; STICKLINE(MACDlx&lt;0,MACD,0,2,0),ColorEE7700; STICKLINE(MACDlx&lt;0,MACD,0,1,0),ColorFF8800; STICKLINE(MACDls&lt;0,MACD,0,9,0),Color005500; STICKLINE(MACDls&lt;0,MACD,0,8,0),Color007700; STICKLINE(MACDls&lt;0,MACD,0,7,0),Color009900; STICKLINE(MACDls&lt;0,MACD,0,6,0),Color00AA00; STICKLINE(MACDls&lt;0,MACD,0,5,0),Color00BB00; STICKLINE(MACDls&lt;0,MACD,0,4,0),Color00CC00; STICKLINE(MACDls&lt;0,MACD,0,3,0),Color00DD00; STICKLINE(MACDls&lt;0,MACD,0,2,0),Color00EE00; STICKLINE(MACDls&lt;0,MACD,0,1,0),Color00FF00;DIFF:DIFF1,Color0000FF;DEA:DEA1,ColorFF0000;红柱面积:IF(MACD&gt;0,SUM(MACD,BARSLAST(MACD&lt;0)),0),LIN ETHICK0,Color0000FF;绿柱面积:IF(MACD&lt;0,SUM(MACD,BARSLAST(MACD&gt;0)),0),LIN ETHICK0,Color006000;{平均面积: IF(MACD&gt;0,10*红柱面积/BARSLAST(MACD&lt;0),10*绿柱面积/BARSLAST(MACD&gt;0)),LINETHICK0,ColorFF00FF;} DRAWNUMBER(ref(MACD,1)&gt;0 andMACD&lt;=0 ,HHV(MACD,4),ref(红柱面积,1),2),ALIGN1,pxup10,colorred;{DRAWNUMBER(ref(MACD,1)&gt;0 andMACD&lt;=0 ,HHV(MACD,4),ref(平均面积,1),2),ALIGN1,pxup35,ColorFF00FF;}DRAWNUMBER(ref(MACD,1)&lt;0 andMACD&gt;=0 ,LLV(MACD,4),ref(abs(绿柱面积),1),2),ALIGN1,pxdn5,Color006000;{DRAWNUMBER(ref(MACD,1)&lt;0 andMACD&gt;=0 ,LLV(MACD,4),ref(abs(平均面积),1),2),ALIGN1,pxdn30,ColorFF00FF;}DRAWNUMBER(BARSTATUS=2 ANDMACD&lt;0,LLV(MACD,4),abs(绿柱面积),2),align2,pxdn5,Color006000;{DRAWNUMBER(BARSTATUS=2 ANDMACD&lt;0,LLV(MACD,4),abs(平均面积),2),align2,pxdn30,ColorFF00FF;}DRAWNUMBER(BARSTATUS=2 ANDMACD&gt;0,HHV(MACD,4),abs(红柱面积),2),align2,pxup10,colorred;{DRAWNUMBER(BARSTATUS=2 ANDMACD&gt;0,HHV(MACD,4),abs(平均面积),2),align2,pxup35,ColorFF00FF;}DRAWNUMBER(MACD&gt;0 ANDMACD=HHV(MACD,BARSLAST(MACD&lt;0)) ANDMACD&gt;=REFX(MACD,1) ANDMACD&gt;=REFX(MACD,2),MACD,MACD,2),align0,pxup20,C olorFF0000;DRAWNUMBER(MACD&lt;0 ANDMACD=LLV(MACD,BARSLAST(MACD&gt;0)) ANDMACD&lt;=REFX(MACD,1) ANDMACD&lt;=REFX(MACD,2),MACD,MACD,2),align0,pxup10,C olorFF00FF;0,Color000000;{MACD红绿柱面积(大智慧L2版副图)参数默认值:p=26;s=12;m=9}DIFF:EMA(CLOSE,s) - EMA(CLOSE,p);DEA:EMA(DIFF,m);MACD:2*(DIFF-DEA){,COLORSTICK},LINETHICK0; MACDhs:=IF(MACD&gt;0 ANDMACD&gt;REF(MACD,1),MACD,0);MACDhx:=IF(MACD&gt;0 ANDMACD&lt;REF(MACD,1),MACD,0);MACDlx:=IF(MACD&lt;0 ANDMACD&lt;REF(MACD,1),MACD,0);MACDls:=IF(MACD&lt;0 ANDMACD&gt;REF(MACD,1),MACD,0);STICKLINE(MACDhs&gt;0,0,MACD,9,0),Color0000BB; STICKLINE(MACDhs&gt;0,0,MACD,8,0),Color0000CC; STICKLINE(MACDhs&gt;0,0,MACD,7,0),Color0000CC; STICKLINE(MACDhs&gt;0,0,MACD,6,0),Color0000DD; STICKLINE(MACDhs&gt;0,0,MACD,5,0),Color0033DD; STICKLINE(MACDhs&gt;0,0,MACD,4,0),Color3355EE; STICKLINE(MACDhs&gt;0,0,MACD,3,0),Color6677EE; STICKLINE(MACDhs&gt;0,0,MACD,2,0),Color8888FF; STICKLINE(MACDhs&gt;0,0,MACD,1,0),Color9999FF; STICKLINE(MACDhx&gt;0,0,MACD,9,0),Color0077BB;STICKLINE(MACDhx&gt;0,0,MACD,8,0),Color0088CC; STICKLINE(MACDhx&gt;0,0,MACD,7,0),Color0099CC; STICKLINE(MACDhx&gt;0,0,MACD,6,0),Color00AADD; STICKLINE(MACDhx&gt;0,0,MACD,5,0),Color11BBDD; STICKLINE(MACDhx&gt;0,0,MACD,4,0),Color22CCEE; STICKLINE(MACDhx&gt;0,0,MACD,3,0),Color33DDEE; STICKLINE(MACDhx&gt;0,0,MACD,2,0),Color44EEFF; STICKLINE(MACDhx&gt;0,0,MACD,1,0),Color55FFFF; STICKLINE(MACDlx&lt;0,MACD,0,9,0),ColorBB0000; STICKLINE(MACDlx&lt;0,MACD,0,8,0),ColorCC0000; STICKLINE(MACDlx&lt;0,MACD,0,7,0),ColorCC2200; STICKLINE(MACDlx&lt;0,MACD,0,6,0),ColorDD4400; STICKLINE(MACDlx&lt;0,MACD,0,5,0),ColorDD6611; STICKLINE(MACDlx&lt;0,MACD,0,4,0),ColorEE8822; STICKLINE(MACDlx&lt;0,MACD,0,3,0),ColorEEAA33; STICKLINE(MACDlx&lt;0,MACD,0,2,0),ColorFFBB44; STICKLINE(MACDlx&lt;0,MACD,0,1,0),ColorFFCC55; STICKLINE(MACDls&lt;0,MACD,0,9,0),Color007700; STICKLINE(MACDls&lt;0,MACD,0,8,0),Color009900; STICKLINE(MACDls&lt;0,MACD,0,7,0),Color00AA00; STICKLINE(MACDls&lt;0,MACD,0,6,0),Color00BB00; STICKLINE(MACDls&lt;0,MACD,0,5,0),Color11CC11;STICKLINE(MACDls&lt;0,MACD,0,4,0),Color22DD22; STICKLINE(MACDls&lt;0,MACD,0,3,0),Color33FF33; STICKLINE(MACDls&lt;0,MACD,0,2,0),Color44EF44; STICKLINE(MACDls&lt;0,MACD,0,1,0),Color55FF55;绿柱面积:10*IF(MACD&lt;0,SUM(MACD,BARSLAST(MACD&gt;0)),0),LINETHI CK0,Color00ff00;红柱面积:10*IF(MACD&gt;0,SUM(MACD,BARSLAST(MACD&lt;0)),0),LINETHI CK0,colorred;DRAWTEXT(ref(MACD,1)&gt;0 andMACD&lt;=0 ,HHV(MACD,8),''+ref(红柱面积,1)),ALIGN1,VALIGN1,colorred;DRAWTEXT(ref(MACD,1)&lt;0 andMACD&gt;=0 ,LLV(MACD,4),''+ref(abs(绿柱面积),1)),ALIGN1,Color00ff00;DRAWTEXT(BARSTATUS=2 ANDMACD&lt;0,LLV(MACD,8),''+abs(绿柱面积)),align2,Color004A00;DRAWTEXT(BARSTATUS=2 ANDMACD&gt;0,HHV(MACD,4),''+abs(红柱面积)),align2,VALIGN1,colorred;注:底双背离是指MACD(绿柱)和DIFF(黄白线)都底背离。

相关文档
最新文档