MACD红柱和绿柱天数通达信公式 副图 源码 测试图
DEA:=35;
DIFF:=10;
绿柱天:=BARSLAST(MACD>0)NODRAW;
HSL100:=SUM(VOL/CAPITAL*100,BARSLAST(CROSS(DIFF,DEA))+1)-VOL/CAPITAL*100;
HSL101:=SUM(VOL/CAPITAL*100,BARSLAST(CROSS(DEA,DIFF))+1)-VOL/CAPITAL*100;
HSL102:=SUM(VOL/CAPITAL*100,BARSLAST(CROSS(DIFF,DEA))+1);
HSL103:=SUM(VOL/CAPITAL*100,BARSLAST(CROSS(DEA,DIFF))+1);
红柱天数:BARSLAST(MACD< 0),COLORRED,NODRAW;
绿柱天数:REF(绿柱天,1),COLORGREEN,NODRAW;
DRAWNUMBER(CROSS(DEA,DIFF),0.2,ROUND(HSL100)),COLORRED;
DRAWNUMBER(CROSS(DIFF,DEA),-0.05,ROUND(HSL101)),COLORGREEN;
DRAWNUMBER(MACD>0 AND ISLASTBAR,0.2,ROUND(HSL102)),COLORYELLOW;
DRAWNUMBER(MACD< 0 AND ISLASTBAR,-0.05,ROUND(HSL103)),COLORYELLOW;
未来函数检测结果如下:
该公式包含未来函数:CAPITAL
解密、编写股票、期货策略请联系QQ或微信同号:88652583
相关股票指标公式
原理解析:
DEA赋值:35
DIFF赋值:10
绿柱天赋值:上次MACD>0距今天数NODRAW
HSL100赋值:SUM(成交量/当前流通股本*100,上次DIFF上穿DEA距今天数+1)-成交量/当前流通股本*100
HSL101赋值:SUM(成交量/当前流通股本*100,上次DEA上穿DIFF距今天数+1)-成交量/当前流通股本*100
HSL102赋值:SUM(成交量/当前流通股本*100,上次DIFF上穿DEA距今天数+1)
HSL103赋值:SUM(成交量/当前流通股本*100,上次DEA上穿DIFF距今天数+1)
输出红柱天数:上次MACD< 0距今天数,画红色,NODRAW
绿柱天数:1日前的绿柱天,画绿色,NODRAW
DRAWNUMBER(DEA上穿DIFF,0.2,ROUND(HSL100)),画红色
DRAWNUMBER(DIFF上穿DEA,-0.05,ROUND(HSL101)),画绿色
DRAWNUMBER(MACD>0 AND ISLASTBAR,0.2,ROUND(HSL102)),画黄色
DRAWNUMBER(MACD< 0 AND ISLASTBAR,-0.05,ROUND(HSL103)),画黄色