internal override async Task RefreshLastTrade( TradingPair tradingPair) { // https://www.binance.com/api/v1/trades?symbol=ETHBTC&limit=1 List <BinanceTradeJson> tradeHistory = await Get <List <BinanceTradeJson> >( $"api/v1/trades?symbol={GetPairId(tradingPair)}&limit=1"); if (tradeHistory.Count > 0) { BinanceTradeJson history = tradeHistory[0]; decimal price = decimal.Parse(history.price); tradingPair.lastTrade = new LastTrade(price); } }
/// <summary> /// Override if the last trade is not already available /// from an API which auto-refreshes. /// </summary> internal virtual Task RefreshLastTrade( TradingPair tradingPair) { return(Task.CompletedTask); }
/// <summary> /// Override if the last trade is not already available /// from an API which auto-refreshes. /// </summary> internal virtual Task RefreshLastTrade( TradingPair tradingPair) { return(null); }
internal LastTrade( TradingPair tradingPair) { this.tradingPair = tradingPair; }