JJJ:=IF(DYNAINFO(8)>0.01,0.01*DYNAINFO(10)/DYNAINFO(8),DYNAINFO(3));
DDD:=(DYNAINFO(5)<0.01 || DYNAINFO(6)<0.01);
JJJT:=IF(DDD,1,(JJJ<(DYNAINFO(5)+0.01) && JJJ>(DYNAINFO(6)-0.01)));
A1:=C>=REF(C,4);
A2:=C<REF(C,4);
{www.fxjgsw.com}
A3:=C<REF(C,4) AND REF(A1,1);
T:=BARSLAST(A3),NODRAW;
M0:=(T=0 AND REFX(T=1 AND NOT(A2),1)) OR (REFX(T=2 AND NOT(A2),2)) OR (REFX(T=3 AND NOT(A2),3)) OR (REFX(T=4 AND NOT(A2),4)) OR (REFX(T=5 AND NOT(A2),5)) OR (REFX(T=6 AND NOT(A2),6)) OR (REFX(T=7 AND NOT(A2),7)) OR (REFX(T=8 AND NOT(A2),8));
M1:=T=1 AND REFX(T=2 AND NOT(A2),1) OR (REFX(T=3 AND NOT(A2),2)) OR (REFX(T=4 AND NOT(A2),3)) OR (REFX(T=5 AND NOT(A2),4)) OR (REFX(T=6 AND NOT(A2),5)) OR (REFX(T=7 AND NOT(A2),6)) OR (REFX(T=8 AND NOT(A2),7));
M2:=T=2 AND REFX(T=3 AND NOT(A2),1) OR (REFX(T=4 AND NOT(A2),2)) OR (REFX(T=5 AND NOT(A2),3)) OR (REFX(T=6 AND NOT(A2),4)) OR (REFX(T=7 AND NOT(A2),5)) OR (REFX(T=8 AND NOT(A2),6));
M3:=T=3 AND REFX(T=4 AND NOT(A2),1)OR (REFX(T=5 AND NOT(A2),2)) OR (REFX(T=6 AND NOT(A2),3)) OR (REFX(T=7 AND NOT(A2),4)) OR (REFX(T=8 AND NOT(A2),5));
M4:=T=4 AND REFX(T=5 AND NOT(A2),1) OR (REFX(T=6 AND NOT(A2),2)) OR (REFX(T=7 AND NOT(A2),3)) OR (REFX(T=8 AND NOT(A2),4));
M5:=T=5 AND REFX(T=6 AND NOT(A2),1) OR (REFX(T=7 AND NOT(A2),2)) OR (REFX(T=8 AND NOT(A2),3));
M6:=T=6 AND REFX(T=7 AND NOT(A2),1) OR (REFX(T=8 AND NOT(A2),2));
M7:=T=7 AND REFX(T=8 AND NOT(A2),1);
N0:=T=1 AND REF(T=0 AND A3,1) AND A2;
N1:=T=2 AND REF(N0,1) AND A2;
N2:=T=3 AND REF(N1,1) AND A2;
N3:=T=4 AND REF(N2,1) AND A2;
N4:=T=5 AND REF(N3,1) AND A2;
N5:=T=6 AND REF(N4,1) AND A2;
N6:=T=7 AND REF(N5,1) AND A2;
N7:=T=8 AND REF(N6,1) AND A2;
WZD:=L*0.985;
WZG:=H*1.011;
DRAWTEXT(T=0 AND NOT(M0),WZD,'1'),COLORGREEN;
DRAWTEXT(N0 AND NOT(M1),WZD,'2'),COLORGREEN;
DRAWTEXT(N1 AND NOT(M2),WZD,'3'),COLORGREEN;
DRAWTEXT(N2 AND NOT(M3),WZD,'4'),COLORGREEN;
DRAWTEXT(N3 AND NOT(M4),WZD,'5'),COLORGREEN;
DRAWTEXT(N4 AND NOT(M5),WZD,'6'),COLORGREEN;
DRAWTEXT(N5 AND NOT(M6),WZD,'7'),COLORGREEN;
DRAWTEXT(N6 AND NOT(M7),WZD,'8'),COLORGREEN;
DRAWTEXT(N7,WZG,'9'),LINETHICK9,COLORMAGENTA,;
B1:=C<=REF(C,4);
B2:=C>REF(C,4);
B3:=C>REF(C,4) AND REF(B1,1);
T1:=BARSLAST(B3),NODRAW;
M8:=(T1=0 AND REFX(T1=1 AND NOT(B2),1)) OR (REFX(T1=2 AND NOT(B2),2)) OR (REFX(T1=3 AND NOT(B2),3)) OR (REFX(T1=4 AND NOT(B2),4)) OR (REFX(T1=5 AND NOT(B2),5)) OR (REFX(T1=6 AND NOT(B2),6)) OR (REFX(T1=7 AND NOT(B2),7)) OR (REFX(T1=8 AND NOT(B2),8));
M9:=T1=1 AND REFX(T1=2 AND NOT(B2),1) OR (REFX(T1=3 AND NOT(B2),2)) OR (REFX(T1=4 AND NOT(B2),3)) OR (REFX(T1=5 AND NOT(B2),4)) OR (REFX(T1=6 AND NOT(B2),5)) OR (REFX(T1=7 AND NOT(B2),6)) OR (REFX(T1=8 AND NOT(B2),7));
M10:=T1=2 AND REFX(T1=3 AND NOT(B2),1) OR (REFX(T1=4 AND NOT(B2),2)) OR (REFX(T1=5 AND NOT(B2),3)) OR (REFX(T1=6 AND NOT(B2),4)) OR (REFX(T1=7 AND NOT(B2),5)) OR (REFX(T1=8 AND NOT(B2),6));
M11:=T1=3 AND REFX(T1=4 AND NOT(B2),1)OR (REFX(T1=5 AND NOT(B2),2)) OR (REFX(T1=6 AND NOT(B2),3)) OR (REFX(T1=7 AND NOT(B2),4)) OR (REFX(T1=8 AND NOT(B2),5));
M12:=T1=4 AND REFX(T1=5 AND NOT(B2),1) OR (REFX(T1=6 AND NOT(B2),2)) OR (REFX(T1=7 AND NOT(B2),7)) OR (REFX(T1=8 AND NOT(B2),4));
M13:=T1=5 AND REFX(T1=6 AND NOT(B2),1) OR (REFX(T1=7 AND NOT(B2),2)) OR (REFX(T1=8 AND NOT(B2),3));
M14:=T1=6 AND REFX(T1=7 AND NOT(B2),1) OR (REFX(T1=8 AND NOT(B2),2));
M15:=T1=7 AND REFX(T1=8 AND NOT(B2),1);
N8:=T1=1 AND REF(T1=0 AND B3,1) AND B2;
N9:=T1=2 AND REF(N8,1) AND B2;
N10:=T1=3 AND REF(N9,1) AND B2;
N11:=T1=4 AND REF(N10,1) AND B2;
N12:=T1=5 AND REF(N11,1) AND B2;
N13:=T1=6 AND REF(N12,1) AND B2;
N14:=T1=7 AND REF(N13,1) AND B2;
N15:=T1=8 AND REF(N14,1) AND B2;
DRAWTEXT(T1=0 AND NOT(M8),WZG,'1'),COLOR9900CC;
DRAWTEXT(N8 AND NOT(M9),WZG,'2'),COLOR9900CC;
DRAWTEXT(N9 AND NOT(M10),WZG,'3'),COLOR9900CC;
DRAWTEXT(N10 AND NOT(M11),WZG,'4'),COLOR9900CC;
DRAWTEXT(N11 AND NOT(M12),WZG,'5'),COLOR9900CC;
DRAWTEXT(N12 AND NOT(M13),WZG,'6'),COLOR9900CC;
DRAWTEXT(N13 AND NOT(M14),WZG,'7'),COLOR9900CC;
DRAWTEXT(N14 AND NOT(M15),WZG,'8'),COLOR9900CC;
DRAWTEXT(N15 ,WZD,'9'),LINETHICK3,COLORGREEN;
{背离};
AN1:=BARSLAST(REF(CROSS("MACD.DIF","MACD.DEA"),1));
BN1:=REF(C,AN1+1)>C AND REF("MACD.DIF",AN1+1)<"MACD.DIF" AND CROSS("MACD.DIF","MACD.DEA");
DRAWTEXT(BN1>0,WZD,'MACD底背'),COLORYELLOW;
CN1:=BARSLAST(REF(CROSS("MACD.DEA","MACD.DIF"),1));
DN1:=REF(C,CN1+1)<C AND REF("MACD.DIF",CN1+1)>"MACD.DIF" AND CROSS("MACD.DEA","MACD.DIF");
DRAWTEXT(DN1>0,WZG,'MACD顶离'),COLORGREEN;{MACD顶背离};
{N1111:1,100,10;N22:1,100,10;DISP:=1,3,2};
N1111:=10;N22:=10;DISP:=2;
K:=IF(PERIOD=5,1,{日}
IF(PERIOD=6,1,{周}
IF(PERIOD=7,1,{月}
IF(PERIOD=8,1,{多分钟}
IF(PERIOD=9,1,{多日}
IF(PERIOD=10,1,{季}
IF(PERIOD=11,2,{年}
IF(PERIOD=4,1,{60F}
IF(PERIOD=3,1,{30F}
IF(PERIOD=2,1,{15F}
IF(PERIOD=1,1{5F},1{1F})))))))))))/10;
P1:=PEAK(1,K*N1111,1);
P2:=PEAK(1,K*N1111,2);
WP1:=PEAKBARS(1,K*N1111,1);
WP2:=PEAKBARS(1,K*N1111,2);
T111:=TROUGH(2,K*N22,1);
T2:=TROUGH(2,K*N22,2);
WT111:=TROUGHBARS(2,K*N22,1);
WT2:=TROUGHBARS(2,K*N22,2);
TJ1:=P1>T111 AND P2>T2 ;
ZD:=MAX(T111,T2);
ZG:=MIN(P1,P2);
LL:=MIN(T111,T2);
HH:=MAX(P1,P2);
{www.fxjgsw.com}
TJ2:=FILTER(ZG>ZD,2);
TJ3:=ZG=REF(ZG,BARSLAST(TJ2)) OR ZD=REF(ZD,BARSLAST(TJ2));
TJ4:=TJ1&&TJ2&&NOT(TJ3);
TJ5:=BETWEEN(ZD,REF(ZD,REF(BARSLAST(TJ4),1)),REF(ZG,REF(BARSLAST(TJ4),1)));
TJ6:=BETWEEN(ZG,REF(ZD,REF(BARSLAST(TJ4),1)),REF(ZG,REF(BARSLAST(TJ4),1)));
TJ7:=ZG>REF(ZG,REF(BARSLAST(TJ4),1))&&ZD<REF(ZD,REF(BARSLAST(TJ4),1));
TJ8:=TJ4&&NOT(TJ5 OR TJ6 OR TJ7);
ZSD:=IF(TJ8,ZD,DRAWNULL);
ZSG:=IF(TJ8,ZG,DRAWNULL);
ZSH:=IF(TJ8,HH,DRAWNULL);
ZSL:=IF(TJ8,LL,DRAWNULL);
STICKLINE(TJ8,ZSH,ZSL,0,-1),COLORMAGENTA;
STICKLINE(TJ8,ZSD,ZSG,IF(DISP=1,3,0),1),COLORMAGENTA;
DRAWTEXT(DISP=2,ZSH,'中枢'),COLORRED;
中枢高:PLOYLINE(DISP=2,REF(ZSD,BARSLAST(TJ8))),CROSSDOT,COLORLIRED;
中枢低:PLOYLINE(DISP=2,REF(ZSG,BARSLAST(TJ8))),CROSSDOT,COLORLIGREEN;
中枢最高:PLOYLINE(DISP=2,REF(ZSH,BARSLAST(TJ8))),POINTDOT,COLORRED;
中枢最低:PLOYLINE(DISP=2,REF(ZSL,BARSLAST(TJ8))),POINTDOT,COLORGREEN;
趋势高:PLOYLINE(DISP=3,ZIG(1,K*N1111)),COLORLIBLUE;
趋势低:PLOYLINE(DISP=3,ZIG(2,K*N22)),COLORLIBLUE;
局部低点预选A:=BACKSET(LLV(L,5)<REF(LLV(L,4),1),4);
局部低点预选B:=BACKSET(局部低点预选A=0 AND REF(局部低点预选A,1)=1,2);
局部低点预选C:=IF(局部低点预选B=1 AND REF(局部低点预选B,1)=0,-1,0);
局部高点预选A:=BACKSET(HHV(H,5)>REF(HHV(H,4),1),4);
局部高点预选B:=BACKSET(局部高点预选A=0 AND REF(局部高点预选A,1)=1,2);
局部高点预选C:=IF(局部高点预选B=1 AND REF(局部高点预选B,1)=0,1,0);
缺口判断:=IF(L>REF(H,1),1,IF(H<REF(L,1),-1,0));
距前高天:=BARSLAST(局部高点预选C=1);
距前低天:=BARSLAST(局部低点预选C=-1);
小值周期:=LOWRANGE(L);
大值周期:=TOPRANGE(H);
低保留AA:=IF(局部低点预选C=-1 AND REF(距前高天,1)>REF(距前低天,1) AND LLV(L,距前高天+1)<REF(LLV(L,距前高天+1),1),-1,0);
低保留AB:=IF(局部低点预选C=-1 AND REF(距前高天,1)<=REF(距前低天,
|