编写要求:
N:=2;
SHORT:=12*N;
LONG:=29*N;
M:=9*N;
DIFF : EMA(CLOSE,SHORT) - EMA(CLOSE,LONG);
DEA : EMA(DIFF,M);
MACD : 2*(DIFF-DEA), COLORSTICK;
0,dotline,colorwhite;
{以下处理底背离}
N1:=last(MACD<0);{绿柱天数}
N2:=REF(last(MACD>0),N1);{绿柱前红柱天数}
N3:=REF(last(MACD<0),N2+N1);{红柱前绿柱天数}
MINMD1:=LLV(MACD,N1);
MINMD3:=REF(LLV(MACD,N3+N2),N1);
MINDIFF1:=LLV(DIFF,N1);
MINDIFF3:=REF(LLV(DIFF,N2+N3),N1);
MINDEA1:=LLV(DEA,N1);
MINDEA3:=REF(LLV(DEA,N2+N3),N1);
股价L1:=LLV(L,N1);
股价L3:=REF(LLV(L,N2+N3),N1);
股价LL:=LLV(L,N1+N2+N3);
绿柱缩短:=MACD<0 AND MACD>REF(MACD,1) AND REF(MACD,1)MINMD3;
DIFF底背离:=DIFF<0 AND MINDIFF1>MINDIFF3;
DEA底背离:=DEA<0 AND MINDEA1>MINDEA3;
股价新低:=股价L1=股价LL and 股价L1/股价L3<0.9;
底背离:绿柱缩短 AND MACD底背离 AND DIFF底背离 AND DEA底背离 AND 股价新低,COLORRED,PRECIS0,LINETHICK0;
VERTLINE(底背离 ,1 ),colorred;
DRAWICON(底背离,MACD*0.97,1,1),ALIGN1;
{以下处理顶背离}
M1:=last(MACD>0);{ 红柱天数}
M2:=REF(last(MACD<0),M1); {红柱前绿柱天数}
M3:=REF(last(MACD>0),M2+M1); {绿柱前红柱天数}
MAXMD1:=HHV(MACD,M1);
MAXMD3:=REF(HHV(MACD,M3+M2),M1);
MAXDIFF1:=HHV(DIFF,M1);
MAXDIFF3:=REF(HHV(DIFF,M2+M3),M1);
MAXDEA1:=HHV(DEA,M1);
MAXDEA3:=REF(HHV(DEA,M2+M3),M1);
股价H1:=HHV(H,M1);
股价HH:=HHV(H,M1+M2+M3);
红柱缩短:=MACD>0 AND MACDREF(MACD,2);
MACD顶背离:=MACD>0 AND MAXMD1 解答: ?N:=2; SHORT:=12*N;
Copyright 2018- www.dyjian.com/ 大宇股票知识网 海口美兰韩哲棚百货商行 版权所有 琼ICP备2023001966号
免责声名:本站所发表的内容仅用于学术交流和学习,内容所带来的一切后果均与本站无关。若您发现本站存在您非授权的原创作品,请第一时间联系本站删除!