当前位置: 网站首页 > 股票软件公式 > 通达信公式 > 文章 当前位置: 通达信公式 > 文章

通达信源码:独步天下主图和主力白骨副图,黑马趋势主升浪绝技,快进快出

点击: 次    来源:顶尖财经    作者:股市狙击 - 小 + 大

1、独步天下主图和主力白骨副图

这个公式是我自用主副图,经过复合后,形成自己的重要的操盘指标
 
 
{主力白骨幅图}
{主力倍量吃货,副图}
N:=8;
M:=13;
P:=60;
S:=3;
V1:=(C*2+H+L)/4*10;
V2:=EMA(V1,13)-EMA(V1,34);
V3:=EMA(V2,5);
V4:2*(V2-V3)*5.5;
超大主力吃: IF(V4>=0,V4,0),COLOR7F00FF,LINETHICK2;
超大主力吐: IF(V4<=0,V4,0),COLOR66FF00,LINETHICK1;
V5:=(HHV(INDEXH,8)-INDEXC)/(HHV(INDEXH,8)-LLV(INDEXL,8))*8;
V6:=EMA(3*V5-2*SMA(V5,18,1),5);
V7:=(INDEXC-LLV(INDEXL,8))/(HHV(INDEXH,8)-LLV(INDEXL,8))*10;
V8:=(INDEXC*2+INDEXH+INDEXL)/4;
V9:=EMA(V8,13)-EMA(V8,34);
VA:=EMA(V9,3);
VB:=(V9-VA)/2;
主力吃货线:8,COLORFF80FF,LINETHICK2,CROSSDOT;
DH:=REF(HHV(H,10),2);
DC:=REF(HHV(MAX(C,O),10),2);
XGDH:CROSS(C,DH) AND CROSS(超大主力吃,8);
XGDC:CROSS(C,DC) AND CROSS(超大主力吃,8);
STICKLINE(XGDH OR XGDC,0,8,2,0),COLOR3131FF;
倍量吃货:(XGDH OR XGDC) AND V/REF(V,1)>1.95,COLORYELLOW;
STICKLINE(倍量吃货,0,-8,5,0),COLORYELLOW;
{庄家出现}
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:=SMA(RSV,3,1);
D:=SMA(K,3,1);
J:=3*K-2*D;
J1:=REVERSE(J);
AA:=REF(MA(C,1),10)>REF(MA(C,60),10);
买点:CROSS(J,J1) AND AA;
STICKLINE(买点,0,30,6,0),COLORBLUE;
STICKLINE(买点,30,60,4,0),COLORWHITE;
STICKLINE(买点,60,80,2,0),COLORYELLOW;
DRAWTEXT(买点,70,'庄家出现'),COLORRED;
{主力进出场}
 
