同花顺MACD面积副图指标 源码
指标功能:[B]国产软件[/B]
指标类型:简体中文
所需积分:0
推荐星级:
授权方式:共享版
公式大小:0 Bytes
更新时间:2018-01-18 20:09:00
公式简介:
MACD面积调试,分红绿柱子面积,计算大小差异
SHORT:=12;
LONG:=26;
M:=9;
DIFF:EMA(CLOSE,Short) - EMA(CLOSE,Long);
DEA:EMA(DIFF,M);
MACD:2*(DIFF-DEA),COLORSTICK;
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);
红柱面积:=IF(MACD>0,SUM(MACD,BARSLAST(MACD<0)),0),PRECIS2,COLOR0000FF;
绿柱面积:=IF(MACD<0,SUM(MACD,BARSLAST(MACD>0)),0),PRECIS2,COLOR006000;
//MACD面积:IF(MACD<0,ABS(绿柱面积),ABS(红柱面积)),NODRAW;
DRAWTEXT(REF(MACD,1)>0 AND MACD<=0 ,HHV(MACD,4),TOSTRING(REF(红柱面积,1),3)),colorred;
DRAWTEXT(REF(MACD,1)<0 AND MACD>=0 ,LLV(MACD,4),TOSTRING(REF(ABS(绿柱面积),1),3)),Color00ff00;
DRAWTEXT(ISNULL(REFX(&CLOSE,1))=1 AND MACD<0,LLV(MACD,4),TOSTRING(ABS(绿柱面积),3)),Color004A00;
DRAWTEXT(ISNULL(REFX(&CLOSE,1))=1 AND MACD>0,HHV(MACD,4),TOSTRING(ABS(红柱面积),3)),colorred;
BV:=SUM(MACD,0);
BA:=IF(MAX(BV,REF(BV,2))<REF(BV,1) OR MIN(BV,REF(BV,2))>REF(BV,1),1,0);
BC:=BARSLAST(BA)+1;
面积:=BV-REF(BV,BC); DIFF:EMA(CLOSE,Short) - EMA(CLOSE,Long);
DEA:EMA(DIFF,M);
MACD:2*(DIFF-DEA),COLORSTICK;
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);
红柱面积:=IF(MACD>0,SUM(MACD,BARSLAST(MACD<0)),0),PRECIS2,COLOR0000FF;
绿柱面积:=IF(MACD<0,SUM(MACD,BARSLAST(MACD>0)),0),PRECIS2,COLOR006000;
//MACD面积:IF(MACD<0,ABS(绿柱面积),ABS(红柱面积)),NODRAW;
DRAWTEXT(REF(MACD,1)>0 AND MACD<=0 ,HHV(MACD,4),TOSTRING(REF(红柱面积,1),3)),colorred;
DRAWTEXT(REF(MACD,1)<0 AND MACD>=0 ,LLV(MACD,4),TOSTRING(REF(ABS(绿柱面积),1),3)),Color00ff00;
DRAWTEXT(ISNULL(REFX(&CLOSE,1))=1 AND MACD<0,LLV(MACD,4),TOSTRING(ABS(绿柱面积),3)),Color004A00;
DRAWTEXT(ISNULL(REFX(&CLOSE,1))=1 AND MACD>0,HHV(MACD,4),TOSTRING(ABS(红柱面积),3)),colorred;
BV:=SUM(MACD,0);
BA:=IF(MAX(BV,REF(BV,2))<REF(BV,1) OR MIN(BV,REF(BV,2))>REF(BV,1),1,0);
BC:=BARSLAST(BA)+1;
面积:=BV-REF(BV,BC)
[url=http://www.goodgupiao.com/gupiaogongshi/48884.html][B]同花顺MACD面积副图指标 源码[/B][/url]