예제 #1
0
 // ensure volatilities are Black
 private BlackBondFutureVolatilities checkBlackVols(BondFutureVolatilities volatilities)
 {
     if (volatilities is BlackBondFutureVolatilities)
     {
         return((BlackBondFutureVolatilities)volatilities);
     }
     throw new System.ArgumentException(Messages.format("Bond future option only supports Black volatilities, but was '{}'", volatilities.VolatilityType));
 }
 /// <summary>
 /// Calculates present value for a single set of market data.
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="discountingProvider">  the market data </param>
 /// <param name="volatilities">  the volatilities </param>
 /// <returns> the present value </returns>
 public virtual CurrencyAmount presentValue(ResolvedBondFutureOptionTrade trade, LegalEntityDiscountingProvider discountingProvider, BondFutureVolatilities volatilities)
 {
     return(calc.presentValue(trade, discountingProvider, volatilities));
 }
 /// <summary>
 /// Calculates currency exposure for a single set of market data.
 /// <para>
 /// The currency risk, expressed as the equivalent amount in each currency.
 ///
 /// </para>
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="discountingProvider">  the market data </param>
 /// <param name="volatilities">  the volatilities </param>
 /// <returns> the currency exposure </returns>
 public virtual MultiCurrencyAmount currencyExposure(ResolvedBondFutureOptionTrade trade, LegalEntityDiscountingProvider discountingProvider, BondFutureVolatilities volatilities)
 {
     return(calc.currencyExposure(trade, discountingProvider, volatilities));
 }
 /// <summary>
 /// Calculates unit price for a single set of market data.
 /// <para>
 /// This is the price of a single unit of the security.
 ///
 /// <h4>Price</h4>
 /// Strata uses <i>decimal prices</i> for bond futures options in the trade model, pricers and market data.
 /// This is coherent with the pricing of <seealso cref="BondFuture"/>.
 ///
 /// </para>
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="discountingProvider">  the market data </param>
 /// <param name="volatilities">  the volatilities </param>
 /// <returns> the present value </returns>
 public virtual double unitPrice(ResolvedBondFutureOptionTrade trade, LegalEntityDiscountingProvider discountingProvider, BondFutureVolatilities volatilities)
 {
     return(calc.unitPrice(trade, discountingProvider, volatilities));
 }
 /// <summary>
 /// Calculates present value sensitivity for a single set of market data.
 /// <para>
 /// This is the sensitivity of
 /// <seealso cref="#presentValue(ResolvedBondFutureOptionTrade, LegalEntityDiscountingMarketDataLookup, BondFutureOptionMarketDataLookup, ScenarioMarketData) present value"/>
 /// to a one basis point shift in the calibrated curves.
 /// The result is provided for each affected curve and currency, bucketed by curve node.
 ///
 /// </para>
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="discountingProvider">  the market data </param>
 /// <param name="volatilities">  the volatilities </param>
 /// <returns> the present value sensitivity </returns>
 public virtual CurrencyParameterSensitivities pv01CalibratedBucketed(ResolvedBondFutureOptionTrade trade, LegalEntityDiscountingProvider discountingProvider, BondFutureVolatilities volatilities)
 {
     return(calc.pv01CalibratedBucketed(trade, discountingProvider, volatilities));
 }
 /// <summary>
 /// Calculates present value sensitivity for a single set of market data.
 /// <para>
 /// This is the sensitivity of
 /// <seealso cref="#presentValue(ResolvedBondFutureOptionTrade, LegalEntityDiscountingMarketDataLookup, BondFutureOptionMarketDataLookup, ScenarioMarketData) present value"/>
 /// to a one basis point shift in the calibrated curves.
 /// The result is the sum of the sensitivities of all affected curves.
 ///
 /// </para>
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="discountingProvider">  the market data </param>
 /// <param name="volatilities">  the volatilities </param>
 /// <returns> the present value sensitivity </returns>
 public virtual MultiCurrencyAmount pv01CalibratedSum(ResolvedBondFutureOptionTrade trade, LegalEntityDiscountingProvider discountingProvider, BondFutureVolatilities volatilities)
 {
     return(calc.pv01CalibratedSum(trade, discountingProvider, volatilities));
 }
예제 #7
0
        // calibrated sum PV01 for one scenario
        internal MultiCurrencyAmount pv01CalibratedSum(ResolvedBondFutureOptionTrade trade, LegalEntityDiscountingProvider discountingProvider, BondFutureVolatilities volatilities)
        {
            BlackBondFutureVolatilities normalVols       = checkBlackVols(volatilities);
            PointSensitivities          pointSensitivity = tradePricer.presentValueSensitivityRates(trade, discountingProvider, normalVols);

            return(discountingProvider.parameterSensitivity(pointSensitivity).total().multipliedBy(ONE_BASIS_POINT));
        }
예제 #8
0
        // present value for one scenario
        internal CurrencyAmount presentValue(ResolvedBondFutureOptionTrade trade, LegalEntityDiscountingProvider discountingProvider, BondFutureVolatilities volatilities)
        {
            // mark to model
            double settlementPrice = this.settlementPrice(trade, discountingProvider);
            BlackBondFutureVolatilities normalVols = checkBlackVols(volatilities);

            return(tradePricer.presentValue(trade, discountingProvider, normalVols, settlementPrice));
        }
예제 #9
0
        // currency exposure for one scenario
        internal MultiCurrencyAmount currencyExposure(ResolvedBondFutureOptionTrade trade, LegalEntityDiscountingProvider discountingProvider, BondFutureVolatilities volatilities)
        {
            double settlementPrice = this.settlementPrice(trade, discountingProvider);

            return(tradePricer.currencyExposure(trade, discountingProvider, volatilities, settlementPrice));
        }
예제 #10
0
        // unit price for one scenario
        internal double unitPrice(ResolvedBondFutureOptionTrade trade, LegalEntityDiscountingProvider discountingProvider, BondFutureVolatilities volatilities)
        {
            // mark to model
            BlackBondFutureVolatilities normalVols = checkBlackVols(volatilities);

            return(tradePricer.price(trade, discountingProvider, normalVols));
        }