Skip to content

Commit

Permalink
Finish QLNet-v1.10.0
Browse files Browse the repository at this point in the history
  • Loading branch information
amaggiulli committed Oct 30, 2017
2 parents 4cb47c8 + bff1913 commit cc527d0
Show file tree
Hide file tree
Showing 17 changed files with 1,493 additions and 3,325 deletions.
4,711 changes: 1,423 additions & 3,288 deletions ChangeLog.txt

Large diffs are not rendered by default.

44 changes: 32 additions & 12 deletions News.txt
Original file line number Diff line number Diff line change
@@ -1,28 +1,48 @@
QLNet 1.9.2
QLNet 1.10.0
=========================

QLNet 1.9.2 stable version.
QLNet 1.10.0 stable version.

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

ENGINES

+ Added DiscountingLoanEngine
+ Updated Swaption Engine
+ Added IsdaCdsEngine, InterpolatedSurvivalProbabilityCurve and SurvivalProbabilityStructure with test
+ Added AnalyticDoubleBarrierBinaryEngine and BinomialDoubleBarrierEngine
+ Added HW swaption engine

FRAMEWORK

+ Fixed floating point numbers equality.
+ Added FastActivator to avoid new() on generic classes
+ Project updated to Visual Studio 2017 new .csproj model.
+ General project refactoring
+ Removed "System.Exception" thrown by user code.
+ Updated documentation to standard XML format
+ Updated to net standard 2.0
+ Several bug fixes

TERMSTRUCTURES

+ Added HestonBlackVolSurface
+ Added Interpolated YoY Inflation Curve
+ Added normal volatility interpolation to SABR

INDEXES
TIME

+ Fixed inflation index reference period
+ Updated Schedule for CDS2015 with test.
+ Updated Actual360 daycounter to include/exclude last day

INSTRUMENTS

+ Added normal implied vol cap floor
+ Added Bachelier volatility for CapFloor
+ Add gearing interface for CMS and Floating legs
+ Swaption instrument update
+ Updated bonds constructors
+ Added Finite differences method
+ Updated CreditDefaultSwap + helper

MATH

+ Add SVI Interpolation class
+ Add shift to SABR & XABR

CASHFLOWS

