您现在的位置:程序化交易>> 期货公式>> 文华财经>> 文华财经知识>>正文内容

老师帮忙看看。 [文华财经]

  • 咨询内容:  


    文件名:赢顺截图20170315220547.jpg



    MACD    对应的高点连线不对,老师看一下,应该是箭头指的地方


    DRAWKLINE(P/10,COLORRED,M,COLORCYAN,N);DIFF1 := EMA(CLOSE,12) - EMA(CLOSE,26),COLORLIGHTRED,LINETHICK3,NODRAW;DEA1:=EMA(DIFF1,9),NODRAW;MACD:=2*(DIFF1-DEA1);//DIFF减DEA的2倍画柱状线EMA56:=EMA(C,56),COLORGREEN,PRECIS2,CIRCLEDOT,LINETHICK1;
    T1:=BARSLAST(CROSS(DIFF1,DEA1))+1,NODRAW;TT1:=HHVBARS(DIFF1,T1)+1;TTT1:BACKSET(CROSSDOWN(DIFF1,DEA1),TT1),NODRAW;HHH:=VALUEWHEN(CROSS(TTT1,0.5),MACD);H_S: =IF(TTT1&&(EMA56>TTT1),HHH,NULL),COLORGREEN,LINETHICK5;// DING部MACD; Q1:=BARSLAST(CROSSDOWN(DIFF1,DEA1))+1,NODRAW;QQ1:=LLVBARS(DIFF1,Q1)+1;QQQ1:=BACKSET(CROSS(DIFF1,DEA1),QQ1),NODRAW;LLL:=VALUEWHEN(CROSS(QQQ1,0.5),MACD);L_S:=IF(QQQ1&&(QQQ1<EMA56), LLL,NULL),COLORRED,LINETHICK5,NODRAW;//{MACD高低点}GH:=VALUEWHEN(MACD=HHV(MACD,T1),H);GH1:IF(GH=REF(GH,1),GH,NULL),DOT,COLORMAGENTA,LINETHICK3,NODRAW;DL:=VALUEWHEN(MACD=LLV(MACD,Q1),L);DL1:IF(DL=REF(DL,1),DL,NULL),DOT,COLORRED,LINETHICK3,NODRAW;A9:=BACKSET(ISLASTBAR,BARSLAST(CROSS(TTT1,0.5))+1);A7:=BACKSET(ISLASTBAR,BARSLAST(CROSS(QQQ1,0.5))+1);DRAWSL(1&&A9=1,VALUEWHEN(CROSS(TTT1,0.5),H),0,1,0,COLORYELLOW),LINETHICK2;//水平线DRAWSL(1&&A7=1,VALUEWHEN(CROSS(QQQ1,0.5),L),0,1,0,COLORCYAN),DOT,LINETHICK2;//水平线

     

  • 文华技术人员:  您是指绿色的虚线是与MACD0轴上方的柱子的最高的一根是对应的吗?

     

  • 文华客服:  是的,最高最低都不对应

     

  • 网友回复: 分析您的模型是取得DIFF1值最大的位置画线的,不是MACD
    您是要求在MACD最大最小的位置画线?
    请参考:DRAWKLINE(P/10,COLORRED,M,COLORCYAN,N);DIFF1 := EMA(CLOSE,12) - EMA(CLOSE,26),COLORLIGHTRED,LINETHICK3,NODRAW;DEA1:=EMA(DIFF1,9),NODRAW;MACD:=2*(DIFF1-DEA1);//DIFF减DEA的2倍画柱状线EMA56:=EMA(C,56),COLORGREEN,PRECIS2,CIRCLEDOT,LINETHICK1;T1:=BARSLAST(CROSS(DIFF1,DEA1))+1,NODRAW;TT1:=HHVBARS(MACD,T1)+1;TTT1:=BACKSET(CROSSDOWN(DIFF1,DEA1),TT1),NODRAW;HHH:=VALUEWHEN(CROSS(TTT1,0.5),MACD);H_S:IF(TTT1&&(EMA56>TTT1),HHH,NULL),COLORGREEN,LINETHICK5,NODRAW;// DING部MACD; Q1:BARSLAST(CROSSDOWN(DIFF1,DEA1))+1,NODRAW;QQ1:LLVBARS(MACD,Q1)+1;QQQ1:BACKSET(CROSS(DIFF1,DEA1),QQ1),NODRAW;LLL:VALUEWHEN(CROSS(QQQ1,0.5),MACD),NODRAW;L_S:=IF(QQQ1&&(QQQ1<EMA56), LLL,NULL),COLORRED,LINETHICK5,NODRAW;//{MACD高低点}GH:=VALUEWHEN(MACD=HHV(MACD,T1),H),NODRAW;GH1:=IF(GH=REF(GH,1),GH,NULL),DOT,COLORMAGENTA,LINETHICK3,NODRAW;DL:=VALUEWHEN(MACD=LLV(MACD,Q1),L),NODRAW;DL1:=IF(DL=REF(DL,1),DL,NULL),DOT,COLORRED,LINETHICK3,NODRAW;A9:=BACKSET(ISLASTBAR,BARSLAST(CROSS(TTT1,0.5))+1),NODRAW;A7:=BACKSET(ISLASTBAR,BARSLAST(CROSS(QQQ1,0.5))+1),NODRAW;DRAWSL(1&&A9=1,VALUEWHEN(CROSS(TTT1,0.5),H),0,1,0,COLORYELLOW),LINETHICK2;//水平线DRAWSL(1&&A7=1,VALUEWHEN(CROSS(QQQ1,0.5),L),0,1,0,COLORCYAN),DOT,LINETHICK2;//水平线
    另参数P、M、N请您自定义

 

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

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


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

相关文章

    没有相关内容