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

macd变形 [博易POBO]

咨询内容:

macd变形

老师吧这个文化的改成博弈的,然后当DIFF时正值时用白线表示,时负值时用另一种颜色表示,谢谢
DIFF:EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:EMA(DIFF,9);
MACD:2*(DIFF-DEA),NODRAW;
STICKLINE(MACD>0&&MACD>REF(MACD,1),0,MACD,RGB(255,0,0),0);
STICKLINE(MACD>0&&MACD<REF(MACD,1),0,MACD,COLORYELLOW,0);
STICKLINE(MACD<0&&MACD<REF(MACD,1),0,MACD,COLORBLUE,0);
STICKLINE(MACD<0&&MACD>REF(MACD,1),0,MACD,COLORGREEN,0);
JC:=CROSS(DIFF,DEA);
SC:=CROSSDOWN(DIFF,DEA);
N1:=BARSLAST(JC)+1;
N2:=BARSLAST(SC)+1;
HHO:=VALUEWHEN(CROSSDOWN(DIFF,DEA),HHV(H,N1));//上次MACD红柱期间合约最大值
HH2O:=VALUEWHEN(CROSSDOWN(DIFF,DEA),REF(HHO,1));//上上次MACD红柱期间合约最大值
MHDO:=VALUEWHEN(CROSSDOWN(DIFF,DEA),HHV(MACD,N1));//上次MACD红柱期间MACD最大值
MHD2O:=VALUEWHEN(CROSSDOWN(DIFF,DEA),REF(MHDO,1));//上上次MACD红柱期间MACD最大值
LLO:=VALUEWHEN(CROSS(DIFF,DEA),LLV(L,N2));//上次MACD绿柱期间合约最小值
LL2O:=VALUEWHEN(CROSS(DIFF,DEA),REF(LLO,1));//上上次MACD绿柱期间合约最小值
MLDO:=VALUEWHEN(CROSS(DIFF,DEA),LLV(MACD,N2));//上次MACD绿柱期间MACD最小值
MLD2O:=VALUEWHEN(CROSS(DIFF,DEA),REF(MLDO,1));//上上次MACD绿柱期间MACD最小值
DINGO:=CROSSDOWN(DIFF,DEA)&&HHO>HH2O&&MHDO<MHD2O||ISLASTBAR&&MACD>0&&HHV(H,N1)>HHO&&HHV(MACD,N1)<MHDO;//顶背离
DBO:=CROSS(DIFF,DEA)&&LLO<LL2O&&MLDO>MLD2O||ISLASTBAR&&MACD<0&&LLV(L,N2)<LLO&&LLV(MACD,N2)>MLDO;//底背离
P:=REF(LLVBARS(MACD,BARSLAST(CROSS(DEA,DIFF))),BARSLAST(CROSS(DIFF,DEA)));
DRAWLINE3(REFX(DBO,1),MLDO,P+BARSLAST(CROSS(DIFF,DEA)),DBO,MLDO,LLVBARS(MACD,BARSLAST(CROSS(DEA,DIFF))),0);
Z:=BACKSET(DBO,LLVBARS(MACD,BARSLAST(CROSS(DEA,DIFF)))+1);
DRAWTEXT(CROSS(Z,0.5),MACD,'底背离');
PP:=REF(HHVBARS(MACD,BARSLAST(CROSSDOWN(DEA,DIFF))),BARSLAST(CROSSDOWN(DIFF,DEA)));
//DRAWLINE3(REFX(DINGO,1),MHDO,PP+BARSLAST(CROSSDOWN(DIFF,DEA)),DINGO,MHDO,HHVBARS(MACD,BARSLAST(CROSSDOWN(DEA,DIFF))),0);
ZZ:=BACKSET(DINGO,HHVBARS(MACD,BARSLAST(CROSSDOWN(DEA,DIFF)))+1);
DRAWICON(CROSS(ZZ,0.5),MACD,2);

 

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

博易技术人员: DIFF:EMA(CLOSE,12) - EMA(CLOSE,26);
DEA:EMA(DIFF,9);
MACD:2*(DIFF-DEA),NODRAW;
STICKLINE(MACD>0&&MACD>REF(MACD,1),0,MACD,10,0),COLOR0000FF;
STICKLINE(MACD>0&&MACD<REF(MACD,1),0,MACD,10,0),COLORYELLOW;
STICKLINE(MACD<0&&MACD<REF(MACD,1),0,MACD,10,0),COLORBLUE;
STICKLINE(MACD<0&&MACD>REF(MACD,1),0,MACD,10,0),COLORGREEN;
JC:=CROSS(DIFF,DEA);
SC:=CROSS(DEA,DIFF);
N1:=BARSLAST(JC)+1;
N2:=BARSLAST(SC)+1;
HHO:=VALUEWHEN(CROSS(DEA,DIFF),HHV(H,N1));//上次MACD红柱期间合约最大值
HH2O:=VALUEWHEN(CROSS(DEA,DIFF),REF(HHO,1));//上上次MACD红柱期间合约最大值
MHDO:=VALUEWHEN(CROSS(DEA,DIFF),HHV(MACD,N1));//上次MACD红柱期间MACD最大值
MHD2O:=VALUEWHEN(CROSS(DEA,DIFF),REF(MHDO,1));//上上次MACD红柱期间MACD最大值
LLO:=VALUEWHEN(CROSS(DIFF,DEA),LLV(L,N2));//上次MACD绿柱期间合约最小值
LL2O:=VALUEWHEN(CROSS(DIFF,DEA),REF(LLO,1));//上上次MACD绿柱期间合约最小值
MLDO:=VALUEWHEN(CROSS(DIFF,DEA),LLV(MACD,N2));//上次MACD绿柱期间MACD最小值
MLD2O:=VALUEWHEN(CROSS(DIFF,DEA),REF(MLDO,1));//上上次MACD绿柱期间MACD最小值
DINGO:=CROSS(DEA,DIFF)&&HHO>HH2O&&MHDO<MHD2O||ISLASTBAR&&MACD>0&&HHV(H,N1)>HHO&&HHV(MACD,N1)<MHDO;//顶背离
DBO:=CROSS(DIFF,DEA)&&LLO<LL2O&&MLDO>MLD2O||ISLASTBAR&&MACD<0&&LLV(L,N2)<LLO&&LLV(MACD,N2)>MLDO;//底背离
P:=REF(LLVBARS(MACD,BARSLAST(CROSS(DEA,DIFF))),BARSLAST(CROSS(DIFF,DEA)));

Z:=BACKSET(DBO,LLVBARS(MACD,BARSLAST(CROSS(DEA,DIFF)))+1);
DRAWTEXT(CROSS(Z,0.5),MACD,'底背离');
PP:=REF(HHVBARS(MACD,BARSLAST(CROSS(DEA,DIFF))),BARSLAST(CROSS(DEA,DIFF)));
//DRAWLINE3(REFX(DINGO,1),MHDO,PP+BARSLAST(CROSSDOWN(DIFF,DEA)),DINGO,MHDO,HHVBARS(MACD,BARSLAST(CROSSDOWN(DEA,DIFF))),0);
ZZ:=BACKSET(DINGO,HHVBARS(MACD,BARSLAST(CROSS(DEA,DIFF)))+1);
DRAWICON(CROSS(ZZ,0.5),MACD,2); 来源 程序化久久网

 

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

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

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

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


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

相关文章

    没有相关内容