好用MACD MACD背离副图指标公式[同花顺公式]
原理解析:
来源:程序化99( WWW.CXH99.COM )
源码:
DRAWGBK(V>1,STRIP(RGB(60,100,255),RGB(180,180,255),1));
DIF:EMA(CLOSE,5)-EMA(CLOSE,10),colorred,LINETHICK2;
DEA:EMA(DIF,3),colorwhite,LINETHICK2;
DRAWTEXT(CROSS(DIF,DEA),DIF-0,'建仓'),colorred;
DRAWTEXT(CROSS(DEA,DIF),DIF+0,'空仓'),colorgreen;
MACD彩柱:(DIF-DEA)*2,COLORSTICK;
STICKLINE(((MACD彩柱<REF(MACD彩柱,1)) AND (MACD彩柱>0)),0,MACD彩柱,1,0),COLORLIBLUE,LINETHICK2;
STICKLINE(((MACD彩柱>REF(MACD彩柱,1)) AND (MACD彩柱<0)),0,MACD彩柱,1,0),COLORFF00FF,LINETHICK2;
持仓段:IF(DIF<0,DIF,0),coloryellow,LINETHICK2;
加仓段:IF(DIF<0,0,DIF),colorred,LINETHICK2;
白线空仓段:IF(DIF<DEA,DIF,DEA),colorwhite,LINETHICK2;
趋势强弱:IF(DIF>DEA,DEA,DEA),ColorFFFF00,LINETHICK2;
AA:=COUNT(CROSS(DIF,DEA),BARSLAST(DEA>=0));
二次金叉:=CROSS(DIF,DEA) AND DEA<0 AND COUNT(AA=2,21)=1;
DRAWTEXT(二次金叉,0.2,' 二次金叉'),coloryellow;
A1:=BARSLAST(REF(CROSS(DIF,DEA),1));
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIF>REF(DIF,A1+1) AND CROSS(DIF,DEA);
STICKLINE(底背离,0,0.03,6,0),COLOR00FF00;
底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),colorred,LINETHICK4;
DRAWTEXT(底背离,0.12,' 底背离'),COLORFF00FF;
A2:=BARSLAST(REF(CROSS(DEA,DIF),1));
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIF,A2+1)>DIF AND CROSS(DEA,DIF);
顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),colorgreen,LINETHICK4;
TIPTEXT(ISNULL(REFX(&CLOSE,1)),0,' WWW.CXH99.COM '),colorred;
TIPTEXT(ISNULL(REF(CLOSE,1)),0,'同花顺程序化交易');
公式导入教程: 【通达信公式源码导入方法教程】 【同花顺公式源码导入方法教程】 【大智慧新一代公式源码导入方法教程】
有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友
可联系技术人员 QQ: 1145508240 进行 有偿 编写!(不贵!点击查看价格!)
相关文章
-
没有相关内容