MACD背离建仓[同花顺公式]
相关标签: 最精确的macd背离公式 、 macd背离指标公式集锦 、 macd指标背离图解 、 macd顶底背离指标公式 、 macd背离指标公式源码 、 通达信原始macd公式 、 徐小明macd背离公式 、 通达信macd背离公式 、 通达信macd背离指标公式 、 macd背离起涨点副图指标 、 通达信macd背离指标源码 、 macd底背离选股指标公式 、
SHORT:=12;LONG:=26;N:=5;M:=9;n1:=21;M1:=10;M2:=80;M3:=20;DIFF := MA(EMA(CLOSE,SHORT) - EMA(CLOSE,LONG),N);DEA : =EMA(DIFF,M);MACDx : 2*(DIFF-DEA),colorwhite;Zero : =0;gj:=MAX(C,O);STICKLINE(MACDx>0 AND MACDx>=REF(MACDx,1),0,MACDx,2,0),color0000ff;STICKLINE(MACDx>0 AND MACDx<REF(MACDx,1),0,MACDx,2,0),colorffff00;STICKLINE(MACDx<0 AND MACDx>=REF(MACDx,1),0,MACDx,2,0),colorff00ff;///STICKLINE(MACDx<0 AND MACDx<REF(MACDx,1),0,MACDx,2,0),color00ff00;L4:=LLV(gj,4);//www.cxh99.comjl:=(HHV(diff,55)-LLV(diff,55))/5;gt:=dea>REF(dea,1) AND REF(dea,1)<REF(dea,2);A1:=BARSLAST(REF(gt,1));//底背离:=REF(L4,A1+1)>CLOSE AND diff>REF(diff,A1+1) AND gt;//DRAWLINE(A1=0,DEA,底背离,REF(DEA,A1),0),colorred,LINETHICK2;//DRAWLINE(底背离,DEA,底背离,REF(DEA,A1),0),colorred,LINETHICK2;//DRAWTEXT(底背离,REF(DEA,A1)*1.18,' 底背离'),COLORFF00FF;H4:=HHV(gj,4);gt2:=dea<REF(dea,1) AND REF(dea,1)>REF(dea,2);A2:=BARSLAST(REF(gt2,1));//顶背离:= REF(H4,A2+1)<H4 AND diff<REF(diff,A2+1) AND gt2;//DRAWLINE(A2=0 ,DEA,顶背离,REF(DEA,A2),0),colorgreen,LINETHICK2;//DRAWLINE(顶背离,DEA,顶背离,REF(DEA,A2),0),colorgreen,LINETHICK2;//DRAWTEXT(顶背离,REF(DEA,A2)*1.18,' 顶背离'),COLORGREEN;//http://www.cxh99.com////////////////////////////////////////////////////////////////////////////DIFFy : =MA(EMA(CLOSE,SHORT) - EMA(CLOSE,LONG),N1);DEAy : =EMA(DIFFy,M);MACDy : 2*(DIFFy-DEAy),coloryellow;Zeroy : 0;gjy:=MAX(C,O);STICKLINE(MACDy>0 AND MACDx>=REF(MACDy,1),0,MACDy,2,0),color0000ff;STICKLINE(MACDy>0 AND MACDx<REF(MACDy,1),0,MACDy,2,0),colorffff00;STICKLINE(MACDy<0 AND MACDx>=REF(MACDy,1),0,MACDy,2,0),colorff00ff;STICKLINE(MACDy<0 AND MACDx<REF(MACDy,1),0,MACDy,2,0),color00ff00;L4y:=LLV(gjy,4);jly:=(HHV(diff,55)-LLV(diff,55))/5;gty:=dea>REF(dea,1) AND REF(dea,1)<REF(dea,2);A1y:=BARSLAST(REF(gty,1));//底背离y:=REF(L4y,A1y+1)>CLOSE AND diff>REF(diff,A1y+1) AND gty;//DRAWLINE(A1y=0,DEAy,底背离y,REF(DEAy,A1y),0),colorred,LINETHICK2;//DRAWLINE(底背离y,DEAy,底背离y,REF(DEAy,A1y),0),colorred,LINETHICK2;//DRAWTEXT(底背离y,REF(DEAy,A1y)*1.18,' 底背离'),COLORFF00FF;H4y:=HHV(gjy,4);gt2y:=dea<REF(dea,1) AND REF(dea,1)>REF(dea,2);A2y:=BARSLAST(REF(gt2y,1));顶背离y:= REF(H4y,A2y+1)<H4y AND diff<REF(diff,A2y+1) AND gt2y;//DRAWLINE(A2y=0 ,DEAy,顶背离y,REF(DEAy,A2y),0),colorgreen,LINETHICK2;//DRAWLINE(顶背离y,DEAy,顶背离y,REF(DEAy,A2y),0),colorgreen,LINETHICK2;//DRAWTEXT(顶背离y,REF(DEAy,A2y)*1.18,' 顶背离'),COLORGREEN;//http://www.cxh99.com///////////////////////////////////////////////////////////////////////////////21日线DRAWICON(CROSS(MACDY,0) AND C<O,0,6);DRAWICON(CROSS(MACDY,0) AND C<O,0,2);DRAWICON(CROSS(MACDY,0) AND C>=O,0,5);DRAWICON(CROSS(MACDY,0) AND C>=O,0,1);//5日线DRAWICON(CROSS(MACD,0) AND C<O,0,6);DRAWICON(CROSS(MACD,0) AND C<O,0,2);DRAWICON(CROSS(MACD,0) AND C>=O,0,5);DRAWICON(CROSS(MACD,0) AND C>=O,0,1);////////////////////////////////////////////////////////////////////////////////////////////////////////必进清仓ema1:=EMA(CLOSE,13);ema2:=EMA(CLOSE,34),colorred;ema3:=EMA(CLOSE,55),colorcyan;var11:=ZIG(3,6)>REF(ZIG(3,6),1) AND REF(ZIG(3,6),1)<=REF(ZIG(3,6),2) AND REF(ZIG(3,6),2)<=REF(ZIG(3,6),3);var12:=ZIG(3,6)<REF(ZIG(3,6),1) AND REF(ZIG(3,6),1)>=REF(ZIG(3,6),2) AND REF(ZIG(3,6),2)>=REF(ZIG(3,6),3);var13:=ZIG(3,22)>REF(ZIG(3,22),1) AND REF(ZIG(3,22),1)<=REF(ZIG(3,22),2) AND REF(ZIG(3,22),2)<=REF(ZIG(3,22),3);var14:=ZIG(3,22)<REF(ZIG(3,22),1) AND REF(ZIG(3,22),1)>=REF(ZIG(3,22),2) AND REF(ZIG(3,22),2)>=REF(ZIG(3,22),3);var15:=ZIG(3,51)>REF(ZIG(3,51),1) AND REF(ZIG(3,51),1)<=REF(ZIG(3,51),2) AND REF(ZIG(3,51),2)<=REF(ZIG(3,51),3);var16:=ZIG(3,51)<REF(ZIG(3,51),1) AND REF(ZIG(3,51),1)>=REF(ZIG(3,51),2) AND REF(ZIG(3,51),2)>=REF(ZIG(3,51),3);var17:=ZIG(3,72)>REF(ZIG(3,72),1) AND REF(ZIG(3,72),1)<=REF(ZIG(3,72),2) AND REF(ZIG(3,72),2)<=REF(ZIG(3,72),3);var18:=ZIG(3,72)<REF(ZIG(3,72),1) AND REF(ZIG(3,72),1)>=REF(ZIG(3,72),2) AND REF(ZIG(3,72),2)>=REF(ZIG(3,72),3);买:=(var11+var13+var15+var17);卖:=(var12+var14+var16+var18);//威廉指标WR:=100*(HHV(HIGH,M1)-CLOSE)/(HHV(HIGH,M1)-LLV(LOW,M1));B:=CROSS(M2,WR);S:=(CROSS(WR,M2)) OR (CROSS(WR,M3));bm:=BARSLAST(b);sm:=BARSLAST(s);bm1:=IF(bm[1]=-1 AND b,1,IF(bm[1]!=-1 AND sm[1]!=-1 AND bm[1]>sm[1] AND b AND b[1]=0,1,0));sm1:=IF(sm[1]=-1 AND bm[1]!=-1 AND s,1,IF( sm[1]!=-1 AND bm[1]!=-1 AND sm[1]>bm[1] AND s AND s[1]=0,1,0));//大盘金叉D1:=CROSS(INDEXC,MA(INDEXC,5));//KQY指标V1:=MA(C,3)=HHV(MA(C,3),7);V2:=MA(C,3)>MA(C,5);V3:=MA(V,5)>MA(V,10)*1.01;V4:=COUNT(MA(C,1)>REF(C,1),2)=2;LC20:=REF(CLOSE,1);RSI20:=SMA(MAX(CLOSE-LC20,0),4.1,1)/SMA(ABS(CLOSE-LC20),4.1,1)*100;VAR3A:=3;//www.cxh99.comVAR2A:=3*SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1)-2*SMA(SMA((CLOSE-LLV(LOW,27))/(HHV(HIGH,27)-LLV(LOW,27))*100,5,1),3,1);MTM:=C-REF(C,1);DX:=100*EMA(EMA(MTM,6),6)/EMA(EMA(ABS(MTM),6),6);YXF:=IF(LLV(DX,2)=LLV(DX,7) AND COUNT(DX<0,2) AND CROSS(DX,MA(DX,2)),1,0);加仓:=IF(FILTER(YXF=1,5),5,0),colorliblue,LINETHICK1;A51:=3*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1)-2*SMA((C-LLV(L,55))/(HHV(H,55)-LLV(L,55))*100,5,1);FY:=EMA(A51,5);A54:=((C-LLV(L,21))/(HHV(H,21)-LLV(L,21)))*100;VAR1:=(CLOSE-LLV(LOW,9))/(HHV(HIGH,9)-LLV(LOW,9))*50;kqy1:=(EMA(VAR1,3))*2;kqy2:=MA(kqy1,3);买2:=ZIG(3,10)>REF(ZIG(3,10),1) AND REF(ZIG(3,10),1)<REF(ZIG(3,10),2),colorred,LINETHICK2;卖2:=ZIG(3,10)<REF(ZIG(3,10),1) AND REF(ZIG(3,10),1)>REF(ZIG(3,10),2),colorwhite,LINETHICK1;//股票均线金叉JC:=CROSS(CLOSE,MA(CLOSE,MA(CLOSE,5)));CLOSE_1:=CLOSE,colorwhite;MA5:=MA(CLOSE,5),coloryellow;M5:=MA(CLOSE,M),coloryellow;//M10:=MA(CLOSE,10),colormagenta;//CLOSE1:=CLOSE,colorwhite;LOW1:=LOW,colorwhite;LOW144:=LLV(LOW,144),coloryellow;LOW144_1:=LOW144*0.95,coloryellow;//STICKLINE(INDEXC>INDEXO,LOW144_1,LOW144,1,0),colorred;//柱线//STICKLINE(INDEXC<INDEXO,LOW144_1,LOW144,1,0),COLORGREEN;//http://www.cxh99.com//柱线//STICKLINE(CROSS(INDEXC,MA(INDEXC,5)),LOW144_1,LOW144,8,0),colorred;//柱线//STICKLINE(CROSS(MA(INDEXC,5),INDEXC),LOW144_1,LOW144,8,0),COLORGREEN;//http://www.cxh99.com//柱线//STICKLINE(CLOSE>=M5,C,M5,2,0),colorred;//柱线//STICKLINE(CLOSE<M5,C,M5,2,0),colorcyan;//柱线DRAWICON(买>0,MACD*0.9,5);//DRAWICON((bm1>0 AND 买>0) OR (D1 AND 买>0) OR (买2=1 AND 买>0) OR (JC AND 买>0),MACD*0.9,1);//DRAWNUMBER((bm1
公式导入教程: 【通达信公式源码导入方法教程】 【同花顺公式源码导入方法教程】 【大智慧新一代公式源码导入方法教程】
有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友
可联系技术人员 QQ: 262069696 或微信:cxhjy888 进行 有偿收费 编写!(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
相关文章
-
没有相关内容