通达信指标公式源码 MACD反身向上副图选股预警源码

合集下载

通达信综合分析判断副图指标公式源码

通达信综合分析判断副图指标公式源码

通达信综合分析判断副图指标公式源码注意:=SMA(ABS(L-REF(L,1)),3,1)/SMA(MAX(L-REF(L,1),0),3,1)*100;启动:=EMA(IF(L<=LLV(L,55),(EMA(IF(C*1.35,注意*10,注意/10),3)+HHV(EMA(IF(C*1.35,注意*10,注意/10),3),0)*2)/2,0),3)/618;DIFF:=EMA((C+L)/2,3)-EMA((C+L)/2,5);STICKLINE(IF(启动>5,12,启动)/3*5>0 AND (DIFF+1.9>EMA(DIFF+1.9,11)),40,IF(启动>5,12,启动)/3*5+40,1,0),LINETHICK2,COLORFF00FF;快线: (((C+L)/2-LLV(L,19))/(HHV(H,19)-LLV(L,19))*100)+20,COLORFFFFFF;慢线:=(((C+L)/2-LLV(L,68))/(HHV(H,68)-LLV(L,68))*100)+20;分析趋势:STICKLINE(慢线>82.8,108,103,2,1),COLORRED;{注意信号:STICKLINE(慢线<22.8,-1.5,-4,2,0),COLORRED;}综合判断:STICKLINE(快线>82.8,105,103,2,0),COLORFF00FF;{控制风险:STICKLINE(快线<24.8,-9,-5,2,1),COLORFF00FF;}STICKLINE(((MA(((C+L)/2-LLV(L,250))/(HHV(H,250)-LLV(L,250))*100,1)+20)*1.08)>96,110,108,2,0),COLORRED;STICKLINE(((MA(((C+L)/2-LLV(L,250))/(HHV(H,250)-LLV(L,250))*100,1)+20)*1.08)<22.8,-10.5,-14,2,0),COLORRED;防线:EMA(((2*C+H+L)/4-LLV(L,31))/(HHV((H+C)/2,21)-LLV(L,31))*100,8),CIRCLEDOT,LINETHICK2,COLOR000099;均线:SMA(防线,4,1),COLOR009900;中:=100-3*SMA(((C+L)/2-LLV(L,120))/(HHV((H+C)/2,120)-LLV(L,120))*100,29,1)+2*SMA(SMA(((C+L)/2-LLV(L,120))/(HHV((H+C)/2,120)-LLV(L,120))*100,29,1),62,1);线:=中>IF(中>REF(中,1),中,中-5) AND EMA(((C+L)/2-LLV(L,3))/(HHV((H+C)/2,3)-LLV(L,3))*100,11)>=REF(EMA(((C+L)/2-LLV(L,3))/(HHV((H+C)/2,3)-LLV(L,3))*100,11),1);趋:=MIN((C+L)/2,(MAX((C+L)/2,MAX((C+L)/2,EMA((C+L)/2,1 6)))));势:=EMA(3*(H+L+C)/3-2*SMA((H+L+C)/3,2,1),14);CHAGULA:SMA(MAX(CLOSE-C,0),7,1)/SMA(ABS(CLOSE-C),7,1)*100,NODRAW;STICKLINE((IF((L+C+(H+C)/2)/3>势,(L+C+(H+C)/2)/3,势))>(REVERSE(IF((L+C+(H+C)/2)/3>势,(L+C+(H+C)/2)/3,势))+2*势),-28,-8,2,1),COLOR9933FF;STICKLINE((中>IF(中>REF(中,1),中,中-3)) AND (趋=(MAX((C+L)/2,MAX((C+L)/2,EMA((C+L)/2,16))))),-28,-8,2,1),COLORYELLOW;STICKLINE(线AND (趋>=REF(趋,1) AND 趋=(MAX((C+L)/2,MAX((C+L)/2,EMA((C+L)/2,16))))),-28,-8,2,1),COLORRED;STICKLINE(((EMA((C+L)/2,8)-EMA((C+L)/2,89))*100)<(-50) AND (((C+L)/2-REF((C+L)/2,1))/(REF((C+L)/2,1)))*(100)>2.28,-28,-8,2,1),COLOR008800;VAR1:=SMA(ABS(L-REF(L,1)),13,1)/SMA(MAX(L-REF(L,1),0),13,1)*100;VAR2:=(EMA(IF(L<=LLV(L,34),(EMA(IF(C*1.2,VAR1*13,VAR1/ 13),13)+HHV(EMA(IF(C*1.2,VAR1*13,VAR1/13),13),34)*2)/2,0),3)/ 618*IF(LLV(L,56),1,0));VAR3:=SMA(MAX((H+L+O+2*C)/5-REF((H+L+O+2*C)/5,1),0),10,1)/SMA(ABS((H+L+O+2*C)/5-REF((H+L+O+2*C)/5,1)),10,1)*100;VAR4:=IF(COUNT(VAR3<20,5)>=1 AND COUNT((H+L+O+2*C)/5=LLV((H+L+O+2*C)/5,10),10)>=1 AND C>=O*1.038 AND VOL>MA(VOL,5)*1.2,1,0);DRAWTEXT(VAR4 AND 防线<30,均线,'进?'),LINETHICK2,COLORYELLOW;买?:=REF(MA(L,2)*0.96,1)<MA(LOW,26)*0.85 AND REF(MA(L,2)*0.96,1)<MA(L,2)*0.96 AND REF(MA(L,2)*0.96,1)<REF(MA(L,2)*0.96,2);{DRAWICON(买?,-8,1);}DRAWTEXT(买?,-19,'买?'),COLORFFFFFF;心:=((H+C)/2+L+(C+L)/2)/3;中1:=EMA((心-EMA(LLV(心,47),2))/(EMA(HHV(心,21),2)-EMA(LLV(心,47),2)),2)*90;有:=IF(CROSS(-1.8,中1),7,-7),COLORYELLOW;DRAWTEXT((CROSS(-3,中1)),3,'3天内'),COLORFFFFFF;数:=EMA((C-LLV(L,30))/(HHV(H,30)-LLV(L,30))*100,5)/8*10;DRAWTEXT(CROSS(5,数),-7,'底部'),COLORYELLOW;。

