Ejemplo n.º 1
0
        public virtual void test_of()
        {
            SurfaceName test = SurfaceName.of("Foo");

            assertEquals(test.Name, "Foo");
            assertEquals(test.MarketDataType, typeof(Surface));
            assertEquals(test.ToString(), "Foo");
            assertEquals(test.CompareTo(SurfaceName.of("Goo")) < 0, true);
        }
 //-----------------------------------------------------------------------
 /// <summary>
 /// Sets the surface name.
 /// </summary>
 /// <param name="surfaceName">  the surface name </param>
 /// <returns> this, for chaining </returns>
 public DefaultSurfaceMetadataBuilder surfaceName(string surfaceName)
 {
     this.surfaceName_Renamed = SurfaceName.of(surfaceName);
     return(this);
 }
Ejemplo n.º 3
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Creates metadata for a surface providing Black expiry-strike volatility.
 /// <para>
 /// The x-values represent time to expiry year fractions as defined by the specified day count.
 /// The y-values represent strike
 /// The z-values represent Black volatility.
 ///
 /// </para>
 /// </summary>
 /// <param name="name">  the surface name </param>
 /// <param name="dayCount">  the day count </param>
 /// <returns> the surface metadata </returns>
 public static SurfaceMetadata blackVolatilityByExpiryStrike(string name, DayCount dayCount)
 {
     return(blackVolatilityByExpiryStrike(SurfaceName.of(name), dayCount));
 }
Ejemplo n.º 4
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Creates metadata for a surface providing a SABR expiry-tenor parameter.
 /// <para>
 /// The x-values represent time to expiry year fractions as defined by the specified day count.
 /// The y-values represent tenor year fractions.
 ///
 /// </para>
 /// </summary>
 /// <param name="name">  the surface name </param>
 /// <param name="dayCount">  the day count </param>
 /// <param name="zType">  the z-value type, which must be one of the four SABR values </param>
 /// <returns> the surface metadata </returns>
 public static SurfaceMetadata sabrParameterByExpiryTenor(string name, DayCount dayCount, ValueType zType)
 {
     return(sabrParameterByExpiryTenor(SurfaceName.of(name), dayCount, zType));
 }
Ejemplo n.º 5
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Creates metadata for a surface providing Normal expiry-simple moneyness volatility.
 /// <para>
 /// The x-values represent time to expiry year fractions as defined by the specified day count.
 /// The y-values represent simple moneyness.
 /// The z-values represent Normal volatility.
 ///
 /// </para>
 /// </summary>
 /// <param name="name">  the surface name </param>
 /// <param name="dayCount">  the day count </param>
 /// <param name="moneynessType">  the moneyness type, prices or rates </param>
 /// <returns> the surface metadata </returns>
 public static SurfaceMetadata normalVolatilityByExpirySimpleMoneyness(string name, DayCount dayCount, MoneynessType moneynessType)
 {
     return(normalVolatilityByExpirySimpleMoneyness(SurfaceName.of(name), dayCount, moneynessType));
 }
Ejemplo n.º 6
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Creates metadata for a surface providing Normal expiry-tenor volatility.
 /// <para>
 /// The x-values represent time to expiry year fractions as defined by the specified day count.
 /// The y-values represent tenor year fractions.
 /// The z-values represent Normal volatility.
 ///
 /// </para>
 /// </summary>
 /// <param name="name">  the surface name </param>
 /// <param name="dayCount">  the day count </param>
 /// <returns> the surface metadata </returns>
 public static SurfaceMetadata normalVolatilityByExpiryTenor(string name, DayCount dayCount)
 {
     return(normalVolatilityByExpiryTenor(SurfaceName.of(name), dayCount));
 }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Creates the metadata.
 /// <para>
 /// No information will be available for the x-values, y-values, z-values or parameters.
 ///
 /// </para>
 /// </summary>
 /// <param name="name">  the surface name </param>
 /// <returns> the metadata </returns>
 public static DefaultSurfaceMetadata of(string name)
 {
     return(of(SurfaceName.of(name)));
 }
 //-------------------------------------------------------------------------
 /// <summary>
 /// Creates a constant surface with a specific value.
 /// </summary>
 /// <param name="name">  the surface name </param>
 /// <param name="zValue">  the constant z-value </param>
 /// <returns> the surface </returns>
 public static ConstantSurface of(string name, double zValue)
 {
     return(of(SurfaceName.of(name), zValue));
 }
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            DefaultSurfaceMetadata test = DefaultSurfaceMetadata.of(SURFACE_NAME);

            coverImmutableBean(test);
            DefaultSurfaceMetadata test2 = DefaultSurfaceMetadata.builder().surfaceName(SurfaceName.of("Test")).xValueType(ValueType.YEAR_FRACTION).yValueType(ValueType.DISCOUNT_FACTOR).zValueType(ValueType.ZERO_RATE).dayCount(ACT_365F).parameterMetadata(ParameterMetadata.empty()).build();

            coverBeanEquals(test, test2);
        }