项目作者: maurodelazeri

项目描述 :
TA-Lib implementation in go (golang) (http://ta-lib.org)
高级语言: Go
项目地址: git://github.com/maurodelazeri/go-talib.git
创建时间: 2018-01-25T13:53:09Z
项目社区:https://github.com/maurodelazeri/go-talib

开源协议:MIT License

下载


go-talib

GoDoc

A pure Go port of TA-Lib

Install

Install the package with:

  1. go get github.com/maurodelazeri/go-talib

Import it with:

  1. import "github.com/maurodelazeri/go-talib"

and use talib as the package name inside the code.

Example

  1. package main
  2. import (
  3. "fmt"
  4. "github.com/maurodelazeri/go-talib"
  5. )
  6. // Standard Deviation
  7. func main() {
  8. x := []float64{22.2,22.33,21.22,23.22,21.00}
  9. fmt.Println(talib.StdDev(x, 5, 2))
  10. [0 0 0 0 1.611339815184824]
  11. }
  1. package main
  2. import (
  3. "fmt"
  4. "github.com/markcheno/go-quote"
  5. "github.com/markcheno/go-talib"
  6. )
  7. func main() {
  8. spy, _ := quote.NewQuoteFromYahoo("spy", "2016-01-01", "2016-04-01", quote.Daily, true)
  9. fmt.Print(spy.CSV())
  10. rsi2 := talib.Rsi(spy.Close, 2)
  11. fmt.Println(rsi2)
  12. }