通达信指标公式源码概况:

指标类别: 通达信指标公式

授权方式: 免费版

指标评级: ★★★★★

指标分类: 策略

画线方法: 副图

一、缠论顶底副图指标公式

  

MA1:EMA(CLOSE,6),COLOR00FF00;  

MA2:EMA(CLOSE,25),colorred;  

顶:MA(CLOSE,20)+2*STD(CLOSE,55),coloryellow,POINTDOT,LINETHICK2;  

底:MA(CLOSE,20)-2*STD(CLOSE,55),coloryellow,POINTDOT,LINETHICK2;  

STICKLINE(MA1>MA2,MA1,MA2,9,0),COLORFF66FF;  

STICKLINE(MA2>MA1,MA1,MA2,9,0),COLORFF6600;  

DRAWICON(MA2-MA1>0ANDMA1/LOW>1.15,LOW,1);  

DRAWICON(MA1-MA2>0ANDHIGH/MA1>1.15,HIGH,2);  

STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,4,0),COLORFFCC00;  

STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,3,0),COLORFFDD00;  

STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,2,0),COLORFFEE00;  

STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,1,0),COLORFFFF00;  

STICKLINE(CLOSE>OPEN,CLOSE,OPEN,4,0),COLOR000099;  

STICKLINE(CLOSE>OPEN,CLOSE,OPEN,3,0),COLOR0000BB;  

STICKLINE(CLOSE>OPEN,CLOSE,OPEN,2,0),COLOR0000DD;  

STICKLINE(CLOSE>OPEN,CLOSE,OPEN,1,0),COLOR0000FF;  

VAR1:=SMA(MAX(OPEN-REF(OPEN,1),0),6,1)/SMA(ABS(OPEN-REF(OPEN,1)),6,1)  

*100;  

VAR2:=SMA(MAX(CLOSE-REF(CLOSE,1),0),6,1)/SMA(ABS(CLOSE-  

REF(CLOSE,1)),6,1)*100;  

VAR3:=SMA(MAX(HIGH-REF(HIGH,1),0),6,1)/SMA(ABS(HIGH-REF(HIGH,1)),6,1)  

*100;  

VAR4:=SMA(MAX(LOW-REF(LOW,1),0),6,1)/SMA(ABS(LOW-  

REF(LOW,1)),6,1)*100;  

VAR5:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;  

短:SMA(VAR5,6,1),COLORWHITE;  

中:SMA(短,3,1),COLORYELLOW;  

领先:3*短-2*中,COLORLIMAGENTA;  

DRAWKLINE(VAR3,VAR1,VAR4,VAR2);  

顶:90,LINETHICK2,COLOR55AA77;  

底:15,LINETHICK2,COLOR55AA77;  

局部低点预选A:=BACKSET(LLV(L,5)<REF(LLV(L,4),1),4);  

局部低点预选B:=BACKSET(局部低点预选A=0ANDREF(局部低点预选A,1)=1,2);  

局部低点预选C:=IF(局部低点预选B=1ANDREF(局部低点预选B,1)=0,-1,0);  

局部高点预选A:=BACKSET(HHV(H,5)>REF(HHV(H,4),1),4);  

局部高点预选B:=BACKSET(局部高点预选A=0ANDREF(局部高点预选A,1)=1,2);  

