Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sar指标计算报错 #345

Open
513153980 opened this issue May 18, 2020 · 2 comments
Open

sar指标计算报错 #345

513153980 opened this issue May 18, 2020 · 2 comments

Comments

@513153980
Copy link

File "C:\Users\wb\AppData\Local\Programs\Python\Python38\lib\site-packages\tqsdk\ta.py", line 344, in SAR
sar = _sar(df["open"].values, df["high"].values, df["low"].values, df["close"].values, range_high.values,
File "C:\Users\wb\AppData\Local\Programs\Python\Python38\lib\site-packages\tqsdk\ta.py", line 277, in _sar
trend = 1 if (close[n] - open[n]) > 0 else -1
IndexError: index 202 is out of bounds for axis 0 with size 200

@shinny-mayanqiong
Copy link
Collaborator

您好,请提供一份可以重现问题的代码。

@513153980
Copy link
Author

数组下标越界啊,看下这行代码就知道问题在哪里吧,应该很好解决吧,重现的代码很难写的,偶发的

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants