DIFF: EMA(CLOSE,12) - EMA(CLOSE,26);
DEA: EMA(DIFF,9);
MACD:= 2*(DIFF-DEA);
JC:= DEA-DIFF;
ZERO : 0;
DRAWBAND(DIFF,RGB(200,50,55),DEA,RGB(50,100,10));
八十日漂紅: COUNT(MACD>0,80),NODRAW;
連紅: BARSLASTCOUNT(MACD>0),NODRAW;
連增:BARSLASTCOUNT(MACD>REF(MACD,1)),COLORRED,NODRAW;
連減:BARSLASTCOUNT(MACD<REF(MACD,1)),COLORGREEN,NODRAW;
綠柱面積:=IF(MACD<0,SUM(MACD,BARSLAST(JC<0)),0);
紅柱面積:=IF(MACD>0,SUM(MACD,BARSLAST(JC>0)),0);
本次最低價:=LLV(L,BARSLAST(JC<0));
本次最高價:=HHV(H,BARSLAST(JC>0));
X1:=IF (MACD<0,BARSLAST(CROSS(DIFF,DEA)),0);
前次綠柱面積:=REF(綠柱面積,X1+1);
前次最低價:=REF(本次最低價,X1+1);
Y1:=IF((綠柱面積<0 AND ABS(綠柱面積)<ABS(前次綠柱面積)
AND 本次最低價<前次最低價 ),1,0);
RS1:= MACD<0 AND REF(MACD,1)<0 AND C<前次最低價
AND ABS(綠柱面積)<ABS(前次綠柱面積) AND ABS(MACD)<ABS(REF(MACD,1));
底背馳:= IF (CROSS(DIFF,DEA),REF(Y1,1),0);
STICKLINE(底背馳,0,-0.3,4,0),COLORYELLOW;
DRAWTEXT(底背馳,-0.3,'底積背'),COLORYELLOW;
DRAWICON(底背馳,0,1),COLORYELLOW;
遵:IF(DIFF>=DEA,DIFF,DRAWNULL),COLORRED;
守:IF(DEA>=DIFF,DEA,DRAWNULL),COLORFF9900;
紀(jì):IF(DIFF>=DEA,DEA,DRAWNULL),COLOR00FFFF;
律:IF(DEA>=DIFF,DIFF,DRAWNULL),COLOR00FF00;
X2:=IF (MACD>0,BARSLAST(CROSS(DEA,DIFF)),0);
前次紅柱面積:=REF(紅柱面積,X2+1);
前次最高價:=REF(本次最高價,X2+1);
Y2:=IF((紅柱面積>0 AND 紅柱面積<前次紅柱面積 AND 本次最高價>前次最高價 ),1,0);
RS2:= MACD>0 AND REF(MACD,1)>0 AND C>前次最高價 AND ABS(紅柱面積)<ABS(前次紅柱面積) AND ABS(MACD)<ABS(REF(MACD,1));
頂背馳:= IF (CROSS(DEA,DIFF),REF(Y2,1),0);
DRAWICON(頂背馳,0,2),COLOR00FF00;
DRAWTEXT(頂背馳,0.3,'頂積背'),COLOR00FFFF;
STICKLINE(頂背馳,0,0.3,4,0),COLORYELLOW;
STICKLINE(MACD>0 AND MACD>=REF(MACD,1),0,MACD,2,0),COLORRED;
STICKLINE(MACD>0 AND MACD<REF(MACD,1),0,MACD,2,0),COLORYELLOW;
STICKLINE(MACD<0 AND MACD>=REF(MACD,1),0,MACD,2,0),COLORWHITE;
STICKLINE(MACD<0 AND MACD<REF(MACD,1),0,MACD,2,0),COLORGREEN;
Y22:=IF((綠柱面積<0 AND ABS(綠柱面積)<ABS(前次綠柱面積)),1,0);
XG1:=DRAWTEXT(底背馳,-0.3,'底積背');
XG2:=IF (CROSS(DIFF,DEA),REF(Y22,1),0);
STICKLINE(XG2,0,-0.3,3,0),COLORYELLOW;
DRAWTEXT(XG2,-0.2,'買'),COLORRED;
紅面積:SUM(MACD,BARSLAST(MACD<0))*(MACD>0),COLOR0000FF,NODRAW;
綠面積:SUM(MACD,BARSLAST(MACD>0))*(MACD<0),COLORFFFF00,NODRAW;
AA:=ROUND(REF(綠面積,1)*100);
BB:=ROUND(REF(紅面積,1)*100);
DRAWNUMBER(CROSS(MACD,0),LLV(REF(MACD,1),5)-0.03,ABS(AA)),COLORGREEN;
聯(lián)系客服