: | : | :期货量化学习 | :期货量化 |
返回列表 发帖

[大智慧指标] [转载]MACD 背离与面积不错的研判技术【付图,源码,贴图,说明】

[大智慧指标] [转载]MACD 背离与面积不错的研判技术【付图,源码,贴图,说明】

001.jpg

  1. DIFF:EMA(CLOSE,10) - EMA(CLOSE,22),LINETHICK0;
  2. DEA :EMA(DIFF,7.5),LINETHICK0;
  3. MACD :2*(DIFF-DEA),LINETHICK0;
  4. HZL:=CROSS(MACD,0);
  5. LZH:=CROSS(0,MACD);
  6. BC:=BARSLAST(HZL OR LZH)+1;
  7. ZGHZ:=IF(MACD>0,HHV(MACD,bc),0);
  8. ZDLZ:=IF(MACD<0,LLV(MACD,bc),0);
  9. FILLRGN(ZDLZ,0,MACD<0,RGB(44,88,44),MACD<0,RGB(0,0,0));
  10. FILLRGN(ZGHZ,0,MACD>0,RGB(99,55,55),MACD<0,RGB(0,0,0));
  11. FILLRGN(DIFF,DEA,DIFF>DEA,RGB(142,66,140),DIFF<DEA,RGB(64,129,129));{
  12. PARTLINE(CROSS(DIFF,DEA) AND DIFF<0,DIFF),CROSSDOT,LINETHICK3,COLORff00FF;
  13. PARTLINE(CROSS(DEA ,DIFF),DIFF),CROSSDOT,LINETHICK3,COLOR00ff00;}
  14. STICKLINE(MACD>0 AND MACD>REF(MACD,1),0,MACD,5,1),COLORRED;
  15. STICKLINE(MACD>0 AND MACD<REF(MACD,1),0,MACD,5,0),COLOR90FF00;
  16. STICKLINE(MACD<0 AND MACD<REF(MACD,1),0,MACD,5,1),COLOREFFF00;
  17. STICKLINE(MACD<0 AND MACD>REF(MACD,1),0,MACD,5,0),COLORFFAAFF;
  18. ↑:TROUGHBARS(3,3,1),COLOR0000FF,LINETHICK0;
  19. ↓:PEAKBARS(3,3,1),COLOR00FF00,LINETHICK0;
  20. 低:=IF(↑=0,DIFF,IF(↓<↑,TROUGH(3,3,1),REF(TROUGH(3,3,1),1)));
  21. 高:=IF(↓=0,DIFF,IF(↑<↓,PEAK(3,3,1),REF(PEAK(3,3,1),1)));
  22. STICKLINE(↑=0 AND DIFF<0 AND DIFF<DEA,0,DIFF,0,0),COLOR0000FF;
  23. STICKLINE(↓=0 AND DIFF>0 AND DIFF>DEA,DIFF,0,0,0),COLOR00FF00;
  24. DRAWTEXT(↑=0 AND DIFF<0 AND DIFF<DEA,DIFF,'低'),COLORWHITE;
  25. DRAWTEXT(↓=0 AND DIFF>0 AND DIFF>DEA,DIFF,'高'),COLOR11FF11;
  26. PARTLINE(DIFF,CROSS(DIFF,DEA ) AND DIFF<0,RGB(2,224,12)),CROSSDOT,LINETHICK3;
  27. PARTLINE(DIFF,CROSS(DIFF,DEA ) AND DIFF>0,RGB(255,22,222)),CROSSDOT,LINETHICK3;
  28. PARTLINE(DIFF,CROSS(DEA,DIFF ),RGB(255,245,12)),CIRCLEDOT,LINETHICK3;
  29. DRAWFLAGTEXT(CROSS(DIFF,DEA ) AND DIFF<0,DIFF,'MACD<0金叉');
  30. DRAWFLAGTEXT(CROSS(DIFF,DEA ) AND DIFF>0,DIFF,'MACD>0金叉');
  31. DRAWFLAGTEXT(CROSS(DEA ,DIFF),DIFF,'死叉');
  32. A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
  33. B1:=REF(C,A1+1)>C AND REF(DIFF,A1+1)<DIFF AND CROSS(DIFF,DEA);
  34. DRAWTEXT(FILTER(B1>0,5),0,'←MACD'),COLORGREEN;
  35. A2:=BARSLAST(REF(CROSS("KDJ.K","KDJ.D"),1));
  36. B2:=REF(C,A2+1)>C AND REF("KDJ.K",A2+1)<"KDJ.K" AND CROSS("KDJ.K","KDJ.D");
  37. DRAWTEXT(FILTER(B2>0,5),MACD,'←KDJ'),COLORYELLOW;
  38. A3:=BARSLAST(REF(CROSS("RSI.RSI1","RSI.RSI2"),1));
  39. B3:=REF(C,A3+1)>C AND REF("RSI.RSI1",A3+1)<"RSI.RSI1" AND CROSS("RSI.RSI1","RSI.RSI2");
  40. DRAWTEXT(FILTER(B3>0,5),MACD,'←RSI'),COLORCYAN;
  41. C1:=BARSLAST(REF(CROSS(DEA,DIFF),1));
  42. D1:=REF(C,C1+1)<C AND REF(DIFF,C1+1)>DIFF AND CROSS(DEA,DIFF);
  43. DRAWTEXT(FILTER(D1>0,5),MACD,'←MACD'),COLORWHITE;
  44. C2:=BARSLAST(REF(CROSS("KDJ.D","KDJ.K"),1));
  45. D2:=REF(C,C2+1)<C AND REF("KDJ.K",C2+1)>"KDJ.K" AND CROSS("KDJ.D","KDJ.K");
  46. DRAWTEXT(FILTER(D2>0,5),MACD,'←KDJ'),COLORWHITE;
  47. C3:=BARSLAST(REF(CROSS("RSI.RSI2","RSI.RSI1"),1));
  48. D3:=REF(C,C3+1)<C AND REF("RSI.RSI1",C3+1)>"RSI.RSI1" AND CROSS("RSI.RSI2","RSI.RSI1");
  49. DRAWTEXT(FILTER(D3>0,5),MACD,'←RSI'),COLORMAGENTA;
  50. DRAWFLAGTEXT(FILTER(B2>0,5),MACD,'KDJ金叉');
  51. DRAWFLAGTEXT(FILTER(B3>0,5),MACD,'RSI金叉');
  52. DRAWFLAGTEXT(FILTER(D2>0,5),MACD,'KDJ死叉');
  53. DRAWFLAGTEXT(FILTER(D3>0,5),MACD,'RSI死叉');
  54. DRAWTEXTABS(2,8,'【精华8个字 买小卖小,缩头缩脚】 当股价一波比一波高时,反而红柱的堆,一堆比一堆小,证明产生了顶背离现象,应该及时卖出'+''),Color1111FF;
  55. DRAWTEXTABS(200,22,'当股价一波比一波低时,反而绿柱的堆,一堆比一堆小,证明产生了底背离现象,应该及时买进'+''),Color11FF11;
