Skip to content

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

@m7rick

Description

@m7rick

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions