DA1:=IF(N>TOTALBARSCOUNT,TOTALBARSCOUNT,N);
DA:=IF(CURRBARSCOUNT>DA1,0,DA1);
HI:=REFDATE(HHV(H,DA),DATE);
LO:=REFDATE(LLV(L,DA),DATE);
C1:=IF(CURRBARSCOUNT<=DA,C,DRAWNULL);
GZ:=EXP(LN(HI/LO)/10);
LH1:=SUM(IF(C1>=(HI/GZ),V,0),DA);
LH2:=SUM(IF(C1>=(HI/POW(GZ,2)) AND C1<(HI/GZ),V,0),DA);
LH3:=SUM(IF(C1>=(HI/POW(GZ,3)) AND C1<(HI/POW(GZ,2)),V,0),DA);
LH4:=SUM(IF(C1>=(HI/POW(GZ,4)) AND C1<(HI/POW(GZ,3)),V,0),DA);
LH5:=SUM(IF(C1>=(HI/POW(GZ,5)) AND C1<(HI/POW(GZ,4)),V,0),DA);
LH6:=SUM(IF(C1>=(HI/POW(GZ,6)) AND C1<(HI/POW(GZ,5)),V,0),DA);
LH7:=SUM(IF(C1>=(HI/POW(GZ,7)) AND C1<(HI/POW(GZ,6)),V,0),DA);
LH8:=SUM(IF(C1>=(HI/POW(GZ,8)) AND C1<(HI/POW(GZ,7)),V,0),DA);
LH9:=SUM(IF(C1>=(LO*GZ) AND C1<LO*POW(GZ,2),V,0),DA);
LH10:=SUM(IF(C1>=LO AND C1<LO*GZ,V,0),DA);
L1:=REFDATE(HHV(LH1,DA),DATE),LINETHICK0;
L2:=REFDATE(HHV(LH2,DA),DATE),LINETHICK0;
L3:=REFDATE(HHV(LH3,DA),DATE),LINETHICK0;
L4:=REFDATE(HHV(LH4,DA),DATE);
L5:=REFDATE(HHV(LH5,DA),DATE);
L6:=REFDATE(HHV(LH6,DA),DATE);
L7:=REFDATE(HHV(LH7,DA),DATE);
L8:=REFDATE(HHV(LH8,DA),DATE);
L9:=REFDATE(HHV(LH9,DA),DATE);
L10:=REFDATE(HHV(LH10,DA),DATE);
SS:=(L1+L2+L3+L4+L5+L6+L7+L8+L9+L10);
STICKLINE(CEILING(DA*L1/SS)*3>=CURRBARSCOUNT,HI*99/100,HI/GZ,9,0)COLOR556600,LINETHICK3;
STICKLINE(CEILING(DA*L2/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,1)*99/100,HI/POW(GZ,2),9,0)COLOR665500,LINETHICK3;
STICKLINE(CEILING(DA*L3/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,2)*99/100,HI/POW(GZ,3),9,0)COLOR556600,LINETHICK3;
STICKLINE(CEILING(DA*L4/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,3)*99/100,HI/POW(GZ,4),9,0)COLOR665500,LINETHICK3;
STICKLINE(CEILING(DA*L5/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,4)*99/100,HI/POW(GZ,5),9,0)COLOR556600,LINETHICK3;
STICKLINE(CEILING(DA*L6/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,5)*99/100,HI/POW(GZ,6),9,0)COLOR665500,LINETHICK3;
STICKLINE(CEILING(DA*L7/SS)*3>=CURRBARSCOUNT,HI/POW(GZ,6)*99/100,HI/POW(GZ,7),9,0)COLOR556600,LINETHICK3;
STICKLINE(CEILING(DA*L8/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,2),LO*POW(GZ,3)*99/100,9,0)COLOR665500,LINETHICK3;
STICKLINE(CEILING(DA*L9/SS)*3>=CURRBARSCOUNT,LO*POW(GZ,1),LO*POW(GZ,2)*99/100,9,0)COLOR556600,LINETHICK3;
STICKLINE(CEILING(DA*L10/SS)*3>=CURRBARSCOUNT,LO,LO*POW(GZ,1)*99/100,9,0)COLOR665500,LINETHICK3;
DRAWKLINE(H,O,L,C);
STICKLINE(C<O,C,O,3,0),COLORFF9900;
STICKLINE(C<O,C,O,2,0),COLORFFAA00;
STICKLINE(C<O,C,O,1,0),COLORFFBB00;
STICKLINE(C<O,H,L,0,0),COLORFFCC00;
STICKLINE(C>=O,C,O,3,0),COLOR0000BB;
STICKLINE(C>=O,C,O,2,0),COLOR0000CC;
STICKLINE(C>=O,C,O,1,0),COLOR0000DD;
STICKLINE(C>=O,H,L,0,0),COLOR0000FF;
C3:=REF(C,1);
涨停:=IF((C-C3)*100/C3>=(10-0.01*100/C3),1,0);
STICKLINE(涨停,OPEN,CLOSE,2,0),COLOR0099FF;
STICKLINE(涨停,OPEN,CLOSE,1,0),COLOR00AAFF;
跌停:=IF((C3-C)*100/C3>=(10-0.01*100/C3),1,0);
STICKLINE(跌停,OPEN,CLOSE,2,0),COLORDD4400;
STICKLINE(跌停,OPEN,CLOSE,1,0),COLORDD3300;
PDI:=C;
AA1:=REF(PDI,P1)=HHV(PDI,2*P1+1);
BB1:=BACKSET(AA1,P1+1);
CC1:=FILTER(BB1,P1) AND PDI=HHV(PDI,P1+1);
A1:=BARSLAST(REF(CC1,1));
AA2:=REF(PDI,P1)=LLV(PDI,2*P1+1);
BB2:=BACKSET(AA2,P1+1);
CC2:=FILTER(BB2,P1) AND PDI=LLV(PDI,P1+1);
A2:=BARSLAST(REF(CC2,1));
DRAWICON(CC1,PDI*1.02,2);
DDD:=BARSLAST(CC1);
HDTS:=IF(CC1,CURRBARSCOUNT,0);
HDBU:=IF(DDD,REF(PDI,DDD),PDI);
HDBUTS:=IF(DDD,REF(HDTS,DDD),HDTS);
HDBU1:=REF(HDBU,DDD+1);
GDCS1:=CONST(HDBUTS);
HDBUTS1:=REF(HDBUTS,DDD+1);
GDCS2:=CONST(HDBUTS1);
DINGBU2:=REF(HDBU1,DDD+1);
MM:=IF(CURRBARSCOUNT>GDCS2,0,1);
压力:DRAWLINE(CURRBARSCOUNT=GDCS2,PDI,CURRBARSCOUNT=GDCS1,PDI,1) COLORFFBB00,LINETHICK2;
DRAWLINE(CURRBARSCOUNT=GDCS2,PDI,ISLASTBAR,REF(PDI,GDCS2-1),0),COLORFF8800;
DRAWLINE(CURRBARSCOUNT=GDCS1,PDI,ISLASTBAR,REF(PDI,GDCS1-1),1),COLORFF3300;
介入:DRAWICON(CC2,PDI*0.98,1);
DD1:=BARSLAST(CC2);
LDTS:=IF(CC2,CURRBARSCOUNT,0);
LDBU:=IF(DD1,REF(PDI,DD1),PDI);
DDTS1:=IF(DD1,REF(LDTS,DD1),LDTS);
DDCS1:=CONST(DDTS1);
ZDB:=REF(LDBU,DD1+1);
DDTS2:=REF(DDTS1,DD1+1);
DDCS2:=CONST(DDTS2);
支撑:DRAWLINE(CURRBARSCOUNT=DDCS2,PDI,CURRBARSCOUNT=DDCS1,PDI,1) COLORRED,LINETHICK2;
DRAWLINE(CURRBARSCOUNT=DDCS1,PDI,ISLASTBAR,REF(PDI,DDCS1-1),1),COLORFF00FF;
DRAWLINE(CURRBARSCOUNT=DDCS2,PDI,ISLASTBAR,REF(PDI,DDCS2-1),1),COLOR0044FF;
MA1:MA(C,M1),COLOR00FFFF;
MA2:MA(C,M2),COLOR00FF00;
MA3:MA(C,M3),COLORFF00FF; |