//-------------------------------------------------------------------------
        public virtual FunctionRequirements requirements(T target, ISet <Measure> measures, CalculationParameters parameters, ReferenceData refData)
        {
            // extract data from product
            BondFutureOption option = target.Product;
            BondFuture       future = option.UnderlyingFuture;

            // use lookup to build requirements
            QuoteId optionQuoteId      = QuoteId.of(option.SecurityId.StandardId, FieldName.SETTLEMENT_PRICE);
            FunctionRequirements freqs = FunctionRequirements.builder().valueRequirements(optionQuoteId).outputCurrencies(future.Currency, option.Currency).build();
            LegalEntityDiscountingMarketDataLookup ledLookup = parameters.getParameter(typeof(LegalEntityDiscountingMarketDataLookup));

            foreach (FixedCouponBond bond in future.DeliveryBasket)
            {
                freqs = freqs.combinedWith(ledLookup.requirements(bond.SecurityId, bond.LegalEntityId, bond.Currency));
            }
            BondFutureOptionMarketDataLookup optionLookup = parameters.getParameter(typeof(BondFutureOptionMarketDataLookup));
            FunctionRequirements             optionReqs   = optionLookup.requirements(future.SecurityId);

            return(freqs.combinedWith(optionReqs));
        }
        //-------------------------------------------------------------------------
        public virtual FunctionRequirements requirements(FxSingleBarrierOptionTrade trade, ISet <Measure> measures, CalculationParameters parameters, ReferenceData refData)
        {
            // extract data from product
            FxSingleBarrierOption product      = trade.Product;
            CurrencyPair          currencyPair = product.CurrencyPair;

            // use lookup to build requirements
            RatesMarketDataLookup    ratesLookup  = parameters.getParameter(typeof(RatesMarketDataLookup));
            FunctionRequirements     ratesReqs    = ratesLookup.requirements(ImmutableSet.of(currencyPair.Base, currencyPair.Counter));
            FxOptionMarketDataLookup optionLookup = parameters.getParameter(typeof(FxOptionMarketDataLookup));
            FunctionRequirements     optionReqs   = optionLookup.requirements(currencyPair);

            return(ratesReqs.combinedWith(optionReqs));
        }
Exemplo n.º 3
0
        //-------------------------------------------------------------------------
        public virtual FunctionRequirements requirements(IborCapFloorTrade trade, ISet <Measure> measures, CalculationParameters parameters, ReferenceData refData)
        {
            // extract data from product
            IborCapFloor    product    = trade.Product;
            ISet <Currency> currencies = product.allPaymentCurrencies();
            ISet <Index>    indices    = product.allIndices();

            // use lookup to build requirements
            RatesMarketDataLookup        ratesLookup    = parameters.getParameter(typeof(RatesMarketDataLookup));
            FunctionRequirements         ratesReqs      = ratesLookup.requirements(currencies, indices);
            IborCapFloorMarketDataLookup capFloorLookup = parameters.getParameter(typeof(IborCapFloorMarketDataLookup));
            FunctionRequirements         capFloorReqs   = capFloorLookup.requirements(product.CapFloorLeg.Index);

            return(ratesReqs.combinedWith(capFloorReqs));
        }
        //-------------------------------------------------------------------------
        public virtual FunctionRequirements requirements(SwaptionTrade trade, ISet <Measure> measures, CalculationParameters parameters, ReferenceData refData)
        {
            // extract data from product
            Swaption  product  = trade.Product;
            Currency  currency = product.Currency;
            IborIndex index    = product.Index;

            // use lookup to build requirements
            RatesMarketDataLookup    ratesLookup    = parameters.getParameter(typeof(RatesMarketDataLookup));
            FunctionRequirements     ratesReqs      = ratesLookup.requirements(currency, index);
            SwaptionMarketDataLookup swaptionLookup = parameters.getParameter(typeof(SwaptionMarketDataLookup));
            FunctionRequirements     swaptionReqs   = swaptionLookup.requirements(index);

            return(ratesReqs.combinedWith(swaptionReqs));
        }
        //-------------------------------------------------------------------------
        public virtual FunctionRequirements requirements(T target, ISet <Measure> measures, CalculationParameters parameters, ReferenceData refData)
        {
            // extract data from product
            CapitalIndexedBond product       = target.Product;
            Currency           currency      = product.Currency;
            SecurityId         securityId    = product.SecurityId;
            LegalEntityId      legalEntityId = product.LegalEntityId;

            // use lookup to build requirements
            RatesMarketDataLookup ratesLookup = parameters.getParameter(typeof(RatesMarketDataLookup));
            FunctionRequirements  ratesReqs   = ratesLookup.requirements(ImmutableSet.of(), ImmutableSet.of(product.RateCalculation.Index));
            LegalEntityDiscountingMarketDataLookup ledLookup = parameters.getParameter(typeof(LegalEntityDiscountingMarketDataLookup));
            FunctionRequirements ledReqs = ledLookup.requirements(securityId, legalEntityId, currency);

            return(ratesReqs.combinedWith(ledReqs));
        }
        //-------------------------------------------------------------------------
        public virtual FunctionRequirements requirements(T target, ISet <Measure> measures, CalculationParameters parameters, ReferenceData refData)
        {
            // extract data from product
            BondFuture product  = target.Product;
            QuoteId    quoteId  = QuoteId.of(product.SecurityId.StandardId, FieldName.SETTLEMENT_PRICE);
            Currency   currency = product.Currency;

            // use lookup to build requirements
            FunctionRequirements freqs = FunctionRequirements.builder().valueRequirements(quoteId).outputCurrencies(currency).build();
            LegalEntityDiscountingMarketDataLookup ledLookup = parameters.getParameter(typeof(LegalEntityDiscountingMarketDataLookup));

            foreach (FixedCouponBond bond in product.DeliveryBasket)
            {
                freqs = freqs.combinedWith(ledLookup.requirements(bond.SecurityId, bond.LegalEntityId, bond.Currency));
            }
            return(freqs);
        }
        //-------------------------------------------------------------------------
        public virtual FunctionRequirements requirements(CmsTrade trade, ISet <Measure> measures, CalculationParameters parameters, ReferenceData refData)
        {
            // extract data from product
            Cms             product    = trade.Product;
            ISet <Currency> currencies = product.allPaymentCurrencies();
            IborIndex       cmsIndex   = trade.Product.CmsLeg.UnderlyingIndex;
            ISet <Index>    payIndices = trade.Product.allRateIndices();
            ISet <Index>    indices    = ImmutableSet.builder <Index>().add(cmsIndex).addAll(payIndices).build();

            // use lookup to build requirements
            RatesMarketDataLookup    ratesLookup    = parameters.getParameter(typeof(RatesMarketDataLookup));
            FunctionRequirements     ratesReqs      = ratesLookup.requirements(currencies, indices);
            SwaptionMarketDataLookup swaptionLookup = parameters.getParameter(typeof(SwaptionMarketDataLookup));
            FunctionRequirements     swaptionReqs   = swaptionLookup.requirements(cmsIndex);

            return(ratesReqs.combinedWith(swaptionReqs));
        }