Indicators: Add support for correlation coefficient (#519)

* Add support for correlation coefficient code

* Bump ta depends

* Bump gct-ta depends version
This commit is contained in:
Adrian Gallagher
2020-06-23 17:49:08 +10:00
committed by GitHub
parent 59edb47960
commit 9f775ca952
8 changed files with 162 additions and 59 deletions

View File

@@ -0,0 +1,15 @@
fmt := import("fmt")
exch := import("exchange")
t := import("times")
cc := import("indicator/correlationcoefficient")
load := func() {
start := t.date(2017, 8 , 17 , 0 , 0 , 0, 0)
end := t.add_date(start, 0, 6 , 0)
ohlcvDataBTC := exch.ohlcv("binance", "BTC-USDT", "-", "SPOT", start, end, "1d")
ohlcvDataETH := exch.ohlcv("binance", "ETH-USDT", "-", "SPOT", start, end, "1d")
ret := cc.calculate(ohlcvDataBTC.candles, ohlcvDataETH.candles, 20)
fmt.println(ret)
}
load()