+ Added LastPeriodDayCounter to FixedRateCoupon
2 changes: 1 addition & 1 deletion src/BermudanSwaption/BermudanSwaption.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>1.9.2</VersionPrefix>
<VersionPrefix>1.10.0</VersionPrefix>
<TargetFrameworks>net45</TargetFrameworks>
<DefineConstants>$(DefineConstants);QL_NEGATIVE_RATES</DefineConstants>
<AssemblyName>BermudanSwaption</AssemblyName>
Expand Down
2 changes: 1 addition & 1 deletion src/Bonds/Bonds.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>1.9.2</VersionPrefix>
<VersionPrefix>1.10.0</VersionPrefix>
<TargetFrameworks>net45</TargetFrameworks>
<DefineConstants>$(DefineConstants);QL_NEGATIVE_RATES</DefineConstants>
<AssemblyName>Bonds</AssemblyName>
Expand Down
2 changes: 1 addition & 1 deletion src/CVAIRS/CVAIRS.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>1.9.2</VersionPrefix>
<VersionPrefix>1.10.0</VersionPrefix>
<TargetFrameworks>net45</TargetFrameworks>
<DefineConstants>$(DefineConstants);QL_NEGATIVE_RATES</DefineConstants>
<AssemblyName>CVAIRS</AssemblyName>
Expand Down
2 changes: 1 addition & 1 deletion src/CallableBonds/CallableBonds.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>1.9.2</VersionPrefix>
<VersionPrefix>1.10.0</VersionPrefix>
<TargetFrameworks>net45</TargetFrameworks>
<DefineConstants>$(DefineConstants);QL_NEGATIVE_RATES</DefineConstants>
<AssemblyName>CallableBonds</AssemblyName>
Expand Down
2 changes: 1 addition & 1 deletion src/EquityOption/EquityOption.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>1.9.2</VersionPrefix>
<VersionPrefix>1.10.0</VersionPrefix>
<TargetFrameworks>net45</TargetFrameworks>
<DefineConstants>$(DefineConstants);QL_NEGATIVE_RATES</DefineConstants>
<AssemblyName>EquityOption</AssemblyName>
Expand Down
2 changes: 1 addition & 1 deletion src/FRA/FRA.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>1.9.2</VersionPrefix>
<VersionPrefix>1.10.0</VersionPrefix>
<TargetFrameworks>net45</TargetFrameworks>
<DefineConstants>$(DefineConstants);QL_NEGATIVE_RATES</DefineConstants>
<AssemblyName>FRA</AssemblyName>
Expand Down
2 changes: 1 addition & 1 deletion src/FittedBondCurve/FittedBondCurve.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>1.9.2</VersionPrefix>
<VersionPrefix>1.10.0</VersionPrefix>
<TargetFrameworks>net45</TargetFrameworks>
<DefineConstants>$(DefineConstants);QL_NEGATIVE_RATES</DefineConstants>
<AssemblyName>FittedBondCurve</AssemblyName>
Expand Down
4 changes: 2 additions & 2 deletions src/QLNet.Old/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@
//
// È possibile specificare tutti i valori o impostare come predefiniti i valori Numero revisione e Numero build
// utilizzando l'asterisco (*) come descritto di seguito:
[assembly: AssemblyVersion( "1.9.2.0" )]
[assembly: AssemblyFileVersion( "1.9.2.0" )]
[assembly: AssemblyVersion( "1.10.0.0" )]
[assembly: AssemblyFileVersion( "1.10.0.0" )]
10 changes: 6 additions & 4 deletions src/QLNet/Math/Interpolations/SviInterpolation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,15 +144,16 @@ public SviInterpolation(List<double> xBegin, // x = strikes
OptimizationMethod optMethod = null,
double errorAccept = 0.0020,
bool useMaxError = false,
int maxGuesses = 50)
int maxGuesses = 50,
List<double?> addParams = null)
{

impl_ = new XABRInterpolationImpl<SVISpecs>(
xBegin, size, yBegin, t, forward,
new List<double?>() { a, b, sigma, rho, m },
new List<bool>() { aIsFixed, bIsFixed, sigmaIsFixed, rhoIsFixed, mIsFixed },
vegaWeighted, endCriteria, optMethod, errorAccept, useMaxError,
maxGuesses);
maxGuesses, addParams);
coeffs_ = (impl_ as XABRInterpolationImpl<SVISpecs>).coeff_;
}
public double expiry() { return coeffs_.t_; }
Expand All @@ -178,7 +179,7 @@ public SVI(double t, double forward, double a, double b, double sigma, double rh
bool vegaWeighted = false,
EndCriteria endCriteria = null,
OptimizationMethod optMethod = null,
double errorAccept = 0.0020, bool useMaxError = false, int maxGuesses = 50)
double errorAccept = 0.0020, bool useMaxError = false, int maxGuesses = 50, List<double?> addParams = null)
{
t_ = t;
forward_ = forward;
Expand All @@ -198,6 +199,7 @@ public SVI(double t, double forward, double a, double b, double sigma, double rh
errorAccept_ = errorAccept;
useMaxError_ = useMaxError;
maxGuesses_ = maxGuesses;
addParams_ = addParams;
}

public Interpolation interpolate(List<double> xBegin, int xEnd, List<double> yBegin)
Expand All @@ -208,7 +210,6 @@ public Interpolation interpolate(List<double> xBegin, int xEnd, List<double> yBe
}
public const bool global = true;


private double t_;
private double forward_;
private double a_, b_, sigma_, rho_, m_;
Expand All @@ -219,5 +220,6 @@ public Interpolation interpolate(List<double> xBegin, int xEnd, List<double> yBe
private double errorAccept_;
private bool useMaxError_;
private int maxGuesses_;
private List<double?> addParams_;
}
}
6 changes: 3 additions & 3 deletions src/QLNet/QLNet.csproj
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>1.9.2</VersionPrefix>
<TargetFrameworks>net45;net40;netstandard1.6;netcoreapp1.1</TargetFrameworks>
<VersionPrefix>1.10.0</VersionPrefix>
<TargetFrameworks>net45;net40;netstandard2.0;netcoreapp1.1</TargetFrameworks>
<DefineConstants>$(DefineConstants);QL_NEGATIVE_RATES</DefineConstants>
<AssemblyName>QLNet</AssemblyName>
<PackageId>QLNet</PackageId>
Expand Down Expand Up @@ -30,7 +30,7 @@
<Reference Include="Microsoft.CSharp" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard1.6' ">
<ItemGroup Condition=" '$(TargetFramework)' == 'netstandard2.0' ">
<PackageReference Include="System.Reflection.Emit.Lightweight" Version="4.0.1" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,10 @@ public enum Extrapolation
private DayCounter dayCounter_;
private Date maxDate_;
private List<double> strikes_;
private List<double> times_;
private Matrix variances_;
private List<double> times_;
private List<Date> dates_;
private Matrix variances_;
private Matrix volatilities_;
private Interpolation2D varianceSurface_;
private Extrapolation lowerExtrapolation_, upperExtrapolation_;

