找回密码
 立即注册

QQ登录

只需一步,快速开始

广告载入中...
楼主: 雨、

发改进版MACD趋势线指标(源码、贴图、无未来)

 火.. [复制链接]
发表于 2012-12-31 08:31 | 显示全部楼层
THANK YOU O MUCH
回复

使用道具 举报

发表于 2012-12-31 08:48 | 显示全部楼层
学习了
回复

使用道具 举报

发表于 2012-12-31 09:08 | 显示全部楼层
谢谢学长
回复

使用道具 举报

发表于 2012-12-31 09:20 | 显示全部楼层
回复

使用道具 举报

发表于 2012-12-31 23:56 | 显示全部楼层
好好学习天天向上
回复

使用道具 举报

发表于 2013-1-21 00:06 | 显示全部楼层
谢谢分享....
回复

使用道具 举报

发表于 2013-1-22 17:25 | 显示全部楼层
谢谢分享看看
回复

使用道具 举报

发表于 2013-1-22 17:34 | 显示全部楼层
分享了,谢谢!
回复

使用道具 举报

发表于 2013-1-24 21:31 | 显示全部楼层
谢谢分享共同学习
回复

使用道具 举报

发表于 2013-1-25 01:14 | 显示全部楼层
{想法是要快人一步,当然反应快即意味着不稳定}
DIF:EMA(CLOSE,12)-EMA(CLOSE,26),NODRAW;
DEA:EMA(DIF,9),NODRAW;
MACDDIF-DEA)*2,COLORSTICK,COLORRED;
ES:=REF(EMA(C,26),1);
EP:=REF(EMA(C,12),1);
DI:=REF(DIF,1);
DIF穿零价(12+1)*(26-1)*ES-(26+1)*(12-1)*EP)/(2*(26+1)-2*(12+1)),NODRAW,COLORWHITE;
DIF拐点价(12-1)*EP/(12+1)-(26-1)*ES/(26+1)-DI)*(26+1)*(12+1)/(2*(12+1)-2*(26+1)),COLORYELLOW,NODRAW;
TJ1:=DEA<0 AND CROSS(DIF,DEA);{零下金叉}
TJ2:=BARSLAST(CROSS(0,DIF));{下跌起点到现在的周期数}
TJ3:=DEA<0 AND COUNT(TJ1,TJ2+1)>1;{从下跌起点算起,零下金叉两次以上}
TJ4:=DEA<0 AND MACD>0 AND REF(MACD,1)>0
AND REF(MACD,1)<REF(MACD,2) AND MACD>REF(MACD,1);{零下且MACD为正时,DIF,DEA收敛后发散}
TJ5:=BARSLAST(TJ1);{上一次零下金叉到现在的周期数}
TJ6:=DEA<0 AND TJ3 AND COUNT(TJ4,TJ5+1)>0,NODRAW;{零下两次金叉后发生至少一次收敛后发散}
TJ7:=DEA<0 AND COUNT(TJ6,TJ2)>0,NODRAW;{满足条件6的周期}
TJ8:=DEA<0 AND COUNT(TJ1,TJ2+1)>2;{从下跌起点算起,零下金叉三次以上}
TJ9:=DEA<0 AND COUNT(TJ8,TJ2)>0,NODRAW;{满足条件8的周期}
TJ10:=TJ7 AND DIF>0 AND DIF>REF(DIF,1) AND DEA<0;{条件6信号加强}
TJ11:=TJ9 AND DIF>0 AND DIF>REF(DIF,1) AND DEA<0;{条件8信号加强}
TJ12:=DIF>0 AND DEA>0 AND REF(MACD,1) AND REF(MACD,2)<0 AND MACD>REF(MACD,1) AND
REF(MACD,1)<REF(MACD,2);{零上且DIF,DEA反向收敛}
STJ1:=DIF>0 AND MACD>0 AND REF(MACD,1)>0
AND REF(MACD,1)>REF(MACD,2) AND MACD<REF(MACD,1);{零上MACD为正时,DIF,DEA发生收敛}
STJ2:=BARSLAST(CROSS(DIF,0)),NODRAW;{上涨起点到现在的周期数}
STJ3:=BARSLAST(CROSS(DIF,DEA));{上一次金叉以来到现在的周期数}
STJ4:=DIF>0 AND COUNT(STJ1,STJ2)>1 AND COUNT(STJ1,STJ3)>1 AND STJ1;{从上涨起点算起,发生零上收敛两次以上}
STJ5:=DIF>0 AND COUNT(STJ1,STJ2)>2 AND COUNT(STJ1,STJ3)>2 AND STJ1;{从上涨起点算起,发生零上收敛三次以上}
STJ6:=DIF>0 AND COUNT(STJ1,STJ2)>3 AND COUNT(STJ1,STJ3)>3 AND STJ1;{从上涨起点算起,发生零上收敛四次以上}
STJ7:=DIF>0 AND COUNT(STJ1,STJ2)<2 AND CROSS(DEA,DIF);{从上涨起点算起,零上收敛一次即出现死叉}
STJ8:=COUNT(CROSS(DIF,DEA),STJ2)>0 AND STJ1;{零上金叉后出现零上收敛}
STJ9:=DIF>0 AND REF(CROSS(DIF,DEA),1) AND CROSS(DEA,DIF);{零上金叉后随即死叉}
STJ10:=COUNT(DIF>0 AND (STJ4 OR STJ7 OR STJ8 OR STJ9),STJ2);
STJ11:=DIF>0 AND MACD<0 AND REF(MACD,2)<0 AND
MACD<REF(MACD,1) AND REF(MACD,1)>REF(MACD,2);{零上二次向下发散}
减仓提示:STJ10,NODRAW,COLORGREEN;
清仓提示:STJ10>4,NODRAW,COLORMAGENTA;
STICKLINE(DEA<0 AND MACD<0,0,MACD,2,0),COLORBLUE;
STICKLINE(DEA<0 AND MACD>=0,0,MACD,1,-1),COLORBLUE;
STICKLINE(DEA<0 AND MACD>=0 AND MACD<REF(MACD,1),0,MACD,1,1),COLORBLUE;
STICKLINE(DEA>=0 AND MACD>0,0,MACD,0,1),COLORLIRED;
STICKLINE(DEA>=0 AND MACD>0 AND MACD<REF(MACD,1),0,MACD,0,-1),COLORLIRED;
STICKLINE(DEA>=0 AND MACD<0 AND MACD>REF(MACD,1),0,MACD,0,-1),COLORLIRED;
STICKLINE(TJ7 AND MACD>0,0,MACD,2,1),COLORYELLOW;
STICKLINE(TJ7 AND MACD>0 AND MACD<REF(MACD,1),0,MACD,2,-1),COLORYELLOW;
STICKLINE(TJ7 AND MACD<0,0,MACD,2,0),COLORGREEN;
STICKLINE(TJ7 AND MACD<0 AND MACD>REF(MACD,1),0,MACD,2,1),COLORGREEN;
STICKLINE(TJ9 AND MACD>0,0,MACD,2,0),COLORYELLOW;
STICKLINE(TJ9 AND MACD>0 AND MACD<REF(MACD,1),0,MACD,2,1),COLORYELLOW;
STICKLINE(TJ9 AND MACD<0,0,MACD,2,1),COLORGREEN;
STICKLINE(TJ9 AND MACD<0 AND MACD>REF(MACD,1),0,MACD,2,-1),COLORGREEN;
STICKLINE(TJ10,0,MACD,2,1),COLORRED;
STICKLINE(TJ10 AND MACD<REF(MACD,1),0,MACD,2,-1),COLORRED;
STICKLINE(TJ11,0,MACD,2,0),COLORRED;
STICKLINE(TJ11 AND MACD<REF(MACD,1),0,MACD,2,1),COLORRED;
STICKLINE(TJ12,0,DIF,0,-1),COLORRED;
STICKLINE(STJ4,0,MACD,2,-1),COLORGREEN;
DRAWICON(STJ4,DIF*1.03,2);
STICKLINE(STJ5,0,MACD,2,1),COLORGREEN;
DRAWICON(STJ5,DIF*1.03,2);
STICKLINE(STJ6,0,MACD,2,0),COLORGREEN;
DRAWICON(STJ6,DIF*1.03,2);
STICKLINE(STJ7,0,MACD,2,0),COLORGREEN;
DRAWICON(STJ7,DEA*1.03,2);
STICKLINE(STJ8,0,MACD,2,0),COLORBLUE;
DRAWICON(STJ8,DIF*1.03,2);
STICKLINE(STJ9,0,MACD,2,0),COLORBLUE;
DRAWICON(STJ9,DEA*1.03,2);
DRAWTEXT(STJ10>4 AND (STJ4 OR STJ7 OR STJ8 OR STJ9),DIF*1.1,'逃'),COLORMAGENTA;
STICKLINE(STJ11,0,DIF,0,-1),COLORBLUE;
J1:="MACD.DIF"(12,26,9);J2:="MACD.DEA"(12,26,9);
J3:="KDJ.K"(9,3,3);J4:="KDJ.D"(9,3,3);
J5:="RSI.RSI1"(6,12,24);J6:="RSI.RSI2"(6,12,24);
A1:=BARSLAST(REF(CROSS(J1,J2),1));
B1:=REF(C,A1+1)>C AND REF(J1,A1+1)<J1 AND CROSS(J1,J2);
A2:=BARSLAST(REF(CROSS(J3,J4),1));
B2:=REF(C,A2+1)>C AND REF(J3,A2+1)<J3 AND CROSS(J3,J4);
A3:=BARSLAST(REF(CROSS(J5,J6),1));
B3:=REF(C,A3+1)>C AND REF(J5,A3+1)<J5 AND CROSS(J5,J6);
C1:=BARSLAST(REF(CROSS(J2,J1),1));
D1:=REF(C,C1+1)<C AND REF(J1,C1+1)>J1 AND CROSS(J2,J1);
C2:=BARSLAST(REF(CROSS(J4,J3),1));
D2:=REF(C,C2+1)<C AND REF(J3,C2+1)>J3 AND CROSS(J4,J3);
C3:=BARSLAST(REF(CROSS(J6,J5),1));
D3:=REF(C,C3+1)<C AND REF(J5,C3+1)>J5 AND CROSS(J6,J5);
MACD底背离:=FILTER(B1>0,5);
DRAWTEXT(MACD底背离,REF(J1,A1+1),'MACD底背离'),COLORYELLOW;
KDJ底背离:=FILTER(B2>0,5);
DRAWTEXT(KDJ底背离,REF(J1,A1+2),'KDJ底背离'),COLORWHITE;
RSI底背离:=FILTER(B3>0,5);
DRAWTEXT(RSI底背离,REF(J1,A1+3),'RSI底背离'),COLORFFCC66;
MACD顶背离:=FILTER(D1>0,5);
DRAWTEXT(MACD顶背离,REF(J1,D1+1),'MACD顶背离'),COLOR0066FF;
KDJ顶背离:=FILTER(D2>0,5);
DRAWTEXT(KDJ顶背离,REF(J1,D1+2),'KDJ顶背离'),COLOR0000FF;
RSI顶背离:=FILTER(D3>0,5);
DRAWTEXT(RSI顶背离,REF(J1,D1+3),'RSI顶背离'),COLORFF00FF;
DIF,COLORWHITE;
DEA,COLORYELLOW;
回复

