本文整理汇总了C#中BusinessDayConvention类的典型用法代码示例。如果您正苦于以下问题:C# BusinessDayConvention类的具体用法?C# BusinessDayConvention怎么用?C# BusinessDayConvention使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BusinessDayConvention类属于命名空间,在下文中一共展示了BusinessDayConvention类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: FloatingRateBond
public FloatingRateBond(int settlementDays, double faceAmount, Schedule schedule, IborIndex index,
DayCounter paymentDayCounter, BusinessDayConvention paymentConvention, int fixingDays,
List<double> gearings, List<double> spreads)
: this(settlementDays, faceAmount, schedule, index, paymentDayCounter, BusinessDayConvention.Following,
fixingDays, gearings, spreads, new List<double>(), new List<double>(), false, 100, null)
{
}
开发者ID:ariesy,项目名称:QLNet,代码行数:7,代码来源:FloatingRateBond.cs
示例2: FixedRateBond
//! fixed-rate bond
/*! \ingroup instruments
\test calculations are tested by checking results against
cached values.
*/
//! simple annual compounding coupon rates
public FixedRateBond(int settlementDays, double faceAmount, Schedule schedule,List<double> coupons,
DayCounter accrualDayCounter, BusinessDayConvention paymentConvention = BusinessDayConvention.Following,
double redemption = 100, Date issueDate = null,Calendar paymentCalendar = null,
Period exCouponPeriod = null,
Calendar exCouponCalendar = null,
BusinessDayConvention exCouponConvention = BusinessDayConvention.Unadjusted,
bool exCouponEndOfMonth = false)
: base(settlementDays, paymentCalendar == null ? schedule.calendar() : paymentCalendar,
issueDate)
{
frequency_ = schedule.tenor().frequency();
dayCounter_ = accrualDayCounter;
maturityDate_ = schedule.endDate();
cashflows_ = new FixedRateLeg(schedule)
.withCouponRates(coupons, accrualDayCounter)
.withExCouponPeriod(exCouponPeriod,
exCouponCalendar,
exCouponConvention,
exCouponEndOfMonth)
.withPaymentCalendar(calendar_)
.withNotionals(faceAmount)
.withPaymentAdjustment(paymentConvention);
addRedemptionsToCashflows(new List<double>() { redemption });
if (cashflows().Count == 0)
throw new ApplicationException("bond with no cashflows!");
if (redemptions_.Count != 1)
throw new ApplicationException("multiple redemptions created");
}
开发者ID:akasolace,项目名称:qlnet,代码行数:41,代码来源:Fixedratebond.cs
示例3: FixedRateBond
public FixedRateBond(int settlementDays, double faceAmount, Schedule schedule,
List<double> coupons, DayCounter accrualDayCounter,
BusinessDayConvention paymentConvention, double redemption, Date issueDate)
: this(settlementDays, faceAmount, schedule, coupons, accrualDayCounter,
paymentConvention, redemption, issueDate, new Calendar())
{
}
开发者ID:ammachado,项目名称:QLNet,代码行数:7,代码来源:Fixedratebond.cs
示例4: SwaptionVolatilityDiscrete
public SwaptionVolatilityDiscrete(List<Period> optionTenors,
List<Period> swapTenors,
Date referenceDate,
Calendar cal,
BusinessDayConvention bdc,
DayCounter dc)
: base(referenceDate, cal, bdc, dc)
{
nOptionTenors_ = optionTenors.Count;
optionTenors_ = optionTenors;
optionDates_ = new InitializedList<Date>(nOptionTenors_);
optionTimes_ = new InitializedList<double>(nOptionTenors_);
optionDatesAsReal_ = new InitializedList<double>(nOptionTenors_);
nSwapTenors_ = swapTenors.Count;
swapTenors_ = swapTenors;
swapLengths_ = new InitializedList<double>(nSwapTenors_);
checkOptionTenors();
initializeOptionDatesAndTimes();
checkSwapTenors();
initializeSwapLengths();
optionInterpolator_ = new LinearInterpolation(optionTimes_,
optionTimes_.Count,
optionDatesAsReal_);
optionInterpolator_.update();
optionInterpolator_.enableExtrapolation();
}
开发者ID:akasolace,项目名称:qlnet,代码行数:30,代码来源:swaptionvoldiscrete.cs
示例5: FloatingRateBond
public FloatingRateBond(int settlementDays, double faceAmount, Schedule schedule, IborIndex index, DayCounter paymentDayCounter,
BusinessDayConvention paymentConvention, int fixingDays, List<double> gearings, List<double> spreads,
List<double> caps, List<double> floors, bool inArrears, double redemption, Date issueDate)
: base(settlementDays, schedule.calendar(), issueDate) {
maturityDate_ = schedule.endDate();
cashflows_ = new IborLeg(schedule, index)
.withPaymentDayCounter(paymentDayCounter)
.withFixingDays(fixingDays)
.withGearings(gearings)
.withSpreads(spreads)
.withCaps(caps)
.withFloors(floors)
.inArrears(inArrears)
.withNotionals(faceAmount)
.withPaymentAdjustment(paymentConvention);
addRedemptionsToCashflows(new List<double>() { redemption });
if (cashflows().Count == 0)
throw new ApplicationException("bond with no cashflows!");
if (redemptions_.Count != 1)
throw new ApplicationException("multiple redemptions created");
index.registerWith(update);
}
开发者ID:akasolace,项目名称:qlnet,代码行数:25,代码来源:FloatingRateBond.cs
示例6: AmortizingFixedRateBond
public AmortizingFixedRateBond(
int settlementDays,
List<double> notionals,
Schedule schedule,
List<double> coupons,
DayCounter accrualDayCounter,
BusinessDayConvention paymentConvention = BusinessDayConvention.Following,
Date issueDate = null)
:base(settlementDays, schedule.calendar(), issueDate)
{
frequency_ = schedule.tenor().frequency();
dayCounter_ = accrualDayCounter;
schedule_ = schedule;
maturityDate_ = schedule.endDate();
cashflows_ = new FixedRateLeg(schedule)
.withCouponRates(coupons, accrualDayCounter)
.withNotionals(notionals)
.withPaymentAdjustment(paymentConvention).value();
addRedemptionsToCashflows();
if ( cashflows().empty())
throw new ApplicationException("bond with no cashflows!");
}
开发者ID:akasolace,项目名称:qlnet,代码行数:27,代码来源:AmortizingFixedRateBond.cs
示例7: SwapRateHelper
public SwapRateHelper(double rate, Period tenor, Calendar calendar,
Frequency fixedFrequency, BusinessDayConvention fixedConvention, DayCounter fixedDayCount,
IborIndex iborIndex)
: this(rate, tenor, calendar, fixedFrequency, fixedConvention, fixedDayCount, iborIndex,
new Handle<Quote>(), new Period(0, TimeUnit.Days))
{
}
开发者ID:StreetConnect,项目名称:QLNet,代码行数:7,代码来源:SwapRateHelper.cs
示例8: ZeroCouponBond
public ZeroCouponBond(int settlementDays, Calendar calendar, double faceAmount, Date maturityDate, BusinessDayConvention paymentConvention, double redemption, Date issueDate)
: base(settlementDays, calendar, issueDate)
{
maturityDate_ = maturityDate;
Date redemptionDate = calendar_.adjust(maturityDate, paymentConvention);
setSingleRedemption(faceAmount, redemption, redemptionDate);
}
开发者ID:ammachado,项目名称:QLNet,代码行数:7,代码来源:Zerocouponbond.cs
示例9: ConstantOptionletVolatility
//! floating reference date, floating market data
public ConstantOptionletVolatility(int settlementDays, Calendar cal, BusinessDayConvention bdc,
Handle<Quote> vol, DayCounter dc)
: base(settlementDays, cal, bdc, dc)
{
volatility_ = vol;
volatility_.registerWith(update);
}
开发者ID:akasolace,项目名称:qlnet,代码行数:9,代码来源:ConstantOptionletVolatility.cs
示例10: withExCouponPeriod
public CPILegBase withExCouponPeriod(Period period, Calendar cal, BusinessDayConvention convention, bool endOfMonth = false)
{
exCouponPeriod_ = period;
exCouponCalendar_ = cal;
exCouponAdjustment_ = convention;
exCouponEndOfMonth_ = endOfMonth;
return this;
}
开发者ID:Yenyenx,项目名称:qlnet,代码行数:8,代码来源:RateLegBase.cs
示例11: IborIndex
public IborIndex(string familyName, Period tenor, int settlementDays, Currency currency,
Calendar fixingCalendar, BusinessDayConvention convention, bool endOfMonth,
DayCounter dayCounter)
: this(familyName, tenor, settlementDays, currency,
fixingCalendar, convention, endOfMonth,
dayCounter, new Handle<YieldTermStructure>())
{
}
开发者ID:Yenyenx,项目名称:qlnet,代码行数:8,代码来源:IBORIndex.cs
示例12: DepositRateHelper
public DepositRateHelper(double rate, Period tenor, int fixingDays, Calendar calendar,
BusinessDayConvention convention, bool endOfMonth, DayCounter dayCounter)
: base(rate)
{
iborIndex_ = new IborIndex("no-fix", tenor, fixingDays, new Currency(), calendar, convention,
endOfMonth, dayCounter, termStructureHandle_);
initializeDates();
}
开发者ID:StreetConnect,项目名称:QLNet,代码行数:8,代码来源:DepositRateHelper.cs
示例13: ConstantCapFloorTermVolatility
// fixed reference date, fixed market data
public ConstantCapFloorTermVolatility(Date referenceDate,
Calendar cal,
BusinessDayConvention bdc,
double volatility,
DayCounter dc)
: base(referenceDate, cal, bdc, dc)
{
volatility_ = new Handle<Quote>(new SimpleQuote(volatility));
}
开发者ID:Yenyenx,项目名称:qlnet,代码行数:10,代码来源:ConstantCapFloorTermVolatility.cs
示例14: FixedRateBondHelper
//public FixedRateBondHelper(Quote cleanPrice, int settlementDays, double faceAmount, Schedule schedule,
// List<double> coupons, DayCounter dayCounter,
// BusinessDayConvention paymentConv = Following,
// double redemption = 100.0,
// Date issueDate = null);
public FixedRateBondHelper(Handle<Quote> cleanPrice, int settlementDays, double faceAmount, Schedule schedule,
List<double> coupons, DayCounter dayCounter, BusinessDayConvention paymentConvention,
double redemption, Date issueDate)
: base(cleanPrice, new FixedRateBond(settlementDays, faceAmount, schedule,
coupons, dayCounter, paymentConvention,
redemption, issueDate)) {
fixedRateBond_ = bond_ as FixedRateBond;
}
开发者ID:minikie,项目名称:OTCDerivativesCalculatorModule,代码行数:14,代码来源:Bondhelpers.cs
示例15: ConstantSwaptionVolatility
//! fixed reference date, fixed market data
public ConstantSwaptionVolatility( Date referenceDate,
Calendar cal,
BusinessDayConvention bdc,
double vol,
DayCounter dc)
: base(referenceDate, cal, bdc, dc)
{
volatility_ = new Handle<Quote>(new SimpleQuote(vol));
maxSwapTenor_ = new Period(100, TimeUnit.Years);
}
开发者ID:akasolace,项目名称:qlnet,代码行数:11,代码来源:swaptionconstantvol.cs
示例16: MakeSwaption
public MakeSwaption(SwapIndex swapIndex,
Period optionTenor,
double strike)
{
swapIndex_ = swapIndex;
delivery_ = Settlement.Type.Physical;
optionTenor_ = optionTenor;
optionConvention_ = BusinessDayConvention.ModifiedFollowing;
strike_ = strike;
}
开发者ID:ariesy,项目名称:QLNet,代码行数:10,代码来源:Makeswaption.cs
示例17: FRARateHelper
public FRARateHelper(double rate, int monthsToStart, int monthsToEnd, int fixingDays, Calendar calendar,
BusinessDayConvention convention, bool endOfMonth, DayCounter dayCounter)
: base(rate)
{
periodToStart_ = new Period(monthsToStart, TimeUnit.Months);
if (!(monthsToEnd > monthsToStart)) throw new ArgumentException("monthsToEnd must be grater than monthsToStart");
iborIndex_ = new IborIndex("no-fix", new Period(monthsToEnd - monthsToStart, TimeUnit.Months), fixingDays,
new Currency(), calendar, convention, endOfMonth, dayCounter, termStructureHandle_);
initializeDates();
}
开发者ID:ammachado,项目名称:QLNet,代码行数:11,代码来源:FRARateHelper.cs
示例18: NPV
//! \name Constructors
/*! If strike is given in the constructor, can calculate the
NPV of the contract via NPV().
If strike/forward price is desired, it can be obtained via
forwardPrice(). In this case, the strike variable in the
constructor is irrelevant and will be ignored.
*/
//@{
//Handle<YieldTermStructure> discountCurve = Handle<YieldTermStructure>(),
//Handle<YieldTermStructure> incomeDiscountCurve = Handle<YieldTermStructure>());
public FixedRateBondForward(Date valueDate, Date maturityDate, Position.Type type, double strike, int settlementDays,
DayCounter dayCounter, Calendar calendar, BusinessDayConvention businessDayConvention,
FixedRateBond fixedCouponBond,
Handle<YieldTermStructure> discountCurve,
Handle<YieldTermStructure> incomeDiscountCurve)
: base(dayCounter, calendar, businessDayConvention, settlementDays, new ForwardTypePayoff(type, strike),
valueDate, maturityDate, discountCurve) {
fixedCouponBond_ = fixedCouponBond;
incomeDiscountCurve_ = incomeDiscountCurve;
incomeDiscountCurve_.registerWith(update);
}
开发者ID:akasolace,项目名称:qlnet,代码行数:22,代码来源:fixedratebondforward.cs
示例19: BasisSwap
public BasisSwap(Type type, double nominal,
Schedule float1Schedule, IborIndex iborIndex1, double spread1, DayCounter float1DayCount,
Schedule float2Schedule, IborIndex iborIndex2, double spread2, DayCounter float2DayCount,
BusinessDayConvention? paymentConvention) :
base(2)
{
type_ = type;
nominal_ = nominal;
floating1Schedule_ = float1Schedule;
spread1_ = spread1;
floating1DayCount_ = float1DayCount;
iborIndex1_ = iborIndex1;
floating2Schedule_ = float2Schedule;
spread2_ = spread2;
floating2DayCount_ = float2DayCount;
iborIndex2_ = iborIndex2;
if (paymentConvention.HasValue)
paymentConvention_ = paymentConvention.Value;
else
paymentConvention_ = floating1Schedule_.businessDayConvention();
List<CashFlow> floating1Leg = new IborLeg(float1Schedule, iborIndex1)
.withPaymentDayCounter(float1DayCount)
.withSpreads(spread1)
.withNotionals(nominal)
.withPaymentAdjustment(paymentConvention_);
List<CashFlow> floating2Leg = new IborLeg(float2Schedule, iborIndex2)
.withPaymentDayCounter(float2DayCount)
.withSpreads(spread2)
.withNotionals(nominal)
.withPaymentAdjustment(paymentConvention_);
foreach (var cf in floating1Leg)
cf.registerWith(update);
foreach (var cf in floating2Leg)
cf.registerWith(update);
legs_[0] = floating1Leg;
legs_[1] = floating2Leg;
if (type_ == Type.Payer)
{
payer_[0] = -1;
payer_[1] = +1;
}
else
{
payer_[0] = +1;
payer_[1] = -1;
}
}
开发者ID:minikie,项目名称:OTCDerivativesCalculatorModule,代码行数:53,代码来源:BasisSwap.cs
示例20: IborIndex
public IborIndex(string familyName, Period tenor, int settlementDays, Currency currency,
Calendar fixingCalendar, BusinessDayConvention convention, bool endOfMonth,
DayCounter dayCounter, Handle<YieldTermStructure> h) :
base(familyName, tenor, settlementDays, currency, fixingCalendar, dayCounter) {
convention_ = convention;
termStructure_ = h;
endOfMonth_ = endOfMonth;
// observer interface
if (!termStructure_.empty())
termStructure_.registerWith(update);
}
开发者ID:akasolace,项目名称:qlnet,代码行数:12,代码来源:IBORIndex.cs
注:本文中的BusinessDayConvention类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论