Exemple #1
0
        //-------------------------------------------------------------------------
        private static ImmutableList <ParameterMetadata> createParameterMetadata(double expiry, DoubleArray delta)
        {
            ArgChecker.notNull(delta, "delta");
            int nbDelta = delta.size();

            ParameterMetadata[] parameterMetadata = new ParameterMetadata[2 * nbDelta + 1];
            parameterMetadata[nbDelta] = GenericVolatilitySurfaceYearFractionParameterMetadata.of(expiry, DeltaStrike.of(0.5d));
            for (int i = 0; i < nbDelta; i++)
            {
                parameterMetadata[i] = GenericVolatilitySurfaceYearFractionParameterMetadata.of(expiry, DeltaStrike.of(1d - delta.get(i)));          // Put
                parameterMetadata[2 * nbDelta - i] = GenericVolatilitySurfaceYearFractionParameterMetadata.of(expiry, DeltaStrike.of(delta.get(i))); // Call
            }
            return(ImmutableList.copyOf(parameterMetadata));
        }
        static ShiftedBlackIborCapletFloorletExpiryStrikeVolatilitiesTest()
        {
            IList <GenericVolatilitySurfaceYearFractionParameterMetadata> list = new List <GenericVolatilitySurfaceYearFractionParameterMetadata>();
            int nData = TIME.size();

            for (int i = 0; i < nData; ++i)
            {
                GenericVolatilitySurfaceYearFractionParameterMetadata parameterMetadata = GenericVolatilitySurfaceYearFractionParameterMetadata.of(TIME.get(i), SimpleStrike.of(STRIKE.get(i)));
                list.Add(parameterMetadata);
            }
            METADATA = Surfaces.blackVolatilityByExpiryStrike("CAP_VOL", ACT_365F).withParameterMetadata(list);
        }
Exemple #3
0
        static BlackBondFutureOptionMarginedProductPricerTest()
        {
            IList <GenericVolatilitySurfaceYearFractionParameterMetadata> list = new List <GenericVolatilitySurfaceYearFractionParameterMetadata>();
            int nData = TIME.size();

            for (int i = 0; i < nData; ++i)
            {
                GenericVolatilitySurfaceYearFractionParameterMetadata parameterMetadata = GenericVolatilitySurfaceYearFractionParameterMetadata.of(TIME.get(i), LogMoneynessStrike.of(MONEYNESS.get(i)));
                list.Add(parameterMetadata);
            }
            METADATA = DefaultSurfaceMetadata.builder().surfaceName(SurfaceName.of("GOVT1-BOND-FUT-VOL")).xValueType(ValueType.YEAR_FRACTION).yValueType(ValueType.LOG_MONEYNESS).zValueType(ValueType.BLACK_VOLATILITY).parameterMetadata(list).dayCount(ACT_365F).build();
        }