使用道具 举报

发表于 2013-1-25 08:11 | 显示全部楼层
学习,学习,在学习!!
回复

使用道具 举报

发表于 2013-1-31 16:50 | 显示全部楼层
好好学习天天向上
本文来自: 股海明灯论坛  详细文章参考:http://www.178448.com/forum.php? ... ;pre_pos=4&ext=
回复

使用道具 举报

发表于 2013-1-31 19:03 | 显示全部楼层
如果您要查看本帖隐藏内容
本文来自: 股海明灯论坛  详细文章参考:http://www.178448.com/thread-432770-1-1.html
回复

使用道具 举报

发表于 2013-2-17 00:26 | 显示全部楼层
DIFIF1:=EMA(CLOSE,12) - EMA(CLOSE,26);
DEAEA1:=EMA(DIFIF1,9);
MACD1:=2*(DIFIF1-DEAEA1),STICK;
MACD2:=EMA(MACD1,3);
STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,1,0),COLORRED;
STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,1,0),COLORGREEN;
STICKLINE(MACD1<MACD2,0,MACD1,1,0),COLORCBCBC0;
STICKLINE(MACD1>=0 OR MACD1<=0,0,0,50,1),COLORWHITE;
DIFIF1,COLOR33FF33,LINETHICK2;
DEAEA1,COLORYELLOW,LINETHICK2;
MACD:MACD1,NODRAW,COLORMAGENTA;
强:IF(DIFIF1>=DEAEA1,DIFIF1,DRAWNULL),COLORRED,LINETHICK2;
弱:=IF(DEAEA1>=DIFIF1,DEAEA1,DRAWNULL),COLORFF9900,LINETHICK2;
DRAWICON(CROSS(DIFIF1,DEAEA1),DIFIF1+0.1,1);
DRAWICON(CROSS(DEAEA1,DIFIF1),0.4,2);
A1:=BARSLAST(REF(CROSS("MACD.DIF","MACD.DEA"),1));
B1:=REF(C,A1+1)>C AND REF("MACD.DIF",A1+1)<"MACD.DIF" AND CROSS("MACD.DIF","MACD.DEA");
DRAWTEXT(B1>0,-0.8,'MACD底背'),COLORFF00FF;
A2:=BARSLAST(REF(CROSS("KDJ.K","KDJ.D"),1));
B2:=REF(C,A2+1)>C AND REF("KDJ.K",A2+1)<"KDJ.K" AND CROSS("KDJ.K","KDJ.D");
DRAWTEXT(B2,-0.6,'KDJ底离'),COLORYELLOW;{KDJ底背离};
A3:=BARSLAST(REF(CROSS("RSI.RSI1","RSI.RSI2"),1));
B3:=REF(C,A3+1)>C AND REF("RSI.RSI1",A3+1)<"RSI.RSI1" AND CROSS("RSI.RSI1","RSI.RSI2");
DRAWTEXT(B3>0,-0.3,'RSI底离'),COLORCYAN;{RSI底背离};
C1:=BARSLAST(REF(CROSS("MACD.DEA","MACD.DIF"),1));
D1:=REF(C,C1+1)<C AND REF("MACD.DIF",C1+1)>"MACD.DIF" AND CROSS("MACD.DEA","MACD.DIF");
DRAWTEXT(D1>0,0.4,'MACD顶离'),COLORBLUE;{MACD顶背离}
C2:=BARSLAST(REF(CROSS("KDJ.D","KDJ.K"),1));
D2:=REF(C,C2+1)<C AND REF("KDJ.K",C2+1)>"KDJ.K" AND CROSS("KDJ.D","KDJ.K");
DRAWTEXT(D2>0,0.6,'KDJ顶离'),COLORLIGRAY;{KDJ顶背离}
C3:=BARSLAST(REF(CROSS("RSI.RSI2","RSI.RSI1"),1));
D3:=REF(C,C3+1)<C AND REF("RSI.RSI1",C3+1)>"RSI.RSI1" AND CROSS("RSI.RSI2","RSI.RSI1"); DRAWTEXT(D3>0,0.8,'RSI顶离'),COLORGREEN;{RSI顶背离};

本文来自: 股海明灯论坛  详细文章参考:http://www.178448.com/forum.php?mod=viewthread&tid=355157&reltid=160432&pre_pos=4&ext=
回复

使用道具 举报

发表于 2013-2-17 00:56 | 显示全部楼层

好好学习天天向上
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|股海明灯官网 ( 京ICP备18020431号 )

GMT+8, 2024-11-23 22:18 , Processed in 0.109168 second(s), Total 9, Slave 8 queries , Gzip On, MemCached On.

Powered by Discuz! X3.5

Copyright © 2001-2024 Tencent Cloud.

快速回复 返回顶部 返回列表