编写要求:
DIFF1:=EMA(CLOSE,SHORT) - EMA(CLOSE,LONG);
DEA1:=EMA(DIFF1,M);
MACD:=2*(DIFF1-DEA1);
DIFF : EMA(CLOSE,SHORT) - EMA(CLOSE,LONG),colorff00ff,linethick2;
DEA : EMA(DIFF1,M),colorwhite,linethick2;
AH:HHV(DIFF1,55),COLOR6600ff,linethick2,layer0;
PARTLINE(ah,ah),COLORWHITE,POINTDOT,linethick2,layer0;
DRAWICON( ref(aH=diff1,1) and DIFFREF(DIFF1,1),al,7),ALIGN1;
{●60零上金叉:IF(CROSS(DIFF,DEA) AND DIFF>0,0.3,0),COLOR6600ff,POINTDOT;
STICKLINE(●60零上金叉,DIFF,ah,4,0),COLOR6600ff;}
■零下金叉:IF(CROSS(DIFF,DEA) AND DIFF<-0.001,0.3,0),COLORWHITE,POINTDOT;
STICKLINE(■零下金叉,0.1,0.15,6,0),COLORWHITE;
JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
■二次金叉:IF(CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1,0.2,0),COLOR3C86CC,POINTDOT;
STICKLINE(■二次金叉,0.15,0.2,6,0),COLOR3C86CC;
A3:=CROSS(DIFF,DEA) AND DEA<0;
■零下二次金叉:IF(FILTER(COUNT(A3,21)=2,10) AND DEA<0,0.05,0),COLORF58F98,POINTDOT;
STICKLINE(■零下二次金叉,0.25,0.3,6,0),COLORF58F98;
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));
■底背离:IF(REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA),0.1,0),COLORFFFF00;
底背离1:STICKLINE(REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA),0,AL,4,0),COLOR00FF00;
STICKLINE(■底背离,0.2,0.25,6,0),COLORFFFF00;
{DRAWLINE(A1=0,DEA,■底背离,DEA,0),COLORYELLOW};
{A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));
顶背离:STICKLINE(REF(CLOSE,A2+1)
解答:
?diff1:=ema(close,short) - ema(close,long);
dea1:=ema(diff1,m);
Copyright 2018- www.dyjian.com/ 大宇股票知识网 海口美兰韩哲棚百货商行 版权所有 琼ICP备2023001966号
免责声名:本站所发表的内容仅用于学术交流和学习,内容所带来的一切后果均与本站无关。若您发现本站存在您非授权的原创作品,请第一时间联系本站删除!