❶ 求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;