public PriceTicker Convert(Binance.PriceTicker24hr ticker) { var si = GetSymbolInformation(ticker.symbol); if (si == null) { return(null); } if (si.Status != "BREAK") { return 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 = Math.Round(ticker.quoteVolume, si.PriceDecimals), Symbol = ticker.symbol, SymbolInformation = si, Volume = Math.Round(ticker.volume, si.QuantityDecimals), WeightedAveragePrice = Math.Round(ticker.weightedAvgPrice, si.PriceDecimals) } } ; return(new PriceTicker() { Symbol = ticker.symbol, SymbolInformation = si, }); }
internal static PriceTicker ToPriceTicker(Binance.PriceTicker24hr ticker) { return(new PriceTicker() { LastPrice = ticker.lastPrice, PriceChangePercent = ticker.priceChangePercent, Symbol = ticker.symbol, Volume = ticker.quoteVolume }); }