VAR1:=REF((LOW+OPEN+CLOSE+HIGH)/4,1);
VAR2:=SMA(ABS(LOW-VAR1),13,1)/SMA(MAX(LOW-VAR1,0),10,1);
VAR3:=EMA(VAR2,10);
VAR4:=LLV(LOW,33);
VAR5:=EMA(IF(LOW<=VAR4,VAR3,0),3);
主力进场:IF(VAR5>REF(VAR5,1),VAR5,0),COLORRED,NODRAW;
STICKLINE(VAR5>REF(VAR5,1),0,VAR5,3,0 ),COLORRED;
STICKLINE(VAR5>REF(VAR5,1),0,VAR5,3,0 ),COLOR000055;
STICKLINE(VAR5>REF(VAR5,1),0,VAR5,2.6,0 ),COLOR000077;
STICKLINE(VAR5>REF(VAR5,1),0,VAR5,2.1,0 ),COLOR000099;
STICKLINE(VAR5>REF(VAR5,1),0,VAR5,1.5,0 ),COLOR0000BB;
STICKLINE(VAR5>REF(VAR5,1),0,VAR5,0.9,0 ),COLOR0000DD;
STICKLINE(VAR5>REF(VAR5,1),0,VAR5,0.3,0 ),COLOR0000FF;
洗盘:IF(VAR5<REF(VAR5,1),VAR5,0),COLORGREEN,NODRAW;
STICKLINE(VAR5<REF(VAR5,1),0,VAR5,3,0),COLORGREEN;
STICKLINE(VAR5<REF(VAR5,1),0,VAR5,3,0),COLOR005500;
STICKLINE(VAR5<REF(VAR5,1),0,VAR5,2.6,0),COLOR007700;
STICKLINE(VAR5<REF(VAR5,1),0,VAR5,2.1,0),COLOR009900;
STICKLINE(VAR5<REF(VAR5,1),0,VAR5,1.5,0),COLOR00BB00;
STICKLINE(VAR5<REF(VAR5,1),0,VAR5,0.9,0),COLOR00DD00;
STICKLINE(VAR5<REF(VAR5,1),0,VAR5,0.3,0),COLOR00FF00;
VAR12:=SMA(ABS(VAR1-H),13,1)/SMA(MAX(VAR1-H,0),10,1);
VAR13:=EMA(VAR12,10);
VAR14:=HHV(H,33);
VAR15:=EMA(IF(H>=VAR14,VAR13,0),3);
冲顶:IF(VAR15>REF(VAR15,1),VAR15,0),COLORFF00FF,NODRAW;
STICKLINE(VAR15>REF(VAR15,1),0,VAR15,3,0),COLORFF00FF;
STICKLINE(VAR15>REF(VAR15,1),0,VAR15,3,0 ),COLOR550055;
STICKLINE(VAR15>REF(VAR15,1),0,VAR15,2.6,0 ),COLOR770077;
STICKLINE(VAR15>REF(VAR15,1),0,VAR15,2.1,0 ),COLOR990099;
STICKLINE(VAR15>REF(VAR15,1),0,VAR15,1.5,0 ),COLORBB00BB;
STICKLINE(VAR15>REF(VAR15,1),0,VAR15,0.9,0 ),COLORDD00DD;
STICKLINE(VAR15>REF(VAR15,1),0,VAR15,0.3,0 ),COLORFF00FF;
主力出场:IF(VAR15<REF(VAR15,1),VAR15,0),COLORYELLOW,NODRAW;
STICKLINE(VAR15<REF(VAR15,1),0,VAR15,3,0 ),COLORYELLOW;
STICKLINE(VAR15<REF(VAR15,1),0,VAR15,3,0),COLOR005555;
STICKLINE(VAR15<REF(VAR15,1),0,VAR15,2.6,0),COLOR007777;
STICKLINE(VAR15<REF(VAR5,1),0,VAR15,2.1,0),COLOR009999;
STICKLINE(VAR15<REF(VAR15,1),0,VAR15,1.5,0),COLOR00BBBB;
STICKLINE(VAR15<REF(VAR15,1),0,VAR15,0.9,0),COLOR00DDDD;
STICKLINE(VAR15<REF(VAR15,1),0,VAR15,0.3,0),COLOR00FFFF;
A1:=REF(CLOSE,2);
A2:=SMA(MAX(CLOSE-A1,0),7,1)/SMA(ABS(CLOSE-A1),7,1)*100;
波段介入点:IF(A2<19,19,0)COLORWHITE;
VAR21:=SMA(ABS(HIGH-VAR1),13,1)/SMA(MIN(HIGH-VAR1,0),10,1);
VAR31:=EMA(VAR21,10);
VAR41:=HHV(HIGH,33);
VAR51:=EMA(IF(HIGH>=VAR41,VAR31,0),3);
出货:IF(VAR51>REF(VAR51,1),VAR51,0),NODRAW;
STICKLINE(VAR51>REF(VAR51,1),0,VAR51,3,0 ),COLORBLUE;
主力拉高:IF(VAR51<REF(VAR51,1),VAR51,0),NODRAW;
STICKLINE(VAR51<REF(VAR51,1),0,VAR51,5,0),COLORYELLOW;
SS:=MA(C,60)>REF(MA(C,60),1);
A:=(3*CLOSE+LOW+OPEN+HIGH)/6;
D1:=(20*A+19*REF(A,1)+18*REF(A,2)+17*REF(A,3)+16*REF(A,4)+15*REF(A,5)+14*REF(A,6)
+13*REF(A,7)+12*REF(A,8)+11*REF(A,9)+10*REF(A,10)+9*REF(A,11)+8*REF(A,12)
+7*REF(A,13)+6*REF(A,14)+5*REF(A,15)+4*REF(A,16)+3*REF(A,17)+2*REF(A,18)+
REF(A,20))/211;
D2:=EMA(D1,2);
D3:=EMA(D2,2);
K1:=EMA(D3,2);
哥要起涨:IF(CROSS(D1,K1),30,0),COLORFFCC66;
{主力潜伏}
N1:=8;
MTM:=C-REF(C,1);
ZLGJ:100*EMA(EMA(MTM,N1),N1)/EMA(EMA(ABS(MTM),N1),N1),COLORYELLOW;{N1=9}
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD:=2*(DIFF-DEA);
主力潜伏:COUNT(MACD<0,10)=10,COLORCYAN;
STICKLINE(主力潜伏,0,MACD*(-0.1),2.8,0),LINETHICK6,,COLORCYAN;
DRAWICON(主力潜伏,MACD*(-0.18),28);
DRAWICON(主力潜伏,MACD*(-0.1),26);
 
 
 
{独步天下主图}
 
N:=(1,100,8);
 KK:=(0,2,0);
 TYP := (HIGH + LOW + CLOSE)/3;
 CCI1:=(TYP-MA(TYP,6))/(0.015*AVEDEV(TYP,6));
 CCI2:=(TYP-MA(TYP,10))/(0.015*AVEDEV(TYP,10));
 CCI3:=(TYP-MA(TYP,20))/(0.015*AVEDEV(TYP,20));
 CCI4:=(TYP-MA(TYP,30))/(0.015*AVEDEV(TYP,30));
 CCI5:=(TYP-MA(TYP,60))/(0.015*AVEDEV(TYP,60));
 CCI:=CCI1+CCI2+CCI3+CCI4+CCI5;
 AAAB:=(3*C+H+L+O)/6;
 VVAR1:=(8*AAAB+7*REF(AAAB,1)+6*REF(AAAB,2)+5*REF(AAAB,3)+4*REF(AAAB,4)+3*REF(AAAB,5)+2*REF(AAAB,6)+REF(AAAB,8))/36;
 VVAR6:=(LLV(VVAR1,2)+LLV(VVAR1,4)+LLV(VVAR1,6))/3;
 VAR7:=0;
