Пример #1
0
 private void SetProperties(PricingStructureTypeEnum pricingStructureType)
 {
     if (pricingStructureType == PricingStructureTypeEnum.BondDiscountCurve)
     {
         var rateCurveId   = CurveName.Split('-');
         var subordination = rateCurveId[rateCurveId.Length - 1];
         var indexName     = rateCurveId[0];
         for (var i = 1; i < rateCurveId.Length - 1; i++)
         {
             indexName = indexName + '-' + rateCurveId[i];
         }
         CreditInstrumentId = ProductTypeHelper.InstrumentIdHelper.Parse(indexName);
         CreditSeniority    = ProductTypeHelper.CreditSeniorityHelper.Parse(subordination);
     }
     if (pricingStructureType == PricingStructureTypeEnum.BondCurve)
     {
         var rateCurveId   = CurveName.Split('-');
         var subordination = rateCurveId[rateCurveId.Length - 1];
         var indexName     = rateCurveId[0];
         for (var i = 1; i < rateCurveId.Length - 1; i++)
         {
             indexName = indexName + '-' + rateCurveId[i];
         }
         CreditInstrumentId = ProductTypeHelper.InstrumentIdHelper.Parse(indexName);
         CreditSeniority    = ProductTypeHelper.CreditSeniorityHelper.Parse(subordination);
     }
 }
        /// <summary>
        /// The CommodityCurveIdentifier.
        /// </summary>
        /// <param name="pricingStructureType"></param>
        /// <param name="curveName"></param>
        /// <param name="buildDateTime"></param>
        public EquityCurveIdentifier(PricingStructureTypeEnum pricingStructureType, string curveName, DateTime buildDateTime)
            : base(pricingStructureType, curveName, buildDateTime)
        {
            var components = CurveName.Split('-');

            EquityAsset = components[1];
            Currency    = CurrencyHelper.Parse(components[0]);
        }
        /// <summary>
        /// The CommodityCurveIdentifier.
        /// </summary>
        /// <param name="curveId"></param>
        public EquityCurveIdentifier(string curveId)
            : base(curveId)
        {
            var comcurveId = CurveName.Split('-');

            if (comcurveId.Length == 2)
            {
                EquityAsset = comcurveId[1];
                Currency    = CurrencyHelper.Parse(comcurveId[0]);
            }
        }
        /// <summary>
        /// The CommodityCurveIdentifier.
        /// </summary>
        /// <param name="curveId"></param>
        public CommodityCurveIdentifier(string curveId)
            : base(curveId)
        {
            var comcurveId = CurveName.Split('-');

            if (comcurveId.Length != 2)
            {
            }
            else
            {
                CommodityAsset = CurveName.Split('-')[1];
            }
        }
Пример #5
0
        /// <summary>
        /// Initializes a new instance of the <see cref="VolatilitySurfaceIdentifier"/> class.
        /// </summary>
        /// <param name="pricingStructureType"></param>
        /// <param name="curveName"></param>
        /// <param name="baseDate"></param>
        /// <param name="algorithm"></param>
        public VolatilitySurfaceIdentifier(PricingStructureTypeEnum pricingStructureType, string curveName, DateTime baseDate, string algorithm)
            : base(pricingStructureType, curveName, baseDate, algorithm)
        {
            var volCurveId = CurveName.Split('-');

            Currency   = CurrencyHelper.Parse(volCurveId[0]);
            Instrument = volCurveId[volCurveId.Length - 2];
            UnderlyingAssetReference = new AssetReference {
                href = Instrument
            };
            StrikeQuoteUnits = new PriceQuoteUnits {
                Value = PriceQuoteProp.Absolute
            };                                                                         //DecimalRate
        }
Пример #6
0
 private void SetProperties(PricingStructureTypeEnum pricingStructureType, string curveName)
 {
     if (pricingStructureType == PricingStructureTypeEnum.RateCurve ||
         pricingStructureType == PricingStructureTypeEnum.RateBasisCurve ||
         pricingStructureType == PricingStructureTypeEnum.ClearedRateCurve ||
         pricingStructureType == PricingStructureTypeEnum.RateSpreadCurve)
     {
         var rateCurveId = curveName.Split('-');
         var indexTenor  = rateCurveId[rateCurveId.Length - 1];
         var indexName   = rateCurveId[0];
         for (var i = 1; i < rateCurveId.Length - 1; i++)
         {
             indexName = indexName + '-' + rateCurveId[i];
         }
         ForecastRateIndex = ForecastRateIndexHelper.Parse(indexName, indexTenor);
     }
     if (pricingStructureType == PricingStructureTypeEnum.DiscountCurve ||
         pricingStructureType == PricingStructureTypeEnum.RateXccyCurve)
     {
         var rateCurveId   = CurveName.Split('-');
         var subordination = rateCurveId[rateCurveId.Length - 1];
         var indexName     = rateCurveId[0];
         for (var i = 1; i < rateCurveId.Length - 1; i++)
         {
             indexName = indexName + '-' + rateCurveId[i];
         }
         CreditInstrumentId = InstrumentIdHelper.Parse(indexName);
         CreditSeniority    = CreditSeniorityHelper.Parse(subordination);
     }
     if (pricingStructureType == PricingStructureTypeEnum.InflationCurve)
     {
         var rateCurveId = CurveName.Split('-');
         var indexTenor  = rateCurveId[rateCurveId.Length - 1];
         var indexName   = rateCurveId[0];
         for (var i = 1; i < rateCurveId.Length - 1; i++)
         {
             indexName = indexName + '-' + rateCurveId[i];
         }
         ForecastRateIndex = ForecastRateIndexHelper.Parse(indexName, indexTenor);
     }
 }
 /// <summary>
 /// The CommodityCurveIdentifier.
 /// </summary>
 /// <param name="pricingStructureType"></param>
 /// <param name="curveName"></param>
 /// <param name="buildDateTime"></param>
 public CommodityCurveIdentifier(PricingStructureTypeEnum pricingStructureType, string curveName, DateTime buildDateTime)
     : base(pricingStructureType, curveName, buildDateTime)
 {
     CommodityAsset = CurveName.Split('-')[1];
 }