通达信指标公式源码好厉害的MACD背离(通达信副图指标)

通达信指标公式源码好厉害的MACD背离(通达信副图指标)

好厉害的MACD背离(通达信副图指标)DIF:EMA(CLOSE,12)-EMA(CLOSE,26),COLORRED,LINETHICK2;DEA:EMA(DIF,9),COLORWHITE,LINETHICK2;持仓段:=0,COLOR00CFFF;空仓段:=0,COLORFFCCFF;STICKLINE(DIF>DEA,-0.5,-0.6,10,1),COLOR00CFFF;STICKLINE(DIF<DEA,-0.5,-0.6,10,1),COLORFFCCFF;MACD:(DIF-DEA)*2,COLORSTICK;STICKLINE(((MACD<REF(MACD,1)) AND(MACD>0)),0,MACD,1,0),COLORLIBLUE,LINETHICK2;STICKLINE(((MACD>REF(MACD,1)) AND(MACD<0)),0,MACD,1,0),COLORFF00FF,LINETHICK2;建仓:IF(DIF<0,DIF,0),COLORYELLOW,LINETHICK2;加仓:IF(DIF<0,0,DIF),COLORRED,LINETHICK2;白线破仓:IF(DIF<DEA,DIF,DEA),COLORWHITE,LINETHICK2;趋势强弱:IF(DIF>DEA,DEA,DEA),COLORFF937F,LINETHICK2;AA:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));二次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(AA=2,21)=1; DRAWTEXT(二次金叉,0.2,' 二次金叉'),COLORYELLOW;A1:=BARSLAST(REF(CROSS(DIF,DEA),1));底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA); STICKLINE(底背离,0,0.03,6,0),COLOR00FF00;底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK4; DRAWTEXT(底背离,0.12,' 底背离'),COLORFF00FF;A2:=BARSLAST(REF(CROSS(DEA,DIF),1));顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF AND CROSS(DEA,DIF); 顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK4;。

通达信软件指标公式源码常用的MACD三次背离副图指标通达信源码.docx

通达信软件指标公式源码常用的MACD三次背离副图指标通达信源码.docx

常用的MACD三次背离副图指标通达信源码自己常用的MACD,严重底背离红柱子和底背离绿柱子,三次背离底部划线等, 主要看图比较清晰!DIFIF1:(EMA(CLOSE,12) - EMA(CLOSE,26))*100/EMA(CLOSE Z26); DEAEA1:EMA(DIFIF1,9);MACD1:=2*(DIFIF1-DEAEA1),STICK;MACD2:=EMA(MACD1,3);STICKLINE(MACD 1 >MACD2 AND MACD1>0,0,MACD1,3,0),COLORRED; STICKLINE(MACD 1 >MACD2 AND MACD1<O Z O,MACD1,3,0),COLORGREEN; STICKLINE(MACD1<MACD2,0,MACD1Z3,0),COLORCBCBCO;STICKLINE(MACDl>=0 OR MACDl<=O z O z O z50,l)z COLORWHITE;DIFIF1,COLOR33FF33,LINETHICK2;DEAEAl’COLORYELLOW 丄INETHICK2;MACD: MACD1,NODRAW,COLORMAGENTA;强:IF(DIFIF1>=DEAEA1,DIFIF1QRAWNULL),COLORRED 丄INETHICK2;弱:IF(DEAEA1>=DIFIF1Z DEAEA1,DRAWNULL)Z COLORFF9900,LINETHICK2; DRAWICON(CROSS(DIFIF1,DEAEA1),DIFIF1+O.l,l);DRAWICON(CROSS(DEAEA1,DIFIF1),0.4,2);Al:=BARSLAST(REF(CROSS(n MACD. DIF H z n MACD. DEA n)z 1));B1:=REF(C,A1+1)>C AND REF(H MACD.DIF,,,Al+l)<H MACD.DIF n AND CROSS(n MACD.DIF,,,n MACD.DEA n);DRAWTEXT(Bl>0z-0.8;MACD 底背'),COLORFFOOFF;A2:=BARSLAST(REF(CROSS(,,KDJ.K,,/,,KDJ.D,,)Z1));B2:=REF(C,A2+1)>C AND REF(^^KDJ.K^,,A24-1)<^^KDJ.K,, ANDCROSS(,,KDJ.K,,z,,KDJ.D n);DRAWTEXT(B2z-0.6;KDJ 底离'),COLORYELLOW;{KDJ 底背离};A3:=BARSLAST(REF(CROSS(,,RSLRSI1,,Z,,RSI.RSI2,,),1));B3:=REF(C,A3+1)>C AND REF(,,RSLRSIl,,z A3+l)<,,RSI.RSir,AND CROSS(”RSI・RSI1TRSI・RSI2J;DRAWTEXT(B3>0,-0.3z'RSI 底离'),COLORCYAN;{RSI 底背离};C1:=BARSLAST(REF(CROSS(,,MACD.DEA,,/,MACD.DIF,,),1));Dl:=REF(C,Cl+l)vC AND [^=(“1^。

通达信指标公式源码 超前MACD优化版 副图源码

通达信指标公式源码 超前MACD优化版 副图源码

DIFF:EMA(CLOSE,7) - EMA(CLOSE,19);DEA:EMA(DIFF,9);MACD:6*(DIFF-DEA),COLORSTICK;A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));B1:=REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA);A2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));B2:=REF(C,A2+1)>C AND REF("KDJ.K"(9,3,3),A2+1)<"KDJ.K"(9,3,3) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));A3:=BARSLAST(REF(CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));B3:=REF(C,A3+1)>C AND REF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));C1:=BARSLAST(REF(CROSS(DEA,DIFF),1));D1:=REF(C,C1+1)<C AND REF(DIFF,C1+1)>DIFF AND CROSS(DEA,DIFF);C2:=BARSLAST(REF(CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3)),1));D2:=REF(C,C2+1)<C AND REF("KDJ.K"(9,3,3),C2+1)>"KDJ.K"(9,3,3) AND CROSS("KDJ.D"(9,3,3),"KDJ.K"(9,3,3));C3:=BARSLAST(REF(CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24)),1));D3:=REF(C,C3+1)<C AND REF("RSI.RSI1"(6,12,24),C3+1)>"RSI.RSI1"(6,12,24) AND CROSS("RSI.RSI2"(6,12,24),"RSI.RSI1"(6,12,24));MACD底背:IF(B1>0,-0.1,0),COLORRED,POINTDOT;KDJ底背:IF(B2>0,-0.1,0),COLORCC0055,POINTDOT;RSI底背:IF(B3>0,-0.1,0),COLORYELLOW,POINTDOT;MACD顶背:IF(D1>0,0.1,0),COLOR00FF00,POINTDOT;KDJ顶背:IF(D2>0,0.1,0),COLORFFCC66,POINTDOT;RSI顶背:IF(D3>0,0.1,0),COLORWHITE,POINTDOT;STICKLINE(B1>0,-0.2,0,2.5,1),COLORMAGENTA;STICKLINE(B2>0,-0.16,0,3.5,1),COLORCC0066;STICKLINE(B3>0,-0.18,0,5,1),COLORYELLOW;STICKLINE(D1>0,0.2,0,2.5,0),COLOR00FF00;STICKLINE(D2>0,0.18,0,3.5,0),COLORFFCC66;STICKLINE(D3>0,0.16,0,6,0),COLORWHITE;STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,1,1),COLORRED; STICKLINE(MACD<=REF(MACD,1) AND MACD>0,0,MACD,0,1),COLORCYAN; STICKLINE(MACD<REF(MACD,1) AND MACD<0,0,MACD,1,1),COLORGREEN; STICKLINE(MACD>=REF(MACD,1) AND MACD<0,0,MACD,1,1),COLORMAGENTA; STICKLINE(C>0,0,0,50,1),COLORBLUE;DIFF,COLORGREEN;DEA,COLORYELLOW;强:IF(DIFF>MA(DIFF,2),DIFF,DRAWNULL),COLORRED;弱:IF(DEA>MA(DEA,2),DEA,DRAWNULL),COLORMAGENTA;{大盘神针}UAR1:=INDEXA/100000000;UAR2:=INDEXADV;UAR3:=INDEXDEC;UAR4:=UAR2/(UAR2+UAR3);UAR5:=UAR3/(UAR2+UAR3);UAR6:=EMA(UAR4,3);UAR7:=EMA(UAR5,3);UAR8:=EMA(UAR6,5);UAR9:=EMA(UAR7,5);进场资金: EMA(UAR8,10)/150 ;资金: EMA(UAR9,10)/150;大盘神针:=(SMA(MAX(CLOSE-REF(CLOSE,1),0),7,1)/SMA(ABS(CLOSE-REF(CLOSE,3)),7,1)*100< 20ANDSMA(MAX(CLOSE-REF(CLOSE,3),0),13,1)/SMA(ABS(CLOSE-REF(CLOSE,3)),13,1)*100<25 AND MA((LLV(LOW,45)-CLOSE)/(HHV(HIGH,45)-LLV(LOW,45))*100,5)>-19AND (LOW>LLV(LOW,5) AND (CLOSE-HHV(CLOSE,8))/HHV(CLOSE,8)<-0.05 ANDMA(AMOUNT,125)/MA(VOL,125)/(MA(AMOUNT,5)/MA(VOL,5))>1.12))*0.75;买入:=BARSLAST(大盘神针)<15 AND CROSS(MACD.DIF,MACD.DEA);底:=BARSLAST(LLV(L,4)=LLV(L,120))<5 ;均线买:=CROSS(MA(C,5),MA(C,20));买:=(底AND 均线买AND (进场资金>资金) OR 买入);STICKLINE(买,资金-1.35,资金-1.5,2,0),COLORYELLOW;DRAWTEXT(买,资金-1.28,'买'),COLORYELLOW;安全区:STICKLINE(底,资金-0.01,资金,0.04,1),COLORRED;{黄雀}短线趋势:=(EMA(C,7) - EMA(C,13));中线趋势:=EMA(短线趋势,13);VAR4:=MA(C,7);VAR5:=MA(C,13);VAR6:=MA(C,34);VAR7:=MA(C,55);VAR10:=((0 - ((10 * (HHV(C,5) - C)) / (HHV(C,5) - LLV(L,5)))) + 10);VAR11:=((0 - ((10 * (HHV(C,13) - C)) / (HHV(C,13) - LLV(L,13)))) + 10);VAR12:=((0 - ((10 * (HHV(C,21) - C)) / (HHV(C,21) - LLV(L,21)))) + 10);VAR13:=((0 - ((10 * (HHV(C,34) - C)) / (HHV(C,34) - LLV(L,34)))) + 10);VAR14:=REF(中线趋势,1);VAR15:=中线趋势;VAR16:=(VAR15 - VAR14);VAR17:=REF(短线趋势,1);VAR18:=短线趋势;VAR19:=(VAR18 - VAR17);VARE:=(SUM(((C * VOL) * 10),34) / SUM((VOL * 200),34));VARF:=(INTPART((VARE * 10)) / 10);吃货:(((((((O<= VAR4) AND (O<= VAR5)) AND (O<= VAR6)) AND (C>= VAR4)) AND (C>= VARF)) AND (VAR16 > 0)) AND (VAR19 > 0)),LINETHICK0;DRAWBAND (0>吃货,RGB(0,0,0),0<吃货,RGB(200,0,10)),NODRAW;STICKLINE (吃货,-1.75,-1.60,5,1),COLORCC0099;{抄}STICKLINE((DMI.PDI(14,6)<5 AND DMI.ADX(14,6)>70),1.5,-1.5,0,-1),COLORRED; DRAWTEXT (抄,-1.58,'抄'),COLORRED;{一阳二阴}VAR1:=3;VAR2:=((3 * SMA((((CLOSE - LLV(LOW,89)) / (HHV(HIGH,89) - LLV(LOW,89))) * 100),5,1))- (2 * SMA(SMA((((CLOSE - LLV(LOW,89)) / (HHV(HIGH,89) - LLV(LOW,89))) * 100),5,1),3,1)));大赚小赔:1.5*IF(CROSS(VAR2,VAR1),-0.89,-1),COLORRED,LINETHICK1;{黄金坑}RR8:=MA(CLOSE,27);RR9:=(CLOSE-RR8)/RR8*100;RRA:=MA(RR9,2);RRB:=BARSLAST(CROSS(-10,RRA)=1);RRD:=RRA<-10 AND RRB>3;黄金坑:0.01*IF(RRD,-300,1),COLORYELLOW,LINETHICK2;{神秘买点}SM01:=MA((2*C+H+L)/4,5);SM02:=SM01*(200-102)/100;SM03:=(1-7/100)*DMA(C,ABS((2*C+H+L)/4-MA(C,20))/MA(C,20));SM04:=(C-LLV(L,9))/(HHV(H,9)-LLV(L,9))*100;SM05:=3*SMA(SM04,3,1)-2*SMA(SMA(SM04,3,1),3,1);SM06:=((H+L+C)/3-MA((H+L+C)/3,14))/(0.015*AVEDEV((H+L+C)/3,14));SM07:=SM02<SM03&&SM05>REF(SM05,1)&&REF(SM05,1)<REF(SM05,2)&&SM06<-100 &&SM06>REF(SM06,1);神秘买点:IF(SM07*0.35,-1.3,-1.5),COLORCC0099,LINETHICK1;{止盈}转折周期:=7;转折灵敏:=50;TTR:=SMA(MAX(MAX(HIGH-LOW,ABS(HIGH-REF(CLOSE,1))),ABS(LOW-REF(CLOSE,1))),转折周期,1);HD:=HIGH-REF(HIGH,1);LD:=REF(LOW,1)-LOW;DMP:=SMA(IF(HD>0 AND HD>LD,HD,0),转折周期,1);DMM:=SMA(IF(LD>0 AND LD>HD,LD,0),转折周期,1);正DI:=DMP*100/TTR,COLORRED;负DI:=DMM*100/TTR,COLORGREEN;转折点:SMA(ABS(负DI-正DI)/(负DI+正DI)*100,转折周期,1),NODRAW;转折点A:=FILTER(转折点<REF(转折点,1)-1.3 AND EVERY(REF(转折点,1)>=REF(转折点,2)-1.3,5) AND REF(转折点,1)>转折灵敏,5);STICKLINE(转折点A AND REF(正DI>负DI,1),1.5,-1.5,0,-1),COLORGREEN; DRAWTEXT (转折点A AND REF(正DI>负DI,1),1.45,'止'),COLORGREEN;顶:1.5*IF(LAST(MA(C,5)>MA(C,10),5,0) AND "I"<REF("I",1) AND CROSS(100,"I"),0.9,1),COLORWHITE;N:=38;N1:=5;N2:=13;WAR1:=(CLOSE-LLV(LOW,60))/(HHV(HIGH,60)-LLV(LOW,60))*80;X: SMA(WAR1,7,1),LINETHICK1,NODRAW;WAR2:=SMA(X,5,1);Y: IF(CROSS(X,WAR2) AND CROSS(MA(C,N1),MA(C,N2) AND X>50) ,WAR2*2,WAR2),COLORYELLOW,NODRAW;WAR4:= EMA(CLOSE,8);WAR5:= EMA(CLOSE,20);黑码上山:IF(CROSS(MA(CLOSE,1),MA(CLOSE,N)) AND X-Y>2 AND WAR4>WAR5 ,WAR2*2,WAR2),COLOR00FF00,NODRAW;入:=(CROSS(MA(CLOSE,1),MA(CLOSE,N)) AND X-Y>2 AND WAR4>WAR5 );排序:IF(入>0,2,0), STICK,COLORCC0099;DRAWICON(排序>0,2,1);STICKLINE(X>WAR2,X,Y,0,0), , COLORF00FF0,NODRAW;STICKLINE(X<WAR2,X,WAR2,0,0), ,COLOR00FF00,NODRAW ;。

