mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-24 07:26:47 +00:00
Moved ticker fetching from main into the relative exchange.
This commit is contained in:
12
coinbase.go
12
coinbase.go
@@ -2,6 +2,7 @@ package main
|
||||
|
||||
import (
|
||||
"log"
|
||||
"time"
|
||||
"fmt"
|
||||
"strconv"
|
||||
"net/url"
|
||||
@@ -108,6 +109,17 @@ func (c *Coinbase) GetFee(maker bool) (float64) {
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Coinbase) Run() {
|
||||
for c.Enabled {
|
||||
go func() {
|
||||
CoinbaseStats := c.GetStats("BTC-USD")
|
||||
CoinbaseTicker := c.GetTicker("BTC-USD")
|
||||
log.Printf("Coinbase BTC: Last %f High %f Low %f Volume %f\n", CoinbaseTicker.Price, CoinbaseStats.High, CoinbaseStats.Low, CoinbaseStats.Volume)
|
||||
}()
|
||||
time.Sleep(time.Second * 10)
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Coinbase) SetAPIKeys(password, apiKey, apiSecret string) {
|
||||
c.Password = password
|
||||
c.APIKey = apiKey
|
||||
|
||||
Reference in New Issue
Block a user