萬山紅遍公式源碼副圖指標公式[通達信公式]
相關標簽:通達信kd指標公式源碼 、 通達信主圖指標源碼 、 通達信kdj副圖源碼 、 通達信魚身副圖源碼 、 通達信最新副圖源碼 、 通達信公式源碼主圖 、 通達信主圖指標公式 、 通達信四量圖指標源碼 、 通達信圈叉圖指標源碼 、 通達信最好的副圖指標 、 通達信龍虎榜副圖指標 、 通達信分時圖指標公式 、 通達信分時副圖指標 、 通達信副圖全倉指標 、 通達信乖離率指標副圖 、
?
?
原理解析:
?
?來源:程序化99( www.kzuj.com.cn )
源碼:
?
?
高:=CONST(REF(HHV(H,150),3));低:=CONST(REF(LLV(L,150),3));NN:=100;N:=9;LC:=REF(C,1);QC:=REF(C,2);AA:=REF(H,N)=HHV(H,2*N+1);AA1:=REF(L,N)=LLV(L,2*N+1);QY:=BACKSET(AA,N+1);QY1:=BACKSET(AA1,N+1);CC:=FILTER(QY,N) AND H=HHV(H,N+1);CC1:=FILTER(QY1,N) AND L=LLV(L,N+1);DDD:=BARSLAST(CC); DD1:=BARSLAST(CC1);GDTS:=IF(CC,CURRBARSCOUNT,0);DDTS:=IF(CC1,CURRBARSCOUNT,0);UTS:=IF(DDD,REF(GDTS,DDD),GDTS);DDTS1:=IF(DD1,REF(DDTS,DD1),DDTS);GDCS1:=CONST(UTS);DDCS1:=CONST(DDTS1);GDCS13:=CONST(REF(H,GDCS1-1));DDCS13:=CONST(REF(L,DDCS1-1));SS1:=REF(UTS,DDD+1);TS2:=REF(DDTS1,DD1+1);GDCS2:=CONST(SS1);DDCS2:=CONST(TS2);M:=INTPART(3*N/5);AAA:=REF(H,M)=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);TSS:=IF(DDDD,REF(GDTSS,DDDD),GDTSS);GDCS11:=CONST(TSS);TS11:=REF(TSS,DDDD+1);GDCS22:=CONST(TS11);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);ZGD:=HHV(H,60)*1.01.00;ZGD2:=CONST(ZGD);高壓M:=DRAWLINE(CURRBARSCOUNT=GDCS22,H,CURRBARSCOUNT=GDCS11,H,1),COLORRED,LINETHICK1;低撐M:=DRAWLINE(CURRBARSCOUNT=DDCS22,L,CURRBARSCOUNT=DDCS11,L,1) COLORRED,LINETHICK1;高壓1:=DRAWLINE(CURRBARSCOUNT=GDCS2,H,CURRBARSCOUNT=GDCS1,H,1) ,COLORBLUE,LINETHICK1;低撐1:=DRAWLINE(CURRBARSCOUNT=DDCS2,L,CURRBARSCOUNT=DDCS1,L,1),COLORBLUE,LINETHICK1;高點:=CONST(HHV(H,NN));低點:=CONST(LLV(L,NN));DRAWTEXT_FIX(1,0.00,0.00,0,'{背景變色}R1:=C>LC AND C>QC;R2:=REF(R1,1) AND C<=LC AND C>=QC;R3:=REF(R2,1) AND C>=LC AND C<=QC;R4:=REF(R3,1) AND C<=LC AND C>=QC;R5:=REF(R4,1) AND C>=LC AND C<=QC;R6:=REF(R5,1) AND C<=LC AND C>=QC;R7:=REF(R6,1) AND C>=LC AND C<=QC;R8:=REF(R7,1) AND C<=LC AND C>=QC;R9:=REF(R8,1) AND C>=LC AND C<=QC;RA:=REF(R9,1) AND C<=LC AND C>=QC;RB:=REF(RA,1) AND C>=LC AND C<=QC;RC:=REF(RB,1) AND C<=LC AND C>=QC;RD:=C<LC AND C<QC;RE:=REF(RD,1) AND C>=LC AND C<=QC;RF:=REF(RE,1) AND C<=LC AND C>=QC;R10:=REF(RF,1) AND C>=LC AND C<=QC;R11:=REF(R10,1) AND C<=LC AND C>=QC;R12:=REF(R11,1) AND C>=LC AND C<=QC;R13:=REF(R12,1) AND C<=LC AND C>=QC;R14:=REF(R13,1) AND C>=LC AND C<=QC;R15:=REF(R14,1) AND C<=LC AND C>=QC;R16:=REF(R15,1) AND C>=LC AND C<=QC;R17:=REF(R16,1) AND C<=LC AND C>=QC;R18:=REF(R17,1) AND C>=LC AND C<=QC;R19:=REF(RD OR RE OR RF OR R10 OR R11 OR R12 OR R13 OR R14 OR R15 OR R16 OR R17 OR R18,1) AND R1;R1A:=((REF(R1 OR R2 OR R3 OR R4 OR R5 OR R6 OR R7 OR R8 OR R9 OR RA OR RB OR RC,1)) AND RD);VAR3:=IF(C<200 ,MA(COST(80),3),2500),NODRAW;VAR4:=(H+LC)/3;VAR5:=EMA((O+H+L+C)/4,2330);VAR6:=(VAR5 + ((VAR5 * 6) / 100));短買:R19,NODRAW,COLOR00AAAA;離場:R1A,NODRAW,COLORFF7700;持股:R1 OR R2 OR R3 OR R4 OR R5 OR R6 OR R7 OR R8 OR R9 OR RA OR RB OR RC,NODRAW,COLOR8000FF;觀望:RD OR RE OR RF OR R10 OR R11 OR R12 OR R13 OR R14 OR R15 OR R16 OR R17 OR R18,NODRAW,COLOR767628;超跌:=(C-MA(C,34))/MA(C,34)*100<-14,COLORBBBBBB,NODRAW;Q1:=CONST(IF(短買,100,IF(離場,0,IF(持股,100,IF(超跌,150,40))))),NODRAW;Q2:=CONST(IF(短買,100,IF(離場,66,IF(持股,0,IF(超跌,150,118))))),NODRAW;Q3:=CONST(IF(短買,0,IF(離場,132,IF(持股,50,IF(超跌,150,118))))),NODRAW;DRAWBAND(高點,RGB(Q1,Q2,Q3),低點,DRAWNULL);C1:=IF(短買,短買,DRAWNULL),;C2:=IF(離場,離場,DRAWNULL),;{DDE金指 N: 1, 999, 13;}JH:=SMA(MAX(C-REF(C,1),0),6,1)/SMA(ABS(C-REF(C,1)),6,1)*100;SZ:=FILTER(CROSS(JH,35),13);SX:=FILTER(CROSS(JH,30),7);SQ:=FILTER(CROSS(71,JH),74);SD:=FILTER(CROSS(80,JH),74);CCL:=REF(HHV(C,120),1);DD:=REF(LLV(C,120),1);WW:=100*(C-DD)/(CCL-DD);EE:=AMOUNT;FF:=(EMA(EE,5)/REF(EMA(EE,5),5));低買:IF(CAPITAL<1,SZ,SX),COLOR22FFFF,NODRAW;變盤:FILTER(O<REF(L,1) AND C>O AND V>REF(V,1),13),COLORFF88FF,NODRAW;霸占:=FILTER((FF>=2 AND WW<35 AND BARSCOUNT(C)>30 OR (FF>=2 AND WW<100) AND BARSCOUNT(C)<50),90),COLOR0000AA,NODRAW;頂部:=IF(CAPITAL<1,SQ,SD),COLOR00CC00,NODRAW;持股K:C>REF(C,1),COLOR0099FF,NODRAW;持幣K:C<REF(C,1),COLORFFAA00,NODRAW;平盤:=C=REF(C,1),COLOR999999,NODRAW;STICKLINE(持股K,H,L,3,1),COLOR0099FF;STICKLINE(持股K,C,O,1.5,0),COLOR0099FF;STICKLINE(持幣K,H,L,3,1),COLORFF9900;STICKLINE(持幣K,C,O,1.5,0),COLORFF9900;STICKLINE(平盤,H,L,3,1),COLOR999999;STICKLINE(平盤,C,O,1.5,0),COLOR999999;STICKLINE(霸占,H,L,3,1),COLOR0000CC;STICKLINE(霸占,C,O,1.5,0),COLOR0000CC;STICKLINE(變盤,H,L,3,1), COLORFF88FF;STICKLINE(變盤,C,O,1.5,0),COLORFF88FF;STICKLINE(低買,H,L,3,1),COLOR22FFFF;STICKLINE(低買,C,O,1.5,0),COLOR22FFFF;STICKLINE(頂部,H,L,3,1),COLOR00CC00;STICKLINE(頂部,C,O,1.5,0),COLOR00CC00;趨勢線:=3*SMA((C-LLV(L,27))/(HHV(H,27)-LLV(L,27))*100,5,1)-2*SMA(SMA((C-LLV(L,27))/(HHV(H,27)-LLV(L,27))*100,5,1),3,1),COLORBCBC00,NODRAW;ZZ:=趨勢線>REF(趨勢線,1);{阻力支撐}QWX1:=HHV(C,30);QWX2:=LLV(C,30);QWX3:=CONST((QWX1+QWX2)/2);QWX4:=ABS((2*C+H+L)/4-MA(C,20))/MA(C,20);QWX5:=CONST((1-7/100)*(DMA(C,QWX4)));QWX6:=CONST((1+7/100)*(DMA(C,QWX4)));阻力:IF(BARSLAST(CURRBARSCOUNT=12),QWX6,DRAWNULL),COLORFF9D3C,LINETHICK1,CIRCLEDOT;支撐:IF(BARSLAST(CURRBARSCOUNT=12),QWX5,DRAWNULL),COLORFF00FF,LINETHICK1,CIRCLEDOT;{最佳買入選股}RSI5:=(SMA(MAX((C-LC),0),5,1)/SMA(ABS((C-LC)),5,1))*100;TR1:=SUM(MAX(MAX((H-L),ABS(H-REF(C,1))),ABS(L-REF(C,1))),10);HD:=H-REF(H,1);LD:=REF(L,1)-L;DMP:=SUM(IF((HD>0 AND HD>LD),HD,0),10);DMM:=SUM(IF((LD>0 AND LD>HD),LD,0),10);PDI:=DMP*100/TR1;MDI:=DMM*100/TR1;ADX:=MA((ABS((MDI-PDI)/(MDI+PDI))*100),5);AV:=RSI5+ADX;DXR:=(ADX+REF(ADX,5)/2)+RSI5;WR10:=(100*(HHV(H,10)-C))/(HHV(H,10)-LLV(L,10));NEWVOL:=RSI5-WR10;最佳買入:=AV+NEWVOL;J:="KDJ.J";X:=LLV(J,2)=LLV(J,8);買入時機:=(CROSS(J,3));佳選A:=CROSS(最佳買入,0);{DIF綜合抓牛}RSIA:=(SMA(MAX(C-LC,0),6,1)/SMA(ABS(C-LC),6,1)*100)/100;WR:=-100*(HHV(H,14)-C)/(HHV(H,14)-LLV(L,14));反向:=((0-WR)-100)/100,;角度差:=1-(反向/RSI);角度2:=MA(角度差,2);角度4:=MA(角度差,4);角度差A:=角度差>MA(角度差,3)*1.3;轉向:=REF(角度差,1)<REF(角度差,2) AND 角度差>REF(角度差,1) AND REF(角度差,1)<1.06;SS:=COUNT(轉向,4)>0 OR COUNT(角度差A,4)>0;DIF買:=CROSS(角度2,角度4) AND SS,COLOR0088FF;{精準買點}CYC13:=0.01*EXPMA(AMOUNT,13)/EXPMA(V,13);CYS:=(C-CYC13)/CYC13*100;逢低買入:=IF("ZXNH.ZXNH"=1 AND CYS<=-2,0.6,0);抓牛A:=DIF買&&逢低買入;到:=(HHV(H,21)-C)/(HHV(H,21)-LLV(L,21))*100-10;底:=(C-LLV(L,21))/(HHV(H,21)-LLV(L,21))*100;啦:=SMA(底,13,8);哈:=CEILING(SMA(啦,13,8));哈哈:=SMA(到,21,8);差:=哈-哈哈,COLORFFFFFF;RC1:=REF((L+O+C+H)/4,1);RC2:=SMA(ABS(L-RC1),13,1)/SMA(MAX(LOW-RC1,0),10,1);RC3:=EMA(RC2,10);RC4:=LLV(L,33);RC5:=EMA(IF(L<=RC4,RC3,0),3),;建倉:=IF(RC5>REF(RC5,1),RC5,0);洗:=IF(RC5<REF(RC5,1),RC5,0),;啟動A:=FILTER(REF(差,1)<-70 AND 差>REF(差,1) AND (建倉 OR 洗),3);{乖離破底}X3:=(2*C+L+H)/4;地:=EMA(X3,55)*0.84,;乖離5:=(C-MA(C,5))/MA(C,5)*100,NODRAW;乖離A:=FILTER(L<地 AND REF(乖離5,1)<-5 AND 乖離5>REF(乖離5,1),3);趨勢:=7*SMA((C-LLV(L,27))/(HHV(H,27)-LLV(L,27))*30,4,1)-3*SMA(SMA((C-LLV(L,27))/(HHV(H,27)-LLV(L,27))*30,4,1),3,1)-SMA(SMA(SMA((C-LLV(L,27))/(HHV(H,27)-LLV(L,27))*30,4,1),3,1),2,1);天線:=78.89;逃頂:=CROSS(天線,趨勢);低吸A:=CROSS(趨勢,5);{內能線}ZF:=((C-REF(C,1))/REF(C,1))*100;HSL:=(V/CAPITAL)*100;KK:=ZF/HSL,COLOR6000FF;KK5:=MA(KK,5),COLORFFAA00;LL:=LLV(KK,34);內能買A:=CROSS(KK,KK5)&&REF(KK,1)<=LL&&ZZ,;{包賺不賠}止跌:=(REF(EVERY(C<O,2),1) AND C>O);VAR1N:=MA(C,5),;VAR2N:=MA(C,10);VAR3N:=(VAR1N-C)/C>3/100;VAR4N:=(VAR2N-VAR1N)/VAR1N>0.03;VAR5N:=LLV(C,30)=LLV(C,120);底部:=VAR3N AND VAR4N AND VAR5N;包賺A:=BARSLAST(底部)<=2 AND 止跌,COLORFF8800,NODRAW;{深坑挖金}A:=REF(C,1);RSIK:=SMA(MAX(C-A,0),6,1)/SMA(ABS(C-A),6,1)*100;A4:=RSIA<20;ZZF:=(C/REF(C,1)-1)*100;深坑1:=IF(BETWEEN(A4,0,5) AND L<=REF(C,A4)AND ZZF<=-5 ,20,0),COLORFF0000,LINETHICK2;CD:= C>=O AND REF(深坑1 ,1)=20 AND REF(RSI,1)<20 ;深坑A:=C>O AND REF(深坑1 ,1)=20 AND REF(RSI,1)<20;深坑:IF(深坑A,L*1.005,DRAWNULL)COLOR55FF55,CIRCLEDOT,LINETHICK5;佳選:IF(佳選A,L*0.995,DRAWNULL)COLORFF88FF,CIRCLEDOT,LINETHICK4;啟動:IF(啟動A,L*0.99,DRAWNULL)COLORFFFF00,CIRCLEDOT,LINETHICK4;抓牛:IF(抓牛A,L*0.985,DRAWNULL)COLOR0088FF,CIRCLEDOT,LINETHICK4;乖離底:IF(乖離A,L*0.98,DRAWNULL)COLORFFFFFF,CIRCLEDOT,LINETHICK4;內能買:IF(內能買A,L*0.975,DRAWNULL)COLOR0000FF,CIRCLEDOT,LINETHICK4;低吸:IF(低吸A,L*0.97,DRAWNULL)COLOR00FFFF,CIRCLEDOT,LINETHICK4;包賺:IF(包賺A,L*0.965,DRAWNULL)COLORFF00FF,CIRCLEDOT,LINETHICK4;B01:=IF(佳選A,1,0);B02:=IF(啟動A,1,0);B03:=IF(抓牛A,1,0);B04:=IF(乖離A,1,0);B05:=IF(內能買A,1,0);B06:=IF(低吸A,1,0);B07:=IF(包賺A,1,0);B08:=IF(深坑A,1,0);【共振】:B01+B02+B03+B04+B05+B06+B07+B08,COLOR00FFFF,NODRAW;DRAWICON(【共振】>=4,H*1.008,34);持幣線:EMA(C,13),COLOR32E01F,LINETHICK3;持股線:IF(持幣線>REF(持幣線,1),持幣線,DRAWNULL),COLOR460CF3,LINETHICK3;{畫線}IF(BETWEEN(高壓M,高點,低點),高壓M,DRAWNULL),COLOR00CCFF,LINETHICK1;IF(BETWEEN(低撐M,高點,低點),低撐M,DRAWNULL),COLOR00CCFF,LINETHICK1;IF(BETWEEN(高壓1,高點,低點),高壓1,DRAWNULL),COLORCCCCCC,LINETHICK1;IF(BETWEEN(低撐1,高點,低點),低撐1,DRAWNULL),COLORCCCCCC,LINETHICK1;中:=(MA(C,3)+MA(C,6)+MA(C,12)+MA(C,24))/4,COLORFFFFFF;VAR326:=IF(C AND MA(VOL,5)/240 AND C>LC*1.0 AND C,88,0);VAR327:=IF(C/LC>1.050 AND VOL/CAPITAL*100<10 AND C<17 AND H/C<1.010 AND VAR326>0, 91, 0);DRAWTEXT(VAR327>90,L*0.993,'↖殺莊'),COLOR00FFFF;{背離}RSI:=(SMA(MAX((C-LC),0),3,1)/SMA(ABS((C-LC)),3,1))*100;FFF:=EMA(C,3);MA15:=EMA(C,21);頂背:=CROSS(88,RSI);DRAWTEXT(CROSS(FFF,MA15),L,'←底背'),COLORFF88FF;CCI:="CCI";CCI3:=MA(CCI,3);CCI7:=MA(CCI,7);頭:=CROSS(CCI3,CCI) AND (CCI>130);STICKLINE(頭,H*1.005,H*1.01,4,0),COLOR00CC00;DRAWTEXT(頭,H*1.01,'頭'),COLORFFFFFF;STICKLINE(逃頂,H*1.01,H*1.015,4,0),COLORFFFFFF;賣出警報:=(頭 AND 頂背),COLOR0000FF;STICKLINE(賣出警報,H*1.016,H*1.025,4,0),COLOR0000FF;DRAWTEXT(賣出警報,H*1.028,'空倉'),COLORFFFFFF;DRAWICON(頂背,H*1.016,8);DRAWTEXT(頂背,H*1.02,'←頂背'),COLOR98FF75;DRAWTEXT_FIX(1,0.92,0.01,0,STRCAT(STRCAT('【共振】',CON2STR(【共振】,1)),' ')),COLOR00FFFF;
DRAWTEXT_FIX(C>O,0.01,0.9,0,' www.kzuj.com.cn '),COLORRED;
DRAWTEXT_FIX(C>O,1,1,0,'程序化交易模型'),COLORRED;
DRAWTEXT_FIX(C>O,0.01,0.9,0,' www.kzuj.com.cn '),COLORRED;
DRAWTEXT_FIX(C>O,1,1,0,'程序化交易模型'),COLORRED;
DRAWTEXT_FIX(C>O,0.01,0.9,0,' www.kzuj.com.cn '),COLORRED;
DRAWTEXT_FIX(C>O,1,1,0,'程序化交易模型'),COLORRED;
?
?
公式導入教程: 【通達信公式源碼導入方法教程】 【同花順公式源碼導入方法教程】 【大智慧新一代公式源碼導入方法教程】
?
有思路,想編寫各種指標公式,程序化交易模型,選股公式,預警公式的朋友
可聯系技術人員 QQ: 262069696 或微信:cxhjy888 進行 有償收費 編寫!(注:由于人數限制,QQ或微信請選擇方便的一個聯系我們就行,謝謝您!)
相關文章
-
沒有相關內容