通达信主图macd指标公式
2020/1/25 19:02:30
{使用说明:k线的不同颜色代表macd红绿柱的高低正负变化。}
s:=12;p:=26;m:=9;
A:=AMOUNT/V/100;
VARA:=EMA((((A-EMA(A,13))/EMA(A,13))*(0-100)),5);
X1:=EMA(((VARA/10)+EMA(A,10)),3);Y1:=EMA(A,3);
Y2:=(C+0.618*REF(C,1)+0.382*REF(C,2)+0.236*REF(C,3)+0.146*REF(C,4))/2.382;
X2:=EMA(((SLOPE(C,22)*20)+C),55);
压力:MA(REF(HHV(C,30),1),2);
支撑:MA(REF(LLV(C,30),1),2);
转换线:(HHV(HIGH,9)+LLV(LOW,9))/2,COLORMAGENTA,LINETHICK2;
DIFF1:=EMA(CLOSE,S) - EMA(CLOSE,P);
DEA1:=EMA(DIFF1,M);
MACD:=2*(DIFF1-DEA1),COLORYELLOW,LINETHICK0;
MACDHS:=IF(MACD>0 AND MACD>=REF(MACD,1),MACD,0);
MACDHX:=IF(MACD>0 AND MACD<REF(MACD,1),MACD,0);
MACDLX:=IF(MACD<0 AND MACD<=REF(MACD,1),MACD,0);
MACDLS:=IF(MACD<0 AND MACD>REF(MACD,1),MACD,0);
AA:=STICKLINE( C<0,H*1.003,L*0.998,0,0),COLOR666666;
BB:=STICKLINE( C<0,O,C,2.95,1),COLOR666666;
STICKLINE(MACDHS>0,O,C,3.0,0),COLOR0000BB;
STICKLINE(MACDHS>0,O,C,2.7,0),COLOR0000CC;
STICKLINE(MACDHS>0,O,C,2.4,0),COLOR0011CC;
STICKLINE(MACDHS>0,O,C,2.0,0),COLOR1122DD;
STICKLINE(MACDHS>0,O,C,1.7,0),COLOR2233DD;
STICKLINE(MACDHS>0,O,C,1.3,0),COLOR3344EE;
STICKLINE(MACDHS>0,O,C,1,0),COLOR4455EE;
STICKLINE(MACDHS>0,O,C,0.6,0),COLOR5566FF;
STICKLINE(MACDHS>0,O,C,0.3,0),COLOR6677FF;
STICKLINE(MACDHS>0,H,L,0,0),COLOR6677FF;
STICKLINE(MACDHX>0,O,C,3,0),COLOR0077BB;
STICKLINE(MACDHX>0,O,C,2.6,0),COLOR0088CC;
STICKLINE(MACDHX>0,O,C,2.2,0),COLOR0099CC;
STICKLINE(MACDHX>0,O,C,1.8,0),COLOR00AADD;
STICKLINE(MACDHX>0,O,C,1.4,0),COLOR00BBDD;
STICKLINE(MACDHX>0,O,C,1,0),COLOR00CCEE;
STICKLINE(MACDHX>0,O,C,0.6,0),COLOR00DDEE;
STICKLINE(MACDHX>0,O,C,0.2,0),COLOR00EEFF;
STICKLINE(MACDHX>0,O,C,0.1,0),COLOR00FFFF;
STICKLINE(MACDHX>0,H,L,0,0),COLOR00FFFF;
{投股票网-股票公式网站 www.tou18.cn}
STICKLINE(MACDLS<0,O,C,3,0),COLOR770000;
STICKLINE(MACDLS<0,O,C,2.7,0),COLOR881100;
STICKLINE(MACDLS<0,O,C,2.4,0),COLOR992200;
STICKLINE(MACDLS<0,O,C,2.1,0),COLORAA3300;
STICKLINE(MACDLS<0,O,C,1.7,0),COLORBB4400;
STICKLINE(MACDLS<0,O,C,1.4,0),COLORCC5500;
STICKLINE(MACDLS<0,O,C,1.1,0),COLORDD6600;
STICKLINE(MACDLS<0,O,C,0.8,0),COLOREE7700;
STICKLINE(MACDLS<0,O,C,0.4,0),COLORFF8800;
STICKLINE(MACDLS<0,H,L,0,0),COLORFF8800;
STICKLINE(MACDLX<0,O,C,3.0,0),COLOR005500;
STICKLINE(MACDLX<0,O,C,2.8,0),COLOR007700;
STICKLINE(MACDLX<0,O,C,2.4,0),COLOR009900;
STICKLINE(MACDLX<0,O,C,2.0,0),COLOR00AA00;
STICKLINE(MACDLX<0,O,C,1.6.5,0),COLOR00BB00;
STICKLINE(MACDLX<0,O,C,1.2,0),COLOR00CC00;
STICKLINE(MACDLX<0,O,C,1.0,0),COLOR00DD00;
STICKLINE(MACDLX<0,O,C,0.6,0),COLOR00EE00;
STICKLINE(MACDLX<0,O,C,0.2,0),COLOR00FF00;
STICKLINE(MACDLX<0,H,L,0,0),COLOR00FF00;
FD:=(CLOSE-REF(CLOSE,1))/REF(CLOSE,1)*100;
涨幅:IF(FD>0,FD,DRAWNULL),COLORRED,NODRAW;
DRAWTEXT(涨幅>9,L*0.98,'▲');
投 股票网 www.to u18.cn
股市公式下载推荐