返回顶部
  • 发帖数532
  • 粉丝0

此人很懒,什么也没有留下

  • 最佳新人

  • 活跃会员

    经常参与各类话题的讨论,发帖内容较有主见
  • 热心会员

    经常帮助其他会员答疑
  • 终身成就

    为论坛做出突出贡献的会员
  • 爆料达人

    发帖爆料达人
开启左侧

[技巧] MACD多周期确认副图指标公式源码

[复制链接]
股票大数据 首发之星 显示全部楼层 发表于 2022-3-28 22:17:10 |阅读模式 打印 上一主题 下一主题
灵通疑MACD多周期确认副图目标公式源码(无源码的请下载附件导进)

{MACD工夫}
{3,7,3}{7,21,2}{12,52,9}
N:=3;
M:=9;
M1:=3;

DIF:EMA(CLOSE,N)-EMA(CLOSE,M),NODRAW;
DEA:EMA(DIF,M1),NODRAW;
MACD:(DIF-DEA)*2,COLORSTICK;
{多周期统计}
当白:IF(BARSLAST(MACD<0),BARSLAST(MACD<0),0),NODRAW,COLORRED;
当绿:IF(BARSLAST(MACD>0),BARSLAST(MACD>0),0),NODRAW,COLORGREEN;
{MACD周值}
周DIF:="MACD.DIF#WEEK";
周DEA:="MACD.DEA#WEEK";
周MACD:=(周DIF-周DEA)*2;
周白:IF(周MACD>0,BARSLAST(CROSS(周MACD,0)),DRAWNULL)+1,COLORYELLOW,NODRAW;
周绿:IF(周MACD<0,BARSLAST(CROSS(0,周MACD)),DRAWNULL)+1,COLORCYAN,NODRAW;
{MACD月值}
月DIF:="MACD.DIF#MONTH";
月DEA:="MACD.DEA#MONTH";
月MACD:=(月DIF-月DEA)*2;
月白:IF(月MACD>0,BARSLAST(CROSS(月MACD,0)),DRAWNULL)+1,COLORRED,NODRAW;
月绿:IF(月MACD<0,BARSLAST(CROSS(0,月MACD)),DRAWNULL)+1,COLORGREEN,NODRAW;
STICKLINE(MACD>REF(MACD,1) AND MACD>0,0,MACD,1,0),COLORRED;
STICKLINE(MACD<REF(MACD,1) AND MACD>0,0,MACD,1,-1),COLORRED;
STICKLINE(MACD>REF(MACD,1) AND MACD<0,0,MACD,1,0),COLORGREEN;
STICKLINE(MACD<REF(MACD,1) AND MACD<0,0,MACD,1,-1),COLORGREEN;
ZM:=REF(MACD,BARSLAST(周白=1));
STICKLINE(MACD>ZM AND ZM>0,ZM,ZM,1,0),COLORWHITE;
DRAWBAND(DEA,RGB(250,250,0),DEA,RGB(0,0,0));
DRAWBAND(IF(DIF>DEA,DIF,DRAWNULL),RGB(250,0,0),DIF,RGB(0,0,0));
DRAWBAND(IF(周白<1,DEA,DRAWNULL),RGB(0,250,0),DEA,RGB(0,0,0));
DRAWTEXT(周白=1,0,'周'),COLORYELLOW,DRAWABOVE;
低位金叉:=CROSS(DIF,DEA) AND DIF<-0.1;
JCCOUNT:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));
两次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;
DRAWTEXT(两次金叉,DEA*0.2,'两金'),COLORWHITE;
三次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=3,60)=1;
DRAWTEXT(三次金叉,DEA*0.2,'三金'),COLORLIMAGENTA;
四次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=4,90)=1;
DRAWTEXT(四次金叉,DEA*0.2,'四金'),COLORYELLOW;
五次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=5,120)=1;
DRAWTEXT(五次金叉,DEA*0.2,'五金'),COLORBROWN;
六次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(JCCOUNT=6,150)=1;
DRAWTEXT(六次金叉,DEA*0.2,'六金'),COLORBLUE;
{MACD日线底背叛}
A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
底背叛:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA);
DRAWTEXT(底背叛,DIF*0.5,'底背'),COLORRED;
{日底背绘线:DRAWLINE(A1=0,DEA,底背叛,DEA,0),COLORRED,DOTLINE;}
{MACD日线顶背叛}
A2:=BARSLAST(REF(CROSS(DEA,DIF),1));
顶背叛:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF AND CROSS(DEA,DIF);
DRAWTEXT(顶背叛,DIF*1.12,'顶背'),COLORGREEN;
{日顶背绘线:DRAWLINE(A2=0,DEA,顶背叛,DEA,0),COLORGREEN,DOTLINE;}
{MACD积背叛}
JC:= DEA-DIF;
绿柱里积:=IF(MACD<0,SUM(MACD,BARSLAST(JC<0)),0);
白柱里积:=IF(MACD>0,SUM(MACD,BARSLAST(JC>0)),0);
本次最低价:=LLV(L,BARSLAST(JC<0));
本次最下价:=HHV(H,BARSLAST(JC>0));
X1:=IF (MACD<0,BARSLAST(CROSS(DIF,DEA)),0);
上次绿柱里积:=REF(绿柱里积,X1+1);
上次最低价:=REF(本次最低价,X1+1);
Y1:=IF((绿柱里积<0 AND ABS(绿柱里积)<ABS(上次绿柱里积) AND 本次最低价<上次最低价 ),1,0);
RS1:= MACD<0 AND REF(MACD,1)<0 AND C<上次最低价
AND ABS(绿柱里积)<ABS(上次绿柱里积) AND ABS(MACD)<ABS(REF(MACD,1));
底背驰:= IF (CROSS(DIF,DEA),REF(Y1,1),0);
DRAWTEXT(底背驰,DEA*0.8,'积底背'),COLORFF80FF;
X2:=IF (MACD>0,BARSLAST(CROSS(DEA,DIF)),0);
上次白柱里积:=REF(白柱里积,X2+1);
上次最下价:=REF(本次最下价,X2+1);
Y2:=IF((白柱里积>0 AND 白柱里积<上次白柱里积 AND 本次最下价>上次最下价 ),1,0);
RS2:= MACD>0 AND REF(MACD,1)>0 AND C>上次最下价 AND ABS(白柱里积)<ABS(上次白柱里积) AND ABS(MACD)<ABS(REF(MACD,1));
顶背驰:= IF (CROSS(DEA,DIF),REF(Y2,1),0);
DRAWTEXT(顶背驰,DEA*0.8,'积顶背'),COLORCYAN;
周K:="KDJ.K#WEEK";周D:="KDJ.D#WEEK";
DRAWTEXT(CROSS(周K,周D),0,'KDJ周'),COLORYELLOW;
DRAWTEXT_FIX(1,0.02,0.06,0,'周线金叉呈现正在周一,周五开盘后才气肯定旌旗灯号能否建立'),COLORLIGRAY;





上一篇:潜伏等主升副图/选股预警指标公式源码
下一篇:趋势赢家副图指标公式一个精品趋势指标公式源码
您需要登录后才可以回帖 登录 | 立即注册 用百度帐号登录

本版积分规则

首发之家社区成立于2011年3月,内容涉及3C家电、数码生活智能电视,股票软件,4K,体育,软件,教育,游戏等资源指标公式论坛。
  • 官方手机版

  • 抖音号

  • 商务合作

  • Powered by Discuz! X3.4 | Copyright © 2011-2021, Tencent Cloud. | 首发之家社区
  • |网站地图 | mp4d@qq.com|小黑屋|手机版|