USE 1a0001.DBF ALIAS A
BLANK ALL FIELDS K
FOR I=1 TO RECCOUNT()-8
SELECT SHLOW FROM 1A0001 WHERE BETWEEN(RECNO(),I,I+8) INTO ARRAY AA
=ACOPY(AA,BB)
=ASORT(BB) && BB(1)为最小值,BB(9)为最大值
SELECT A
REPLACE K WITH BB(1) FOR RECNO()=I+8
SELECT SHhigh FROM 1A0001 WHERE BETWEEN(RECNO(),I,I+8) INTO ARRAY AA
=ACOPY(AA,BB)
=ASORT(BB) && BB(1)为最小值,BB(9)为最大值
SELECT A
REPLACE d WITH BB(9) FOR RECNO()=I+8
ENDFOR
n=9
GO n
DO WHILE !EOF()
rsv=((shclose-k)/(d-k))*100
REPLACE trix WITH rsv
SKIP
n=n+1
ENDDO
成功计算出rsv,谢谢,现在编 K=SMA(RSV,3,1);