Moved ticker fetching from main into the relative exchange.

This commit is contained in:
Adrian Gallagher
2015-03-18 16:36:01 +11:00
parent 8fdcb81924
commit b23070d7be
12 changed files with 260 additions and 215 deletions

View File

@@ -83,6 +83,20 @@ func (k *Kraken) GetFee(cryptoTrade bool) (float64) {
}
}
func (k *Kraken) Run() {
for k.Enabled {
go func() {
KrakenBTC := k.GetTicker("XBTUSD")
log.Printf("Kraken BTC: %v\n", KrakenBTC)
}()
go func() {
KrakenLTC := k.GetTicker("LTCUSD")
log.Printf("Kraken LTC: %v\n", KrakenLTC)
}()
time.Sleep(time.Second * 10)
}
}
func (k *Kraken) GetServerTime() {
result, err := k.SendKrakenRequest(KRAKEN_SERVER_TIME)