private void OnLastTradesUpdate(IScriptLastTrades e) { if (LastTradesUpdate != null) { LastTradesUpdate(this, e); } }
private void AssertTrades(IScriptLastTrades trades) { Assert.IsNotNull(trades, "Bad API response"); Assert.IsTrue(trades.Trades.Any(), "Empty trades list"); foreach (var trade in trades.Trades) { Assert.IsTrue(trade.Price > 0.0M, "Zero price"); Assert.IsTrue(trade.Amount > 0.0M, "Zero amount"); Assert.IsTrue(trade.Timestamp > DateTime.UtcNow.AddMonths(-2), "Outdated timestamp, wrong parsing?"); } }