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>