通达信指标公式源码 MACD主图 主图源码

通达信指标公式源码 MACD主图 主图源码

{色MACD主图}高1:=REF(HHV(H,150),3);低1:=REF(LLV(L,150),3);H3:=高1-(高1-低1)*0.5;中轴:REFDATE(H3,DATE),POINTDOT,COLORLIGRAY,LINETHICK3;B1:=EMA(C,12);B2:=EMA(C,26);B3:=B1-B2;WDIF:EMA(EMA(EMA(C,3),3),3)+B3,COLORRED,LINETHICK2;WDEA:EMA(WDIF,9),COLORGREEN,LINETHICK2;MACD:2*(WDIF-WDEA),NODRAW ;STICKLINE(MACD>0,中轴,中轴+MACD,0,1),COLORRED;STICKLINE(MACD<0,中轴,中轴+MACD,0,1),COLORLIBLUE;STICKLINE(MACD<REF(MACD,1)AND MACD>0,中轴,中轴+MACD,0,0 ),COLOR00BBFF;STICKLINE(MACD>=REF(MACD,1)AND MACD>0,中轴,中轴+MACD,0,0 ),COLOR0011BB;STICKLINE(MACD>REF(MACD,1)AND MACD<0,中轴,中轴+MACD,0,0),COLORBB11BB;STICKLINE(MACD<=REF(MACD,1)AND MACD<0,中轴,中轴+MACD,0,0),COLORFFBB11;{量价异动}短线:MA(C,5),NODRAW;中线:((MA(CLOSE,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24))/4+EXPMA( CLOSE,10))/2,NODRAW;密码线:((EMA(C,6)+EMA(C,18)+EMA(C,54)+EMA(C,162))/4+EXPMA(CLOSE,24)+ MA(C,25))/3,NODRAW;神奇线:(MA(C,35)+EXPMA(CLOSE,50))/2,NODRAW;阳涨幅:=4.0;阳倍量:=2.0;单阳收:=C;单阳开:=O;单阳:=单阳收>=REF(C,1)*(1+阳涨幅/100)AND VOL>REF(VOL,1)*阳倍量; DRAWTEXT(CURRBARSCOUNT<100 AND 单阳,L*0.98,'准备'),COLOR00FFFF; 高不破价:=REF(C,BARSLAST(单阳));低不破价:=REF(L,BARSLAST(单阳));F1:=C/REF(C,1)>1.098;强势:=COUNT(单阳,5) AND C>高不破价*0.98;A111:=REF(C/REF(C,1),BARSLAST(单阳));主升浪:=强势>0 AND C/REF(C,1)>A111 AND C>MA(C,60) ;JCCOUNT:=COUNT(单阳,11);上升中继:=单阳AND COUNT(JCCOUNT=2,11);DRAWTEXT(上升中继>0 ,L*0.9,'高度关注'),COLOR00FFFF;主升浪1:=上升中继AND F1;DRAWTEXT(主升浪>0 ,L*0.98,'主升浪'),COLOR00FFFF;拉升:=COUNT(单阳,4) AND O/REF(C,1)>1.017 AND C>=O AND C>MA(C,60) ; DRAWTEXT(拉升>0 ,L*0.9,'拉升'),COLOR00FFFF;单阳不破:=CURRBARSCOUNT<100 AND BARSLAST(单阳)<11 AND(LLV(L,BARSLAST(单阳))>低不破价OR LLV(L,BARSLAST(单阳))=低不破价); {金叉共振}市场成本:DMA(AMOUNT/V/100,V/CAPITAL),COLORRED,NODRAW; DRAWICON(CROSS(C,市场成本),L-0.20,1);{1号图标显示红脸} {PARTLINE(市场成本,市场成本>REF(市场成本,1),RGB(255,0,0),NOT(市场成本<REF(市场成本,1)),RGB(0,0,255),1,RGB(0,0,255)),LINETHICK2;}DIFF:=EMA(CLOSE,2) - EMA(CLOSE,60);DEA:=EMA(DIFF,8);A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));B01:=REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA); A2:=BARSLAST(REF(CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),1));B02:=REF(C,A2+1)>C AND REF("KDJ.K"(9,3,3),A2+1)<"KDJ.K"(9,3,3) AND CROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3));A3:=BARSLAST(REF(CROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24)),1));B03:=REF(C,A3+1)>C ANDREF("RSI.RSI1"(6,12,24),A3+1)<"RSI.RSI1"(6,12,24) ANDCROSS("RSI.RSI1"(6,12,24),"RSI.RSI2"(6,12,24));DRAWICON(B01>0,L-0.20,5);DRAWTEXT(B01,L-0.30,'MACD底背'),COLORWHITE;DRAWICON(B02>0,L-0.20,4);DRAWTEXT(B02,L-0.30,'KDJ底背'),COLORFF00FF;DRAWICON(B03>0,L-0.20,3);DRAWTEXT(B03,L-0.30,'RSI底背'),COLORYELLOW;DRAWICON(CROSS(DIFF,DEA) ANDCROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),L-0.20,6);DRAWTEXT(CROSS(DIFF,DEA) ANDCROSS("KDJ.K"(9,3,3),"KDJ.D"(9,3,3)),L-0.30,'金叉共振'),COLOR0099FF; STICKLINE(C/REF(C,1)>1.095,C,O,2,0),COLORYELLOW;{F10}DRAWTEXT_FIX(1,0.7,0,0,'所属板块:'),COLORFF6000;DRAWTEXT_FIX(1,0.77,0,0,HYBLOCK),COLORRED;DRAWTEXT_FIX(1,0.835,0,0,DYBLOCK),COLORYELLOW;总股本:=STRCAT(STRCAT('总股本: ',CON2STR(TOTALCAPITAL/1000000,2)),'亿');流通盘:=STRCAT(STRCAT(' 流通盘: ',CON2STR(CAPITAL/1000000,2)),'亿'); 全流通:=STRCAT(' 全流通:',CON2STR((CAPITAL/1000000)/(TOTALCAPITAL/1000000),2));市值:=STRCAT(STRCAT(' 流通市值: ',CON2STR((CAPITAL/1000000)*C,2)),'亿');上市日期:=STRCAT(' 上市日期: ',CON2STR(FINANCE(42),0));股本市值:=STRCAT('股本市值: ',STRCAT(STRCAT(STRCAT(STRCAT(总股本,流通盘),全流通),市值),上市日期));{}市盈率:=STRCAT('市盈率: ',CON2STR(C/FINANCE(33),2));市销率:=STRCAT(' 市销率: ',CON2STR(C/(FINANCE(20)/FINANCE(1)),2));市净率:=STRCAT(' 市净率: ',CON2STR(C/FINANCE(34),2));净资收益率:=STRCAT(' 净资收益率:',CON2STR(FINANCE(33)/FINANCE(34)*100,2));毛利率:=STRCAT(' 毛利率:',CON2STR((FINANCE(20)-FINANCE(21))/FINANCE(20)*100,2));净利润率:=STRCAT(' 净利润率',CON2STR(FINANCE(30)/FINANCE(20)*100,2));主营利润率:=STRCAT(' 主营利润率',CON2STR(FINANCE(23)/FINANCE(20)*100,2));当前业绩:=STRCAT('当前业绩:',STRCAT(STRCAT(STRCAT(STRCAT(STRCAT(STRCAT(市盈率,市销率),市净率),净资收益率),毛利率),净利润率),主营利润率));{}X1:=(FINANCE(11)-FINANCE(15))/FINANCE(10)*1.2;X2:=(FINANCE(31)+FINANCE(17))/FINANCE(10)*1.4;{盈余公积用资本公积金代替};X3:=FINANCE(23)/FINANCE(10)*3.3;X4:=FINANCE(19)/FINANCE(15)*0.6;{缺长期负债或负债总额}X5:=FINANCE(20)/FINANCE(15)*0.999;Z值:=X1+X2+X3+X4+X5;预警:=IF(Z值<1.2,'重警',IF(Z值>=1.2 AND Z值<2.6,'轻警','无警'));财务预警:=STRCAT('财务预警: ',STRCAT(预警,STRCAT('-Z值: ',CON2STR(Z 值,3))));优质资产率:=STRCAT(' 优质资产率:',CON2STR((FINANCE(19)-FINANCE(22)-FINANCE(27))/FINANCE(19),2));{理论上越大越好但不同行业有不同标准};现金负债比:=STRCAT(' 现金负债比:',CON2STR(FINANCE(25)/FINANCE(15),3));{缺长期负债或负债总额,理论上越大越好但不同行业有不同标准};财务系数:=STRCAT('风险系数: ',STRCAT(STRCAT(财务预警,优质资产率),现金负债比));{}DRAWTEXT_FIX(ISLASTBAR,0.005,0.01,0,财务系数),COLORYELLOW; DRAWTEXT_FIX(ISLASTBAR,0.005,0.06,0,当前业绩),COLORYELLOW; DRAWTEXT_FIX(ISLASTBAR,0.005,0.115,0,股本市值),COLORYELLOW;{止损线}{数据自己爱好调整}STICKLINE(ISLASTBAR,HHV(C,5),HHV(C,5),218,1)COLORBLUE; STICKLINE(ISLASTBAR,HHV(C,5)*0.95,HHV(C,5)*0.95,218,1)COLORRED;。

