以下是通达信五里头精华主图3(主图)源码(无源码的请下载附件导入)
AAF:LLV(LOW,34),LINETHICK2,COLORGREEN;
BBF:MA(AAF,4),LINETHICK2,COLORYELLOW;
VAR2X:=SMA(MAX(CLOSE-REF(CLOSE, 1),0),6,1)/SMA(ABS(CLOSE-REF(CLOSE, 1)),6,1)*100;
STICKLINE(CROSS(76,VAR2X),C,O,4,0) ,COLORYELLOW,LINETHICK2;
DRAWTEXT(CROSS(76,VAR2X),H*1.05,'卖') ,COLORYELLOW;
A2:=SMA(MAX((CLOSE - REF(CLOSE, 1)),0), 8, 1) / SMA(ABS((CLOSE - REF(CLOSE, 1))), 8, 1) * 100;
A3:=SMA(MAX((CLOSE - REF(CLOSE, 1)),0), 55, 1) / SMA(ABS((CLOSE - REF(CLOSE, 1))), 55, 1) * 100;
底1:=(((A2 <= 20) AND (A3 <= 49)) * 2);
底2:= IF(SMA(MAX(CLOSE-REF(CLOSE,2),0),7,1)/SMA(ABS(CLOSE- REF(CLOSE,2)),7,1)*100<12,1,0);
STICKLINE(底1=2 AND 底2=1,C,O,4,0) ,COLORF00FF0,LINETHICK2;
DRAWTEXT(底1=2 AND 底2=1,L*0.95,'买') ,COLORF00FF0;
上:EMA(C,3),COLORBLUE,LINETHICK1;
中:EMA(C,5),COLORWHITE,LINETHICK1;
下:EMA(中,5),COLOR00FF00,LINETHICK1;
IF(上>中 AND 上>REF(上,1), 上,DRAWNULL),LINETHICK2,COLORRED;
IF(中>下 AND 中>REF(中,1), 中,DRAWNULL),LINETHICK2,COLORRED;
获利盘%:WINNER(CLOSE)*100,NODRAW,COLORWHITE;
趋势线:EMA(((SLOPE(CLOSE,21) * 20) + CLOSE),42),POINTDOT,COLORFF00FF,LINETHICK4;
V5:=MA((LOW+HIGH+CLOSE)/3,5);
MA1:=MEMA(CLOSE,5);
MA2:=ATAN((MA1/REF(MA1,1)-1)*100)*180/3.1416;
MA3:=IF(MA2>0,MA2,MA2);
VAR1:=CLOSE=HHV(C,4) AND (REF(C,1)>=REF(C,2) OR REF(C,1)>=REF(C,3))
OR REF(C,1)=HHV(C,4) AND CLOSE>=REF(C,2) OR REF(C,2)=HHV(C,4) AND
REF(C,3)=LLV(C,4) AND C>=REF(C,1) OR REF(C,3)=HHV(C,4) AND
C>=REF(C,1) AND C>=REF(C,2);
{收盘价=4日内收盘价的最高值 AND 昨收>=2日前的收盘价}
VAR2:=CLOSE=HHV(C,4) AND REF(C,1)=LLV(C,4);
{收盘价=4日内收盘价的最高值 AND 昨收=4日内收盘价的最低值}
VAR3:=CLOSE=LLV(C,4) AND (REF(C,1)<REF(C,2) OR REF(C,1)<REF(C,3)) OR
REF(C,1)=LLV(C,4) AND C<REF(C,2) OR REF(C,2)=LLV(C,4) AND
REF(C,1)=HHV(C,4) AND C<REF(C,1) OR REF(C,3)=LLV(C,4) AND
C<REF(C,1) AND C<REF(C,2);
{收盘价=4日内收盘价的最低值 AND (昨收<2日前的收盘价}
VAR4:=REF(C,1)=LLV(C,4) AND C>=REF(C,2) OR REF(C,2)=LLV(C,4) AND
REF(C,1)<=REF(C,3) AND REF(C,2)<REF(C,4) AND C>=REF(C,1);
{昨收=4日内收盘价的最低值 AND 收盘价>=2日前的收盘价}
VAR5:=REF(C,1)=HHV(C,4) AND C<REF(C,2) OR (REF(C,2)=HHV(C,4) AND
REF(C,1)>REF(C,3) OR REF(C,3)=HHV(C,4) AND REF(C,1)>REF(C,2)) AND
REF(C,2)>=REF(C,4) AND C<REF(C,1);
{昨收=4日内收盘价的最高值 AND 收盘价<2日前的收盘价}
VAR6:=V5>REF(V5,1) AND REF(V5,1)<REF(V5,2);
{今日V5向上形成拐点}
VAR7:=LOW<HHV(V5,13) AND HIGH>HHV(V5,13) AND CLOSE>REF(C,1) AND CLOSE>OPEN;
VAR8:=VAR7 AND COUNT(VAR6,2);
VAR9:=100*EMA(EMA(C-REF(C,1),6),6)/EMA(EMA(ABS(C-REF(C,1)),6),6);
VAR10:=EMA(MA(C,13),13);
VAR11:=FILTER((LLV(VAR9,2)=LLV(VAR9,7) AND COUNT(VAR9<0,2) AND
CROSS(VAR9,MA(VAR9,2)))=1,5);
VAR12:=FILTER((HHV(VAR9,2)=HHV(VAR9,7) AND COUNT(VAR9>50,2) AND
CROSS(MA(VAR9,2),VAR9))=1,1);
VAR13:=SMA(EMA((C-REF(C,1))/REF(C,1),5)*100,3,1)*10;
VAR14:=FILTER(((CROSS(VAR13,0) OR CROSS(C,VAR10)) AND VAR11)=1,3);
VAR15:=MA(C,18)>=REF(MA(C,18),3) AND CROSS(C,MA(C,18));
VAR16:=VAR8 AND NOT(REF(VAR8,1));
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;
买1:=(VAR14 OR VAR15) AND VAR11;
买2:=(VAR14 OR VAR15) AND VAR4;
买3:=(VAR14 OR VAR15) AND VAR2;
买4:=(VAR2 AND VAR11) OR (VAR4 AND VAR11);
买5:=(CROSS(J,D) AND VAR4) OR (CROSS(J,D) AND VAR2) OR (CROSS(J,D) AND VAR11);
{蓝}
STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,3.3,0),COLORFF7700;
STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,0.8,0),COLORCYAN;
{红}
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,3.3,0),COLOR000099;
STICKLINE(CLOSE>OPEN,CLOSE,OPEN,0.8,0),COLORCC66FF;
{绿}
STICKLINE(VAR3,OPEN,(OPEN+CLOSE)/2,3.3,0),COLOR009900;
STICKLINE(VAR3,OPEN,(OPEN+CLOSE)/2,0.8,0),COLOR00FF00;
{灰}
STICKLINE(VAR4,OPEN,(OPEN+CLOSE)/2,3.3,0),COLOR999999;
STICKLINE(VAR4,OPEN,(OPEN+CLOSE)/2,0.8,0),COLORFFFFFF;
STICKLINE(CROSS(J,D),OPEN,CLOSE,1,0),COLORYELLOW;
STICKLINE(CROSS(D,J),OPEN,CLOSE,1,0),COLOR000099;
DRAWICON(VAR16,LOW-0.02,7);
DRAWICON(买1 OR 买2 OR 买3 OR 买4 OR 买5 AND 上>REF(上,1),LOW-0.01,1);
DRAWICON(CROSS(D,J) OR CROSS(50,VAR9) AND C<中,HIGH+0.01,2);
BB5:=ATAN(EMA((C+L+H)/3,7)-REF(EMA((C+L+H)/3,7),1))*3.1416*10;
DRAWTEXT(FILTER(BB5>1 AND EMA((C+L+H)/3,7)>REF(EMA((C+L+H)/3,7),1),10),
LOW*0.99,'★∠45'),COLORFFFFFF;
VAR82:=((((2*CLOSE)+HIGH)+LOW) / 4);
C1:=(EMA((((VAR82-LLV(L,5))/(HHV(H,4)-LLV(L,5)))*100),4)),COLORFF00FF,LINETHICK2;
C2:=(EMA(((0.667*REF(C1,1))+(0.333*C1)),2)),COLORFFFFFF,LINETHICK2;
TJ3:=CROSS(C1,C2) AND REF(C1,1)<20;
TJ4:=CROSS(C2,C1) AND REF(C1,1)>80;
DRAWTEXT(CROSS(C2,C1) AND C1>90,H*1.02,'S'),COLORBLUE;
DRAWTEXT(TJ3 AND 上>REF(上,1),L*0.98,'底'),COLORFF00FF;
DRAWTEXT(TJ4 AND C<中,H*1.02,'逃'),COLORGREEN;
B0:=( HHV(H,200)- LLV(L,200))/40;
KB2:=L-B0;
STICKLINE((BARSCOUNT(C)+0)/34=FLOOR((BARSCOUNT(C)+0)/34),KB2,KB2-0.8*B0,1,0),COLORYELLOW,LINETHICK3;
DRAWTEXT((BARSCOUNT(C)+0)/34=FLOOR((BARSCOUNT(C)+0)/34),KB2-B0,'时窗'),COLORYELLOW;
AAA:=(3*C+H+L+O)/6;
短趋:=(8*AAA+7*REF(AAA,1)+6*REF(AAA,2)+5*REF(AAA,3)+4*REF(AAA,4)+3*REF(AAA,5)+2*REF(AAA,6)+REF(AAA,8))/36;
TTJ1:=VOL=HHV(VOL,10) AND VOL>2*REF(VOL,1) AND CLOSE>短趋;
TTJ2:=IF(BARSLAST(FILTER(TTJ1,5))=1 AND CLOSE>REF(HIGH,1),1,IF(BARSLAST(FILTER(TTJ1,5))=2 AND CLOSE>REF(HIGH,2),1,IF(BARSLAST(FILTER(TTJ1,5))=3 AND CLOSE>REF(HIGH,3),1,0)));
TTJ3:=IF(BARSLAST(FILTER(TTJ1,5))=1 AND CLOSE>REF(LOW,1),1,IF(BARSLAST(FILTER(TTJ1,5))=2 AND CLOSE>REF(LOW,2),1,IF(BARSLAST(FILTER(TTJ1,5))=3 AND CLOSE>REF(LOW,3),1,0)));
条件成立:=FILTER(TTJ3=1 AND TTJ2=1,3);
DRAWTEXT(条件成立,L*0.93,'桩'),COLORFF26FF;
VAR90:=((((HHV((((EMA(DCLOSE,12)-EMA(DCLOSE,26))-(EMA((EMA(DCLOSE,12)
-EMA(DCLOSE,26)),9)))*2),4)<0) AND ((((EMA(DCLOSE,12)-EMA(DCLOSE,26))-
(EMA((EMA(DCLOSE,12)-EMA(DCLOSE,26)),9)))*2)>REF((((EMA(DCLOSE,12)
-EMA(DCLOSE,26))-(EMA((EMA(DCLOSE,12)-EMA(DCLOSE,26)),9)))*2),1)))
AND (REF((((EMA(DCLOSE,12)-EMA(DCLOSE,26))-(EMA((EMA(DCLOSE,12)-
EMA(DCLOSE,26)),9)))*2),1)<REF((((EMA(DCLOSE,12)-EMA(DCLOSE,26))-
(EMA((EMA(DCLOSE,12)-EMA(DCLOSE,26)),9)))*2),2))) AND (REF((((EMA(DCLOSE,12)
-EMA(DCLOSE,26))-(EMA((EMA(DCLOSE,12)-EMA(DCLOSE,26)),9)))*2),2)
<REF((((EMA(DCLOSE,12)-EMA(DCLOSE,26))-(EMA((EMA(DCLOSE,12)-EMA(DCLOSE,
26)),9)))*2),3)));
DRAWTEXT(VAR90 AND 上>REF(上,1),L*0.98,'买'),COLORRED;
DRAWTEXT(CROSS(MA(C,3),MA(C,9)) AND C>=REF(C,1) AND C>O,L*0.98,'追'),COLORMAGENTA;
DRAWTEXT(REF(C,BARSLAST(REF(CROSS("MACD.DIF","MACD.DEA"),1))+1)>C AND
REF("MACD.DIF",BARSLAST(REF(CROSS("MACD.DIF","MACD.DEA"),1))+1)
<"MACD.DIF" AND CROSS("MACD.DIF","MACD.DEA")
>0,L-0.02,'★M'),COLORFF00FF;{MACD底背离}
DRAWTEXT(REF(C,BARSLAST(REF(CROSS("KDJ.K","KDJ.D"),1))+1)>C AND
REF("KDJ.K",BARSLAST(REF(CROSS("KDJ.K","KDJ.D"),1))+1)<"KDJ.K" AND
CROSS("KDJ.K","KDJ.D"),L-0.10,'◎K'),COLORFF00FF;{KDJ底背离}
DRAWTEXT(REF(C,BARSLAST(REF(CROSS("RSI.RSI1","RSI.RSI2"),1))+1)>C AND
REF("RSI.RSI1",BARSLAST(REF(CROSS("RSI.RSI1","RSI.RSI2"),1))+1)
<"RSI.RSI1" AND CROSS("RSI.RSI1","RSI.RSI2")
>0,L-0.18,'◆R'),COLORFF00FF;{RSI底背离};
DRAWTEXT(REF(C,BARSLAST(REF(CROSS("MACD.DEA","MACD.DIF"),1))+1)<C AND REF("MACD.DIF",BARSLAST(REF(CROSS("MACD.DEA","MACD.DIF"),1))+1)
>"MACD.DIF" AND CROSS("MACD.DEA","MACD.DIF")
>0,H+0.16,'★M'),COLORGREEN;{MACD顶背离};
DRAWTEXT(REF(C,BARSLAST(REF(CROSS("KDJ.D","KDJ.K"),1))+1)<C
AND REF("KDJ.K",BARSLAST(REF(CROSS("KDJ.D","KDJ.K"),1))+1)
>"KDJ.K" AND CROSS("KDJ.D","KDJ.K")>0,H+0.08,'◎K'),COLORGREEN;{KDJ顶背离}
DRAWTEXT(REF(C,BARSLAST(REF(CROSS("RSI.RSI2","RSI.RSI1"),1))+1)<C AND
REF("RSI.RSI1",BARSLAST(REF(CROSS("RSI.RSI2","RSI.RSI1"),1))+1)>"RSI.RSI1"
AND CROSS("RSI.RSI2","RSI.RSI1")>0,H+0.04,'◆R'),COLORGREEN;{RSI顶背离};
814266165.jpg
|