网友求助:
请老师帮忙用下面指标写一个RSI选股公式:
RSI数值连续10天以上在50-65之间横盘震荡的选股公式
LC:=REF(CLOSE,1);
RS1:=SMA(MAX(CLOSE-LC,0),14,1)/SMA(ABS(CLOSE-LC),14,1)*100;
ATR:=MA(MAX(MAX((RS1-RS1),ABS(REF(RS1,1)-RS1)),ABS(REF(RS1,1)-RS1)),15);
VM:=MA(RS1,6);
VU:VM+2.3*ATR,PRECISION1,ColorFFFFFF,LINETHICK0;
VD:VM-2.1*ATR,PRECISION1,ColorFFFFFF,LINETHICK0;
SM:MA(RS1,20),PRECISION1,Color00FF00,LINETHICK0;
SU:SM+2*STD(RS1,20),PRECISION1,Coloraaee00,LINETHICK0;
SD:SM-2*STD(RS1,20),PRECISION1,Coloraaee00,LINETHICK0;
DRAWGBK(C>0,Colorrgb(0,150,180),Colorrgb(0,150,180),0);
FILLRGN(C>0,SU,SD),Colorbbcc00,PRECISION1;
FILLRGN(C>0,VU,VD),Colorffffff,PRECISION1;
MA1:VM,PRECISION1,Colorff0000;
MA2:MA(RS1,3),PRECISION1,Color007a00;
RSI:RS1,PRECISION1,Color0000ee,LINETHICK2;()
解答如下:
LC:=REF(CLOSE,1);
RSI:=SMA(MAX(CLOSE-LC,0),14,1)/SMA(ABS(CLOSE-LC),14,1)*100;
XG:COUNT(RSI>50 AND RSI<65,10)=10;