通达信指标公式源码彩色MACD指标副图源码

通达信指标公式源码彩色MACD指标副图源码

通达信指标公式源码彩色MACD指标副图源码[object Object]彩色MACD指标是一种技术分析指标,用于判断股票或其他金融资产价格的趋势和买卖信号。

它是在传统的MACD指标基础上进行改进,通过在MACD指标的柱状图上添加颜色来增加指标的可读性和直观性。

下面是通达信软件中彩色MACD指标的源码:```python#定义彩色MACD指标函数def Colorful_MACD(ema1, ema2, dea, color1, color2):DIFF = ema1 - ema2DEA = deaMACD=2*(DIFF-DEA)color = [color1 if diff >= 0 else color2 for diff in DIFF]return MACD, DIFF, DEA, color#使用彩色MACD指标函数计算指标数值MACD, DIFF, DEA, color = Colorful_MACD(EMA(CLOSE, 12),EMA(CLOSE, 26), EMA(MACD, 9), COLORRED, COLORGREEN)#绘制彩色MACD指标副图PlotBar(MACD, DIFF, DEA, 0, color, 0, 0, 1, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)```上述代码中,Colorful_MACD函数用于计算彩色MACD指标的数值。

函数的输入参数分别为短期指数移动平均(EMA)和长期EMA的数值,以及MACD的DEA数值。