复制代码

论坛官方微信、群(期货热点、量化探讨、开户与绑定实盘)
 
期货论坛 - 版权/免责声明   1.本站发布源码(包括函数、指标、策略等)均属开放源码,用意在于让使用者学习程序化语法撰写,使用者可以任意修改语法內容并调整参数。仅限用于个人学习使用,请勿转载、滥用,严禁私自连接实盘账户交易
  2.本站发布资讯(包括文章、视频、历史记录、教材、评论、资讯、交易方案等)均系转载自网络主流媒体,内容仅为作者当日个人观点,本网转载此文出于传递更多信息之目的,并不意味着赞同其观点或证实其描述。本网不对该类信息或数据做任何保证。不对您构成任何投资建议,不能依靠信息而取代自身独立判断,不对因使用本篇文章所诉信息或观点等导致的损失承担任何责任。
  3.本站发布资源(包括书籍、杂志、文档、软件等)均从互联网搜索而来,仅供个人免费交流学习,不可用作商业用途,本站不对显示的内容承担任何责任。请在下载后24小时内删除。如果喜欢,请购买正版,谢谢合作!
  4.龙听期货论坛原创文章属本网版权作品,转载须注明来源“龙听期货论坛”,违者本网将保留追究其相关法律责任的权力。本论坛除发布原创文章外,亦致力于优秀财经文章的交流分享,部分文章推送时若未能及时与原作者取得联系并涉及版权问题时,请及时联系删除。联系方式:http://www.qhlt.cn/thread-262-1-1.html
如何访问权限为100/255贴子:/thread-37840-1-1.html;注册后仍无法回复:/thread-23-1-1.html;微信/QQ群:/thread-262-1-1.html;网盘链接失效解决办法:/thread-93307-1-1.html

返回列表