Пример #1
0
        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);
            }
        }
Пример #2
0
 /// <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);
 }
Пример #3
0
 /// <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);
 }
Пример #4
0
 internal LastTrade(
     TradingPair tradingPair)
 {
     this.tradingPair = tradingPair;
 }