Exemplo n.º 1
0
 // ensure volatilities are Normal
 private NormalIborFutureOptionVolatilities checkNormalVols(IborFutureOptionVolatilities volatilities)
 {
     if (volatilities is NormalIborFutureOptionVolatilities)
     {
         return((NormalIborFutureOptionVolatilities)volatilities);
     }
     throw new System.ArgumentException(Messages.format("Ibor future option only supports Normal volatilities, but was '{}'", volatilities.VolatilityType));
 }
Exemplo n.º 2
0
        // calibrated sum PV01 for one scenario
        internal MultiCurrencyAmount pv01CalibratedSum(ResolvedIborFutureOptionTrade trade, RatesProvider ratesProvider, IborFutureOptionVolatilities volatilities)
        {
            NormalIborFutureOptionVolatilities normalVols = checkNormalVols(volatilities);
            PointSensitivities pointSensitivity           = tradePricer.presentValueSensitivityRates(trade, ratesProvider, normalVols);

            return(ratesProvider.parameterSensitivity(pointSensitivity).total().multipliedBy(ONE_BASIS_POINT));
        }
Exemplo n.º 3
0
        // present value for one scenario
        internal CurrencyAmount presentValue(ResolvedIborFutureOptionTrade trade, RatesProvider ratesProvider, IborFutureOptionVolatilities volatilities)
        {
            // mark to model
            double settlementPrice = this.settlementPrice(trade, ratesProvider);
            NormalIborFutureOptionVolatilities normalVols = checkNormalVols(volatilities);

            return(tradePricer.presentValue(trade, ratesProvider, normalVols, settlementPrice));
        }
Exemplo n.º 4
0
        // unit price for one scenario
        internal double unitPrice(ResolvedIborFutureOptionTrade trade, RatesProvider ratesProvider, IborFutureOptionVolatilities volatilities)
        {
            // mark to model
            NormalIborFutureOptionVolatilities normalVols = checkNormalVols(volatilities);

            return(tradePricer.price(trade, ratesProvider, normalVols));
        }
Exemplo n.º 5
0
        // market quote bucketed PV01 for one scenario
        internal CurrencyParameterSensitivities pv01MarketQuoteBucketed(ResolvedIborFutureOptionTrade trade, RatesProvider ratesProvider, IborFutureOptionVolatilities volatilities)
        {
            NormalIborFutureOptionVolatilities normalVols       = checkNormalVols(volatilities);
            PointSensitivities             pointSensitivity     = tradePricer.presentValueSensitivityRates(trade, ratesProvider, normalVols);
            CurrencyParameterSensitivities parameterSensitivity = ratesProvider.parameterSensitivity(pointSensitivity);

            return(MARKET_QUOTE_SENS.sensitivity(parameterSensitivity, ratesProvider).multipliedBy(ONE_BASIS_POINT));
        }
 /// <summary>
 /// Calculates present value for a single set of market data.
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="ratesProvider">  the market data </param>
 /// <param name="volatilities">  the option volatilities </param>
 /// <returns> the present value </returns>
 public virtual CurrencyAmount presentValue(ResolvedIborFutureOptionTrade trade, RatesProvider ratesProvider, IborFutureOptionVolatilities volatilities)
 {
     return(calc.presentValue(trade, ratesProvider, volatilities));
 }
 /// <summary>
 /// Calculates unit price for a single set of market data.
 /// <para>
 /// This is the price of a single unit of the security.
 /// </para>
 /// <para>
 /// Strata uses <i>decimal prices</i> for Ibor futures in the trade model, pricers and market data.
 /// The decimal price is based on the decimal rate equivalent to the percentage.
 /// For example, a price of 99.32 implies an interest rate of 0.68% which is represented in Strata by 0.9932.
 ///
 /// </para>
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="ratesProvider">  the market data </param>
 /// <param name="volatilities">  the option volatilities </param>
 /// <returns> the present value </returns>
 public virtual double unitPrice(ResolvedIborFutureOptionTrade trade, RatesProvider ratesProvider, IborFutureOptionVolatilities volatilities)
 {
     return(calc.unitPrice(trade, ratesProvider, volatilities));
 }
 /// <summary>
 /// Calculates present value sensitivity for a single set of market data.
 /// <para>
 /// This is the sensitivity of
 /// <seealso cref="#presentValue(ResolvedIborFutureOptionTrade, RatesMarketDataLookup, IborFutureOptionMarketDataLookup, ScenarioMarketData) present value"/>
 /// to a one basis point shift in the market quotes used to calibrate the 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="ratesProvider">  the market data </param>
 /// <param name="volatilities">  the option volatilities </param>
 /// <returns> the present value sensitivity </returns>
 public virtual CurrencyParameterSensitivities pv01MarketQuoteBucketed(ResolvedIborFutureOptionTrade trade, RatesProvider ratesProvider, IborFutureOptionVolatilities volatilities)
 {
     return(calc.pv01MarketQuoteBucketed(trade, ratesProvider, volatilities));
 }
 /// <summary>
 /// Calculates present value sensitivity for a single set of market data.
 /// <para>
 /// This is the sensitivity of
 /// <seealso cref="#presentValue(ResolvedIborFutureOptionTrade, RatesMarketDataLookup, IborFutureOptionMarketDataLookup, ScenarioMarketData) present value"/>
 /// to a one basis point shift in the market quotes used to calibrate the curves.
 /// The result is the sum of the sensitivities of all affected curves.
 ///
 /// </para>
 /// </summary>
 /// <param name="trade">  the trade </param>
 /// <param name="ratesProvider">  the market data </param>
 /// <param name="volatilities">  the option volatilities </param>
 /// <returns> the present value sensitivity </returns>
 public virtual MultiCurrencyAmount pv01MarketQuoteSum(ResolvedIborFutureOptionTrade trade, RatesProvider ratesProvider, IborFutureOptionVolatilities volatilities)
 {
     return(calc.pv01MarketQuoteSum(trade, ratesProvider, volatilities));
 }