请那位大师帮忙改写一个MACD背离的选股公式,顶背离选出 ,底背离也可以选出,谢谢!
DIF:EMA(CLOSE,12)-EMA(CLOSE,26),NODRAW,COLORWHITE;DEA:EMA(DIF,9),NODRAW,COLORGREEN;DR...
DIF:EMA(CLOSE,12)-EMA(CLOSE,26),NODRAW,COLORWHITE;DEA:EMA(DIF,9),NODRAW,COLORGREEN;DRAWBAND(DIF,RGB(100,20,20),DEA,RGB(50,100,50));STICKLINE(C>0,0,0,28,0)COLORGRAY;MACD:(DIF-DEA)*2,NODRAW,COLOR4080FF;STICKLINE(MACD>0,0,MACD,0,0)COLOR4080FF;STICKLINE(MACD<0,0,MACD,0,0)COLORLIBLUE;NOTEXT:MACD,COLORWHITE;均MACD:EMA(MACD,5)COLORYELLOW;DRAWICON(CROSS(MACD,均MACD),REF(MACD,1),1);DRAWICON(CROSS(均MACD,MACD),REF(MACD,1),2);DRAWTEXT_FIX(C>0,0.00,0,0,'MACD柱线均势和背离'),COLORWHITE;A1:=BARSLAST(REF(CROSS(MACD,均MACD),1));金叉底背:=REF(CLOSE,A1+1)>CLOSE AND MACD>REF(MACD,A1+1) AND CROSS(MACD,均MACD);DRAWTEXT(金叉底背,REF(MACD,1),'__底背'),COLORYELLOW;DRAWLINE(A1=0,均MACD,金叉底背,均MACD,0),COLORLIRED,DOTLINE;{底背画线};A2:=BARSLAST(REF(CROSS(均MACD,MACD),1));死叉顶背:=REF(CLOSE,A2+1)<CLOSE AND REF(MACD,A2+1)>MACD AND CROSS(均MACD,MACD);DRAWTEXT(死叉顶背,REF(MACD,1),'__顶背'),COLORLIGREEN;DRAWLINE(A2=0,均MACD,死叉顶背,均MACD,0),COLORGREEN,DOTLINE;{顶背画线};
如果可以的话再帮忙写一个金叉和死叉都能选出的 公式,谢谢, 展开
如果可以的话再帮忙写一个金叉和死叉都能选出的 公式,谢谢, 展开
展开全部
根据题意,选股公式如下:
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
MACD:=(DIF-DEA)*2;
均MACD:=EMA(MACD,5);
A1:=BARSLAST(REF(CROSS(MACD,均MACD),1));
金叉底背:=REF(CLOSE,A1+1)>CLOSE AND MACD>REF(MACD,A1+1) AND CROSS(MACD,均MACD);
A2:=BARSLAST(REF(CROSS(均MACD,MACD),1));
死叉顶背:=REF(CLOSE,A2+1)<CLOSE AND REF(MACD,A2+1)>MACD AND CROSS(均MACD,MACD);
金叉底背 OR 死叉顶背;
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
MACD:=(DIF-DEA)*2;
均MACD:=EMA(MACD,5);
A1:=BARSLAST(REF(CROSS(MACD,均MACD),1));
金叉底背:=REF(CLOSE,A1+1)>CLOSE AND MACD>REF(MACD,A1+1) AND CROSS(MACD,均MACD);
A2:=BARSLAST(REF(CROSS(均MACD,MACD),1));
死叉顶背:=REF(CLOSE,A2+1)<CLOSE AND REF(MACD,A2+1)>MACD AND CROSS(均MACD,MACD);
金叉底背 OR 死叉顶背;
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询