麻烦老师把这只指标修改到我们的软件上面可以吗谢谢 [博易POBO]
咨询内容:
DEA:EMA(DIFF,9);
MACD:2*(DIFF-DEA),NODRAW;
JC:=CROSS(DIFF,DEA);
SC:=CROSSDOWN(DIFF,DEA);
N1:=BARSLAST(JC)+1;
N2:=BARSLAST(SC)+1;
HH:=VALUEWHEN(CROSSDOWN(DIFF,DEA),HHV(H,N1));//上次MACD红柱期间合约最大值
HH2:=VALUEWHEN(CROSSDOWN(DIFF,DEA),REF(HH,1));//上上次MACD红柱期间合约最大值
MHD:=VALUEWHEN(CROSSDOWN(DIFF,DEA),HHV(MACD,N1));//上次MACD红柱期间MACD最大值
MHD2:=VALUEWHEN(CROSSDOWN(DIFF,DEA),REF(MHD,1));//上上次MACD红柱期间MACD最大值
LL:=VALUEWHEN(CROSS(DIFF,DEA),LLV(L,N2));
LL2:=VALUEWHEN(CROSS(DIFF,DEA),REF(LL,1));
MLD:=VALUEWHEN(CROSS(DIFF,DEA),LLV(MACD,N2));
MLD2:=VALUEWHEN(CROSS(DIFF,DEA),REF(MLD,1));
A:=MACD<0&&HH>HH2&&MHD<MHD2;//顶背离
B:=MACD>0&&LL<LL2&&MLD>MLD2;
A1:=BACKSET(A,HHVBARS(MACD,N1)+1);
A2:=BACKSET(A,HHVBARS(MACD,SUMBARS(JC,2))+1);
B1:=BACKSET(B,LLVBARS(MACD,N2)+1);
B2:=BACKSET(B,LLVBARS(MACD,SUMBARS(SC,2))+1);
DRAWTEXT(CROSS(A1,0.5),MACD,'顶背离'),VALIGN2,COLORRED;
DRAWTEXT(CROSS(B1,0.5),MACD,'底背离'),VALIGN0,COLORGREEN;
STICKLINE(MACD>0&&MACD>REF(MACD,1),0,MACD,COLORRED,0);
STICKLINE(MACD>0&&MACD<REF(MACD,1),0,MACD,COLORYELLOW,0);
STICKLINE(MACD<0&&MACD>REF(MACD,1),0,MACD,COLORGREEN,0);
STICKLINE(MACD<0&&MACD<REF(MACD,1),0,MACD,COLORBLUE,0);
DEA:EMA(DIFF,9);
MACD:2*(DIFF-DEA),NODRAW;
JC:=CROSS(DIFF,DEA);
SC:=CROSS(DEA,DIFF);
N1:=BARSLAST(JC)+1;
N2:=BARSLAST(SC)+1;
HH:=VALUEWHEN(CROSS(DEA,DIFF),HHV(H,N1));//上次MACD红柱期间合约最大值
HH2:=VALUEWHEN(CROSS(DEA,DIFF),REF(HH,1));//上上次MACD红柱期间合约最大值
MHD:=VALUEWHEN(CROSS(DEA,DIFF),HHV(MACD,N1));//上次MACD红柱期间MACD最大值
MHD2:=VALUEWHEN(CROSS(DEA,DIFF),REF(MHD,1));//上上次MACD红柱期间MACD最大值
LL:=VALUEWHEN(CROSS(DIFF,DEA),LLV(L,N2));
LL2:=VALUEWHEN(CROSS(DIFF,DEA),REF(LL,1));
MLD:=VALUEWHEN(CROSS(DIFF,DEA),LLV(MACD,N2));
MLD2:=VALUEWHEN(CROSS(DIFF,DEA),REF(MLD,1));
A:=MACD<0&&HH>HH2&&MHD<MHD2;//顶背离
B:=MACD>0&&LL<LL2&&MLD>MLD2;
A1:=BACKSET(A,HHVBARS(MACD,N1)+1);
A2:=BACKSET(A,HHVBARS(MACD,SUMBARS(JC,2))+1);
B1:=BACKSET(B,LLVBARS(MACD,N2)+1);
B2:=BACKSET(B,LLVBARS(MACD,SUMBARS(SC,2))+1);
DRAWTEXT(CROSS(A1,0.5),MACD,'顶背离'),VALIGN2,COLORRED;
DRAWTEXT(CROSS(B1,0.5),MACD,'底背离'),VALIGN0,COLORGREEN;
STICKLINE(MACD>0&&MACD>REF(MACD,1),0,MACD,10,0),COLORRED;
STICKLINE(MACD>0&&MACD<REF(MACD,1),0,MACD,10,0),COLORYELLOW;
STICKLINE(MACD<0&&MACD>REF(MACD,1),0,MACD,10,0),COLORGREEN;
STICKLINE(MACD<0&&MACD<REF(MACD,1),0,MACD,10,0),COLORBLUE; 来源 程序化久久网
麻烦老师把这只指标修改到我们的软件上面可以吗谢谢
DIFF:EMA(CLOSE,12) - EMA(CLOSE,26);DEA:EMA(DIFF,9);
MACD:2*(DIFF-DEA),NODRAW;
JC:=CROSS(DIFF,DEA);
SC:=CROSSDOWN(DIFF,DEA);
N1:=BARSLAST(JC)+1;
N2:=BARSLAST(SC)+1;
HH:=VALUEWHEN(CROSSDOWN(DIFF,DEA),HHV(H,N1));//上次MACD红柱期间合约最大值
HH2:=VALUEWHEN(CROSSDOWN(DIFF,DEA),REF(HH,1));//上上次MACD红柱期间合约最大值
MHD:=VALUEWHEN(CROSSDOWN(DIFF,DEA),HHV(MACD,N1));//上次MACD红柱期间MACD最大值
MHD2:=VALUEWHEN(CROSSDOWN(DIFF,DEA),REF(MHD,1));//上上次MACD红柱期间MACD最大值
LL:=VALUEWHEN(CROSS(DIFF,DEA),LLV(L,N2));
LL2:=VALUEWHEN(CROSS(DIFF,DEA),REF(LL,1));
MLD:=VALUEWHEN(CROSS(DIFF,DEA),LLV(MACD,N2));
MLD2:=VALUEWHEN(CROSS(DIFF,DEA),REF(MLD,1));
A:=MACD<0&&HH>HH2&&MHD<MHD2;//顶背离
B:=MACD>0&&LL<LL2&&MLD>MLD2;
A1:=BACKSET(A,HHVBARS(MACD,N1)+1);
A2:=BACKSET(A,HHVBARS(MACD,SUMBARS(JC,2))+1);
B1:=BACKSET(B,LLVBARS(MACD,N2)+1);
B2:=BACKSET(B,LLVBARS(MACD,SUMBARS(SC,2))+1);
DRAWTEXT(CROSS(A1,0.5),MACD,'顶背离'),VALIGN2,COLORRED;
DRAWTEXT(CROSS(B1,0.5),MACD,'底背离'),VALIGN0,COLORGREEN;
STICKLINE(MACD>0&&MACD>REF(MACD,1),0,MACD,COLORRED,0);
STICKLINE(MACD>0&&MACD<REF(MACD,1),0,MACD,COLORYELLOW,0);
STICKLINE(MACD<0&&MACD>REF(MACD,1),0,MACD,COLORGREEN,0);
STICKLINE(MACD<0&&MACD<REF(MACD,1),0,MACD,COLORBLUE,0);
来源:程序化99网( WWW.CXH99.COM )
博易技术人员: DIFF:EMA(CLOSE,12) - EMA(CLOSE,26);DEA:EMA(DIFF,9);
MACD:2*(DIFF-DEA),NODRAW;
JC:=CROSS(DIFF,DEA);
SC:=CROSS(DEA,DIFF);
N1:=BARSLAST(JC)+1;
N2:=BARSLAST(SC)+1;
HH:=VALUEWHEN(CROSS(DEA,DIFF),HHV(H,N1));//上次MACD红柱期间合约最大值
HH2:=VALUEWHEN(CROSS(DEA,DIFF),REF(HH,1));//上上次MACD红柱期间合约最大值
MHD:=VALUEWHEN(CROSS(DEA,DIFF),HHV(MACD,N1));//上次MACD红柱期间MACD最大值
MHD2:=VALUEWHEN(CROSS(DEA,DIFF),REF(MHD,1));//上上次MACD红柱期间MACD最大值
LL:=VALUEWHEN(CROSS(DIFF,DEA),LLV(L,N2));
LL2:=VALUEWHEN(CROSS(DIFF,DEA),REF(LL,1));
MLD:=VALUEWHEN(CROSS(DIFF,DEA),LLV(MACD,N2));
MLD2:=VALUEWHEN(CROSS(DIFF,DEA),REF(MLD,1));
A:=MACD<0&&HH>HH2&&MHD<MHD2;//顶背离
B:=MACD>0&&LL<LL2&&MLD>MLD2;
A1:=BACKSET(A,HHVBARS(MACD,N1)+1);
A2:=BACKSET(A,HHVBARS(MACD,SUMBARS(JC,2))+1);
B1:=BACKSET(B,LLVBARS(MACD,N2)+1);
B2:=BACKSET(B,LLVBARS(MACD,SUMBARS(SC,2))+1);
DRAWTEXT(CROSS(A1,0.5),MACD,'顶背离'),VALIGN2,COLORRED;
DRAWTEXT(CROSS(B1,0.5),MACD,'底背离'),VALIGN0,COLORGREEN;
STICKLINE(MACD>0&&MACD>REF(MACD,1),0,MACD,10,0),COLORRED;
STICKLINE(MACD>0&&MACD<REF(MACD,1),0,MACD,10,0),COLORYELLOW;
STICKLINE(MACD<0&&MACD>REF(MACD,1),0,MACD,10,0),COLORGREEN;
STICKLINE(MACD<0&&MACD<REF(MACD,1),0,MACD,10,0),COLORBLUE; 来源 程序化久久网
有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友
可联系技术人员 QQ: 262069696 或微信号:cxh99cxh99 进行 有偿收费 编写!
(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
相关文章
-
没有相关内容