指标增加交易指令

    菜鸟 发表于 2020-06-10 12:38 ・489次浏览 1条跟帖 赢智 wh8 回复

    
    
    HH1:=IFELSE(H<REF(H,10) && REF(H,10)<REF(H,20),REF(H,20),0);
    LL1:=IFELSE(L>REF(L,10) && REF(L,10)>REF(L,20),REF(L,20),0);
    HH2:=VALUEWHEN(HH1>0,HH1);
    LL2:=VALUEWHEN(LL1>0,LL1);
    K1:=IFELSE(CLOSE>HH2,-3,IFELSE(CLOSE<LL2,1,0));
    K2:=VALUEWHEN(K1<>0,K1);
    G:=IFELSE(K2=1,HH2,LL2);
    G1:=VALUEWHEN(ISLASTBAR,G);
    W1:=K2;
    W2:=OPEN-CLOSE;
    HT:=IFELSE(OPEN>CLOSE,OPEN,CLOSE);
    LT:=IFELSE(OPEN<CLOSE,OPEN,CLOSE);
    DRAWCOLORKLINE(C< O ,RGB(192,192,192),0);
    DRAWCOLORKLINE(C>= O ,RGB(192,192,192),1);
    BAA:=1;
    MA4:=EMA(CLOSE,10)*BAA;
    HH:=HHV(HIGH,5)*BAA;
    LL:=LLV(LOW,5)*BAA;
    H1:=IFELSE(CLOSE>REF(HH,1),1,0)*BAA;
    L1:=IFELSE(CLOSE<REF(LL,1),-1,0)*BAA;
    H0:=REF(HIGH,1)*BAA;
    L0:=REF(LOW,1)*BAA;
    P7:=H1+L1*BAA;
    P8:=IFELSE(P7=0,REF(P7,1),P7)*BAA;
    P9:=IFELSE(P8=0,REF(P8,1),P8)*BAA;
    P10:=IFELSE(P9=0,REF(P9,1),P9)*BAA;
    P11:=IFELSE(P10=0,REF(P10,1),P10)*BAA;
    P12:=IFELSE(P11=0,REF(P11,1),P11)*BAA;
    P13:=IFELSE(P12=0,REF(P12,1),P12)*BAA;
    P14:=IFELSE(P13=0,REF(P13,1),P13)*BAA;
    P15:=IFELSE(P14=0,REF(P14,1),P14)*BAA;
    P16:=IFELSE(P15=0,REF(P15,1),P15)*BAA;
    P17:=IFELSE(P16=0,REF(P16,1),P16)*BAA;
    P18:=IFELSE(P17=0,REF(P17,1),P17)*BAA;
    P19:=IFELSE(P18=0,REF(P18,1),P18)*BAA;
    P20:=IFELSE(P19=0,REF(P19,1),P19)*BAA;
    P21:=IFELSE(P20=0,REF(P20,1),P20)*BAA;
    P22:=IFELSE(P21=0,REF(P21,1),P21)*BAA;
    P23:=IFELSE(P22=0,REF(P22,1),P22)*BAA;
    P24:=IFELSE(P23=0,REF(P23,1),P23)*BAA;
    P25:=IFELSE(P24=0,REF(P24,1),P24)*BAA;
    P26:=IFELSE(P25=0,REF(P25,1),P25)*BAA;
    P27:=IFELSE(P26=0,REF(P26,1),P26)*BAA;
    P28:=IFELSE(P27=0,REF(P27,1),P27)*BAA;
    P29:=IFELSE(P28=0,REF(P28,1),P28)*BAA;
    P30:=IFELSE(P29=0,REF(P29,1),P29)*BAA;
    T:=IFELSE(P30=0,REF(P30,1),P30)*BAA;
    AUTOFILTER;
    DD:=BARSLAST(CROSS(T=1,0.5));
    KK:=BARSLAST(CROSS(T=-1,0.5));
    DRAWLINE(W1=1 && KK<DD,HIGH,W1=1 && KK<DD,HT,COLORGREEN);
    DRAWLINE(W1=1 && KK<DD,LOW,W1=1 && KK<DD,LT,COLORGREEN);
    DRAWLINE(W1=-3 && DD<KK,HIGH,W1=-3 && DD<KK,HT,COLORRED);
    DRAWLINE(W1=-3 && DD<KK,LOW,W1=-3 && DD<KK,LT,COLORRED);
    STICKLINE(W1>0 && KK<DD,OPEN,CLOSE,COLORGREEN,1);
    STICKLINE(W1<=0 && DD<KK,OPEN,CLOSE,COLORRED,1);
    STICKLINE(W2>0 && W1<=0 && DD<KK,OPEN,CLOSE,COLORRED,0);
    STICKLINE(W2>0 && W1>0 && KK<DD,OPEN,CLOSE,COLORGREEN,0);
    //SETEXPIREDATE(?');
    这个模型能编写红色K线买进,K线变白色或绿色,平仓。K线变绿色卖开,K线变白色或红色平仓吗。
    
    
        
    
    

    autojiaoyi.com 沙发

    参考:
    
    HH1:=IFELSE(H<REF(H,10) && REF(H,10)<REF(H,20),REF(H,20),0);
    LL1:=IFELSE(L>REF(L,10) && REF(L,10)>REF(L,20),REF(L,20),0);
    HH2:=VALUEWHEN(HH1>0,HH1);
    LL2:=VALUEWHEN(LL1>0,LL1);
    K1:=IFELSE(CLOSE>HH2,-3,IFELSE(CLOSE<LL2,1,0));
    K2:=VALUEWHEN(K1<>0,K1);
    G:=IFELSE(K2=1,HH2,LL2);
    G1:=VALUEWHEN(ISLASTBAR,G);
    W1:=K2;
    W2:=OPEN-CLOSE;
    HT:=IFELSE(OPEN>CLOSE,OPEN,CLOSE);
    LT:=IFELSE(OPEN<CLOSE,OPEN,CLOSE);
    DRAWCOLORKLINE(C< O ,RGB(192,192,192),0);
    DRAWCOLORKLINE(C>= O ,RGB(192,192,192),1);
    BAA:=1;
    MA4:=EMA(CLOSE,10)*BAA;
    HH:=HHV(HIGH,5)*BAA;
    LL:=LLV(LOW,5)*BAA;
    H1:=IFELSE(CLOSE>REF(HH,1),1,0)*BAA;
    L1:=IFELSE(CLOSE<REF(LL,1),-1,0)*BAA;
    H0:=REF(HIGH,1)*BAA;
    L0:=REF(LOW,1)*BAA;
    P7:=H1+L1*BAA;
    P8:=IFELSE(P7=0,REF(P7,1),P7)*BAA;
    P9:=IFELSE(P8=0,REF(P8,1),P8)*BAA;
    P10:=IFELSE(P9=0,REF(P9,1),P9)*BAA;
    P11:=IFELSE(P10=0,REF(P10,1),P10)*BAA;
    P12:=IFELSE(P11=0,REF(P11,1),P11)*BAA;
    P13:=IFELSE(P12=0,REF(P12,1),P12)*BAA;
    P14:=IFELSE(P13=0,REF(P13,1),P13)*BAA;
    P15:=IFELSE(P14=0,REF(P14,1),P14)*BAA;
    P16:=IFELSE(P15=0,REF(P15,1),P15)*BAA;
    P17:=IFELSE(P16=0,REF(P16,1),P16)*BAA;
    P18:=IFELSE(P17=0,REF(P17,1),P17)*BAA;
    P19:=IFELSE(P18=0,REF(P18,1),P18)*BAA;
    P20:=IFELSE(P19=0,REF(P19,1),P19)*BAA;
    P21:=IFELSE(P20=0,REF(P20,1),P20)*BAA;
    P22:=IFELSE(P21=0,REF(P21,1),P21)*BAA;
    P23:=IFELSE(P22=0,REF(P22,1),P22)*BAA;
    P24:=IFELSE(P23=0,REF(P23,1),P23)*BAA;
    P25:=IFELSE(P24=0,REF(P24,1),P24)*BAA;
    P26:=IFELSE(P25=0,REF(P25,1),P25)*BAA;
    P27:=IFELSE(P26=0,REF(P26,1),P26)*BAA;
    P28:=IFELSE(P27=0,REF(P27,1),P27)*BAA;
    P29:=IFELSE(P28=0,REF(P28,1),P28)*BAA;
    P30:=IFELSE(P29=0,REF(P29,1),P29)*BAA;
    T:=IFELSE(P30=0,REF(P30,1),P30)*BAA;
    DD:=BARSLAST(CROSS(T=1,0.5));
    KK:=BARSLAST(CROSS(T=-1,0.5));
    DRAWLINE(W1=1 && KK<DD,HIGH,W1=1 && KK<DD,HT,COLORGREEN);
    DRAWLINE(W1=1 && KK<DD,LOW,W1=1 && KK<DD,LT,COLORGREEN);
    DRAWLINE(W1=-3 && DD<KK,HIGH,W1=-3 && DD<KK,HT,COLORRED);
    DRAWLINE(W1=-3 && DD<KK,LOW,W1=-3 && DD<KK,LT,COLORRED);
    STICKLINE(W1>0 && KK<DD,OPEN,CLOSE,COLORGREEN,1);
    STICKLINE(W1<=0 && DD<KK,OPEN,CLOSE,COLORRED,1);
    STICKLINE(W2>0 && W1<=0 && DD<KK,OPEN,CLOSE,COLORRED,0);
    STICKLINE(W2>0 && W1>0 && KK<DD,OPEN,CLOSE,COLORGREEN,0);
    W1=-3 && DD<KK||W1<=0 && DD<KK||W2>0 && W1<=0 && DD<KK,BPK;
    NOT(W1=-3 && DD<KK||W1<=0 && DD<KK||W2>0 && W1<=0 && DD<KK),SP;
    W1=1 && KK<DD||W1>0 && KK<DD||W2>0 && W1>0 && KK<DD,SPK;
    NOT(W1=1 && KK<DD||W1>0 && KK<DD||W2>0 && W1>0 && KK<DD),BP;
    AUTOFILTER;
    
    回复

    本版积分规则

    发布新内容
    请关注微信公众号,获取最新指标公式
    加入收藏 我要分享
    分享到论坛或者博客

    复制
    热门指标策略
    快速回复 返回顶部 返回列表