mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-13 23:16:45 +00:00
Fixed errors relating to commit: ed1543f7.
This commit is contained in:
@@ -189,8 +189,18 @@ func (c *Coinbase) Run() {
|
||||
for _, x := range c.EnabledPairs {
|
||||
currency := x[0:3] + "-" + x[3:]
|
||||
go func() {
|
||||
stats := c.GetStats(currency)
|
||||
ticker := c.GetTicker(currency)
|
||||
stats, err := c.GetStats(currency)
|
||||
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return
|
||||
}
|
||||
ticker, err := c.GetTicker(currency)
|
||||
|
||||
if err != nil {
|
||||
log.Println(err)
|
||||
return
|
||||
}
|
||||
log.Printf("Coinbase %s: Last %f High %f Low %f Volume %f\n", currency, ticker.Price, stats.High, stats.Low, stats.Volume)
|
||||
AddExchangeInfo(c.GetName(), currency[0:3], currency[4:], ticker.Price, stats.Volume)
|
||||
}()
|
||||
|
||||
@@ -130,7 +130,12 @@ func (e *Event) CheckCondition() bool {
|
||||
lastPrice = result.Last
|
||||
}
|
||||
} else if bot.exchange.coinbase.GetName() == e.Exchange {
|
||||
lastPrice = bot.exchange.coinbase.GetTicker("BTC-USD").Price
|
||||
result, err := bot.exchange.coinbase.GetTicker("BTC-USD")
|
||||
if err != nil {
|
||||
lastPrice = 0
|
||||
} else {
|
||||
lastPrice = result.Price
|
||||
}
|
||||
} else if bot.exchange.cryptsy.GetName() == e.Exchange {
|
||||
lastPrice = bot.exchange.cryptsy.Market["BTCUSD"].LastTrade.Price
|
||||
} else if bot.exchange.dwvx.GetName() == e.Exchange {
|
||||
|
||||
Reference in New Issue
Block a user