Пример #1
0
 public OvernightIndexedSwap(OvernightIndexedSwap.Type type, DoubleVector nominals, Schedule schedule, double fixedRate, DayCounter fixedDC, OvernightIndex index, double spread, uint paymentLag, BusinessDayConvention paymentAdjustment, Calendar paymentCalendar) : this(NQuantLibcPINVOKE.new_OvernightIndexedSwap__SWIG_7((int)type, DoubleVector.getCPtr(nominals), Schedule.getCPtr(schedule), fixedRate, DayCounter.getCPtr(fixedDC), OvernightIndex.getCPtr(index), spread, paymentLag, (int)paymentAdjustment, Calendar.getCPtr(paymentCalendar)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Пример #2
0
 public OvernightIndexedSwap(OvernightIndexedSwap.Type type, double nominal, Schedule schedule, double fixedRate, DayCounter fixedDC, OvernightIndex index) : this(NQuantLibcPINVOKE.new_OvernightIndexedSwap__SWIG_5((int)type, nominal, Schedule.getCPtr(schedule), fixedRate, DayCounter.getCPtr(fixedDC), OvernightIndex.getCPtr(index)), true)
 {
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
 }
Пример #3
0
 public OvernightIndexedSwap.Type type()
 {
     OvernightIndexedSwap.Type ret = (OvernightIndexedSwap.Type)NQuantLibcPINVOKE.OvernightIndexedSwap_type(swigCPtr);
     if (NQuantLibcPINVOKE.SWIGPendingException.Pending)
     {
         throw NQuantLibcPINVOKE.SWIGPendingException.Retrieve();
     }
     return(ret);
 }
 public MakeOIS(Period swapTenor, OvernightIndex overnightIndex,
                double?fixedRate, Period fwdStart)
 {
     swapTenor_        = swapTenor;
     overnightIndex_   = overnightIndex;
     fixedRate_        = fixedRate;
     forwardStart_     = fwdStart;
     fixingDays_       = 2;
     paymentFrequency_ = Frequency.Annual;
     rule_             = DateGeneration.Rule.Backward;
     endOfMonth_       = (new Period(1, TimeUnit.Months) <= swapTenor && swapTenor <= new Period(2, TimeUnit.Years) ? true : false);
     type_             = OvernightIndexedSwap.Type.Payer;
     nominal_          = 1.0;
     overnightSpread_  = 0.0;
     fixedDayCount_    = overnightIndex.dayCounter();
     engine_           = new DiscountingSwapEngine(overnightIndex_.forwardingTermStructure());
 }
Пример #5
0
 public MakeOIS(Period swapTenor, OvernightIndex overnightIndex, double?fixedRate = null, Period fwdStart = null)
 {
     swapTenor_        = swapTenor;
     overnightIndex_   = overnightIndex;
     fixedRate_        = fixedRate;
     forwardStart_     = fwdStart ?? new Period(0, TimeUnit.Days);
     settlementDays_   = 2;
     calendar_         = overnightIndex.fixingCalendar();
     paymentFrequency_ = Frequency.Annual;
     rule_             = DateGeneration.Rule.Backward;
     // any value here for endOfMonth_ would not be actually used
     isDefaultEOM_    = true;
     type_            = OvernightIndexedSwap.Type.Payer;
     nominal_         = 1.0;
     overnightSpread_ = 0.0;
     fixedDayCount_   = overnightIndex.dayCounter();
 }
Пример #6
0
 public MakeOIS(Period swapTenor, OvernightIndex overnightIndex,
              double? fixedRate, Period fwdStart)
 {
     swapTenor_=swapTenor;
      overnightIndex_ = overnightIndex;
      fixedRate_= fixedRate;
      forwardStart_= fwdStart;
      fixingDays_ = 2;
      paymentFrequency_ = Frequency.Annual;
      rule_ = DateGeneration.Rule.Backward;
      endOfMonth_ = (new Period(1,TimeUnit.Months)<=swapTenor && swapTenor<=new Period(2,TimeUnit.Years) ? true : false);
      type_ = OvernightIndexedSwap.Type.Payer;
      nominal_ = 1.0;
      overnightSpread_ = 0.0;
      fixedDayCount_ = overnightIndex.dayCounter();
      engine_ = new DiscountingSwapEngine(overnightIndex_.forwardingTermStructure());
 }
Пример #7
0
 public MakeOIS(Period swapTenor, OvernightIndex overnightIndex, double?fixedRate = null, Period fwdStart = null)
 {
     swapTenor_        = swapTenor;
     overnightIndex_   = overnightIndex;
     fixedRate_        = fixedRate;
     forwardStart_     = fwdStart ?? new Period(0, TimeUnit.Days);
     settlementDays_   = 2;
     calendar_         = overnightIndex.fixingCalendar();
     paymentFrequency_ = Frequency.Annual;
     rule_             = DateGeneration.Rule.Backward;
     // any value here for endOfMonth_ would not be actually used
     isDefaultEOM_ = true;
     //endOfMonth_ = (new Period(1,TimeUnit.Months)<=swapTenor && swapTenor<=new Period(2,TimeUnit.Years) ? true : false);
     type_            = OvernightIndexedSwap.Type.Payer;
     nominal_         = 1.0;
     overnightSpread_ = 0.0;
     fixedDayCount_   = overnightIndex.dayCounter();
     //engine_ = new DiscountingSwapEngine(overnightIndex_.forwardingTermStructure());
 }
Пример #8
0
 public CommonVars()
 {
     type                    = OvernightIndexedSwap.Type.Payer;
     settlementDays          = 2;
     nominal                 = 100.0;
     fixedEoniaConvention    = BusinessDayConvention.ModifiedFollowing;
     floatingEoniaConvention = BusinessDayConvention.ModifiedFollowing;
     fixedEoniaPeriod        = new Period(1, TimeUnit.Years);
     floatingEoniaPeriod     = new Period(1, TimeUnit.Years);
     fixedEoniaDayCount      = new Actual360();
     eoniaIndex              = new Eonia(eoniaTermStructure);
     fixedSwapConvention     = BusinessDayConvention.ModifiedFollowing;
     fixedSwapFrequency      = Frequency.Annual;
     fixedSwapDayCount       = new Thirty360();
     swapIndex               = (IborIndex) new Euribor3M(swapTermStructure);
     calendar                = eoniaIndex.fixingCalendar();
     today                   = new Date(5, Month.February, 2009);
     //today = calendar.adjust(Date::todaysDate());
     Settings.setEvaluationDate(today);
     settlement = calendar.advance(today, new Period(settlementDays, TimeUnit.Days), BusinessDayConvention.Following);
     eoniaTermStructure.linkTo(Utilities.flatRate(settlement, 0.05, new Actual365Fixed()));
 }
Пример #9
0
 public MakeOIS withType(OvernightIndexedSwap.Type type)
 {
     type_ = type;
     return(this);
 }
Пример #10
0
 public MakeOIS receiveFixed(bool flag = true)
 {
     type_ = flag ? OvernightIndexedSwap.Type.Receiver : OvernightIndexedSwap.Type.Payer;
     return(this);
 }
Пример #11
0
 public MakeOIS withType(OvernightIndexedSwap.Type type) 
 {
    type_ = type;
    return this;
 }
Пример #12
0
 public MakeOIS receiveFixed(bool flag) 
 {
   type_ = flag ? OvernightIndexedSwap.Type.Receiver : OvernightIndexedSwap.Type.Payer ;
   return this;
 }
Пример #13
0
 public CommonVars()
 {
     type = OvernightIndexedSwap.Type.Payer;
     settlementDays = 2;
     nominal = 100.0;
     fixedEoniaConvention = BusinessDayConvention.ModifiedFollowing;
     floatingEoniaConvention = BusinessDayConvention.ModifiedFollowing;
     fixedEoniaPeriod = new Period(1, TimeUnit.Years);
     floatingEoniaPeriod = new Period(1, TimeUnit.Years);
     fixedEoniaDayCount = new Actual360();
     eoniaIndex = new Eonia(eoniaTermStructure);
     fixedSwapConvention = BusinessDayConvention.ModifiedFollowing;
     fixedSwapFrequency = Frequency.Annual;
     fixedSwapDayCount = new Thirty360();
     swapIndex = (IborIndex) new Euribor3M(swapTermStructure);
     calendar = eoniaIndex.fixingCalendar();
     today = new Date(5, Month.February, 2009);
     //today = calendar.adjust(Date::todaysDate());
     Settings.setEvaluationDate(today);
     settlement = calendar.advance(today,new Period(settlementDays,TimeUnit.Days),BusinessDayConvention.Following);
     eoniaTermStructure.linkTo(Utilities.flatRate(settlement, 0.05,new Actual365Fixed()));
 }