VAR8:=SMA(MAX(CLOSE-REF(CLOSE,1),0),34,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),7,1)*100;
VAR9:=SMA(MAX(CLOSE-REF(CLOSE,1),0),13,1)/SMA(ABS(CLOSE-REF(CLOSE,1)),13,1)*100;
VAR10:=IF(TROUGHBARS(3,16,1)=0 AND HIGH>LOW+0.04,4,0);
VAR11:=ZIG(3,6)>REF(ZIG(3,6),1) AND REF(ZIG(3,6),1)<=REF(ZIG(3,6),2) AND REF(ZIG(3,6),2)<=REF(ZIG(3,6),3);
VAR12:=ZIG(3,6)<REF(ZIG(3,6),1) AND REF(ZIG(3,6),1)>=REF(ZIG(3,6),2) AND REF(ZIG(3,6),2)>=REF(ZIG(3,6),3);
VAR13:=ZIG(3,22)>REF(ZIG(3,22),1) AND REF(ZIG(3,22),1)<=REF(ZIG(3,22),2) AND REF(ZIG(3,22),2)<=REF(ZIG(3,22),3);
VAR14:=ZIG(3,22)<REF(ZIG(3,22),1) AND REF(ZIG(3,22),1)>=REF(ZIG(3,22),2) AND REF(ZIG(3,22),2)>=REF(ZIG(3,22),3);
VAR15:=ZIG(3,51)>REF(ZIG(3,51),1) AND REF(ZIG(3,51),1)<=REF(ZIG(3,51),2) AND REF(ZIG(3,51),2)<=REF(ZIG(3,51),3);
VAR16:=ZIG(3,51)<REF(ZIG(3,51),1) AND REF(ZIG(3,51),1)>=REF(ZIG(3,51),2) AND REF(ZIG(3,51),2)>=REF(ZIG(3,51),3);
VAR17:=ZIG(3,72)>REF(ZIG(3,72),1) AND REF(ZIG(3,72),1)<=REF(ZIG(3,72),2) AND REF(ZIG(3,72),2)<=REF(ZIG(3,72),3);
VAR18:=ZIG(3,72)<REF(ZIG(3,72),1) AND REF(ZIG(3,72),1)>=REF(ZIG(3,72),2) AND REF(ZIG(3,72),2)>=REF(ZIG(3,72),3);
VAR19:=EMA(CLOSE,2)-EMA(CLOSE,150);
 
DRAWTEXT(VAR11 AND COUNT(VAR11,30)=1,LOW*0.95,'机构进场'),LINETHICK1,COLORFF00FF;
 
指标王:=CROSS(SMA((CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8))*100,3,1),SMA(SMA((CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8))*100,3,1),3,1)) AND SMA((CLOSE-LLV(LOW,8))/(HHV(HIGH,8)-LLV(LOW,8))*100,3,1)<20;
DRAWTEXT(指标王,L,'主力建仓'),COLORYELLOW;
 
 
 
