{MACD顺天}
{INPUT:SHORT(12),LONG(26),M(9),N(55);}DIFF:(EMA(CLOSE,3)-EMA(CLOSE,8)),LINETHICK2,COLORGREEN;IF(DIFF>=REF(DIFF,1),DIFF,DRAWNULL),LINETHICK2,COLORRED;DEA:EMA(DIFF,9),COLORWHITE;MACD:DIFF-DEA,NODRAW,COLORMAGENTA;IF(DIFF>0 AND DIFF>DEA AND DIFF>REF(DIFF,1),DIFF,DRAWNULL),LINETHICK2,COLORRED;IF(DIFF<0 AND DIFF>DEA AND DIFF>REF(DIFF,1),DIFF,DRAWNULL),LINETHICK2,COLORYELLOW;
STICKLINE(MACD<=0 AND MACD<=REF(MACD,1),0,MACD,2,0),COLORGREEN;STICKLINE(MACD<=0 AND MACD>=REF(MACD,1),0,MACD,2,0),COLORMAGENTA;STICKLINE(MACD>=0 AND MACD<=REF(MACD,1),0,MACD,2,0),COLORCYAN;STICKLINE(MACD>=0 AND MACD>=REF(MACD,1),0,MACD,2,0),COLORRED;建仓:DIFF<0 AND REF(DIFF,1)<REF(DIFF,2) AND (DIFF>REF(DIFF,1)),COLORRED,NODRAW;买点:DIFF<0 AND CROSS(DIFF,DEA),COLORYELLOW,NODRAW;IF(买点,0.3,0),COLORYELLOW;加仓:DIFF<0 AND DIFF>DEA AND MACD>REF(MACD,1){DIFF>REF(DIFF,1)},NODRAW,COLORYELLOW;持股:DIFF>0 AND DIFF>DEA AND MACD>REF(MACD,1){DIFF>REF(DIFF,1)},NODRAW,COLORRED;卖点:DIFF>0 AND REF(DIFF,1)>REF(DIFF,2) AND {MACD<REF(MACD,1)}DIFF<REF(DIFF,1),COLORGREEN,NODRAW;持币:DIFF<DEA AND MACD<REF(MACD,1){DIFF<REF(DIFF,1)},NODRAW,COLORFFFF00;清仓:=DIFF>0 AND CROSS(DEA,DIFF);DRAWICON(建仓,DIFF*1.15,1);DRAWTEXT(建仓,DIFF*1.25,'建仓'),COLORRED;DRAWTEXT(买点,DEA*1.050,'买点'),COLORYELLOW;DRAWICON(卖点,DIFF*1.10,2);DRAWTEXT(卖点,DEA*1.30,'卖点'),COLORGREEN;DRAWTEXT(DIFF>0 AND CROSS(DEA,DIFF),DIFF*1.200,'清仓'),COLORGREEN;零线:0,COLORWHITE;T6:=IF(FINDSTR(EXTERNSTR(0,1),','),STRCAT('千股千评:',EXTERNSTR(0,1)),'');DRAWTEXT_FIX(1,0.30,0.00,0,T6),COLOR00FFFF;底背离:=LLV(LOW,60)=LOW AND NOT(LLV(MACD,55)=MACD);{大智慧讲师原设55天,LCY改为60天}顶背离:=HHV(HIGH,60)=HIGH AND NOT(HHV(MACD,55)=MACD);DRAWTEXT(底背离=1,DIFF*0.98,'底背离'),COLORMAGENTA;DRAWTEXT(顶背离=1,DEA*1.098,'顶背离'),COLORCCFF00;{主力潜伏}主力潜伏:COUNT(MACD<0,10)=10,COLORMAGENTA,NODRAW;IF(主力潜伏,0.3,0),COLORMAGENTA;{GX:REF(主力潜伏,1)=1 AND 主力潜伏<1 AND DIFF>0,COLORRED;};量:=EMA(VOL,13);资金:=EMA(AMOUNT,13);过滤:=((资金 /量) / 100);提纯:=(((CLOSE -过滤) / 过滤) * 100);黄金:=((提纯<(0)) AND ZXNH),COLORRED;粪土:=((提纯>(0)) AND ZXNH);低买:IF(黄金 AND (持股 OR 加仓),0.3,0),COLORYELLOW,LINETHICK2;高卖:IF(粪土 AND (持币 OR 清仓),0.3,0),COLORBLUE,LINETHICK2;{上涨分界:25;}STICKLINE(低买,0,0.3,2,0),COLORYELLOW;STICKLINE(高卖,0,0.3,2,0),COLORBLUE;