azml123 / 待分類 / 通達信一成MACD背離指標公式

0 0

   

通達信一成MACD背離指標公式

2018-03-17  azml123
DIFF : EMA(CLOSE,12) - EMA(CLOSE,26);
DEA : EMA(DIFF,9);
MACD : 2*(DIFF-DEA), COLORSTICK;
JC := DEA-DIFF;
綠柱面積:=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);
DRAWTEXT(底背馳,-0.01,'底背'),COLOR00FFFF;
STICKLINE(底背馳,0,-0.01,4,0),COLOR0000FF;
DRAWICON(底背馳,0,23),COLORYELLOW;
DRAWBAND(DIFF,RGB(200,50,55),DEA,RGB(50,100,10));
遵:IF(DIFF>=DEA,DIFF,DRAWNULL),COLORRED;
守:IF(DEA>=DIFF,DEA,DRAWNULL),COLORFF9900;
紀: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,19),COLOR00FF00;
STICKLINE(頂背馳,0,0.01,4,0),COLOR00FF00;
DRAWTEXT(頂背馳,0.01,'頂背'),COLORFF0000;
買:IFF(底背馳,0.1,0),COLOR0000FF;
賣:IFF(頂背馳,0.1,0),COLOR00FF00;
A1:=C>REF(C,4);
NT:=BARSLASTCOUNT(A1);
TJ11:=NT=9;
TJ13:=ISLASTBAR AND BETWEEN(NT,5,8);
AY:=(BACKSET(TJ11>0,9) OR BACKSET(TJ13>0,NT))*NT;
DRAWTEXT(AY>0,MACD*1.02,VAR2STR(AY,0)),COLORLIRED;
DRAWTEXT(NT=9,MACD*1.02,'9'),COLORGREEN;
B1:=C<REF(C,4);
NT0:=BARSLASTCOUNT(B1);
TJ21:=NT0=9 ;
TJ23:=ISLASTBAR AND BETWEEN(NT0,5,8);
AY1:=(BACKSET(TJ21>0,9) OR BACKSET(TJ23>0,NT0))*NT0;
DRAWTEXT(AY1>0,MACD*0.98,VAR2STR(AY1,0)),COLORGREEN;
DRAWTEXT(NT0=9,MACD*0.98,'9'),COLORRED;

    本站是提供個人知識管理的網絡存儲空間,所有內容均由用戶發布,不代表本站觀點。如發現有害或侵權內容,請點擊這里 或 撥打24小時舉報電話:4000070609 與我們聯系。

    猜你喜歡

    0條評論

    發表

    請遵守用戶 評論公約

    類似文章
    喜歡該文的人也喜歡 更多

    vr赛车开奖官网