指标提示标注 [文华财经]
-
咨询内容:
DIFF : EMA(CLOSE,12) - EMA(CLOSE,26),COLORWHITE;DEA : EMA(DIFF,9),COLORMAGENTA;MACD:=2*(DIFF-DEA),COLORSTICK;
DRAWICON(MACD>0&&REF(MACD,1)<REF(MACD,2)&&CROSS(MACD>REF(MACD,1),0.5)&&REF(MACD>0,1),MACD,4);MACD>0&&REF(MACD,1)<REF(MACD,2)&&CROSS(MACD>REF(MACD,1),0.5)&&REF(MACD>0,1),SELECT;
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));//上次MACD绿柱期间合约最小值
LL2:=VALUEWHEN(CROSS(DIFF,DEA),REF(LL,1));//上上次MACD绿柱期间合约最小值
MLD:=VALUEWHEN(CROSS(DIFF,DEA),LLV(MACD,N2));//上次MACD绿柱期间MACD最小值
MLD2:=VALUEWHEN(CROSS(DIFF,DEA),REF(MLD,1));//上上次MACD绿柱期间MACD最小值
A:=CROSSDOWN(DIFF,DEA)&&HH>HH2&&MHD<MHD2;//顶背离
B:=CROSS(DIFF,DEA)&&LL<LL2&&MLD>MLD2;//底背离
DRAWTEXT(A,DIFF,'背离';
DRAWTEXT(B,DIFF,'背离',VALIGN0;STICKLINE(MACD>0&&MACD>REF(MACD,1),0,MACD,COLORRED,0);STICKLINE(MACD<0&&MACD<REF(MACD,1),0,MACD,COLORGREEN,0);STICKLINE(MACD>0&&MACD<REF(MACD,1),0,MACD,COLORYELLOW,0);STICKLINE(MACD<0&&MACD>REF(MACD,1),0,MACD,COLORWHITE,0);N11:=BACKSET(A,SUMBARS(SC,2));DRAWLINE1(CROSS(N11,0.5),DIFF,A,DIFF,0),COLORRED,LINETHICK3;N12:=BACKSET(B,SUMBARS(JC,2));DRAWLINE1(CROSS(N12,0.5),DIFF,B,DIFF,0),COLORGREEN,LINETHICK3;
老师您好,把上面的MACD指标,用文字标注一下金叉与死叉,2次金叉,2次死叉,文字的颜色用白色来源:程序化99
-
文华技术人员:
参考:
DIFF : EMA(CLOSE,12) - EMA(CLOSE,26),COLORWHITE; DEA : EMA(DIFF,9),COLORMAGENTA; MACD:=2*(DIFF-DEA),COLORSTICK; DRAWICON(MACD>0&&REF(MACD,1)<REF(MACD,2)&&CROSS(MACD>REF(MACD,1),0.5)&&REF(MACD>0,1),MACD,4); MACD>0&&REF(MACD,1)<REF(MACD,2)&&CROSS(MACD>REF(MACD,1),0.5)&&REF(MACD>0,1),SELECT; 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));//上次MACD绿柱期间合约最小值 LL2:=VALUEWHEN(CROSS(DIFF,DEA),REF(LL,1));//上上次MACD绿柱期间合约最小值 MLD:=VALUEWHEN(CROSS(DIFF,DEA),LLV(MACD,N2));//上次MACD绿柱期间MACD最小值 MLD2:=VALUEWHEN(CROSS(DIFF,DEA),REF(MLD,1));//上上次MACD绿柱期间MACD最小值 A:=CROSSDOWN(DIFF,DEA)&&HH>HH2&&MHD<MHD2;//顶背离 B:=CROSS(DIFF,DEA)&&LL<LL2&&MLD>MLD2;//底背离 DRAWTEXT(A,DIFF,'背离'; DRAWTEXT(B,DIFF,'背离',VALIGN0; STICKLINE(MACD>0&&MACD>REF(MACD,1),0,MACD,COLORRED,0); STICKLINE(MACD<0&&MACD<REF(MACD,1),0,MACD,COLORGREEN,0); STICKLINE(MACD>0&&MACD<REF(MACD,1),0,MACD,COLORYELLOW,0); STICKLINE(MACD<0&&MACD>REF(MACD,1),0,MACD,COLORWHITE,0); N11:=BACKSET(A,SUMBARS(SC,2)); DRAWLINE1(CROSS(N11,0.5),DIFF,A,DIFF,0),COLORRED,LINETHICK3; N12:=BACKSET(B,SUMBARS(JC,2)); DRAWLINE1(CROSS(N12,0.5),DIFF,B,DIFF,0),COLORGREEN,LINETHICK3;
DRAWTEXT(JC&&DIFF>0&&DEA>0,DIFF,'叉',COLORWHITE,ALIGN2; DRAWTEXT(SC&&DIFF<0&&DEA<0,DIFF,'叉',COLORWHITE,ALIGN2; DRAWNUMBER1(JC&&DIFF>0&&DEA>0,DIFF,COUNT(JC,BARSLASTCOUNT(DIFF>0&&DEA>0)),0),COLORWHITE,ALIGN0; DRAWNUMBER1(SC&&DIFF<0&&DEA<0,DIFF,COUNT(SC,BARSLASTCOUNT(DIFF<0&&DEA<0)),0),COLORWHITE,ALIGN0;
来源: WWW.CXH99.COM
-
文华客服:
您好,上面的指标金叉只显示0轴以上的,死叉只显示0轴以下的。我认为0轴以下的金叉也要算和显示,0轴以上的死叉也要显示,谢谢
- 网友回复: 金叉计数 是什么范围以来的第一次 ,第二次?
有思路,想编写各种指标公式,交易模型,选股公式,还原公式的朋友
可联系技术人员 QQ: 262069696 或微信号:cxh99cxh99 进行 有偿收费 编写!
(注:由于人数限制,QQ或微信请选择方便的一个联系我们就行,加好友时请简单备注下您的需求,否则无法通过。谢谢您!)
相关文章
-
没有相关内容