internal static PriceTicker ToPriceTicker(Binance.WsPriceTicker24hr ticker) { return(new PriceTicker() { Symbol = ticker.symbol, LastPrice = ticker.lastPrice, PriceChangePercent = ticker.priceChangePercent, Volume = ticker.quoteVolume }); }
public PriceTicker Convert(Binance.WsPriceTicker24hr ticker) { var si = GetSymbolInformation(ticker.symbol); return(si != null ? new PriceTicker() { Bid = ticker.bidPrice, Ask = ticker.askPrice, BuyVolume = 0m, HighPrice = Math.Round(ticker.highPrice, si.PriceDecimals), LastPrice = Math.Round(ticker.lastPrice, si.PriceDecimals), LowPrice = Math.Round(ticker.lowPrice, si.PriceDecimals), PriceChange = Math.Round(ticker.priceChange, si.PriceDecimals), PriceChangePercent = ticker.priceChangePercent, QuoteVolume = ticker.quoteVolume, Symbol = ticker.symbol, SymbolInformation = si, Volume = Math.Round(ticker.volume, si.QuantityDecimals), WeightedAveragePrice = Math.Round(ticker.weightedAvgPrice, si.PriceDecimals) } : null); }