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

求助老师优化MACD [博易POBO]

咨询内容:

求助老师优化MACD

老师好,这个是优化了博易MACD的源码,现在是
DIFF和DEA线交金叉和死叉后线条变色。能不能请老师调整一下变成

比如DIF下跌显示绿色,上升显示黄色;DEA下跌显示蓝色,上升显示红色。不是交金叉和死叉后才变色.



DIFF :EMA(CLOSE,12) - EMA(CLOSE,26),COLOR0000FF,LINETHICK3;
DEA :EMA(DIFF,9),COLOR00FFFF,LINETHICK3;
MACD := 2*(DIFF-DEA);
DRAWBMP(MACD>0 AND MACD>REF(MACD,1),0,'红.BMP');
DRAWBMP(MACD>0 AND MACD
DRAWBMP(MACD<0 ,0,'绿.BMP');
DRAWBMP(MACD<0 AND MACD>REF(MACD,1),0,'蓝.BMP');
STICKLINE(MACD>0 AND MACD>REF(MACD,1),MACD,0,2,0),COLORB50FA8;
STICKLINE(MACD>0 AND MACD>REF(MACD,1),MACD,0,1,0),COLORFF00FF;
STICKLINE(MACD>0 AND MACD
STICKLINE(MACD>0 AND MACD
STICKLINE(MACD<0 ,MACD,0,2,0),COLOR007500;
STICKLINE(MACD<0 ,MACD,0,1,0),COLOR00FF00;
STICKLINE(MACD<0 AND MACD>REF(MACD,1),MACD,0,2,0),COLORFF0000;
STICKLINE(MACD<0 AND MACD>REF(MACD,1),MACD,0,1,0),COLORFFFF00;
PARTLINE(DIFF>DEA,DIFF),COLOR0000FF,LINETHICK3;
PARTLINE(DIFF>DEA,DEA),COLOR00FFFF,LINETHICK3;
PARTLINE(DIFF
PARTLINE(DIFF

JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;
STICKLINE(二次金叉,0,-0.03,3,0),COLORFF00FF;
DRAWICON(二次金叉,DEA*1.04,13) ;
DRAWTEXT(二次金叉,-0.1,' 二次金叉'),COLORFF00FF;

A11:=BARSLAST(REF(CROSS(DIFF,DEA),1));
底背离:=REF(CLOSE,A11+1)>CLOSE AND DIFF>REF(DIFF,A11+1) AND CROSS(DIFF,DEA);
DRAWTEXT(底背离,DEA*0.6,' 底背离'),COLORFFFFFF;
A22:=BARSLAST(REF(CROSS(DEA,DIFF),1));
顶背离:=REF(CLOSE,A22+1)DIFF AND CROSS(DEA,DIFF);
DRAWTEXT(顶背离,DEA*1.2,' 顶背离'),COLORGREEN;

 

博易技术人员: DIFF :EMA(CLOSE,12) - EMA(CLOSE,26),COLOR00FF00,LINETHICK3;
DEA :EMA(DIFF,9),COLORFF8000,LINETHICK3;
MACD := 2*(DIFF-DEA);
DRAWBMP(MACD>0 AND MACD>REF(MACD,1),0,'红.BMP');
DRAWBMP(MACD>0 AND MACD
DRAWBMP(MACD<0 ,0,'绿.BMP');
DRAWBMP(MACD<0 AND MACD>REF(MACD,1),0,'蓝.BMP');
STICKLINE(MACD>0 AND MACD>REF(MACD,1),MACD,0,2,0),COLORB50FA8;
STICKLINE(MACD>0 AND MACD>REF(MACD,1),MACD,0,1,0),COLORFF00FF;
STICKLINE(MACD>0 AND MACD
STICKLINE(MACD>0 AND MACD
STICKLINE(MACD<0 ,MACD,0,2,0),COLOR007500;
STICKLINE(MACD<0 ,MACD,0,1,0),COLOR00FF00;
STICKLINE(MACD<0 AND MACD>REF(MACD,1),MACD,0,2,0),COLORFF0000;
STICKLINE(MACD<0 AND MACD>REF(MACD,1),MACD,0,1,0),COLORFFFF00;
PARTLINE(DIFF>REF(DIFF,1),DIFF),COLOR00FFFF,LINETHICK3;
PARTLINE(DEA>REF(DEA,1),DEA),COLOR0000FF,LINETHICK3;

JCCOUNT:=COUNT(CROSS(DIFF,DEA),BARSLAST(DEA>=0));
二次金叉:=CROSS(DIFF,DEA) AND DEA<0 AND COUNT(JCCOUNT=2,21)=1;
STICKLINE(二次金叉,0,-0.03,3,0),COLORFF00FF;
DRAWICON(二次金叉,DEA*1.04,13) ;
DRAWTEXT(二次金叉,-0.1,' 二次金叉'),COLORFF00FF;

A11:=BARSLAST(REF(CROSS(DIFF,DEA),1));
底背离:=REF(CLOSE,A11+1)>CLOSE AND DIFF>REF(DIFF,A11+1) AND CROSS(DIFF,DEA);
DRAWTEXT(底背离,DEA*0.6,' 底背离'),COLORFFFFFF;
A22:=BARSLAST(REF(CROSS(DEA,DIFF),1));
顶背离:=REF(CLOSE,A22+1)DIFF AND CROSS(DEA,DIFF);
DRAWTEXT(顶背离,DEA*1.2,' 顶背离'),COLORGREEN; http://210.14.65.65:13168/foru...D1257
DIFF:EMA(CLOSE,12)-EMA(CLOSE,26),COLOR00FF00,LINETHICK3;
DEA:EMA(DIFF,9),COLORFF8000,LINETHICK...


谢谢老师,要的就是这个效果!!

 

有思路,想编写各种指标公式,程序化交易模型,选股公式,预警公式的朋友

可联系技术人员 QQ: 511411198  点击这里给我发消息进行 有偿 编写!不贵!点击查看价格!


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

相关文章

    没有相关内容