P:=5;
LC:=REF(CLOSE,1);
RSI1:SMA(MAX(CLOSE-LC,0),6,1)/SMA(ABS(CLOSE-LC),6,1)*100,COLORWHITE;
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);{低点}
前期高点:REF(RSI1,BARSLAST(D1)),COLORFF00FF,NODRAW;
前期低点:REF(RSI1,BARSLAST(D2)),COLOR00FF00,NODRAW;
向前期高点:CROSS(RSI1,前期高点*1.01),NODRAW;
相对能量:(RSI1-前期低点)/(前期高点-前期低点)*100,COLORYELLOW,NODRAW;
R11:=BACKSET(ISLASTBAR,BARSLAST(D1)+1);
S11:=R11>REF(R11,1);
DRAWLINE(D1,RSI1,S11,RSI1,1),COLORYELLOW;
T11:=BACKSET(ISLASTBAR,BARSLAST(D2)+1);
U11:=T11>REF(T11,1);
DRAWLINE(D2,RSI1,U11,RSI1,1),COLOR00FF00;
STICKLINE(C>0,前期低点,前期低点,1,0),COLOR00FF00;
STICKLINE(C>0,前期高点,前期高点,1,0),COLORFF00FF;