示例#1
0
        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;
            }
        }
示例#2
0
            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);
                }
            }
示例#3
0
 public void AddLeg(LegItem leg)
 {
     _legs.Add(leg);
 }
示例#4
0
 public LegItem CreateLeg()
 {
     return(LegItem.Create(this));
 }
示例#5
0
 public void RemoveLeg(LegItem leg)
 {
     _legs.Remove(leg);
 }