Adds CurrencyPair to tickerPrice creation

This commit is contained in:
Scott
2017-03-26 18:45:38 +11:00
parent 150ee09529
commit dedfad5d1f
15 changed files with 15 additions and 0 deletions

View File

@@ -207,6 +207,7 @@ func (a *ANX) GetTickerPrice(currency string) (TickerPrice, error) {
tickerPrice.Bid = ticker.Data.Sell.Value
tickerPrice.FirstCurrency = currency[0:3]
tickerPrice.SecondCurrency = currency[3:]
tickerPrice.CurrencyPair = tickerPrice.FirstCurrency + "_" + tickerPrice.SecondCurrency
tickerPrice.Low = ticker.Data.Low.Value
tickerPrice.Last = ticker.Data.Last.Value
tickerPrice.Volume = ticker.Data.Vol.Value

View File

@@ -303,6 +303,7 @@ func (b *Bitfinex) GetTickerPrice(currency string) (TickerPrice, error) {
tickerPrice.Bid = tickerNew.Bid
tickerPrice.FirstCurrency = currency[0:3]
tickerPrice.SecondCurrency = currency[3:]
tickerPrice.CurrencyPair = tickerPrice.FirstCurrency + "_" + tickerPrice.SecondCurrency
tickerPrice.Low = tickerNew.Low
tickerPrice.Last = tickerNew.Last
tickerPrice.Volume = tickerNew.Volume

View File

@@ -292,6 +292,7 @@ func (b *Bitstamp) GetTickerPrice(currency string) (TickerPrice, error) {
tickerPrice.Bid = ticker.Bid
tickerPrice.FirstCurrency = currency[0:3]
tickerPrice.SecondCurrency = currency[3:]
tickerPrice.CurrencyPair = tickerPrice.FirstCurrency + "_" + tickerPrice.SecondCurrency
tickerPrice.Low = ticker.Low
tickerPrice.Last = ticker.Last
tickerPrice.Volume = ticker.Volume

View File

@@ -282,6 +282,7 @@ func (b *BTCC) GetTickerPrice(currency string) (TickerPrice, error) {
tickerPrice.Bid = ticker.Buy
tickerPrice.FirstCurrency = currency[0:3]
tickerPrice.SecondCurrency = currency[3:]
tickerPrice.CurrencyPair = tickerPrice.FirstCurrency + "_" + tickerPrice.SecondCurrency
tickerPrice.Low = ticker.Low
tickerPrice.Last = ticker.Last
tickerPrice.Volume = ticker.Vol

View File

@@ -216,6 +216,7 @@ func (b *BTCE) GetTickerPrice(currency string) (TickerPrice, error) {
tickerPrice.Bid = ticker.Sell
tickerPrice.FirstCurrency = currency[0:3]
tickerPrice.SecondCurrency = currency[3:]
tickerPrice.CurrencyPair = tickerPrice.FirstCurrency + "_" + tickerPrice.SecondCurrency
tickerPrice.Low = ticker.Low
tickerPrice.Last = ticker.Last
tickerPrice.Volume = ticker.Vol_cur

View File

@@ -205,6 +205,7 @@ func (b *BTCMarkets) GetTickerPrice(currency string) (TickerPrice, error) {
tickerPrice.Bid = ticker.BestBID
tickerPrice.FirstCurrency = currency[0:3]
tickerPrice.SecondCurrency = currency[3:]
tickerPrice.CurrencyPair = tickerPrice.FirstCurrency + "_" + tickerPrice.SecondCurrency
tickerPrice.Last = ticker.LastPrice
ProcessTicker(b.GetName(), tickerPrice.FirstCurrency, tickerPrice.SecondCurrency, tickerPrice)
return tickerPrice, nil

View File

@@ -377,6 +377,7 @@ func (g *GDAX) GetTickerPrice(currency string) (TickerPrice, error) {
tickerPrice.FirstCurrency = currency[0:3]
tickerPrice.SecondCurrency = currency[4:]
tickerPrice.CurrencyPair = tickerPrice.FirstCurrency + "_" + tickerPrice.SecondCurrency
tickerPrice.Volume = stats.Volume
tickerPrice.Last = ticker.Price
tickerPrice.High = stats.High

View File

@@ -251,6 +251,7 @@ func (g *Gemini) GetTickerPrice(currency string) (TickerPrice, error) {
tickerPrice.Bid = ticker.Bid
tickerPrice.FirstCurrency = currency[0:3]
tickerPrice.SecondCurrency = currency[3:]
tickerPrice.CurrencyPair = tickerPrice.FirstCurrency + "_" + tickerPrice.SecondCurrency
tickerPrice.Last = ticker.Last
tickerPrice.Volume = ticker.Volume.USD
ProcessTicker(g.GetName(), tickerPrice.FirstCurrency, tickerPrice.SecondCurrency, tickerPrice)

View File

@@ -154,6 +154,7 @@ func (h *HUOBI) GetTickerPrice(currency string) (TickerPrice, error) {
tickerPrice.Bid = ticker.Buy
tickerPrice.FirstCurrency = StringToUpper(currency[0:3])
tickerPrice.SecondCurrency = StringToUpper(currency[3:])
tickerPrice.CurrencyPair = tickerPrice.FirstCurrency + "_" + tickerPrice.SecondCurrency
tickerPrice.Low = ticker.Low
tickerPrice.Last = ticker.Last
tickerPrice.Volume = ticker.Vol

View File

@@ -157,6 +157,7 @@ func (i *ItBit) GetTickerPrice(currency string) (TickerPrice, error) {
tickerPrice.Bid = ticker.Bid
tickerPrice.FirstCurrency = currency[0:3]
tickerPrice.SecondCurrency = currency[3:]
tickerPrice.CurrencyPair = tickerPrice.FirstCurrency + "_" + tickerPrice.SecondCurrency
tickerPrice.Last = ticker.LastPrice
tickerPrice.High = ticker.High24h
tickerPrice.Low = ticker.Low24h

View File

@@ -210,6 +210,7 @@ func (l *LakeBTC) GetTickerPrice(currency string) (TickerPrice, error) {
tickerPrice.Last = result.Last
tickerPrice.FirstCurrency = currency[0:3]
tickerPrice.SecondCurrency = currency[3:]
tickerPrice.CurrencyPair = tickerPrice.FirstCurrency + "_" + tickerPrice.SecondCurrency
ProcessTicker(l.GetName(), tickerPrice.FirstCurrency, tickerPrice.SecondCurrency, tickerPrice)
return tickerPrice, nil
}

View File

@@ -250,6 +250,7 @@ func (l *Liqui) GetTickerPrice(currency string) (TickerPrice, error) {
currencies := SplitStrings(currency, "_")
tickerPrice.FirstCurrency = currencies[0]
tickerPrice.SecondCurrency = currencies[1]
tickerPrice.CurrencyPair = tickerPrice.FirstCurrency + "_" + tickerPrice.SecondCurrency
tickerPrice.Low = ticker.Low
tickerPrice.Last = ticker.Last
tickerPrice.Volume = ticker.Vol_cur

View File

@@ -155,6 +155,7 @@ func (l *LocalBitcoins) GetTickerPrice(currency string) (TickerPrice, error) {
tickerPrice.Last = value.Rates.Last
tickerPrice.FirstCurrency = currency[0:3]
tickerPrice.SecondCurrency = key
tickerPrice.CurrencyPair = tickerPrice.FirstCurrency + "_" + tickerPrice.SecondCurrency
tickerPrice.Volume = value.VolumeBTC
ProcessTicker(l.GetName(), tickerPrice.FirstCurrency, tickerPrice.SecondCurrency, tickerPrice)
}

View File

@@ -349,6 +349,7 @@ func (o *OKCoin) GetTickerPrice(currency string) (TickerPrice, error) {
tickerPrice.Bid = ticker.Buy
tickerPrice.FirstCurrency = StringToUpper(currency[0:3])
tickerPrice.SecondCurrency = StringToUpper(currency[4:])
tickerPrice.CurrencyPair = tickerPrice.FirstCurrency + "_" + tickerPrice.SecondCurrency
tickerPrice.Low = ticker.Low
tickerPrice.Last = ticker.Last
tickerPrice.Volume = ticker.Vol

View File

@@ -181,6 +181,7 @@ func (p *Poloniex) GetTickerPrice(currency string) (TickerPrice, error) {
currencyPair := SplitStrings(currency, "_")
tickerPrice.FirstCurrency = currencyPair[0]
tickerPrice.SecondCurrency = currencyPair[1]
tickerPrice.CurrencyPair = tickerPrice.FirstCurrency + "_" + tickerPrice.SecondCurrency
tickerPrice.Ask = ticker[currency].Last
tickerPrice.Bid = ticker[currency].HighestBid
tickerPrice.High = ticker[currency].HighestBid