Skip to content

Commit

Permalink
Update to QLNet-1.9.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
amaggiulli committed Jan 19, 2017
2 parents fdc656b + 949cb7d commit 0a5428c
Show file tree
Hide file tree
Showing 120 changed files with 17,718 additions and 1,764 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
TestResults
obj
bin
.vs
*.user
*.suo
*.tss
1,025 changes: 415 additions & 610 deletions ChangeLog.txt

Large diffs are not rendered by default.

594 changes: 297 additions & 297 deletions Examples/BermudanSwaption/BermudanSwaption.cs

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Examples/BermudanSwaption/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct( "QLNet Examples" )]
[assembly: AssemblyCopyright( "Copyright (c) 2008-2016 Andrea Maggiulli (a.maggiulli@gmail.com)" )]
[assembly: AssemblyCopyright( "Copyright (c) 2008-2017 Andrea Maggiulli (a.maggiulli@gmail.com)" )]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// È possibile specificare tutti i valori oppure impostare i valori predefiniti per i numeri relativi alla build e alla revisione
// utilizzando l'asterisco (*) come descritto di seguito:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.8.0.0")]
[assembly: AssemblyFileVersion("1.8.0.0")]
[assembly: AssemblyVersion("1.9.0.0")]
[assembly: AssemblyFileVersion("1.9.0.0")]
6 changes: 3 additions & 3 deletions Examples/Bonds/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct( "QLNet Examples" )]
[assembly: AssemblyCopyright( "Copyright (c) 2008-2016 Andrea Maggiulli (a.maggiulli@gmail.com)" )]
[assembly: AssemblyCopyright( "Copyright (c) 2008-2017 Andrea Maggiulli (a.maggiulli@gmail.com)" )]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.8.0.0")]
[assembly: AssemblyFileVersion("1.8.0.0")]
[assembly: AssemblyVersion("1.9.0.0")]
[assembly: AssemblyFileVersion("1.9.0.0")]
6 changes: 3 additions & 3 deletions Examples/CVAIRS/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration( "" )]
[assembly: AssemblyCompany( "" )]
[assembly: AssemblyProduct( "QLNet Examples" )]
[assembly: AssemblyCopyright( "Copyright (c) 2008-2016 Andrea Maggiulli (a.maggiulli@gmail.com)" )]
[assembly: AssemblyCopyright( "Copyright (c) 2008-2017 Andrea Maggiulli (a.maggiulli@gmail.com)" )]
[assembly: AssemblyTrademark( "" )]
[assembly: AssemblyCulture( "" )]

Expand All @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion( "1.8.0.0" )]
[assembly: AssemblyFileVersion( "1.8.0.0" )]
[assembly: AssemblyVersion( "1.9.0.0" )]
[assembly: AssemblyFileVersion( "1.9.0.0" )]
6 changes: 3 additions & 3 deletions Examples/CallableBonds/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct( "QLNet Examples" )]
[assembly: AssemblyCopyright( "Copyright (c) 2008-2016 Andrea Maggiulli (a.maggiulli@gmail.com)" )]
[assembly: AssemblyCopyright( "Copyright (c) 2008-2017 Andrea Maggiulli (a.maggiulli@gmail.com)" )]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// È possibile specificare tutti i valori oppure impostare valori predefiniti per i numeri relativi alla revisione e alla build
// utilizzando l'asterisco (*) come descritto di seguito:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.8.0.0")]
[assembly: AssemblyFileVersion("1.8.0.0")]
[assembly: AssemblyVersion("1.9.0.0")]
[assembly: AssemblyFileVersion("1.9.0.0")]
6 changes: 3 additions & 3 deletions Examples/EquityOption/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct( "QLNet Examples" )]
[assembly: AssemblyCopyright( "Copyright (c) 2008-2016 Andrea Maggiulli (a.maggiulli@gmail.com)" )]
[assembly: AssemblyCopyright( "Copyright (c) 2008-2017 Andrea Maggiulli (a.maggiulli@gmail.com)" )]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.7.0.0")]
[assembly: AssemblyFileVersion("1.7.0.0")]
[assembly: AssemblyVersion("1.9.0.0")]
[assembly: AssemblyFileVersion("1.9.0.0")]
6 changes: 3 additions & 3 deletions Examples/FRA/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct( "QLNet Examples" )]
[assembly: AssemblyCopyright( "Copyright (c) 2008-2016 Andrea Maggiulli (a.maggiulli@gmail.com)" )]
[assembly: AssemblyCopyright( "Copyright (c) 2008-2017 Andrea Maggiulli (a.maggiulli@gmail.com)" )]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// È possibile specificare tutti i valori oppure impostare i valori predefiniti per i numeri relativi alla build e alla revisione
// utilizzando l'asterisco (*) come descritto di seguito:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.7.0.0")]
[assembly: AssemblyFileVersion("1.7.0.0")]
[assembly: AssemblyVersion("1.9.0.0")]
[assembly: AssemblyFileVersion("1.9.0.0")]
6 changes: 3 additions & 3 deletions Examples/FittedBondCurve/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration( "" )]
[assembly: AssemblyCompany( "" )]
[assembly: AssemblyProduct( "QLNet Examples" )]
[assembly: AssemblyCopyright( "Copyright (c) 2008-2016 Andrea Maggiulli (a.maggiulli@gmail.com)" )]
[assembly: AssemblyCopyright( "Copyright (c) 2008-2017 Andrea Maggiulli (a.maggiulli@gmail.com)" )]
[assembly: AssemblyTrademark( "" )]
[assembly: AssemblyCulture( "" )]

