Esempio n. 1
0
        public virtual void test_of_wrongCounterCurrency()
        {
            FxSingle nearLeg = FxSingle.of(USD_P1550, EUR_P1590.negated(), DATE_2011_11_21);
            FxSingle farLeg  = FxSingle.of(GBP_M1000, EUR_P1590, DATE_2011_12_21);

            assertThrowsIllegalArg(() => FxSwap.of(nearLeg, farLeg));
        }
Esempio n. 2
0
        private AdjustablePayment parsePremium(XmlElement swaptionEl, FpmlDocument document, TradeInfoBuilder tradeInfoBuilder)
        {
            XmlElement     premiumEl       = swaptionEl.getChild("premium");
            PayReceive     payReceive      = document.parsePayerReceiver(premiumEl, tradeInfoBuilder);
            XmlElement     paymentAmountEl = premiumEl.getChild("paymentAmount");
            CurrencyAmount ccyAmount       = document.parseCurrencyAmount(paymentAmountEl);

            ccyAmount = payReceive.Pay ? ccyAmount.negated() : ccyAmount;
            AdjustableDate paymentDate = premiumEl.findChild("paymentDate").map(el => document.parseAdjustableDate(el)).get();

            return(AdjustablePayment.of(ccyAmount, paymentDate));
        }
Esempio n. 3
0
        public virtual void test_of_sameSign()
        {
            FxSingle farLeg = FxSingle.of(GBP_M1000.negated(), USD_P1550.negated(), DATE_2011_12_21);

            assertThrowsIllegalArg(() => FxSwap.of(NEAR_LEG, farLeg));
        }