fmt := import("fmt") exch := import("exchange") t := import("times") macd := import("indicator/macd") 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 ohlcvData := exch.ohlcv(ctx, "binance", "BTC-USDT", "-", "SPOT", start, end, "1d") if is_error(ohlcvData) { // handle error fmt.println(ohlcvData) return } ret := macd.calculate(ohlcvData.candles, 12, 26, 9) fmt.println(ret) } load()