局部高点预选C:=IF(局部高点预选B=1ANDREF(局部高点预选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=-1ANDREF(距前高天,1)>REF(距前低天,1)ANDLLV(L,  

距前高天+1)<REF(LLV(L,距前高天+1),1),-1,0);  

低保留AB:=IF(局部低点预选C=-1ANDREF(距前高天,1)<=REF(距前低天,1)AND(距前高  

天>=4ORLLV(缺口判断,距前高天)=-1ORLLV(L,距前低天+2)<REF(LLV(L,距前低天  

+1),1)),-1,0);  

低保留S:=IF((低保留AA=-1OR低保留AB=-1)ANDL<REF(H,距前高天+1),-1,0);  

预判:=IF((距前低天<4ANDHHV(缺口判断,距前低天)!=1)ORREF(低保留S,距前低  

天)=0,1,0);  

判断:=IF(局部高点预选C=1ANDREF(距前低天,1)<=REF(距前高天,1)AND预判=1AND  

大值周期>REF(小值周期,距前低天+1)AND大值周期>REF(小值周期,距前低天)AND大  

值周期>REF(大值周期,距前高天),1,0);  

高保留A:=IF(局部高点预选C=1ANDREF(距前低天,1)>REF(距前高天,1)ANDHHV(H,距  

前低天+1)>REF(HHV(H,距前低天+1),1),1,0);  

高保留B:=IF(局部高点预选C=1ANDREF(距前低天,1)<=REF(距前高天,1)ANDREF(低保  

留S,距前低天)=-1AND(距前低天>=4ORHHV(缺口判断,距前低天)=1),1,0);  

高保留:=IF((高保留A=1OR高保留B=1OR判断=1)ANDH>REF(L,距前低天+1),1,0);  

预判A:=IF((距前高天<4ANDHHV(缺口判断,距前高天)!=1)ORREF(高保留,距前高  

天)=0,1,0);  

判断A:=IF(局部低点预选C=-1ANDREF(距前高天,1)<=REF(距前低天,1)AND预判A=1  

AND小值周期>REF(大值周期,距前高天+1)AND小值周期>REF(大值周期,距前高天)  

AND小值周期>REF(小值周期,距前低天),-1,0);  

低保留A:=IF(局部低点预选C=-1ANDREF(距前高天,1)>REF(距前低天,1)ANDLLV(L,距  

前高天+1)<REF(LLV(L,距前高天+1),1),-1,0);  

低保留B:=IF(局部低点预选C=-1ANDREF(距前高天,1)<=REF(距前低天,1)AND(距前高  

天>=4ORLLV(缺口判断,距前高天)=-1OR判断A=-1),-1,0);  

低保留:=IF((低保留A=-1OR低保留B=-1)ANDL<REF(H,距前高天+1),-1,0);  

距前高天A:=BARSLAST(高保留=1);  

距前低天A:=BARSLAST(低保留=-1);  

预判X:=IF((距前低天A<4ANDHHV(缺口判断,距前低天A)!=1)ORREF(低保留,距前低天  

A)=0,1,0);  

判断X:=IF(局部高点预选C=1ANDREF(距前低天A,1)<=REF(距前高天A,1)AND预判  

X=1AND大值周期>REF(小值周期,距前低天A+1)AND大值周期>REF(小值周期,距前低  

天A)AND大值周期>REF(大值周期,距前高天A),1,0);  

高保留XA:=IF(局部高点预选C=1ANDREF(距前低天A,1)>REF(距前高天A,1)AND  

HHV(H,距前低天A+1)>REF(HHV(H,距前低天A+1),1),1,0);  

高保留XB:=IF(局部高点预选C=1ANDREF(距前低天A,1)<=REF(距前高天A,1)AND  

REF(低保留,距前低天A)=-1AND(距前低天A>=4ORHHV(缺口判断,距前低天A)=1),1,0);  

高保留X:=IF((高保留XA=1OR高保留XB=1OR判断X=1)ANDH>REF(L,距前低天  

A+1),1,0);  

预判XA:=IF((距前高天A<4ANDHHV(缺口判断,距前高天A)!=1)ORREF(高保留XA,距前  

高天A)=0,1,0);  

判断XA:=IF(局部低点预选C=-1ANDREF(距前高天A,1)<=REF(距前低天A,1)AND预判  

XA=1AND小值周期>REF(大值周期,距前高天A+1)AND小值周期>REF(大值周期,距前  

高天A)AND小值周期>REF(小值周期,距前低天A),-1,0);  

低保留XA:=IF(局部低点预选C=-1ANDREF(距前高天A,1)>REF(距前低天A,1)AND  

LLV(L,距前高天A+1)<REF(LLV(L,距前高天A+1),1),-1,0);  

低保留XB:=IF(局部低点预选C=-1ANDREF(距前高天A,1)<=REF(距前低天A,1)AND(距  

前高天A>=4ORLLV(缺口判断,距前高天A)=-1OR判断XA=-1),-1,0);  

低保留X:=IF((低保留XA=-1OR低保留XB=-1)ANDL<REF(H,距前高天A+1),-1,0);  

距前高天YA:=BARSLAST(高保留X=1);  

距前低天YA:=BARSLAST(低保留X=-1);  

预判YX:=IF((距前低天YA<4ANDHHV(缺口判断,距前低天YA)!=1)ORREF(低保留X,距  

前低天YA)=0,1,0);  

判断YX:=IF(局部高点预选C=1ANDREF(距前低天YA,1)<=REF(距前高天YA,1)AND预判YX=1AND大值周期>REF(小值周期,距前低天YA+1)AND大值周期>REF(小值周期,  

距前低天YA)AND大值周期>REF(大值周期,距前高天YA),1,0);  

高保留YXA:=IF(局部高点预选C=1ANDREF(距前低天YA,1)>REF(距前高天YA,1)AND  

HHV(H,距前低天YA+1)>REF(HHV(H,距前低天YA+1),1),1,0);  

高保留YXB:=IF(局部高点预选C=1ANDREF(距前低天YA,1)<=REF(距前高天YA,1)AND  

REF(低保留X,距前低天YA)=-1AND(距前低天YA>=4ORHHV(缺口判断,距前低天  

YA)=1),1,0);  

高保留YX:=IF((高保留YXA=1OR高保留YXB=1OR判断YX=1)ANDH>REF(L,距前低  

天YA+1),1,0);  

预判YXA:=IF((距前高天YA<4ANDHHV(缺口判断,距前高天YA)!=1)ORREF(高保留YXA,  

距前高天YA)=0,1,0);  

判断YXA:=IF(局部低点预选C=-1ANDREF(距前高天YA,1)<=REF(距前低天YA,1)AND  

预判YXA=1AND小值周期>REF(大值周期,距前高天YA+1)AND小值周期>REF(大值周  

期,距前高天YA)AND小值周期>REF(小值周期,距前低天YA),-1,0);  

低保留YXA:=IF(局部低点预选C=-1ANDREF(距前高天YA,1)>REF(距前低天YA,1)AND  

LLV(L,距前高天YA+1)<REF(LLV(L,距前高天YA+1),1),-1,0);  

低保留YXB:=IF(局部低点预选C=-1ANDREF(距前高天YA,1)<=REF(距前低天YA,1)AND  

(距前高天YA>=4ORLLV(缺口判断,距前高天YA)=-1OR判断YXA=-1),-1,0);  

低保留YX:=IF((低保留YXA=-1OR低保留YXB=-1)ANDL<REF(H,距前高天YA+1),-1,0);  

AAAD:=IF(高保留YX=1AND低保留YX=-1ANDH>REF(H,REF(距前高天  

YA,1)+2),1,IF(高保留YX=1AND低保留YX=-1ANDL<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;  

DRAWICON(极点保留=-1,L-0.03,1);  

DRAWICON(极点保留=1,H+0.03,2);

image.png

二、缠论买卖点副图指标公式

  

R1:=(CLOSE-LLV(LOW,90))/(HHV(HIGH,90)-LLV(LOW,90))*200;  

R2:=EMA((CLOSE-(LLV(LOW,5)))/((HHV(HIGH,5))-(LLV(LOW,5)))*100,4)*2;  

R3:=EMA(0.618*REF(R2,1)+0.382*R2,2);  

R4:=POW(MA(CLOSE,5),2)+MA(CLOSE,5);  

R5:=POW(MA(LOW,5),2)+MA(LOW,5);  

R6:=POW(MA(HIGH,5),2)+MA(HIGH,5);  

R7:=(R4-LLV(R5,64))/(HHV(R6,64)-LLV(R5,64))*150+65-10;  

R8:=SMA((SMA(R7,3,1)*1.5-100),3,1);  

R9:=3*(SMA(R7,3,1)*1.5-100)-2*R8;  

R10:=(HIGH+LOW+CLOSE*2)/4;  

R11:=(R10-(EMA(R10,13)))*100/(STD(R10,13));  

R12:=EMA((EMA(R11,5)),13)+200-100;  

R13:=(SMA(R1,3,1))+R2+(SMA(R7,3,1)*1.5-100)+R12;  

R14:=(SMA((SMA(R1,3,1)),3,1))+R3+R8+(EMA(R12,10));  

R15:=(3*(SMA(R1,3,1))-2*(SMA((SMA(R1,3,1)),3,1)))+(3*R12-2*(EMA(R12,10)))+  

R9+(3*R12-2*(EMA(R12,10)));  

R16:=(HIGH+LOW+CLOSE)/3;  

R17:=(R16-MA(R16,34))/(0.015*AVEDEV(R16,34));  

R18:=(HIGH+LOW+CLOSE+R16)/4;  

R19:=(R18-(EMA(R18,24)))/(STD(R18,24))*100;  

R20:=(R16-MA(R16,24))/(0.015*AVEDEV(R16,24));  

R21:=(((EMA(R19,5))+R20+R17)/3+165)/4;  

R22:=(R13+R14+R15*30)/32/5-15;  

A1:=EMA(EMA(CLOSE,13),13);  

A2:=(A1-REF(A1,1))/REF(A1,1)*6400;  

A3:=100*WINNER(CLOSE*0.95);  

AR1:=EMA(OPEN,7);  

AR2:=EMA(AR1,21);  

AR3:=CROSS(AR1,AR2);  

AR5:=EMA(SMA((CLOSE-LLV(LOW,20))/(HHV(HIGH,16)-LLV(LOW,20))*100,8,1),3);  

中买:IF(TROUGHBARS(3,18,1)=0AND  

HIGH>LOW+0.1,60,0),COLORLIMAGENTA,LINETHICK6;  

中卖:IF(PEAKBARS(2,15,1)=0,80,100),COLORRED;  

全买:(ZIG(3,35)>REF(ZIG(3,35),1)ANDREF(ZIG(3,35),1)<REF(ZIG(3,35),2))  

*90,STICK,COLORRED,LINETHICK6;  

全卖:(ZIG(3,15)<REF(ZIG(3,15),1)ANDREF(ZIG(3,15),1)>REF(ZIG(3,15),2))  

*90,STICK,COLORGREEN,LINETHICK8;  

V1:=ZIG(3,12);  

V2:IF(REF(V1,2)>REF(V1,1)ANDV1>REF(V1,1),50,0),COLORRED,LINETHICK2;  

V3:IF(REF(V1,2)<REF(V1,1)ANDV1<REF(V1,1),50,0),COLORGREEN,LINETHICK2;  

VAR1:=ZIG(3,12)<REF(ZIG(3,12),1)ANDREF(ZIG(3,12),1)>REF(ZIG(3,12),2);  

VAR2:=ZIG(3,12)>REF(ZIG(3,12),1)ANDREF(ZIG(3,12),1)<REF(ZIG(3,12),2);  

DRAWTEXT(VAR1,80,'顶'),COLORYELLOW;  

DRAWTEXT(VAR2,80,'底'),COLORMAGENTA;  

{N1(2,250,5)}{N2(2,150,10)}  

SHI:=REF(CLOSE,1);  

SHOU:SMA(MAX(CLOSE-SHI,0),N1,1)/SMA(ABS(CLOSE-SHI),N1,1)*100;  

MAZL:MA(SHOU,N2)*1.2,COLORBROWN;  

AA:95,COLORGREEN;  

BB:90,COLORCYAN;  

CC:45,COLORYELLOW;  

DD:80,COLORMAGENTA;  

EE:10,COLORRED;  

DRAWTEXT(ISLASTBAR,AA,'清仓');  

DRAWTEXT(ISLASTBAR,BB,'减仓');  

DRAWTEXT(ISLASTBAR,DD,'警觉');  

{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>T1ANDP2>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))ORZD=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(TJ5ORTJ6ORTJ7);  

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=0ANDREF(局部低点预选A,1)=1,2);  

局部低点预选C:=IF(局部低点预选B=1ANDREF(局部低点预选B,1)=0,-1,0);  

局部高点预选A:=BACKSET(HHV(H,5)>REF(HHV(H,4),1),4);  

局部高点预选B:=BACKSET(局部高点预选A=0ANDREF(局部高点预选A,1)=1,2);  

局部高点预选C:=IF(局部高点预选B=1ANDREF(局部高点预选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=-1ANDREF(距前高天,1)>REF(距前低天,1)ANDLLV(L,  

距前高天+1)<REF(LLV(L,距前高天+1),1),-1,0);  

低保留AB:=IF(局部低点预选C=-1ANDREF(距前高天,1)<=REF(距前低天,1)AND(距前高  

天>=4ORLLV(缺口判断,距前高天)=-1ORLLV(L,距前低天+2)<REF(LLV(L,距前低天  

+1),1)),-1,0);  

低保留S:=IF((低保留AA=-1OR低保留AB=-1)ANDL<REF(H,距前高天+1),-1,0);  

预判:=IF((距前低天<4ANDHHV(缺口判断,距前低天)!=1)ORREF(低保留S,距前低  

天)=0,1,0);  

判断:=IF(局部高点预选C=1ANDREF(距前低天,1)<=REF(距前高天,1)AND预判=1AND  

大值周期>REF(小值周期,距前低天+1)AND大值周期>REF(小值周期,距前低天)AND大  

值周期>REF(大值周期,距前高天),1,0);  

高保留A:=IF(局部高点预选C=1ANDREF(距前低天,1)>REF(距前高天,1)ANDHHV(H,距  

前低天+1)>REF(HHV(H,距前低天+1),1),1,0);  

高保留B:=IF(局部高点预选C=1ANDREF(距前低天,1)<=REF(距前高天,1)ANDREF(低保  

留S,距前低天)=-1AND(距前低天>=4ORHHV(缺口判断,距前低天)=1),1,0);  

高保留:=IF((高保留A=1OR高保留B=1OR判断=1)ANDH>REF(L,距前低天+1),1,0);  

预判A:=IF((距前高天<4ANDHHV(缺口判断,距前高天)!=1)ORREF(高保留,距前高  

天)=0,1,0);  

判断A:=IF(局部低点预选C=-1ANDREF(距前高天,1)<=REF(距前低天,1)AND预判A=1  

AND小值周期>REF(大值周期,距前高天+1)AND小值周期>REF(大值周期,距前高天)  

AND小值周期>REF(小值周期,距前低天),-1,0);  

低保留A:=IF(局部低点预选C=-1ANDREF(距前高天,1)>REF(距前低天,1)ANDLLV(L,距  

前高天+1)<REF(LLV(L,距前高天+1),1),-1,0);  

低保留B:=IF(局部低点预选C=-1ANDREF(距前高天,1)<=REF(距前低天,1)AND(距前高  

天>=4ORLLV(缺口判断,距前高天)=-1OR判断A=-1),-1,0);  

低保留:=IF((低保留A=-1OR低保留B=-1)ANDL<REF(H,距前高天+1),-1,0);  

距前高天A:=BARSLAST(高保留=1);  

距前低天A:=BARSLAST(低保留=-1);  

预判X:=IF((距前低天A<4ANDHHV(缺口判断,距前低天A)!=1)ORREF(低保留,距前低天  

A)=0,1,0);  

判断X:=IF(局部高点预选C=1ANDREF(距前低天A,1)<=REF(距前高天A,1)AND预判  

X=1AND大值周期>REF(小值周期,距前低天A+1)AND大值周期>REF(小值周期,距前低  

天A)AND大值周期>REF(大值周期,距前高天A),1,0);  

高保留XA:=IF(局部高点预选C=1ANDREF(距前低天A,1)>REF(距前高天A,1)AND  

HHV(H,距前低天A+1)>REF(HHV(H,距前低天A+1),1),1,0);  

高保留XB:=IF(局部高点预选C=1ANDREF(距前低天A,1)<=REF(距前高天A,1)AND  

REF(低保留,距前低天A)=-1AND(距前低天A>=4ORHHV(缺口判断,距前低天A)=1),1,0);  

高保留X:=IF((高保留XA=1OR高保留XB=1OR判断X=1)ANDH>REF(L,距前低天  

A+1),1,0);  

预判XA:=IF((距前高天A<4ANDHHV(缺口判断,距前高天A)!=1)ORREF(高保留XA,距前  

高天A)=0,1,0);  

判断XA:=IF(局部低点预选C=-1ANDREF(距前高天A,1)<=REF(距前低天A,1)AND预判  

XA=1AND小值周期>REF(大值周期,距前高天A+1)AND小值周期>REF(大值周期,距前  

高天A)AND小值周期>REF(小值周期,距前低天A),-1,0);  

低保留XA:=IF(局部低点预选C=-1ANDREF(距前高天A,1)>REF(距前低天A,1)AND  

LLV(L,距前高天A+1)<REF(LLV(L,距前高天A+1),1),-1,0);  

低保留XB:=IF(局部低点预选C=-1ANDREF(距前高天A,1)<=REF(距前低天A,1)AND(距  

前高天A>=4ORLLV(缺口判断,距前高天A)=-1OR判断XA=-1),-1,0);  

低保留X:=IF((低保留XA=-1OR低保留XB=-1)ANDL<REF(H,距前高天A+1),-1,0);  

距前高天YA:=BARSLAST(高保留X=1);  

距前低天YA:=BARSLAST(低保留X=-1);

image.png

[源码注释]通达信公式动态翻译结果

MD赋值:收盘价的20日[1日权重]移动平均

VART1赋值:(收盘价-MD)的2乘幂

VART2赋值:VART1的20日简单移动平均

VART3赋值:VART2的开方

UPPER赋值:MD+2*VART3

UB赋值:1日前的UPPER

收盘价上穿U

推荐阅读:缠论买卖点副图指标

  

ifDATATYPE<8then  

begin  

fx30:="FENXING#min30";  

fx60:="FENXING#min60";  

{fxday:="FENXING#day";}  

drawtext(barstatus=2,fx30,'—–30底分高'+fx30),colorwhite,align2;  

drawtext(barstatus=2,fx60,'—–60底分高'+fx60),colorgreen,align2;  

{drawtext(barstatus=2,fxday,'–日线底分高')+fx60,colorgreen,align2;}end;  

var1:="chzhshch@kxian";{处理K线}  

var2:="chzhshch@bi";{处理笔关系}  

drawline(var2=1,h,var2=-1,l,0),pointdot,coloryellow;  

drawline(var2=-1,l,var2=1,h,0),pointdot,coloryellow;  

var3:="chzhshch@duan";{处理段关系}  

drawtext(var3=1,h,''+h),align0,colormagenta;  

drawtext(var3=1,h,'卖'),align2,colorred;  

drawtext(var3=-1,l,''+l),colorgreen;  

drawtext(var3=-1,l,'买'),align2,colorgreen;  

drawline(var3=1,h,var3=-1,l,0),colorff6600;  

drawline(var3=-1,l,var3=1,h,0),colorff6600;  

{高一级别的段  

var4:="[email=chzhshch@duan2]chzhshch@duan2[/email]";  

drawline(var4=1,h,var4=-1,l,0),linethick2,colorred;  

drawline(var4=-1,l,var4=1,h,0),linethick2,colorred;}  

h1:=0;  

X1:=BARSLAST(h1);通达信:  

{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>T1ANDP2>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))ORZD=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(TJ5ORTJ6ORTJ7);  

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=0ANDREF(局部低点预选A,1)=1,2);局部  

