input:N(156,1,1000),NY(8,1,100),背景(1,1,3);
DRAWGBK(背景=3, COLORRGB(40,15,55) ,COLORRGB(50,50,90),2);
DRAWGBK(背景=2, COLORRGB(90,90,90) ,COLORRGB(30,30,30),2);
DRAWGBK(背景=1,COLORRGB(0,35,0),COLORRGB(0,55,0),3);
A:=BARPOS;A1:=SYSPARAM(1);A2:=SYSPARAM(2);A3:=SYSPARAM(3);B:=DATACOUNT; KB:=B-A+1,COLORFFFFFF,LINETHICK; HM:=A3-A2;
VERTLINE(N=KB),COLORFFFFFF,POINTDOT,linethick1;
MM:=(A3-A2)/100; //定位
DW1:=A=A2+ROUND(MM*98);
DW2:=A=A2+ROUND(MM*46);
DW3:=A=A2+ROUND(MM*67);
ZQ:=DATATYPE;
BK1:=INBLOCK( 'A股板块'); BK2:=INBLOCK('深圳权证'); BK3:=INBLOCK('上海权证');
BK4:=INBLOCK('上海指数'); BK5:=INBLOCK('深圳指数');
流通:=IF((BK1 OR BK2 OR BK3)=1,CAPITAL,IF(BK4=1,ESTDATA(1),IF(BK5=1,ESTDATA(2),0)));
SOU:=VOL/CAPITAL*100;
JJ:=IF(bk1=1,AMOUNT/VOL/100,IF((BK3 or BK2)=1,AMOUNT/VOL/100,CLOSE));
HQ:=HHV(HIGH,HM);
LQ:=LLV(LOW,HM);
W:=A=SYSPARAM(3); W2:=A=SYSPARAM(2);
ZH:=HQ[B];
ZL:=LQ[B];
Q:=(ZH-ZL)/10;
PC:=CLOSE;
SPJ:=PC[B];
Q1:=SUM(IF(JJ>=ZH-1*Q,VOL,0),N)/流通*100;
Q2:=SUM(IF(JJ<ZH-1*Q AND JJ>=ZH-2*Q,VOL,0),N)/流通*100;
Q3:=SUM(IF(JJ<ZH-2*Q AND JJ>=ZH-3*Q,VOL,0),N)/流通*100;
Q4:=SUM(IF(JJ<ZH-3*Q AND JJ>=ZH-4*Q,VOL,0),N)/流通*100;
Q5:=SUM(IF(JJ<ZH-4*Q AND JJ>=ZH-5*Q,VOL,0),N)/流通*100;
Q6:=SUM(IF(JJ<ZH-5*Q AND JJ>=ZH-6*Q,VOL,0),N)/流通*100;
Q7:=SUM(IF(JJ<ZH-6*Q AND JJ>=ZH-7*Q,VOL,0),N)/流通*100;
Q8:=SUM(IF(JJ<ZH-7*Q AND JJ>=ZH-8*Q,VOL,0),N)/流通*100;
Q9:=SUM(IF(JJ<ZH-8*Q AND JJ>=ZH-9*Q,VOL,0),N)/流通*100;
Q10:=SUM(IF(JJ<ZH-9*Q,VOL,0),N)/流通*100;
STICKLINE(BACKSET(W ,Q1[A1]/2)>0,ZH-0*Q,ZH-1*Q,10,0),COLOR990000;
STICKLINE(BACKSET(W ,Q2[A1]/2)>0,ZH-1*Q,ZH-2*Q,10,0),COLOR888888;
STICKLINE(BACKSET(W ,Q3[A1]/2)>0,ZH-2*Q,ZH-3*Q,10,0),COLOR777777;
STICKLINE(BACKSET(W ,Q4[A1]/2)>0,ZH-3*Q,ZH-4*Q,10,0),COLOR666666;
STICKLINE(BACKSET(W ,Q5[A1]/2)>0,ZH-4*Q,ZH-5*Q,10,0),COLOR555555;
STICKLINE(BACKSET(W ,Q6[A1]/2)>0,ZH-5*Q,ZH-6*Q,10,0),COLOR444444;
STICKLINE(BACKSET(W ,Q7[A1]/2)>0,ZH-6*Q,ZH-7*Q,10,0),COLOR333333;
STICKLINE(BACKSET(W ,Q8[A1]/2)>0,ZH-7*Q,ZH-8*Q,10,0),COLOR222222;
STICKLINE(BACKSET(W ,Q9[A1]/2)>0,ZH-8*Q,ZH-9*Q,10,0),COLOR111111;
STICKLINE(BACKSET(W ,Q10[A1]/2)>0,ZH-9*Q,ZH-10*Q,10,0),COLOR000000;
DRAWNUMBER( C>=((ZH-1.0*Q)+(ZH-2*Q))/2 AND ISLASTBAR ,((ZH-1.0*Q)+(ZH-2*Q))/2,((ZH-1.0*Q)+(ZH-2*Q))/2,2),COLOR444444,shift2;
DRAWNUMBER( C>=((ZH-2.0*Q)+(ZH-3*Q))/2 AND ISLASTBAR ,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ZH-3*Q,2),COLOR000000,shift2;
DRAWNUMBER( ISLASTBAR ,ZH-4.0*Q,ZH-4*Q,2),COLOR000000,shift2;
DRAWNUMBER( ISLASTBAR ,ZH-5.0*Q,ZH-5*Q,2),COLOR000000,shift2;
DRAWNUMBER( ISLASTBAR ,ZH-6.0*Q,ZH-6*Q,2),COLOR000000,shift2;
DRAWNUMBER( ISLASTBAR ,ZH-7.0*Q,ZH-7*Q,2),COLOR000000,shift2;
DRAWNUMBER( ISLASTBAR ,ZH-8.0*Q,ZH-8*Q,2),COLOR000000,shift2;
DRAWNUMBER( ISLASTBAR ,ZH-9.0*Q,ZH-9*Q,2),COLOR000000,shift2;
DRAWNUMBER( ISLASTBAR ,ZH-10.0*Q,ZH-10*Q,2),COLOR000000,shift2;
DRAWNUMBER( C>=ZH-1.0*Q AND ISLASTBAR ,ZH-1.0*Q,ZH-1*Q,2),COLOR444444,shift2;
DRAWNUMBER( C>=ZH-2.0*Q AND ISLASTBAR ,ZH-2.0*Q,ZH-2*Q,2),COLOR444444,shift2;
DRAWNUMBER( C>=ZH-3.0*Q AND ISLASTBAR ,ZH-3.0*Q,ZH-3*Q,2),COLOR444444,shift2;
DRAWNUMBER( C>=ZH-4.0*Q AND ISLASTBAR ,ZH-4.0*Q,ZH-4*Q,2),COLOR444444,shift2;
DRAWNUMBER( C>=ZH-5.0*Q AND ISLASTBAR ,ZH-5.0*Q,ZH-5*Q,2),COLOR444444,shift2;
DRAWNUMBER( C>=ZH-6.0*Q AND ISLASTBAR ,ZH-6.0*Q,ZH-6*Q,2),COLOR444444,shift2;
DRAWNUMBER( C>=ZH-7.0*Q AND ISLASTBAR ,ZH-7.0*Q,ZH-7*Q,2),COLOR444444,shift2;
DRAWNUMBER( C>=ZH-8.0*Q AND ISLASTBAR ,ZH-8.0*Q,ZH-8*Q,2),COLOR444444,shift2;
DRAWNUMBER( C>=ZH-9.0*Q AND ISLASTBAR ,ZH-9.0*Q,ZH-9*Q,2),COLOR444444,shift2;
DR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-10*Q))/2 AND ISLASTBAR ,((ZH-9.0*Q)+(ZH-10*Q))/2,((ZH-9.0*Q)+(ZH-10*Q))/2,2),COLOR000000,shift2;
DRAWTEXT(ISLASTBAR,ZH-0*Q,'支撑压力'),shift1,colorBBBBBB,PXUP20;
DRAWTEXT(ISLASTBAR,ZH-0*Q,'筹码集中'),shift1,color00BBBB,PXDN20;
A1Y:=REF(H,NY)=HHV(H,2*NY+1); B1Y:=FILTER(A1Y,NY); C1Y:=BACKSET(B1Y,NY+1); D1Y:=FILTER(C1Y,NY);{高点}
A2Y:=REF(L,NY)=LLV(L,2*NY+1); B2Y:=FILTER(A2Y,NY); C2Y:=BACKSET(B2Y,NY+1); D2Y:=FILTER(C2Y,NY);{低点}
E1Y:=(REF(LLV(L,2*NY),1)+REF(HHV(H,2*NY),1))/2; E2Y:=(H+L)/2;{高低点出现在同一K线上时可作取舍}
H1Y:=(D1Y AND NOT(D2Y AND E1Y>=E2Y)) OR ISLASTBAR OR BARSCOUNT(C)=1;
L1Y:=(D2Y AND NOT(D1Y AND E1Y<E2Y)); H2Y:=D1Y AND NOT(D2Y AND E1Y>=E2Y);
X1Y:=REF(BARSLAST(H1Y),1)+1; F1Y:=BACKSET(H1Y AND COUNT(L1Y,X1Y)>0,LLVBARS(IF(L1Y,L,10000),X1Y));
G1Y:=F1Y>REF(F1Y,1); I1Y:=BACKSET(G1Y,2); LDY:=I1Y>REF(I1Y,1),LINETHICK0;{过滤后低点}
L2Y:=LDY OR ISLASTBAR OR BARSCOUNT(C)=1;
X2Y:=REF(BARSLAST(L2Y),1)+1; F2Y:=BACKSET(L2Y AND COUNT(H2Y,X2Y)>0,HHVBARS(IF(H2Y,H,0),X2Y));
G2Y:=F2Y>REF(F2Y,1); I2Y:=BACKSET(G2Y,2); HDY:=I2Y>REF(I2Y,1),LINETHICK0;{过滤后高点}
R1Y:=BACKSET(ISLASTBAR,BARSLAST(HDY)+1); S1Y:=R1Y>REF(R1Y,1); {前一高}
T1Y:=BACKSET(ISLASTBAR,BARSLAST(LDY)+1); U1Y:=T1Y>REF(T1Y,1); {前一低}
R2Y:=BACKSET(S1Y,REF(BARSLAST(HDY),1)+2); S2Y:=R2Y>REF(R2Y,1); {前二高}
T2Y:=BACKSET(U1 |