DIF:EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:EMA(DIF,9);
MACD:(DIF-DEA)*2,NODRAW;
STICKLINE(MACD>0,0,MACD,2.5,1),COLORRED;
STICKLINE(MACD<0,0,MACD,2.5,0),COLORCYAN;
VA1:=HHVBARS(MACD,BARSLAST(MACD<0)+1);
VA2:=CROSS(BACKSET(CROSS(0,MACD) OR (ISLASTBAR AND MACD>0),REF(VA1,1)+2),0.5);
前高:=DRAWLINE(VA2,MACD,REF(VA2,1),REF(MACD,1),1),COLORWHITE;
VA3:=LLVBARS(MACD,BARSLAST(MACD>0)+1);
VA4:=CROSS(BACKSET(CROSS(MACD,0) OR (ISLASTBAR AND MACD<0),REF(VA3,1)+2),0.5);
前低:=DRAWLINE(VA4,MACD,REF(VA4,1),REF(MACD,1),1),COLORYELLOW;
安全高点:IF(COUNT(MACD>0,BARSLAST(VA2))=BARSLAST(VA2),DRAWLINE(VA2,MACD,REF(VA2,1),REF(MACD,1),1),
DRAWNULL),COLORGREEN,LINETHICK2;
安全低点:IF(COUNT(MACD<0,BARSLAST(VA4))=BARSLAST(VA4),DRAWLINE(VA4,MACD,REF(VA4,1),REF(MACD,1),1),
DRAWNULL),COLORRED,LINETHICK2;
X:=IF(COUNT(MACD>0,BARSLAST(VA2))=BARSLAST(VA2),DRAWLINE(VA2,H,REF(VA2,1),REF(H,1),1),
DRAWNULL),COLORGREEN,LINETHICK2;
STICKLINE(MACD>0 AND C>X,0,MACD,0.5,0),COLORRED;
风险界:安全高点/2,POINTDOT,COLORWHITE;
安全界:安全低点/2,POINTDOT,COLORGREEN;
STICKLINE(MACD>0 AND MACD>前高,0,MACD,1,0),COLORYELLOW;
STICKLINE(REFX(VA2,1) OR REFX(VA4,1),0,MACD,1,0),COLORFF6600;
JC:=CROSS(DIF,DEA);
JTS:=BARSLAST(DIF
STS:=BARSLAST(DIF>DEA);
上涨低点:IF(JTS>0,DRAWLINE(JC,MACD,REF(JC,1),REF(MACD,1),1),DRAWNULL),COLORMAGENTA,LINETHICK2;
下跌高点:IF(STS>0,DRAWLINE(SC,MACD,REF(SC,1),REF(MACD,1),1),DRAWNULL),COLORYELLOW,LINETHICK2;
JGGD0:=DRAWLINE(SC,MACD,REF(SC,1),REF(MACD,1),1);
WW0:=BARSLAST(VA4)<=REF(IF(VA4,BARSNEXT(JC),DRAWNULL),BARSLAST(VA4));
MACD低点:IF(WW0,DRAWLINE(VA4,MACD,REF(VA4,1),REF(MACD,1),1),DRAWNULL),COLORWHITE,LINETHICK2;
价格低点:=IF(JTS>0,DRAWLINE(JC,L,REF(JC,1),REF(L,1),1),DRAWNULL),COLORMAGENTA,LINETHICK2;
价格高点:=IF(STS>0,DRAWLINE(SC,H,REF(SC,1),REF(H,1),1),DRAWNULL),COLORYELLOW,LINETHICK2;
JGGD:=DRAWLINE(SC,H,REF(SC,1),REF(H,1),1);
WW:=BARSLAST(VA4)<=REF(IF(VA4,BARSNEXT(JC),DRAWNULL),BARSLAST(VA4));
指标低点:=IF(WW,DRAWLINE(VA4,L,REF(VA4,1),REF(L,1),1),DRAWNULL),COLORWHITE,LINETHICK2;
白线:=DRAWLINE(VA4,L,REF(VA4,1),REF(L,1),1);
STICKLINE(MAX(C,O)<指标低点,0,MACD,1,0),COLORWHITE;
STICKLINE(价格低点<白线 AND MAX(C,O)<价格低点,0,MACD,1,0),COLORMAGENTA;
STICKLINE(MACD>0 AND MACD<风险界,0,MACD/2,1,0),COLORGREEN;
STICKLINE(MACD<0 AND MACD>安全界,0,MACD/2,1,0),COLOR0099FF;
{DRAWTEXT(价格低点<白线 AND O<价格低点 AND C>价格低点 AND MACD>REF(MACD,1) AND
REF(C,1)<价格低点 AND JTS>1,L*0.99,'挖坑结束、还需确认'),COLORYELLOW;
DRAWTEXT(JC AND 价格低点>JGGD,L*0.99,'小心筑顶、红柱保护');
DRAWTEXT(NOT(WW) AND C>价格高点 AND O<价格高点,L*0.99,'简单骗术、时间和谐');
DRAWTEXT(WW AND C>价格高点 AND O<价格高点,L*0.99,'再涨一段、注意真假'),COLORYELLOW;};