低点预选C:=IF(局部低点预选B=1ANDREF(局部低点预选B,1)=0,-1,0);  

局部高点预选A:=BACKSET(HHV(H,5)>REF(HHV(H,4),1),4);  

局部高点预选B:=BACKSET(局部高点预选A=0ANDREF(局部高点预选A,1)=1,2);局部  

高点预选C:=IF(局部高点预选B=1ANDREF(局部高点预选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=-1ANDREF(距前高天,1)>REF(距前低天,1)ANDLLV(L,  

距前高天+1)<REF(LLV(L,距前高天+1),1),-1,0);  

低保留AB:=IF(局部低点预选C=-1ANDREF(距前高天,1)<=REF(距前低天,1)AND(距  

前高天>=4ORLLV(缺口判断,距前高天)=-1ORLLV(L,距前低天+2)<REF(LLV(L,距前低天  

+1),1)),-1,0);  

低保留S:=IF((低保留AA=-1OR低保留AB=-1)ANDL<REF(H,距前高天+1),-1,0);预  

判:=IF((距前低天<4ANDHHV(缺口判断,距前低天)!=1)ORREF(低保留S,距前低  

天)=0,1,0);  

判断:=IF(局部高点预选C=1ANDREF(距前低天,1)<=REF(距前高天,1)AND预判=1AND  

大值周期>REF(小值周期,距前低天+1)AND大值周期>REF(小值周期,距前低天)AND大值  

周期>REF(大值周期,距前高天),1,0);  

高保留A:=IF(局部高点预选C=1ANDREF(距前低天,1)>REF(距前高天,1)ANDHHV(H,  

距前低天+1)>REF(HHV(H,距前低天+1),1),1,0);  

高保留B:=IF(局部高点预选C=1ANDREF(距前低天,1)<=REF(距前高天,1)ANDREF(低  

保留S,距前低天)=-1AND(距前低天>=4ORHHV(缺口判断,距前低天)=1),1,0);  

高保留:=IF((高保留A=1OR高保留B=1OR判断=1)ANDH>REF(L,距前低天+1),1,0);  

预判A:=IF((距前高天<4ANDHHV(缺口判断,距前高天)!=1)ORREF(高保留,距前高  

天)=0,1,0);  

判断A:=IF(局部低点预选C=-1ANDREF(距前高天,1)<=REF(距前低天,1)AND预判A=1  

AND小值周期>REF(大值周期,距前高天+1)AND小值周期>REF(大值周期,距前高天)AND  

小值周期>REF(小值周期,距前低天),-1,0);  

低保留A:=IF(局部低点预选C=-1ANDREF(距前高天,1)>REF(距前低天,1)ANDLLV(L,  

距前高天+1)<REF(LLV(L,距前高天+1),1),-1,0);低保留B:=IF(局部低点预选C=-1AND  

REF(距前高天,1)<=REF(距前低天,1)AND(距前高天>=4ORLLV(缺口判断,距前高天)=-1  

OR判断A=-1),-1,0);  

低保留:=IF((低保留A=-1OR低保留B=-1)ANDL<REF(H,距前高天+1),-1,0);  

距前高天A:=BARSLAST(高保留=1);  

距前低天A:=BARSLAST(低保留=-1);  

预判X:=IF((距前低天A<4ANDHHV(缺口判断,距前低天A)!=1)ORREF(低保留,距前低  

天  

A)=0,1,0);  

判断X:=IF(局部高点预选C=1ANDREF(距前低天A,1)<=REF(距前高天A,1)AND预判  

X=1AND大值周期>REF(小值周期,距前低天A+1)AND大值周期>REF(小值周期,距前低天  

A)AND大值周期>REF(大值周期,距前高天A),1,0);  

高保留XA:=IF(局部高点预选C=1ANDREF(距前低天A,1)>REF(距前高天A,1)AND  

HHV(H,距前低天A+1)>REF(HHV(H,距前低天A+1),1),1,0);  

高保留XB:=IF(局部高点预选C=1ANDREF(距前低天A,1)<=REF(距前高天A,1)AND  

REF(低保留,距前低天A)=-1AND(距前低天A>=4ORHHV(缺口判断,距前低天A)=1),1,0);  

高保留X:=IF((高保留XA=1OR高保留XB=1OR判断X=1)ANDH>REF(L,距前低天  

A+1),1,0);预判XA:=IF((距前高天A<4ANDHHV(缺口判断,距前高天A)!=1)ORREF(高  

保留XA,距前高天A)=0,1,0);  

判断XA:=IF(局部低点预选C=-1ANDREF(距前高天A,1)<=REF(距前低天A,1)AND预  

判XA=1AND小值周期>REF(大值周期,距前高天A+1)AND小值周期>REF(大值周期,距前  

高天A)AND小值周期>REF(小值周期,距前低天A),-1,0);  

低保留XA:=IF(局部低点预选C=-1ANDREF(距前高天A,1)>REF(距前低天A,1)AND  

LLV(L,距前高天A+1)<REF(LLV(L,距前高天A+1),1),-1,0);  

低保留XB:=IF(局部低点预选C=-1ANDREF(距前高天A,1)<=REF(距前低天A,1)AND  

(距前高天A>=4ORLLV(缺口判断,距前高天A)=-1OR判断XA=-1),-1,0);  

低保留X:=IF((低保留XA=-1OR低保留XB=-1)ANDL<REF(H,距前高天A+1),-1,0);  

距前高天YA:=BARSLAST(高保留X=1);  

距前低天YA:=BARSLAST(低保留X=-1);  

预判YX:=IF((距前低天YA<4ANDHHV(缺口判断,距前低天YA)!=1)ORREF(低保留X,  

距前低天YA)=0,1,0);  

判断YX:=IF(局部高点预选C=1ANDREF(距前低天YA,1)<=REF(距前高天YA,1)AND预  

判YX=1AND大值周期>REF(小值周期,距前低天YA+1)AND大值周期>REF(小值周期,距前  

低天YA)AND大值周期>REF(大值周期,距前高天YA),1,0);  

高保留YXA:=IF(局部高点预选C=1ANDREF(距前低天YA,1)>REF(距前高天YA,1)AND  

HHV(H,距前低天YA+1)>REF(HHV(H,距前低天YA+1),1),1,0);  

高保留YXB:=IF(局部高点预选C=1ANDREF(距前低天YA,1)<=REF(距前高天YA,1)AND  

REF(低保留X,距前低天YA)=-1AND(距前低天YA>=4ORHHV(缺口判断,距前低天  

YA)=1),1,0);  

高保留YX:=IF((高保留YXA=1OR高保留YXB=1OR判断YX=1)ANDH>REF(L,距前低天  

YA+1),1,0);  

预判YXA:=IF((距前高天YA<4ANDHHV(缺口判断,距前高天YA)!=1)ORREF(高保留  

YXA,距前高天YA)=0,1,0);  

判断YXA:=IF(局部低点预选C=-1ANDREF(距前高天YA,1)<=REF(距前低天YA,1)AND  

预判YXA=1AND小值周期>REF(大值周期,距前高天YA+1)AND小值周期>REF(大值周期,  

距前高天YA)AND小值周期>REF(小值周期,距前低天YA),-1,0);低保留YXA:=IF(局部低  

点预选C=-1ANDREF(距前高天YA,1)>REF(距前低天YA,1)ANDLLV(L,距前高天  

YA+1)<REF(LLV(L,距前高天YA+1),1),-1,0);  

低保留YXB:=IF(局部低点预选C=-1ANDREF(距前高天YA,1)<=REF(距前低天YA,1)  

AND(距前高天YA>=4ORLLV(缺口判断,距前高天YA)=-1OR判断YXA=-1),-1,0);  

低保留YX:=IF((低保留YXA=-1OR低保留YXB=-1)ANDL<REF(H,距前高天YA+1),-  

1,0);AAAD:=IF(高保留YX=1AND低保留YX=-1ANDH>REF(H,REF(距前高天  

YA,1)+2),1,IF(高保留YX=1AND低保留YX=-1ANDL<REF(L,REF(距前低天YA,1)+2),-  

1,0));  

极点保留:=IF(AAAD=0,高保留YX+低保留YX,AAAD);  

局部极点:IF(极点保留=-1,L,IF(极点保留=1,H,DRAWNULL))CIRCLEDOTCOLORYELLOW;  

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;  

飞狐:  

var1:="color=#ff0000]chzhshch@kxian";  

var2:="chzhshch@bi";{处理笔关系}  

ifDATAPERIOD<=8then  

begin  

//var2:="[email=chzhshch@duan]chzhshch@duan[/email]";{处理段1分钟的关系}  

pre:=3;{设置小数点位数}  

ifSTKTYPE=0thenpre:=1;  

ifSTKTYPE=11thenpre:=3;  

a1:=barslast(var2<>0);  

a2:=ref(var2,a1);  

aa1:=ref(a1+1,1);  

aa2:=ref(a2,1);  

aa3:=BARSSINCE(var2<>0);  

aa4:=ref(aa3+1,1)+4;//历史总周期数  

a3:if(aa2>0,l-ref(h,aa1),h-ref(l,aa1)),linethick0;{计算点位差}  

drawnumber(var2=1,h,h,pre),pxup20,color3300ff,align1;{显示数  

字}drawnumber(var2=-1,l,l,pre),pxdn5,colorffff00,align1;  

//{显示完成笔力度}  

//drawtext(var2=1,h,'+'),pxup45,colormagenta,align2;  

drawnumber(var2=1,h,a3,pre),align1,colormagenta,pxup65;  

drawnumber(var2=-1,l,a3,pre),align1,colormagenta,pxdn50;  

//显示完成笔周期  

drawtext(var2=1,h,'卖'),pxup45,colorred,align2;  

drawtext(var2=1,h,'T:'),pxup45,coloryellow,align2,shift3;  

drawnumber(var2=1,h,aa1,0),colormagenta,pxup45,align1,shift3;  

//drawnumber(var2=1,h,aa4,0),coloryellow,pxup45,align1,shift6;  

drawtext(var2=-1,l,'买'),pxdn30,colorgreen,align2;  

drawtext(var2=-1,l,'T:'),pxdn30,coloryellow,align2,shift3;  

drawnumber(var2=-1,l,aa1,0),colormagenta,pxdn30,align1,shift3;  

//drawnumber(var2=-1,l,aa4,0),coloryellow,pxdn30,align1,shift6;  

//显示未完成笔的点位力度  

ll:=l-ref(h,barslast(var2<>0));  

hh:=h-ref(l,barslast(var2<>0));  

a3:=-a3;  

//显示未完成笔的收盘数据  

drawtext(islastbarandref(var2,barslast(var2<>0))=-1and  

var2=0,h,numtostr(h,3)),pxup20,color3300ff,align1,shift6;{显示数字}  

drawtext(islastbarandref(var2,barslast(var2<>0))=1and  

var2=0,l,numtostr(l,3)),pxdn5,colorffff00,align1,shift6;  

//写在未完成笔低点处的笔的点位力度  

drawtext(islastbarandref(var2,barslast(var2<>0))=1and  

var2=0,L,numtostr(ll,3)),colorgreen,shift6,pxdn30,align1;  

//写在未完成笔高点处的笔的点位力度//  

drawtext(islastbarandref(var2,barslast(var2<>0))=-1andvar2=0,h,'+'+  

numtostr(hh,3)),align1,colormagenta,pxup45,shift6;  

//显示未完成笔的周期,写在低点的  

drawtext(islastbarandref(var2,barslast(var2<>0))=1andvar2=0,L,'T:'+  

numtostr(aa1,0)),pxdn50,coloryellow,align1,shift6;  

//显示未完成笔的周期,写在高点的  

drawtext(islastbarandref(var2,barslast(var2<>0))=-1andvar2=0,h,'T:'+  

numtostr(aa1,0)),pxup65,coloryellow,align1,shift6;  

end;  

var1:="[email=chzhshch@kxian]chzhshch@kxian[/email]";{处理K线}  

var2:="[email=chzhshch@bi]chzhshch@bi[/email]";{处理笔关系}  

drawline(var2=1,h,var2=-1,l,0),linedot,coloryellow;  

drawline(var2=-1,l,var2=1,h,0),linedot,coloryellow;  

var3:="[email=chzhshch@duan]chzhshch@duan[/email]";{处理段关系,处理前调整笔  

的高低点,处理后不调整}  

drawnumber(var3=1,h,h,2),pxup20,colormagenta,align2;//drawtext(var3=1,h,'卖  

'),pxup20,colormagenta,align2;  

drawnumber(var3=-1,l,l,2),pxdn5,colorgreen;  

drawline(var3=1,h,var3=-1,l,0),colorFF6600;  

drawline(var3=-1,l,var3=1,h,0),colorFF6600;  

var31:=hhvbars(zig(3,19)>ref(zig(3,19),1)  

andref(zig(3,19),1)<ref(zig(3,19),2),0);  

stickline(var31=2,l*0.95,l*0.98,8,0),color0000ff;drawtext(var31=2,l*0.95,'3  

天'),coloryellow;  

stickline(var31=4,h*1.05,h*1.02,8,0),color9966ff;drawtext(var31=4,h*1.06,'5  

天'),coloryellow;  

stickline(var31=7,l*0.95,l*0.98,8,0),color00ffff;drawtext(var31=7,l*0.95,'8  

天'),coloryellow;  

stickline(var31=12,h*1.05,h*1.02,8,0),colorff33ff;  

drawtext(var31=12,h*1.06,'13天'),coloryellow;  

stickline(var31=20,l*0.95,l*0.98,8,0),color0066ff;  

drawtext(var31=20,l*0.95,'21天'),coloryellow;  

stickline(var31=33,h*1.05,h*1.02,8,0),colorffff00;  

drawtext(var31=33,h*1.06,'34天'),coloryellow;  

stickline(var31=54,l*0.95,l*0.98,8,0),color006600;  

drawtext(var31=54,l*0.95,'55天'),coloryellow;  

stickline(var31=88,h*1.05,h*1.02,8,0),color00ff00;  

drawtext(var31=88,h*1.06,'89天'),coloryellow;  

stickline(var31=143,l*0.95,l*0.98,8,0),colorccffff;  

drawtext(var31=143,l*0.95,'144天'),coloryellow;  

stickline(var31=232,h*1.05,h*1.02,8,0),colorff0033;  

drawtext(var31=232,h*1.06,'233天'),coloryellow;  

stickline(var31=376,l*0.95,l*0.98,8,0),colorff9966;  

STICKLINE(CURRBARSCOUNT=1,105,0,5,0),COLOR0000FF;  

F1:=ZIG(3,12);  

价差12:=IF((F1>REF(F1,1)),-5,105);  

STICKLINE(  

F2:=ZIG(3,6);  

价差6:=IF((F2>REF(F2,1)),-5,105);  

STICKLINE(价差6>-80,价差  

6,0,4,0),COLOR993300,LINETHICK1;  

VAR11:=(HHV(INDEXH,27)-INDEXC)/(HHV(INDEXH,27)-  

LLV(INDEXL,27))*100;  

大盘线:SMA(VAR11,3,1)*(-1)+100,COLORRED,LINETHICK1;  

VAR1F:=((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-  

LLV(LOW,27)))*(100);  

VAR21:=SMA(VAR1F,3,1);  

趋势:=SMA(VAR21,3,1);  

人气:=SMA(趋势,3,1);  

顶天立地:=CROSS(趋势,人气)AND(趋势<30);  

DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);  

DEA:=EMA(DIFF,9);  

A:=IF(CROSS(0,DEA),1,0);  

A1:=IF(DIFF<0ANDCROSS(DIFF,DEA),1,0);  

SS:=IF(A,SUM(A1,0),0);  

SSB:=HHV(SS,0);  

SSS:=SUM(A1,0);  

笑傲江湖:=SSS-SSB=2ANDSSS>REF(SSS,1),COLORWHITE;  

VAR51:=EMA(CLOSE,8);  

VAR52:=EMA(VAR51,20);  

价差12>-80,价差  

12,0,4,0),COLOR662290,LINETHICK1;  

VAR53:=CROSS(VAR51,VAR52);  

VAR54:=VAR51<EMA(CLOSE,120);  

黑马起步:=VAR53ANDVAR54;  

VAR41:=REF((LOW+OPEN+CLOSE+HIGH)/4,1);  

VAR42:=SMA(ABS(LOW-VAR41),13,1)/SMA(MAX(LOW￾VAR41,0),10,1);  

VAR43:=EMA(VAR42,10);  

VAR44:=LLV(LOW,33);  

VAR45:=EMA(IF(LOW<=VAR44,VAR43,0),3);  

主力进场:=VAR45>REF(VAR45,1),NODRAW;  

MA5:=MA(CLOSE,5);  

MA10:=MA(CLOSE,10);  

MA13:=MA(C,13);  

MA20:=MA(CLOSE,20);  

MA40:=MA(CLOSE,40);  

MA60:=MA(CLOSE,60);  

NA1:=MIN(MA(C,5),MA(C,10))>MA(C,60)  

CROSS(MA(C,5),MA(C,10));  

NA2:=MIN(MA(C,5),MA(C,10))/MA(C,60)<1.05;  

NA3:=COUNT(V<MA(V,10),10)>6;  

青龙取水:=NA1ANDNA2ANDNA3;  

VAR32:=(CLOSE-LLV(LOW,20))/(HHV(HIGH,20)-  

LLV(LOW,20))*100;  

VAR33:=SMA(SMA(VAR32,3,1),3,1)/28.57;  

VAR34:=EMA(VAR33,5);  

VAR35:=3*VAR33-2*VAR34;  

绝买:=CROSS(VAR35,VAR33)ANDVAR33<2.1ANDC>O;  

SS1:=(LOW+HIGH+CLOSE*2)/4;  

SS2:=MA(SS1,4);  

SS3:=HHV(SS2,10);  

AND  

SS4:=MA(SS3,3);  

SS5:=1.25*SS4-0.25*SS3;  

XKKJ:=IF(SS5>SS3,SS3,SS5);  

FF1:=LLV(SS2,10);  

FF2:=MA(FF1,3);  

FF3:=1.25*FF2-0.25*FF1;  

DKKJ:=IF(FF3<FF1,FF1,FF3);  

ZDHM:=CROSS(C,DKKJ)  

CROSS(C,XKKJ);  

ZHM:=CROSS(C,MA13)ANDCROSS(C,XKKJ);  

的卢:=ZDHMORZHM;  

A11:=OPEN<MA20OROPEN<MA40OROPEN<MA60;  

A12:=C>MAX(MA20,MAX(MA40,MA60));  

A13:=V/MA(V,30)>1.2;  

A14:=C/REF(C,1)>1.049;  

芙蓉:=A11ANDA12ANDA13ANDA14;  

J:=(C*2+H+L)/4;  

K:=(EMA(J,13)-EMA(J,21))*180;  

D:=EMA(K,2);  

KK:=(K-D);  

DD:=-1*(K-D);  

SSA:=CROSS(KK,DD);  

VARBB:=EMA(EMA(CLOSE,5),5);  

LL:=(VARBB-REF(VARBB,1))/REF(VARBB,1)*1000;  

MM:=CROSS(LL,0);  

黄买蓝出:=SSAANDMM;  

VAR1G:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-  

LLV(LOW,9))*100;  

KG:=SMA(VAR1G,3,1);  

DG:=SMA(KG,3,1);  

ANDCROSS(C,MA13)AND  

低位金叉:=DG<20ANDCROSS(KG,DG);  

起死回生:=BARSLAST(低位金叉)<=9ANDBARSLAST(低位金  

叉)>2ANDCROSS(DG,KG)ANDDG<30;  

V1:=(HIGH+OPEN+LOW+(2)*(CLOSE))/(5);  

V2:=REF(V1,1);  

V3:=MAX(V1-V2,0);  

V4:=ABS(V1-V2);  

V5:=SMA(V3,10,1);  

V6:=SMA(V4,10,1);  

V8:=COUNT(((V5)/(V6)<0.2),5);  

V9:=COUNT((LLV(V1,10)=V1),10);  

底部构成:=IF((V8>=1)AND(V9>=1)AND  

AND(CLOSE>OPEN)  

腰线:=(MA(CLOSE,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24  

))/4;  

KKD:=EMA(CLOSE-LOW,5);  

顶线:=MA((CLOSE+REF(CLOSE,1)+REF(CLOSE,1))/3+KKD,5);  

底线:=MA(REF(CLOSE,1)-KKD,5);  

MA2:=MA(CLOSE,2);  

EE:=(CROSS(MA2,MA10)ANDCROSS(MA2,MA20),1);  

超级战神:=腰线>OPENANDOPEN>底线ANDCLOSE>顶线  

ANDCLOSE>MA20ANDCLOSE>腰线ANDEE;  

MA30:=MA(C,30);  

MA120:=SMA(C,120,1);  

ZH520:=ABS(MA5-MA20)/MA20*100<=10;  

ZH530:=ABS(MA5-MA30)/MA30*100<=10;  

QSXS1:=MA5>REF(MA5,1);  

QSXS2:=MA20>REF(MA20,1);  

AND(REF(CLOSE,1)>REF(OPEN,1))  

(VOL>REF(VOL,1)),1,0),COLOR00FFFF;  

QSXS3:=MA30>REF(MA30,1);  

DTPL:=MA20>MA30ANDMA30>MA120;  

LYT:=DTPLANDQSXS2ANDQSXS3AND  

COUNT(QSXS1,4)<=1;  

GJHS:=C>MA5AND((QSXS1ANDNOT(REF(QSXS1,1)))OR  

C>REF(C,3));  

LYKK:=GJHSAND(ZH520ORZH530)ANDLYT;  

买:=LYKKANDNOT(REF(LYKK,1));  

老鸭头优选:=买ANDCOUNT((MA10>MA20),5)=5;  

AA4:=(CLOSE-LLV(LOW,21))/(HHV(HIGH,21)-  

LLV(LOW,21))*100;  

AA5:=SMA(AA4,13,8);  

趋势1:=(5)*(SMA(((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-  

LLV(LOW,27)))*(100),5,1))-(3)*(SMA(SMA(((CLOSE￾LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27)))*(100),5,1),3,1))-  

SMA(SMA(SMA(((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-  

LLV(LOW,27)))*(100),5,1),3,1),2,1);  

底部:=5;  

AA3:=WINNER(CLOSE+CLOSE*15/100)*100;  

BB3:=WINNER(CLOSE+CLOSE*0/100)*100;  

CC3:=AA3-BB3;  

DD3:=(WINNER(CLOSE-CLOSE*0.1/100)-WINNER(CLOSE￾CLOSE*15/100))*100;  

EE3:=CC3<3ANDDD3<0.5ANDOPEN<LOW;  

A21:=DYNAINFO(6);  

A22:=IF(LOW>A21,0,IF(HIGH<A21,1,(A21-  

LOW+0.01)/(HIGH-LOW+0.01)));  

A23:=VOL/WINNER(LOW);  

A24:=REF(HHV(CLOSE,120),1);  

A25:=REF(LLV(CLOSE,120),1);  

A26:=100*(CLOSE-A25)/(A24-A25);  

A27:=A22>0ORA22=1;  

A28:=A27ANDA23/REF(A23,3)>=3ANDA26<80;  

A29:=REF(A28,1)ORREF(A28,2)ORREF(A28,3)OR  

REF(A28,4);  

A30:=A28ANDA29;  

A31:=IF(FILTER(A28,3),5,0);  

A32:=IF(FILTER(A30,3)OREE3,10,0);  

N:=13;  

N1:=6;  

N2:=14;  

RSV:=(CLOSE-LLV(LOW,N))/(HHV(HIGH,N)-LLV(LOW,N))*100;  

MA75:=MA(CLOSE,75);  

LC:=REF(C,1);  

K9:=SMA((C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100,3,1);  

D9:=SMA(K9,3,1);  

J9:=3*K9-2*D9;  

JJ:=J9*0.1;  

TYP:=(HIGH+LOW+CLOSE)/3;  

CC1:=(TYP￾MA(TYP,N2))/(0.015*AVEDEV(TYP,N2)),COLORFF00FF;  

C11:=SMA(CC1,3,1);  

C12:=SMA(C11,3,1);  

C13:=3*C11-2*C12;  

CB1:=EMA(C13,5);  

RSI1:=SMA(MAX(CLOSE-LC,0),N1,1)/SMA(ABS(CLOSE￾LC),N1,1)*100;  

RSI:=(RSI1-50)*5,LINETHICK2,COLORFFFFFF;  

R1:=SMA(RSI,3,1);  

D11:=SMA(R1,3,1);  

J1:=3*R1-2*D11;  

RR1:=EMA(J1,5);  

RR2:=REF(RR1,1);  

RR:=RR1>RR2;  

KR:=SMA(RSV,3,1);  

K1:=(KR-50)*5,COLOR00FF00;  

K2:=SMA(K1,3,1);  

D12:=SMA(K2,3,1);  

J2:=3*K2-2*D12;  

BB1:=EMA(J2,5);  

买入:=RRANDNOT(REF(RR,1))AND(RR1<-100ANDBB1<-  

100)ANDCB1<-100,LINETHICK0;  

VAR2:=INDEXADV;  

VAR3:=INDEXDEC;  

VAR4:=VAR2/(VAR2+VAR3);  

VAR5:=VAR3/(VAR2+VAR3);  

VAR6:=EMA(VAR4,3);  

VAR7:=EMA(VAR5,3);  

VAR8:=EMA(VAR6,5);  

VAR9:=EMA(VAR7,5);  

进场资金:=EMA(VAR8,10)/150,CIRCLEDOT,COLORRED;  

资金:=EMA(VAR9,10)/150,CIRCLEDOT,COLORGREEN;  

大盘神针  

AND  

AND  

AND  

:=(SMA(MAX(CLOSE￾SMA(MAX(CLOSE￾MA((LLV(LOW,45)-  

(CLOSE￾AND  

REF(CLOSE,1),0),7,1)/SMA(ABS(CLOSE￾REF(CLOSE,3)),7,1)*100<20  

REF(CLOSE,3)),13,1)*100<25  

(LOW>LLV(LOW,5)  

REF(CLOSE,3),0),13,1)/SMA(ABS(CLOSE￾CLOSE)/(HHV(HIGH,45)-LLV(LOW,45))*100,5)>-19AND  

HHV(CLOSE,8))/HHV(CLOSE,8)<-0.05  

MA(AMOUNT,125)/MA(VOL,125)/(MA(AMOUNT,5)/MA(VOL,5))  

>1.12))*0.75;  

西买:=BARSLAST(大盘神针)<15  

ANDCROSS(MACD.DIF,MACD.DEA);  

底:=BARSLAST(LLV(L,4)=LLV(L,120))<5;  

均线买:=CROSS(MA(C,5),MA(C,20));  

介入:=(底AND均线买AND(进场资金>资金)OR西买);  

AC:=MA(-100*(HHV(HIGH,34)-CLOSE)/(HHV(HIGH,34)-  

LLV(LOW,34)),19)+100;  

BC:=-100*(HHV(HIGH,14)-CLOSE)/(HHV(HIGH,14)-  

LLV(LOW,14))+100;  

DC:=EMA(-100*(HHV(HIGH,34)-CLOSE)/(HHV(HIGH,34)-  

LLV(LOW,34)),4)+100;  

大底:=(AC<15ANDREF(AC,1)<15ANDDC<18AND  

BC>REF(BC,1)  

(REF(BC,1)<5  

REF(BC,1)<1));  

VAR17:=REF(CLOSE,1);  

VAR18:=SMA(MAX(CLOSE-VAR17,0),7,1)/SMA(ABS(CLOSE￾VAR17),7,1)*100;  

VAR19:=SMA(MAX(CLOSE-VAR17,0),13,1)/SMA(ABS(CLOSE￾VAR17),13,1)*100;  

VAR1A:=BARSLAST(VAR19<33)<=3  

CROSS(VAR18,VAR19);  

VAR1B:=(CLOSE-MA(CLOSE,33))/MA(CLOSE,20)*100<-12.5;  

VAR1C:=LLV(LOW,5);  

VAR1D:=HHV(HIGH,10);  

VAR1E:=EMA((CLOSE-VAR1C)/(VAR1D-VAR1C)*100,4);  

VAR1FW:=EMA(0.667*REF(VAR1E,1)+0.333*VAR1E,2);  

难得一遇:=0-(-1)*VAR1AANDVAR1BAND  

AND  

AND  

OR  

CROSS(BC,AC)  

REF(BC,2)<5  

ANDBC>DC  

(DC>=AC  

AND  

OR)AND  

CROSS(VAR1E,VAR1FW)ANDVAR1E<=25;  

VAR22:=REF(CLOSE,1);  

VAR23:=SMA(MAX(CLOSE-VAR22,0),7,1)/SMA(ABS(CLOSE￾VAR22),7,1)*100;  

VAR24:=SMA(MAX(CLOSE-VAR22,0),13,1)/SMA(ABS(CLOSE￾VAR22),13,1)*100;  

VAR25:=BARSLAST(VAR24<23)<=3  

CROSS(VAR23,VAR24);  

VAR26:=(CLOSE-MA(CLOSE,23))/MA(CLOSE,20)*100<-12.5;  

VAR27:=LLV(LOW,5);  

VAR28:=HHV(HIGH,10);  

VAR29:=EMA((CLOSE-VAR27)/(VAR28-VAR27)*100,4);  

VAR2A:=EMA(0.667*REF(VAR29,1)+0.333*VAR29,2);  

千载难逢:=0-(-1)*VAR25ANDVAR26AND  

CROSS(VAR29,VAR2A)ANDVAR29<=25;  

大盘6日:=(INDEXC-MA(INDEXC,6))/MA(INDEXC,6)*100;  

大盘12日:=(INDEXC-MA(INDEXC,12))/MA(INDEXC,12)*100;  

大盘24日:=(INDEXC-MA(INDEXC,24))/MA(INDEXC,24)*100;  

大盘60日:=(INDEXC-MA(INDEXC,60))/MA(INDEXC,60)*100;  

大盘:=(大盘6日+大盘12日+大盘24日)/3;  

大盘2:=(大盘6日+大盘12日+大盘24日+大盘60日)/4;  

个股6日:=(C-MA(C,6))/MA(C,6)*100;  

个股12日:=(C-MA(C,12))/MA(C,12)*100;  

个股24日:=(C-MA(C,24))/MA(C,24)*100;  

个股60日:=(C-MA(C,60))/MA(C,60)*100;  

个股:=(个股6日+个股12日+个股24日)/3;  

个股2:=(个股6日+个股12日+个股24日+个股60日)/4;  

强势出击:=(大盘>REF(大盘,1)ANDCROSS(个股,大盘))OR(大盘  

2>REF(大盘2,1)ANDCROSS(个股2,大盘2));  

STICKLINE(A31,50,0,1,0),COLORFF7700;  

AND  

STICKLINE(A32,30,0,1,0),COLORFF00FF;  

STICKLINE(主力进场,0,-5,4,0),COLORRED;  

走势:CEILING(SMA(AA5,13,8));  

DRAWTEXT(老鸭头优选,100,'优'),COLORYELLOW;  

DRAWTEXT(顶天立地,100,'顶'),COLORYELLOW;  

DRAWTEXT(黄买蓝出,90,'黄买'),COLORYELLOW;  

DRAWTEXT(超级战神,80,'战神'),COLORYELLOW;  

DRAWTEXT(的卢,70,'的卢'),COLORYELLOW;  

DRAWTEXT(笑傲江湖,60,'笑'),COLORYELLOW;  

DRAWTEXT(绝买,50,'绝买'),COLORYELLOW;  

DRAWTEXT(芙蓉,40,'芙蓉'),COLORYELLOW;  

DRAWTEXT(青龙取水,30,'龙'),COLORYELLOW;  

DRAWTEXT(黑马起步,30,'马'),COLORYELLOW;  

DRAWTEXT(难得一遇>0AND千载难逢>0,20,'难逢  

'),COLORYELLOW;  

DRAWTEXT(大盘神针,20,'神针'),COLORFFFF00;  

DRAWTEXT(买入ANDJJ<8ANDREF(CCI,1)<-120ANDC>O  

ANDCONST(IF(C>=MA75,1,0)),20,'东买'),COLORWHITE;  

DRAWTEXT(大底,20,'大底')COLORYELLOW;  

DRAWTEXT(介入,10,'长买'),COLORWHITE;  

DRAWTEXT(买入,10,'短买'),COLORWHITE;  

DRAWTEXT(底部构成,3,'底'),COLORYELLOW;  

DRAWTEXT(低位金叉,3,'低'),COLORYELLOW;  

DRAWTEXT(起死回生,-3,'起'),COLORYELLOW;  

DRAWTEXT((CROSS(趋势1,底部)),-3,'▲'),COLORYELLOW;  

DRAWTEXT(强势出击,40,'强势'),COLORFFFFFF;  

DRAWTEXT(CROSS(0.9,1/VOL*1000>0.01  

"KDJ.J"<0),30,'地量'),COLOR33FFFF;  

STICKLINE(CURRBARSCOUNT=55,105,-  

5,62,0),COLOR333344;  

AND  

STICKLINE(CURRBARSCOUNT=55,105,95,62,0),COLORYELLO  

W;  

DRAWTEXT(CURRBARSCOUNT=59,100,'☆东家专用精选买点36个☆'),COLORRED;  

DRAWTEXT(CURRBARSCOUNT=59,90,'东买=东家买绝买  

的卢神针'),COLORGREEN;  

DRAWTEXT(CURRBARSCOUNT=59,80,'芙蓉=出水芙蓉马=黑马起步'),COLORGREEN;  

DRAWTEXT(CURRBARSCOUNT=59,70,'战神=超级战神龙=青龙取水'),COLORGREEN;  

DRAWTEXT(CURRBARSCOUNT=59,60,'优=老鸭头优选笑=笑傲江湖'),COLORGREEN;  

DRAWTEXT(CURRBARSCOUNT=59,50,'黄买=黄买蓝出低=低位金叉'),COLORGREEN;  

DRAWTEXT(CURRBARSCOUNT=59,40,'长买=长线稳买顶=顶天立地'),COLORGREEN;  

DRAWTEXT(CURRBARSCOUNT=59,30,'短买=金兰三宝起=起死回生'),COLORGREEN;  

DRAWTEXT(CURRBARSCOUNT=59,20,'红底=主力吸筹底=底部构成'),COLORGREEN;  

DRAWTEXT(CURRBARSCOUNT=59,10,'蓝柱=主力进攻红柱  

=主力加仓'),COLORGREEN;  

DRAWTEXT(CURRBARSCOUNT=59,0,'▲底部大底枯木逢春千  

载难逢'),COLORGREEN;  

DRAWTEXT(ISLASTBAR  

'),COLORYELLOW;  

DRAWTEXT(ISLASTBAR  

'),COLORYELLOW;  

DRAWTEXT(ISLASTBARAND(F1>REF(F1,1)),-3,'上升趋势  

'),COLORYELLOW;  

ANDA32,30,'主力加仓  

ANDA31,80,'主力进攻  

DRAWTEXT(ISLASTBARAND(F1<=REF(F1,1)),-3,'下跌趋势  

'),COLORYELLOW;  

drawtext(var31=376,l*0.95,'377天'),coloryellow;

image.png

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。