❶ 求MACD指标中DIFF这条线的源码
DIF:EMA(CLOSE,12)-EMA(CLOSE,26);
❷ 朋友你的MACD和KDJ 合为一个指标正是我需要的可以提供源码吗 谢谢
这个就可用了,简单就好,不要搞得太复杂。需要设置可变参数,可修改KDJ的9-3-3为M,N1,N2.MACD的参数也同样可改。
{KDJ_MACD}
RSV:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*100;
K:SMA(RSV,3,1),NODRAW;
D:SMA(K,3,1),NODRAW;
J:3*K-2*D,NODRAW;
DIF:EMA(CLOSE,12)-EMA(CLOSE,26),COLORWHITE;
DEA:EMA(DIF,9),COLORYELLOW;
MACD:(DIF-DEA)*2,COLORSTICK;
DRAWBAND(K/25,RGB(255,0,0),K/25,RGB(0,0,0));
DRAWBAND(D/25,RGB(0,255,0),D/25,RGB(0,0,0));
DRAWBAND(J/25,RGB(0,0,255),J/25,RGB(0,0,0));
❸ 关于外汇MACD源码 如何修改MACD源码 请详细的说一下 不要系统自带的那种
MACD太慢了,等交叉出来都过了最佳交易时间。用MT4的最好试看其他指标,有很多综合性的,多找找。
❹ 求老师帮忙编写一个MACD0日线上出现第一根红柱时的选股指标源码(谢谢)
可以编写macd日线上出现第一根红柱时的选股指标公式源码,效果如下图。
❺ 跪求通达信冠军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);
❻ 帮忙编辑下炒股用的MACD源码
以下MACD源码。
DIF:EMA(CLOSE,9)-EMA(CLOSE,18);
DEA:EMA(DIF,7),LINETHICK1;
MACD:=2*(DIF-DEA);
STICKLINE(MACD>=0,MACD,0,0,0),COLORF00FF0;
STICKLINE(MACD<0,MACD,0,0,0),COLORF00FF0;
STICKLINE(MACD<REF(MACD,1)AND MACD>0,0,MACD,0,0 ),COLORFFFF00;
STICKLINE(MACD<=REF(MACD,1)AND MACD<0,0,MACD,0,0 ),COLORFFFF00;
IF(DIF<0,DIF,0),colorred,LINETHICK1;
IF(DIF<0,0,DIF),colorred,LINETHICK1;
IF(DIF<DEA,DIF,DEA),COLOR00FF00,LINETHICK1;
IF(DIF>DEA,DEA,DEA),colorwhite,LINETHICK1;
金叉:=CROSS(DIF,DEA) AND DIF<0.3;
STICKLINE(金叉,0,-0.38,3,0),COLOR0000FF;
MACD1:2*(DIF-DEA),LINETHICK0;
你试试看行不行。
❼ 哪位高手能写出macd上面那指标的源代码图为002132 在8月底到11月9号的指标形态。
RSV:=(CLOSE-LLV(LOW,5))/(HHV(HIGH,5)-LLV(LOW,5))*100;
K:SMA(RSV,3,1);
D:SMA(K,3,1);
50;
❽ 求MACD空中加油指标源码(通达信)
MA4:MA(C,4);
MA10:MA(C,10);
MA20:MA(C,20);
MA62:MA(C,62);
A10:=ATAN((MA(C,10)/REF(MA(C,10),1)-1)*100)*3.1416*MA(C,10);
小金角:=REF(CROSS(MA(C,10),MA(C,20)),1) AND A10>10.0;
DRAWTEXT(小金角,L-0.20,'小金角');
B20:=ATAN((MA(C,20)/REF(MA(C,20),1)-1)*100)*3.1416*MA(C,20);
大金角:=REF(CROSS(MA(C,20),MA(C,62)),1) AND B20>10;
DRAWTEXT(大金角,L-0.20,'大金角');
XJB1:=BARSLAST(小金角);
XJB2:=XJB1 AND CROSS(MA(C,10),C) AND C<MA(C,10);
XJB3:=RANGE(C,MA(C,20),MA(C,10));
小金边:=XJB2 AND XJB3;
DRAWTEXT(小金边,L-0.20,'小金边');
DJB1:=BARSLAST(大金角);
DJB2:=DJB1 AND CROSS(MA(C,20),C) AND C<MA(C,20);
DJB3:=RANGE(C,MA(C,62),MA(C,20));
大金边:=DJB2 AND DJB3;
DRAWTEXT(大金边,L-0.20,'大金边');
DIFF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIFF,9);
V1:=DIFF>0 AND V>MA(V,5);
V2:=DEA<0 AND DEA>-0.07;
MACD骑墙:=V1 AND V2;
DRAWTEXT(MACD骑墙,L-0.20,'MACD骑墙');
KZJY:=DIFF>0 AND DEA>0;
空中加油:=KZJY AND ABS(DIFF-DEA)/C<0.0045 AND CROSS(DIFF,DEA);
DRAWTEXT(空中加油,L-0.20,'空中加油'),COLORRED,LINETHICK2;
HZZZ:=ABS(MA(C,4)-MA(C,20))+ABS(MA(C,20)-MA(C,62))/C;
海豚张嘴:=HZZZ<0.23 AND CROSS(MA(C,20),MA(C,62)) AND MA(C,20)>REF(MA(C,20),1) AND V>MA(V,5);
DRAWTEXT(海豚张嘴,L-0.20,'海豚张嘴'),COLORRED,LINETHICK2;