Example #1
0
 private ResolvedIborFixingDepositTrade(TradeInfo info, ResolvedIborFixingDeposit product)
 {
     JodaBeanUtils.notNull(info, "info");
     JodaBeanUtils.notNull(product, "product");
     this.info    = info;
     this.product = product;
 }
Example #2
0
        //-------------------------------------------------------------------------
        public virtual void coverage()
        {
            ResolvedIborFixingDeposit test1 = ResolvedIborFixingDeposit.builder().currency(GBP).notional(NOTIONAL).startDate(START_DATE).endDate(END_DATE).yearFraction(YEAR_FRACTION).floatingRate(RATE_COMP).fixedRate(RATE).build();

            coverImmutableBean(test1);
            ResolvedIborFixingDeposit test2 = ResolvedIborFixingDeposit.builder().currency(GBP).notional(-100000000d).startDate(START_DATE).endDate(LocalDate.of(2015, 4, 20)).yearFraction(0.25).floatingRate(IborRateComputation.of(GBP_LIBOR_3M, FIXING_DATE, REF_DATA)).fixedRate(0.0375).build();

            coverBeanEquals(test1, test2);
        }
Example #3
0
        //-------------------------------------------------------------------------
        public virtual void test_builder()
        {
            ResolvedIborFixingDeposit test = ResolvedIborFixingDeposit.builder().currency(GBP).notional(NOTIONAL).startDate(START_DATE).endDate(END_DATE).yearFraction(YEAR_FRACTION).floatingRate(RATE_COMP).fixedRate(RATE).build();

            assertEquals(test.Currency, GBP);
            assertEquals(test.Notional, NOTIONAL);
            assertEquals(test.StartDate, START_DATE);
            assertEquals(test.EndDate, END_DATE);
            assertEquals(test.YearFraction, YEAR_FRACTION);
            assertEquals(test.FloatingRate, RATE_COMP);
            assertEquals(test.FixedRate, RATE);
        }
Example #4
0
 public override bool Equals(object obj)
 {
     if (obj == this)
     {
         return(true);
     }
     if (obj != null && obj.GetType() == this.GetType())
     {
         ResolvedIborFixingDeposit other = (ResolvedIborFixingDeposit)obj;
         return(JodaBeanUtils.equal(currency, other.currency) && JodaBeanUtils.equal(notional, other.notional) && JodaBeanUtils.equal(startDate, other.startDate) && JodaBeanUtils.equal(endDate, other.endDate) && JodaBeanUtils.equal(yearFraction, other.yearFraction) && JodaBeanUtils.equal(fixedRate, other.fixedRate) && JodaBeanUtils.equal(floatingRate, other.floatingRate));
     }
     return(false);
 }
Example #5
0
        //-------------------------------------------------------------------------
        public virtual void test_resolve()
        {
            IborFixingDeposit         @base          = IborFixingDeposit.builder().buySell(SELL).notional(NOTIONAL).startDate(START_DATE).endDate(END_DATE).businessDayAdjustment(BDA_MOD_FOLLOW).index(GBP_LIBOR_6M).fixedRate(RATE).build();
            ResolvedIborFixingDeposit test           = @base.resolve(REF_DATA);
            LocalDate           expectedEndDate      = BDA_MOD_FOLLOW.adjust(END_DATE, REF_DATA);
            double              expectedYearFraction = ACT_365F.yearFraction(START_DATE, expectedEndDate);
            IborRateComputation expectedObservation  = IborRateComputation.of(GBP_LIBOR_6M, GBP_LIBOR_6M.FixingDateOffset.adjust(START_DATE, REF_DATA), REF_DATA);

            assertEquals(test.Currency, GBP);
            assertEquals(test.StartDate, START_DATE);
            assertEquals(test.EndDate, expectedEndDate);
            assertEquals(test.FloatingRate, expectedObservation);
            assertEquals(test.Notional, -NOTIONAL);
            assertEquals(test.FixedRate, RATE);
            assertEquals(test.YearFraction, expectedYearFraction);
        }
Example #6
0
            public override Builder set(string propertyName, object newValue)
            {
                switch (propertyName.GetHashCode())
                {
                case 3237038:         // info
                    this.info_Renamed = (TradeInfo)newValue;
                    break;

                case -309474065:         // product
                    this.product_Renamed = (ResolvedIborFixingDeposit)newValue;
                    break;

                default:
                    throw new NoSuchElementException("Unknown property: " + propertyName);
                }
                return(this);
            }
Example #7
0
        public virtual void test_serialization()
        {
            ResolvedIborFixingDeposit test = ResolvedIborFixingDeposit.builder().currency(GBP).notional(NOTIONAL).startDate(START_DATE).endDate(END_DATE).yearFraction(YEAR_FRACTION).floatingRate(RATE_COMP).fixedRate(RATE).build();

            assertSerialization(test);
        }
Example #8
0
 public virtual void test_builder_wrongDates()
 {
     assertThrowsIllegalArg(() => ResolvedIborFixingDeposit.builder().currency(GBP).notional(NOTIONAL).startDate(LocalDate.of(2015, 8, 20)).endDate(END_DATE).yearFraction(YEAR_FRACTION).floatingRate(RATE_COMP).fixedRate(RATE).build());
 }
Example #9
0
 //-------------------------------------------------------------------------
 /// <summary>
 /// Obtains an instance of a resolved Ibor Fixing Deposit trade.
 /// </summary>
 /// <param name="info">  the trade info </param>
 /// <param name="product">  the product </param>
 /// <returns> the resolved trade </returns>
 public static ResolvedIborFixingDepositTrade of(TradeInfo info, ResolvedIborFixingDeposit product)
 {
     return(new ResolvedIborFixingDepositTrade(info, product));
 }
Example #10
0
 /// <summary>
 /// Sets the resolved Ibor Fixing Deposit product.
 /// <para>
 /// The product captures the contracted financial details of the trade.
 /// </para>
 /// </summary>
 /// <param name="product">  the new value, not null </param>
 /// <returns> this, for chaining, not null </returns>
 public Builder product(ResolvedIborFixingDeposit product)
 {
     JodaBeanUtils.notNull(product, "product");
     this.product_Renamed = product;
     return(this);
 }
Example #11
0
 /// <summary>
 /// Restricted copy constructor. </summary>
 /// <param name="beanToCopy">  the bean to copy from, not null </param>
 internal Builder(ResolvedIborFixingDepositTrade beanToCopy)
 {
     this.info_Renamed    = beanToCopy.Info;
     this.product_Renamed = beanToCopy.Product;
 }