《20个极品通达信计划指标定律公式源码.doc》由会员分享,可在线阅读,更多相关《20个极品通达信计划指标定律公式源码.doc(44页珍藏版)》请在淘文阁 - 分享文档赚钱的网站上搜索。
1、.*公式1(未来函数)代码N1:=5;N2:=10;N3:=20;N4:=30;P:=2;M:=20;N:=250;M1:=55;W:=21;P3:=500;N9:=90;HR:=HHV(HIGH,M1);HRY:=LLV(LOW,M1);HRY11:=HR*HRY;HRY33:SQRT(HRY11),COLORGREEN,LINETHICK2;IF(CHRY33 AND HRY33 =REF(HRY33 ,1), HRY33 ,DRAWNULL),LINETHICK2,COLORRED;MA1:EMA(CLOSE,N1);MA2:EMA(CLOSE,N2);MA3:EMA(CLOSE,N3)
2、,COLOR00FFFF;MA4:EMA(CLOSE,N4),LINETHICK2;TJ1:=CROSS(MA1,MA2) AND CO AND CREF(C,1) AND C/REF(C,1)=1.018OR CROSS(MA1,MA4) AND CO AND CREF(C,1) AND C/REF(C,1)=1.018OR CROSS(MA2,MA3) AND CO AND CREF(C,1) AND C/REF(C,1)=1.018OR CROSS(MA1,MA3) AND CO AND CREF(C,1) AND C/REF(C,1)=1.018;TJ2:=(MAX(MA1,MAX(M
3、A2,MA3)-MIN(MA1,MIN(MA2,MA3)/MIN(MA1,MIN(MA2,MA3)*100D AND MACD0 AND V1,2,0),COLORRED;做空:=IF(KD AND MACD1,-2,0),COLOR00FF00;强洗:=IF(MACD0 AND K1,1,0),COLOR0099FF;弱升:=IF(MACDD AND V1,-1,0),COLORFFFF00;STICKLINE(做多 AND C=O,C,O,3,1),COLORRED;STICKLINE(做多 AND CO,C,O,3,0),COLOR990099;STICKLINE(做多 AND CO,C
4、,O,1,0),COLORCC00CC;STICKLINE(做多 AND C=O,C,O,3,1),COLOR0000FF;STICKLINE(做多 AND C=O,C,O,1.5,0),COLOR0000DD;STICKLINE(做多 AND C=O,C,O,0.4,0),COLOR0000FF;STICKLINE(做空 AND C=O,L,H,0.1,0),COLOR0000FF;STICKLINE(做空 AND C=O,C,O,3,1),COLOR00FF00;STICKLINE(做空 AND CO,C,O,3,0),COLOR00FF00;STICKLINE(做空 AND CO,C,O
5、,0.3,0),COLOR00FF00;STICKLINE(做空 AND C=O,L,H,0.1,0),COLOR0000FF;STICKLINE(强洗 AND C=O,C,O,3,1),COLORFFFFFF;STICKLINE(强洗 AND CO,C,O,3,0),COLOR999999;STICKLINE(强洗 AND CO,C,O,1,0),COLORCCCCCC;STICKLINE(强洗 AND C=O,C,O,3,1),COLOR00FFFF;STICKLINE(弱升 AND CO,C,O,3,0),COLOR009999;STICKLINE(弱升 AND CREF(ZIG(3,5
6、),1) AND REF(ZIG(3,5),1)=REF(ZIG(3,5),2) AND REF(ZIG(3,5),2)=REF(ZIG(3,5),3);EX1:=ZIG(3,5)=REF(ZIG(3,5),2) AND REF(ZIG(3,5),2)=REF(ZIG(3,5),3);PL10:=ZIG(3,10);EN2:=ZIG(3,10)REF(ZIG(3,10),1) AND REF(ZIG(3,10),1)=REF(ZIG(3,10),2) AND REF(ZIG(3,10),2)=REF(ZIG(3,10),3);EX2:=ZIG(3,10)=REF(ZIG(3,10),2) AN
7、D REF(ZIG(3,10),2)=REF(ZIG(3,10),3);PL20:=ZIG(3,20);EN3:=ZIG(3,20)REF(ZIG(3,20),1) AND REF(ZIG(3,20),1)=REF(ZIG(3,20),2) AND REF(ZIG(3,20),2)=REF(ZIG(3,20),3);EX3:=ZIG(3,20)=REF(ZIG(3,20),2) AND REF(ZIG(3,20),2)=REF(ZIG(3,20),3);PL40:=ZIG(3,40);走强1:=BARSLAST(PL5REF(PL5,1);走强2:=BARSLAST(PL10REF(PL10,
8、1);走强3:=BARSLAST(PL20REF(PL20,1);ZTJZ5:=IF(PL10REF(PL10,1),COUNT(EN1,走强2),0);ZTJD5:=IF(PL10REF(PL10,1),COUNT(EX1,走强2),0);DTJZ5:=IF(PL10REF(PL10,1),COUNT(EN1,走弱2),0);DTJD5:=IF(PL10REF(PL20,1),COUNT(EN2,走强3),0);ZTJD10:=IF(PL20REF(PL20,1),COUNT(EX2,走强3),0);DTJZ10:=IF(PL20REF(PL20,1),COUNT(EN2,走弱3),0);D
9、TJD10:=IF(PL20REF(PL20,1) AND ZTJD10=1,H*1.03,),LINETHICK3,COLOR00FFFF;DRAWTEXT(EN2 AND PL20REF(PL20,1) AND ZTJZ10=2,L*0.95,),LINETHICK3,COLOR00FFFF;DRAWTEXT(EX2 AND PL20REF(PL20,1) AND ZTJD10=2 OR (ZTJD10=0 OR ZTJD10=2)AND EX2,H*1.03,),LINETHICK3,COLOR00FFFF;DRAWTEXT(EN2 AND PL20REF(PL20,1) AND ZTJ
10、Z10=3,L*0.95,),LINETHICK3,COLOR00FFFF;TJ11:=EN2 AND ZTJZ5=1;TJ22:=EN1 AND PL10REF(PL10,1) AND ZTJZ5=2;TJ33:=EN2 AND DTJZ10=1;TJ44:=EN3 AND ZTJZ10=1;TJ55:=EN2 AND PL20REF(PL20,1) AND ZTJZ10=2;XG22:=TJ11 OR TJ22 OR TJ33 OR TJ44 OR TJ55;MM:=CHRY33 AND HRY33 =REF(HRY33 ,1);QQ:=HRY33=REF(HRY33 ,1);XG11:=
11、CROSS(C,HRY33) AND QQ AND MM;BUY1:=LAST(CLOSEMA(CLOSE,55),0,5);BUY2:=EXIST(CLOSEMA(CLOSE,55)&BUY1&BUY2;W18:=FILTER(EXIST(XG11 OR BUY,1),5);STICKLINE(W18,C,(C+O)/2,4,0),COLORFF00FF;DRAWTEXT(W18,L*0.97,牛),COLOR00FFFF;X1:=REF(C,1)/HHV(H,20)0.67;X3:=(HIGH-MAX(CLOSE,OPEN)/(HIGH-LOW)0.33;X4:=ABS(C-O)/CC;X
12、5:=COUNT(DOWN,7)=5;XG8:=X1 AND X2 AND X3 AND X4 AND X5;DRAWTEXT(XG8,L*0.98,螺),COLOR00FFFF;AA:=REF(C,1)/REF(O,1)1.03;CC:=CREF(O,1);TJ81:=AA AND BB AND CC;X81:=REF(C,1)/HHV(H,20)C;X82:=COUNT(DN,7)=5;X83:=C=HHV(C,3);XG81:=TJ81 AND X81 AND X82;XG82:=X81 AND X82 AND X83;XG88:=XG81 OR XG82;DRAWTEXT(XG88,L
13、*0.96,反),COLOR00FFFF;X01:=REF(C,1)/HHV(H,21)C;X02:=COUNT(DOWN1,9)=6;X03:=ABS(C-O)/C0.025;XG0:=X01 AND X03 AND X04;DRAWTEXT(XG0,L*0.97,星),COLOR00FFFF;S1:=REF(C,1)/LLV(L,W)1.30;S2:=(H-MAX(C,O)/(H-L)0.60;S3:=ABS(C-O)/C0.05 AND C0.05 AND CO;SAL3:=S1 AND ABS(C-O)/C0.67 AND CO AND S3;SAL:=SAL1 OR SAL2 OR
14、SAL3 OR SAL4 OR SAL5;LC:=REF(CLOSE,1);RSI:=SMA(MAX(CLOSE-LC,0),4.1,1)/SMA(ABS(CLOSE-LC),4.1,1)*100;黄买:=FILTER(REF(CLOSE,2)CLOSE AND RSICLOSE AND RSI80),7);红买:=FILTER(CROSS(RSI,11),7);红卖:=FILTER(CROSS(89,RSI),7);绿买:=FILTER(CROSS(RSI,20),7);绿卖:=FILTER(CROSS(80,RSI),7);SL1:=红卖 AND 绿卖;SL2:=红卖 AND 绿卖 AND
15、 黄卖;BU:=红买 AND 绿买;SS1:=CROSS(MA(C,5),C);SS2:=(REF(C,1)-C)/REF(C,1)0.04;SS3:=O 0) AND (LOW = 短期底部) AND (WINNER(CLOSE) 0.13),7);图公式2代码PJJ:=DMA(H + L + C * 2) / 4,0.9);JJ:=REF(EMA(PJJ,3),1);QJJ:=VOL / (H - L) * 2 - ABS(C - O);XVL:=IF(C O,QJJ * (H - L),IF(C O,0 - QJJ * (H - C + (O - L),IF(C DEA AND 趋势线R
16、EF(趋势线,1),HHV(H,5)*1.05,LLV(L,5)*0.95,4,0),COLOR781836;DRAWKLINE(H,O,L,C); V1:=ABS(2*CLOSE+HIGH+LOW)/4-MA(CLOSE,20)/MA(CLOSE,20);V2:=(1-7/100)*(DMA(CLOSE,V1);V3:=(1+7/100)*(DMA(CLOSE,V1);V5:=MA(LOW+HIGH+CLOSE)/3,5);支撑:REFDATE(V2,DATE),POINTDOT,LINETHICK3,COLORCC66FF;阻力:REFDATE(V3,DATE),POINTDOT,LINE
17、THICK3,COLORGREEN;VAR1:=CLOSEREF(CLOSE,1) AND CLOSEREF(CLOSE,2);VAR2:=REF(VAR1,1) AND CLOSE=REF(CLOSE,2);VAR3:=REF(VAR2,1) AND CLOSE=REF(CLOSE,1) AND CLOSE=REF(CLOSE,2);VAR4:=REF(VAR3,1) AND CLOSE=REF(CLOSE,2);VAR5:=REF(VAR4,1) AND CLOSE=REF(CLOSE,1) AND CLOSE=REF(CLOSE,2);VAR6:=REF(VAR5,1) AND CLOS
18、E=REF(CLOSE,2);VAR7:=REF(VAR6,1) AND CLOSE=REF(CLOSE,1) AND CLOSE=REF(CLOSE,2);VAR8:=REF(VAR7,1) AND CLOSE=REF(CLOSE,2);VAR9:=REF(VAR8,1) AND CLOSE=REF(CLOSE,1) AND CLOSE=REF(CLOSE,2);VARA:=REF(VAR9,1) AND CLOSE=REF(CLOSE,2);VARB:=REF(VARA,1) AND CLOSE=REF(CLOSE,1) AND CLOSE=REF(CLOSE,2);VARC:=REF(V
19、ARB,1) AND CLOSE=REF(CLOSE,2);VARD:=CLOSEREF(CLOSE,1) AND CLOSE=REF(CLOSE,1) AND CLOSE=REF(CLOSE,2);VARF:=REF(VARE,1) AND CLOSE=REF(CLOSE,2);VAR10:=REF(VARF,1) AND CLOSE=REF(CLOSE,1) AND CLOSE=REF(CLOSE,2);VAR11:=REF(VAR10,1) AND CLOSE=REF(CLOSE,2);VAR12:=REF(VAR11,1) AND CLOSE=REF(CLOSE,1) AND CLOS
20、E=REF(CLOSE,2);VAR13:=REF(VAR12,1) AND CLOSE=REF(CLOSE,2);VAR14:=REF(VAR13,1) AND CLOSE=REF(CLOSE,1) AND CLOSE=REF(CLOSE,2);VAR15:=REF(VAR14,1) AND CLOSE=REF(CLOSE,2);VAR16:=REF(VAR15,1) AND CLOSE=REF(CLOSE,1) AND CLOSE=REF(CLOSE,2);VAR17:=REF(VAR16,1) AND CLOSE=REF(CLOSE,2);VAR18:=REF(VAR17,1) AND
21、CLOSE=REF(CLOSE,1) AND CLOSE30 AND MA5REF(MA5,1), MA5,DRAWNULL),LINETHICK1,COLORRED;BB10:=ATAN(MA10/REF(MA10,1)-1)*100)*180/3.1416;IF(BB50 AND MA5REF(MA5,1), MA5,DRAWNULL),LINETHICK1,COLORGREEN;DD5:=MA5REF(MA5,1);IF(DD5,MA5,DRAWNULL),COLOR00FF00;X0:=(3*C+L+O+H)/6;多空线: (20*X0+19*REF(X0,1)+18*REF(X0,2
22、)+17*REF(X0,3)+16*REF(X0,4)+15*REF(X0,5)+14*REF(X0,6)+13*REF(X0,7)+12*REF(X0,8)+11*REF(X0,9)+10*REF(X0,10)+9*REF(X0,11)+8*REF(X0,12)+7*REF(X0,13)+6*REF(X0,14)+5*REF(X0,15)+4*REF(X0,16)+3*REF(X0,17)+2*REF(X0,18)+REF(X0,20)/210,COLORFF00FF,LINETHICK1;用法:黄托底买进,绿压顶买出。DD:=多空线多空线);IF(A,多空线,DRAWNULL),COLOR
23、YELLOW,POINTDOT;A1:=(MA5多空线);IF(A1,多空线,DRAWNULL),COLORWHITE;A2:=3*EMA(C-LLV(L,30)/(HHV(H,30)-LLV(L,30)*100,5)-2*EMA(C-LLV(L,30)/(HHV(H,30)-LLV(L,30)*100,5);A4:=(HHV(H,34)-C)/(HHV(H,34)-LLV(L,34)*100;A5:=EMA(CLOSE,12)-EMA(CLOSE,26);A6:=EMA(A5,9);A7:=(A5A6);财神:IF(A7,LLV(L,21),DRAWNULL)COLORRED,CIRCLED
24、OT;CYS:=(EMA(CLOSE-V2)/V2,1)*100);AA0:=CYS;MIDD:=MA(CYS,20);CC0:=MIDD+0.85*STD(CYS,10);TM6:=AA0CC0;IF(TM6,MA5,DRAWNULL),COLORRED,LINETHICK1;A0:=(L+H+C*2)/4;工作:=EMA(A0,14)COLORYELLOW,LINETHICK1;度假:=EMA(A0,25)COLORYELLOW,LINETHICK1;A1X:=(工作-REF(工作,1)/REF(工作,1)*100;A2X:=(度假-REF(度假,1)/REF(度假,1)*100;G:=B
25、ARSLAST(CROSS(A1X,0);KDJRSV:=(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;金叉:=CROSS(J,D);死叉:=CROSS(D,J);买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:=(金叉 AND VAR4) OR (
26、金叉 AND VAR2) OR (金叉 AND VAR11);涨停STICKLINE(CLOSEREF(CLOSE,1)*1.0985 AND CLOSE=HIGH,CLOSE,OPEN,4,-1),COLOR00FFFF;跌停STICKLINE(CLOSE=CLOSE,CLOSE,OPEN,3,0),COLORFF7700;STICKLINE(OPEN=CLOSE,CLOSE,OPEN,2.2,0),COLORFF9900;STICKLINE(OPEN=CLOSE,CLOSE,OPEN,1.5,0),COLORFFBB00;STICKLINE(OPEN=CLOSE,CLOSE,OPEN,0.
27、5,0),COLORCYAN;红STICKLINE(CLOSEOPEN,CLOSE,OPEN,3,0),COLOR000099;STICKLINE(CLOSEOPEN,CLOSE,OPEN,2.2,0),COLOR0000CC;STICKLINE(CLOSEOPEN,CLOSE,OPEN,1.5,0),COLOR0000FF;STICKLINE(CLOSEOPEN,CLOSE,OPEN,0.5,0),COLORCC66FF;绿STICKLINE(VAR3,OPEN,(OPEN+CLOSE)/2,3,0),COLOR009900;STICKLINE(VAR3,OPEN,(OPEN+CLOSE)/
28、2,2.2,0),COLOR00BB00;STICKLINE(VAR3,OPEN,(OPEN+CLOSE)/2,1.5,0),COLOR00DD00;STICKLINE(VAR3,OPEN,(OPEN+CLOSE)/2,0.5,0),COLOR00FF00;灰 STICKLINE(VAR4,OPEN,(OPEN+CLOSE)/2,3,0),COLOR999999;STICKLINE(VAR4,OPEN,(OPEN+CLOSE)/2,2.2,0),COLORBBBBBB;STICKLINE(VAR4,OPEN,(OPEN+CLOSE)/2,1.5,0),COLORDDDDDD;STICKLINE
29、(VAR4,OPEN,(OPEN+CLOSE)/2,0.5,0),COLORFFFFFF;STICKLINE(金叉,OPEN,CLOSE,0.5,0),COLORYELLOW;STICKLINE(死叉,OPEN,CLOSE,0.5,0),COLOR000099;DRAWICON(VAR16,LOW-0.02,7);DRAWICON(买1 OR 买2 OR 买3 OR 买4 OR 买5,LOW-0.01,1);DRAWICON(死叉 OR VAR12 OR CROSS(40,VAR9),HIGH+0.01,2);STICKLINE(CROSS(A1X,0),C,O,1,0)COLORFFFFFF
30、;STICKLINE(CROSS(0,A1X),C,O,1,0)COLORGREEN;AX:=XMA(C,3);DRAWICON(H/AX1.05,H*1.01,2);N1:=6;AA:=REF(H,N1)=HHV(H,2*N1+1); AA1:=REF(L,N1)=LLV(L,2*N1+1);QY:=BACKSET(AA,N1+1); QY1:=BACKSET(AA1,N1+1);CC:=FILTER(QY,N1) AND H=HHV(H,N1+1); CC1:=FILTER(QY1,N1) AND L=LLV(L,N1+1);DDD:=BARSLAST(CC); DD1:=BARSLAST
31、(CC1);GDTS:=IF(CC,CURRBARSCOUNT,0); DDTS:=IF(CC1,CURRBARSCOUNT,0);DINGBUTS:=IF(DDD,REF(GDTS,DDD),GDTS); DDTS1:=IF(DD1,REF(DDTS,DD1),DDTS);GDCS1:=CONST(DINGBUTS); DDCS1:=CONST(DDTS1);GDCS13:=CONST(REF(HIGH,GDCS1-1); DDCS13:=CONST(REF(L,DDCS1-1);DINGBUTS1:=REF(DINGBUTS,DDD+1); DDTS2:=REF(DDTS1,DD1+1);
32、GDCS2:=CONST(DINGBUTS1); DDCS2:=CONST(DDTS2);GDCS23:=CONST(REF(HIGH,DINGBUTS1-1); DDCS23:=CONST(REF(L,DDTS2-1);XG1:=BACKSET(ISLASTBAR,GDCS1); XD1:=BACKSET(ISLASTBAR,DDCS1);XG2:=BACKSET(ISLASTBAR,DINGBUTS1); XD2:=BACKSET(ISLASTBAR,DDTS2);XDD:=IF(DDCS13=DDCS23,XD1,XD2);M:=INTPART(3*N1/5);AAA:=REF(H,M)
33、=HHV(H,2*M+1);QYY:=BACKSET(AAA,M+1);CCC:=FILTER(QYY,M) AND H=HHV(H,M+1);DDDD:=BARSLAST(CCC),NODRAW;GDTSS:=IF(CCC,CURRBARSCOUNT,0);DINGBUTSS:=IF(DDDD,REF(GDTSS,DDDD),GDTSS);GDCS11:=CONST(DINGBUTSS);DINGBUTS11:=REF(DINGBUTSS,DDDD+1);GDCS22:=CONST(DINGBUTS11);AA11:=REF(L,M)=LLV(L,2*M+1);QY11:=BACKSET(AA11,M+1);CC11:=FILTER(QY11,M) AND L=LLV(L,M+1);DD11:=BARSLAST(CC11);DDTSS:=IF(CC11,CURRBARSCOUNT,0);DDTS11:=IF(DD11,REF(DDTSS,DD11),DDTSS);DDCS11:=CONST(DDTS11);DDTS22:=REF(DDTS11,DD11+1);DDCS22:=CONST(DDTS22);HH1:= REF(H,GDCS1-1),
限制150内