函数根据DIFF(短期EMA减去长期EMA)的正负来确定颜色,如果DIFF大于等于0,则使用color1(例如COLORRED)作为颜色,否则使用color2(例如COLORGREEN)作为颜色。

函数的输出为MACD、DIFF、DEA和color四个变量。

通达信指标公式源码 macd副图指标,逃顶抄底,买卖利器

通达信指标公式源码 macd副图指标,逃顶抄底,买卖利器

RSV:=(CLOSE-LLV(LOW,11))/(HHV(HIGH,11)-LLV(LOW,11))*100;DIF:EMA(CLOSE,12)-EMA(CLOSE,26);DEA:EMA(DIF,9);MACD:(DIF-DEA)*2,COLORSTICK;DIFF:=EMA(CLOSE,12)-EMA(CLOSE,27);DEA1:=EMA(DIFF,9);MACD1:=2*(DIFF-DEA1),COLORSTICK,LINETHICK2;趋势:=MA(MACD,1);DRAWICON(MACD1>REF(MACD1,1) AND 趋势>0 ,趋势,1);低位金叉:=CROSS(DIF,DEA) AND DIF<-0.1;JCCOUNT:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));二次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;K:=SMA(RSV,3,1);D:=SMA(K,3,1);J:=(3*K-2*D);DRAWTEXT(二次金叉,DEA*1,'低二叉'),COLORYELLOW;周DIF:="MACD.DIF#WEEK"(12,26,9);周DEA:="MACD.DEA#WEEK"(12,26,9);周MACD:="MACD.MACD#WEEK"(12,26,9);DIF周金叉:=CROSS(周DIF,周DEA);DRAWTEXT(DIF周金叉,0,'周叉'),COLORYELLOW;DRAWTEXT(CROSS(周DEA,周DIF),0,'周死'),COLORGREEN;MACD周金叉:=CROSS(周MACD,周DIF) AND 周MACD>=(0-0.05) AND 周MACD<=0.02; VARR:=EMA(EMA(CLOSE,13),13);控盘:=(VARR-REF(VARR,1))/REF(VARR,1)*1000;A10:=CROSS(控盘,0);控盘B:=FILTER(IF(A10,1,0),5);JJ:=DYNAINFO(11);P:=55;S:=8;M1:=3;刘:=(EMA(CLOSE,S)-EMA(CLOSE,P))*10;剑:=EMA(刘,M1);BTJ11:=(C-JJ)/JJ<-0.03;BTJ2:=控盘>REF(控盘,1) AND 控盘<-0.2;BTJ3:=CROSS(刘,剑) AND 刘<-0.3;BTJ811:=FILTER(BTJ11 AND BTJ2 AND BTJ3,13);庄:= BTJ11 AND BTJ2 AND BTJ3;有庄:=FILTER(庄,55),COLORWHITE;DRAWTEXT(BTJ811,-0.2,'★有庄'),COLORYELLOW;DRAWTEXT(CROSS(J,-3),DIF,'出击'),COLORWHITE;A1:=BARSLAST(REF(CROSS(EMA(CLOSE,12)-EMA(CLOSE,26),EMA(EMA(CLOSE,12)-EMA( CLOSE,26),9)),1));底背离:=REF(CLOSE,A1+1)>CLOSE AND EMA(CLOSE,12)-EMA(CLOSE,26)>REF(EMA(CLOSE,12)-EMA(CLOSE,26),A1+1) AND CROSS(EMA(CLOSE,12)-EMA(CLOSE,26),EMA(EMA(CLOSE,12)-EMA(CLOSE,26),9));底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORMAGENTA,LINETHICK2;A2:=BARSLAST(REF(CROSS(EMA(EMA(CLOSE,12)-EMA(CLOSE,26),9),EMA(CLOSE,12)-E MA(CLOSE,26)),1));顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(EMA(CLOSE,12)-EMA(CLOSE,26),A2+1)>EMA(CLOSE,12)-EMA(CLOSE,26) AND CROSS(EMA(EMA(CLOSE,12)-EMA(CLOSE,26),9),EMA(CLOSE,12)-EMA(CLOSE,26));顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK2;。