Expand All @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion( "1.7.0.0" )]
[assembly: AssemblyFileVersion( "1.7.0.0" )]
[assembly: AssemblyVersion( "1.9.0.0" )]
[assembly: AssemblyFileVersion( "1.9.0.0" )]
6 changes: 3 additions & 3 deletions Examples/Repo/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct( "QLNet Examples" )]
[assembly: AssemblyCopyright( "Copyright (c) 2008-2016 Andrea Maggiulli (a.maggiulli@gmail.com)" )]
[assembly: AssemblyCopyright( "Copyright (c) 2008-2017 Andrea Maggiulli (a.maggiulli@gmail.com)" )]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.7.0.0")]
[assembly: AssemblyFileVersion("1.7.0.0")]
[assembly: AssemblyVersion("1.9.0.0")]
[assembly: AssemblyFileVersion("1.9.0.0")]
6 changes: 3 additions & 3 deletions Examples/Swap/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct( "QLNet Examples" )]
[assembly: AssemblyCopyright( "Copyright (c) 2008-2016 Andrea Maggiulli (a.maggiulli@gmail.com)" )]
[assembly: AssemblyCopyright( "Copyright (c) 2008-2017 Andrea Maggiulli (a.maggiulli@gmail.com)" )]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]

Expand All @@ -32,5 +32,5 @@
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.7.0.0")]
[assembly: AssemblyFileVersion("1.7.0.0")]
[assembly: AssemblyVersion("1.9.0.0")]
[assembly: AssemblyFileVersion("1.9.0.0")]
71 changes: 52 additions & 19 deletions News.txt
Original file line number Diff line number Diff line change
@@ -1,42 +1,75 @@
QLNet 1.8
QLNet 1.9
=========================

QLNet 1.8 stable version.
QLNet 1.9 stable version.

The most notable changes are included below.
A detailed list of changes is available in ChangeLog.txt.

FRAMEWORK

+ Refactored code to be compatible with .NET Core , created VS 2015 solution QLNet_Core.sln
that build the .NET Core version.

+ Refactored test project to work with Microsoft UnitTesting and Xunit.
+ Refactoring & Update BlackScholesProcess, LocalVolCurve, bsmlattice
+ Optimized npvbps calculation
+ List and InitializedList refactoring

INTEREST RATES
CASHFLOWS

+ Fixed links to documentation for LIBOR indexes.
+ Fixed CappedFlooredCoupon factory

INSTRUMENTS

+ Added basic CVA IRS pricing engine.
+ Added CompositeInstrument.
+ Added DividendBarrierOption.
+ Added ForwardVanillaOption.
+ Added LookbackOption.
+ Added CMS Helper.
+ Added BarrierOption.
+ Added Cliquet Option.
+ Added DoubleBarrier Option.
+ Added CPICapFloor.
+ Added CPISwap.

CURRENCIES
DATE/TIME

+ Added Ukrainian hryvnia.
+ Added ECB dates for 2017.
+ Fixed rule for the Japanese Mountain Day holiday.
+ Fixed United States holidays before 1971.

DATE/TIME
INDEXES

+ Added new Ukrainian holiday, Defender's Day.
+ Added Ibor indexes : Aonia , Bbsw, Bkbm and Nzocr.

MATH

+ Added mixed log interpolation.
+ Added FlatExtrapolator2D
+ Added BackwardflatLinear Interpolation.
+ Added AbcdInterpolation.
+ Implemented Lagrange boundary condition for cubic interpolation
+ Added Matrix inverse calculation with Crout's LU decomposition.
+ Added VannaVolga Interpolation.

TERMSTRUCTURES

+ Added Swaption volatility cube.
+ Allow negative jumps in yield term structures.

PRICING ENGINES

