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

价格为小数时,MyTT计算指标精度丢失 #44

Open
QGB opened this issue Jul 4, 2023 · 1 comment
Open

价格为小数时,MyTT计算指标精度丢失 #44

QGB opened this issue Jul 4, 2023 · 1 comment

Comments

@QGB
Copy link

QGB commented Jul 4, 2023

In [8]: cs=pd.Series([0.0014206, 0.0014267, 0.0014481, 0.0014968, 0.0015338, 0.001553 ,
   ...:        0.0015419, 0.0015932, 0.0016061, 0.0016428, 0.0015578, 0.0016377,
   ...:        0.0016215, 0.0015671, 0.0015631, 0.0015753, 0.0015723, 0.0015584,
   ...:        0.0015552, 0.0015157, 0.0015386, 0.0015448, 0.0015455, 0.001557 ,
   ...:        0.0015842, 0.0015893, 0.0016561, 0.0018115, 0.0018354, 0.0018405])
   ...: MyTT.BOLL(cs)
Out[8]: 
(array([  nan,   nan,   nan,   nan,   nan,   nan,   nan,   nan,   nan,
          nan,   nan,   nan,   nan,   nan,   nan,   nan,   nan,   nan,
          nan, 0.002, 0.002, 0.002, 0.002, 0.002, 0.002, 0.002, 0.002,
        0.002, 0.002, 0.002]),
 array([  nan,   nan,   nan,   nan,   nan,   nan,   nan,   nan,   nan,
          nan,   nan,   nan,   nan,   nan,   nan,   nan,   nan,   nan,
          nan, 0.002, 0.002, 0.002, 0.002, 0.002, 0.002, 0.002, 0.002,
        0.002, 0.002, 0.002]),
 array([  nan,   nan,   nan,   nan,   nan,   nan,   nan,   nan,   nan,
          nan,   nan,   nan,   nan,   nan,   nan,   nan,   nan,   nan,
          nan, 0.001, 0.001, 0.001, 0.001, 0.002, 0.002, 0.002, 0.002,
        0.001, 0.001, 0.001]))

@mpquant
Copy link
Owner

mpquant commented Jul 11, 2023

改改代码,把精度提高,主要是股票没有0.0015386 这样的价格,应该是数字货币吧

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