예제 #1
0
        public static RelativeDateOffset Create(string s, DayTypeEnum dayType,
                                                string businessDayConventionAsString,
                                                string businessCentersAsString,
                                                string dateRelativeTo)
        {
            var result = new RelativeDateOffset();

            Period interval = PeriodHelper.Parse(s);

            result.period           = interval.period;
            result.periodMultiplier = interval.periodMultiplier;


            result.dayType          = dayType;
            result.dayTypeSpecified = true;

            result.businessDayConvention = BusinessDayConventionHelper.Parse(businessDayConventionAsString);
            result.businessCenters       = BusinessCentersHelper.Parse(businessCentersAsString);


            var dateReference = new DateReference {
                href = dateRelativeTo
            };

            result.dateRelativeTo = dateReference;

            return(result);
        }
예제 #2
0
        public static BusinessDayAdjustments Create(BusinessDayConventionEnum businessDayConvention, string businessCentersAsString)
        {
            var result = new BusinessDayAdjustments
            {
                businessDayConvention = businessDayConvention,
                businessCenters       =
                    BusinessCentersHelper.Parse(businessCentersAsString)
            };

            return(result);
        }
예제 #3
0
        public static Quotation Create(decimal value, DateTime valuationDate,
                                       string businessCenter, string currency,
                                       string rateSourceProvider, string rateSource, string rateSourcePage,
                                       string assetMeasureType, string quoteUnits)
        {
            var quotation = new Quotation
            {
                businessCenter    = BusinessCentersHelper.Parse(businessCenter).businessCenter[0],
                currency          = CurrencyHelper.Parse(currency),
                informationSource =
                    InformationSourceHelper.Create(
                        InformationSourceHelper.Create(rateSourceProvider, rateSource,
                                                       rateSourcePage)),
                measureType            = AssetMeasureTypeHelper.Parse(assetMeasureType),
                quoteUnits             = PriceQuoteUnitsHelper.Create(quoteUnits),
                valuationDate          = valuationDate,
                valuationDateSpecified = true,
                value          = value,
                valueSpecified = true
            };

            return(quotation);
        }
예제 #4
0
        public static Quotation Copy(Quotation baseQuotation)
        {
            Quotation quotation = null;

            if (baseQuotation != null)
            {
                quotation = new Quotation();
                if (baseQuotation.businessCenter != null)
                {
                    quotation.businessCenter = BusinessCentersHelper.Parse(baseQuotation.businessCenter.Value).businessCenter[0];
                }
                if (baseQuotation.currency != null)
                {
                    quotation.currency = CurrencyHelper.Parse(baseQuotation.currency.Value);
                }
                if (baseQuotation.valueSpecified)
                {
                    quotation.value          = baseQuotation.value;
                    quotation.valueSpecified = true;
                }
                if (baseQuotation.valuationDateSpecified)
                {
                    quotation.valuationDate          = baseQuotation.valuationDate;
                    quotation.valuationDateSpecified = true;
                }
                if (baseQuotation.expiryTimeSpecified)
                {
                    quotation.expiryTime          = baseQuotation.expiryTime;
                    quotation.expiryTimeSpecified = true;
                }
                if (baseQuotation.sideSpecified)
                {
                    quotation.side          = baseQuotation.side;
                    quotation.sideSpecified = true;
                }
                if (baseQuotation.timeSpecified)
                {
                    quotation.time          = baseQuotation.time;
                    quotation.timeSpecified = true;
                }
                if (baseQuotation.sensitivitySet != null)
                {
                    quotation.sensitivitySet = SensitivitySetHelper.Copy(baseQuotation.sensitivitySet);
                }
                if (baseQuotation.measureType != null)
                {
                    quotation.measureType = AssetMeasureTypeHelper.Copy(baseQuotation.measureType);
                }
                if (baseQuotation.quoteUnits != null)
                {
                    quotation.quoteUnits = PriceQuoteUnitsHelper.Copy(baseQuotation.quoteUnits);
                }
                if (baseQuotation.informationSource != null)
                {
                    quotation.informationSource = InformationSourceHelper.Copy(baseQuotation.informationSource).ToArray();
                }
                if (baseQuotation.exchangeId != null)
                {
                    quotation.exchangeId = ExchangeIdHelper.Copy(baseQuotation.exchangeId);
                }
            }
            return(quotation);
        }