Esempio n. 1
0
        public SpreadMatrixDataCell GetDataCell(MDDatePair datePair)
        {
            lock (LockObject)
            {
                SecurityEntry entry = spreadMatrixEntries.GetValue(datePair.GetMinDate(), datePair.GetMaxDate());

                if (entry != null)
                {
                    SpreadMatrixDataCell cell = new SpreadMatrixDataCell();
                    cell.FillData(entry);
                    return cell;
                }

                return null;
            }
        }
Esempio n. 2
0
 void SetMinYearMonth(MDDatePair datePair)
 {
     if (minYearMonth == new DateTime())
         minYearMonth = datePair.GetMinDate();
     else
         minYearMonth = MDDatePair.GetMinDate(minYearMonth, datePair.GetMinDate());
 }
Esempio n. 3
0
        public MDDatePair GetDatePair()
        {
            switch (SubContractCount)
            {
                case 0:
                    return new MDDatePair(MaturityMonthYear, MaturityMonthYear);
                case 1:
                    return new MDDatePair(GetSubContract(0).MaturityMonthYear, GetSubContract(0).MaturityMonthYear);
                case 2:
                    MDDatePair datePair = new MDDatePair(GetSubContract(0).MaturityMonthYear,
                                                         GetSubContract(1).MaturityMonthYear);
                    return new MDDatePair(datePair.GetMinDate(), datePair.GetMaxDate());
            }

            throw new Exception("Contracts that contains more than 2 subcontracts detected. These contracts currently not supported.");
        }