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) // 'ctx' is already defined when we construct our bytecode from file. // To add debugging information to the request, see verbose.gct. To add account credentials, see account.gct ohlcvDataBTC := exch.ohlcv(ctx, "binance", "BTC-USDT", "-", "SPOT", start, end, "1d") if is_error(ohlcvDataBTC) { // handle error fmt.println(ohlcvDataBTC) return } ohlcvDataETH := exch.ohlcv(ctx, "binance", "ETH-USDT", "-", "SPOT", start, end, "1d") if is_error(ohlcvDataETH) { // handle error fmt.println(ohlcvDataETH) return } ret := cc.calculate(ohlcvDataBTC.candles, ohlcvDataETH.candles, 20) fmt.println(ret) } load()