public void UpdateDiff() { if (_legs.Count >= 2) { LegItem bigger = _legs[0].Last >= _legs[1].Last ? _legs[0] : _legs[1]; LegItem smaller = _legs[0].Last < _legs[1].Last ? _legs[0] : _legs[1]; LongDiff = bigger.Ask - smaller.Bid; ShortDiff = bigger.Bid - smaller.Ask; } }
public EditPortfolioViewModel(IEnumerable <Future> futures, PortfolioItem portfolioItem) { FutureList = futures; Portfolio = portfolioItem; if (Portfolio.Legs.Count() == 0) { LegItem leg = Portfolio.CreateLeg(); Portfolio.AddLeg(leg); leg = Portfolio.CreateLeg(); Portfolio.AddLeg(leg); } }
public void AddLeg(LegItem leg) { _legs.Add(leg); }
public LegItem CreateLeg() { return(LegItem.Create(this)); }
public void RemoveLeg(LegItem leg) { _legs.Remove(leg); }