private void LoadExpiredDeals(Dictionary <string, InstrumentPosition> posDico) { Deal[] expiredDeals = _dbManager.GetAllExpiredDeals(); foreach (var deal in expiredDeals) { InstrumentPosition pos; if (!posDico.TryGetValue(deal.InstrumentId, out pos)) { posDico.Add(deal.InstrumentId, new InstrumentPosition(deal)); continue; } Pnl.ComputeInstrumentPosition(pos, deal); } }
private void LoadExpiredDeals() { Deal[] expiredDeals = _dbManager.GetAllExpiredDeals(); foreach (var deal in expiredDeals) { ObsInstruPosition pos; if (!_expiredPosDico.TryGetValue(deal.InstrumentId, out pos)) { _expiredPosDico.Add(deal.InstrumentId, new ObsInstruPosition(deal)); continue; } Pnl.ComputeInstrumentPosition(pos, deal); } }
public void LoadCurrentDeals(Dictionary <string, InstrumentPosition> posDico) { Deal[] currentDeals = _dbManager.GetAllDeals(); foreach (var deal in currentDeals) { InstrumentPosition pos; if (!posDico.TryGetValue(deal.InstrumentId, out pos)) { InstrumentPosition newPos = new InstrumentPosition(deal); posDico.Add(deal.InstrumentId, newPos); continue; } Pnl.ComputeInstrumentPosition(pos, deal); } }
public void LoadCurrentDeals() { _deals = _dbManager.GetAllDeals(); ResetInstrumentPosition(); foreach (var deal in _deals) { ObsInstruPosition pos; if (!_currentPosDico.TryGetValue(deal.InstrumentId, out pos)) { var newPos = new ObsInstruPosition(deal); _currentPosDico.Add(deal.InstrumentId, newPos); ObsPositions.Add(newPos); continue; } Pnl.ComputeInstrumentPosition(pos, deal); } ResetBookPosition(); foreach (ObsInstruPosition instruPos in _currentPosDico.Values) { ObsBookPosition pos; if (!_bookPositionDico.TryGetValue(instruPos.Book, out pos)) { var newPos = new ObsBookPosition(instruPos); _bookPositionDico.Add(instruPos.Book, newPos); ObsBookPosition.Add(newPos); return; } Pnl.ComputeBookPosition(pos, instruPos); } foreach (ObsInstruPosition instruPos in _expiredPosDico.Values) { ObsBookPosition pos; if (!_bookPositionDico.TryGetValue(instruPos.Book, out pos)) { var newPos = new ObsBookPosition(instruPos); _bookPositionDico.Add(instruPos.Book, newPos); ObsBookPosition.Add(newPos); return; } Pnl.ComputeBookPosition(pos, instruPos); } }