通达信MACD妙用源码公式:
MA5:MA(C,5);MA10:MA(C,10);
DIF:=EMA(CLOSE,12)-EMA(CLOSE,26);DEA:=EMA(DIF,9);
MACD:=(DIF-DEA)*2,COLORSTICK;MAMACD:=MA(MACD,4);
建仓:=MAMACD<0&&CROSS(MACD,MAMACD);
看涨:=MACD>0&&MAMACD>0&&REF(MACD,1)<0;
关键:=REF(MACD,1)>0&&REF(MAMACD,1)<0&&MAMACD>0;
DRAWTEXT(建仓,L,'建'),COLORMAGENTA;
DRAWTEXT(建仓,L*0.97,'仓'),COLORMAGENTA;
DRAWTEXT(看涨,L,'看'),COLORBLUE;
DRAWTEXT(看涨,L*0.97,'涨'),COLORBLUE;
DRAWTEXT(关键,L,'关'),COLORGREEN;
DRAWTEXT(关键,L*0.97,'键'),COLORGREEN; |