以下是通达信MACD底背离(主图幅图选股源码)
今天继续发一个MACD底背离,这是一位前辈的理念,MACD三堆量柱,第一堆绿柱 第二堆红柱 第三堆绿柱,要求三堆量柱每一堆至少10天以上连续形成。然后 比较两堆绿柱,要求股价下跌,现在的绿柱比前一堆量柱要缩短。形成量价底背离,这只是一种MACD底背离形态,看看和前面的KDJ底背离能不能找到共振呢?或者加入其他条件和MACD底背离共振出票?一切留给喜欢MACD底背离的朋友自己去挖掘。我只是写出这个形态,并配上直观主图 幅图 加上选股,其余自己拿捏吧!
{主图}
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
MACD:=(DIF-DEA)*2;
T:=BARSLAST(CROSS(0,MACD));
TA:=BARSLAST(CROSS(MACD,0));
T2:=REF(T,TA+1)+TA+1;
L1:=LLV(L,T+1);
L2:=REF(L1,T+1);
L1T:=BARSLAST(L=L1);
M1:=REF(MACD,BARSLAST(L=L1));
M2:=REF(M1,T+1+T+1);
L2T:=BARSLAST(L=CONST(L2));
TJ:=(T2-TA)>=10 AND (TA-T)>=10;
TJ1:=L1<L2 AND M1>M2;
EXT:DRAWLINE(L2T=0,L,L1T=0 AND TJ AND TJ1 AND T>=10 AND L2T>20 ,L,0),COLORYELLOW;
DRAWTEXT(CROSS(EXT!=DRAWNULL,0.5),EXT*1.05,'底背离'),COLORYELLOW;
{幅图}
DIF:EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:EMA(DIF,9);
MACD:(DIF-DEA)*2,COLORSTICK;
T:=BARSLAST(CROSS(0,MACD));
TA:=BARSLAST(CROSS(MACD,0));
T2:=REF(T,TA+1)+TA+1;
L1:=LLV(L,T+1);
L2:=REF(L1,T+1);
L1T:=BARSLAST(L=L1);
M1:=REF(MACD,BARSLAST(L=L1));
M2:=REF(M1,T+1+T+1);
L2T:=BARSLAST(L=CONST(L2));
TJ:=(T2-TA)>=10 AND (TA-T)>=10;
TJ1:=L1<L2 AND M1>M2;
EXT:DRAWLINE(L2T=0,MACD,L1T=0 AND TJ AND TJ1 AND T>=10 AND L2T>20,MACD,0),DOTLINE,COLORMAGENTA;
DRAWTEXT(CROSS(EXT!=DRAWNULL,0.5),MACD,'底背离'),COLORMAGENTA;
{选股}
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);
DEA:=EMA(DIF,9);
MACD:=(DIF-DEA)*2;
T:=BARSLAST(CROSS(0,MACD));
TA:=BARSLAST(CROSS(MACD,0));
T2:=REF(T,TA+1)+TA+1;
L1:=LLV(L,T+1);
L2:=REF(L1,T+1);
L1T:=BARSLAST(L=L1);
M1:=REF(MACD,BARSLAST(L=L1));
M2:=REF(M1,T+1+T+1);
L2T:=BARSLAST(L=CONST(L2));
TJ:=(T2-TA)>=10 AND (TA-T)>=10;
TJ1:=L1<L2 AND M1>M2;
XG:TJ AND TJ1 AND L1T=0 AND T>=10 AND L2T>20;