【资料名称】:MACD上主图源码 通达信 贴图+背离信号介绍【资料描述】:
MACD上主图源码 通达信 贴图+背离信号
8年多前的“万能叠加”指标,自行研究成功将MACD叠加上主图,最关键的是还将MACD红绿杠也搬上了主图,并叠加上了顶底背离信号(源码奉献,无未来,不漂移)
{0. 将MACD指标搬上主图显示}
DDIF:EMA(CLOSE,12)-EMA(CLOSE,26),NODRAW;
DDEA:EMA(DDIF,9),NODRAW;
DMACD:(DDIF-DDEA)*2,NODRAW;
上市天数:=BARSCOUNT(C); N:=IF(上市天数<90,上市天数-1,90);
基点:=CONST(LLV(L,N)); 基:=CONST(HHV(H,N))-基点;
分:=CONST(LLV(DDIF,N)); 百:=CONST(HHV(DDIF,N))-分;
CC比:=(DDIF-分)/百; XCX:=CC比*基+基点;
DIF:=XCX; NOTEXTDDIF:DIF,COLORWHITE;
DEA:=EMA(DIF,9); NOTEXTDDEA:DEA,COLORYELLOW;
基准零线:=(0-分)/百*基+基点; NOTEXT基准零线:基准零线,POINTDOT,COLORLIRED;
MACD:=(DIF-DEA)*2;
STICKLINE(MACD>=0,基准零线,基准零线+MACD,0,0),COLORLIRED;
STICKLINE(MACD<0,基准零线,基准零线+MACD,0,0),COLORLICYAN;
{1. MACD结构量化指标:}
A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
底部结构:=REF(C,A1+1)>C AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA);
DRAWLINE(A1=0,REF(DEA,1),底部结构,REF(DEA,A1+1),0),COLORMAGENTA,LINETHICK1;
STICKLINE(底部结构,DEA,REF(DEA,A1+1),0,0),COLORMAGENTA,LINETHICK1;
DRAWTEXT(底部结构>0,REF(DEA,A1+1),'底背离'),COLORMAGENTA;
A2:=BARSLAST(REF(CROSS(DEA,DIF),1));
顶部结构:=REF(C,A2+1)<C AND REF(DIF,A2+1)>DIF AND CROSS(DEA,DIF);
DRAWLINE(A2=0,REF(DEA,1),顶部结构,REF(DEA,A2+1),0),COLORGREEN,LINETHICK1;
STICKLINE(顶部结构,DEA,REF(DEA,A2+1),0,0),COLORGREEN,LINETHICK1;
DRAWTEXT(顶部结构>0,REF(DEA,A2+1),'顶背离'),COLORGREEN;
gd49744
【下载地址隐藏】: 点:回复可见地址