HIGHN:=12;P:=9;N1:=7;
LC:=REF(CLOSE,1);
RSI1:SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100,colorwhite;
AA:=REF(RSI1,HIGHN)=HHV(RSI1,2*HIGHN+1);
QY:=BACKSET(AA,HIGHN+1);
CC:=FILTER(QY,HIGHN) AND RSI1=HHV(RSI1,HIGHN+1);
DDD:=BARSLAST(CC);
GDTS:=IF(CC,CURRBARSCOUNT,0);
DINGBUTS:=IF(DDD,REF(GDTS,DDD),GDTS);
GDCS1:=CONST(DINGBUTS);
DINGBUTS1:=REF(DINGBUTS,DDD+1);
GDCS2:=CONST(DINGBUTS1);
AA1:=REF(RSI1,HIGHN)=LLV(RSI1,2*HIGHN+1);
QY1:=BACKSET(AA1,HIGHN+1);
CC1:=FILTER(QY1,HIGHN) AND RSI1=LLV(RSI1,HIGHN+1);
DD1:=BARSLAST(CC1);
DDTS:=IF(CC1,CURRBARSCOUNT,0);
DDTS1:=IF(DD1,REF(DDTS,DD1),DDTS);
DDCS1:=CONST(DDTS1);
DDTS2:=REF(DDTS1,DD1+1);
DDCS2:=CONST(DDTS2);
A1:=REF(RSI1,P)=HHV(RSI1,2*P+1);
B1:=FILTER(A1,P);
C1:=BACKSET(B1,P+1);
D1:=FILTER(C1,P);
A2:=REF(RSI1,P)=LLV(RSI1,2*P+1);
B2:=FILTER(A2,P);
C2:=BACKSET(B2,P+1);
D2:=FILTER(C2,P);
R11:=BACKSET(ISLASTBAR,BARSLAST(D1)+1);
S11:=R11>REF(R11,1);
T11:=BACKSET(ISLASTBAR,BARSLAST(D2)+1);
U11:=T11>REF(T11,1);
MID:=MA(RSI1,20);
UPPER:=MID + 2*STD(RSI1,20);
LOWER:=MID - 2*STD(RSI1,20);
高:=REF(HHV(RSI1,360),1);
低:=REF(LLV(RSI1,240),1);
BIAS1:=(C-MA(C,6))/MA(C,6)*100;
BIAS2:=(C-MA(C,12))/MA(C,12)*100;
BIAS3:=(C-MA(C,24))/MA(C,24)*100;
BIAS:=(BIAS1+2*BIAS2+3*BIAS3)/6;
乖离:=MA(BIAS,6);
前高:REF(RSI1,BARSLAST(D1)),COLORFF00FF,NODRAW;
前低:REF(RSI1,BARSLAST(D2)),COLOR00FF00,NODRAW;
相对能量:(RSI1-前低)/(前高-前低)*100,coloryellow,NODRAW;
上轨:UPPER,COLOR993300;
下轨:LOWER,COLOR993300;
DRAWICON(CC,RSI1*1.03,2);
DRAWICON(CC1,RSI1*0.97,1);
高压:DRAWLINE(CURRBARSCOUNT=GDCS2,RSI1,CURRBARSCOUNT=GDCS1,RSI1,1) ,colorblue,POINTDOT,LINETHICK4;
低支:DRAWLINE(CURRBARSCOUNT=DDCS2,RSI1,CURRBARSCOUNT=DDCS1,RSI1,1) ,colorred,POINTDOT,LINETHICK4;
阻力:DRAWLINE(D1,RSI1,S11,RSI1,1),coloryellow;
支撑:DRAWLINE(D2,RSI1,U11,RSI1,1),COLOR00FF00;
DRAWTEXT(CROSS(RSI1,LOWER),LOWER,'抄'),COLOR00FF00;
DRAWTEXT(CROSS(LOWER,RSI1),LOWER,'▼'),COLOR00FF00;
DRAWTEXT(CROSS(RSI1,高),MID,'年高'),coloryellow;
DRAWTEXT(CROSS(低,RSI1),MID,'年低'),coloryellow;
DRAWTEXT(CROSS(UPPER,RSI1),UPPER,'逃'),coloryellow;
DRAWTEXT(CROSS(RSI1,UPPER),UPPER,'▲'),coloryellow;
VM:MA(RSI1,N1),COLORFF00FF,NODRAW;
STICKLINE(CROSS(BIAS,乖离) AND 乖离<-9,6,0,2,0),colorred;
DRAWTEXT(ISLASTBAR AND RSI1>REF(RSI1,1),VM,' ▲'),COLORDD00FF;
DRAWTEXT(ISLASTBAR AND RSI1<REF(RSI1,1),VM,' ▼'),COLORCCEE00;
DRAWTEXT(CURRBARSCOUNT=60,10,' ☆ 实战☆'),colorgreen;
状元郎:=RSI1<=18;
STICKLINE(状元郎,58,55,14,0),coloryellow;
STICKLINE(状元郎,57,56,12,0),colorcyan;
STICKLINE(状元郎,45,48,4,0),colorwhite;
STICKLINE(状元郎,53,50,9,0),COLOR0088DD;
STICKLINE(状元郎,55,48,6,0),colorlired;
STICKLINE(状元郎,53,53,5,0),COLOR000000;
STICKLINE(状元郎,52,52,3,0),COLOR000000;
STICKLINE(状元郎,53,50,2,0),COLOR0077EE;
STICKLINE(状元郎,53,50,1,0),COLOR0077EE;
STICKLINE(状元郎,60,55,7,0),colorred;
STICKLINE(状元郎,60,63,4,0),colorred;
状元献宝:IF(状元郎,58,DRAWNULL),LINETHICK4,POINTDOT,colorgreen;
STICKLINE(状元郎,20,17,16,0),colorwhite;
STICKLINE(状元郎,22,20,12,0),coloryellow;
STICKLINE(状元郎,22,17,5,0),colorblack;
STICKLINE(状元郎,33,22,13,0),colorred;
STICKLINE(状元郎,46,42,18,0),colormagenta;
STICKLINE(状元郎,46,31,16,0),colorred;
STICKLINE(状元郎,41,31,12,0),colorbrown;
STICKLINE(状元郎,41,31,11,0),colorred;
STICKLINE(状元郎,32,31,12,0),coloryellow;
STICKLINE(状元郎,35,33,8,0),COLOR00AAFF;
STICKLINE(状元郎,49,49,1,0),COLOR0000EE;
DRAWICON(状元郎,38,9);
DRAWICON(状元郎,26,29);