以下是通达信背离一目了然副图指标公式

背离一目了然(副图)
W:=1;
M:=1;
MM:=9*M;
SHORT:=MM*4/3;
LONG:=MM*26/9;
DIFF:=(EMA(CLOSE,SHORT)-EMA(CLOSE,LONG));
DEA:=EMA(DIFF,MM),COLOR58FF58;
MACD:=2*(DIFF-DEA),COLORFFFF00,LINETHICK0;
红柱:DRAWBAND(MACD,RGB(180,50,50),0,RGB(0,128,0));
绿柱:DRAWBAND(0,RGB(0,128,0),MACD,RGB(180,50,50));
AMACD:=ABS(MACD);
{STICKLINE(MACD>=0 AND MACD>=REF(MACD,1),0,MACD,W,1),COLOR6058FF;
STICKLINE(MACD>=0 AND MACD< REF(MACD,1),0,MACD,W,0),COLOR6058FF;
STICKLINE(MACD<0 AND MACD>=REF(MACD,1),0,MACD,W,1),COLORFFFF00;
STICKLINE(MACD<0 AND MACD< REF(MACD,1),0,MACD,W,0),COLORFFFF00;}
红柱面积 := IF (MACD>0,SUM(AMACD,BARSLAST(MACD<0)),0),LINETHICK0,COLORRED;
绿柱面积 := IF (MACD<0,SUM(AMACD,BARSLAST(MACD>0)),0),LINETHICK0,COLORBLUE;
BV:=SUM(MACD,0);
红转绿:=CROSS(MACD,0);
绿转红:=CROSS(0,MACD);
BC:=BARSLAST(红转绿 OR 绿转红)+1;
最高红柱子:IF(MACD>0,HHV(MACD,BC),0),NODRAW;
最低绿柱子:IF(MACD<0,LLV(MACD,BC),0),NODRAW;
DRAWTEXT(绿转红 ,REF(最高红柱子,1),”+REF(INTPART((红柱面积)*10)/10,1)),COLORRED;

DRAWTEXT(红转绿 ,REF(最低绿柱子,1),”+REF(INTPART((绿柱面积)*10)/10,1)),COLORRED;
CDIFF:DIFF;CDEA:DEA;

声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。