原文地址:macd不同周期共振"指标作者:长征一,千钧大师的"macd不同周期共振"指标[通达信] dif:"macd.dif"; dea:"macd.dea",linethick2 coloryellow; macd:"macd.macd",colorstick; 周dif:ma("macd.dif#week",5); 周dea:ma("macd.dea#week",5),linethick1 colorffff00; 月dif:ma("macd.dif#month",21),linethick2 colorred; 月dea:ma("macd.dea#month",21),linethick1 colorgreen; 二,macd日周共振指标[通达信] dif:=ema(close,5)-ema(close,26); dea:=ema(dif,3); macd:=(dif-dea)*2;   dmacd:(ddif-ddea)*2,colorstick; 日金:=cross(ddif,ddea); 周dif:ma(dif,5),pointdot,linethick1,colorwhite; 周dea:ma(dea,5),pointdot,linethick1,color33ff99; 周金:drawtext(cross(周dif,周dea),周dif,  ),colorred; 日周同金:drawtext(cross(周dif,周dea) and 日金,dmacd, 日周同金 ),coloryellow; 三,macd日周共振指标[通达信] diff:=ema(close,48) - ema(close,104); dea:=ema(diff,36); , colorstick; a:macd; g:ma(macd,12);  - ema(close,26),linethick2;  , colorstick; a1:=macd1; g1:=ma(a1,3),color0099ff; stickline(macd1ref(macd1,1)and macd10,0,macd1,2,0),colorffcc33; stickline(macd1ref(macd1,1)and macd10,0,macd1,2,0),colorgreen; stickline(macd1ref(macd1,1)and macd10,0,macd1,2,0),coloryellow; stickline(macd1ref(macd1,1)and macd10,0,macd1,2,0),colorff00ff; 0; 四,kdj日线,周线,月线金叉死叉的公式[大智慧level2,飞狐,通达信] n:=9; m1:=3; m2:=3; rsv:=(close-llv(low,n))(hhv(high,n)-llv(low,n))*100; k:sma(rsv,m1,1); d:sma(k,m2,1); j:3*k-2*d; 周k:ma("kdj.k#week"(n,m1,m2) ,5),pointdot,linethick1,colorwhite; 周d:ma("kdj.d#week"(n,m1,m2) ,5),pointdot,linethick1,color33ff99; 周j:ma("kdj.j#week"(n,m1,m2) ,5),pointdot,linethick1,colormagenta; 周金:drawtext(cross("kdj.k#week"(n,m1,m2),"kdj.d#week"(n,m1,m2)) ,8,  ),colorred; 周死▼:drawtext(cross("kdj.d#week"(n,m1,m2),"kdj.k#week"(n,m1,m2)) ,92, ▼ ),colorgreen; 月金:drawtext(cross("kdj.k#month"(n,m1,m2),"kdj.d#month"(n,m1,m2)) ,0,  ),colormagenta; 月死▼:drawtext(cross("kdj.d#month"(n,m1,m2),"kdj.k#month"(n,m1,m2)) ,100, ▼ ),coloryellow; 五,macd和kdj金叉共振及其选股公式[通达信] 1,源码: dif:(ema(close,12)-ema(close,26))*100;  macd:(dif-dea)*2,colorstick; drawicon(cross(dif,dea),dea,1); drawicon(cross(dea,dif),dea,2); if(difdea,dif,drawnull),colorgreen; 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; 顶背离:=(dd and ee and dea hhv(dea,180))*dea; 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),colorred,linethick2; rsv:=(close-llv(low,9))(hhv(high,9)-llv(low,9))*100; k:sma(rsv,9,3),coloryellow; d:sma(k,9,3),colorwhite; j:3*k-2*d,colormagenta; if(jd,j,drawnull),colorffee44; a1:=barslast(ref(cross(dif,dea),1)); b1:=ref(c,a1+1)c and ref(dif,a1+1)dif and cross(dif,dea); a22:=barslast(ref(cross("kdj.k"(9,3,3),"kdj.d"(9,3,3)),1)); b2:=ref(c,a22+1)c and ref("kdj.k"(9,3,3),a22+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)); drawtext(b1,dea-0.20, macd底背 ),colorwhite; drawtext(b2,d-0.20, kdj底背 ),colorff00ff; {dj:=cross(j,d) and d20; drawtext(dj,j-0.3, 低金叉 ),colorcyan; mdj:=cross(dif,dea) and dea0; drawtext(mdj,dea-0.3, 低金叉 ),colorgreen; drawtext(cross(dea,dif),dif+0.3, 死叉 ),coloryellow; drawtext(cross(d,j),j+0.3, 死叉 ),colorred;} a:=cross(dif,dea) and cross(k,d) and cross(j,d); drawicon(a,low*0.98,1);  and cross("kdj.k"(9,3,3),"kdj.d"(9,3,3)); drawtext(b4,l-0.20, 金叉共振 ),color0099ff; drawicon(cross(k,d),d,1); drawicon(cross(d,k),d,2); ba:=dearef(dea,1); bb:=sum(ba,5)=4; bc:=co; bd:=sum(bc,5)=2; (bb and bd and jref(j,1) and ref(j,1)ref(j,2),3); stickline(bxg,hhv(j,60),hhv(j,60)-20,1,0),colorred; ss:=ema(c,11); ll:=(ema(c,1)+ema(c,2)+ema(c,3)+ema(c,5))4; {短:ema(ll,2),colorgreen,linethick2;} {长:ema(ss,2),colormagenta,linethick2;} aa:=(c-llv(c,10))(hhv(c,10)-llv(c,10)); (cross(aa,0.05)-1); 2,选股公式: dif:=(ema(close,12)-ema(close,26))*100; dea:=ema(dif,9); rsv:=(close-llv(low,9))(hhv(high,9)-llv(low,9))*100; k:=sma(rsv,9,1); d:=sma(k,9,1);  and cross("kdj.k"(9,3,3),"kdj.d"(9,3,3));