文化财经 macd 面积显示+macd背离指标

macd面积显示:

DIF:EMA(CLOSE,12)-EMA(CLOSE,26);

DEA:EMA(DIF,9);

MACD:(DIF-DEA)*2,NODRAW;

MACDHS:=IF(MACD>0 AND MACD>REF(MACD,1),MACD,0);

MACDHX:=IF(MACD>0 AND MACD<REF(MACD,1),MACD,0);

MACDLX:=IF(MACD<0 AND MACD<REF(MACD,1),MACD,0);

MACDLS:=IF(MACD<0 AND MACD>REF(MACD,1),MACD,0);

STICKLINE1(MACDHS>0,0,MACD,0,0),COLORLIGHTRED;

STICKLINE1(MACDHX>0,0,MACD,0,0),COLORYELLOW;

STICKLINE1(MACDLX<0,MACD,0,0,0),COLORCYAN;

STICKLINE1(MACDLS<0,MACD,0,0,0), COLORLIGHTGREEN;

绿柱面积:10*IF (MACD<0,SUM(MACD,BARSLAST(MACD>0)),0),NODRAW,COLORCYAN;

红柱面积:10*IF (MACD>0,SUM(MACD,BARSLAST(MACD<0)),0),NODRAW,COLORRED;

DRAWNUMBER(REF(MACD,1)>0 AND MACD<=0 ,HHV(MACD,8), REF(ABS(红柱面积),1),2,COLORRED);

DRAWNUMBER(REF(MACD,1)<0 AND MACD>=0 ,LLV(MACD,13),REF(ABS(绿柱面积),1),2,COLORGREEN);

DRAWNUMBER(ISLASTBAR AND MACD<0,LLV(MACD,8), ABS(绿柱面积),2,COLORGREEN);

DRAWNUMBER(ISLASTBAR AND MACD>0,HHV(MACD,13),ABS(红柱面积),2,COLORRED);


macd背离指标

DIFF :EMA(CLOSE,12) - EMA(CLOSE,26);

DEA  :EMA(DIFF,9),LINETHICK2;
MACD:=2*(DIFF-DEA);//WWW.70822.COM
STICKLINE(MACD>0 AND MACD>REF(MACD,1),MACD,0,COLORRED,0);
STICKLINE(MACD>0 AND MACD<REF(MACD,1),MACD,0,COLORYELLOW,0);
STICKLINE(MACD<0 AND MACD>REF(MACD,1),MACD,0,COLORGREEN,0);
STICKLINE(MACD<0 AND MACD<REF(MACD,1),MACD,0,COLORBLUE,0);
UPCOND:=CROSS(DIFF,DEA);
DOWNCOND:=CROSSDOWN(DIFF,DEA);
END_N1:=SUMBARS(DOWNCOND,1);
RANGE_N1:=REF(SUMBARS(UPCOND,1),END_N1);
END_N2:=SUMBARS(DOWNCOND,2);
HH1:=REF(HV(H,RANGE_N1),END_N1-1);
HH2:=REF(HV(H,RANGE_N1),END_N2-1);
MACD1:=REF(HV(MACD,RANGE_N1),END_N1-1);
MACD2:=REF(HV(MACD,RANGE_N1),END_N2-1);
顶背离:=CROSS(0,MACD)  AND  HH1>HH2  AND  MACD1<MACD2;
DRAWTEXT(顶背离,DIFF*1.30 ,'顶背离'),RGB(0,255,64);
END_M1:=SUMBARS(UPCOND,1);//WWW.70822.COM
RANGE_M1:=REF(SUMBARS(DOWNCOND,1),END_M1);
END_M2:=SUMBARS(UPCOND,2);
LL1:=REF(LV(L,RANGE_M1),END_M1-1);
LL2:=REF(LV(L,RANGE_M1),END_M2-1);
MACD3:=REF(LV(MACD,RANGE_M1),END_M1-1);
MACD4:=REF(LV(MACD,RANGE_M1),END_M2-1);
底背离:=CROSS(MACD,0)  AND  LL1<LL2  AND  MACD3>MACD4;
DRAWTEXT(底背离,DIFF*1.50 ,'底背离'),COLORWHITE;
(0)

相关推荐