最新更新 - 网站地图 - 手机版
您的当前位置:爱购股票学习网 > 股票公式 > 公式技巧 > MACD指标背离画线功能

MACD指标背离画线功能

来源:网络 点击: 时间:2018-08-21

编写要求:

各位老师好,自己把这个公式加入了背离画线功能,但不能显示,请老师指点 源码:DIFF: EMA(CLOSE,12) - EMA(CLOSE,26); DEA: EMA(DIFF,9); MACD : 2*(DIFF-DEA), COLORSTICK,COLOR5454FF; 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; 上升背离:(CC AND EE)*DEA,COLOR00FFFF; 顶背离:(DD AND EE AND DEA< HHV(DEA,180))*DEA,STICK,LINETHICK3,COLORGREEN; FF:=C=LLV(C,180); GG:= DEA> REF(DEA,1) AND REF(DEA> REF(DEA,1),1)=1; LL:=C< REF(C,1) AND REF(C< REF(C,1),1)=1; 下降背离:(LL AND GG)*DEA,COLORMAGENTA; 底背离:(FF AND GG AND DEA> LLV(DEA,180))*DEA,STICK,LINETHICK3,COLORRED; MM:=IF(MACD< 0,MACD,0); JJ:=MM> REF(MM,1); ZZ:=REF(JJ,1)=1; 介入区:(JJ AND ZZ)*DEA,POINTDOT,COLORRED;{MACD蓝柱缩短---指今日比昨天短} STICKLINE(介入区=DEA,DEA,DIFF,3,0),COLORRED; DRAWTEXT(CROSS(DIFF,DEA ),0,'★'),COLORRED; DRAWTEXT(CROSS(DEA,DIFF ),0,'★'),COLORGREEN; A1:= BARSLAST(REF(CROSS(DEA,DIFF),1)); 底背离2:=REF(CLOSE,A1+1)DIFF AND CROSS(DEA,DIFF); 顶背:DRAWLINE(A1=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK2;

解答:

?DIFF:EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:EMA(DIFF,9);
MACD:2*(DIFF-DEA), COLORSTICK;
CC:=LAST(MACD>=REF(MACD,1),3,1);
DD:=MACD CC1:=LAST(MACD<=REF(MACD,1),3,1);
DD1:=MACD>REF(MACD,1);
STICKLINE(CC AND DD AND MACD>0,MACD,0,0,0),COLORDDDD00;
STICKLINE(CC1 AND DD1 AND MACD<0,MACD,0,0,0),COLOR0000DD;
DRAWICON(BB,DEA,11);0,VOLSTICK,COLORDDDD00;
低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;
JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);
DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK1;
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
顶背离:=REF(CLOSE,A2+1)DIFF AND CROSS(DEA,DIFF);
DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN;

标签:

    Copyright 2018- www.igojr.com 爱购股票学习网 版权所有 邮箱:terrylm@qq.com

    免责声名:本站所发表的内容仅用于学术交流和学习,内容所带来的一切后果均与本站无关。若您发现本站存在您非授权的原创作品,请第一时间联系本站删除!

    Top