Expand All @@ -64,7 +66,14 @@ public override Date maxDate()
public override double maxStrike()
{
return strikes_.Last();
}
}

//public accessors
public virtual List<double> strikes() { return strikes_; }
public virtual List<double> times() { return times_; }
public virtual List<Date> dates() { return dates_; }
public virtual Matrix volatilities() { return volatilities_; }
public virtual Matrix variances() { return variances_; }

// required for Handle
public BlackVarianceSurface() { }
Expand All @@ -83,7 +92,9 @@ public BlackVarianceSurface(Date referenceDate,
maxDate_ = dates.Last();
strikes_ = strikes;
lowerExtrapolation_ = lowerExtrapolation;
upperExtrapolation_ = upperExtrapolation;
upperExtrapolation_ = upperExtrapolation;
dates_ = dates;
volatilities_ = blackVolMatrix;

Utils.QL_REQUIRE(dates.Count == blackVolMatrix.columns(), () =>
"mismatch between date vector and vol matrix colums");
Expand Down
2 changes: 1 addition & 1 deletion src/Repo/Repo.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>1.9.2</VersionPrefix>
<VersionPrefix>1.10.0</VersionPrefix>
<TargetFrameworks>net45</TargetFrameworks>
<DefineConstants>$(DefineConstants);QL_NEGATIVE_RATES</DefineConstants>
<AssemblyName>Repo</AssemblyName>
Expand Down
2 changes: 1 addition & 1 deletion src/Swap/Swap.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>1.9.2</VersionPrefix>
<VersionPrefix>1.10.0</VersionPrefix>
<TargetFrameworks>net45</TargetFrameworks>
<DefineConstants>$(DefineConstants);QL_NEGATIVE_RATES</DefineConstants>
<AssemblyName>Swap</AssemblyName>
Expand Down
4 changes: 2 additions & 2 deletions tests/QLNet.Tests.Old/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,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.9.2.0" )]
[assembly: AssemblyFileVersion( "1.9.2.0" )]
[assembly: AssemblyVersion( "1.10.0.0" )]
[assembly: AssemblyFileVersion( "1.10.0.0" )]
2 changes: 1 addition & 1 deletion tests/QLNet.Tests/QLNet.Tests.csproj
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<VersionPrefix>1.9.2</VersionPrefix>
<VersionPrefix>1.10.0</VersionPrefix>
<TargetFramework>net45</TargetFramework>
<AssemblyName>QLNet.Tests</AssemblyName>
<PackageId>QLNet.Tests</PackageId>
Expand Down

0 comments on commit cc527d0

Please sign in to comment.