JJ:=(CLOSE+HIGH+LOW)/3;
AA:=EMA(JJ,10);
BB:=REF(AA,1);
持股区域:STICKLINE(AA>BB,AA,BB,2,0),COLORYELLOW;
持币区域:STICKLINE(AA<BB,AA,BB,2,0),COLORBLUE;
 
 
 下跌:IF(KK=0 AND VVAR1=VVAR6,VVAR6, DRAWNULL),COLORGREEN;
 中:=(MA(CLOSE,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24))/4;
 上轨:IF(KK=1,中+3*STD(中,10),DRAWNULL),COLOR000088,LINETHICK1;
 IF(KK=1,2*MA(上轨,12)-MA(C,21),DRAWNULL),COLOR666666;
 N1:=(1,100,10);
 N2:=(1,100,10);
 DISP:=(1,3,2);
 K:=IF(PERIOD=5,1,{日}
 IF(PERIOD=6,1,{周}
 IF(PERIOD=7,1,{月}
 IF(PERIOD=8,1,{多分钟}
 IF(PERIOD=9,1,{多日}
 IF(PERIOD=10,1,{季}
 IF(PERIOD=11,2,{年}
 IF(PERIOD=4,1,{60F}
 IF(PERIOD=3,1,{30F}
 IF(PERIOD=2,1,{15F}
 IF(PERIOD=1,1{5F},1{1F})))))))))))/10;
 P1:=PEAK(1,K*N1,1);
 P2:=PEAK(1,K*N1,2);
 WP1:=PEAKBARS(1,K*N1,1);
 WP2:=PEAKBARS(1,K*N1,2);
 T1:=TROUGH(2,K*N2,1);
 T2:=TROUGH(2,K*N2,2);
 WT1:=TROUGHBARS(2,K*N2,1);
 WT2:=TROUGHBARS(2,K*N2,2);
 TJ1:=P1>T1 AND P2>T2 ;
 ZD:=MAX(T1,T2);
 ZG:=MIN(P1,P2);
 LL:=MIN(T1,T2);
 HH:=MAX(P1,P2);
 TJ2:=FILTER(ZG>ZD,2);
 TJ3:=ZG=REF(ZG,BARSLAST(TJ2)) OR ZD=REF(ZD,BARSLAST(TJ2));
 TJ4:=TJ1&&TJ2&&NOT(TJ3);
 TJ5:=BETWEEN(ZD,REF(ZD,REF(BARSLAST(TJ4),1)),REF(ZG,REF(BARSLAST(TJ4),1)));
 TJ6:=BETWEEN(ZG,REF(ZD,REF(BARSLAST(TJ4),1)),REF(ZG,REF(BARSLAST(TJ4),1)));
 TJ7:=ZG>REF(ZG,REF(BARSLAST(TJ4),1))&&ZD<REF(ZD,REF(BARSLAST(TJ4),1));
 TJ8:=TJ4&&NOT(TJ5 OR TJ6 OR TJ7);
 ZSD:=IF(TJ8,ZD,DRAWNULL);
 ZSG:=IF(TJ8,ZG,DRAWNULL);
 ZSH:=IF(TJ8,HH,DRAWNULL);
 ZSL:=IF(TJ8,LL,DRAWNULL);
 STICKLINE(TJ8,ZSH,ZSL,0,-1),COLORMAGENTA;
 STICKLINE(TJ8,ZSD,ZSG,IF(DISP=1,3,0),1),COLORMAGENTA;
 DRAWTEXT(DISP=2,ZSH,'中枢'),COLORWHITE;
 中枢高:PLOYLINE(DISP=2,REF(ZSD,BARSLAST(TJ8))),CIRCLEDOT,COLORLIRED;
 中枢低:PLOYLINE(DISP=2,REF(ZSG,BARSLAST(TJ8))),CIRCLEDOT,COLORLIGREEN;
 中枢最高:PLOYLINE(DISP=2,REF(ZSH,BARSLAST(TJ8))),POINTDOT,COLORRED;
 中枢最低:PLOYLINE(DISP=2,REF(ZSL,BARSLAST(TJ8))),POINTDOT,COLORGREEN;
 趋势高:PLOYLINE(DISP=3,ZIG(1,K*N1)),COLORLIBLUE;
 趋势低:PLOYLINE(DISP=3,ZIG(2,K*N2)),COLORLIBLUE;
 局部低点预选A:=BACKSET(LLV(L,5)<REF(LLV(L,4),1),4);
 局部低点预选B:=BACKSET(局部低点预选A=0 AND REF(局部低点预选A,1)=1,2);
 局部低点预选C:=IF(局部低点预选B=1 AND REF(局部低点预选B,1)=0,-1,0);
 局部高点预选A:=BACKSET(HHV(H,5)>REF(HHV(H,4),1),4);
 局部高点预选B:=BACKSET(局部高点预选A=0 AND REF(局部高点预选A,1)=1,2);
 局部高点预选C:=IF(局部高点预选B=1 AND REF(局部高点预选B,1)=0,1,0);
 缺口判断:=IF(L>REF(H,1),1,IF(H<REF(L,1),-1,0));
 距前高天:=BARSLAST(局部高点预选C=1);
 距前低天:=BARSLAST(局部低点预选C=-1);
 小值周期:=LOWRANGE(L);
 大值周期:=TOPRANGE(H);
 低保留AA:=IF(局部低点预选C=-1 AND REF(距前高天,1)>REF(距前低天,1) AND LLV(L,距前高天+1)<REF(LLV(L,距前高天+1),1),-1,0);
 低保留AB:=IF(局部低点预选C=-1 AND REF(距前高天,1)<=REF(距前低天,1) AND (距前高天>=4 OR LLV(缺口判断,距前高天)=-1 OR LLV(L,距前低天+2)<REF(LLV(L,距前低天+1),1)),-1,0);
 低保留S:=IF((低保留AA=-1 OR 低保留AB=-1) AND L<REF(H,距前高天+1),-1,0);
 预判:=IF((距前低天<4 AND HHV(缺口判断,距前低天)!=1) OR REF(低保留S,距前低天)=0,1,0);
 判断:=IF(局部高点预选C=1 AND REF(距前低天,1)<=REF(距前高天,1) AND 预判=1 AND 大值周期>REF(小值周期,距前低天+1) AND 大值周期
 >REF(小值周期,距前低天) AND 大值周期>REF(大值周期,距前高天),1,0);
 高保留A:=IF(局部高点预选C=1 AND REF(距前低天,1)>REF(距前高天,1) AND HHV(H,距前低天+1)>REF(HHV(H,距前低天+1),1),1,0);
 高保留B:=IF(局部高点预选C=1 AND REF(距前低天,1)<=REF(距前高天,1) AND REF(低保留S,距前低天)=-1 AND (距前低天>=4 OR HHV(缺口判断,距前低天)=1),1,0);
 高保留:=IF((高保留A=1 OR 高保留B=1 OR 判断=1) AND H>REF(L,距前低天+1),1,0);
 预判A:=IF((距前高天<4 AND HHV(缺口判断,距前高天)!=1) OR REF(高保留,距前高天)=0,1,0);
 判断A:=IF(局部低点预选C=-1 AND REF(距前高天,1)<=REF(距前低天,1) AND 预判A=1 AND 小值周期>REF(大值周期,距前高天+1) AND 小值周期>REF(大值周期,距前高天) AND 小值周期>REF(小值周期,距前低天),-1,0);
 低保留A:=IF(局部低点预选C=-1 AND REF(距前高天,1)>REF(距前低天,1) AND LLV(L,距前高天+1)<REF(LLV(L,距前高天+1),1),-1,0);
 低保留B:=IF(局部低点预选C=-1 AND REF(距前高天,1)<=REF(距前低天,1) AND (距前高天>=4 OR LLV(缺口判断,距前高天)=-1 OR 判断A=-
 1),-1,0);
 低保留:=IF((低保留A=-1 OR 低保留B=-1) AND L<REF(H,距前高天+1),-1,0);
 距前高天A:=BARSLAST(高保留=1);
 距前低天A:=BARSLAST(低保留=-1);
 预判X:=IF((距前低天A<4 AND HHV(缺口判断,距前低天A)!=1) OR REF(低保留,距前低天A)=0,1,0);
 判断X:=IF(局部高点预选C=1 AND REF(距前低天A,1)<=REF(距前高天A,1) AND 预判X=1 AND 大值周期>REF(小值周期,距前低天A+1) AND 大值周期>REF(小值周期,距前低天A) AND 大值周期>REF(大值周期,距前高天A),1,0);
 高保留XA:=IF(局部高点预选C=1 AND REF(距前低天A,1)>REF(距前高天A,1) AND HHV(H,距前低天A+1)>REF(HHV(H,距前低天A+1),1),1,0);
 高保留XB:=IF(局部高点预选C=1 AND REF(距前低天A,1)<=REF(距前高天A,1) AND REF(低保留,距前低天A)=-1 AND (距前低天A>=4 OR HHV(缺口判断,距前低天A)=1),1,0);
 高保留X:=IF((高保留XA=1 OR 高保留XB=1 OR 判断X=1) AND H>REF(L,距前低天A+1),1,0);
 预判XA:=IF((距前高天A<4 AND HHV(缺口判断,距前高天A)!=1) OR REF(高保留XA,距前高天A)=0,1,0);
 判断XA:=IF(局部低点预选C=-1 AND REF(距前高天A,1)<=REF(距前低天A,1) AND 预判XA=1 AND 小值周期>REF(大值周期,距前高天A+1) AND 小值周期>REF(大值周期,距前高天A) AND 小值周期>REF(小值周期,距前低天A),-1,0);
 低保留XA:=IF(局部低点预选C=-1 AND REF(距前高天A,1)>REF(距前低天A,1) AND LLV(L,距前高天A+1)<REF(LLV(L,距前高天A+1),1),-1,0);
 低保留XB:=IF(局部低点预选C=-1 AND REF(距前高天A,1)<=REF(距前低天A,1) AND (距前高天A>=4 OR LLV(缺口判断,距前高天A)=-1 OR 判断XA=-1),-1,0);
 低保留X:=IF((低保留XA=-1 OR 低保留XB=-1) AND L<REF(H,距前高天A+1),-1,0);
 距前高天YA:=BARSLAST(高保留X=1);
 距前低天YA:=BARSLAST(低保留X=-1);
 预判YX:=IF((距前低天YA<4 AND HHV(缺口判断,距前低天YA)!=1) OR REF(低保留X,距前低天YA)=0,1,0);
 判断YX:=IF(局部高点预选C=1 AND REF(距前低天YA,1)<=REF(距前高天YA,1) AND 预判YX=1 AND 大值周期>REF(小值周期,距前低天YA+1) AND 
大值周期>REF(小值周期,距前低天YA) AND 大值周期>REF(大值周期,距前高天YA),1,0);
 高保留YXA:=IF(局部高点预选C=1 AND REF(距前低天YA,1)>REF(距前高天YA,1) AND HHV(H,距前低天YA+1)>REF(HHV(H,距前低天YA+1),1),1,0);
 高保留YXB:=IF(局部高点预选C=1 AND REF(距前低天YA,1)<=REF(距前高天YA,1) AND REF(低保留X,距前低天YA)=-1 AND (距前低天YA>=4 OR 
HHV(缺口判断,距前低天YA)=1),1,0);
 高保留YX:=IF((高保留YXA=1 OR 高保留YXB=1 OR 判断YX=1) AND H>REF(L,距前低天YA+1),1,0);
 预判YXA:=IF((距前高天YA<4 AND HHV(缺口判断,距前高天YA)!=1) OR REF(高保留YXA,距前高天YA)=0,1,0);
 判断YXA:=IF(局部低点预选C=-1 AND REF(距前高天YA,1)<=REF(距前低天YA,1) AND 预判YXA=1 AND 小值周期>REF(大值周期,距前高天YA+1) 
AND 小值周期>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;
 STICKLINE(C>REF(C,1)*1.099,C,O,2.7,0)COLORRED,LINETHICK2;
 STICKLINE(C<REF(C,1)*0.901,C,O,2.7,0)COLORGREEN,LINETHICK2;
 DRAWLINE(极点保留=-1,局部极点,极点保留=1,局部极点,0),COLORRED;
 DRAWLINE(极点保留=1,局部极点,极点保留=-1,局部极点,0),COLORGREEN;
 DD1:=BARSLAST(ABS(极点保留)!=1);
 DRAWICON(极点保留=1,局部极点,2);
 DRAWICON(极点保留=-1,局部极点,1);
 {MA5:MA(CLOSE,5),COLORMAGENTA,LINETHICK1; 
判:IF(MA5<REF(MA5,1),MA5,DRAWNULL),COLORCYAN,LINETHICK1;};
 V2:=IF(CURRBARSCOUNT=1,VOL*240/FROMOPEN/REF(VOL,1)-1,VOL/REF(VOL,1)-1);
 STICKLINE(V2>=1,O,C,1,0),COLORYELLOW;
 TY:=C;{收盘价}
 A1:=REF(TY,10)=HHV(TY,2*10+1);{10日前收盘价等于21天内最高价}
 VB1:=FILTER(A1,10);{当出现A1条件时,过滤10天后连续出现的信号}
 C1:=BACKSET(VB1,10+1);{将当前位置到11天前的位置设为1}
 HD:=FILTER(C1,10);{将当前位置到10天后的位置设为1}
 A2:=REF(TY,10)=LLV(TY,2*10+1);{10天前的收盘价等于21天内最低价}
 VB2:=FILTER(A2,10); {过滤10天内连续出现的信号}
 C2:=BACKSET(VB2,10+1);{将当前位置到11天前的位置设为1}
 LD:=FILTER(C2,10);{当出现C2后,10天后的数据不予记录}
 A:=REF(C,BARSLAST(HD));{设值上次高点位置}
 B:=REF(C,BARSLAST(LD));{设值上次低点位置}
 T11:=BARSLAST(HD)<BARSLAST(LD) AND NOT(HD);{上升波段回调不创新低没新高}
 T21:=BARSLAST(HD)>BARSLAST(LD) AND NOT(LD);{下降波段反弹不创新高没新低}
 波峰:IF(T11,A,A),COLORFF00FF,POINTDOT;{符合T1条件,高位线为紫色点状线}
 STICKLINE(T11,A,A,9,0),COLORFF00FF;{高位画横线}
 波谷:IF(T21,B,B),COLOR80FF00,POINTDOT;{符合T2条件,高位线为绿色点状线}
 STICKLINE(T21,B,B,9,0),COLOR80FF00;{低位画横线};





2、黑马趋势主升浪绝技

M:=7;
EMA13:=EMA(C,13);
EMA30:EMA(C,30),COLORFFCCCC;
HJ_1:=(CLOSE-LLV(LOW,20))/(HHV(HIGH,20)-LLV(LOW,20))*100;
HJ_2:=SMA(SMA(HJ_1,3,1),3,1)/28.57;
HJ_3:=EMA(HJ_2,5);
HJ_4:=3*HJ_2-2*HJ_3;
HJ_5:=CROSS(HJ_4,HJ_2) AND HJ_2<2.1 AND CLOSE>OPEN;
EMA60:EMA(C,60),COLORFF00FF;
EMA90:EMA(C,90),COLORYELLOW;
STICKLINE(HJ_5,82,0,0.005,0),COLORRED;
DRAWICON(HJ_5>0,85,13),COLORYELLOW;
EMA120:EMA(C,120),COLORFFCC66;
EMA250:EMA(C,250),COLORBLUE;
HJ_6:=CROSS(HJ_4,HJ_2) AND HJ_2<2.1 AND CLOSE>OPEN;
HJ_7:=(2*CLOSE+HIGH+LOW)/4;
HJ_8:=LLV(LOW,13);
A1:3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,
1)-2*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1);
黑马线:EMA(A1,5),LINETHICK2,COLOR6600FF;
HJ_9:=HHV(HIGH,13);
HJ_10:=EMA((HJ_7-HJ_8)/(HJ_9-HJ_8)*100,13);
F1:=EMA30-EMA60<130/1000 AND EMA30-EMA90<230/1000 AND EMA30-EMA120<330/1000;
F2:=EMA60-EMA30<130/1000 AND EMA60-EMA90<230/1000 AND EMA60-EMA120<330/1000;
HJ_11:=EMA(0.667*REF(HJ_10,1)+0.333*HJ_10,2);
HJ_12:=HJ_10;
F3:=EMA90-EMA30<130/1000 AND EMA90-EMA60<230/1000 AND EMA90-EMA120<330/1000;
F4:=EMA120-EMA30<130/1000 AND EMA120-EMA60<230/1000 AND EMA120-EMA90<330/1000;
F5:=EMA30-EMA60<100/1000 AND EMA30-EMA90<200/1000;
STICKLINE(HJ_10>HJ_11,HJ_10,HJ_11,3,0),COLOR0055AA;
STICKLINE(HJ_10>HJ_11,HJ_10,HJ_11,2.8,0),COLOR0066BB;
STICKLINE(HJ_10>HJ_11,HJ_10,HJ_11,2.5,0),COLOR0077CC;
A2:=(黑马线-REF(黑马线,1))/REF(黑马线,1)*100;
A3:=EMA(C,5);
STICKLINE(HJ_10>HJ_11,HJ_10,HJ_11,2.2,0),COLOR0088DD;
STICKLINE(HJ_10>HJ_11,HJ_10,HJ_11,1.7,0),COLOR0099EE;
STICKLINE(HJ_10>HJ_11,HJ_10,HJ_11,1.2,0),COLOR00AAFF;
FF1:=F1 AND F2 AND F3 AND F4 AND CROSS(EMA30,EMA60);
FF2:=F1 AND F2 AND F3 AND F4 AND CROSS(EMA(C,13),EMA30);
FF3:=F5 AND C>EMA250 AND CROSS(EMA30,EMA60);
STICKLINE(HJ_10>HJ_11,HJ_10,HJ_11,0.7,0),COLOR00CCFF;
STICKLINE(HJ_10>HJ_11,HJ_10,HJ_11,0.2,0),COLORYELLOW;
STICKLINE(HJ_10<=HJ_11,HJ_10,HJ_11,3,0),COLOR990099;
STICKLINE(HJ_10<=HJ_11,HJ_10,HJ_11,2.8,0),COLOR990088;
STICKLINE(HJ_10<=HJ_11,HJ_10,HJ_11,2.5,0),COLOR990077;
G1:=EMA60-EMA90<220/1000 AND EMA60-EMA120<320/1000 AND EMA60-EMA250<420/1000;
G2:=EMA90-EMA30<220/1000 AND EMA90-EMA60<320/1000 AND EMA90-EMA250<420/1000;
STICKLINE(HJ_10<=HJ_11,HJ_10,HJ_11,2.2,0),COLOR990066;
STICKLINE(HJ_10<=HJ_11,HJ_10,HJ_11,1.7,0),COLOR990055;
STICKLINE(HJ_10<=HJ_11,HJ_10,HJ_11,1.2,0),COLORBB00BB;
STICKLINE(HJ_10<=HJ_11,HJ_10,HJ_11,0.7,0),COLORDD00DD;
STICKLINE(HJ_10<=HJ_11,HJ_10,HJ_11,0.2,0),COLORMAGENTA;
G3:=EMA120-EMA60<220/1000 AND EMA120-EMA90<320/1000 AND EMA120-EMA250<420/1000;
G4:=EMA250-EMA60<220/1000 AND EMA250-EMA90<320/1000 AND EMA250-EMA120<420/1000;
DRAWTEXT(HJ_6,78,5),COLORCYAN;
HJ_13:=10;
GG1:=G1 AND G2 AND G3 AND G4 AND CROSS(EMA13,EMA30);
GG2:=G1 AND G2 AND G3 AND G4 AND CROSS(EMA30,EMA60);
底部区域:20,COLORLIRED;
中轨:50,COLORYELLOW;
高位:80,COLORLIBLUE;
启动:EMA(0.382*REF(HJ_10,2)+0.618*HJ_10,6),COLORRED;
A4:=((C-LLV(L,21))/(HHV(H,21)-LLV(L,21)))*100;
趋势线:(MA(3*SMA(A4,6,1)-2*SMA(SMA(A4,5,1),5,1),2)),LINETHICK2,COLORYELLOW;
IF(启动>REF(启动,1),启动,DRAWNULL),COLORRED,LINETHICK4;
IF(启动<REF(启动,1),启动,DRAWNULL),COLORLIBLUE,LINETHICK2;
DRAWICON(FF1 OR FF2 OR FF3 OR GG1 OR GG2,L-0.1,9);
VAR1:=EMA(SMA((CLOSE-LLV(LOW,19))/(HHV(HIGH,19)-LLV(LOW,19))*100,8,1),3);
买入:IF(CROSS(4*SMA((CLOSE-LLV(LOW,25))/(HHV(HIGH,25)-LLV(LOW,25))*100,
5,1)-3*SMA(SMA((CLOSE-LLV(LOW,25))/(HHV(HIGH,25)-LLV(LOW,25))*100,5,
1),3,1),8),58,0),STICK,COLORYELLOW,LINETHICK3;
A5:=(HHV(H,60)-C)/(HHV(H,60)-LLV(L,60))*100;
STICKLINE(买入,50,0,3.5,0),COLORGREEN;
STICKLINE(买入,50,0,3.4,0),COLORGREEN;
STICKLINE(买入,50,0,3.1,0),COLORGREEN;
STICKLINE(VAR1>20 AND VAR1<80,VAR1,VAR1,10,1),COLORRED;
STICKLINE(VAR1<REF(VAR1,1),VAR1,VAR1,10,1),COLORFFCC66;
STICKLINE(买入,50,0,2.8,0),COLOR009900;
STICKLINE(买入,50,0,2.5,0),COLOR009900;
STICKLINE(买入,50,0,2,0),COLOR009900;
STICKLINE(买入,50,0,1.5,0),COLOR00BB00;
STICKLINE(VAR1>80,VAR1,VAR1,8,1),COLOR00FF00;
STICKLINE(VAR1<20,VAR1,VAR1,8,1),COLORYELLOW;
STICKLINE(买入,50,0,0.9,0),COLOR00DD00;
STICKLINE(买入,50,0,0.3,0),COLORGREEN;
STICKLINE(买入,50,0,0.05,0),COLORYELLOW;
DRAWTEXT(FILTER(REF(黑马线,1)>90 AND A2<0,7),黑马线,'跑'),COLOR00FF00;
WWWCHNMONEYCOM:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
DRAWTEXT(CROSS(A1,黑马线)AND 黑马线<A5,黑马线,'黑马');
DRAWTEXT(CROSS(趋势线,0)AND 黑马线<40,5,'大黑马');
DRAWICON(买入>0,58,34),COLORYELLOW;
DRAWTEXT(买入,45,2),COLOR66FFCC;
主升浪:IF(WINNER(C*0.9)*100-V/CAPITAL*100>=25,10,0),COLORYELLOW,POINTDOT;
STICKLINE(主升浪,10,0,1,1),COLORYELLOW;
HJ_14:=REF(CLOSE,1);
HJ_15:=SMA(MAX(CLOSE-HJ_14,0),6,1)/SMA(ABS(CLOSE-HJ_14),6,1)*100;
HJ_16:=CROSS(70,HJ_15)*70;
底部:(A2<-10 AND A2>REF(A2,1))*25,COLORRED;
DRAWICON(底部 AND A3>REF(A3,1),25,4);
DRAWTEXT(HJ_16,80,3),COLORRED;
DRAWTEXT_FIX(1,0.61,0.9,1,4),COLORRED;




