最新公告
  • 欢迎您光临九毛八公式指标网www.9m8.cn,本站全新改版试运行,期间内容全部免费,欢迎下载!欢迎加入本站VIP
  • 通达信四季变天图源码

    正文概述    2024-04-13 08:01:58  

    四季变天图


    n:=6;

    {四季变天图 TDX N:1,100,9}

    MT1:=IF(ISLASTBAR,REF((C*2-REF(C,3)),1),DRAWNULL);

    MT2:=IF(ISLASTBAR,REF((C*2-REF(C,3)),2),DRAWNULL);

    MT3:=IF(ISLASTBAR,C*2-REF(C,3),DRAWNULL);

    高:=CONST(REF(HHV(H,150),3)),NODRAW;

    低:=CONST(REF(LLV(L,150),3)),NODRAW;

    色彩峰:=高-低;

    NN:=100;

    AA:=REF(H,N)=HHV(H,2*N+1); AA1:=REF(L,N)=LLV(L,2*N+1);

    QY:=BACKSET(AA,N+1); QY1:=BACKSET(AA1,N+1);

    CC:=FILTER(QY,N) AND H=HHV(H,N+1); CC1:=FILTER(QY1,N) AND L=LLV(L,N+1);

    DDD:=BARSLAST(CC); DD1:=BARSLAST(CC1);

    GDTS:=IF(CC,CURRBARSCOUNT,0); DDTS:=IF(CC1,CURRBARSCOUNT,0);

    DINGBUTS:=IF(DDD,REF(GDTS,DDD),GDTS); DDTS1:=IF(DD1,REF(DDTS,DD1),DDTS);

    GDCS1:=CONST(DINGBUTS); DDCS1:=CONST(DDTS1);

    GDCS13:=CONST(REF(HIGH,GDCS1-1)); DDCS13:=CONST(REF(L,DDCS1-1));

    DINGBUTS1:=REF(DINGBUTS,DDD+1); DDTS2:=REF(DDTS1,DD1+1);

    GDCS2:=CONST(DINGBUTS1); DDCS2:=CONST(DDTS2);

    M:=INTPART(3*N/5);

    AAA:=REF(H,M)=HHV(H,2*M+1);

    QYY:=BACKSET(AAA,M+1);

    CCC:=FILTER(QYY,M) AND H=HHV(H,M+1);

    DDDD:=BARSLAST(CCC),NODRAW;

    GDTSS:=IF(CCC,CURRBARSCOUNT,0);

    DINGBUTSS:=IF(DDDD,REF(GDTSS,DDDD),GDTSS);

    GDCS11:=CONST(DINGBUTSS);

    DINGBUTS11:=REF(DINGBUTSS,DDDD+1);

    GDCS22:=CONST(DINGBUTS11);

    AA11:=REF(L,M)=LLV(L,2*M+1);

    QY11:=BACKSET(AA11,M+1);

    CC11:=FILTER(QY11,M) AND L=LLV(L,M+1);

    DD11:=BARSLAST(CC11);

    DDTSS:=IF(CC11,CURRBARSCOUNT,0);

    DDTS11:=IF(DD11,REF(DDTSS,DD11),DDTSS);

    DDCS11:=CONST(DDTS11);

    DDTS22:=REF(DDTS11,DD11+1);

    DDCS22:=CONST(DDTS22);

    ZGD:=HHV(H,60)*1.01.00;

    ZGD2:=CONST(ZGD);

    高点压力M:=DRAWLINE(CURRBARSCOUNT=GDCS22,H,CURRBARSCOUNT=GDCS11,H,1),COLORRED,LINETHICK1;

    低点支撑M:=DRAWLINE(CURRBARSCOUNT=DDCS22,L,CURRBARSCOUNT=DDCS11,L,1) COLORRED,LINETHICK1;

    高点压力1:=DRAWLINE(CURRBARSCOUNT=GDCS2,H,CURRBARSCOUNT=GDCS1,H,1) ,COLORBLUE,LINETHICK1;

    低点支撑1:=DRAWLINE(CURRBARSCOUNT=DDCS2,L,CURRBARSCOUNT=DDCS1,L,1),COLORBLUE,LINETHICK1;

    高点:=CONST(HHV(H,NN)),NODRAW;

    低点:=CONST(LLV(L,NN)),NODRAW;

    GJ:=(C+H+L+O)/4;

    明日阻力:=L+(GJ-L)+(C-L);

    明日支撑:=L+(C-GJ);

    明日阻力2:=L+2*(GJ-L)+(C-L);

    明日支撑2:=L+(C-GJ)-(GJ-L);

    今日阻力:=CONST(REF(明日阻力 , 1)),NODRAW;

    今日支撑:=CONST(REF(明日支撑 , 1)),NODRAW;

    今日阻力2:=CONST(REF(明日阻力2 , 1)),NODRAW;

    今日支撑2:=CONST(REF(明日支撑2 , 1)),NODRAW;

    STICKLINE(ISLASTBAR,今日阻力,今日阻力2,10,0),COLOR555555;

    DRAWTEXT(ISLASTBAR,今日阻力,' 阻'),COLOR0000FF;

    STICKLINE(ISLASTBAR,今日支撑,今日支撑2,10,0),COLOR555555;

    DRAWTEXT(ISLASTBAR,今日支撑,' 支'),COLOR00FF00;

    JRH:=HHV(C,2);

    JRL:=LLV(C,2);

    MA3:=MA(CLOSE,3);

    YTSL:=(3*CLOSE+LOW+OPEN+HIGH)/6;

    R1:=(CLOSE REF(CLOSE,1) AND CLOSE REF(CLOSE,2));

    R2:=(REF(R1,1) AND CLOSE =REF(CLOSE,1) AND CLOSE =REF(CLOSE,2));

    R3:=(REF(R2,1) AND CLOSE =REF(CLOSE,1) AND CLOSE =REF(CLOSE,2));

    R4:=(REF(R3,1) AND CLOSE =REF(CLOSE,1) AND CLOSE =REF(CLOSE,2));

    R5:=(REF(R4,1) AND CLOSE =REF(CLOSE,1) AND CLOSE =REF(CLOSE,2));

    R6:=(REF(R5,1) AND CLOSE =REF(CLOSE,1) AND CLOSE =REF(CLOSE,2));

    R7:=(REF(R6,1) AND CLOSE =REF(CLOSE,1) AND CLOSE =REF(CLOSE,2));

    R8:=(REF(R7,1) AND CLOSE =REF(CLOSE,1) AND CLOSE =REF(CLOSE,2));

    R9:=(REF(R8,1) AND CLOSE =REF(CLOSE,1) AND CLOSE =REF(CLOSE,2));

    RA:=(REF(R9,1) AND CLOSE =REF(CLOSE,1) AND CLOSE =REF(CLOSE,2));

    RB:=(REF(RA,1) AND CLOSE =REF(CLOSE,1) AND CLOSE =REF(CLOSE,2));

    RC:=(REF(RB,1) AND CLOSE =REF(CLOSE,1) AND CLOSE =REF(CLOSE,2));

    RD:=(CLOSE REF(CLOSE,1) AND CLOSE REF(CLOSE,2));

    RE:=(REF(RD,1) AND CLOSE =REF(CLOSE,1) AND CLOSE =REF(CLOSE,2));

    RF:=(REF(RE,1) AND CLOSE =REF(CLOSE,1) AND CLOSE =REF(CLOSE,2));

    R10:=(REF(RF,1) AND CLOSE =REF(CLOSE,1) AND CLOSE =REF(CLOSE,2));

    R11:=(REF(R10,1) AND CLOSE =REF(CLOSE,1) AND CLOSE =REF(CLOSE,2));

    R12:=(REF(R11,1) AND CLOSE =REF(CLOSE,1) AND CLOSE =REF(CLOSE,2));

    R13:=(REF(R12,1) AND CLOSE =REF(CLOSE,1) AND CLOSE =REF(CLOSE,2));

    R14:=(REF(R13,1) AND CLOSE =REF(CLOSE,1) AND CLOSE =REF(CLOSE,2));

    R15:=(REF(R14,1) AND CLOSE =REF(CLOSE,1) AND CLOSE =REF(CLOSE,2));

    R16:=(REF(R15,1) AND CLOSE =REF(CLOSE,1) AND CLOSE =REF(CLOSE,2));

    R17:=(REF(R16,1) AND CLOSE =REF(CLOSE,1) AND CLOSE =REF(CLOSE,2));

    R18:=(REF(R17,1) AND CLOSE =REF(CLOSE,1) AND CLOSE =REF(CLOSE,2));

    R19:=REF(RD OR RE OR RF OR R10 OR R11 OR R12 OR R13 OR R14 OR R15 OR R16 OR R17 OR R18,1) AND R1;

    R1A:=((REF(R1 OR R2 OR R3 OR R4 OR R5 OR R6 OR R7 OR R8 OR R9 OR RA OR RB OR RC,1)) AND RD);

    VAR3:=IF(C 200 ,MA(COST(80),3),2500),NODRAW;

    VAR4:=(((HIGH + LOW) + CLOSE) / 3);

    VAR5:=EMA(((((OPEN + HIGH) + LOW) + CLOSE) / 4),2330);

    VAR6:=(VAR5 + ((VAR5 * 6) / 100));

    短买春:=R19,NODRAW,COLOR00DD00;

    秋离场:=R1A,NODRAW,COLOR2288EE;

    红持股:=R1 OR R2 OR R3 OR R4 OR R5 OR R6 OR R7 OR R8 OR R9 OR RA OR RB OR RC,NODRAW,COLOR0000FF;

    阴观望:=RD OR RE OR RF OR R10 OR R11 OR R12 OR R13 OR R14 OR R15 OR R16 OR R17 OR R18,NODRAW,COLOR999999;

    急速超跌关注:=(CLOSE-MA(CLOSE,34))/MA(CLOSE,34)*100 -14,COLORBBBBBB,NODRAW;

    离场:=IF(红持股,JRL,DRAWNULL);

    明离场价:=离场,COLORFF99FF,NODRAW;

    今离场价:=REF(离场,1)COLOR0000FF,NODRAW;

    进:=IF(阴观望,JRH,DRAWNULL);

    明进场价:=进,COLOR33AACC,NODRAW;

    今进场价:=REF(明进场价,1),COLOR00FF00,NODRAW;

    大雪:=MA((((HIGH + LOW) + CLOSE) / 3),8);

    无痕:=MA((((HIGH + LOW) + CLOSE) / 3),21);

    VAR111:=EMA(((OPEN + CLOSE) / 2),26);

    VAR222:=IF(C 200 , MA(COST(30),3),2300),NODRAW;

    天下有雪:=IF(C 200 ,MA(COST(50),3),2300);

    严冬:=ISLASTBAR AND (VAR4 0.1),COLORFFFFFF,NODRAW;

    早春:=ISLASTBAR AND (((((VAR4 天下有雪) AND (VAR4 无痕))

    OR ((VAR4 VAR5) AND (VAR4 无痕))) OR ((VAR4 无痕)

    AND (VAR111 无痕)))),COLOR00FF00,NODRAW;

    初夏:=ISLASTBAR AND ((((((VAR4 天下有雪) AND (VAR4 VAR111))

    AND (VAR4 VAR5)) AND (VAR222 REF(VAR222,1))) OR ((((VAR4 VAR222)

    AND (VAR4 VAR111)) AND (VAR4 VAR5)) AND (VAR222 REF(VAR222,1))))),

    COLOR0000FF,NODRAW;

    深秋:=ISLASTBAR AND (((((VAR4 VAR6) AND (VAR4 VAR3)) AND (大雪 无痕))

    AND (VAR111 REF(VAR111,1)))),COLOR00FFFF,NODRAW;

    SAAA:=(3*C+H+L+O)/6;

    SVAR1:=(8*SAAA+7*REF(SAAA,1)+6*REF(SAAA,2)

    +5*REF(SAAA,3)+4*REF(SAAA,4)+3*REF(SAAA,5)+2*REF(SAAA,6)+REF(SAAA,8))/36;

    SVAR2:=(HHV(SVAR1,5)+HHV(SVAR1,10)+HHV(SVAR1,20))/3;

    SVAR3:=(LLV(SVAR1,5)+LLV(SVAR1,10)+LLV(SVAR1,20))/3;

    SVAR4:=(HHV(SVAR2,5)+HHV(SVAR2,10)+HHV(SVAR2,20))/3;

    SVAR5:=(LLV(SVAR3,5)+LLV(SVAR3,10)+LLV(SVAR3,20))/3;

    SVAR6:=(LLV(SVAR1,2)+LLV(SVAR1,4)+LLV(SVAR1,6))/3;

    Q1:=CONST(IF(短买春,0,IF(秋离场,180,IF(红持股,220,IF(急速超跌关注,150,100))))),NODRAW;

    Q2:=CONST(IF(短买春,150,IF(秋离场,100,IF(红持股,0,IF(急速超跌关注,150,100))))),NODRAW;

    Q3:=CONST(IF(短买春,0,IF(秋离场,50,IF(红持股,50,IF(急速超跌关注,150,100))))),NODRAW;

    DRAWGBK(C 0,RGB(Q1,Q2,Q3),RGB(0,50,50),0,' ',0);

    VVAR1:=EMA(CLOSE,3)-EMA(CLOSE,6)-(EMA(CLOSE,6)-EMA(CLOSE,12))*(-100);

    VVAR2:=EMA(VVAR1,3);

    VVAR5:=CROSS(VVAR1,VVAR2);

    VVAR6:=CROSS(VVAR2,VVAR1);

    HB:=COST(99.9);

    LB:=COST(0.1);

    B3:=(HB-LB)/50;

    B31:=HB-B3;

    B32:=HB-2*B3;

    B33:=HB-3*B3;

    B34:=HB-4*B3;

    B35:=HB-5*B3;

    B36:=HB-6*B3;

    B37:=HB-7*B3;

    B38:=HB-8*B3;

    B39:=HB-9*B3;

    B310:=HB-10*B3;

    B311:=HB-11*B3;

    B312:=HB-12*B3;

    B313:=HB-13*B3;

    B314:=HB-14*B3;

    B315:=HB-15*B3;

    B316:=HB-16*B3;

    B317:=HB-17*B3;

    B318:=HB-18*B3;

    B319:=HB-19*B3;

    B320:=HB-20*B3;

    B321:=HB-21*B3;

    B322:=HB-22*B3;

    B323:=HB-23*B3;

    B324:=HB-24*B3;

    B325:=HB-25*B3;

    B326:=HB-26*B3;

    B327:=HB-27*B3;

    B328:=HB-28*B3;

    B329:=HB-29*B3;

    B330:=HB-30*B3;

    B331:=HB-31*B3;

    B332:=HB-32*B3;

    B333:=HB-33*B3;

    B334:=HB-34*B3;

    B335:=HB-35*B3;

    B336:=HB-36*B3;

    B337:=HB-37*B3;

    B338:=HB-38*B3;

    B339:=HB-39*B3;

    B340:=HB-40*B3;

    B341:=HB-41*B3;

    B342:=HB-42*B3;

    B343:=HB-43*B3;

    B344:=HB-44*B3;

    B345:=HB-45*B3;

    B346:=HB-46*B3;

    B347:=HB-47*B3;

    B348:=HB-48*B3;

    B349:=HB-49*B3;

    A1:=WINNER(HB)*100-WINNER(B31)*100;

    A2:=WINNER(B31)*100-WINNER(B32)*100;

    A3:=WINNER(B32)*100-WINNER(B33)*100;

    A4:=WINNER(B33)*100-WINNER(B34)*100;

    A5:=WINNER(B34)*100-WINNER(B35)*100;

    A6:=WINNER(B35)*100-WINNER(B36)*100;

    A7:=WINNER(B36)*100-WINNER(B37)*100;

    A8:=WINNER(B37)*100-WINNER(B38)*100;

    A9:=WINNER(B38)*100-WINNER(B39)*100;

    A10:=WINNER(B39)*100-WINNER(B310)*100;

    A11:=WINNER(B310)*100-WINNER(B311)*100;

    A12:=WINNER(B311)*100-WINNER(B312)*100;

    A13:=WINNER(B312)*100-WINNER(B313)*100;

    A14:=WINNER(B313)*100-WINNER(B314)*100;

    A15:=WINNER(B314)*100-WINNER(B315)*100;

    A16:=WINNER(B315)*100-WINNER(B316)*100;

    A17:=WINNER(B316)*100-WINNER(B317)*100;

    A18:=WINNER(B317)*100-WINNER(B318)*100;

    A19:=WINNER(B318)*100-WINNER(B319)*100;

    A20:=WINNER(B319)*100-WINNER(B320)*100;

    A21:=WINNER(B320)*100-WINNER(B321)*100;

    A22:=WINNER(B321)*100-WINNER(B322)*100;

    A23:=WINNER(B322)*100-WINNER(B323)*100;

    A24:=WINNER(B323)*100-WINNER(B324)*100;

    A25:=WINNER(B324)*100-WINNER(B325)*100;

    A26:=WINNER(B325)*100-WINNER(B326)*100;

    A27:=WINNER(B326)*100-WINNER(B327)*100;

    A28:=WINNER(B327)*100-WINNER(B328)*100;

    A29:=WINNER(B328)*100-WINNER(B329)*100;

    A30:=WINNER(B329)*100-WINNER(B330)*100;

    A31:=WINNER(B330)*100-WINNER(B331)*100;

    A32:=WINNER(B331)*100-WINNER(B332)*100;

    A33:=WINNER(B332)*100-WINNER(B333)*100;

    A34:=WINNER(B333)*100-WINNER(B334)*100;

    A35:=WINNER(B334)*100-WINNER(B335)*100;

    A36:=WINNER(B335)*100-WINNER(B336)*100;

    A37:=WINNER(B336)*100-WINNER(B337)*100;

    A38:=WINNER(B337)*100-WINNER(B338)*100;

    A39:=WINNER(B338)*100-WINNER(B339)*100;

    A40:=WINNER(B339)*100-WINNER(B340)*100;

    A41:=WINNER(B340)*100-WINNER(B341)*100;

    A42:=WINNER(B341)*100-WINNER(B342)*100;

    A43:=WINNER(B342)*100-WINNER(B343)*100;

    A44:=WINNER(B343)*100-WINNER(B344)*100;

    A45:=WINNER(B344)*100-WINNER(B345)*100;

    A46:=WINNER(B345)*100-WINNER(B346)*100;

    A47:=WINNER(B346)*100-WINNER(B347)*100;

    A48:=WINNER(B347)*100-WINNER(B348)*100;

    A49:=WINNER(B348)*100-WINNER(B349)*100;

    A50:=WINNER(B349)*100-WINNER(LB)*100;

    STICKLINE(ISLASTBAR,HB ,HB ,A1*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B31 ,B31 ,A1*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B32 ,B32 ,A2*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B33 ,B33 ,A3*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B34 ,B34 ,A4*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B35 ,B35 ,A5*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B36 ,B36 ,A6*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B37 ,B37 ,A7*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B38 ,B38 ,A8*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B39 ,B39 ,A9*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B310 ,B310 ,A10*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B311 ,B311 ,A11*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B312 ,B312 ,A12*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B313 ,B313 ,A13*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B314 ,B314 ,A14*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B315 ,B315 ,A15*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B316 ,B316 ,A16*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B317 ,B317 ,A17*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B318 ,B318 ,A18*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B319 ,B319 ,A19*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B320 ,B320 ,A20*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B321 ,B321 ,A21*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B322 ,B322 ,A22*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B323 ,B323 ,A23*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B324 ,B324 ,A24*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B325 ,B325 ,A25*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B326 ,B326 ,A26*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B327 ,B327 ,A27*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B328 ,B328 ,A28*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B329 ,B329 ,A29*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B330 ,B330 ,A30*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B331 ,B331 ,A31*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B332 ,B332 ,A32*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B333 ,B333 ,A33*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B334 ,B334 ,A34*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B335 ,B335 ,A35*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B336 ,B336 ,A36*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B337 ,B337 ,A37*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B338 ,B338 ,A38*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B339 ,B339 ,A39*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B340 ,B340 ,A40*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B341 ,B341 ,A41*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B342 ,B342 ,A42*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B343 ,B343 ,A43*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B344 ,B344 ,A44*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B345 ,B345 ,A45*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B346 ,B346 ,A46*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B347 ,B347 ,A47*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,B348 ,B348 ,A48*100 ,0 ),COLORGRAY;

    STICKLINE(ISLASTBAR,LB ,LB ,A50*100 ,0 ),COLORGRAY;

    N1:=13;

    WO1:= Y01.O1#WEEK

    WC:= Y01.C1#WEEK

    WH:= Y01.H1#WEEK

    WL:= Y01.L1#WEEK

    WQ:= Y01.RQ#WEEK

    K1:=WO1=REF(WO1,1) AND WC=REF(WC,1) AND WH=REF(WH,1) AND WL=REF(WL,1);

    K3:=REF(C,1)=DYNAINFO(3) AND O=DYNAINFO(4) AND C=DYNAINFO(7) AND H=DYNAINFO(5) AND L=DYNAINFO(6);

    DD:=REF(BARSLAST(K1=0)+1,1),LINETHICK0;

    ADD1:=CROSS(BACKSET((K1=0 OR K3) AND DD=5,4),0.5),NODRAW;

    ADD2:=CROSS(BACKSET((K1=0 OR K3) AND (DD=4 OR DD=3),3),0.5),NODRAW;

    ADD3:=CROSS(BACKSET((K1=0 OR K3) AND DD =2,2),0.5),LINETHICK0;

    BK1:=ADD1 OR ADD2 OR ADD3;

    BK2:=CROSS(BACKSET(K1=0,2),0.5);

    BK3:=CROSS(BACKSET(K1=0 AND REF(K1=0,1),2),0.5);

    WO:=IF(BARSLAST(K1=0)=0,O,REF(O,BARSLAST(K1=0))),NODRAW;

    K0:=WC WO OR (WC=WO AND WC REF(WC,BARSLAST(K1=0)+1));

    STICKLINE(PERIOD=5 AND WQ N1 AND K0 AND BK1,WH,WC,1,0),COLOR000077;

    STICKLINE(PERIOD=5 AND WQ N1 AND K0 AND BK1,WO,WL,1,0),COLOR000077;

    STICKLINE(PERIOD=5 AND WQ N1 AND K0 AND K1=0,WC,WO,1,0),COLOR000077;

    STICKLINE(PERIOD=5 AND WQ N1 AND K0 AND (BK2 OR K3),WC,WO,1,0),COLOR000077;

    STICKLINE(PERIOD=5 AND WQ N1 AND K0 AND ((K1 AND BK2=0 AND K3=0) OR BK3),WC,WC,8,1),COLOR000099;

    STICKLINE(PERIOD=5 AND WQ N1 AND K0 AND ((K1 AND BK2=0 AND K3=0) OR BK3),WC,WO,8,0),COLOR000077;

    STICKLINE(PERIOD=5 AND WQ N1 AND NOT(K0) AND BK1,WH,WO,1,0),COLOR770000;

    STICKLINE(PERIOD=5 AND WQ N1 AND NOT(K0) AND BK1,WC,WL,1,0),COLOR770000;

    STICKLINE(PERIOD=5 AND WQ N1 AND NOT(K0) AND K1=0,WC,WO,1,0),COLOR770000;

    STICKLINE(PERIOD=5 AND WQ N1 AND NOT(K0) AND (BK2 OR K3),WC,WO,1,0),COLOR770000;

    STICKLINE(PERIOD=5 AND WQ N1 AND NOT(K0) AND ((K1 AND BK2=0 AND K3=0) OR BK3),WC,WC,8,1),COLORFF0000;

    STICKLINE(PERIOD=5 AND WQ N1 AND NOT(K0) AND ((K1 AND BK2=0 AND K3=0) OR BK3),WC,WO,8,0),COLOR770000;

    IF(BETWEEN(高点压力M,高点,低点),高点压力M,DRAWNULL),COLORYELLOW,LINETHICK1;

    IF(BETWEEN(低点支撑M,高点,低点),低点支撑M,DRAWNULL),COLORYELLOW,LINETHICK1;

    IF(BETWEEN(高点压力1,高点,低点),高点压力1,DRAWNULL),COLORGREEN,LINETHICK1;

    IF(BETWEEN(低点支撑1,高点,低点),低点支撑1,DRAWNULL),COLORGREEN,LINETHICK1;

    中:=(MA(CLOSE,3)+MA(CLOSE,6)+MA(CLOSE,12)+MA(CLOSE,24))/4;

    DRAWTEXT(ISLASTBAR,MT2,' ●'),COLORYELLOW;

    DRAWTEXT(ISLASTBAR,MT1,' ●'),COLORYELLOW;

    DRAWTEXT(ISLASTBAR,MT3,' ●'),COLORYELLOW;

    AAAX:=(3*C+H+L+O)/6;

    中长:IF(C,(8*AAAX+7*REF(AAAX,1)+6*REF(AAAX,2)+5*REF(AAAX,3)

    +4*REF(AAAX,4)+3*REF(AAAX,5)+2*REF(AAAX,6)+REF(AAAX,8))/36,DRAWNULL),COLOR00FF00;

    IF(中长 REF(中长,1),中长,DRAWNULL),COLORMAGENTA,LINETHICK2;

    下档线:=(((CLOSE - LLV(LOW,13)) / (HHV(HIGH,13) - LLV(LOW,13))) * 100);

    RRRSV:=SMA(下档线,3,1);

    KKK:=SMA(RRRSV,3,1);

    DDDDD:=((3 * RRRSV) - (2 * KKK));

    JJ12:=(((CLOSE - LLV(LOW,55)) / (HHV(HIGH,55) - LLV(LOW,55))) * 100);

    RSV24:=SMA(JJ12,3,1);

    K24:=SMA(RSV24,3,1);

    D24:=((3 * RSV24) - (2 * K24));

    压力2:=IF(CROSS(D24,DDDDD),HIGH,REF(HIGH,BARSLAST(CROSS(D24,DDDDD)))),COLORFFFFFF;

    底部:=LLV(HIGH,30),COLOR00FF00;

    压力位:=IF(ISLASTBAR,压力2,DRAWNULL),NODRAW;

    底部位:=IF(ISLASTBAR,底部,DRAWNULL),NODRAW;

    底:=CONST(底部);

    STICKLINE(ISLASTBAR ,压力位,压力位,30,0),COLORFFFFFF;

    STICKLINE(ISLASTBAR ,底部位,底部位,25,0),COLOR00FFFF;

    辰星线:=(20*YTSL+19*REF(YTSL,1)+18*REF(YTSL,2)+17*REF(YTSL,3)

    +16*REF(YTSL,4)+15*REF(YTSL,5)+14*REF(YTSL,6)+13*REF(YTSL,7)

    +12*REF(YTSL,8)+11*REF(YTSL,9)+10*REF(YTSL,10)+9*REF(YTSL,11)

    +8*REF(YTSL,12)+7*REF(YTSL,13)+6*REF(YTSL,14)+5*REF(YTSL,15)

    +4*REF(YTSL,16)+3*REF(YTSL,17)+2*REF(YTSL,18)+REF(YTSL,20))/211;

    等待:=IF(MA3 辰星线,辰星线,MA3);

    {卖出------------------------}

    VAR55:=EMA(EMA(EMA(CLOSE,8),13),62);

    VAR56:=((REF(HIGH,1) + REF(LOW,1)) / 2);

    VAR57:=(MA(CLOSE,20) + (2 * STD(CLOSE,20)));

    VAR58:=((SMA(MAX((CLOSE - REF(CLOSE,1)),0),7,1) / SMA(ABS((CLOSE - REF(CLOSE,1))),7,1)) * 100);

    卖出1:=FILTER(CROSS(79,VAR58),4);

    MA21:=REF(CLOSE,1);

    ZX:=((SMA(MAX((CLOSE - MA21),0),6,1) / SMA(ABS((CLOSE - MA21)),6,1)) * 100);

    卖出2:=CROSS(84,ZX),COLORFF00FF;

    卖出3:=CROSS(90,RSI);

    卖出:=卖出1 OR 卖出2 OR 卖出3;

    {买入------------------------}

    QQ2:=(CLOSE-LLV(LOW, 18))/(HHV(HIGH, 18)-LLV(LOW, 18))*100;

    QQ3:=SMA(QQ2, 9, 1);

    QQ4:=SMA(QQ3, 3, 1);

    长趋势:=3*QQ3-2*QQ4,COLORWHITE,LINETHICK3;

    趋势线:=EMA(QQ3, 3),COLORRED,LINETHICK3;

    金叉:= CROSS(长趋势,趋势线);

    AAAA1:=AMOUNT/V;

    BBB1:=L AAAA1*0.9;

    CCC1:=(C-REF(C,1))/REF(C,1)*100

    DDD1:=L MA(C,5)*0.921;

    EEE1:=V MA(V,5)*1.5;

    老鼠仓:=BBB1 AND CCC1 AND DDD1 AND EEE1,,NODRAW;

    X1:=(C+L+H)/3;

    BB5:=ATAN(EMA(X1,7)-REF(EMA(X1,7),1))*3.1416*10;

    VAR1:=(MA(CLOSE,80)-MA(CLOSE,13)/3);

    VAR2:=( MA((CLOSE-VAR1)/VAR1,1));

    VVAR3:=(CLOSE-LLV(LOW,28))/(HHV(HIGH,28)-LLV(LOW,28))*100;

    VVAR4:=SMA(VVAR3,4,1);

    MMA:=EMA(VAR2,12)*0.7;

    MMB:=EMA(VAR2,3);

    快到底:=IF(LLV(MMB-MMA,12) 0,0,-20),LINETHICK2,COLORGREEN;

    DIFF:=( EMA(CLOSE,12) - EMA(CLOSE,26))*100;

    DEA:=EMA(DIFF,9);

    MACD:= 2*(DIFF-DEA);

    抄底:=IF(快到底 0 AND CROSS(MACD,0) AND VAR4 18,1,0);

    AVAR2:=(2*CLOSE+HIGH+LOW)/4;

    AVAR3:=IF(YEAR =2099 AND MONTH 2,0,1);

    AVAR4:=LLV(LOW,5);

    AVAR5:=HHV(HIGH,4);

    散户:= EMA((AVAR2-AVAR4)/(AVAR5-AVAR4)*100,4)*AVAR3;

    庄家:= EMA(0.667*REF(散户,1)+0.333*散户,2)*AVAR3;

    试买:=(((CROSS(散户,庄家) AND 散户 50 AND 29 散户)) NOT 大雪)

    OR (CROSS(散户,庄家) AND 散户 30 ) OR 抄底;

    AA05:=MA(C,5),COLOR0099CC;

    五日乖离率:=(C-AA05)/AA05*100;

    BB05:=ATAN((AA05/REF(AA05,1)-1)*100)*180/3.1416;

    速度5:=SMA(EMA((AA05-REF(AA05,1))/REF(AA05,1),3)*100,3,1);

    加速度5:=EMA((速度5-REF(速度5,1)),3),NODRAW;

    AA10:=MA(C,10);

    AA20:=MA(C,20);BB10:=ATAN((AA10/REF(AA10,1)-1)*100)*180/3.1416;

    AA30:=MA(C,30);

    三拾日乖离率:=(C-AA30)/AA30*100;

    加仓:=FILTER(COUNT(CROSS(BB05,30),5) =1 AND

    AA05 REF(AA05,1) AND 三拾日乖离率 REF(三拾日乖离率,1) AND

    AA10 REF(AA10,1)

    AND 加速度5 REF(加速度5,1) AND 速度5 REF(速度5,1) ,10) ;

    DRAWICON(加仓,L*0.99,23);

    IF(等待 REF(等待,1),等待,DRAWNULL),LINETHICK2,COLOR00FFFF;

    IF(辰星线 REF(辰星线,1),辰星线,DRAWNULL),LINETHICK2,COLOR0000FF;

    IF(辰星线 REF(辰星线,1),辰星线,DRAWNULL),COLOR00FF00,LINETHICK1;

    STICKLINE(ISLASTBAR AND (红持股 OR REF(红持股,1)=1),今离场价,今离场价,15,1),COLOR0000FF;

    STICKLINE(ISLASTBAR AND (阴观望 OR REF(阴观望,1)=1),今进场价,今进场价,15,1),COLOR00FF00;

    DRAWICON(卖出,(HIGH * 1.002),15);

    {DRAWTEXT(秋离场,HHV(H,3),' '),COLORFF99FF;}

    DRAWICON(老鼠仓 OR 金叉,(LOW - (LOW * 0.01)),1);

    {DRAWTEXT(短买春,LLV(L,3),' '),COLOR00FF00;}

    {----------------------------}

    {严冬:}STICKLINE((VAR4 0.1),HIGH,LOW,0,0),COLORFFFFFF;

    {早春:}STICKLINE(((((VAR4 天下有雪) AND (VAR4 无痕))

    OR ((VAR4 VAR5) AND (VAR4 无痕))) OR ((VAR4 无痕)

    AND (VAR111 无痕))),HIGH,LOW,0,0),COLOR00FF00;

    {初夏:}STICKLINE((((((VAR4 天下有雪) AND (VAR4 VAR111))

    AND (VAR4 VAR5)) AND (VAR222 REF(VAR222,1))) OR ((((VAR4 VAR222)

    AND (VAR4 VAR111)) AND (VAR4 VAR5)) AND (VAR222 REF(VAR222,1)))),

    HIGH,LOW,0,0),COLOR0000FF;

    {深秋:}STICKLINE(((((VAR4 VAR6) AND (VAR4 VAR3)) AND (大雪 无痕))

    AND (VAR111 REF(VAR111,1))),HIGH,LOW,0,0),COLOR00FFFF;

    STICKLINE(((VAR4 0.1) AND (CLOSE OPEN)),OPEN,CLOSE,2.8,0),COLORCCCCCC;

    STICKLINE(((VAR4 0.1) AND (CLOSE = OPEN)),OPEN,CLOSE,2.8,1),COLORCCCCCC;

    STICKLINE(((VAR4 0.1) AND (CLOSE = OPEN)),OPEN,OPEN+(CLOSE-OPEN)/3,2.8,0),COLORFFFFFF;

    STICKLINE((((((VAR4 天下有雪) AND (VAR4 无痕)) AND (CLOSE OPEN))

    OR (((VAR4 VAR5) AND (VAR4 无痕)) AND (CLOSE OPEN)))

    OR (((VAR4 无痕) AND (VAR111 无痕)) AND (CLOSE OPEN))),

    OPEN,CLOSE,2.8,0),COLOR00FF00;

    STICKLINE((((((VAR4 天下有雪) AND (VAR4 无痕)) AND (CLOSE OPEN))

    OR (((VAR4 VAR5) AND (VAR4 无痕)) AND (CLOSE OPEN)))

    OR (((VAR4 无痕) AND (VAR111 无痕)) AND (CLOSE = OPEN)))

    ,OPEN,CLOSE,2.8,1),COLOR00FF00;

    STICKLINE(((((((VAR4 天下有雪) AND (VAR4 VAR111)) AND (VAR4 VAR5))

    AND (VAR222 REF(VAR222,1))) AND (CLOSE OPEN)) OR (((((VAR4 VAR222)

    AND (VAR4 VAR111)) AND (VAR4 VAR5)) AND (VAR222 REF(VAR222,2)))

    AND (CLOSE OPEN))),OPEN,CLOSE,2.8,0),COLOR0000FF;

    STICKLINE(((((((VAR4 天下有雪) AND (VAR4 VAR111)) AND (VAR4 VAR5))

    AND (VAR222 REF(VAR222,1))) AND (CLOSE OPEN)) OR (((((VAR4 VAR222)

    AND (VAR4 VAR111)) AND (VAR4 VAR5)) AND (VAR222 REF(VAR222,1)))

    AND (CLOSE = OPEN))),OPEN,CLOSE,2.8,1),COLOR0000FF;

    STICKLINE((((((VAR4 VAR6) AND (VAR4 VAR3)) AND (大雪 无痕))

    AND (VAR111 REF(VAR111,1))) AND (CLOSE OPEN)),OPEN,CLOSE,2.8,0)

    ,COLOR00FFFF;

    STICKLINE((((((VAR4 VAR6) AND (VAR4 VAR3)) AND (大雪 无痕))

    AND (VAR111 REF(VAR111,1))) AND (CLOSE = OPEN)),OPEN,CLOSE,2.8,1)

    ,COLOR00FFFF;

    TAB:=CURRBARSCOUNT=25;

    IF(( BARSLAST(TAB) 10),REF((C*2-REF(C,3)),3),DRAWNULL),LINETHICK1,DOTLINE,COLORYELLOW;

    通达信四季变天图源码

    九毛八公式指标,一个优质的公式指标平台!
    九毛八公式指标 » 通达信四季变天图源码 加入收藏