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

[Bug] ExampleMACD() function return values for MACD, signal line and Hist line are nil #65

Open
m7rick opened this issue Feb 22, 2024 · 0 comments

Comments

@m7rick
Copy link

m7rick commented Feb 22, 2024

Description:

I am using the ExampleMACD() function in Go-Pine library to generate a dataset and compute MACD. The code is as follows:

func ExampleMACD() {
    start := time.Now()
    data := OHLCVTestData(start, 10000, 5*60*1000)
    series, _ := NewOHLCVSeries(data)
    close := OHLCVAttr(series, OHLCPropClose)
    mline, sigline, histline := MACD(close, 12, 26, 9)
    log.Printf("MACD line: %+v", mline.Val())
    log.Printf("Signal line: %+v", sigline.Val())
    log.Printf("Hist line: %+v", histline.Val())
}

However, the result shows that MACD line, signal line and Hist line all output as nil values. I would like to know why this is happening and how it could be resolved.

2024/02/22 12:04:03 MACD line: <nil>
2024/02/22 12:04:03 Signal line: <nil>
2024/02/22 12:04:03 Hist line: <nil>
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

1 participant