示例#1
0
        public static Swaption Create(Swap swap, Money premium, string premiumPayer, string premiumReceiver,
                                      AdjustableDate paymentDate,
                                      AdjustableDate expirationDate,
                                      DateTime earliestExerciseTime, DateTime expirationTime, bool automaticExercise)
        {
            var swaption = new Swaption {
                swap = swap, premium = new[] { new Payment() }
            };

            swaption.buyerPartyReference               = PartyOrTradeSideReferenceHelper.ToPartyOrTradeSideReference(premiumPayer);
            swaption.sellerPartyReference              = PartyOrTradeSideReferenceHelper.ToPartyOrTradeSideReference(premiumReceiver);
            swaption.premium[0].paymentAmount          = premium;
            swaption.premium[0].paymentDate            = paymentDate;
            swaption.premium[0].payerPartyReference    = PartyOrAccountReferenceFactory.Create(premiumPayer);
            swaption.premium[0].receiverPartyReference = PartyOrAccountReferenceFactory.Create(premiumReceiver);
            var europeanExercise = new EuropeanExercise
            {
                expirationDate       = new AdjustableOrRelativeDate(),
                earliestExerciseTime = BusinessCenterTimeHelper.Create(earliestExerciseTime),
                expirationTime       = BusinessCenterTimeHelper.Create(expirationTime)
            };

            europeanExercise.expirationDate.Item = expirationDate;
            swaption.exerciseProcedure           = new ExerciseProcedure();
            if (automaticExercise)
            {
                XsdClassesFieldResolver.ExerciseProcedure_SetAutomaticExercise(swaption.exerciseProcedure, new AutomaticExercise());
            }
            else//manual exercise
            {
                XsdClassesFieldResolver.ExerciseProcedure_SetManualExercise(swaption.exerciseProcedure, new ManualExercise());
            }
            XsdClassesFieldResolver.Swaption_SetEuropeanExercise(swaption, europeanExercise);
            return(swaption);
        }
示例#2
0
        public static Payment Create(String payerPartyReference,
                                     String receiverPartyReference, String currency, Decimal paymentAmount)
        {
            var payment = new Payment
            {
                payerPartyReference = PartyOrAccountReferenceFactory.Create(payerPartyReference),
                paymentAmount       = new Money {
                    amount = paymentAmount, currency = new Currency {
                        Value = currency
                    }
                },
                receiverPartyReference = PartyOrAccountReferenceFactory.Create(receiverPartyReference)
            };

            return(payment);
        }
示例#3
0
        public static Payment Create(string identifier, bool pay, Money paymentAmount,
                                     DateTime adjustedPaymentDate, PaymentType paymentType,
                                     decimal discountFactor, Money presentValueAmount)
        {
            var payment = new Payment();
            var result  = new IdentifiedDate {
                Value = adjustedPaymentDate
            };

            payment.adjustedPaymentDate     = result;
            payment.discountFactor          = discountFactor;
            payment.discountFactorSpecified = true;
            payment.href = identifier;
            payment.payerPartyReference    = (pay) ? PartyOrAccountReferenceFactory.Create("CBA") : PartyOrAccountReferenceFactory.Create("");
            payment.paymentAmount          = paymentAmount;
            payment.paymentType            = paymentType;
            payment.presentValueAmount     = presentValueAmount;
            payment.receiverPartyReference = (pay) ? PartyOrAccountReferenceFactory.Create("") : PartyOrAccountReferenceFactory.Create("CBA");
            return(payment);
        }
示例#4
0
        public static Payment Create(String payerPartyReference,
                                     String receiverPartyReference, String currency, Decimal paymentAmount,
                                     DateTime valueDate)
        {
            var payment = new Payment
            {
                adjustedPaymentDate = new IdentifiedDate {
                    Value = valueDate
                },
                payerPartyReference = PartyOrAccountReferenceFactory.Create(payerPartyReference),
                paymentAmount       = new Money {
                    amount = paymentAmount, currency = new Currency {
                        Value = currency
                    }
                },
                receiverPartyReference = PartyOrAccountReferenceFactory.Create(receiverPartyReference)
            };

            return(payment);
        }
 public static void SetPayerAndReceiver(InterestRateStream stream, string payer, string receiver)
 {
     stream.payerPartyReference    = PartyOrAccountReferenceFactory.Create(payer);
     stream.receiverPartyReference = PartyOrAccountReferenceFactory.Create(receiver);
 }