MACD面积背驰副图-源码
macd实战公式源代码复制添加副图即可用
MACD实战公式源代码复制添加副图即可用DU0:=CROSS(DIFF,0);UD0:=CROSS(0,DIFF);TDU0:=BARSLAST(DU0);TUD0:=BARSLAST(UD0);DU3:=REF(DU0,1);UD3:=REF(UD0,1);TDU3:=BARSLAST(DU3);TUD3:=BARSLAST(UD3);UDGLINE:=IF((TDU3 <TUD3),REF(HHV(HIGH,2),TDU3),REF(LLV(LOW,2),TUD3 ));JDU0:=(((REF(CLOSE,1) <= REF(UDGLINE,1)) AND (CLOSE > UDGLINE)) AND (TDU0 < TUD0));JUD0:=(((REF(CLOSE,1) >= REF(UDGLINE,1)) AND (CLOSE < UDGLINE)) AND (TUD0 < TDU0));JDU1:=(JDU0 AND (COUNT(JDU0,TDU0) = 1));JUD1:=(JUD0 AND (COUNT(JUD0,TUD0) = 1));JDU2:=(JDU1 AND (REF(BARSLAST(JUD1),1) <REF(BARSLAST(JDU1),1)));JUD2:=(JUD1 AND (REF(BARSLAST(JUD1),1) >REF(BARSLAST(JDU1),1)));JDU3:=(JDU1 AND (REF(BARSLAST(JUD1),1) >REF(BARSLAST(JDU1),1)));JUD3:=(JUD1 AND (REF(BARSLAST(JUD1),1) <REF(BARSLAST(JDU1),1)));BSLINE:=IF((BARSLAST(JDU2) <BARSLAST(JUD2)),IF(REF(CROSS(0,MACD2),1),LLV(L OW,2),REF(LLV(LOW,2),BARSLAST(REF(CROSS(0,MA CD2),1)))),IF(REF(CROSS(MACD2,0),1),HHV(HIGH,2),R EF(HHV(HIGH,2),BARSLAST(REF(CROSS(MACD2,0),1)) )));DRAWICON((JDU1 OR (BARSLAST(JDU1) < BARSLAST(JUD1))),0, 0) ;DRAWICON((JUD1 OR (BARSLAST(JDU1) > BARSLAST(JUD1))),0,0) ;STICKLINE((MACD2 >=0),0,MACD2,2,1),COLORRED ;STICKLINE(((MACD2 >= 0) AND (MACD2 <REF(MACD2,1))),0,MACD2,2,0),COLORRED; STICKLINE((MACD2 <0),0,MACD2,2,0),COLORFFFF00;STICKLINE(((MACD2 < 0) AND (MACD2 >REF(MACD2,1))),0,MACD2,2,1),COLORFFFF00;DIF:DIFF,LINETHICK2,COLORYELLOW ;MACD:DEA ,COLORLIMAGENTA ;DEF:MACD2,LINETHICK0,COLORFFFF00 ; STICKLINE((CLOSE > 0),0,0,0 ,0) ;DEFUT:=BARSLAST(CROSS(MACD2,0));DEFDT:=BARSLAST(CROSS(0,MACD2));DEFUL:=IF((MACD2 >= 0),HHV(MACD2,(DEFUT + 1)),REF(HHV(MACD2,(DEFUT + 1)),(DEFDT + 1))); DEFDL:=IF((MACD2 < 0),LLV(MACD2,(DEFDT + 1)),REF(LLV(MACD2,(DEFDT + 1)),(DEFUT + 1))); DEFU2L:=REF(DEFUL,(DEFUT + 1));DEFD2L:=REF(DEFDL,(DEFDT + 1));DRAWICON(((((LLV(MACD2,4) > 0) AND (MACD2 < REF(MACD2,1))) AND (REF(MACD2,1) >REF(MACD2,2))) AND (REF(MACD2,2) >REF(MACD2,3))),MACD2,2) ;DRAWICON(((((HHV(MACD2,4) < 0) AND (MACD2 > REF(MACD2,1))) AND (REF(MACD2,1) <REF(MACD2,2))) AND (REF(MACD2,2) <REF(MACD2,3))),MACD2,1);DRAWICON(((((JUD1 OR (BARSLAST(JDU1) >BARSLAST(JUD1))) AND (MACD2 >= 0)) AND(REF(MACD2,1) < REF(DEFU2L,1))) AND (MACD2 > DEFU2L)),MACD2,12) ;DRAWICON(((((JDU1 OR (BARSLAST(JDU1) < BARSLAST(JUD1))) AND (MACD2 < 0)) AND(REF(MACD2,1) > REF(DEFD2L,1))) AND (MACD2 < DEFD2L)),MACD2,12);。
通达信双重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面积背驰(选股/副图源码)下跌为例:MACD的背驰原点就是指股票的一个同级别的走势中,当股价创了新低,但MACD 的绿柱子面积不再创新低(即面积缩小),同时MACD的黄白线也变小,这时走势就会产生一个MACD背驰点。
这个背驰点的作用或者叫用法有两个:一是起码保证背驰点后的一个反弹幅度至少达到这个背驰点前一个低点的位置;二是导致一个同级别走势的反转走势。
在实际操作中最关键的是你要会看MACD的指标,明白它的意思才行,这东西说清楚有很多内容,这里无法展开谈,但我告诉你要明白两点最基本的:一个是一定要同级别的走势来分析,这个同级别很关键;二是这个背驰点只会在下跌或上涨的走势中产生,盘整走势或者叫横盘走势是不会产生背驰点的。
其他的你还要多去找相关的资料来看,同时要多结合看图。
通用MACD面积背驰选股公式DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);DEA:=EMA(DIF,9);MACD0:=(DIF-DEA)*2;MJ:=MACD0;S05:=SUM(MJ,0);QST:=BARSLAST(MJ<0 AND REF(MJ,1)>0)+1;QXT:=BARSLAST(MJ>0 AND REF(MJ,1)<0)+1;S5:=IF(MJ>0,S05-REF(S05,BARSLAST(MJ<0)),S05-REF(S05,BARSLAST(MJ>0)))/10; ST:=IF(MJ>0,REF(QST,QXT)+QXT,REF(QXT,QST)+QST);RS5:=REF(S5,ST);BC:IF(MJ>0 AND S5<RS5,0,IF(MJ<0 AND S5>RS5 AND DEA<0,1,0));。
通达信指标公式源码好厉害的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三次背离副图指标通达信源码自己常用的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背离副图指标 贴图 源码通达信指标公式
MACD2:=2*(MACD.DIF-MACD.DEA);STICKLINE(MACD2>=0 AND MACD2>REF(MACD2,1),0,MACD2,1.2,0),COLOR0000A5; STICKLINE(MACD2>=0 AND MACD2<REF(MACD2,1),0,MACD2,1.2,0),COLORAA7800; STICKLINE(MACD2<0 AND MACD2<REF(MACD2,1),0,MACD2,1.2,0),COLOR00A500; STICKLINE(MACD2<0 AND MACD2>REF(MACD2,1),0,MACD2,1.2,0),COLORA500A5; DIF:EMA(CLOSE,12)-EMA(CLOSE,26);DEA:EMA(DIF,9);MACD:(DIF-DEA)*2,NODRAW;{MACD日线二次金叉}JCCOUNT:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));二次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1; DRAWTEXT(二次金叉,DEA*1.25,'零下二金'),COLORWHITE;{MACD日线底背离}A1:=BARSLAST(REF(CROSS(DIF,DEA),1));底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA); DRAWTEXT(底背离,DIF*0.5,'日底背'),COLORRED;{日底背画线:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,DOTLINE;}{MACD日线顶背离}A2:=BARSLAST(REF(CROSS(DEA,DIF),1));顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF AND CROSS(DEA,DIF); DRAWTEXT(顶背离,DIF*1.12,'日顶背'),COLORGREEN;{日顶背画线:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,DOTLINE;}{MACD_KDJ的金叉共振}{DIF:EMA(CLOSE,12)-EMA(CLOSE,26);DEA:EMA(DIF,9);}RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9));K:=SMA(RSV,9,3),NODRAW;D:=SMA(K,9,3),NODRAW;J:=3*K-2*D,NODRAW;M&K金共:=CROSS(DIF,DEA) AND CROSS(K,D) AND CROSS(J,D);DRAWTEXT(M&K金共,DEA*1.12,'金叉共振'),COLORYELLOW;{MACD柱背离}MACD高:=HHV(MACD,5);C1:=BARSLAST(REF(CROSS(DEA,DIF),1));E:=REF(C,C1+1)>C AND DEA>0 AND REF(MACD高,C1+1)<MACD高AND CROSS(DEA,DIF) ;DRAWTEXT(E>0,-0.5,'柱顶背'),COLORCYAN;F:=REF(C,A1+1)>C AND DEA<0 AND REF(MACD高,A1+1)<MACD高AND CROSS(DIF,DEA);DRAWTEXT(F>0,0.5,'柱底背'),COLORLIRED;{MACD积背离}JC:= DEA-DIF;绿柱面积:=IF(MACD<0,SUM(MACD,BARSLAST(JC<0)),0);红柱面积:=IF(MACD>0,SUM(MACD,BARSLAST(JC>0)),0);本次最低价:=LLV(L,BARSLAST(JC<0));本次最高价:=HHV(H,BARSLAST(JC>0));X1:=IF (MACD<0,BARSLAST(CROSS(DIF,DEA)),0);前次绿柱面积:=REF(绿柱面积,X1+1);前次最低价:=REF(本次最低价,X1+1);Y1:=IF((绿柱面积<0 AND ABS(绿柱面积)<ABS(前次绿柱面积) AND 本次最低价<前次最低价),1,0);RS1:= MACD<0 AND REF(MACD,1)<0 AND C<前次最低价AND ABS(绿柱面积)<ABS(前次绿柱面积) AND ABS(MACD)<ABS(REF(MACD,1));底背驰:= IF (CROSS(DIF,DEA),REF(Y1,1),0);DRAWTEXT(底背驰,DEA*0.8,'积底背'),COLORFF80FF;X2:=IF (MACD>0,BARSLAST(CROSS(DEA,DIF)),0);前次红柱面积:=REF(红柱面积,X2+1);前次最高价:=REF(本次最高价,X2+1);Y2:=IF((红柱面积>0 AND 红柱面积<前次红柱面积AND 本次最高价>前次最高价),1,0); RS2:= MACD>0 AND REF(MACD,1)>0 AND C>前次最高价AND ABS(红柱面积)<ABS(前次红柱面积) AND ABS(MACD)<ABS(REF(MACD,1));顶背驰:= IF (CROSS(DEA,DIF),REF(Y2,1),0);DRAWTEXT(顶背驰,DEA*0.8,'积顶背'),COLORCYAN;。
通达信MACD顶底背离副图指标公式源码
通达信MACD顶底背离副图指标公式源码
{MACD顶底背离}
DIFF:EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:EMA(DIFF,9);
MACD:2*(DIFF-DEA),COLORSTICK;
B3:=REF(C,A3+1)>C AND REF('RSI.RSI1'(6,12,24),A3+1)<'RSI.RSI1'(6,12,24) ANDCROSS('RSI.RSI1'(6,12,24),'RSI.RSI2'(6,12,24));
C1:=BARSLAST(REF(CROSS(DEA,DIFF),1));
STICKLINE(B3>0,-0.1,0,2,0),COLORYELLOW;
STICKLINE(D1>0,0பைடு நூலகம்1,0,2,0),COLOR00FF00;
STICKLINE(D2>0,0.1,0,2,0),COLORFFCC66;
STICKLINE(D3>0,0.1,0,2,0),COLORWHITE;
KDJ顶背:IF(D2>0,0.1,0),COLORFFCC66,POINTDOT;
RSI顶背:IF(D3>0,0.1,0),COLORWHITE,POINTDOT;
STICKLINE(B1>0,-0.1,0,2,0),COLORRED;
STICKLINE(B2>0,-0.1,0,2,0),COLORFF00FF;
MACD底背:IF(B1>0,-0.1,0),COLORRED,POINTDOT;
通达信指标公式源码 顶底背离MACD副图指标
VAR1:=EMA(SLOPE(C,21)+C,55);VAR2:=EMA(SLOPE(O,21)+O,55);VAR3:=EMA(SLOPE(H,21)+H,55);VAR4:=EMA(SLOPE(L,21)+L,55);VAR5:=EMA(C,3);VAR6:=EMA(O,3);VAR7:=EMA(H,3);VAR8:=EMA(L,3);VAR9:=VAR1-VAR5,LINETHICK2;VAR10:=VAR2-VAR6,LINETHICK2;VAR11:=VAR3-VAR7,LINETHICK2;VAR12:=VAR4-VAR8,LINETHICK2;ZJC:=REVERSE(VAR9);ZJO:=REVERSE(VAR10);ZJH:=REVERSE(VAR11);ZJL:=REVERSE(VAR12);DIF:EMA(ZJC*5,12)-EMA(ZJC*5,26);DEA:EMA(DIF,9);MACD:(DIF-DEA)*2,COLORSTICK;STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,0,0),COLORRED; STICKLINE(MACD<REF(MACD,1) AND MACD>0,0,MACD,0,0),COLORMAGENTA;STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,0,0),COLORYELLOW;STICKLINE(MACD<REF(MACD,1) AND MACD<0,0,MACD,0,0),COLORLIGREEN; STICKLINE(ZJC> ZJO,ZJH,ZJL,0.0,0),COLORFF66FF;STICKLINE(ZJC> ZJO,ZJC,ZJO,2.1,0),COLORAA00AA;STICKLINE(ZJC> ZJO,ZJC,ZJO,1.9,0),COLORCC11CC;STICKLINE(ZJC> ZJO,ZJC,ZJO,1.6,0),COLORFF22FF;STICKLINE(ZJC> ZJO,ZJC,ZJO,1.2,0),COLORFF44FF;STICKLINE(ZJC> ZJO,ZJC,ZJO,0.7,0),COLORFF66FF;STICKLINE(ZJC> ZJO,ZJC,ZJO,0.2,0),COLORFF99FF;STICKLINE(ZJC<=ZJO,ZJL,ZJC,0.0,0),COLORGREEN;STICKLINE(ZJC<=ZJO,ZJO,ZJC,2.1,0),COLOR005500;STICKLINE(ZJC<=ZJO,ZJO,ZJC,1.9,0),COLOR007700;STICKLINE(ZJC<=ZJO,ZJO,ZJC,1.6,0),COLOR009900;STICKLINE(ZJC<=ZJO,ZJO,ZJC,1.2,0),COLOR00BB00;STICKLINE(ZJC<=ZJO,ZJO,ZJC,0.7,0),COLOR00DD00;STICKLINE(ZJC<=ZJO,ZJO,ZJC,0.2,0),COLOR44FF00;ZTB:=(C-REF(C,1))/REF(C,1)*100>9.9;DRAWTEXT(ZTB,IF(ZJC<0,ZJC*0.9,ZJC*1.1),'涨停板')COLORYELLOW; STICKLINE(ZTB,ZJC,ZJO,2.1,0),COLOR006666;STICKLINE(ZTB,ZJC,ZJO,1.9,0),COLOR008888;STICKLINE(ZTB,ZJC,ZJO,1.6,0),COLOR00AAAA;STICKLINE(ZTB,ZJC,ZJO,1.2,0),COLOR00CCCC;STICKLINE(ZTB,ZJC,ZJO,0.7,0),COLOR00EEEE;STICKLINE(ZTB,ZJC,ZJO,0.2,0),COLOR33FFFF;DTB:=(C-REF(C,1))/REF(C,1)*100<-9.9;DRAWTEXT(DTB,IF(ZJC>0,ZJC*0.9,ZJC*1.1),'跌停板')COLORFF8800; STICKLINE(DTB,ZJO,ZJC,2.1,0),COLORFF0000;{蓝色}STICKLINE(DTB,ZJO,ZJC,1.9,0),COLORFF2200;STICKLINE(DTB,ZJO,ZJC,1.6,0),COLORFF4400;STICKLINE(DTB,ZJO,ZJC,1.2,0),COLORFF6600;STICKLINE(DTB,ZJO,ZJC,0.7,0),COLORFF8800;STICKLINE(DTB,ZJO,ZJC,0.2,0),COLORFFAA00;。
通达信指标公式源码 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面积2种公式源代码
缠论辅助同花顺面积公式原同花顺只有面积无数值显示,修改方法:打开同花顺,工具→公式管理→趋势指标→MACD→修改→把第一种或第二种的数据复制掩盖原有数据→确定,大功告成,面积数出来了。
第一种:DIF:EMA(CLOSE,12)-EMA(CLOSE,26);DEA:EMA(DIF,9);MACD:(DIF-DEA)*2,COLORSTICK;红面积:SUM(MACD,BARSLAST(MACD<0))*(MACD>0),COLOR0000FF,NODRAW;绿面积:SUM(MACD,BARSLAST(MACD>0))*(MACD<0),COLORFFFF00,NODRAW;AA:=ROUND(REF(绿面积,1)*100);BB:=ROUND(REF(红面积,1)*100);DRAWNUMBER(CROSS(0,MACD),HHV(REF(MACD,1),5)+0.03,ABS(BB)),COLORMAGENTA;DRAWNUMBER(CROSS(MACD,0),LLV(REF(MACD,1),5)-0.03,ABS(AA)),COLORGREEN;第二种:DIF:EMA(CLOSE,12)-EMA(CLOSE,26);DEA:EMA(DIF,9);MACD:(DIF-DEA)*2,COLORSTICK;MACDHS:=IF(MACD>0AND MACD>REF(MACD,1),MACD,0);MACDHX:=IF(MACD>0AND MACD<REF(MACD,1),MACD,0);MACDLX:=IF(MACD<0AND MACD<REF(MACD,1),MACD,0);MACDLS:=IF(MACD<0AND MACD>REF(MACD,1),MACD,0);红柱面积:=IF(MACD>0,SUM(MACD,BARSLAST(MACD<0)),0),PRECIS2,COLOR0000FF;绿柱面积:=IF(MACD<0,SUM(MACD,BARSLAST(MACD>0)),0),PRECIS2,COLOR006000;;DRAWTEXT(REF(MACD,1)>0AND MACD<=0 ,HHV(MACD,4),''+TOSTRING(REF(红柱面积,1),2)),colorred; DRAWTEXT(REF(MACD,1)<0AND MACD>=0 ,LLV(MACD,4),''+TOSTRING(REF(ABS(绿柱面积),1),2)),Color00ff00;DRAWTEXT(ISNULL(REFX(&CLOSE,1))=1AND MACD<0,LLV(MACD,4),''+TOSTRING(ABS(绿柱面积),2)),Color004A00;DRAWTEXT(ISNULL(REFX(&CLOSE,1))=1AND MACD>0,HHV(MACD,4),''+TOSTRING(ABS(红柱面积),2)),colorred;。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
X2:=IF (MACD>0,BARSLAST(CROSS(DEA,DIFF)),0);
前次红柱面积:=REF(红柱面积,X2+1);
前次最高价:=REF(本次最高价,X2+1);
Y2:=IF((红柱面积>0 AND 红柱面积<前次红柱面积 AND 本次最高价>前次最高价 ),1,0);
RS2:= MACD>0 AND REF(MACD,1)>0 AND C>前次最高价 AND ABS(红柱面积);
顶背驰:= IF (CROSS(DEA,DIFF),REF(Y2,1),0);
DRAWICON(顶背驰,0,19),COLOR00FF00;
STICKLINE(顶背驰,0,0.01,4,0),COLOR00FF00;
红柱面积:=IF(MACD>0,SUM(MACD,BARSLAST(JC>0)),0);
本次最低价:=LLV(L,BARSLAST(JC<0));
本次最高价:=HHV(H,BARSLAST(JC>0));
X1:),0);
底背驰:= IF (CROSS(DIFF,DEA),REF(Y1,1),0);
DRAWTEXT(底背驰,-0.01,'底背'),COLOR00FFFF;
STICKLINE(底背驰,0,-0.01,4,0),COLOR0000FF;
DRAWICON(底背驰,0,23),COLORYELLOW;
前次绿柱面积:=REF(绿柱面积,X1+1);
前次最低价:=REF(本次最低价,X1+1);
Y1:=IF((绿柱面积<0 AND ABS(绿柱面积) AND 本次最低价<前次最低价 ),1,0);
RS1:= MACD<0 AND REF(MACD,1)<0 AND C<前次最低价 AND ABS(绿柱面积);
DRAWTEXT(顶背驰,0.01,'顶背'),COLORFF00FF;
买:IFF(底背驰,0.1,0),COLOR0000FF;
卖:IFF(顶背驰,0.1,0),COLOR00FF00;
DRAWBAND(DIFF,RGB(200,50,55),DEA,RGB(50,100,10));
遵:IF(DIFF>=DEA,DIFF,DRAWNULL),COLORRED;
守:IF(DEA>=DIFF,DEA,DRAWNULL),COLORFF9900;
纪:IF(DIFF>=DEA,DEA,DRAWNULL),COLOR00FFFF;
DIFF : EMA(CLOSE,12) - EMA(CLOSE,26);
DEA : EMA(DIFF,9);
MACD : 2*(DIFF-DEA), COLORSTICK;
JC := DEA-DIFF;
绿柱面积:=IF(MACD<0,SUM(MACD,BARSLAST(JC<0)),0);