3、快进快出,紫色买绿色卖

公式的用法:粉底红顶是买点,绿顶黄底是卖点( 股 民 学 院 : http://www.58188.com )

{公式名称: 快进快出
公式描述: 紫色买绿色卖
公式源码:}
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.3,0.03,0,75),COLORYELLOW;
DRAWTEXT_FIX(CURRBARSCOUNT=1,0.3,0.2,0,76),COLORYELLOW;
X_1:=CLOSE>REF(CLOSE,1) AND CLOSE>REF(CLOSE,2);
X_2:=REF(X_1,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
X_3:=REF(X_2,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
X_4:=REF(X_3,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
X_5:=REF(X_4,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
X_6:=REF(X_5,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
X_7:=REF(X_6,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
X_8:=REF(X_7,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
X_9:=REF(X_8,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
X_10:=REF(X_9,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
X_11:=REF(X_10,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
X_12:=REF(X_11,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
STICKLINE(X_1 OR X_2 OR X_3 OR X_4 OR X_5 OR X_6 OR X_7 OR X_8 OR X_9 OR X_10 OR X_11 OR X_12,CLOSE,REF(CLOSE,1),3,0),COLORRED;
X_13:=CLOSE<REF(CLOSE,1) AND CLOSE<REF(CLOSE,2);
X_14:=REF(X_13,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
X_15:=REF(X_14,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
X_16:=REF(X_15,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
X_17:=REF(X_16,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
X_18:=REF(X_17,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
X_19:=REF(X_18,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
X_20:=REF(X_19,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
X_21:=REF(X_20,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
X_22:=REF(X_21,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
X_23:=REF(X_22,1) AND CLOSE<=REF(CLOSE,1) AND CLOSE>=REF(CLOSE,2);
X_24:=REF(X_23,1) AND CLOSE>=REF(CLOSE,1) AND CLOSE<=REF(CLOSE,2);
STICKLINE(X_13 OR X_14 OR X_15 OR X_16 OR X_17 OR X_18 OR X_19 OR X_20 OR X_21 OR X_22 OR X_23 OR X_24,CLOSE,REF(CLOSE,1),3,0),COLORYELLOW;
X_25:=REF(X_13 OR X_14 OR X_15 OR X_16 OR X_17 OR X_18 OR X_19 OR X_20 OR X_21 OR X_22 OR X_23 OR X_24,1) AND X_1;
STICKLINE(X_25,REF(CLOSE,1),REF(CLOSE,2),3,0),COLORMAGENTA;
X_26:=REF(X_1 OR X_2 OR X_3 OR X_4 OR X_5 OR X_6 OR X_7 OR X_8 OR X_9 OR X_10 OR X_11 OR X_12,1) AND X_13;
STICKLINE(X_26,REF(CLOSE,1),REF(CLOSE,2),3,0),COLOR008800;
X_27:=(CLOSE-LLV(LOW,13))/(HHV(HIGH,13)-LLV(LOW,13))*100;
X_28:=SMA(X_27,3,1);
X_29:=SMA(X_28,3,1);
X_30:=3*X_28-2*X_29;
X_31:=(CLOSE-LLV(LOW,55))/(HHV(HIGH,55)-LLV(LOW,55))*100;
X_32:=SMA(X_31,3,1);
X_33:=SMA(X_32,3,1);
X_34:=3*X_32-2*X_33;

上一篇:通达信源码:天下奇兵买卖无敌决杀,选股A号,初选牛犊

下一篇:通达信源码:心想事成-套装,分时抓涨停T+0,长短趋势