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

请老师修改下程序 [文华财经]

  • 咨询内容: 老师,我想把标注到K线上的数字做两步修改:
    第一:在数字的前面显示它的倍数值
    第二:光标点击某一根K线作为最新的一根K线按原来的方式进行重新计算,包括向前移动K线的根数:如图例:
    A:=DEA0+0.15*CZ,COLORGREEN;
    B:=DEA0-0.05*CZ,COLORGREEN;
    CC:=DEA0-0.10*CZ,COLORGREEN;
    D:=DEA0-0.15*CZ,COLORGREEN;
    E:=DEA0-0.20*CZ,COLORGREEN;
    F:=DEA0-0.25*CZ,COLORGREEN;
    G:=DEA0-0.30*CZ,COLORGREEN;
    HH:=DEA0-0.35*CZ,COLORGREEN;
    I:=DEA0-0.40*CZ,COLORGREEN;
    J:=DEA0-0.45*CZ,COLORGREEN;
    K:=DEA0-0.50*CZ,COLORGREEN;
    LL:=DEA0-0.55*CZ,COLORGREEN;
    当天收盘价:=(945/52)*DEA0-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1);
    当天收盘价A:=(945/52)*A-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1);
    当天收盘价B:=(945/52)*B-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1);
    当天收盘价CC:=(945/52)*CC-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1);
    当天收盘价D:=(945/52)*D-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1);
    当天收盘价E:=(945/52)*E-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1);
    当天收盘价F:=(945/52)*F-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1);
    当天收盘价G:=(945/52)*G-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1);
    当天收盘价HH:=(945/52)*HH-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1);
    当天收盘价I:=(945/52)*I-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1);
    当天收盘价J:=(945/52)*J-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1);
    当天收盘价K:=(945/52)*K-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1);
    当天收盘价LL:=(945/52)*LL-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1);
    DRAWNUMBER(REFX1(BARPOS,9999)-BARPOS=7,DIFF,REFX1(当天收盘价A,9999),1,COLORMAGENTA),FONTSIZE15;
    DRAWNUMBER(REFX1(BARPOS,9999)-BARPOS=7,DIFF,REFX1(当天收盘价,9999),1,COLORWHITE),FONTSIZE15,VALIGN0;
    DRAWNUMBER(REFX1(BARPOS,9999)-BARPOS=12,DIFF,REFX1(当天收盘价B,9999),1,COLORCYAN),FONTSIZE15;
    DRAWNUMBER(REFX1(BARPOS,9999)-BARPOS=12,DIFF,REFX1(当天收盘价CC,9999),1,COLORGREEN),FONTSIZE15,VALIGN0;
    DRAWNUMBER(REFX1(BARPOS,9999)-BARPOS=16,


    文件名:ED842DCF-4F8F-4B56-A706-B97686D36D37.jpeg

     

     来源:程序化99

  • 文华技术人员:

    思路2实现不了,编写取不到光标所在位置

     

    另外,思路1可以实现,但是1楼源码不全,您复制完整源码我们看下

     

     来源: WWW.CXH99.COM

  • 文华客服: DIFF:EMA(CLOSE,SHORT) - EMA(CLOSE,LONG),NOTEXT;
    DEA1:EMA(DIFF,M),NOTEXT;
    MACD:=1*(DIFF-DEA1),COLORSTICK,NODRAW;
    CZ:=REF(DEA1,1)-REF(DEA1,2),NODRAW;//差值
    DEA0:=REF(DEA1,1)+CZ,NODRAW,COLORWHITE;
    DRAWLINE3(ISLASTBAR,DEA0,0,1,REF(DEA1,1),1,0),COLORRED,SOLID;
    TN:=(DEA1-DEA0)/CZ;
    DRAWICON(ISLASTBAR&&CZ>0&&TN>=-0.79&&TN<=-0.60,DEA1,'ICO4');
    DRAWICON(ISLASTBAR&&CZ<0&&TN>=-0.79&&TN<=-0.60,DEA1,'ICO5'),VALIGN0;
    DRAWICON(ISLASTBAR&&CZ>0&&TN>=-1.1&&TN<=-0.90,DEA1,'ICO4');
    DRAWICON(ISLASTBAR&&CZ<0&&TN>=-1.1&&TN<=-0.90,DEA1,'ICO5'),VALIGN0;
    DRAWICON(ISLASTBAR&&CZ>0&&TN>=-1.45&&TN<=-1.34,DEA1,'ICO4');
    DRAWICON(ISLASTBAR&&CZ<0&&TN>=-1.45&&TN<=-1.34,DEA1,'ICO5'),VALIGN0;
    DRAWICON(ISLASTBAR&&CZ>0&&TN>=-1.96&&TN<=-1.74,DEA1,'ICO4');
    DRAWICON(ISLASTBAR&&CZ<0&&TN>=-1.96&&TN<=-1.74,DEA1,'ICO5'),VALIGN0;
    DRAWICON(ISLASTBAR&&CZ>0&&TN>=-2.35&&TN<=-2.1,DEA1,'ICO4');
    DRAWICON(ISLASTBAR&&CZ<0&&TN>=-2.35&&TN<=-2.1,DEA1,'ICO5'),VALIGN0;
    DRAWICON(ISLASTBAR&&CZ>0&&TN>=-2.82&&TN<=-2.55,DEA1,'ICO4');
    DRAWICON(ISLASTBAR&&CZ<0&&TN>=-2.82&&TN<=-2.55,DEA1,'ICO5'),VALIGN0;
    X:=2;//移动距离
    AA:=BACKSET(ISLASTBAR,4);
    DRAWNUMBER(CROSS(AA,0.5)&&REFX1(TN,10000)>0,REFX1(DEA0,10000)+0,REFX1(TN,10000),2,COLORRED),FONTSIZE15;
    DRAWNUMBER(CROSS(AA,0.5)&&REFX1(TN,10000)<0,REFX1(DEA0,10000)+0,REFX1(TN,10000),2,COLORGREEN),FONTSIZE15;

     

  • 网友回复: T1:0.10,PRECIS2,NODRAW;
    TA1:=DEA0+CZ*T1;
    TB1:=DEA0-CZ*T1;
    IF(TN>0&&CZ>0,(945/52)*TA1-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1),NULL),COLORRED,NODRAW;//两个判断条件,并列编写即可
    IF(TN<0&&CZ>0,(945/52)*TA1-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1),NULL),COLORRED,NODRAW;
    IF(TN>0&&CZ<0,(945/52)*TA1-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1),NULL),COLORRED,NODRAW;
    IF(TN<0&&CZ<0,(945/52)*TA1-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1),NULL),COLORRED,NODRAW;
    T2:0.15,PRECIS2,NODRAW;
    TA2:=DEA0+CZ*T2;
    TB2:=DEA0-CZ*T2;
    IF(TN>0&&CZ>0,(945/52)*TA2-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1),NULL),COLORRED,NODRAW;//两个判断条件,并列编写即可
    IF(TN<0&&CZ>0,(945/52)*TA2-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1),NULL),COLORRED,NODRAW;
    IF(TN>0&&CZ<0,(945/52)*TA2-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1),NULL),COLORRED,NODRAW;
    IF(TN<0&&CZ<0,(945/52)*TA2-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1),NULL),COLORRED,NODRAW;
    T3:0.20,PRECIS2,NODRAW;
    TA3:=DEA0+CZ*T3;
    TB3:=DEA0-CZ*T3;
    IF(TN>0&&CZ>0,(945/52)*TA3-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1),NULL),COLORRED,NODRAW;//两个判断条件,并列编写即可
    IF(TN<0&&CZ>0,(945/52)*TA3-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1),NULL),COLORRED,NODRAW;
    IF(TN>0&&CZ<0,(945/52)*TA3-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1),NULL),COLORRED,NODRAW;
    IF(TN<0&&CZ<0,(945/52)*TA3-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1),NULL),COLORRED,NODRAW;
    T4:0.25,PRECIS2,NODRAW;
    TA4:=DEA0+CZ*T4;
    TB4:=DEA0-CZ*T4;
    IF(TN>0&&CZ>0,(945/52)*TA4-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1),NULL),COLORRED,NODRAW;//两个判断条件,并列编写即可
    IF(TN<0&&CZ>0,(945/52)*TA4-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1),NULL),COLORRED,NODRAW;
    IF(TN>0&&CZ<0,(945/52)*TA4-(245/52)*REF(EMA(C,8)

     

  • 网友回复: A:=DEA0+0.15*CZ,COLORGREEN;
    B:=DEA0-0.05*CZ,COLORGREEN;
    CC:=DEA0-0.10*CZ,COLORGREEN;
    D:=DEA0-0.15*CZ,COLORGREEN;
    E:=DEA0-0.20*CZ,COLORGREEN;
    F:=DEA0-0.25*CZ,COLORGREEN;
    G:=DEA0-0.30*CZ,COLORGREEN;
    HH:=DEA0-0.35*CZ,COLORGREEN;
    I:=DEA0-0.40*CZ,COLORGREEN;
    J:=DEA0-0.45*CZ,COLORGREEN;
    K:=DEA0-0.50*CZ,COLORGREEN;
    LL:=DEA0-0.55*CZ,COLORGREEN;
    当天收盘价:=(945/52)*DEA0-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1);
    当天收盘价A:=(945/52)*A-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1);
    当天收盘价B:=(945/52)*B-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1);
    当天收盘价CC:=(945/52)*CC-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1);
    当天收盘价D:=(945/52)*D-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1);
    当天收盘价E:=(945/52)*E-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1);
    当天收盘价F:=(945/52)*F-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1);
    当天收盘价G:=(945/52)*G-(245/52)*REF(EMA(C,8),1)+(297/52)*REF(EMA(C,34),1)-(315/26)*REF(DEA1,1);

 

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

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

怎么收费,代编流程等详情请点击阅读,或QQ微信联系我们!


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

相关文章

    没有相关内容