N1:=7;
LC := REF(CLOSE,1);
RSI:SMA(MAX(CLOSE-LC,0),N1,1)/SMA(ABS(CLOSE-LC),N1,1)*100;
DRAWTEXT(CROSS(RSI>=80,0)&&COUNT(CROSS(RSI>=80,0),BARSLAST(CROSS(RSI<=20,0))+1),RSI,'平多开空');
DRAWTEXT(CROSS(RSI<=20,0)&&COUNT(CROSS(RSI<=20,0),BARSLAST(CROSS(RSI>=80,0))+1),RSI,'平空开多');
(来源:文华财经)