当前位置:首页 > 问答

把macd指标加到主图上的方法

我来帮TA回答

你好,请教个问题,在通达信软件中,怎么将MACD的dif和dea两条线叠加到主图上?

长阳真人(466231800)做过类似的指标,但可能不是你要的

下图是博易大师的,

老师,可否帮忙把MACD指标写在主图上

EMA(CLOSE,12);
EMA(CLOSE,26);
DIF:EMA(CLOSE,12)-EMA(CLOSE,26),NODRAW;
DEA:EMA(DIF,9),NODRAW;

求通达信中把MACD顶底背离信号叠加到分时主图上的公式源码

顶背离,你要确定一下是,dif的背离,还是,dea线的背离,还是macd柱子高低的背离.
提示方式是画线提示还是文字提示还是图标提示
例如下图中的是划线提示的

怎么把指标添加到通达信分时图主图里面

首先,你的指标必须是主图叠加指标;

然后,在分时图状态下,鼠标右键:分时主图指标---选择主图指标.。

求MACD空中加油指标源码(通达信)

CROSS(MACD.DIF,MACD.DEA) AND LLV(MACD.DIF,5)>0 AND COUNT(MACD.DIF>MACD.DEA,5)=1;

跪求通达信冠军MACD和冠军背离线附图指标源码,那位大神给下!

{供参考}
{冠军MACD+顶底背离画线}
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
MACD2:=2*(DIFF-DEA);
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;
STICKLINE(MACD2>=0,0,MACD2,1,1),COLOR0000FF;
STICKLINE(MACD2>=0 AND MACD2<REF(MACD2,1),0,MACD2,1,0),COLORGREEN;
STICKLINE(MACD2<0,0,MACD2,2,0),COLORFFFF00;
STICKLINE(MACD2<0 AND MACD2>REF(MACD2,1),0,MACD2,1,1),COLORFFFF00;
STICKLINE(CLOSE>0,0,0,1,0),COLOR808080;
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+0.38,9);
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-0.13,11);
DRAWICON((JUD1 OR BARSLAST(JDU1)>BARSLAST(JUD1)) AND MACD2>=0 AND REF(MACD2,1)<REF(DEFU2L,1) AND MACD2>DEFU2L,MACD2+0.50,5);
DRAWICON((JDU1 OR BARSLAST(JDU1)<BARSLAST(JUD1)) AND MACD2<0 AND REF(MACD2,1)>REF(DEFD2L,1) AND MACD2<DEFD2L,MACD2-0.14,6);
VAR111:=JDU1 OR BARSLAST(JDU1)<BARSLAST(JUD1);
VAR112:=HHV(MACD2,4)<0 AND MACD2>REF(MACD2,1) AND REF(MACD2,1)<REF(MACD2,2) AND REF(MACD2,2)<REF(MACD2,3);
价因子:=IF(CLOSE/OPEN>1.06,2.5,0),COLORLIBLUE;
STICKLINE(价因子,0,1,1,1),COLORYELLOW;
量变线:=VOL/MA(VOL,5)COLORWHITE,LINETHICK2;
量因子:=IF(VOL/MA(VOL,5)>2,2.5,0);
STICKLINE(量因子,0,1,1,1),COLORYELLOW;
DRAWICON(CLOSE/OPEN>1.06,1,24);
DRAWICON(VOL/MA(VOL,5)>2,0.8,25);
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,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,DIFF),1));
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);
顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK4;
DRAWICON(CROSS(DIFF,DEA),DEA,1);
DRAWICON(CROSS(DEA,DIFF),DEA,2);