最新公告
  • 欢迎您光临九毛八公式指标网www.9m8.cn,本站全新改版试运行,期间内容全部免费,欢迎下载!欢迎加入本站VIP
  • 把划线波浪趋势和单阳不破两个主图合二为一

    正文概述    2024-04-14 08:20:59  

    九毛八公式指标

    公式模块:

    划线波浪趋势;
    input:N(10,1,88);
    V1:= BARSTATUS=2;
    V2:=REF(HIGH,N)=HHV(HIGH,2*N+1);
    V3:=FILTER(V2,N);
    V4:=BacKSET(V3,N+1);
    V5:=FILTER(V4,N);
    V6:=V5 OR V1;
    V7:=REF(LOW,N)=LLV(LOW,2*N+1);
    V8:=FILTER(V7,N);
    V9:=BACKSET(V8,N+1);
    VA:=FILTER(V9,N);
    VB:=VA AND NOT(V5);
    VC:=BACKSET(V6,REF(BArslAST(VB),1)+1);
    VD:=VC>REF(VC,1);
    VE:=BACKSET(VD,2);
    VF:=VE>REF(VE,1);
    V10:=BACKSET(VF AND COUNT(V6,REF(BARSLAST(VB),1)+2)=0,REF(BARSLAST(VB),1)+2);
    V11:=V10>REF(V10,1);
    V12:=BACKSET(V11 AND COUNT(V6,REF(BARSLAST(VB),1)+2)=0,REF(BARSLAST(VB),1)+2);
    V13:=V12>REF(V12,1);
    V14:=IF(V6,COUNT(VB,REF(BARSLAST(V6),1)+1),0);
    V15:=IF(V14=1 AND V6,BARSLAST(VF),0);
    V16:=IF(V6 AND REF(LOW,BARSLAST(VF))>=REF(LOW,BARSLAST(V11)),BARSLAST(V11),BARSLAST(VF));
    V17:=IF(V14=2 AND V6,V16,0);
    V18:=IF(V14>=3 AND V6,IF(V6 AND REF(LOW,V16)>=REF(LOW,BARSLAST(V13)),BARSLAST(V13),V16),0);
    V19:=V15+V17+V18;
    V1A:=BACKSET(V6,V19);
    V1B:=V1A>REF(V1A,1);
    V1C:=BACKSET(V1B,2);
    V1D:=V1C>REF(V1C,1);
    V1E:=V1D OR V1;
    V1F:=BACKSET(V1E,REF(BARSLAST(V6),1)+1);
    V20:=V1F>REF(V1F,1);
    V21:=BACKSET(V20,2);
    V22:=V21>REF(V21,1);
    V23:=BACKSET(V22 AND COUNT(V1E,REF(BARSLAST(V6),1)+2)=0,REF(BARSLAST(V6),1)+2);
    V24:=V23>REF(V23,1);
    V25:=BACKSET(V24 AND COUNT(V1E,REF(BARSLAST(V6),1)+2)=0,REF(BARSLAST(V6),1)+2);
    V26:=V25>REF(V25,1);
    V27:=IF(V1E,COUNT(V5,REF(BARSLAST(V1E),1)+1),0);
    V28:=IF(V27=1 AND V1E,BARSLAST(V22),0);
    V29:=IF(V1E AND REF(HIGH,BARSLAST(V22))<=REF(HIGH,BARSLAST(V24)),BARSLAST(V24),BARSLAST(V22));
    V2A:=IF(V27=2 AND V1E,V29,0);
    V2B:=IF(V27>=3 AND V1E,IF(V1E AND REF(HIGH,V29)<=REF(HIGH,BARSLAST(V26)),BARSLAST(V26),V29),0);
    V2C:=V28+V2A+V2B;
    V2D:=BACKSET(V1E,V2C);
    V2E:=V2D>REF(V2D,1);
    V2F:=BACKSET(V2E,2);
    V30:=V2F>REF(V2F,1);
    DRAWLINE(V1D,LOW,V30,HIGH,0);
    DRAWLINE(V30,HIGH,V1D,LOW,0);
    V31:=BACKSET(V1,BARSLAST(V1D)+1);
    V32:=V31>REF(V31,1);
    V33:=BACKSET(V1,BARSLAST(V30)+1);
    V34:=V33>REF(V33,1);
    V35:=IF(BARSLAST(V32)<BARSLAST(V34),V32,V34);
    V36:=IF(BARSLAST(V32)<BARSLAST(V34),LOW,HIGH);
    DRAWLINE(V35,V36,V1,CLOSE,0);
    V37:=BACKSET(V1,BARSLAST(V1D)+1);
    V38:=V37>REF(V37,1);
    V39:=BACKSET(V38,REF(BARSLAST(V1D),1)+2);
    V3A:=V39>REF(V39,1);
    DRAWLINE(V3A,LOW,V38,LOW,1);
    V3B:=BACKSET(V1,BARSLAST(V30)+1);
    V3C:=V3B>REF(V3B,1);
    V3D:=BACKSET(V3C,REF(BARSLAST(V30),1)+2);
    V3E:=V3D>REF(V3D,1);
    DRAWLINE(V3E,HIGH,V3C,HIGH,1);
    前一低: REF(LOW,BARSLAST(V38)),colorccff99,POINTDOT;
    前二低: REF(LOW,BARSLAST(V3A)),colormagenta,POINTDOT;
    前一高: REF(HIGH,BARSLAST(V3C)),colorccff99;
    前二高: REF(HIGH,BARSLAST(V3E)),colormagenta;
    {以下语句是大盘指数显示}
    A1:=REF(HIGH,3)=HHV(HIGH,2*3+1); B1:=FILTER(A1,3); C1:=BACKSET(B1,3+1); D1:=FILTER(C1,3);{高点}
    A2:=REF(LOW,3)=LLV(LOW,2*3+1); B2:=FILTER(A2,3); C2:=BACKSET(B2,3+1); D2:=FILTER(C2,3);{低点}
    E1:=(REF(LLV(LOW,2*3),1)+REF(HHV(HIGH,2*3),1))/2; E2:=(HIGH+LOW)/2;{高低点出现在同一k线上时可作取舍}
    H1:=(D1 AND NOT(D2 AND E1>=E2)) OR BARSTATUS=2 OR BARSCOUNT(CLOSE)=1;
    L1:=(D2 AND NOT(D1 AND E1<E2)); H2:=D1 AND NOT(D2 AND E1>=E2);
    X1:=REF(BARSLAST(H1),1)+1; F1:=BACKSET(H1 AND COUNT(L1,X1)>0,LLVBARS(IF(L1,LOW,10000),X1));
    G1:=F1>REF(F1,1); I1:=BACKSET(G1,2); LD:=I1>REF(I1,1);{过滤后低点}
    L2:=LD OR BARSTATUS=2 OR BARSCOUNT(CLOSE)=1;
    X2:=REF(BARSLAST(L2),1)+1; F2:=BACKSET(L2 AND COUNT(H2,X2)>0,HHVBARS(IF(H2,HIGH,0),X2));
    G2:=F2>REF(F2,1); I2:=BACKSET(G2,2); HD:=I2>REF(I2,1);{过滤后高点}
    UU:=BACKSET(BARSTATUS=2,BARSLAST(LD)+1);
    VV:=UU>REF(UU,1);
    WW:=BACKSET(VV,REF(BARSLAST(LD),1)+2);
    XX:=WW>REF(WW,1);
    常数1:=REF(INDEXC,BARSLAST(VV))/REF(CLOSE,BARSLAST(VV));
    常数2:=REF(INDEXC,BARSLAST(XX))/REF(CLOSE,BARSLAST(XX));
    DRAWTEXT(HD,H*1.01,NUMTOSTRN(H,2)),COLOR00FF00,LINETHICK3;
    DRAWTEXT(LD,L,NUMTOSTRN(L,2)),COLORFFAAFF,LINETHICK3;

    单阳不破;

    单阳:=C>O*1.03 AND vol>REF(VOL,1)*1.5;
    不破价:=REF(L,BARSLAST(单阳));
    DRAWTEXT(单阳,L-L*0.02,'阳'),COLOR00FFFF;
    LS0:=BARSLAST(单阳);
    LS11:=IF(1,LS0=1,单阳);
    LS21:=IF(1,LLV(L,1)>REF(L,1),1);
    单阳不破:=LS11 AND LS21;
    STICKLINE(单阳不破,不破价-不破价*0.002,不破价,4,0),COLORRED;
    DRAWTEXT(单阳不破,不破价-不破价*0.02,'1'),COLORGREEN;
    LS12:=IF(2,LS0=2,单阳);
    LS22:=IF(2,LLV(L,2)>REF(L,2),1);
    单阳不破2:=LS12 AND LS22;
    STICKLINE(单阳不破2,不破价-不破价*0.002,不破价,4,0),COLORRED;
    DRAWTEXT(单阳不破2,不破价-不破价*0.02,'2'),COLORGREEN;
    LS13:=IF(3,LS0=3,单阳);
    LS23:=IF(3,LLV(L,3)>REF(L,3),1);
    单阳不破3:=LS13 AND LS23;
    STICKLINE(单阳不破3,不破价-不破价*0.002,不破价,4,0),COLORRED;
    DRAWTEXT(单阳不破3,不破价-不破价*0.02,'3'),COLORGREEN;
    LS14:=IF(4,LS0=4,单阳);
    LS24:=IF(4,LLV(L,4)>REF(L,4),1);
    单阳不破4:=LS14 AND LS24;
    STICKLINE(单阳不破4,不破价-不破价*0.002,不破价,4,0),COLORRED;
    DRAWTEXT(单阳不破4,不破价-不破价*0.02,'4'),COLORGREEN;
    LS15:=IF(5,LS0=5,单阳);
    LS25:=IF(5,LLV(L,5)>REF(L,5),1);
    单阳不破5:=LS15 AND LS25;
    STICKLINE(单阳不破5,不破价-不破价*0.002,不破价,4,0),COLORRED;
    DRAWTEXT(单阳不破5,不破价-不破价*0.02,'5'),COLORGREEN;
    LS16:=IF(6,LS0=6,单阳);
    LS26:=IF(6,LLV(L,6)>REF(L,6),1);
    单阳不破6:=LS16 AND LS26;
    STICKLINE(单阳不破6,不破价-不破价*0.002,不破价,4,0),COLORRED;
    DRAWTEXT(单阳不破6,不破价-不破价*0.02,'6'),COLORGREEN;
    LS17:=IF(7,LS0=7,单阳);
    LS27:=IF(7,LLV(L,7)>REF(L,7),1);
    单阳不破7:=LS17 AND LS27;
    STICKLINE(单阳不破7,不破价-不破价*0.002,不破价,4,0),COLORRED;
    DRAWTEXT(单阳不破7,不破价-不破价*0.02,'7'),COLORGREEN;
    LS18:=IF(8,LS0=8,单阳);
    LS28:=IF(8,LLV(L,8)>REF(L,8),1);
    单阳不破8:=LS18 AND LS28;
    STICKLINE(单阳不破8,不破价-不破价*0.002,不破价,4,0),COLORRED;
    DRAWTEXT(单阳不破8,不破价-不破价*0.02,'8'),COLORGREEN;
    LS19:=IF(9,LS0=9,单阳);
    LS29:=IF(9,LLV(L,9)>REF(L,9),1);
    单阳不破9:=LS19 AND LS29;
    STICKLINE(单阳不破9,不破价-不破价*0.002,不破价,4,0),COLORRED;
    DRAWTEXT(单阳不破9,不破价-不破价*0.02,'9'),COLORGREEN;
    LS110:=IF(10,LS0=10,单阳);
    LS210:=IF(10,LLV(L,10)>REF(L,10),1);
    单阳不破10:=LS110 AND LS210;
    STICKLINE(单阳不破10,不破价-不破价*0.002,不破价,4,0),COLORRED;
    DRAWTEXT(单阳不破10,不破价-不破价*0.02,'10'),COLORGREEN;

    input:N(10,1,88);
    V1:= BARSTATUS=2;
    V2:=REF(HIGH,N)=HHV(HIGH,2*N+1);
    V3:=FILTER(V2,N);
    V4:=BACKSET(V3,N+1);
    V5:=FILTER(V4,N);
    V6:=V5 OR V1;
    V7:=REF(LOW,N)=LLV(LOW,2*N+1);
    V8:=FILTER(V7,N);
    V9:=BACKSET(V8,N+1);
    VA:=FILTER(V9,N);
    VB:=VA AND NOT(V5);
    VC:=BACKSET(V6,REF(BARSLAST(VB),1)+1);
    VD:=VC>REF(VC,1);
    VE:=BACKSET(VD,2);
    VF:=VE>REF(VE,1);
    V10:=BACKSET(VF AND COUNT(V6,REF(BARSLAST(VB),1)+2)=0,REF(BARSLAST(VB),1)+2);
    V11:=V10>REF(V10,1);
    V12:=BACKSET(V11 AND COUNT(V6,REF(BARSLAST(VB),1)+2)=0,REF(BARSLAST(VB),1)+2);
    V13:=V12>REF(V12,1);
    V14:=IF(V6,COUNT(VB,REF(BARSLAST(V6),1)+1),0);
    V15:=IF(V14=1 AND V6,BARSLAST(VF),0);
    V16:=IF(V6 AND REF(LOW,BARSLAST(VF))>=REF(LOW,BARSLAST(V11)),BARSLAST(V11),BARSLAST(VF));
    V17:=IF(V14=2 AND V6,V16,0);
    V18:=IF(V14>=3 AND V6,IF(V6 AND REF(LOW,V16)>=REF(LOW,BARSLAST(V13)),BARSLAST(V13),V16),0);
    V19:=V15+V17+V18;
    V1A:=BACKSET(V6,V19);
    V1B:=V1A>REF(V1A,1);
    V1C:=BACKSET(V1B,2);
    V1D:=V1C>REF(V1C,1);
    V1E:=V1D OR V1;
    V1F:=BACKSET(V1E,REF(BARSLAST(V6),1)+1);
    V20:=V1F>REF(V1F,1);
    V21:=BACKSET(V20,2);
    V22:=V21>REF(V21,1);
    V23:=BACKSET(V22 AND COUNT(V1E,REF(BARSLAST(V6),1)+2)=0,REF(BARSLAST(V6),1)+2);
    V24:=V23>REF(V23,1);
    V25:=BACKSET(V24 AND COUNT(V1E,REF(BARSLAST(V6),1)+2)=0,REF(BARSLAST(V6),1)+2);
    V26:=V25>REF(V25,1);
    V27:=IF(V1E,COUNT(V5,REF(BARSLAST(V1E),1)+1),0);
    V28:=IF(V27=1 AND V1E,BARSLAST(V22),0);
    V29:=IF(V1E AND REF(HIGH,BARSLAST(V22))<=REF(HIGH,BARSLAST(V24)),BARSLAST(V24),BARSLAST(V22));
    V2A:=IF(V27=2 AND V1E,V29,0);
    V2B:=IF(V27>=3 AND V1E,IF(V1E AND REF(HIGH,V29)<=REF(HIGH,BARSLAST(V26)),BARSLAST(V26),V29),0);
    V2C:=V28+V2A+V2B;
    V2D:=BACKSET(V1E,V2C);
    V2E:=V2D>REF(V2D,1);
    V2F:=BACKSET(V2E,2);
    V30:=V2F>REF(V2F,1);
    DRAWLINE(V1D,LOW,V30,HIGH,0);
    DRAWLINE(V30,HIGH,V1D,LOW,0);
    V31:=BACKSET(V1,BARSLAST(V1D)+1);
    V32:=V31>REF(V31,1);
    V33:=BACKSET(V1,BARSLAST(V30)+1);
    V34:=V33>REF(V33,1);
    V35:=IF(BARSLAST(V32)<BARSLAST(V34),V32,V34);
    V36:=IF(BARSLAST(V32)<BARSLAST(V34),LOW,HIGH);
    DRAWLINE(V35,V36,V1,CLOSE,0);
    V37:=BACKSET(V1,BARSLAST(V1D)+1);
    V38:=V37>REF(V37,1);
    V39:=BACKSET(V38,REF(BARSLAST(V1D),1)+2);
    V3A:=V39>REF(V39,1);
    DRAWLINE(V3A,LOW,V38,LOW,1);
    V3B:=BACKSET(V1,BARSLAST(V30)+1);
    V3C:=V3B>REF(V3B,1);
    V3D:=BACKSET(V3C,REF(BARSLAST(V30),1)+2);
    V3E:=V3D>REF(V3D,1);
    DRAWLINE(V3E,HIGH,V3C,HIGH,1);
    前一低: REF(LOW,BARSLAST(V38)),colorccff99,POINTDOT;
    前二低: REF(LOW,BARSLAST(V3A)),colormagenta,POINTDOT;
    前一高: REF(HIGH,BARSLAST(V3C)),colorccff99;
    前二高: REF(HIGH,BARSLAST(V3E)),colormagenta;
    {以下语句是大盘指数显示}
    A1:=REF(HIGH,3)=HHV(HIGH,2*3+1); B1:=FILTER(A1,3); C1:=BACKSET(B1,3+1); D1:=FILTER(C1,3);{高点}
    A2:=REF(LOW,3)=LLV(LOW,2*3+1); B2:=FILTER(A2,3); C2:=BACKSET(B2,3+1); D2:=FILTER(C2,3);{低点}
    E1:=(REF(LLV(LOW,2*3),1)+REF(HHV(HIGH,2*3),1))/2; E2:=(HIGH+LOW)/2;{高低点出现在同一K线上时可作取舍}
    H1:=(D1 AND NOT(D2 AND E1>=E2)) OR BARSTATUS=2 OR BARSCOUNT(CLOSE)=1;
    L1:=(D2 AND NOT(D1 AND E1<E2)); H2:=D1 AND NOT(D2 AND E1>=E2);
    X1:=REF(BARSLAST(H1),1)+1; F1:=BACKSET(H1 AND COUNT(L1,X1)>0,LLVBARS(IF(L1,LOW,10000),X1));
    G1:=F1>REF(F1,1); I1:=BACKSET(G1,2); LD:=I1>REF(I1,1);{过滤后低点}
    L2:=LD OR BARSTATUS=2 OR BARSCOUNT(CLOSE)=1;
    X2:=REF(BARSLAST(L2),1)+1; F2:=BACKSET(L2 AND COUNT(H2,X2)>0,HHVBARS(IF(H2,HIGH,0),X2));
    G2:=F2>REF(F2,1); I2:=BACKSET(G2,2); HD:=I2>REF(I2,1);{过滤后高点}
    UU:=BACKSET(BARSTATUS=2,BARSLAST(LD)+1);
    VV:=UU>REF(UU,1);
    WW:=BACKSET(VV,REF(BARSLAST(LD),1)+2);
    XX:=WW>REF(WW,1);
    常数1:=REF(INDEXC,BARSLAST(VV))/REF(CLOSE,BARSLAST(VV));
    常数2:=REF(INDEXC,BARSLAST(XX))/REF(CLOSE,BARSLAST(XX));
    DRAWTEXT(HD,H*1.01,NUMTOSTRN(H,2)),COLOR00FF00,LINETHICK3;
    DRAWTEXT(LD,L,NUMTOSTRN(L,2)),COLORFFAAFF,LINETHICK3;

    单阳:=C>O*1.03 AND VOL>REF(VOL,1)*1.5;
    不破价:=REF(L,BARSLAST(单阳));
    DRAWTEXT(单阳,L-L*0.02,'阳'),COLOR00FFFF;
    LS0:=BARSLAST(单阳);
    LS11:=IF(1,LS0=1,单阳);
    LS21:=IF(1,LLV(L,1)>REF(L,1),1);
    单阳不破:=LS11 AND LS21;
    STICKLINE(单阳不破,不破价-不破价*0.002,不破价,4,0),COLORRED;
    DRAWTEXT(单阳不破,不破价-不破价*0.02,'1'),COLORGREEN;
    LS12:=IF(2,LS0=2,单阳);
    LS22:=IF(2,LLV(L,2)>REF(L,2),1);
    单阳不破2:=LS12 AND LS22;
    STICKLINE(单阳不破2,不破价-不破价*0.002,不破价,4,0),COLORRED;
    DRAWTEXT(单阳不破2,不破价-不破价*0.02,'2'),COLORGREEN;
    LS13:=IF(3,LS0=3,单阳);
    LS23:=IF(3,LLV(L,3)>REF(L,3),1);
    单阳不破3:=LS13 AND LS23;
    STICKLINE(单阳不破3,不破价-不破价*0.002,不破价,4,0),COLORRED;
    DRAWTEXT(单阳不破3,不破价-不破价*0.02,'3'),COLORGREEN;
    LS14:=IF(4,LS0=4,单阳);
    LS24:=IF(4,LLV(L,4)>REF(L,4),1);
    单阳不破4:=LS14 AND LS24;
    STICKLINE(单阳不破4,不破价-不破价*0.002,不破价,4,0),COLORRED;
    DRAWTEXT(单阳不破4,不破价-不破价*0.02,'4'),COLORGREEN;
    LS15:=IF(5,LS0=5,单阳);
    LS25:=IF(5,LLV(L,5)>REF(L,5),1);
    单阳不破5:=LS15 AND LS25;
    STICKLINE(单阳不破5,不破价-不破价*0.002,不破价,4,0),COLORRED;
    DRAWTEXT(单阳不破5,不破价-不破价*0.02,'5'),COLORGREEN;
    LS16:=IF(6,LS0=6,单阳);
    LS26:=IF(6,LLV(L,6)>REF(L,6),1);
    单阳不破6:=LS16 AND LS26;
    STICKLINE(单阳不破6,不破价-不破价*0.002,不破价,4,0),COLORRED;
    DRAWTEXT(单阳不破6,不破价-不破价*0.02,'6'),COLORGREEN;
    LS17:=IF(7,LS0=7,单阳);
    LS27:=IF(7,LLV(L,7)>REF(L,7),1);
    单阳不破7:=LS17 AND LS27;
    STICKLINE(单阳不破7,不破价-不破价*0.002,不破价,4,0),COLORRED;
    DRAWTEXT(单阳不破7,不破价-不破价*0.02,'7'),COLORGREEN;
    LS18:=IF(8,LS0=8,单阳);
    LS28:=IF(8,LLV(L,8)>REF(L,8),1);
    单阳不破8:=LS18 AND LS28;
    STICKLINE(单阳不破8,不破价-不破价*0.002,不破价,4,0),COLORRED;
    DRAWTEXT(单阳不破8,不破价-不破价*0.02,'8'),COLORGREEN;
    LS19:=IF(9,LS0=9,单阳);
    LS29:=IF(9,LLV(L,9)>REF(L,9),1);
    单阳不破9:=LS19 AND LS29;
    STICKLINE(单阳不破9,不破价-不破价*0.002,不破价,4,0),COLORRED;
    DRAWTEXT(单阳不破9,不破价-不破价*0.02,'9'),COLORGREEN;
    LS110:=IF(10,LS0=10,单阳);
    LS210:=IF(10,LLV(L,10)>REF(L,10),1);
    单阳不破10:=LS110 AND LS210;
    STICKLINE(单阳不破10,不破价-不破价*0.002,不破价,4,0),COLORRED;
    DRAWTEXT(单阳不破10,不破价-不破价*0.02,'10'),COLORGREEN;

    九毛八公式指标,一个优质的公式指标平台!
    九毛八公式指标 » 把划线波浪趋势和单阳不破两个主图合二为一 加入收藏