public static BasicQuotation Create(AssetMeasureEnum measureType, PriceQuoteUnitsEnum priceUnits, string sideAsString)
        {
            QuotationSideEnum side;
            bool sideSpecified;

            ParseQuotationSideEnum(sideAsString, out sideSpecified, out side);
            return(new BasicQuotation
            {
                valueSpecified = false,
                measureType = AssetMeasureTypeHelper.Create(measureType),
                quoteUnits = PriceQuoteUnitsHelper.Create(priceUnits),
                sideSpecified = sideSpecified,
                side = side
            });
        }
Beispiel #2
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);
        }
Beispiel #3
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 = ProductTypeHelper.ExchangeIdHelper.Copy(baseQuotation.exchangeId);
                }
            }
            return(quotation);
        }