您现在的位置:程序化交易>> 股票公式>> 通达信>> 通达信知识>>正文内容

求助:请老师把飞狐公式修改成通达信可以用的!谢谢! [通达信]

  • 咨询内容: 求助:请老师把飞狐用(楚河汉界)公式修改成通达信可以用的!谢谢!

    楚河漢界(楚河汉界)
    {楚河漢界引用公式}
    {公称名称: CHUS}
    AAA:=1;TT:=1;
    RC:=(REF(CLOSE,1) * AAA);
    XA:=IF((RC > HIGH),RC,0);
    XB:=IF(((HIGH >= RC) AND (RC > LOW)),HIGH,0);
    XC:=IF((RC <= LOW),HIGH,0);
    XD:=((XA + XB) + XC);
    YA:=IF((RC > HIGH),LOW,0);
    YB:=IF(((HIGH >= RC) AND (RC > LOW)),LOW,0);
    YC:=IF((RC <= LOW),RC,0);
    YD:=((YA + YB) + YC);
    ATR:=SMA((XD - YD),20,1);
    TT1: (EMA(CLOSE,20) + (2 * ATR)),LINETHICK0;
    TT2: (EMA(CLOSE,20) - (2 * ATR)),LINETHICK0;
    TT3: ((((TT1 + TT1) + TT1) + TT2) / 4),LINETHICK0;
    TT4: ((((TT1 + TT2) + TT2) + TT2) / 4),LINETHICK0;
    TT5: EMA(CLOSE,8),LINETHICK0;
    TT6: EMA(CLOSE,20),LINETHICK0;

    {西楚霸王}
    TT:=1;
    CHECK:=0;
    CHECK1:=0;
    AAA:=IF((((CHECK = 0) OR (CHECK1 = 0)) AND (TT = 1)),1,0);
    TD:=DATATYPE;
    TT5:=(IF((TD = 1),"CHUS.TT1#min5",IF((TD = 2),"CHUS.TT1#min15",IF((TD = 3),"CHUS.TT1#min60",IF((TD = 4),"CHUS.TT1#min60",IF((TD = 5),"CHUS.TT1#day",IF((TD = 6),"CHUS.TT1#week","CHUS.TT1#year")))))) * TT);
    TT6:=(IF((TD = 1),"CHUS.TT2#min5",IF((TD = 2),"CHUS.TT2#min15",IF((TD = 3),"CHUS.TT2#min60",IF((TD = 4),"CHUS.TT2#min60",IF((TD = 5),"CHUS.TT2#day",IF((TD = 6),"CHUS.TT2#week","CHUS.TT2#year")))))) * TT);
    A3:=(IF((TD = 1),"CHUS.TT3#min5",IF((TD = 2),"CHUS.TT3#min15",IF((TD = 3),"CHUS.TT3#min60",IF((TD = 4),"CHUS.TT3#min60",IF((TD = 5),"CHUS.TT3#day",IF((TD = 6),"CHUS.TT3#week","CHUS.TT3#year")))))) * TT);
    A4:=(IF((TD = 1),"CHUS.TT4#min5",IF((TD = 2),"CHUS.TT4#min15",IF((TD = 3),"CHUS.TT4#min60",IF((TD = 4),"CHUS.TT4#min60",IF((TD = 5),"CHUS.TT4#day",IF((TD = 6),"CHUS.TT4#week","CHUS.TT4#year")))))) * TT);
    XC:=(IF((TD = 1),"CHUS.TT5#min5",IF((TD = 2),"CHUS.TT5#min15",IF((TD = 3),"CHUS.TT5#min60",IF((TD = 4),"CHUS.TT5#min60",IF((TD = 5),"CHUS.TT5#day",IF((TD = 6),"CHUS.TT5#week","CHUS.TT5#year")))))) * TT);
    XD:=(IF((TD = 1),"CHUS.TT6#min5",IF((TD = 2),"CHUS.TT6#min15",IF((TD = 3),"CHUS.TT6#min60",IF((TD = 4),"CHUS.TT6#min60",IF((TD = 5),"CHUS.TT6#day",IF((TD = 6),"CHUS.TT6#week","CHUS.TT6#year")))))) * TT);
    FILLRGN(((XC >= XD) AND (AAA = 1)),EMA(TT5,4),EMA(TT6,4)),color9966CC;
    FILLRGN(((XC < XD) AND (AAA = 1)),EMA(TT5,4),EMA(TT6,4)),colorFFFF00;
    FILLRGN(((EMA(CLOSE,8) >= EMA(CLOSE,20)) AND (AAA = 1)),EMA(A3,4),EMA(A4,4)),colorFF99CC;
    FILLRGN(((EMA(CLOSE,8) < EMA(CLOSE,20)) AND (AAA = 1)),EMA(A3,4),EMA(A4,4)),colorFFFF99;
    FO:=IF(CHECKUSER(1),OPEN,0);
    FH:=IF(CHECKUSER(1),HIGH,0);
    FL:=IF(CHECKUSER(1),LOW,0);
    FC:=IF(CHECKUSER(1),CLOSE,0);
    <%
    vo=ffl.vardata("fo")
    vh=ffl.vardata("fh")
    vl=ffl.vardata("fl")
    vc=ffl.vardata("fc")
    last=ubound(vc)
    vc(0)=(vh(0)+vl(0)+2*vc(0))/4
    for i=1 to last
    vo(i)=(vo(i-1)+vc(i-1))/2
    if vo(i)>vh(i) then vh(i)=vo(i) else vh(i)=vh(i)
    if vo(i) vc(i)=(2*vc(i)+vh(i)+vl(i))/4
    next
    ffl.vardata("fo")=vo
    ffl.vardata("fh")=vh
    ffl.vardata("fl")=vl
    ffl.vardata("fc")=vc

    %>
    KK:=IF(((FC >= FO) AND ((FC >= REF(FC,1)) OR (REF(FC,1) >= REF(FO,1)))),1,IF(((FC < FO) AND ((FC < REF(FO,1)) OR (REF(FC,1) < REF(FO,1)))),(0 - 1),0));
    明日轉折:(ROUND(((FO + FC) / 2)) * AAA),SHIFT1,LINETHICK0,colorFFFF;
    今日轉折:=ROUND(IF((KK = 1),MIN(FC,FO),IF((KK = (0 - 1)),MAX(FC,FO),IF((REF(KK,1) = 1),MIN(FC,FO),IF((REF(KK,1) = (0 - 1)),MAX(FC,FO),((FC + FO) / 2))))));
    DRAWNUMBER((ISLASTBAR AND (AAA = 1)),明日轉折,ROUND(明日轉折),2),SHIFT3;
    STICKLINE((((FC > FO) AND (TT = 1)) AND (AAA = 1)),FH,FL,0.4,0),colorFF;
    STICKLINE((((FO > FC) AND (TT = 1)) AND (AAA = 1)),FH,FL,0.4,0),colorFF0000;
    STICKLINE(((((KK = 1) AND (FC >= FO)) AND (TT = 1)) AND (AAA = 1)),FO,FC,8,0),colorFF;
    STICKLINE(((((KK = 1) AND (FC < FO)) AND (TT = 1)) AND (AAA = 1)),FO,FC,8,0),colorFF;
    STICKLINE(((((KK = (0 - 1)) AND (FC >= FO)) AND (TT = 1)) AND (AAA = 1)),FO,FC,8,0),colorFF0000;
    STICKLINE(((((KK = (0 - 1)) AND (FC < FO)) AND (TT = 1)) AND (AAA = 1)),FO,FC,8,0),colorFF0000;
    STICKLINE(((((KK = 0) AND (FC >= FO)) AND (TT = 1)) AND (AAA = 1)),FO,FC,8,0),colorFF;
    STICKLINE(((((KK = 0) AND (FC < FO)) AND (TT = 1)) AND (AAA = 1)),FO,FC,8,0),colorFF;
    CC:=(CLOSE * TT);
    DIFF:=(EMA(CC,26) - EMA(CC,52));
    DEA:=EMA(DIFF,52);
    MACD:=(2 * (DIFF - DEA));
    DIF:=(EMA(CC,26) - EMA(CC,52));
    ESS:=EMA(CC,26);
    EGG:=EMA(CC,52);
    RDIF:=REF(DIF,1);
    RSS:=REF(ESS,1);
    RGG:=REF(EGG,1);
    RDEA:=REF(DEA,1);
    RMACD:=REF(MACD,1);
    RZZZ:=(RDEA + (((52 + 1) / (2 * (52 - 1))) * RMACD));
    XDIF:=((((((52 - 1) * (26 + 1)) * RGG) - (((52 + 1) * (26 - 1)) * RSS)) + (((26 + 1) * (52 + 1)) * RDIF)) / ((2 * 52) - (2 * 26)));
    XDEA:=((((((52 - 1) * (26 + 1)) * RGG) - (((52 + 1) * (26 - 1)) * RSS)) + (((26 + 1) * (52 + 1)) * RDEA)) / ((2 * 52) - (2 * 26)));
    XMACD:=((((((52 - 1) * (26 + 1)) * RGG) - (((52 + 1) * (26 - 1)) * RSS)) + (((26 + 1) * (52 + 1)) * RZZZ)) / ((2 * 52) - (2 * 26)));
    AA:=ISLASTBAR;
    BB:=BACKSET((AA = 1),1);
    Y:=BARSLAST((BB = 1));
    X:=1;
    TDIF:=(DIF * X);
    TSS:=(ESS * X);
    TGG:=(EGG * X);
    TDEA:=(DEA * X);
    TMACD:=(MACD * X);
    TZZZ:=(TDEA + (((52 + 1) / (2 * (52 - 1))) * TMACD));
    西楚霸王:(((((((((52 - 1) * (26 + 1)) * TGG) * AAA) - ((((52 + 1) * (26 - 1)) * TSS) * AAA)) + (((26 + 1) * (52 + 1)) * TDIF)) * AAA) / ((2 * 52) - (2 * 26))) * AAA);
    PARTLINE(((西楚霸王 >= REF(西楚霸王,1)) AND (AAA = 1)),西楚霸王),LINETHICK3,colorFF;
    PARTLINE(((西楚霸王 < REF(西楚霸王,1)) AND (AAA = 1)),西楚霸王),LINETHICK3,colorFF00;

    {点击看本软件截图:分.析家公 式网 http://www、88gs、com 整理}

 

如果以上指标公式不适用于您常用的行情软件

或者您想改编成选股公式,以便快速选出某种形态个股的话,

可以联系我们相关技术人员 QQ: 262069696  点击在线交流进行 有偿 改编!

 


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

相关文章

    没有相关内容