通达信指标——MACD优化(副图)
通达信《自在买卖-对MACD再优化》副图指标公式
通达信《自在买卖-对MACD再优化》副图指标公式MACD指标的构造起点是股价的平滑移动平均线EMA,所以,决定了它的强势性与稳定性的特点,同时它克服了均线频繁发出假性信号的缺陷,使得它对中长期趋势的把握准确率较大,深受趋势买家的喜爱。
既然它有无可挑剔的稳定性,那么,它的滞后性也随之而来。
因此,对这个问题的解决方法只有仰仗指标参数的优化来搞定了。
MACD指标一般不适合短线和超短线的股友使用,也不适合在盘整行情下使用。
通常来说,在短线和超短线交易中需要你对股价的短期波动灰常敏感。
而MACD指标的滞后性对股价短期波动太难及时地给予反映,因此,MACD指标就十分不适合短线客操作了。
此外,在盘整行情中,它一般会围绕0轴上下运动,频繁发出金死叉等交易信号,而,这些信号往往大多数均属无效信号DIFF1:EMA(C,13) - EMA(C,34),COLOR00FFFF ;DEA1:EMA(EMA(C,13) - EMA(C,34),12) ;IF(EMA(C,13) - EMA(C,34) >= EMA(EMA(C,13) - EMA(C,34) ,12),EMA(C,13) - EMA(C,34) ,DRAWNULL),COLORRED;IF((EMA(C,13) - EMA(C,34) - EMA(EMA(C,13) - EMA(C,34) ,12) ) * 1000/EMA(C,15) > 0 AND (EMA(C,13) - EMA(C,34) - EMA(EMA(C,13) - EMA(C,34) ,12) ) * 1000/EMA(C,15) < 1.85,EMA(C,13) - EMA(C,34),DRAWNULL),COLORGREEN;IF(EMA(C,13) - EMA(C,34) < EMA(EMA(C,13) - EMA(C,34) ,12) OR EMA(C,13) - EMA(C,34) > EMA(EMA(C,13) - EMA(C,34) ,12) AND REF(EMA(C,13) - EMA(C,34) ,1) < REF(EMA(EMA(C,13) - EMA(C,34) ,12) ,1),EMA(C,13) - EMA(C,34) ,DRAWNULL),COLOR00FF00;DRAWBAND(DIFF1,RGB(64,0,64),DEA1,RGB(57,58,66));DIFF:=EMA(C,13)-EMA(C,21),NODRAW;DEA:=EMA(DIFF,5);MACD:=2*(DIFF-DEA);回吐:IF(DEA>0,DEA,0),COLORFFFFFF,NODRAW;回补:IF(DEA<0,DEA,0),COLOR00FFFF,NODRAW;持币:IF(DIFF<0,DIFF,0),COLORFF0000,NODRAW;持股:IF(DIFF>0,DIFF,0),COLOR0000FF,NODRAW;ZG:=HHVBARS(DIFF,89)+1;HH:REF(DIFF,BARSSINCE(BACKSET(ISLASTBAR,ZG))),COLOR AAAA77,LINETHICK2;ZD:=LLVBARS(DIFF,89)+1;LL:REF(DIFF,BARSSINCE(BACKSET(ISLASTBAR,ZD))),COLORA A77AA,LINETHICK2;DRAWNUMBER(ISLASTBAR,HH+0.03,ZG),COLOR00AA00;DRAWNUMBER(ISLASTBAR,LL+0.05,ZD),COLOR0000AA;DRAWNUMBER(CURRBARSCOUNT=11 AND DIFF,HH+0.03,HH);DRAWNUMBER(CURRBARSCOUNT=11 AND DIFF,LL+0.05,LL);STICKLINE((DEA>0),0,DEA,2.5,0),COLORAAAAAA;STICKLINE((DEA>0),0,DEA,1.8,0),COLORCCCCCC;STICKLINE((DEA>0),0,DEA,1,0),COLORDDDDDD;STICKLINE((DEA>0),0,DEA,0.2,0),COLORFFFFFF;STICKLINE(DEA<0,0,DEA,2.5,0),COLOR0064AA;STICKLINE(DEA<0,0,DEA,1.8,0),COLOR0093CC;STICKLINE(DEA<0,0,DEA,1,0),COLOR00C2DD;STICKLINE(DEA<0,0,DEA,0.2,0),COLOR00FFFF;STICKLINE(DIFF<0,0,DIFF,2.5,0),COLORAA1100;STICKLINE(DIFF<0,0,DIFF,1.8,0),COLORAA3300;STICKLINE(DIFF<0,0,DIFF,1,0),COLORAA5500;STICKLINE(DIFF<0,0,DIFF,0.2,0),COLORAA7700;STICKLINE(DIFF>0,0,DIFF,2.5,0),COLOR0000AA;STICKLINE(DIFF>0,0,DIFF,1.8,0),COLOR0000CC;STICKLINE(DIFF>0,0,DIFF,1,0),COLOR0000DD;STICKLINE(DIFF>0,0,DIFF,0.2,0),COLOR0000FF;DRAWTEXT(REF(DIFF<0 AND DIFF<DEA,1) AND DIFF<0 AND DIFF>DEA ,DEA-0.1,'回'),COLOR00FFFF;DRAWTEXT(REF(DIFF<0 AND DIFF<DEA,1) AND DIFF<0 AND DIFF>DEA ,DEA-0.2,'补'),COLOR00FFFF;DRAWTEXT(CROSS(DIFF>0,0.5) ,DIFF+0.2,'买'),COLOR0000FF;DRAWTEXT(CROSS(DIFF>0,0.5) ,DIFF+0.1,'入'),COLOR0000FF;DRAWTEXT(REF(DIFF>0 AND DIFF>DEA,1) AND DIFF>0 AND DIFF<DEA ,DEA+0.2,'回'),COLORFFFFFF;DRAWTEXT(REF(DIFF>0 AND DIFF>DEA,1) AND DIFF>0 AND DIFF<DEA ,DEA+0.1,'吐'),COLORFFFFFF;DRAWICON(CROSS(EMA(C,13) - EMA(C,34) >= EMA(EMA(C,13) - EMA(C,34) ,12),0.5),EMA(EMA(C,13) - EMA(C,34) ,12) ,5);DRAWICON(CROSS(EMA(EMA(C,13) - EMA(C,34) ,12) >=EMA(C,13) - EMA(C,34) ,0.5),EMA(EMA(C,13) - EMA(C,34) ,12) ,6);。
通达信双重MACD副图公式 源码 支持手机
公式源码:STICKLINE(C>0,0,0,10,0),COLORGRAY;M6:=(EMA(c,5)+EMA(c,6))/2;M12:=EMA(c,12);M26:=EMA(c,26);M56:=ema(C,56);M121:=ema(C,121);xdif:((M6-M121)/2+(M12-M56+M26-M121)/2+M6-M26)/3,COLORWHITE;XDEA:ema(XDIF,3),COLORCYAN;XMACD:=2*(xdif-XDEA),LINETHICK,COLORWHITE;DIF:(M56-M121+(M26-M121)/2+(M12-M121)/3+(M6-M121)/4)/4,COLORMAGENTA; DEA:ema(DIF,9),COLORGREEN;MACD:2*(DIF-DEA),LINETHICK,COLOR00CCCC;BMACD:(MACD+XMACD/2)/2,LINETHICK,COLORRED;STICKLINE(BMACD>=0,0,BMACD,2,1),COLORRED;STICKLINE(BMACD<0,0,BMACD,2,1),COLOR00bb00;STICKLINE(MACD>=0,0,MACD,0,0),COLOR00CCCC;STICKLINE(MACD<0,0,MACD,0,0),COLORCYAN;....通达信电脑版公式导入方法A:源码导入1、把要导入的公式(源码)复制下来:方法是用左键先把源码变蓝,之后点右键,点复制;2、进入主界面,即K线图模式,同时按住CTRL+F,出现公式管理器-->用鼠标左键单击任何一个公式组的名称(选择技术指标公式或者条件选股公式)-->单击其他-->点新建公式-->在出现的公式编辑区的下面的空白处,把刚拷的源码粘贴上,将公式名称复制后粘贴到公式名称栏-->确定-->退出;3.如有参数的,如:N 1 100 15 之类,则需将这类数据填充到参数表中;B:文件指标导入1、先把指标文件复制到桌面(或者你知道的路径);2、打开通达信,按CTRL+F打开公式管理器点击“导入”按钮;3、找到桌面上要导入的公式选中”公式“后单击左键,后点击“打开”;4、把“+”号单击展开,在公式名前的空方框里单击成“勾选”后,在点击下方的“确认”;5、输入指标名称,回车即可。
通达信最强悍的MACD副图指标
通达信最强悍的MACD副图指标UPD:COUNT(C>=O OR C>=REF(C,1),8) NODRAW;CM60:BARSLAST(LONGCROSS(C,MA(C,60),8))+1 NODRAW COLORRED;DIFF:=EMA(CLOSE,12)-EMA(CLOSE,24);DEA:=EMA(DIFF,9);ADIF:ATAN((DIFF/REF(DIFF,1)-1)*100)*180/3.1416 NODRAW;RADIF:REF(ADIF,1) NODRAW;C2:=IF(V>MA(V,150)*0.98,0.1,-0.1);C1:=IF(V<MA(V,150)*0.98,-0.1,0.1);B2:=EMA(CLOSE,55)-MA(CLOSE,60) DOTLINE COLORGREEN;B3:=EMA(B2,9) DOTLINE COLORCYAN;DRAWBAND(B2,RGB(120,50,50),B3,RGB(50,120,50));MACD:=2*(DIFF-DEA), STICK,LINETHICK1 COLORCYAN;N:=20;MID:=MA(C,20);VART1:=POW((C-MID),2);VART2:=MA(VART1,N);VART3:=SQRT(VART2);UPPER:=MID+2*VART3;LOWER:=MID-2*VART3;BOLL:=REF(MID,1),COLORGREEN;UB:=REF(UPPER,1),COLOR00FFFF;LB:=REF(LOWER,1),COLOR00FFFF NODRAW;BLTJ:=REF(L,1)<REF(LB,1) AND L>LB;BLLDT:BARSLAST(BLTJ ) NODRAW;JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));A1:=BARSLAST(REF(CROSS(DIFF,DEA),1)) COLORRED NODRAW;底背离:REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA) NODRAW;STICKLINE(底背离,0,0.03,1.2,1),COLOR00FF00;{底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK2 CROSSDOT;} DRAWTEXT(底背离,0.1,' 底背离'),COLORFF00FF;A2:=BARSLAST(REF(CROSS(DEA,DIFF),1)) ;顶背离:REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF) CROSSDOT COLORRED NODRAW;{顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORBLUE,LINETHICK2 CROSSDOT;}底背D:BARSLAST(底背离)+1 NODRAW COLORRED;顶背D:A2+1 COLORGREEN NODRAW;{判断天地量}AA:=SUMBARS(VOL,CAPITAL);地量:=VOL<MA(VOL,AA)*21/100 AND VOL>0;天量:=VOL>MA(VOL,AA)*34/10 ;MACDA:2*(DIFF-DEA), STICK,LINETHICK1 COLORCYAN;NOTEXT3:IF(地量 AND PERIOD>4,MACD*1.5,DRAWNULL) STICK LINETHICK6 COLORYELLOW;NOTEXT4:IF(天量 AND PERIOD>4,MACD*1.5,DRAWNULL) STICK LINETHICK6 COLORAAAAFF;NOTEXT5:IF(V<=MA(V,5)*0.22,MACD,DRAWNULL) STICK LINETHICK4 COLORBLUE; NOTEXT:IF(REF(MACD,1)<=MACD,MACD,DRAWNULL) STICK COLORRED; NOTEXT1:0 LINETHICK3 COLORGRAY;NOTEXT8:IF(V>MA(V,150)*0.98,0,DRAWNULL) COLORRED LINETHICK2 CIRCLEDOT ;DEAA:DEA COLORYELLOW;DIFA:DIFF COLORWHITE ;DIFF1:EMA(CLOSE,12)-EMA(CLOSE,26) DOTLINE COLORGREEN NODRAW;DEA1:EMA(DIFF1,9) DOTLINE COLORCYAN NODRAW;底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK2 CROSSDOT;顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORBLUE,LINETHICK2 CROSSDOT;强:IF(DIFF>MA(DIFF,2),DIFF,DRAWNULL),COLORRED LINETHICK2;弱:IF(DEA>MA(DEA,2),DEA,DRAWNULL),COLORMAGENTA LINETHICK2;必买: DRAWICON(REF(TROUGHBARS(3,15,1),1)=0 AND HIGH>LOW,0,25),COLORRED,LINETHICK4;必卖: DRAWICON(REF(PEAKBARS(3,15,1),1)=1,0,27),COLORRED,LINETHICK8;B1:A1 NODRAW;TOP:A2 NODRAW;BSR:((BIDORDERVOL-BIDCANCELVOL)/(OFFERORDERVOL-OFFERCANCELVOL)-1)*10 NODRAW;NOTEXTBRS:IF(BSR>0,DEA,DRAWNULL) COLORFFFFFF LINETHICK2 CIRCLEDOT; HSJ:=BARSLAST(CROSS(DIFF,0) AND DIFF>=0 )+1 NODRAW;LSJ:=BARSLAST(CROSS(0,DIFF) AND DIFF<0 )+1 NODRAW;T:IF(DIFF>0,HSJ,LSJ) NODRAW;IF(T=1,ABS(MACD),0) STICK LINETHICK2 COLORMAGENTA;IF(CROSS(DEA,0),ABS(MACD),0) STICK LINETHICK2 COLORYELLOW;S:IF(HSJ>1,SUM(ABS(MACD),T),DRAWNULL) NODRAW ;DRAWNUMBER(ISLASTBAR ,ABS(MACD*1.02),S) COLORYELLOW;DRAWNUMBER(T=1 ,ABS(MACD*1.02),REF(S,1)) ;T2:REF(T,T)+T NODRAW;Q1S:REF(S,T) NODRAW;Q2S:=REF(S,T2) NODRAW;BL:=Q1S/Q2S NODRAW;{E2T:BARSLAST(CROSS(DIF,DEA) AND FILTER(CROSS(DIF,DEA) ,5) )+1 NODRAW;E6T:BARSLAST(CROSS(DEA,DIF) AND FILTER(CROSS(DEA,DIF) ,5) )+1 NODRAW; ET:IF(DIF>=DEA,E2T,E6T) NODRAW;ES:SUM(ABS(DIF-DEA),ET) NODRAW;BZ:=MAX(ABS(DEA),ABS(DIF));XS:=IF(DIF<0,-1,1);IF(ET=1,DIF,DRAWNULL) CIRCLEDOT LINETHICK2;DRAWNUMBER(ISLASTBAR ,DIF*1.05,ES) COLORYELLOW;DRAWNUMBER(ET=1 ,BZ*XS*1.05,REF(ES,1)) COLORYELLOW;};TTJ:=IF(BARSLAST(顶背离=1)+1=144 OR BARSLAST(顶背离=1)+1=89 OR BARSLAST(顶背离=1)+1=13 OR BARSLAST(顶背离=1)+1=47 OR BARSLAST(顶背离=1)+1=1 OR BARSLAST(顶背离=1)+1=8 OR BARSLAST(顶背离=1)+1=21 OR BARSLAST(顶背离=1)+1=34 OR BARSLAST(顶背离=1)+1=55,1,O) ;TTJA:=IF( BARSLAST(底背离=1)+1=144 OR BARSLAST(底背离=1)+1=89 OR BARSLAST(底背离=1)+1=8 OR BARSLAST(底背离=1)+1=1 OR BARSLAST(底背离=1)+1=47 OR BARSLAST(底背离=1)+1=13 OR BARSLAST(底背离=1)+1=21 OR BARSLAST(底背离=1)+1=34 OR BARSLAST(底背离=1)+1=55,1,O) ;DRAWNUMBER((BARSLAST(顶背离=1)+1<144 AND TTJ=1 AND CURRBARSCOUNT<233) OR ISLASTBAR,MIN(DIFF,DEA)*0.98,BARSLAST(顶背离=1)+1) COLORGREEN;DRAWNUMBER((BARSLAST(底背离=1)+1<144 AND TTJA=1 AND CURRBARSCOUNT<233)OR ISLASTBAR,0,BARSLAST(底背离=1)+1) COLORYELLOW;。
通达信指标公式源码好厉害的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(副图)
{SHORT:1,500,12 LONG:1,500,26 M:1,500,9}DIFF : EMA(CLOSE,SHORT) - EMA(CLOSE,LONG),LINETHICK0;DEA : EMA(DIFF,M),LINETHICK0;DRAWBAND(DIFF,RGB(155,50,50),DEA,RGB(0,100,50));力:2*(DIFF-DEA),NODRAW;MACD : 2*(DIFF-DEA), COLORSTICK,LINETHICK2;DD:=C=HHV(C,180);EE:=DEA < REF(DEA,1) AND REF(DEA< REF(DEA,1),1)=1;CC:=C > REF(C,1) AND REF(C > REF(C,1),1)=1;DRAWICON(CC AND EE,0.1,11);A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));底背离:=IF(REF(CLOSE,A1+1) > CLOSE AND DIFF > REF(DIFF,A1+1) AND CROSS(DIFF,DEA),1.2,DRAWNULL),COLORRED,LINETHICK4,CROSSDOT;势:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED LINETHICK2;DRAWICON(DD AND EE AND DEA< HHV(DEA,180),0.1,2);A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));顶背离:=REF(CLOSE,A2+1)DIFF AND CROSS(DEA,DIFF),COLORWHITE;压:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN LINETHICK2;FF:=C=LLV(C,180);GG:= DEA > REF(DEA,1) AND REF(DEA > REF(DEA,1),1)=1;LL:=C < REF(C,1) AND REF(C< REF(C,1),1)=1;DRAWICON(LL AND GG,-0.1,16);DRAWICON(FF AND GG AND DEA> LLV(DEA,180),-0.3,9);MM:=IF(MACD < 0,MACD,0);JJ:=MM> REF(MM,1);ZZ:=REF(JJ,1)=1;介入区:(JJ AND ZZ)*DEA,POINTDOT,COLORFFFFFF;{MACD蓝柱缩短---指今日比昨天短}STICKLINE(介入区=DEA,DEA,DIFF,0,0),COLORFFFFFF;STICKLINE(MACD0,0,MACD,0,0),COLORFF00FF;STICKLINE(MACD < 0,0,MACD,0,0)COLOR00FF00;STICKLINE(MACD > REF(MACD,1)AND MACD,0,MACD,0,0),COLORYELLOW; STICKLINE(MACD > REF(MACD,1)AND MACD > 0,0,MACD,0,0),COLORRED;持:IF(DIFF >= DEA,DIFF,DRAWNULL),COLORRED;观:IF(DEA >= DIFF,DEA,DRAWNULL),COLORFF9900;股:IF(DIFF >= DEA,DEA,DRAWNULL),COLOR00FFFF;望:IF(DEA >= DIFF,DIFF,DRAWNULL),COLOR00FF00;AA:=BARSLAST(REF(CROSS(DIFF,DEA),1));BB:=REF(CLOSE,AA+1) > CLOSE AND DIFF > REF(DIFF,AA+1) AND CROSS(DIFF,DEA); 进:DRAWLINE(AA=0,DEA,BB,DEA,0),COLOR0000FF;STICKLINE(BB,0,0.1,0,1),COLORFFFFFF;火:=BARSLAST(EMA(CLOSE,5) < REF(EMA(CLOSE,5),1)),NODRAW;山:=COUNT(EMA(CLOSE,5) > REF(EMA(CLOSE,5),1),5),COLORGREEN;DRAWTEXT(REF(火,3) > 0 AND REF(火,2) > 0 AND REF(火,1) > 0 AND 火=0 AND REF(火,1) > 山,DIFF,'●'),COLORRED;DRAWTEXT(REF(火,3) > 0 AND REF(火,2) > 0 AND REF(火,1) > 0 AND 火=0 AND REF(火,1) > 山,DIFF,'¤'),COLORYELLOW;STICKLINE(REF(山,1)=0 AND 山> 0,0,0.1{-1},5,2),COLORRED;DRAWTEXT(REF("KDJ.J",1) < 0 AND "KDJ.J" > 0,DIFF,'短'),COLORRED ;。
通达信MACD显示在主图副图源码
通达信MACD显示在主图副图源码在通达信里的MACD显示在主图,具体用法你懂得哦~!{MACD真实地显示在主图}DIFZ:=EMA(C,12)-EMA(C,26);DEAZ:=EMA(DIFZ,9);MACDZ:=8*(DIFZ-DEAZ);TYNNN:=60;A1:=REF(HIGH,TYNNN)=HHV(HIGH,2*TYNNN+1);B1:=FILTER(A1,TYNNN);C1:=BACKSET(B1,TYNNN+1); D1:=FILTER(C1,TYNNN);A2:=REF(LOW,TYNNN)=LLV(LOW,2*TYNNN+1);B2:=FILTER(A2,TYNNN);C2:=BACKSET(B2,TYNNN+1); D2:=FILTER(C2,TYNNN);E1:=(REF(LLV(LOW,2*TYNNN),1)+REF(HHV(HIGH,2*TYNNN), 1))/2; E2:=(HIGH+LOW)/2;H1:=(D1 AND NOT(D2 AND E1>=E2)) OR ISLASTBAR OR BARSCOUNT(CLOSE)=1;L1:=(D2 AND NOT(D1 AND E1<E2));X1:=REF(BARSLAST(H1),1)+1; F1:=BACKSET(H1 AND COUNT(L1,X1)>0,LLVBARS(IF(L1,LOW,10000),X1));G1:=F1>REF(F1,1); I1:=BACKSET(G1,2); LD:=I1>REF(I1,1);UU:=BACKSET(ISLASTBAR,BARSLAST(LD)+1);VV:=UU>REF(UU,1);RCC:=REF(L,BARSLAST(VV));DRAWBAND(DIFZ*4+RCC,RGB(155,50,50),EMA(DIFZ*4+RCC, 9),RGB(0,50,150));{此句4.0以下版本要删除}STICKLINE((RCC+MACDZ)>RCC AND (RCC+MACDZ)<=REF(RCC+MACDZ,1),RCC,RCC+MACDZ,1,0),CO LOR400080;STICKLINE((RCC+MACDZ)>RCC AND (RCC+MACDZ)>REF(RCC+MACDZ,1),RCC,RCC+MACDZ,1,0),COL OR00FFFF;STICKLINE((RCC+MACDZ)<=RCC AND (RCC+MACDZ)<=REF(RCC+MACDZ,1),RCC,RCC+MACDZ,1,0),CO LOR008080;STICKLINE((RCC+MACDZ)<=RCC AND (RCC+MACDZ)>REF(RCC+MACDZ,1),RCC,RCC+MACDZ,1,0),COL ORC080FF;IF(C,EMA(DIFZ*4+RCC,9),DRAWNULL),COLORFFFFFF,LINETH ICK1;IF(C,DIFZ*4+RCC,DRAWNULL),COLORRED,LINETHICK1;IF(DIFZ<=REF(DIFZ,1),DIFZ*4+RCC,DRAWNULL),COLORFFF0 00;STICKLINE(C>O,H,L,0,0),COLORRED;STICKLINE(C>O,C,O,3.1,1),COLORRED;STICKLINE(C<=O,H,L,0,0),COLORCYAN;STICKLINE(C<=O,C,O,3.1,1),COLORCYAN;{均线状态}MA5:MA(C,5);MA10:MA(C,10);MA20:MA(C,20);MA30:MA(C,30);MA60:MA(C,60);。
通达信指标公式源码 超前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】副指标源码副图指标源码DIFF:= EMA(CLOSE,12) - EMA(CLOSE,26);DIF:EMA(CLOSE,12)-EMA(CLOSE,26),LINETHICK2;DEA:EMA(DIF,9),COLORWHITE;MACD:(DIF-DEA)*2,NODRAW;DRAWBAND(DIF,RGB(150,20,20),DEA,RGB(10,150,20));DRAWBAND(IF(DIF,DIF,DRAWNULL),RGB(250,250,250),DIF,R GB(0,0,0));DRAWBAND(IF(DEA,DEA,DRAWNULL),RGB(250,250,10),DEA, RGB(0,0,0));STICKLINE(MACD>0,0,MACD,1,0),COLORRED;STICKLINE(MACD<0,0,MACD,1,0),COLORGREEN;STICKLINE(MACD>0 AND MACD<=REF(MACD,1),0,MACD,1,0),COLORYELLOW;STICKLINE(MACD<0 AND MACD>=REF(MACD,1),0,MACD,1,0),COLORWHITE;FH1:=REF(MACD,1)<REF(MACD,2) AND REF(MACD,2)<REF(MACD,3) AND REF(MACD,3)<REF(MACD,4);FH2:=MACD>=0 AND COUNT(MACD>REF(MACD,1),1)=1;FH3:=FH1 AND FH2 AND EMA(C,13)>REF(EMA(C,13),1);FH4:=FH1 AND FH2 AND ABS((DIF-DEA)/C)<0.018;FH5:=FH1 AND FH2 AND MACD<0.10;VV:=CLOSE>OPEN AND MA(CLOSE,5)>MA(CLOSE,10) AND MA(CLOSE,10)>MA(CLOSE,30)AND DIFF>DEA AND MACD>REF(MACD,1) AND DIFF>0 AND DEA>0 ANDMA(VOL,5)>MA(VOL,34) ANDMA(CLOSE,30)>=REF(MA(CLOSE,30),1);佛手:IF(VV,1,0),NODRAW;DRAWICON(佛手,0.06,11);二次翻红:(FH3 OR FH4 OR FH5),COLORRED,NODRAW;低买:CROSS(DIF,DEA) AND DIF<0,COLORFF00FF,NODRAW;加油:CROSS(DIF,DEA) AND DIF>0,COLORYELLOW,NODRAW;DRAWICON(二次翻红,-0.05,1);DRAWTEXT(二次翻红,-0.15,'翻红'),COLORRED;DRAWTEXT(CROSS(DIF,DEA) AND DIF<0,DEA-0.02,'低买'),COLORFF00FF;DRAWTEXT(CROSS(DIF,DEA) AND DIF>0,DEA-0.05,'加油'),COLORYELLOW;XG:二次翻红 OR 低买 OR 加油,NODRAW;YLZC:=IF(CLOSE=INDEXC,(INDEXC+INDEXH+INDEXL+INDE XO)/4,AMOUNT/(VOL+0.01)/100);阻价:=IF(CLOSE=INDEXC,YLZC+INDEXC-INDEXL,YLZC+(CLOSE-LOW));支价:=IF(CLOSE=INDEXC,INDEXL+INDEXC-YLZC,LOW+(CLOSE-YLZC));今压:REF(阻价,1),LINETHICK0,COLORAA11BB,NODRAW;今撑:REF(支价,1),LINETHICK0,COLOR009900,NODRAW;明压:阻价,LINETHICK0,NODRAW;明撑:支价,LINETHICK0,NODRAW;低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;STICKLINE(低位金叉,0,0.08,6,0),COLORYELLOW;DRAWTEXT(低位金叉,0.16,' 低位金叉'),COLORWHITE;JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;STICKLINE(二次金叉,0,0.06,6,0),COLORFF00FF;DRAWICON(二次金叉,DEA*0.9,1) ;DRAWTEXT(二次金叉,0.2,' 二次金叉'),COLORYELLOW;B1:=BARSLAST(REF(CROSS(DIFF,DEA),1));底背离:=REF(CLOSE,B1+1)>CLOSE AND DIFF>REF(DIFF,B1+1) AND CROSS(DIFF,DEA);STICKLINE(底背离,0,0.03,6,0),COLOR00FF00;DRAWTEXT(底背离,0.12,' 底背离'),COLORFF00FF;B2:=BARSLAST(REF(CROSS(DEA,DIFF),1));顶背离:=REF(CLOSE,B2+1)<CLOSE AND REF(DIFF,B2+1)>DIFF AND CROSS(DEA,DIFF);DRAWTEXT(低位金叉 AND 二次金叉 AND 底背离,0.25,'三全项'),COLOR0000FF,LINETHICK2;入1:IF(DIF>REF(DIF,1),DIF,DRAWNULL),COLORRED,LINETHICK2;入2:IF(DIF<REF(DIF,1),DIF,DRAWNULL),COLOR00FF00,LINETHICK2;E3:=EMA(DIF,3);E5:=EMA(DIF,5);E10:=EMA(DIF,10);E20:=EMA(DIF,20);E60:=EMA(DIF,60);E120:=EMA(DIF,120);E240:=EMA(DIF,240);E480:=EMA(DIF,480);E960:=EMA(DIF,960);E1920:=EMA(DIF,1920);EE:=(E3*3+E5*5+E10*10+E20*20+E60*60+E120*120+E240* 240+E480*480+E960*960+E1920*1920)/3818;EE1:=(E3*3+E5*5)/8;EE2:=(E20*20+E60*60+E120*120+E240*240+E480*480)/920;EE3:=(E3*3+E5*5+E10*10)/18;CE1:=((((EE2+EE3)/2+DIF)/2+DIF)/2+DIF)/2;TT:EE2*(1+0.01*344),CIRCLEDOT,COLOR0000FF;公:DRAWNULL,COLORCCCCCC;众:DRAWNULL,COLORCCCCCC;号:DRAWNULL,COLORCCCCCC;股市客栈:DRAWNULL,COLORCCCCCC;。
通达信2指标——MACD画线(副图)
DRAWICON(D2,OBV,2);
当满足条件d1时在obv位置画直线起点当满足条件s11时在obv位置画直线终点1表示是否延长
{MACD画线}
{OBV:=DIF; short:12 long:26 mid:9}
DIF:EMA(CLOSE,SHORT)-EMA(CLOSE,LONG);
DEA:EMA(DIF,MID);
MACD:(DIF-DEA)*2,COLORSTICK;
{当满足条件D1时,在OBV位置画直线起点,
当满足条件S11时,在OBV位置画直线终点,1表示是否延长.,画黄色}
T11:=BACKSET(ISLASTBAR,BARSLAST(D2)+1);
U11:=T11>REF(T11,1);
DRAWLINE(D2,OBV,U11,OBV,1),COLOR00FF00;
STICKLINE(C>0,下,下,1,0),COLOR00FF00;
STICKLINE(C>0,上,上,1,0),COLORFF00FF;
DRAWTEXT(CROSS(OBV,上*1.01),上,'上'),COLORYELLOW;
DRAWTEXT(CROSS(下*0.99,OBV),下,'下'),COLORYELLOW;
OBV:=DIF;
P:=5;
A1:=REF(OBV,P)=HHV(OBV,2*P+1);{A1赋值:P日前的OBV=2*P+1日内OBV的最高值}
B1:=FILTER(A1,P);{A1的P日过滤}
C1:=BACKSET(B1,P+1);{若B1则将最近P+1周期置为1}
通达信指标公式源码 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;。