+ Added CounterpartyAdjSwapEngine engine with example program.
+ Added ForwardVanillaEngine engine.
+ Added AnalyticContinuousFixedLookbackEngine engine.
+ Added AnalyticContinuousFloatingLookbackEngine engine.
+ Added AnalyticContinuousPartialFixedLookbackEngine engine.
+ Added AnalyticContinuousPartialFloatingLookbackEngine engine.
+ Added AnalyticBinaryBarrierEngine.
+ Added AnalyticCliquetEngine.
+ Added AnalyticPerformanceEngine.
+ Added BlackDeltaCalculator and DeltaVolQuote.
+ Added VannaVolga BarrierEngine.
+ Added AnalyticDoubleBarrierEngine.
+ Added VannaVolgaDoubleBarrierEngine.
+ Added WulinYongDoubleBarrierEngine.
+ Added InterpolatingCPICapFloorEngine.

TESTS

+ Added theta pertubation in AmericanOption & DividendOption tests.
+ Added tests for China SSE and IB calendars and a missing Chinese holiday
+ Added Test : Chambers-Nawalkha implied vol approximation
+ Added CapFloored coupon tests.
+ Added Digital Coupon tests.
4 changes: 2 additions & 2 deletions QLNet/Cashflows/CappedFlooredCoupon.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
Copyright (C) 2008 Toyin Akin (toyin_akin@hotmail.com)
Copyright (C) 2009 Siarhei Novik (snovik@gmail.com)
Copyright (C) 2008, 2009 , 2010 Andrea Maggiulli (a.maggiulli@gmail.com)
Copyright (C) 2008-2016 Andrea Maggiulli (a.maggiulli@gmail.com)
This file is part of QLNet Project https://github.com/amaggiulli/qlnet
Expand Down Expand Up @@ -165,7 +165,7 @@ public override void setPricer(FloatingRateCouponPricer pricer)
// Factory - for Leg generators
public virtual CashFlow factory(double nominal, Date paymentDate, Date startDate, Date endDate, int fixingDays, InterestRateIndex index, double gearing, double spread, double? cap, double? floor, Date refPeriodStart, Date refPeriodEnd, DayCounter dayCounter, bool isInArrears)
{
return new CappedFlooredCoupon( new FloatingRateCoupon( paymentDate, nominal, startDate, endDate, fixingDays, index, gearing, spread, refPeriodStart, refPeriodEnd, dayCounter, isInArrears ), cap, floor );
return new CappedFlooredCoupon( new IborCoupon( paymentDate, nominal, startDate, endDate, fixingDays, (IborIndex )index, gearing, spread, refPeriodStart, refPeriodEnd, dayCounter, isInArrears ), cap, floor );
}
}

Expand Down
18 changes: 10 additions & 8 deletions QLNet/Cashflows/CashFlows.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/*
Copyright (C) 2008, 2009 Siarhei Novik (snovik@gmail.com)
Copyright (C) 2008-2013 Andrea Maggiulli (a.maggiulli@gmail.com)
Copyright (C) 2008-2016 Andrea Maggiulli (a.maggiulli@gmail.com)
This file is part of QLNet Project https://github.com/amaggiulli/qlnet
Expand Down Expand Up @@ -360,9 +360,9 @@ public BPSCalculator(YieldTermStructure discountCurve)
// visitor classes should implement the generic visit method in the following form
public void visit(object o)
{
Type[] types = new Type[] { o.GetType() };
Type[] types = new Type[] { o.GetType() };
MethodInfo methodInfo = Utils.GetMethodInfo( this, "visit", types );


if (methodInfo != null) {
methodInfo.Invoke(this, new object[] { o });
}
Expand Down Expand Up @@ -726,27 +726,29 @@ public static double bps(Leg leg, YieldTermStructure discountCurve, bool include
public static void npvbps(Leg leg,YieldTermStructure discountCurve, bool includeSettlementDateFlows,
Date settlementDate, Date npvDate, out double npv,out double bps)
{
npv = 0.0;
npv = bps = 0.0;
if (leg.empty())
{
bps = 0.0;
return;
}

BPSCalculator calc = new BPSCalculator(discountCurve);
for (int i=0; i<leg.Count; ++i)
{
CashFlow cf = leg[i];
if (!cf.hasOccurred(settlementDate, includeSettlementDateFlows) &&
!cf.tradingExCoupon(settlementDate))
{
npv += cf.amount() * discountCurve.discount(cf.date());
cf.accept(calc);
Coupon cp = leg[i] as Coupon;
double df = discountCurve.discount( cf.date() );
npv += cf.amount() * df;
if ( cp != null )
bps += cp.nominal() * cp.accrualPeriod() * df;
}
}
double d = discountCurve.discount(npvDate);
npv /= d;
bps = basisPoint_ * calc.bps() / d;
bps = basisPoint_ * bps / d;
}

// At-the-money rate of the cash flows.
Expand Down
Loading

0 comments on commit 0a5428c

Please sign in to comment.