MACD交易系统通达信指标公式源码

MACD交易系统通达信指标公式源码

MACD交易系统通达信指标公式源码MACD交易系统是一种利用指标MACD(Moving Average Convergence Divergence,移动平均收敛背离指标)进行交易决策的技术分析方法。

该交易系统通过对股票价格趋势进行分析,判断买入和卖出的时机,从而获取利润。

在通达信软件中,可以使用自定义指标公式来实现MACD指标的计算。

以下是通达信的MACD指标公式源码,包含了对MACD指标的计算方法和参数的设定。

```Indicator: MACD信号Parameters:ShortCycle(12);LongCycle(26);DEA(9);PlotType: 2;Plot0: DIFF(ShortCycle, LongCycle);Plot1: DEA(DIFF(ShortCycle, LongCycle), DEA);```上述源码中,`ShortCycle`代表短期EMA周期,`LongCycle`代表长期EMA周期,`DEA`代表DEA周期。

DIFF函数用于计算短期EMA和长期EMA的差值,DEA函数则计算DIFF的DEA值。

在计算MACD指标时,可以根据不同的策略设定不同的参数。

一般来说,较短的EMA周期可以反映较短期的价格变动,而较长的EMA周期可以反映较长期的价格变动。

因此,可以通过调整ShortCycle和LongCycle 的数值,来适应不同的交易策略和市场情况。

在通达信软件中,MACD指标的计算结果会以两条曲线的形式呈现在K 线图上。

DIFF线代表快线,DEA线代表慢线。

当DIFF线向上穿过DEA线时,被视为买入信号;当DIFF线向下穿过DEA线时,被视为卖出信号。

以上就是通达信软件中MACD交易系统的指标公式源码,通过对MACD 指标的计算和参数的设定,可以帮助股票投资者进行交易决策。

在实际操作中,可以根据市场情况和个人策略对参数进行调整,以达到更好的交易效果。

  1. 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
  2. 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
  3. 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
相关文档
最新文档