private void OrderFilledHandler(OrderFilledData data) { TraderInfo traderInfo = TraderStatistic.Find(x => x.Symbol.Equals(data.Symbol)); if (traderInfo != null) { traderInfo.Update(data); TraderInfoChanged?.Invoke(traderInfo); } // Code below is usefull? List <Trade> updatedPositions = new List <Trade>(); List <Trade> allTrades = new List <Trade>(); foreach (Trade trade in data.Trades) { trade.Symbol = data.Symbol; updatedPositions.Add(trade); } foreach (Trade trade in data.RawTrades) { trade.Symbol = data.Symbol; allTrades.Add(trade); } NewTrades?.Invoke(updatedPositions, allTrades); _receiver.OrderFilledHandle(data); }
private void FundingHandler(FundingData data) { TraderInfo traderInfo = TraderStatistic.Find(x => x.Symbol.Equals(data.Symbol)); if (traderInfo != null) { traderInfo.Update(data); TraderInfoChanged?.Invoke(traderInfo); } // Code below is usefull? List <Trade> allTrades = new List <Trade>(); foreach (Trade trade in data.Trades) { trade.Symbol = data.Symbol; allTrades.Add(trade); } NewTrades?.Invoke(new List <Trade>(), allTrades); }
private void RaiseNewTrade(Trade trade) { NewTrade?.Invoke(trade); NewTrades?.Invoke(new[] { trade }); }
private void RealTraderOnNewTrades(IEnumerable <Trade> trades) { NewTrades?.Invoke(this, new TradesEventArgs(trades)); }