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

条件多空 [文华财经]

  • 咨询内容:  老师好,帮忙把下面这个公式做一下优化:将原来的买入、卖出信号全部取消,另外如图重新设置提示“多”“空”信号并加声音预警,谢谢!

    S:=CROSS(CLOSE,EMA2(HIGH,30));

    X:=CROSS(EMA2(LOW,30),CLOSE);

    WS:=BARSLAST(S)+1;

    WX:=BARSLAST(X)+1;

    SS:=CROSS(SUM(S,WX),0.5);

    XX:=CROSS(SUM(X,WS),0.5);

    STICKLINE(CLOSE>EMA2(HIGH,30),EMA2(HIGH,30),EMA2(LOW,30),COLORMAGENTA,1);

    STICKLINE(CLOSE<EMA2(LOW,30),EMA2(LOW,30),EMA2(HIGH,30),COLORBLUE,1);

    STICKLINE(CLOSE>EMA2(HIGH,150),EMA2(HIGH,150),EMA2(LOW,150),COLORLIGHTRED,1);

    STICKLINE(CLOSE<EMA2(LOW,150),EMA2(LOW,150),EMA2(HIGH,150),COLORLIGHTGREEN,1);

    PARTLINE(CLOSE>EMA2(HIGH,30),EMA2(HIGH,30),COLORMAGENTA);

    PARTLINE(CLOSE<EMA2(HIGH,30),EMA2(HIGH,30),COLORBLUE);

    PARTLINE(CLOSE>EMA2(LOW,30),EMA2(LOW,30),COLORMAGENTA);

    PARTLINE(CLOSE<EMA2(LOW,30),EMA2(LOW,30),COLORBLUE);

    PARTLINE(CLOSE>EMA2(HIGH,150),EMA2(HIGH,150),COLORLIGHTRED);

    PARTLINE(CLOSE<EMA2(HIGH,150),EMA2(HIGH,150),COLORLIGHTGREEN);

    PARTLINE(CLOSE>EMA2(LOW,150),EMA2(LOW,150),COLORLIGHTRED);

    PARTLINE(CLOSE<EMA2(LOW,150),EMA2(LOW,150),COLORLIGHTGREEN);

    STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,COLORRED,0);

    STICKLINE(CLOSE>=OPEN,CLOSE,OPEN,COLORCYAN,0);

    DRAWTEXT(SS,LOW,'买入');

    DRAWTEXT(XX,HIGH,'卖出');




    文件名:hhhh1.png


     

     

     来源:程序化99

  • 文华技术人员:  多方看下是不是想要的效果
    S:=CROSS(CLOSE,EMA2(HIGH,30)); X:=CROSS(EMA2(LOW,30),CLOSE); WS:=BARSLAST(S)+1; WX:=BARSLAST(X)+1; SS:=CROSS(SUM(S,WX),0.5); XX:=CROSS(SUM(X,WS),0.5);


    PARTLINE(CLOSE>EMA2(HIGH,30),EMA2(HIGH,30),COLORMAGENTA); PARTLINE(CLOSE<EMA2(HIGH,30),EMA2(HIGH,30),COLORBLUE); PARTLINE(CLOSE>EMA2(LOW,30),EMA2(LOW,30),COLORMAGENTA); PARTLINE(CLOSE<EMA2(LOW,30),EMA2(LOW,30),COLORBLUE); PARTLINE(CLOSE>EMA2(HIGH,150),EMA2(HIGH,150),COLORLIGHTRED); PARTLINE(CLOSE<EMA2(HIGH,150),EMA2(HIGH,150),COLORLIGHTGREEN); PARTLINE(CLOSE>EMA2(LOW,150),EMA2(LOW,150),COLORLIGHTRED); PARTLINE(CLOSE<EMA2(LOW,150),EMA2(LOW,150),COLORLIGHTGREEN);
    STICKLINE(CLOSE>EMA2(HIGH,30),EMA2(HIGH,30),EMA2(LOW,30),COLORMAGENTA,1); STICKLINE(CLOSE<EMA2(LOW,30),EMA2(LOW,30),EMA2(HIGH,30),COLORBLUE,1);

    STICKLINE(CLOSE>EMA2(HIGH,150),EMA2(HIGH,150),EMA2(LOW,150),COLORLIGHTRED,1); STICKLINE(CLOSE<EMA2(LOW,150),EMA2(LOW,150),EMA2(HIGH,150),COLORLIGHTGREEN,1); AA:CROSS(EMA2(L,30),EMA2(H,150)),NODRAW; VERTLINE(AA ,COLORRED); DRAWTEXT( EMA2(L,30)>EMA2(H,150)&&EXIST(C<EMA2(L,30),BARSLAST(AA))&&C>EMA2(H,30)&&COUNT(EXIST(C<EMA2(L,30),BARSLAST(AA))&&C>EMA2(H,30),BARSLAST(AA))=1,H,'';

     

     来源: WWW.CXH99.COM

  • 文华客服:  老师,原来这个放副图上有K线显示的,现在看不到K线了,看不出效果


    文件名:6666.png

     

  • 网友回复: 您1楼的源码中的两个柱线有些奇怪的,阳线显示青色?阴线显示红色? 
  • 网友回复: STICKLINE(OPEN>=CLOSE,CLOSE,OPEN,COLORRED,0); 
  • 网友回复:STICKLINE(CLOSE>=OPEN,CLOSE,OPEN,COLORCYAN,0);

     

  • 网友回复:  这个是在副图显示K线的颜色的,没问题

 

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

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


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

相关文章

    没有相关内容