一,黄金分割 主图, 公式源码(通达信精选)
MA5:MA(C,5);
MA13:MA(C,13);
高:=REF(HHV(H,N),M);
低:=REF(LLV(L,N),M);
H19:=高-(高-低)*0.191;
H38:=高-(高-低)*0.382;
H中:=高-(高-低)*0.5;
H61:=高-(高-低)*0.618;
H80:=高-(高-低)*0.809;
顶点:REFDATE(高,DATE),COLORWHITE;
%19.8:REFDATE(H19,DATE),COLORYELLOW;
%38.2:REFDATE(H38,DATE),COLORMAGENTA;
%50:REFDATE(H中,DATE),COLORRED;
%61.8:REFDATE(H61,DATE),COLORMAGENTA;
%80.9:REFDATE(H80,DATE),COLORYELLOW;
低点:REFDATE(低,DATE),COLORWHITE;
DRAWTEXT(ISLASTBAR,顶点,'顶点'),COLORWHITE;
DRAWTEXT(ISLASTBAR,%19.8,'%19.8'),COLORYELLOW;
DRAWTEXT(ISLASTBAR,%38.2,'%38.2'),COLORMAGENTA;
DRAWTEXT(ISLASTBAR,%50,'%50'),COLORRED;
DRAWTEXT(ISLASTBAR,%61.8,'%61.8'),COLORMAGENTA;
DRAWTEXT(ISLASTBAR,%80.9,'%80.9'),COLORYELLOW;
二、彩色MACD 公式源码
DIFIF1:=EMA(CLOSE,10) - EMA(CLOSE,20);
DEAEA1:=EMA(DIFIF1,5);
MACD1:=2*(DIFIF1-DEAEA1),STICK;
MACD2:=EMA(MACD1,3);
STICKLINE(MACD1>MACD2 AND MACD1>0,0,MACD1,1,0),COLORRED;
STICKLINE(MACD1>MACD2 AND MACD1<0,0,MACD1,1,0),COLORGREEN;
STICKLINE(MACD1<MACD2,0,MACD1,1,0),COLORCBCBC0;
STICKLINE(MACD1>=0 OR MACD1<=0,0,0,50,1),COLORWHITE;
DIFIF1,COLOR33FF33,LINETHICK2;
DEAEA1,COLORYELLOW,LINETHICK2;
MACD:MACD1,NODRAW,COLORMAGENTA;
强:IF(DIFIF1>=DEAEA1,DIFIF1,DRAWNULL),COLORRED,LINETHICK2;
弱:IF(DEAEA1>=DIFIF1,DEAEA1,DRAWNULL),COLORFF9900,LINETHICK2;
DRAWICON(CROSS(DIFIF1,DEAEA1),DIFIF1+0.1,1);
DRAWICON(CROSS(DEAEA1,DIFIF1),-0.5,2);
DRAWTEXT(CROSS(DIFIF1,DEAEA1),DIFIF1,'○'),LINETHICK2, COLORYELLOW; |