您现在的位置:程序化交易>> 期货公式>> 博易大师>> 博易大师知识>>正文内容

想找一个MACD顶底背离的指标,在副图显示 [博易POBO]

咨询内容: 想找一个MACD顶底背离的指标,在副图显示 想找一个MACD顶底背离的指标,在副图显示

 

 来源:程序化99网( WWW.CXH99.COM )

博易技术人员: DIFF:EMA(CLOSE,12)-EMA(CLOSE,26),PRECISION(2);
DEA:EMA(DIFF,9),PRECISION(2);
MACD:2*(DIFF-DEA), COLORSTICK,LINETHICK2,PRECISION(2);{这三句是MACD系统源码}
低位金叉:=CROSS(DIFF,DEA) AND DIFF<-0.1;{定义低位金叉}
STICKLINE(低位金叉,0,0.08,6,0),COLORYELLOW;{低位金叉时MACD柱体黄色显示}
DRAWTEXT(低位金叉,0.11,' 低位金叉'),COLORWHITE,ALIGN2,FONTSIZE9;{低位金叉时显示白色字体,低位金叉}
JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));{统计DEA大于0到现在金叉的周期}
二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;{定义二次金叉}
STICKLINE(二次金叉,0,0.06,6,0),COLORFF00FF;{二次金叉满足时,MACD粉色显示}
DRAWICON(二次金叉,DEA*0.11,1);{二次金叉满足时,下方显示箭头}
DRAWTEXT(二次金叉,0.33,' 二次金叉'),COLORYELLOW,ALIGN2,FONTSIZE9;{二次金叉满足时,显示黄色字,二次金叉}
A1:=BARSLAST(REF(CROSS(DIFF,DEA),1));{上一次金叉距离现在的周期}
底背离:=REF(CLOSE,A1+1)>CLOSE AND DIFF>REF(DIFF,A1+1) AND CROSS(DIFF,DEA);{定义底背离}
STICKLINE(底背离,0,0.03,6,0),COLOR00FF00;{底背离时,显示绿色柱体}
{底背:DRAWLINE(A1=0,DEA,底背离,DEA,0),COLORRED,LINETHICK4;{底背离画,红色线段}
DRAWTEXT(底背离,0.11,'     底背离多'),COLORFF00FF,FONTSIZE9;{底背离时,显示粉色字,底背离}
A2:=BARSLAST(REF(CROSS(DEA,DIFF),1));{取得上次死叉距离现在的周期}
顶背离:=REF(CLOSE,A2+1)<CLOSE AND REF(DIFF,A2+1)>DIFF AND CROSS(DEA,DIFF);{定义顶背离}
{顶背:DRAWLINE(A2=0,DEA,顶背离,DEA,0),COLORGREEN,LINETHICK4; {顶背离画绿色线,属于未来函数}
STICKLINE(顶背离,0,0.03,6,0),COLOR00FF00;{底背离时,显示绿色柱体}
DRAWTEXT(顶背离,0.11,'     顶背离空'),COLORFF00FF,FONTSIZE9;{底背离时,显示粉色字,底背离}

DRAWTEXT(低位金叉 AND 二次金叉 AND 底背离,0.33,'三全项'),COLOR0000FF,ALIGN0,LINETHICK2,FONTSIZE9;{三个条件满足时,显示三全项}
DRAWICON(CROSS(DIFF,DEA),0,1);{1号图标显示红箭头};
DRAWICON(CROSS(DEA,DIFF),0,2);{2号图标显示绿箭头};
DRAWICON(CROSS(DEA,DIFF),0,2);{2号图标显示绿箭头}; 来源 程序化久久网

 

有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友

可联系技术人员 QQ: 262069696  点击在线交流或微信号:cxh99cxh99  进行 有偿收费 编写!

怎么收费,代编流程等详情请点击阅读!

(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)


【字体: 】【打印文章】【查看评论

相关文章

    没有相关内容