private void HandleTrades(Trade trade) { Log.Information($"Received trade, price: {trade.Price}, amount: {trade.Amount}"); _tradeStatsComputer.HandleTrade(trade); FormatTradesStats(_view.Trades1Min, _tradeStatsComputer.GetStatsFor(1)); FormatTradesStats(_view.Trades5Min, _tradeStatsComputer.GetStatsFor(5)); FormatTradesStats(_view.Trades15Min, _tradeStatsComputer.GetStatsFor(15)); FormatTradesStats(_view.Trades1Hour, _tradeStatsComputer.GetStatsFor(60)); FormatTradesStats(_view.Trades24Hours, _tradeStatsComputer.GetStatsFor(60 * 24)); }
private void HandleTrades(TradeResponse response) { var trade = response.Data; Log.Information($"Received [{trade.Side}] trade, price: {trade.Price}, amount: {trade.Quantity}"); _tradeStatsComputer.HandleTrade(trade); FormatTradesStats(_view.Trades1Min, _tradeStatsComputer.GetStatsFor(1)); FormatTradesStats(_view.Trades5Min, _tradeStatsComputer.GetStatsFor(5)); FormatTradesStats(_view.Trades15Min, _tradeStatsComputer.GetStatsFor(15)); FormatTradesStats(_view.Trades1Hour, _tradeStatsComputer.GetStatsFor(60)); FormatTradesStats(_view.Trades24Hours, _tradeStatsComputer.GetStatsFor(60 * 24)); }
private void HandleTrades(TradeResponse response) { if (response.Action != BitmexAction.Insert && response.Action != BitmexAction.Partial) { return; } foreach (var trade in response.Data) { Log.Information($"Received [{trade.Side}] trade, price: {trade.Price}, amount: {trade.Size}"); _tradeStatsComputer.HandleTrade(trade); } FormatTradesStats(_view.Trades1Min, _tradeStatsComputer.GetStatsFor(1)); FormatTradesStats(_view.Trades5Min, _tradeStatsComputer.GetStatsFor(5)); FormatTradesStats(_view.Trades15Min, _tradeStatsComputer.GetStatsFor(15)); FormatTradesStats(_view.Trades1Hour, _tradeStatsComputer.GetStatsFor(60)); FormatTradesStats(_view.Trades24Hours, _tradeStatsComputer.GetStatsFor(60 * 24)); }