mirror of
https://github.com/d0zingcat/gocryptotrader.git
synced 2026-05-20 23:16:49 +00:00
Adds CurrencyPair to tickerPrice creation
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user