diff --git a/ChangeLog.txt b/ChangeLog.txt index 7bffd2f06..b8b470ab3 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,332 +1,484 @@ -commit 3dce73f39710dba45f4306ea6f69e599385322c8 -Author: Sean O'Connor -Date: Thu Apr 2 15:46:49 2020 -0700 +commit 21e7100473af85d45dbd635fdaf9c844f409efd1 +Author: Andrea Maggiulli +Date: Tue Nov 23 20:00:02 2021 +0100 - Fixing outdated sonarqube and adding dotnet core tests (#248) - - * Enabling dotnet core tests. - - * Switching to the dotnet tool for sonar. - - * Updating all appveyor images. - - * Temp disable netstandard tests. - - * Updating appveyor logger. - - * Removing bad test merge. - - * Fixing nuget publish - - * Fixing artifacts. - - * Fixing typo in last commit. - - * Adding gitignore. + Updated to netstandard2.1. - .gitignore | 362 ++++++++++++++++++++++++++++++++++- - appveyor.yml | 25 ++- - src/QLNet/QLNet.csproj | 2 +- - tests/QLNet.Tests/QLNet.Tests.csproj | 12 +- - tests/QLNet.Tests/Utilities.cs | 6 +- - 5 files changed, 384 insertions(+), 23 deletions(-) + src/QLNet/QLNet.csproj | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) -commit 46075c83fa23c0714918684654c6cb08d67e8481 -Author: tournierjc -Date: Wed Jan 29 19:53:02 2020 +0100 +commit cc11a60d51efc6a25eed61739999bb263c7377de +Author: Andrea Maggiulli +Date: Tue Nov 23 19:57:11 2021 +0100 - Add Cranck-Nicholson, Method of Lines & TrBDF2 schemes (#244) - - * Update step method & add new schemes - - - Update step method by adding theta parameter. - - Add Cranck-Nicholson, Method of Lines & TrBDF2 schemes - - * Add new schemes to FdmBackwardSolver - - * Update IMixedScheme interface and dependencies - - * Update QLNet Old project file - - * Delete FdmBackwardSolver.cs - - * Move to Solvers folder - - src/QLNet.Old/QLNet.Old.csproj | 9 ++ - src/QLNet/Methods/Finitedifferences/MixedScheme.cs | 4 +- - .../Methods/Finitedifferences/ParallelEvolver.cs | 2 +- - .../Finitedifferences/Schemes/CraigSneydScheme.cs | 2 +- - .../Schemes/CrankNicolsonScheme.cs | 85 ++++++++++++ - .../Finitedifferences/Schemes/DouglasScheme.cs | 2 +- - .../Schemes/ExplicitEulerScheme.cs | 5 +- - .../Finitedifferences/Schemes/HundsdorferScheme.cs | 2 +- - .../Schemes/ImplicitEulerScheme.cs | 48 ++++--- - .../Schemes/MethodOfLinesScheme.cs | 87 +++++++++++++ - .../Schemes/ModifiedCraigSneydScheme.cs | 2 +- - .../Finitedifferences/Schemes/TrBDF2Scheme.cs | 143 +++++++++++++++++++++ - .../Finitedifferences/Solvers/FdmBackwardSolver.cs | 36 +++++- - src/QLNet/Methods/Finitedifferences/TRBDF2.cs | 2 +- - 14 files changed, 399 insertions(+), 30 deletions(-) - -commit 3b313eceb8cc438161a60786035be8edaf29eece -Author: tournierjc -Date: Mon Jan 20 22:23:03 2020 +0100 - - Add Quanto Term Structure (#243) - - * Add QuantoTermStructure class - - * Add FdmQuantoHelper class - - * Extend FdmBlackScholesMesher with FdmQuantoHelper - - * Extend FdmBlackScholesOp with FdmQuantoHelper - - * Extend FdmBlackScholesSolver with FdmQuantoHelper - - * Fix FdmDividendHandler using wrong array index - - * Dividends in Fd BS Barrier Engines - - Ensure dividend cash-flows are well taken into account in FDM pricing for Black-Scholes Barrier Engine. - - * Extend FDM BS Vanilla with CashDividendModel - - Add CashDividendModel to Black-Scholes Vanilla engine under Finite Difference model. - - Add MakeFdBlackScholesVanillaEngine class. - - * Update Old Project File - - Also update filename convention - - src/QLNet.Old/QLNet.Old.csproj | 662 +++++++++++---------- - .../Meshers/FdmBlackScholesMesher.cs | 75 ++- - .../Operators/FdmBlackScholesOp.cs | 41 +- - .../Solvers/FdmBlackScholesSolver.cs | 14 +- - .../Utilities/FdmDividendHandler.cs | 8 +- - .../Finitedifferences/Utilities/FdmQuantoHelper.cs | 110 ++++ - .../barrier/FdBlackScholesBarrierEngine.cs | 4 +- - .../barrier/FdBlackScholesRebateEngine.cs | 4 +- - .../vanilla/FdBlackScholesVanillaEngine.cs | 353 +++++++---- - .../Termstructures/Yield/QuantoTermStructure.cs | 107 ++++ - 10 files changed, 927 insertions(+), 451 deletions(-) - -commit 68b7f68293e2166edb70d3d43db4bb51e96bbc88 -Author: tournierjc -Date: Mon Jan 20 22:01:54 2020 +0100 - - Add Cumulative & Inverse Cumulative Chi² Distrib (#242) - - .../Math/Distributions/ChiSquareDistribution.cs | 521 ++++++++++++++------- - 1 file changed, 359 insertions(+), 162 deletions(-) - -commit a170d037b717dfe29db2c416f1d5863dedeef4d2 -Author: tournierjc -Date: Mon Jan 20 21:41:01 2020 +0100 - - Fix AdaptiveRungeKutta (#241) - - Lists need to be initialized + Updated calendars tests. - src/QLNet/Math/ODE/AdaptiveRungeKutta.cs | 16 ++++++++-------- - 1 file changed, 8 insertions(+), 8 deletions(-) + tests/QLNet.Tests/T_Calendars.cs | 74 +++++++++++++++++++++++++++++++++++----- + 1 file changed, 66 insertions(+), 8 deletions(-) -commit 7ed37d532161526f32397671219232fdb7a7908c -Author: tournierjc -Date: Sat Jan 18 11:26:43 2020 +0100 +commit 10eb3c3133a66b0caf093014a206fa8a81e9b871 +Author: Andrea Maggiulli +Date: Tue Nov 23 19:56:46 2021 +0100 + + Updated all calendars. + + src/QLNet/Time/Calendars/France.cs | 1 - + src/QLNet/Time/Calendars/Germany.cs | 18 +- + src/QLNet/Time/Calendars/HongKong.cs | 352 ++++++++++++++++++------------ + src/QLNet/Time/Calendars/Hungary.cs | 4 +- + src/QLNet/Time/Calendars/India.cs | 64 ++++++ + src/QLNet/Time/Calendars/Japan.cs | 62 ++++-- + src/QLNet/Time/Calendars/Mexico.cs | 4 +- + src/QLNet/Time/Calendars/NewZealand.cs | 5 +- + src/QLNet/Time/Calendars/Norway.cs | 2 + + src/QLNet/Time/Calendars/Romania.cs | 59 ++++- + src/QLNet/Time/Calendars/Russia.cs | 108 ++++++++- + src/QLNet/Time/Calendars/SouthKorea.cs | 22 +- + src/QLNet/Time/Calendars/Sweden.cs | 6 +- + src/QLNet/Time/Calendars/Taiwan.cs | 107 ++++++++- + src/QLNet/Time/Calendars/Thailand.cs | 96 ++++---- + src/QLNet/Time/Calendars/Turkey.cs | 4 +- + src/QLNet/Time/Calendars/UnitedKingdom.cs | 52 ++--- + src/QLNet/Time/Calendars/UnitedStates.cs | 122 ++++++++++- + 18 files changed, 811 insertions(+), 277 deletions(-) + +commit 5d06ff463ed22e7d0131bc047e35ef9eb9cd0e05 +Author: Andrea Maggiulli +Date: Mon Nov 22 20:23:43 2021 +0100 - MC Barrier Engine (#240) - - * RNGTraits - force IRNG type for factory return - - * MCBarrierEngine - add file - - * Update tests with MC Barrier Engine - - * Project - update old project file - - * Delete rngtraits.cs - - * RNGTraits - force IRNG type for factory function - - * update RNGTraits filename + Updated Canadian calendar. Close #266 - src/QLNet.Old/QLNet.Old.csproj | 9 +- - src/QLNet/Math/randomnumbers/RNGTraits.cs | 6 +- - .../Pricingengines/barrier/MCBarrierEngine.cs | 587 +++++++++++++++++++++ - tests/QLNet.Tests/T_BarrierOption.cs | 85 +-- - 4 files changed, 639 insertions(+), 48 deletions(-) + src/QLNet/Time/Calendars/Canada.cs | 9 ++++++--- + 1 file changed, 6 insertions(+), 3 deletions(-) -commit b08aeba13ab13510a8480de9c7cb7541a1f220ae -Author: tournierjc -Date: Fri Jan 17 22:57:57 2020 +0100 +commit a8d3dd34792341d3f78a326592905bd63f49df34 +Author: Andrea Maggiulli +Date: Mon Nov 22 20:22:23 2021 +0100 - [Heston process] Fix Broadie-Kaya exact scheme (#239) + Added Chilean calendars. - src/QLNet/processes/HestonProcess.cs | 22 ++++++++++++++++++++-- - 1 file changed, 20 insertions(+), 2 deletions(-) + src/QLNet/Time/Calendars/Chile.cs | 133 ++++++++++++++++++++++++++++++++++++++ + 1 file changed, 133 insertions(+) -commit e5560686fe70161e5ab17ab6ff81438cef3d2963 -Author: tournierjc -Date: Fri Jan 17 15:10:58 2020 +0100 +commit 8e685b4cd0e7cff512dad76ba6d281fd76f028fe +Author: Andrea Maggiulli +Date: Mon Nov 22 20:21:30 2021 +0100 - Add Cumulative Gamma distribution (#236) + Added French calendars. - src/QLNet/Math/Distributions/GammaDistribution.cs | 59 +++++++++++++++++++++++ - 1 file changed, 59 insertions(+) + src/QLNet/Time/Calendars/France.cs | 154 +++++++++++++++++++++++++++++++++++++ + 1 file changed, 154 insertions(+) -commit 0405f1c742c86d52e1170de2ce9da5ca124992c7 -Author: tournierjc -Date: Fri Jan 17 15:09:45 2020 +0100 +commit 20a5cadcc0d514ce126f6ced93e1d02ffa3d65d2 +Author: Andrea Maggiulli +Date: Mon Nov 22 19:47:08 2021 +0100 - Old Project Files Fix (#235) [skip ci] - - * [QLNet Old Project] - - Fix missing files - - * [QLNet Test Old] - - Update framework and fix dependency error message - - * Delete QLNet.Old.csproj - - * [QLnet old project] fix missing Exceptions + Updated China calendar up to 2021. - src/QLNet.Old/QLNet.Old.csproj | 31 ++++++++++++++++++++--- - tests/QLNet.Tests.Old/QLNet.Tests.Old.csproj | 38 +++++++++++++--------------- - 2 files changed, 44 insertions(+), 25 deletions(-) + src/QLNet/Time/Calendars/China.cs | 37 ++++++++++++++++++++++++++++++++++--- + 1 file changed, 34 insertions(+), 3 deletions(-) -commit 4ed7bee8a371f771ef5dcf0f909ea563ef30a31f -Author: Andrea Maggiulli -Date: Fri Dec 6 17:43:45 2019 +0100 +commit b272d031e02cccee37d1b2d5a35cab9782bc2fb7 +Author: Andrea Maggiulli +Date: Mon Nov 22 18:49:16 2021 +0100 - Update ReadMe. [skip ci] + Added Austrian calendar. - README.md | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + src/QLNet/Time/Calendars/Austria.cs | 167 ++++++++++++++++++++++++++++++++++++ + 1 file changed, 167 insertions(+) + +commit d97bfab91e19d92faf3df7aeebf2eafc47a3a723 +Author: Olivier Milla +Date: Thu Sep 30 18:57:47 2021 +0200 + + Target Net5.0 Framework in samples too. (#267) -commit 8954646338eaf0ee9aff0571e628af54a4d84707 + samples/BermudanSwaption/BermudanSwaption.csproj | 2 +- + samples/Bonds/Bonds.csproj | 2 +- + samples/CVAIRS/CVAIRS.csproj | 2 +- + samples/CallableBonds/CallableBonds.csproj | 2 +- + samples/ConvertibleBonds/ConvertibleBonds.csproj | 2 +- + samples/EquityOption/EquityOption.csproj | 2 +- + samples/FRA/FRA.csproj | 2 +- + samples/FittedBondCurve/FittedBondCurve.csproj | 2 +- + samples/Repo/Repo.csproj | 2 +- + samples/Swap/Swap.csproj | 2 +- + 10 files changed, 10 insertions(+), 10 deletions(-) + +commit a9c2fc211788e3ff90705aa8bebf6043f98fc38e Author: Andrea Maggiulli -Date: Tue Nov 19 18:31:37 2019 +0100 +Date: Tue Mar 2 19:39:41 2021 +0100 - Added a new QLNet Exception. + Updated tests suite to .Net Core 5. - src/QLNet/Exceptions/NullEffectiveDateException.cs | 21 +++++++++++++++++++++ - src/QLNet/Exceptions/QLNetExceptionEnum.cs | 3 ++- - src/QLNet/Time/Schedule.cs | 4 ++-- - src/QLNet/Utils.cs | 4 ++++ - tests/QLNet.Tests/T_Bonds.cs | 4 ++++ - 5 files changed, 33 insertions(+), 3 deletions(-) + tests/QLNet.Tests/QLNet.Tests.csproj | 2 +- + tests/QLNet.Tests/T_Inflation.cs | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) -commit 1a0a999ad90c82f0fdaa22e725904a061a4ad48a +commit f0d80d3b82de1effee85ad3686d8d9006e721c40 Author: Andrea Maggiulli -Date: Tue Oct 29 16:56:27 2019 +0100 +Date: Tue Mar 2 19:12:22 2021 +0100 - Fixed Date GetHashCode , compute hash on readonly field. + Fixed ActualActualISMA daycounter calculation for long/short final periods, thanks @kristofferpagels. + This close #265 - src/QLNet/Time/Date.cs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + src/QLNet/Time/DayCounters/ActualActual.cs | 39 +++++++++++++++++++---- + tests/QLNet.Tests/T_DayCounters.cs | 51 ++++++++++++++++++++++++++++++ + 2 files changed, 83 insertions(+), 7 deletions(-) -commit 66170a26489eb04d20ee6ca1db33eb68d789b969 -Merge: 8dc18ef af5d041 -Author: Andrea Maggiulli -Date: Tue Oct 29 15:42:15 2019 +0100 +commit 452499ef5a73174e4f82ad12c1b1af38e7433601 +Author: Francois Botha +Date: Wed Feb 24 02:56:46 2021 +0200 - Merge pull request #234 from QtRoS/develop - - Date.GetHashCode() implemented (closes #233) + Add utility Date.ToDateTime() method (#263) -commit af5d04175d5f982f766f4893f4655a7b3e98c20d -Author: Roman Shchekin -Date: Tue Oct 22 11:54:23 2019 +0300 + src/QLNet/Time/Date.cs | 2 ++ + 1 file changed, 2 insertions(+) - Date.GetHashCode() implemented +commit f883f6ba4b8c315714d778f47e7c57d15670aba5 +Author: Andrea Maggiulli +Date: Wed Feb 24 01:12:18 2021 +0100 - src/QLNet/Time/Date.cs | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) + Fixing Nuget deployement. -commit 8dc18ef5116bdfbe1f0a4e82de7a57e5a6db8380 + appveyor.yml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 340bb979be30b6f027042aa4620ab8ea01f5006f Author: Andrea Maggiulli -Date: Fri Sep 20 16:13:23 2019 +0200 +Date: Wed Feb 24 00:52:24 2021 +0100 - Trying to fix Sonar build + Disabling failing test. - appveyor.yml | 2 +- + tests/QLNet.Tests/T_Piecewiseyieldcurve.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -commit 800542f9ed9ab35423583c17b644ebb5af42212f +commit e9d4f6d661b9d515858de77970943e30533ce9df +Author: Andrea Maggiulli +Date: Wed Feb 24 00:28:48 2021 +0100 + + Fixing Nuget deployement. + + appveyor.yml | 7 +++---- + 1 file changed, 3 insertions(+), 4 deletions(-) + +commit db83a242cdc5c09a944994d02ec6ef8f2935fb00 +Author: Andrea Maggiulli +Date: Tue Feb 23 22:34:02 2021 +0100 + + Fixing the build + + appveyor.yml | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +commit 33eba0af05268777c4a22371ccf8a304f10f6897 Author: Andrea Maggiulli -Date: Fri Sep 20 16:04:58 2019 +0200 - - Fixed WAL calculation for past dates with test. - - src/QLNet/Cashflows/CashFlows.cs | 4 ++-- - src/QLNet/Cashflows/ConundrumPricer.cs | 4 ++-- - src/QLNet/Instruments/AssetSwap.cs | 2 +- - src/QLNet/Instruments/BMASwap.cs | 4 ++-- - src/QLNet/Instruments/BasisSwap.cs | 2 +- - src/QLNet/Instruments/Bonds/AmortizingFixedRateBond.cs | 2 +- - src/QLNet/Instruments/CPISwap.cs | 2 +- - src/QLNet/Instruments/OvernightIndexedSwap.cs | 2 +- - src/QLNet/Instruments/VanillaSwap.cs | 2 +- - src/QLNet/Instruments/YearOnYearInflationSwap.cs | 2 +- - src/QLNet/Math/Solvers1d/Bisection.cs | 2 +- - src/QLNet/Math/Solvers1d/Brent.cs | 2 +- - src/QLNet/Math/Solvers1d/FalsePosition.cs | 2 +- - src/QLNet/Math/Solvers1d/FiniteDifferenceNewtonSafe.cs | 2 +- - src/QLNet/Math/Solvers1d/Newton.cs | 2 +- - src/QLNet/Math/Solvers1d/Newtonsafe.cs | 2 +- - src/QLNet/Math/Solvers1d/Ridder.cs | 2 +- - src/QLNet/Math/Solvers1d/Secant.cs | 2 +- - src/QLNet/Math/integrals/Kronrodintegral.cs | 2 +- - src/QLNet/Pricingengines/Bond/BondFunctions.cs | 6 ++++-- - src/QLNet/Pricingengines/credit/IntegralCdsEngine.cs | 2 +- - src/QLNet/Pricingengines/credit/IsdaCdsEngine.cs | 2 +- - src/QLNet/Pricingengines/credit/MidPointCdsEngine.cs | 2 +- - src/QLNet/Termstructures/Yield/Ratehelpers.cs | 2 +- - src/QLNet/legacy/libormarketmodels/LfmSwaptionEngine.cs | 2 +- - tests/QLNet.Tests/T_Bonds.cs | 8 ++++++++ - 26 files changed, 39 insertions(+), 29 deletions(-) - -commit 57e816e2051cda87fef1757ba75f997f5b1d7bb4 +Date: Tue Feb 23 21:30:45 2021 +0100 + + Fixing the build + + appveyor.yml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit d315456be91f161123899325095ed0ae90923de1 +Author: Andrea Maggiulli +Date: Tue Feb 23 21:00:42 2021 +0100 + + Fixing the build + + appveyor.yml | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +commit b4568f366e95dc47d9b966836be5805a37e13fcc +Author: Andrea Maggiulli +Date: Tue Feb 23 19:49:42 2021 +0100 + + Fixing the build + + appveyor.yml | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +commit 66d282df47d00af25478de9e7f192390c368a47d +Author: Andrea Maggiulli +Date: Tue Feb 23 19:12:29 2021 +0100 + + Fixing the build + + appveyor.yml | 2 ++ + 1 file changed, 2 insertions(+) + +commit 82cf2d16be6e24244a39c45cc0764cc280657450 Author: Andrea Maggiulli -Date: Fri Aug 16 13:58:05 2019 +0200 +Date: Mon Sep 14 18:23:46 2020 +0200 - Added a new QLNet Exceptions (fixed missing source file). + Fixed helpers sort for Piecewise Curves. This should fix #260 - src/QLNet/Cashflows/CashFlows.cs | 9 +++------ - src/QLNet/Exceptions/InvalidPriceSignException.cs | 21 +++++++++++++++++++++ - src/QLNet/Utils.cs | 2 ++ - tests/QLNet.Tests/T_Bonds.cs | 4 ++++ - 4 files changed, 30 insertions(+), 6 deletions(-) + src/QLNet/Termstructures/Inflation/PiecewiseYoYInflationCurve.cs | 3 +++ + src/QLNet/Termstructures/Inflation/PiecewiseZeroInflationCurve.cs | 3 +++ + src/QLNet/Termstructures/Iterativebootstrap.cs | 3 --- + src/QLNet/Termstructures/Yield/PiecewiseYieldCurve.cs | 6 ++++++ + 4 files changed, 12 insertions(+), 3 deletions(-) -commit 9633df8179a07cb9e8f7663a3372544504ff5d68 +commit 549a72d527d986426e01668e03a3ad3817f23cdd Author: Andrea Maggiulli -Date: Fri Aug 16 13:32:28 2019 +0200 +Date: Wed May 20 16:32:36 2020 +0200 + + #256 - Fixed Denmark holidays, thx @hhaldn + + src/QLNet/Time/Calendars/Denmark.cs | 12 +++++++++--- + 1 file changed, 9 insertions(+), 3 deletions(-) + +commit d837fec600e517c1c4590600eccb504535df9b8f +Author: Andrea Maggiulli +Date: Mon May 11 17:49:50 2020 +0200 + + Updated Sonar badges [skip ci] + + README.md | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) - Added a new QLNet Exceptions. +commit c397fb4da2e0d02b58dc9146d0d888caf677e39c +Author: Andrea Maggiulli +Date: Mon May 11 17:48:39 2020 +0200 + + Updated Sonar badges [skip ci] - src/QLNet/Cashflows/CashFlows.cs | 9 ++++++--- - src/QLNet/Exceptions/QLNetExceptionEnum.cs | 3 ++- - src/QLNet/Utils.cs | 2 ++ - 3 files changed, 10 insertions(+), 4 deletions(-) + README.md | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) -commit ac2ca38e9c491fd4d20730b8411c7c52b7afe4e1 +commit b19ac52d07a295ec4a53986dcb1e6653462cb8b3 +Author: Andrea Maggiulli +Date: Mon May 11 17:02:07 2020 +0200 + + Feature #253 (#254) + + * #253 Moved example projects into samples folder. + + * #253 Set feature's build to Release, enabled tests. + + * #253 Set feature's build to Release, enabled tests. + + * #253 Removed MSTest framework, updated test project to netcore. + + * #253 Updated test script for features. + + * #253 Fixing tests. + + * #253 Fixing tests. + + * #253 Fixing tests. + + * #253 Removed old projects files. + + * #253 Fixing build. + + * Revert "#253 Fixing tests." + + * #253 Fixed compilation warnings. + + * #253 Fixing appveyor script [skip ci] + + * #253 Fixing appveyor script. + + * #253 Moved to the new SonarCloud site. + + * #253 Fixing appveyor script. + + * #253 Fixing appveyor script. + + * #253 Adding coverage for Sonar. + + * #253 Fixing tests. + + QLNet.sln | 74 +- + QLNetOld.sln | 38 - + appveyor.yml | 66 +- + {src => samples}/BermudanSwaption/.editorconfig | 0 + .../BermudanSwaption/BermudanSwaption.cs | 0 + .../BermudanSwaption/BermudanSwaption.csproj | 2 +- + {src => samples}/Bonds/.editorconfig | 0 + {src => samples}/Bonds/Bonds.cs | 0 + {src => samples}/Bonds/Bonds.csproj | 2 +- + {src => samples}/CVAIRS/CVAIRS.cs | 0 + {src => samples}/CVAIRS/CVAIRS.csproj | 2 +- + {src => samples}/CallableBonds/.editorconfig | 0 + {src => samples}/CallableBonds/CallableBonds.cs | 8 +- + .../CallableBonds/CallableBonds.csproj | 2 +- + {src => samples}/ConvertibleBonds/.editorconfig | 0 + .../ConvertibleBonds/ConvertibleBonds.cs | 6 +- + .../ConvertibleBonds/ConvertibleBonds.csproj | 2 +- + {src => samples}/EquityOption/.editorconfig | 0 + {src => samples}/EquityOption/EquityOption.cs | 0 + {src => samples}/EquityOption/EquityOption.csproj | 2 +- + {src => samples}/FRA/.editorconfig | 0 + {src => samples}/FRA/FRA.cs | 0 + {src => samples}/FRA/FRA.csproj | 2 +- + {src => samples}/FittedBondCurve/.editorconfig | 0 + .../FittedBondCurve/FittedBondCurve.cs | 0 + .../FittedBondCurve/FittedBondCurve.csproj | 2 +- + samples/QLNetSamples.sln | 79 + + {src => samples}/Repo/.editorconfig | 0 + {src => samples}/Repo/Repo.cs | 0 + {src => samples}/Repo/Repo.csproj | 2 +- + {src => samples}/Swap/.editorconfig | 0 + {src => samples}/Swap/Swap.csproj | 2 +- + {src => samples}/Swap/swapvaluation.cs | 0 + {src => samples}/VB/Swap/Swapvaluation.vb | 0 + src/QLNet.Old/AssemblyInfo.cs | 34 - + src/QLNet.Old/Cashflows/.gitkeep | 0 + src/QLNet.Old/Currencies/.gitkeep | 0 + src/QLNet.Old/Extensions/.gitkeep | 0 + src/QLNet.Old/Indexes/Ibor/.gitkeep | 0 + src/QLNet.Old/Indexes/Inflation/.gitkeep | 0 + src/QLNet.Old/Indexes/Swap/.gitkeep | 0 + src/QLNet.Old/Instruments/Bonds/.gitkeep | 0 + src/QLNet.Old/Math/Distributions/.gitkeep | 0 + src/QLNet.Old/Math/Interpolations/.gitkeep | 0 + src/QLNet.Old/Math/Optimization/.gitkeep | 0 + src/QLNet.Old/Math/Solvers1d/.gitkeep | 0 + src/QLNet.Old/Math/integrals/.gitkeep | 0 + src/QLNet.Old/Math/matrixutilities/.gitkeep | 0 + src/QLNet.Old/Math/randomnumbers/.gitkeep | 0 + src/QLNet.Old/Math/statistics/.gitkeep | 0 + src/QLNet.Old/Methods/Finitedifferences/.gitkeep | 0 + src/QLNet.Old/Methods/lattices/.gitkeep | 0 + src/QLNet.Old/Methods/montecarlo/.gitkeep | 0 + src/QLNet.Old/Models/Equity/.gitkeep | 0 + .../MarketModels/BrownianGenerators/.gitkeep | 0 + .../Models/Shortrate/Onefactormodels/.gitkeep | 0 + .../Models/Shortrate/Twofactorsmodels/.gitkeep | 0 + .../Models/Shortrate/calibrationhelpers/.gitkeep | 0 + src/QLNet.Old/Patterns/.gitkeep | 0 + src/QLNet.Old/Pricingengines/Basket/.gitkeep | 0 + src/QLNet.Old/Pricingengines/Bond/.gitkeep | 0 + src/QLNet.Old/Pricingengines/CapFloor/.gitkeep | 0 + src/QLNet.Old/Pricingengines/Cliquet/.gitkeep | 0 + src/QLNet.Old/Pricingengines/Forward/.gitkeep | 0 + src/QLNet.Old/Pricingengines/Loan/.gitkeep | 0 + src/QLNet.Old/Pricingengines/Lookback/.gitkeep | 0 + src/QLNet.Old/Pricingengines/Swap/.gitkeep | 0 + src/QLNet.Old/Pricingengines/asian/.gitkeep | 0 + src/QLNet.Old/Pricingengines/barrier/.gitkeep | 0 + src/QLNet.Old/Pricingengines/credit/.gitkeep | 0 + src/QLNet.Old/Pricingengines/inflation/.gitkeep | 0 + src/QLNet.Old/Pricingengines/swaption/.gitkeep | 0 + src/QLNet.Old/Pricingengines/vanilla/.gitkeep | 0 + src/QLNet.Old/QLNet.Old.csproj | 2154 ------------- + src/QLNet.Old/Quotes/.gitkeep | 0 + src/QLNet.Old/Termstructures/Credit/.gitkeep | 0 + src/QLNet.Old/Termstructures/Inflation/.gitkeep | 0 + .../Termstructures/Volatility/Bond/.gitkeep | 0 + .../Termstructures/Volatility/CapFloor/.gitkeep | 0 + .../Termstructures/Volatility/Inflation/.gitkeep | 0 + .../Termstructures/Volatility/Optionlet/.gitkeep | 0 + .../Termstructures/Volatility/equityfx/.gitkeep | 0 + .../Termstructures/Volatility/swaption/.gitkeep | 0 + src/QLNet.Old/Termstructures/Yield/.gitkeep | 0 + src/QLNet.Old/Time/Calendars/.gitkeep | 0 + src/QLNet.Old/Time/DayCounters/.gitkeep | 0 + src/QLNet.Old/legacy/libormarketmodels/.gitkeep | 0 + src/QLNet.Old/processes/.gitkeep | 0 + src/QLNet/QLNet.csproj | 2 +- + tests/QLNet.Tests.Old/AssemblyInfo.cs | 39 - + tests/QLNet.Tests.Old/QLNet.Tests.Old.csproj | 212 -- + tests/QLNet.Tests/QLNet.Tests.csproj | 24 +- + tests/QLNet.Tests/T_AmericanOption.cs | 44 +- + tests/QLNet.Tests/T_AsianOptions.cs | 34 +- + tests/QLNet.Tests/T_AssetSwap.cs | 60 +- + tests/QLNet.Tests/T_BarrierOption.cs | 28 +- + tests/QLNet.Tests/T_BasketOption.cs | 15 +- + tests/QLNet.Tests/T_Bermudanswaption.cs | 27 +- + tests/QLNet.Tests/T_BinaryOption.cs | 16 +- + tests/QLNet.Tests/T_BlackDeltaCalculator.cs | 24 +- + tests/QLNet.Tests/T_BlackFormula.cs | 16 +- + tests/QLNet.Tests/T_Bonds.cs | 174 +- + tests/QLNet.Tests/T_BusinessDayConvention.cs | 12 +- + tests/QLNet.Tests/T_CPISwap.cs | 20 +- + tests/QLNet.Tests/T_Calendars.cs | 93 +- + tests/QLNet.Tests/T_CapFloor.cs | 51 +- + tests/QLNet.Tests/T_CapFlooredCoupon.cs | 16 +- + tests/QLNet.Tests/T_CashFlows.cs | 24 +- + tests/QLNet.Tests/T_CatBonds.cs | 37 +- + tests/QLNet.Tests/T_CliquetOption.cs | 21 +- + tests/QLNet.Tests/T_Cms.cs | 20 +- + tests/QLNet.Tests/T_ConvertibleBond.cs | 20 +- + tests/QLNet.Tests/T_CreditDefaultSwap.cs | 32 +- + tests/QLNet.Tests/T_Dates.cs | 28 +- + tests/QLNet.Tests/T_DayCounters.cs | 48 +- + tests/QLNet.Tests/T_DefaultProbabilityCurves.cs | 20 +- + tests/QLNet.Tests/T_DigitalCoupon.cs | 40 +- + tests/QLNet.Tests/T_DigitalOption.cs | 40 +- + tests/QLNet.Tests/T_DividendOption.cs | 42 +- + tests/QLNet.Tests/T_DoubleBarrierOption.cs | 21 +- + tests/QLNet.Tests/T_DoubleBinaryOption.cs | 12 +- + tests/QLNet.Tests/T_EuropeanOption.cs | 55 +- + tests/QLNet.Tests/T_ExchangeRate.cs | 28 +- + tests/QLNet.Tests/T_FastFourierTransform.cs | 17 +- + tests/QLNet.Tests/T_FdmLinearOp.cs | 48 +- + tests/QLNet.Tests/T_ForwardOption.cs | 28 +- + tests/QLNet.Tests/T_Functions.cs | 28 +- + tests/QLNet.Tests/T_HestonModel.cs | 78 +- + .../QLNet.Tests/T_HybridHestonHullWhiteProcess.cs | 60 +- + tests/QLNet.Tests/T_Inflation.cs | 24 +- + tests/QLNet.Tests/T_InflationCPICapFloor.cs | 16 +- + tests/QLNet.Tests/T_InflationCapFloorTest.cs | 35 +- + .../QLNet.Tests/T_InflationCapFlooredCouponTest.cs | 31 +- + tests/QLNet.Tests/T_Instruments.cs | 17 +- + tests/QLNet.Tests/T_InterestRate.cs | 12 +- + tests/QLNet.Tests/T_Interpolations.cs | 80 +- + tests/QLNet.Tests/T_LiborMarketModel.cs | 39 +- + tests/QLNet.Tests/T_LiborMarketModelProcess.cs | 36 +- + .../QLNet.Tests/T_LinearLeastSquaresRegression.cs | 36 +- + tests/QLNet.Tests/T_LookbackOption.cs | 24 +- + tests/QLNet.Tests/T_LowDiscrepancySequences.cs | 79 +- + tests/QLNet.Tests/T_Matrices.cs | 36 +- + tests/QLNet.Tests/T_Money.cs | 20 +- + tests/QLNet.Tests/T_Operators.cs | 16 +- + tests/QLNet.Tests/T_Optimizers.cs | 24 +- + tests/QLNet.Tests/T_OptionletStripper.cs | 40 +- + tests/QLNet.Tests/T_OvernightIndexedSwap.cs | 40 +- + tests/QLNet.Tests/T_PSACurve.cs | 12 +- + tests/QLNet.Tests/T_PathGenerator.cs | 35 +- + .../T_PiecewiseZeroSpreadedTermStructure.cs | 48 +- + tests/QLNet.Tests/T_Piecewiseyieldcurve.cs | 168 +- + tests/QLNet.Tests/T_Quotes.cs | 25 +- + tests/QLNet.Tests/T_RNGTraits.cs | 20 +- + tests/QLNet.Tests/T_RangeAccrual.cs | 3150 ++++++++++---------- + tests/QLNet.Tests/T_RiskStats.cs | 12 +- + tests/QLNet.Tests/T_Rounding.cs | 28 +- + tests/QLNet.Tests/T_SVI.cs | 35 +- + tests/QLNet.Tests/T_SampledCurve.cs | 12 +- + tests/QLNet.Tests/T_Schedule.cs | 44 +- + tests/QLNet.Tests/T_ShortRateModels.cs | 20 +- + tests/QLNet.Tests/T_Solvers.cs | 44 +- + tests/QLNet.Tests/T_SpreadOption.cs | 12 +- + tests/QLNet.Tests/T_Stats.cs | 26 +- + tests/QLNet.Tests/T_Swaps.cs | 51 +- + tests/QLNet.Tests/T_Swaption.cs | 51 +- + tests/QLNet.Tests/T_SwaptionVolatilityCube.cs | 822 +++-- + tests/QLNet.Tests/T_SwaptionVolatilitymatrix.cs | 31 +- + tests/QLNet.Tests/T_TermStructures.cs | 73 +- + tests/QLNet.Tests/T_TimeGrid.cs | 40 +- + tests/QLNet.Tests/T_Vector.cs | 24 +- + tests/QLNet.Tests/Utilities.cs | 66 - + tests/QLNet.Tests/xunit.runner.json | 6 + + 172 files changed, 2355 insertions(+), 7238 deletions(-) + +commit b5a730b3518b0b6b5889ec2397fa2f42a37de179 Author: Andrea Maggiulli -Date: Wed Jun 5 20:09:42 2019 +0200 +Date: Thu May 7 16:45:13 2020 +0200 - Updated development versions. [skip ci] + #252 Fixed LineSearchBasedMethod.minimize, thx @hhaldn for spotting it. - appveyor.yml | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) + .../Math/Optimization/LineSearchBasedMethod.cs | 4 +-- + tests/QLNet.Tests/T_Optimizers.cs | 40 ++++++++++++++++++++++ + 2 files changed, 42 insertions(+), 2 deletions(-) -commit 7b57f231127e1821689d672dbea11d09cba58555 +commit 9da55ba9830963b3a3aac59182054e44be57cfbd Author: Andrea Maggiulli -Date: Wed Jun 5 19:38:05 2019 +0200 +Date: Thu May 7 16:10:41 2020 +0200 - Fixed appveyor.yml [skip ci] + Bumping to version 1.12.0 for next release [skip ci] - appveyor.yml | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) \ No newline at end of file + appveyor.yml | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) \ No newline at end of file diff --git a/LICENSE b/LICENSE index d54fa6196..eadc7f233 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ BSD 3-Clause QLNet License -Copyright (c) 2018, Andrea Maggiulli +Copyright (c) 2018-2021, Andrea Maggiulli All rights reserved. Redistribution and use in source and binary forms, with or without diff --git a/News.txt b/News.txt index 0b78a7081..0daeb0416 100644 --- a/News.txt +++ b/News.txt @@ -1,38 +1,35 @@ -QLNet 1.11.4 +QLNet 1.12.0 ========================= -QLNet 1.11.4 +QLNet 1.12.0 A detailed list of changes is available in ChangeLog.txt. -WARNING : This is the last version supporting old Visual Studio projects, with -the upcoming version 1.12 the QLNetOld.sln will be removed and a general cleanup -will be done. - -MATH - -+ Added Cumulative Gamma distribution +FRAMEWORK -INSTRUMENTS ++ Removed QLNet old framework solution ++ Updated tests to use only xunit ++ Updated library to netstandard 2.1 ++ Updated test suite to .Net Core 5 ++ Updated samples to .Net Core 5 -+ Fixed Weighted Average Life calculation for past dates +MATH -TERMSTRUCTURES ++ Fixed LineSearchBasedMethod.minimize, thx @hhaldn for spotting it. -+ Added Quanto Term Structure +CALENDARS -METHODS ++ Fixed Denmark holidays, thx @hhaldn ++ Added Austrian, French and Chilean calendars ++ Updated all existing calendars up to 2021 -+ Added Cranck-Nicholson, Method of Lines & TrBDF2 schemes +TIME -ENGINES ++ Added utility Date.ToDateTime() method ++ Fixed ActualActualISMA daycounter calculation for long/short final periods, thanks @kristofferpagels. + -+ Fixed Broadie-Kaya exact scheme [Heston process] -+ Added Monte Carlo Barrier Engine -+ Fixed AdaptiveRungeKutta -+ Added Cumulative & Inverse Cumulative Chi² Distrib +TERMSTRUCTURES -FRAMEWORK ++ Fixed helpers sort for Piecewise Curves -+ Added more QLNet Exceptions -+ Bug fixing and refactoring. diff --git a/QLNet.sln b/QLNet.sln index d40b85dd7..ca8c7927e 100644 --- a/QLNet.sln +++ b/QLNet.sln @@ -1,7 +1,7 @@  Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26228.10 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{0E7C422B-F8C0-433E-9E54-D3D55968222D}" EndProject @@ -11,26 +11,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "QLNet", "src\QLNet\QLNet.cs EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "QLNet.Tests", "tests\QLNet.Tests\QLNet.Tests.csproj", "{5D0C9349-1A5B-455F-9485-0EF4860C8F62}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BermudanSwaption", "src\BermudanSwaption\BermudanSwaption.csproj", "{B616E3F5-7201-4BE2-801D-6A084F77690E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bonds", "src\Bonds\Bonds.csproj", "{39C6B719-526E-4BEF-98E6-8E48319ABF0B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CallableBonds", "src\CallableBonds\CallableBonds.csproj", "{0B96DC4B-9B75-4926-A583-1D049B88731E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CVAIRS", "src\CVAIRS\CVAIRS.csproj", "{C2D21176-2143-48C3-A364-D6ED28B0FAD7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EquityOption", "src\EquityOption\EquityOption.csproj", "{A11F2EEA-C561-42C3-A3C0-BDBF8A8A0758}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FittedBondCurve", "src\FittedBondCurve\FittedBondCurve.csproj", "{4AB97803-A149-45C0-9D8B-5E93851E296B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FRA", "src\FRA\FRA.csproj", "{683CF269-1F05-4C9B-9DCC-877977BC8C25}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Repo", "src\Repo\Repo.csproj", "{40456B2A-0B05-4DF1-951E-504BB339452A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Swap", "src\Swap\Swap.csproj", "{A653D5D9-660D-4DB2-938C-1676F5E35033}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConvertibleBonds", "src\ConvertibleBonds\ConvertibleBonds.csproj", "{F0F89FDF-F7D9-46CA-9177-A06BA64E306F}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -45,46 +25,6 @@ Global {5D0C9349-1A5B-455F-9485-0EF4860C8F62}.Debug|Any CPU.Build.0 = Debug|Any CPU {5D0C9349-1A5B-455F-9485-0EF4860C8F62}.Release|Any CPU.ActiveCfg = Release|Any CPU {5D0C9349-1A5B-455F-9485-0EF4860C8F62}.Release|Any CPU.Build.0 = Release|Any CPU - {B616E3F5-7201-4BE2-801D-6A084F77690E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B616E3F5-7201-4BE2-801D-6A084F77690E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B616E3F5-7201-4BE2-801D-6A084F77690E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B616E3F5-7201-4BE2-801D-6A084F77690E}.Release|Any CPU.Build.0 = Release|Any CPU - {39C6B719-526E-4BEF-98E6-8E48319ABF0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {39C6B719-526E-4BEF-98E6-8E48319ABF0B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {39C6B719-526E-4BEF-98E6-8E48319ABF0B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {39C6B719-526E-4BEF-98E6-8E48319ABF0B}.Release|Any CPU.Build.0 = Release|Any CPU - {0B96DC4B-9B75-4926-A583-1D049B88731E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0B96DC4B-9B75-4926-A583-1D049B88731E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0B96DC4B-9B75-4926-A583-1D049B88731E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0B96DC4B-9B75-4926-A583-1D049B88731E}.Release|Any CPU.Build.0 = Release|Any CPU - {C2D21176-2143-48C3-A364-D6ED28B0FAD7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C2D21176-2143-48C3-A364-D6ED28B0FAD7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C2D21176-2143-48C3-A364-D6ED28B0FAD7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C2D21176-2143-48C3-A364-D6ED28B0FAD7}.Release|Any CPU.Build.0 = Release|Any CPU - {A11F2EEA-C561-42C3-A3C0-BDBF8A8A0758}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A11F2EEA-C561-42C3-A3C0-BDBF8A8A0758}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A11F2EEA-C561-42C3-A3C0-BDBF8A8A0758}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A11F2EEA-C561-42C3-A3C0-BDBF8A8A0758}.Release|Any CPU.Build.0 = Release|Any CPU - {4AB97803-A149-45C0-9D8B-5E93851E296B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4AB97803-A149-45C0-9D8B-5E93851E296B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4AB97803-A149-45C0-9D8B-5E93851E296B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4AB97803-A149-45C0-9D8B-5E93851E296B}.Release|Any CPU.Build.0 = Release|Any CPU - {683CF269-1F05-4C9B-9DCC-877977BC8C25}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {683CF269-1F05-4C9B-9DCC-877977BC8C25}.Debug|Any CPU.Build.0 = Debug|Any CPU - {683CF269-1F05-4C9B-9DCC-877977BC8C25}.Release|Any CPU.ActiveCfg = Release|Any CPU - {683CF269-1F05-4C9B-9DCC-877977BC8C25}.Release|Any CPU.Build.0 = Release|Any CPU - {40456B2A-0B05-4DF1-951E-504BB339452A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {40456B2A-0B05-4DF1-951E-504BB339452A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {40456B2A-0B05-4DF1-951E-504BB339452A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {40456B2A-0B05-4DF1-951E-504BB339452A}.Release|Any CPU.Build.0 = Release|Any CPU - {A653D5D9-660D-4DB2-938C-1676F5E35033}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A653D5D9-660D-4DB2-938C-1676F5E35033}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A653D5D9-660D-4DB2-938C-1676F5E35033}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A653D5D9-660D-4DB2-938C-1676F5E35033}.Release|Any CPU.Build.0 = Release|Any CPU - {F0F89FDF-F7D9-46CA-9177-A06BA64E306F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F0F89FDF-F7D9-46CA-9177-A06BA64E306F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F0F89FDF-F7D9-46CA-9177-A06BA64E306F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F0F89FDF-F7D9-46CA-9177-A06BA64E306F}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -92,16 +32,6 @@ Global GlobalSection(NestedProjects) = preSolution {A12A9BB7-9C80-4ED2-ADA7-A267D1D36DA4} = {0E7C422B-F8C0-433E-9E54-D3D55968222D} {5D0C9349-1A5B-455F-9485-0EF4860C8F62} = {7509F81A-396A-4765-AF64-F5DB3ECD227C} - {B616E3F5-7201-4BE2-801D-6A084F77690E} = {0E7C422B-F8C0-433E-9E54-D3D55968222D} - {39C6B719-526E-4BEF-98E6-8E48319ABF0B} = {0E7C422B-F8C0-433E-9E54-D3D55968222D} - {0B96DC4B-9B75-4926-A583-1D049B88731E} = {0E7C422B-F8C0-433E-9E54-D3D55968222D} - {C2D21176-2143-48C3-A364-D6ED28B0FAD7} = {0E7C422B-F8C0-433E-9E54-D3D55968222D} - {A11F2EEA-C561-42C3-A3C0-BDBF8A8A0758} = {0E7C422B-F8C0-433E-9E54-D3D55968222D} - {4AB97803-A149-45C0-9D8B-5E93851E296B} = {0E7C422B-F8C0-433E-9E54-D3D55968222D} - {683CF269-1F05-4C9B-9DCC-877977BC8C25} = {0E7C422B-F8C0-433E-9E54-D3D55968222D} - {40456B2A-0B05-4DF1-951E-504BB339452A} = {0E7C422B-F8C0-433E-9E54-D3D55968222D} - {A653D5D9-660D-4DB2-938C-1676F5E35033} = {0E7C422B-F8C0-433E-9E54-D3D55968222D} - {F0F89FDF-F7D9-46CA-9177-A06BA64E306F} = {0E7C422B-F8C0-433E-9E54-D3D55968222D} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {D4B9C389-D195-4E74-9536-587E7D349B67} diff --git a/QLNetOld.sln b/QLNetOld.sln deleted file mode 100644 index dc8470555..000000000 --- a/QLNetOld.sln +++ /dev/null @@ -1,38 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QLNet", "src\QLNet.Old\QLNet.Old.csproj", "{F6E762BD-DCDF-4CA0-ABAD-CB21C7D03BEC}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Test", "tests\QLNet.Tests.Old\QLNet.Tests.Old.csproj", "{2EF8B45B-940A-4B77-8776-E8CE0036961E}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug-net45|Any CPU = Debug-net45|Any CPU - Release|Any CPU = Release|Any CPU - Release-net45|Any CPU = Release-net45|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F6E762BD-DCDF-4CA0-ABAD-CB21C7D03BEC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F6E762BD-DCDF-4CA0-ABAD-CB21C7D03BEC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F6E762BD-DCDF-4CA0-ABAD-CB21C7D03BEC}.Debug-net45|Any CPU.ActiveCfg = Debug-net45|Any CPU - {F6E762BD-DCDF-4CA0-ABAD-CB21C7D03BEC}.Debug-net45|Any CPU.Build.0 = Debug-net45|Any CPU - {F6E762BD-DCDF-4CA0-ABAD-CB21C7D03BEC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F6E762BD-DCDF-4CA0-ABAD-CB21C7D03BEC}.Release|Any CPU.Build.0 = Release|Any CPU - {F6E762BD-DCDF-4CA0-ABAD-CB21C7D03BEC}.Release-net45|Any CPU.ActiveCfg = Release-net45|Any CPU - {F6E762BD-DCDF-4CA0-ABAD-CB21C7D03BEC}.Release-net45|Any CPU.Build.0 = Release-net45|Any CPU - {2EF8B45B-940A-4B77-8776-E8CE0036961E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2EF8B45B-940A-4B77-8776-E8CE0036961E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2EF8B45B-940A-4B77-8776-E8CE0036961E}.Debug-net45|Any CPU.ActiveCfg = Debug-net45|Any CPU - {2EF8B45B-940A-4B77-8776-E8CE0036961E}.Debug-net45|Any CPU.Build.0 = Debug-net45|Any CPU - {2EF8B45B-940A-4B77-8776-E8CE0036961E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2EF8B45B-940A-4B77-8776-E8CE0036961E}.Release|Any CPU.Build.0 = Release|Any CPU - {2EF8B45B-940A-4B77-8776-E8CE0036961E}.Release-net45|Any CPU.ActiveCfg = Release-net45|Any CPU - {2EF8B45B-940A-4B77-8776-E8CE0036961E}.Release-net45|Any CPU.Build.0 = Release-net45|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/README.md b/README.md index e1eaabde7..ff7e40beb 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,15 @@ QLNet also contains new developments on the bond market like MBS, Amortized Cost [![NuGet](https://buildstats.info/nuget/qlnet)](https://www.nuget.org/packages/qlnet/) [![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?item_name=Donation+to+QLNet&cmd=_donations&business=a.maggiulli%40gmail.com) -[![Quality Gate](https://sonarcloud.io/api/project_badges/measure?project=QLNet-develop&metric=alert_status)](https://sonarcloud.io/dashboard?id=QLNet-develop) -[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=QLNet-develop&metric=bugs)](https://sonarcloud.io/project/issues?id=QLNet-develop&resolved=false&types=BUG) -[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=QLNet-develop&metric=vulnerabilities)](https://sonarcloud.io/project/issues?id=QLNet-develop&resolved=false&types=VULNERABILITY) -[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=QLNet-develop&metric=code_smells)](https://sonarcloud.io/project/issues?id=QLNet-develop&resolved=false&types=CODE_SMELL) -[![Duplicated Lines](https://sonarcloud.io/api/project_badges/measure?project=QLNet-develop&metric=duplicated_lines_density)](https://sonarcloud.io/component_measures?id=QLNet-develop&metric=duplicated_lines_density) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=QLNet&metric=alert_status)](https://sonarcloud.io/dashboard?id=QLNet) +[![Bugs](https://sonarcloud.io/api/project_badges/measure?project=QLNet&metric=bugs)](https://sonarcloud.io/dashboard?id=QLNet) +[![Vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=QLNet&metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=QLNet) +[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=QLNet&metric=code_smells)](https://sonarcloud.io/dashboard?id=QLNet) +[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=QLNet&metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=QLNet) +[![Lines of Code](https://sonarcloud.io/api/project_badges/measure?project=QLNet&metric=ncloc)](https://sonarcloud.io/dashboard?id=QLNet) +[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=QLNet&metric=sqale_rating)](https://sonarcloud.io/dashboard?id=QLNet) +[![Reliability Rating](https://sonarcloud.io/api/project_badges/measure?project=QLNet&metric=reliability_rating)](https://sonarcloud.io/dashboard?id=QLNet) +[![Security Rating](https://sonarcloud.io/api/project_badges/measure?project=QLNet&metric=security_rating)](https://sonarcloud.io/dashboard?id=QLNet) [![Technical Debt](https://sonarcloud.io/api/project_badges/measure?project=QLNet-develop&metric=sqale_index)](https://sonarcloud.io/dashboard?id=QLNet-develop) ## Development workflow diff --git a/appveyor.yml b/appveyor.yml index 7d6e1563e..8848486a4 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -6,7 +6,7 @@ branches: only: - master - version: 1.11.4 + version: 1.12.0 configuration: Release platform: Any CPU image: Visual Studio 2019 @@ -16,42 +16,39 @@ do_not_increment_build_number: true nuget: disable_publish_on_pr: true - before_build: - - cmd: dotnet restore qlnet.sln - build: - project: QLNet.sln - verbosity: minimal + build_script: + - cmd: dotnet build -c Release after_build: - cmd: dotnet pack src/qlnet/qlnet.csproj -c Release -o ./ artifacts: - - path: src\QLNet\bin\Release\netstandard12\QLNet.dll + - path: src\QLNet\bin\Release\netstandard2.1\QLNet.dll name: Windows - path: .\*.nupkg name: ng deploy: - provider: GitHub - tag: QLNet-v1.11.4 - release: QLNet Version 1.11.4 - description: QLNet 1.11.4 + tag: QLNet-v1.12.0 + release: QLNet Version 1.12.0 + description: QLNet 1.12.0 auth_token: secure: rK95hgNgZt9ybzXBJ/1W0nbqsG/aENQ22eyY2qxn5xjbi7ZEjv+5BmNjY/l1cAYH - artifact: src\QLNet\bin\Release\netstandard12\QLNet.dll + artifact: src\QLNet\bin\Release\netstandard2.1\QLNet.dll draft: false force_update: false - provider: NuGet api_key: - secure: HcilScZbZnJrCk5hoEPz9MSzKQanBzsQCfulI9gFpcT7wurwxIy3hwSwPfjXmr/v + secure: PfSWPcbGqOhlEhGG74+J7tmJMa5RU/N19DEyjVP2GUXGQG4MWBeTmrKE/W4A70dh skip_symbols: true artifact: ng # Configuration for "develop" branch -# build in Debug mode, run tests , deploy to Sonar +# build in Release mode, run tests , deploy to Sonar - branches: only: - develop - version: 1.11.4-preview.{build} - configuration: Debug + version: 1.12.0-preview.{build} + configuration: Release platform: Any CPU image: Visual Studio 2019 skip_tags: true @@ -60,20 +57,16 @@ do_not_increment_build_number: true nuget: disable_publish_on_pr: true + init: + - cmd: set JAVA_HOME=C:\Program Files\Java\jdk11 before_build: - - cmd: "dotnet tool install --global dotnet-sonarscanner\ndotnet restore qlnet.sln" - - cmd: "dotnet clean qlnet.sln" + - cmd: "dotnet tool install --global dotnet-sonarscanner" - cmd: "SET runner_args=\"\"" - - cmd: "if \"%APPVEYOR_PULL_REQUEST_NUMBER%\"==\"\" SET runner_args=%sonar_commit%" - - cmd: "if not \"%APPVEYOR_PULL_REQUEST_NUMBER%\"==\"\" SET runner_args=%sonar_pr%" + - cmd: "if \"%APPVEYOR_PULL_REQUEST_NUMBER%\"==\"\" SET runner_args=%sonar_commit_new%" + - cmd: "if not \"%APPVEYOR_PULL_REQUEST_NUMBER%\"==\"\" SET runner_args=%sonar_pr_new%" - cmd: "dotnet sonarscanner begin %runner_args%" - - cmd: "dotnet build qlnet.sln /p:Configuration=Debug /logger:\"C:\\Program Files\\AppVeyor\\BuildAgent\\dotnetcore\\Appveyor.MSBuildLogger.dll\" /target:src\\qlnet" - - cmd: "dotnet sonarscanner end /d:\"sonar.login=%sonar_token%\"" - build: - project: QLNet.sln - verbosity: minimal - after_build: - - cmd: dotnet pack src/qlnet/qlnet.csproj -c Debug -o ./ + build_script: + - cmd: dotnet build -c Release artifacts: - path: .\*.nupkg name: ng @@ -86,39 +79,37 @@ file_version: '{version}' informational_version: '{version}' test_script: - - cmd: vstest.console /logger:Appveyor /TestCaseFilter:"TestCategory!=LongRun" "c:\projects\qlnet_develop\tests\QLNet.Tests\bin\Debug\net452\QLNet.Tests.dll" + - cmd: dotnet test -v=normal --no-build -p:Configuration=Release --collect "XPlat Code Coverage" -- DataCollectionRunSettings.DataCollectors.DataCollector.Configuration.Format=opencover + after_test: + - cmd: "dotnet sonarscanner end /d:\"sonar.login=%sonar_token_new%\"" + - cmd: dotnet pack src/qlnet/qlnet.csproj -c Release -o ./ deploy: - provider: NuGet api_key: - secure: HcilScZbZnJrCk5hoEPz9MSzKQanBzsQCfulI9gFpcT7wurwxIy3hwSwPfjXmr/v + secure: PfSWPcbGqOhlEhGG74+J7tmJMa5RU/N19DEyjVP2GUXGQG4MWBeTmrKE/W4A70dh skip_symbols: false artifact: ng # Configuration for "feature/*" branch -# build in Debug mode, run tests , deploy to Sonar +# build in Release mode, run tests , deploy to Nuget - branches: only: - /feature/ - version: 1.11.4-{build} - configuration: Debug + version: 1.12.0-{build} + configuration: Release platform: Any CPU image: Visual Studio 2019 skip_tags: true clone_folder: c:\projects\qlnet_feature init: + - cmd: set JAVA_HOME=C:\Program Files\Java\jdk11 - cmd: "set branch=%APPVEYOR_REPO_BRANCH%\necho branch:%branch%\nset gitVersion=%branch:/=.%\necho gitversion:%gitVersion%\nset newVersion=%gitVersion%.%APPVEYOR_BUILD_NUMBER%\necho %newVersion%" - - cmd: appveyor UpdateBuild -Version "1.11.4-%newVersion%" + - cmd: appveyor UpdateBuild -Version "1.12.0-%newVersion%" before_build: - cmd: dotnet restore qlnet.sln - build: - project: QLNet.sln - verbosity: minimal - after_build: - - cmd: dotnet pack src/qlnet/qlnet.csproj -c Debug -o ./ - artifacts: - - path: .\*.nupkg - name: ng + build_script: + - cmd: dotnet build -c Release dotnet_csproj: patch: true file: '**\*.csproj' @@ -131,18 +122,6 @@ do_not_increment_build_number: true nuget: disable_publish_on_pr: true - deploy: - - provider: NuGet - api_key: - secure: HcilScZbZnJrCk5hoEPz9MSzKQanBzsQCfulI9gFpcT7wurwxIy3hwSwPfjXmr/v - skip_symbols: true - artifact: ng - test: off -# test_script: -# - cmd: vstest.console /logger:Appveyor /TestCaseFilter:"TestCategory!=LongRun" "c:\projects\qlnet_feature\tests\QLNet.Tests\bin\Release\net45\QLNet.Tests.dll" + test_script: + - cmd: dotnet test -v=normal --no-build -p:Configuration=Release -# "fall back" configuration for all other branches -# no "branches" section defined -# do not deploy at all -- - configuration: Debug \ No newline at end of file diff --git a/src/BermudanSwaption/.editorconfig b/samples/BermudanSwaption/.editorconfig similarity index 100% rename from src/BermudanSwaption/.editorconfig rename to samples/BermudanSwaption/.editorconfig diff --git a/src/BermudanSwaption/BermudanSwaption.cs b/samples/BermudanSwaption/BermudanSwaption.cs similarity index 100% rename from src/BermudanSwaption/BermudanSwaption.cs rename to samples/BermudanSwaption/BermudanSwaption.cs diff --git a/src/BermudanSwaption/BermudanSwaption.csproj b/samples/BermudanSwaption/BermudanSwaption.csproj similarity index 70% rename from src/BermudanSwaption/BermudanSwaption.csproj rename to samples/BermudanSwaption/BermudanSwaption.csproj index 3e0f2f3a7..4711cfe4d 100644 --- a/src/BermudanSwaption/BermudanSwaption.csproj +++ b/samples/BermudanSwaption/BermudanSwaption.csproj @@ -1,8 +1,8 @@  - 1.11.4 - netcoreapp2.2 + 1.12.0 + net5.0 $(DefineConstants);QL_NEGATIVE_RATES BermudanSwaption BermudanSwaption @@ -12,7 +12,7 @@ - + \ No newline at end of file diff --git a/src/Bonds/.editorconfig b/samples/Bonds/.editorconfig similarity index 100% rename from src/Bonds/.editorconfig rename to samples/Bonds/.editorconfig diff --git a/src/Bonds/Bonds.cs b/samples/Bonds/Bonds.cs similarity index 100% rename from src/Bonds/Bonds.cs rename to samples/Bonds/Bonds.cs diff --git a/src/Bonds/Bonds.csproj b/samples/Bonds/Bonds.csproj similarity index 69% rename from src/Bonds/Bonds.csproj rename to samples/Bonds/Bonds.csproj index 3ee288e3e..d04a4fb8b 100644 --- a/src/Bonds/Bonds.csproj +++ b/samples/Bonds/Bonds.csproj @@ -1,8 +1,8 @@  - 1.11.4 - netcoreapp2.2 + 1.12.0 + net5.0 $(DefineConstants);QL_NEGATIVE_RATES Bonds Bonds @@ -12,7 +12,7 @@ - + \ No newline at end of file diff --git a/src/CVAIRS/CVAIRS.cs b/samples/CVAIRS/CVAIRS.cs similarity index 100% rename from src/CVAIRS/CVAIRS.cs rename to samples/CVAIRS/CVAIRS.cs diff --git a/src/CVAIRS/CVAIRS.csproj b/samples/CVAIRS/CVAIRS.csproj similarity index 69% rename from src/CVAIRS/CVAIRS.csproj rename to samples/CVAIRS/CVAIRS.csproj index a2070818c..0a51a59a5 100644 --- a/src/CVAIRS/CVAIRS.csproj +++ b/samples/CVAIRS/CVAIRS.csproj @@ -1,8 +1,8 @@  - 1.11.4 - netcoreapp2.2 + 1.12.0 + net5.0 $(DefineConstants);QL_NEGATIVE_RATES CVAIRS CVAIRS @@ -12,7 +12,7 @@ - + \ No newline at end of file diff --git a/src/CallableBonds/.editorconfig b/samples/CallableBonds/.editorconfig similarity index 100% rename from src/CallableBonds/.editorconfig rename to samples/CallableBonds/.editorconfig diff --git a/src/CallableBonds/CallableBonds.cs b/samples/CallableBonds/CallableBonds.cs similarity index 97% rename from src/CallableBonds/CallableBonds.cs rename to samples/CallableBonds/CallableBonds.cs index 5b84baedb..f361285d6 100644 --- a/src/CallableBonds/CallableBonds.cs +++ b/samples/CallableBonds/CallableBonds.cs @@ -41,7 +41,7 @@ static YieldTermStructure flatRate(Date today, static void Main(string[] args) { - // boost::timer timer; + DateTime timer = DateTime.Now; Date today = new Date(16, Month.October, 2007); Settings.setEvaluationDate(today); @@ -234,6 +234,12 @@ Therefore use ActAct(Bond) maxIterations)); Console.WriteLine("Bloomberg price/yld (%) 77,31 / 10,65"); + + Console.WriteLine(" \nRun completed in {0}", DateTime.Now - timer); + Console.WriteLine(); + + Console.Write("Press any key to continue ..."); + Console.ReadKey(); } } } diff --git a/src/CallableBonds/CallableBonds.csproj b/samples/CallableBonds/CallableBonds.csproj similarity index 70% rename from src/CallableBonds/CallableBonds.csproj rename to samples/CallableBonds/CallableBonds.csproj index 3bd8951d0..ea0b02cb8 100644 --- a/src/CallableBonds/CallableBonds.csproj +++ b/samples/CallableBonds/CallableBonds.csproj @@ -1,8 +1,8 @@  - 1.11.4 - netcoreapp2.2 + 1.12.0 + net5.0 $(DefineConstants);QL_NEGATIVE_RATES CallableBonds CallableBonds @@ -12,7 +12,7 @@ - + \ No newline at end of file diff --git a/src/ConvertibleBonds/.editorconfig b/samples/ConvertibleBonds/.editorconfig similarity index 100% rename from src/ConvertibleBonds/.editorconfig rename to samples/ConvertibleBonds/.editorconfig diff --git a/src/ConvertibleBonds/ConvertibleBonds.cs b/samples/ConvertibleBonds/ConvertibleBonds.cs similarity index 97% rename from src/ConvertibleBonds/ConvertibleBonds.cs rename to samples/ConvertibleBonds/ConvertibleBonds.cs index 088d577fb..f23c5742d 100644 --- a/src/ConvertibleBonds/ConvertibleBonds.cs +++ b/samples/ConvertibleBonds/ConvertibleBonds.cs @@ -29,6 +29,7 @@ static void Main(string[] args) { try { + DateTime timer = DateTime.Now; Option.Type type = Option.Type.Put; double underlying = 36.0; double spreadRate = 0.005; @@ -189,12 +190,15 @@ static void Main(string[] args) Console.WriteLine("Joshi4 {0:0.000000} {1:0.000000}", europeanBond.NPV(), americanBond.NPV()); Console.WriteLine("==========================================================================="); + + Console.WriteLine(" \nRun completed in {0}", DateTime.Now - timer); + Console.WriteLine(); } catch (Exception e) { Console.WriteLine(e.ToString()); } - + Console.Write("Press any key to continue ..."); Console.ReadKey(); } } diff --git a/src/ConvertibleBonds/ConvertibleBonds.csproj b/samples/ConvertibleBonds/ConvertibleBonds.csproj similarity index 70% rename from src/ConvertibleBonds/ConvertibleBonds.csproj rename to samples/ConvertibleBonds/ConvertibleBonds.csproj index f72360479..0393fbc86 100644 --- a/src/ConvertibleBonds/ConvertibleBonds.csproj +++ b/samples/ConvertibleBonds/ConvertibleBonds.csproj @@ -1,8 +1,8 @@  - 1.11.3 - netcoreapp2.2 + 1.12.0 + net5.0 $(DefineConstants);QL_NEGATIVE_RATES ConvertibleBonds ConvertibleBonds @@ -12,7 +12,7 @@ - + \ No newline at end of file diff --git a/src/EquityOption/.editorconfig b/samples/EquityOption/.editorconfig similarity index 100% rename from src/EquityOption/.editorconfig rename to samples/EquityOption/.editorconfig diff --git a/src/EquityOption/EquityOption.cs b/samples/EquityOption/EquityOption.cs similarity index 100% rename from src/EquityOption/EquityOption.cs rename to samples/EquityOption/EquityOption.cs diff --git a/src/EquityOption/EquityOption.csproj b/samples/EquityOption/EquityOption.csproj similarity index 69% rename from src/EquityOption/EquityOption.csproj rename to samples/EquityOption/EquityOption.csproj index a113caedd..e74f393d7 100644 --- a/src/EquityOption/EquityOption.csproj +++ b/samples/EquityOption/EquityOption.csproj @@ -1,8 +1,8 @@  - 1.11.4 - netcoreapp2.2 + 1.12.0 + net5.0 $(DefineConstants);QL_NEGATIVE_RATES EquityOption EquityOption @@ -12,7 +12,7 @@ - + \ No newline at end of file diff --git a/src/FRA/.editorconfig b/samples/FRA/.editorconfig similarity index 100% rename from src/FRA/.editorconfig rename to samples/FRA/.editorconfig diff --git a/src/FRA/FRA.cs b/samples/FRA/FRA.cs similarity index 100% rename from src/FRA/FRA.cs rename to samples/FRA/FRA.cs diff --git a/src/FRA/FRA.csproj b/samples/FRA/FRA.csproj similarity index 68% rename from src/FRA/FRA.csproj rename to samples/FRA/FRA.csproj index 00a485750..fa6bc80df 100644 --- a/src/FRA/FRA.csproj +++ b/samples/FRA/FRA.csproj @@ -1,8 +1,8 @@  - 1.11.4 - netcoreapp2.2 + 1.12.0 + net5.0 $(DefineConstants);QL_NEGATIVE_RATES FRA FRA @@ -12,7 +12,7 @@ - + \ No newline at end of file diff --git a/src/FittedBondCurve/.editorconfig b/samples/FittedBondCurve/.editorconfig similarity index 100% rename from src/FittedBondCurve/.editorconfig rename to samples/FittedBondCurve/.editorconfig diff --git a/src/FittedBondCurve/FittedBondCurve.cs b/samples/FittedBondCurve/FittedBondCurve.cs similarity index 100% rename from src/FittedBondCurve/FittedBondCurve.cs rename to samples/FittedBondCurve/FittedBondCurve.cs diff --git a/src/FittedBondCurve/FittedBondCurve.csproj b/samples/FittedBondCurve/FittedBondCurve.csproj similarity index 70% rename from src/FittedBondCurve/FittedBondCurve.csproj rename to samples/FittedBondCurve/FittedBondCurve.csproj index 11d8b7646..d56cd0da8 100644 --- a/src/FittedBondCurve/FittedBondCurve.csproj +++ b/samples/FittedBondCurve/FittedBondCurve.csproj @@ -1,8 +1,8 @@  - 1.11.4 - netcoreapp2.2 + 1.12.0 + net5.0 $(DefineConstants);QL_NEGATIVE_RATES FittedBondCurve FittedBondCurve @@ -12,7 +12,7 @@ - + \ No newline at end of file diff --git a/samples/QLNetSamples.sln b/samples/QLNetSamples.sln new file mode 100644 index 000000000..7535f221b --- /dev/null +++ b/samples/QLNetSamples.sln @@ -0,0 +1,79 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BermudanSwaption", "BermudanSwaption\BermudanSwaption.csproj", "{4C9EC66E-F80F-4672-9460-522B94919225}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bonds", "Bonds\Bonds.csproj", "{6A6916BE-F23A-4ABC-8C81-09C8BB6150FA}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CallableBonds", "CallableBonds\CallableBonds.csproj", "{50CF8B1B-659B-4FDE-B1F7-F13B3F92EC80}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ConvertibleBonds", "ConvertibleBonds\ConvertibleBonds.csproj", "{DC8161DD-4F0B-4263-93F7-174967B305B6}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CVAIRS", "CVAIRS\CVAIRS.csproj", "{B06EF28F-A0D8-4FB3-B5F1-A0331A4A5EAE}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "EquityOption", "EquityOption\EquityOption.csproj", "{0B973D4E-B4AA-4C46-B063-5C1BA92534F4}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FittedBondCurve", "FittedBondCurve\FittedBondCurve.csproj", "{9E7D6F21-2670-4026-B4BE-9BAC14222F9B}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FRA", "FRA\FRA.csproj", "{35FB331F-A5CE-40EA-96F2-0D78A9BA4761}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Repo", "Repo\Repo.csproj", "{0AABC9A5-A855-4871-ABB5-EF7CE967112D}" +EndProject +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Swap", "Swap\Swap.csproj", "{8B065C68-3BF3-4B62-9CFB-8A8B8084DB10}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4C9EC66E-F80F-4672-9460-522B94919225}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4C9EC66E-F80F-4672-9460-522B94919225}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4C9EC66E-F80F-4672-9460-522B94919225}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4C9EC66E-F80F-4672-9460-522B94919225}.Release|Any CPU.Build.0 = Release|Any CPU + {6A6916BE-F23A-4ABC-8C81-09C8BB6150FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6A6916BE-F23A-4ABC-8C81-09C8BB6150FA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6A6916BE-F23A-4ABC-8C81-09C8BB6150FA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6A6916BE-F23A-4ABC-8C81-09C8BB6150FA}.Release|Any CPU.Build.0 = Release|Any CPU + {50CF8B1B-659B-4FDE-B1F7-F13B3F92EC80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {50CF8B1B-659B-4FDE-B1F7-F13B3F92EC80}.Debug|Any CPU.Build.0 = Debug|Any CPU + {50CF8B1B-659B-4FDE-B1F7-F13B3F92EC80}.Release|Any CPU.ActiveCfg = Release|Any CPU + {50CF8B1B-659B-4FDE-B1F7-F13B3F92EC80}.Release|Any CPU.Build.0 = Release|Any CPU + {DC8161DD-4F0B-4263-93F7-174967B305B6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {DC8161DD-4F0B-4263-93F7-174967B305B6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {DC8161DD-4F0B-4263-93F7-174967B305B6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {DC8161DD-4F0B-4263-93F7-174967B305B6}.Release|Any CPU.Build.0 = Release|Any CPU + {B06EF28F-A0D8-4FB3-B5F1-A0331A4A5EAE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {B06EF28F-A0D8-4FB3-B5F1-A0331A4A5EAE}.Debug|Any CPU.Build.0 = Debug|Any CPU + {B06EF28F-A0D8-4FB3-B5F1-A0331A4A5EAE}.Release|Any CPU.ActiveCfg = Release|Any CPU + {B06EF28F-A0D8-4FB3-B5F1-A0331A4A5EAE}.Release|Any CPU.Build.0 = Release|Any CPU + {0B973D4E-B4AA-4C46-B063-5C1BA92534F4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0B973D4E-B4AA-4C46-B063-5C1BA92534F4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0B973D4E-B4AA-4C46-B063-5C1BA92534F4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0B973D4E-B4AA-4C46-B063-5C1BA92534F4}.Release|Any CPU.Build.0 = Release|Any CPU + {9E7D6F21-2670-4026-B4BE-9BAC14222F9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {9E7D6F21-2670-4026-B4BE-9BAC14222F9B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {9E7D6F21-2670-4026-B4BE-9BAC14222F9B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {9E7D6F21-2670-4026-B4BE-9BAC14222F9B}.Release|Any CPU.Build.0 = Release|Any CPU + {35FB331F-A5CE-40EA-96F2-0D78A9BA4761}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {35FB331F-A5CE-40EA-96F2-0D78A9BA4761}.Debug|Any CPU.Build.0 = Debug|Any CPU + {35FB331F-A5CE-40EA-96F2-0D78A9BA4761}.Release|Any CPU.ActiveCfg = Release|Any CPU + {35FB331F-A5CE-40EA-96F2-0D78A9BA4761}.Release|Any CPU.Build.0 = Release|Any CPU + {0AABC9A5-A855-4871-ABB5-EF7CE967112D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0AABC9A5-A855-4871-ABB5-EF7CE967112D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0AABC9A5-A855-4871-ABB5-EF7CE967112D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0AABC9A5-A855-4871-ABB5-EF7CE967112D}.Release|Any CPU.Build.0 = Release|Any CPU + {8B065C68-3BF3-4B62-9CFB-8A8B8084DB10}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {8B065C68-3BF3-4B62-9CFB-8A8B8084DB10}.Debug|Any CPU.Build.0 = Debug|Any CPU + {8B065C68-3BF3-4B62-9CFB-8A8B8084DB10}.Release|Any CPU.ActiveCfg = Release|Any CPU + {8B065C68-3BF3-4B62-9CFB-8A8B8084DB10}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {04D03353-28CB-4921-860D-84AECB553766} + EndGlobalSection +EndGlobal diff --git a/src/Repo/.editorconfig b/samples/Repo/.editorconfig similarity index 100% rename from src/Repo/.editorconfig rename to samples/Repo/.editorconfig diff --git a/src/Repo/Repo.cs b/samples/Repo/Repo.cs similarity index 100% rename from src/Repo/Repo.cs rename to samples/Repo/Repo.cs diff --git a/src/Repo/Repo.csproj b/samples/Repo/Repo.csproj similarity index 68% rename from src/Repo/Repo.csproj rename to samples/Repo/Repo.csproj index 3666adf77..e199f27b1 100644 --- a/src/Repo/Repo.csproj +++ b/samples/Repo/Repo.csproj @@ -1,8 +1,8 @@  - 1.11.4 - netcoreapp2.2 + 1.12.0 + net5.0 $(DefineConstants);QL_NEGATIVE_RATES Repo Repo @@ -12,7 +12,7 @@ - + \ No newline at end of file diff --git a/src/Swap/.editorconfig b/samples/Swap/.editorconfig similarity index 100% rename from src/Swap/.editorconfig rename to samples/Swap/.editorconfig diff --git a/src/Swap/Swap.csproj b/samples/Swap/Swap.csproj similarity index 68% rename from src/Swap/Swap.csproj rename to samples/Swap/Swap.csproj index b11a3a233..b4b2f26af 100644 --- a/src/Swap/Swap.csproj +++ b/samples/Swap/Swap.csproj @@ -1,8 +1,8 @@  - 1.11.4 - netcoreapp2.2 + 1.12.0 + net5.0 $(DefineConstants);QL_NEGATIVE_RATES Swap Swap @@ -12,7 +12,7 @@ - + \ No newline at end of file diff --git a/src/Swap/swapvaluation.cs b/samples/Swap/swapvaluation.cs similarity index 100% rename from src/Swap/swapvaluation.cs rename to samples/Swap/swapvaluation.cs diff --git a/src/VB/Swap/Swapvaluation.vb b/samples/VB/Swap/Swapvaluation.vb similarity index 100% rename from src/VB/Swap/Swapvaluation.vb rename to samples/VB/Swap/Swapvaluation.vb diff --git a/src/QLNet.Old/AssemblyInfo.cs b/src/QLNet.Old/AssemblyInfo.cs deleted file mode 100644 index 9bb80a985..000000000 --- a/src/QLNet.Old/AssemblyInfo.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -// Le informazioni generali relative a un assembly sono controllate dal seguente -// insieme di attributi. Per modificare le informazioni associate a un assembly -// occorre quindi modificare i valori di questi attributi. -[assembly: AssemblyTitle("QLNet")] -[assembly: AssemblyDescription("A free/open-source library for quantitative finance")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("QLNet")] -[assembly: AssemblyCopyright("Copyright (c) 2008-2020 Andrea Maggiulli (a.maggiulli@gmail.com)")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Se si imposta ComVisible su false, i tipi in questo assembly non saranno visibili -// ai componenti COM. Se è necessario accedere a un tipo in questo assembly da -// COM, impostare su true l'attributo ComVisible per tale tipo. -[assembly: ComVisible(false)] - -// Se il progetto viene esposto a COM, il GUID che segue verrà utilizzato per creare l'ID della libreria dei tipi -[assembly: Guid("3595e2b1-f95c-4ddb-bd92-908610e7542d")] - -// Le informazioni sulla versione di un assembly sono costituite dai seguenti quattro valori: -// -// Numero di versione principale -// Numero di versione secondario -// Numero build -// Revisione -// -// È 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.11.4.0")] -[assembly: AssemblyFileVersion("1.11.4.0")] diff --git a/src/QLNet.Old/Cashflows/.gitkeep b/src/QLNet.Old/Cashflows/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Currencies/.gitkeep b/src/QLNet.Old/Currencies/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Extensions/.gitkeep b/src/QLNet.Old/Extensions/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Indexes/Ibor/.gitkeep b/src/QLNet.Old/Indexes/Ibor/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Indexes/Inflation/.gitkeep b/src/QLNet.Old/Indexes/Inflation/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Indexes/Swap/.gitkeep b/src/QLNet.Old/Indexes/Swap/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Instruments/Bonds/.gitkeep b/src/QLNet.Old/Instruments/Bonds/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Math/Distributions/.gitkeep b/src/QLNet.Old/Math/Distributions/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Math/Interpolations/.gitkeep b/src/QLNet.Old/Math/Interpolations/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Math/Optimization/.gitkeep b/src/QLNet.Old/Math/Optimization/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Math/Solvers1d/.gitkeep b/src/QLNet.Old/Math/Solvers1d/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Math/integrals/.gitkeep b/src/QLNet.Old/Math/integrals/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Math/matrixutilities/.gitkeep b/src/QLNet.Old/Math/matrixutilities/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Math/randomnumbers/.gitkeep b/src/QLNet.Old/Math/randomnumbers/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Math/statistics/.gitkeep b/src/QLNet.Old/Math/statistics/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Methods/Finitedifferences/.gitkeep b/src/QLNet.Old/Methods/Finitedifferences/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Methods/lattices/.gitkeep b/src/QLNet.Old/Methods/lattices/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Methods/montecarlo/.gitkeep b/src/QLNet.Old/Methods/montecarlo/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Models/Equity/.gitkeep b/src/QLNet.Old/Models/Equity/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Models/MarketModels/BrownianGenerators/.gitkeep b/src/QLNet.Old/Models/MarketModels/BrownianGenerators/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Models/Shortrate/Onefactormodels/.gitkeep b/src/QLNet.Old/Models/Shortrate/Onefactormodels/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Models/Shortrate/Twofactorsmodels/.gitkeep b/src/QLNet.Old/Models/Shortrate/Twofactorsmodels/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Models/Shortrate/calibrationhelpers/.gitkeep b/src/QLNet.Old/Models/Shortrate/calibrationhelpers/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Patterns/.gitkeep b/src/QLNet.Old/Patterns/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Pricingengines/Basket/.gitkeep b/src/QLNet.Old/Pricingengines/Basket/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Pricingengines/Bond/.gitkeep b/src/QLNet.Old/Pricingengines/Bond/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Pricingengines/CapFloor/.gitkeep b/src/QLNet.Old/Pricingengines/CapFloor/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Pricingengines/Cliquet/.gitkeep b/src/QLNet.Old/Pricingengines/Cliquet/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Pricingengines/Forward/.gitkeep b/src/QLNet.Old/Pricingengines/Forward/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Pricingengines/Loan/.gitkeep b/src/QLNet.Old/Pricingengines/Loan/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Pricingengines/Lookback/.gitkeep b/src/QLNet.Old/Pricingengines/Lookback/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Pricingengines/Swap/.gitkeep b/src/QLNet.Old/Pricingengines/Swap/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Pricingengines/asian/.gitkeep b/src/QLNet.Old/Pricingengines/asian/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Pricingengines/barrier/.gitkeep b/src/QLNet.Old/Pricingengines/barrier/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Pricingengines/credit/.gitkeep b/src/QLNet.Old/Pricingengines/credit/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Pricingengines/inflation/.gitkeep b/src/QLNet.Old/Pricingengines/inflation/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Pricingengines/swaption/.gitkeep b/src/QLNet.Old/Pricingengines/swaption/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Pricingengines/vanilla/.gitkeep b/src/QLNet.Old/Pricingengines/vanilla/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/QLNet.Old.csproj b/src/QLNet.Old/QLNet.Old.csproj deleted file mode 100644 index 9fd82e324..000000000 --- a/src/QLNet.Old/QLNet.Old.csproj +++ /dev/null @@ -1,2154 +0,0 @@ - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {F6E762BD-DCDF-4CA0-ABAD-CB21C7D03BEC} - Library - Properties - QLNet - QLNet - - - 3.5 - - - v4.5.2 - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - false - true - - - - true - full - false - bin\Debug\net40\ - TRACE;DEBUG;QL_NEGATIVE_RATES,NET452 - prompt - 4 - false - AllRules.ruleset - false - - - pdbonly - true - bin\Release\net40\ - TRACE;QL_NEGATIVE_RATES,QL_DOTNET_FRAMEWORK - prompt - 4 - AllRules.ruleset - false - - - true - bin\Debug\net45\ - TRACE;DEBUG;QL_NEGATIVE_RATES,QL_DOTNET_FRAMEWORK - full - v4.5.2 - AnyCPU - prompt - AllRules.ruleset - false - - - bin\Release\net45\ - TRACE;QL_NEGATIVE_RATES,QL_DOTNET_FRAMEWORK - true - pdbonly - v4.6 - AnyCPU - prompt - AllRules.ruleset - false - - - - - - - - - - - Cashflows\AverageBMACoupon.cs - - - Cashflows\CappedFlooredCoupon.cs - - - Cashflows\CappedFlooredYoYInflationCoupon.cs - - - Cashflows\CashFlows.cs - - - Cashflows\Cashflowvectors.cs - - - Cashflows\CmsCoupon.cs - - - Cashflows\ConundrumPricer.cs - - - Cashflows\Coupon.cs - - - Cashflows\CouponPricer.cs - - - Cashflows\CPICoupon.cs - - - Cashflows\CPICouponPricer.cs - - - Cashflows\DigitalCmsCoupon.cs - - - Cashflows\DigitalCoupon.cs - - - Cashflows\DigitalIborCoupon.cs - - - Cashflows\Dividend.cs - - - Cashflows\FixedRateCoupon.cs - - - Cashflows\FloatingRateCoupon.cs - - - Cashflows\IborCoupon.cs - - - Cashflows\IndexedCashFlow.cs - - - Cashflows\InflationCoupon.cs - - - Cashflows\InflationCouponPricer.cs - - - Cashflows\LinearTsrPricer.cs - - - Cashflows\OvernightIndexedCoupon.cs - - - Cashflows\Principal.cs - - - Cashflows\PrincipalLegBase.cs - - - Cashflows\RangeAccrual.cs - - - Cashflows\RateLegBase.cs - - - Cashflows\Replication.cs - - - Cashflows\SimpleCashFlow.cs - - - Cashflows\YoYInflationCoupon.cs - - - Currencies\Africa.cs - - - Currencies\America.cs - - - Currencies\Asia.cs - - - Currencies\Currency.cs - - - Currencies\Europe.cs - - - Currencies\ExchangeRate.cs - - - Currencies\ExchangeRateManager.cs - - - Currencies\Oceania.cs - - - - - - Exceptions\InvalidPriceSignException.cs - - - Exceptions\MaxNumberFuncEvalExceeded.cs - - - Exceptions\NotTradableException.cs - - - Exceptions\NullEffectiveDateException.cs - - - Exceptions\QLNetExceptionEnum.cs - - - Exceptions\RootNotBracketException.cs - - - Extensions\DoubleExtension.cs - - - Extensions\ListExtension.cs - - - - - - Indexes\BMAIndex.cs - - - Indexes\IborIndex.cs - - - Indexes\Ibor\Aonia.cs - - - Indexes\Ibor\Audlibor.cs - - - Indexes\Ibor\Bbsw.cs - - - Indexes\Ibor\Bkbm.cs - - - Indexes\Ibor\Cadlibor.cs - - - Indexes\Ibor\Cdor.cs - - - Indexes\Ibor\Chflibor.cs - - - Indexes\Ibor\Dkklibor.cs - - - Indexes\Ibor\Eonia.cs - - - Indexes\Ibor\Euribor.cs - - - Indexes\Ibor\Eurlibor.cs - - - Indexes\Ibor\FedFunds.cs - - - Indexes\Ibor\Gbplibor.cs - - - Indexes\Ibor\Jibar.cs - - - Indexes\Ibor\Jpylibor.cs - - - Indexes\Ibor\Libor.cs - - - Indexes\Ibor\Nzdlibor.cs - - - Indexes\Ibor\Nzocr.cs - - - Indexes\Ibor\Seklibor.cs - - - Indexes\Ibor\Shibor.cs - - - Indexes\Ibor\Sonia.cs - - - Indexes\Ibor\Tibor.cs - - - Indexes\Ibor\Trylibor.cs - - - Indexes\Ibor\Usdlibor.cs - - - Indexes\Ibor\Zibor.cs - - - Indexes\Indexmanager.cs - - - Indexes\InflationIndex.cs - - - Indexes\Inflation\AUCPI.cs - - - Indexes\Inflation\EUHICP.cs - - - Indexes\Inflation\FRHICP.cs - - - Indexes\Inflation\UKRPI.cs - - - Indexes\Inflation\USCPI.cs - - - Indexes\Inflation\ZACPI.cs - - - Indexes\InterestRateIndex.cs - - - Indexes\Region.cs - - - Indexes\Swapindex.cs - - - Indexes\Swap\ChfLiborSwap.cs - - - Indexes\Swap\EuriborSwap.cs - - - Indexes\Swap\EurLiborSwap.cs - - - Indexes\Swap\GbpLiborSwap.cs - - - Indexes\Swap\JpyLiborSwap.cs - - - Indexes\Swap\UsdLiborSwap.cs - - - Instruments\AsianOption.cs - - - Code - Instruments\AssetSwap.cs - - - Instruments\AverageType.cs - - - Instruments\BarrierOption.cs - - - Instruments\BarrierType.cs - - - Instruments\BasisSwap.cs - - - Instruments\BasketOption.cs - - - Instruments\BMASwap.cs - - - Instruments\Bond.cs - - - Instruments\Bonds\AmortizingBond.cs - - - Instruments\Bonds\AmortizingCmsRateBond.cs - - - Instruments\Bonds\AmortizingFixedRateBond.cs - - - Instruments\Bonds\AmortizingFloatingRateBond.cs - - - Instruments\Bonds\BondFactory.cs - - - Instruments\Bonds\BTP.cs - - - Instruments\Bonds\CallableBond.cs - - - Instruments\Bonds\CmsRateBond.cs - - - Instruments\Bonds\ConstantCPR.cs - - - Instruments\Bonds\ConvertibleBond.cs - - - Instruments\Bonds\CPIBond.cs - - - Instruments\Bonds\DiscretizedCallableFixedRateBond.cs - - - Instruments\Bonds\FixedRateBond.cs - - - Instruments\Bonds\FloatingRateBond.cs - - - Instruments\Bonds\IPrepayModel.cs - - - Instruments\Bonds\MBSFixedRateBond.cs - - - Instruments\Bonds\PSACurve.cs - - - Instruments\Bonds\Zerocouponbond.cs - - - Instruments\Callability.cs - - - Instruments\CapFloor.cs - - - Instruments\Claim.cs - - - Instruments\CliquetOption.cs - - - Instruments\CompositeInstrument.cs - - - Instruments\CouponConversionSchedule.cs - - - Instruments\CPICapFloor.cs - - - Instruments\CPISwap.cs - - - Instruments\CreditDefaultSwap.cs - - - Instruments\DividendBarrierOption.cs - - - Instruments\DividendSchedule.cs - - - Instruments\DividendVanillaOption.cs - - - Instruments\DoubleBarrierOption.cs - - - Instruments\EuropeanOption.cs - - - Instruments\FixedRateBondForward.cs - - - Instruments\Forward.cs - - - Instruments\ForwardRateAgreement.cs - - - Instruments\ForwardVanillaOption.cs - - - Instruments\Futures.cs - - - Instruments\ImpliedVolatility.cs - - - Instruments\InflationCapFloor.cs - - - Instruments\Instrument.cs - - - Instruments\Loan.cs - - - Instruments\LookbackOption.cs - - - Instruments\MakeBasisSwap.cs - - - Instruments\MakeCapFloor.cs - - - Instruments\MakeCms.cs - - - Instruments\MakeLoans.cs - - - Instruments\MakeOIS.cs - - - Instruments\MakeCDS.cs - - - Instruments\Makeswaption.cs - - - Instruments\Makevanillaswap.cs - - - Instruments\MultiAssetOption.cs - - - Instruments\OneAssetOption.cs - - - Instruments\OvernightIndexedSwap.cs - - - - Instruments\Stock.cs - - - Instruments\Swap.cs - - - Instruments\Swaption.cs - - - Instruments\VanillaOption.cs - - - Instruments\VanillaSwap.cs - - - Instruments\YearOnYearInflationSwap.cs - - - Instruments\ZeroCouponInflationSwap.cs - - - InterestRate.cs - - - legacy\libormarketmodels\LfmCovarParam.cs - - - legacy\libormarketmodels\LfmCovarianceProxy.cs - - - legacy\libormarketmodels\lfmhullwhiteparam.cs - - - legacy\libormarketmodels\LfmProcess.cs - - - legacy\libormarketmodels\LfmSwaptionEngine.cs - - - legacy\libormarketmodels\LiborForwardModel.cs - - - legacy\libormarketmodels\LmConstWrapperCorrModel.cs - - - legacy\libormarketmodels\LmConstWrapperVolModel.cs - - - legacy\libormarketmodels\LmCorrModel.cs - - - legacy\libormarketmodels\LmExpCorrModel.cs - - - legacy\libormarketmodels\LmExtLinExpVolModel.cs - - - legacy\libormarketmodels\LmFixedVolModel.cs - - - legacy\libormarketmodels\LmLinExpCorrModel.cs - - - legacy\libormarketmodels\LmLinExpVolModel.cs - - - legacy\libormarketmodels\LmVolModel.cs - - - Math\AbcdMathFunction.cs - - - Math\BernsteinPolynomial.cs - - - Math\beta.cs - - - Math\BSpline.cs - - - Math\Comparison.cs - - - Math\FastFourierTransform.cs - - - Math\NumericalDifferentiation.cs - - - Math\integrals\GaussLobattoIntegral.cs - - - Math\integrals\DiscreteIntegrals.cs - - - Math\Interpolations\Abcdinterpolation.cs - - - Math\Interpolations\BackwardflatLinearInterpolation.cs - - - Math\Interpolations\FlatExtrapolator2D.cs - - - Math\Interpolations\MixedInterpolation.cs - - - Math\Interpolations\VannaVolgaInterpolation.cs - - - Math\Interpolations\SviInterpolation.cs - - - Math\Optimization\BFGS.cs - - - Math\Optimization\CostFunction.cs - - - Math\Optimization\DifferentialEvolution.cs - - - Math\Distributions\BinomialDistribution.cs - - - Math\Distributions\BivariateNormalDistribution.cs - - - Math\Distributions\ChiSquareDistribution.cs - - - Math\Distributions\GammaDistribution.cs - - - Math\Distributions\NormalDistribution.cs - - - Math\Distributions\PoissonDistribution.cs - - - Math\Factorial.cs - - - Math\integrals\GaussianOrthogonalPolynomial.cs - - - Math\integrals\GaussianQuadratures.cs - - - Math\integrals\Integral.cs - - - Math\integrals\Kronrodintegral.cs - - - Math\integrals\Segmentintegral.cs - - - Math\integrals\SimpsonIntegral.cs - - - Math\integrals\TrapezoidIntegral.cs - - - Math\Interpolations\BackwardFlatInterpolation.cs - - - Math\Interpolations\BicubicSplineInterpolation.cs - - - Math\Interpolations\BilinearInterpolation.cs - - - Math\Interpolations\ConvexMonotoneInterpolation.cs - - - Math\Interpolations\CubicInterpolation.cs - - - Math\Interpolations\Extrapolator.cs - - - Math\Interpolation.cs - - - Math\Interpolations\ForwardFlatInterpolation.cs - - - Math\Interpolations\Interpolation2D.cs - - - Math\Interpolations\KernelInterpolation.cs - - - Math\Interpolations\KernelInterpolation2D.cs - - - Math\Interpolations\Linearinterpolation.cs - - - Math\Interpolations\Loginterpolation.cs - - - Math\Interpolations\MultiCubicSpline.cs - - - Math\Interpolations\SABRInterpolation.cs - - - Math\Interpolations\XABRInterpolation.cs - - - Math\KernelFunctions.cs - - - Math\matrixutilities\TqrEigenDecomposition.cs - - - Math\matrixutilities\BiCGStab.cs - - - Math\matrixutilities\GMRES.cs - - - Math\ODE\AdaptiveRungeKutta.cs - - - Math\matrixutilities\SparseMatrix.cs - - - Math\LinearLeastSquaresRegression.cs - - - Math\Matrix.cs - - - Math\matrixutilities\CholeskyDecomposition.cs - - - Math\matrixutilities\PseudoSqrt.cs - - - Math\matrixutilities\QRDecomposition.cs - - - Math\matrixutilities\SVD.cs - - - Math\matrixutilities\SymmetricSchurDecomposition.cs - - - Math\ModifiedBessel.cs - - - Math\Optimization\ArmijoLineSearch.cs - - - Math\Optimization\ConjugateGradient.cs - - - Math\Optimization\Constraint.cs - - - Math\Optimization\EndCriteria.cs - - - Math\Optimization\GoldsteinLineSearch.cs - - - Math\Optimization\LeastSquareProblem.cs - - - Math\Optimization\levenbergmarquardt.cs - - - Math\Optimization\LineSearch.cs - - - Math\Optimization\LineSearchBasedMethod.cs - - - Math\Optimization\LmDif.cs - - - Math\Optimization\Method.cs - - - Math\Optimization\Problem.cs - - - Math\Optimization\ProjectedConstraint.cs - - - Math\Optimization\ProjectedCostFunction.cs - - - Math\Optimization\Projection.cs - - - Math\Optimization\Simplex.cs - - - Math\Optimization\SteepestDescent.cs - - - Math\PascalTriangle.cs - - - Math\PolynomialFunction.cs - - - Math\PrimeNumbers.cs - - - Math\randomnumbers\Haltonrsg.cs - - - Math\randomnumbers\InverseCumulativeRng.cs - - - Math\randomnumbers\InverseCumulativeRsg.cs - - - Math\randomnumbers\MT19937UniformRng.cs - - - Math\randomnumbers\PrimitivePolynomials.cs - - - Math\randomnumbers\RandomSequenceGenerator.cs - - - Math\randomnumbers\RNGTraits.cs - - - Math\randomnumbers\SeedGenerator.cs - - - Math\randomnumbers\SobolBrownianBridgeRsg.cs - - - Math\randomnumbers\SobolRsg.cs - - - Math\randomnumbers\SobolRsg2.cs - - - Math\RichardsonExtrapolation.cs - - - Math\SampledCurve.cs - - - Math\Solver1d.cs - - - Math\Rounding.cs - - - Code - Math\Solvers1d\Bisection.cs - - - Code - Math\Solvers1d\Brent.cs - - - Code - Math\Solvers1d\FalsePosition.cs - - - Math\Solvers1d\FiniteDifferenceNewtonSafe.cs - - - Math\Solvers1d\Newton.cs - - - Math\Solvers1d\Newtonsafe.cs - - - Code - Math\Solvers1d\Ridder.cs - - - Math\Solvers1d\Secant.cs - - - Math\statistics\ConvergenceStatistics.cs - - - Math\statistics\DiscrepancyStatistics.cs - - - Math\statistics\GaussianStatistics.cs - - - Math\statistics\GeneralStatistics.cs - - - Math\statistics\IncrementalStatistics.cs - - - Math\statistics\RiskStatistics.cs - - - Math\statistics\SequenceStatistics.cs - - - Math\TransformedGrid.cs - - - Math\Vector.cs - - - Methods\Finitedifferences\AmericanCondition.cs - - - Methods\Finitedifferences\BoundaryCondition.cs - - - Methods\Finitedifferences\BSMOperator.cs - - - Methods\Finitedifferences\CrankNicolson.cs - - - Methods\Finitedifferences\DPlus.cs - - - Methods\Finitedifferences\DMinus.cs - - - Methods\Finitedifferences\ExplicitEuler.cs - - - Methods\Finitedifferences\ImplicitEuler.cs - - - Methods\Finitedifferences\TRBDF2.cs - - - Methods\Finitedifferences\DPlusDMinus.cs - - - Methods\Finitedifferences\DZero.cs - - - Methods\Finitedifferences\ZeroCondition.cs - - - Methods\Finitedifferences\FiniteDifferenceModel.cs - - - Methods\Finitedifferences\MixedScheme.cs - - - Methods\Finitedifferences\OperatorFactory.cs - - - Methods\Finitedifferences\ParallelEvolver.cs - - - Methods\Finitedifferences\Pde.cs - - - Methods\Finitedifferences\PdeBsm.cs - - - Methods\Finitedifferences\PdeShortRate.cs - - - Methods\Finitedifferences\ShoutCondition.cs - - - Methods\Finitedifferences\StepCondition.cs - - - Methods\Finitedifferences\TridiagonalOperator.cs - - - Methods\Finitedifferences\Meshers\Concentrating1dMesher.cs - - - Methods\Finitedifferences\Meshers\Fdm1dMesher.cs - - - Methods\Finitedifferences\Meshers\FdmSimpleProcess1dMesher.cs - - - Methods\Finitedifferences\Meshers\FdmBlackScholesMesher.cs - - - Methods\Finitedifferences\Meshers\FdmMesher.cs - - - Methods\Finitedifferences\Meshers\FdmMesherComposite.cs - - - Methods\Finitedifferences\Meshers\Uniform1dMesher.cs - - - Methods\Finitedifferences\Meshers\UniformGridMesher.cs - - - Methods\Finitedifferences\Operators\FdmBlackScholesOp.cs - - - Methods\Finitedifferences\Operators\FdmHullWhiteOp.cs - - - Methods\Finitedifferences\Operators\FdmLinearOp.cs - - - Methods\Finitedifferences\Operators\FdmLinearOpComposite.cs - - - Methods\Finitedifferences\Operators\FdmLinearOpIterator.cs - - - Methods\Finitedifferences\Operators\FdmLinearOpLayout.cs - - - Methods\Finitedifferences\Operators\FirstDerivativeOp.cs - - - Methods\Finitedifferences\Operators\NinePointLinearOp.cs - - - Methods\Finitedifferences\Operators\SecondDerivativeOp.cs - - - Methods\Finitedifferences\Operators\SecondOrderMixedDerivativeOp.cs - - - Methods\Finitedifferences\Operators\TripleBandLinearOp.cs - - - Methods\Finitedifferences\Schemes\BoundaryConditionSchemeHelper.cs - - - Methods\Finitedifferences\Schemes\CraigSneydScheme.cs - - - Methods\Finitedifferences\Schemes\CrankNicolsonScheme.cs - - - Methods\Finitedifferences\Schemes\DouglasScheme.cs - - - Methods\Finitedifferences\Schemes\ExplicitEulerScheme.cs - - - Methods\Finitedifferences\Schemes\HundsdorferScheme.cs - - - Methods\Finitedifferences\Schemes\ImplicitEulerScheme.cs - - - Methods\Finitedifferences\Schemes\MethodOfLinesScheme.cs - - - Methods\Finitedifferences\Schemes\ModifiedCraigSneydScheme.cs - - - Methods\Finitedifferences\Schemes\TrBDF2Scheme.cs - - - Methods\Finitedifferences\Solvers\Fdm1DimSolver.cs - - - Methods\Finitedifferences\Solvers\FdmBackwardSolver.cs - - - Methods\Finitedifferences\Solvers\FdmBlackScholesSolver.cs - - - Methods\Finitedifferences\Solvers\FdmHullWhiteSolver.cs - - - Methods\Finitedifferences\Solvers\FdmSolverDesc.cs - - - Methods\Finitedifferences\StepConditions\FdmAmericanStepCondition.cs - - - Methods\Finitedifferences\StepConditions\FdmBermudanStepCondition.cs - - - Methods\Finitedifferences\StepConditions\FdmSnapshotCondition.cs - - - Methods\Finitedifferences\StepConditions\FdmStepConditionComposite.cs - - - Methods\Finitedifferences\Utilities\FdmBoundaryConditionSet.cs - - - Methods\Finitedifferences\Utilities\FdmDirichletBoundary.cs - - - Methods\Finitedifferences\Utilities\FdmDividendHandler.cs - - - Methods\Finitedifferences\Utilities\FdmIndicesOnBoundary.cs - - - Methods\Finitedifferences\Utilities\FdmInnerValueCalculator.cs - - - Methods\Finitedifferences\Utilities\FdmAffineModelSwapInnerValue.cs - - - Methods\Finitedifferences\Utilities\FdmAffineModelTermStructure.cs - - - Methods\Finitedifferences\Utilities\FdmMesherIntegral.cs - - - Methods\Finitedifferences\Utilities\FdmQuantoHelper.cs - - - Methods\Finitedifferences\Utilities\ListUtils.cs - - - Methods\lattices\BinominalTree.cs - - - Methods\lattices\BsmLattice.cs - - - Methods\lattices\Lattice.cs - - - Methods\lattices\Lattice1D.cs - - - Methods\lattices\Lattice2D.cs - - - Methods\lattices\Tree.cs - - - Methods\lattices\TrinomialTree.cs - - - Methods\montecarlo\BrownianBridge.cs - - - Methods\montecarlo\EarlyExercisePathPricer.cs - - - Methods\montecarlo\LongstaffSchwartzPathPricer.cs - - - Methods\montecarlo\LsmBasisSystem.cs - - - Methods\montecarlo\MCTraits.cs - - - Methods\montecarlo\MontecarloModel.cs - - - Methods\montecarlo\MultiPath.cs - - - Methods\montecarlo\MultiPathGenerator.cs - - - Methods\montecarlo\Path.cs - - - Methods\montecarlo\PathGenerator.cs - - - Methods\montecarlo\PathPricer.cs - - - Methods\montecarlo\Sample.cs - - - Models\CalibrationHelper.cs - - - Models\Equity\HestonModel.cs - - - Models\Equity\HestonModelHelper.cs - - - Models\Equity\PiecewiseTimeDependentHestonModel.cs - - - Models\MarketModels\BrownianGenerator.cs - - - Models\MarketModels\BrownianGenerators\SobolBrownianGenerator.cs - - - Code - Models\Model.cs - - - Models\Parameter.cs - - - Models\Shortrate\calibrationhelpers\CapHelper.cs - - - Models\Shortrate\calibrationhelpers\SwaptionHelper.cs - - - Models\Shortrate\OneFactorModel.cs - - - Models\Shortrate\Onefactormodels\BlackKarasinski.cs - - - Models\Shortrate\Onefactormodels\CoxIngersollRoss.cs - - - Models\Shortrate\Onefactormodels\HullWhite.cs - - - Models\Shortrate\Onefactormodels\Vasicek.cs - - - Models\Shortrate\TwoFactorModel.cs - - - Models\Shortrate\Twofactorsmodels\G2.cs - - - - - - Patterns\FastActivator.cs - - - Patterns\LazyObject.cs - - - Patterns\ObservableValue.cs - - - Patterns\Observer.cs - - - Patterns\Visitor.cs - - - Patterns\WeakEventSource.cs - - - Instruments\Payoff.cs - - - - Pricingengines\Americanpayoffatexpiry.cs - - - Pricingengines\Americanpayoffathit.cs - - - Pricingengines\asian\AnalyticContinuousGeometricAveragePriceAsianEngine.cs - - - Pricingengines\asian\AnalyticDiscreteGeometricAveragePriceAsianEngine.cs - - - Pricingengines\asian\AnalyticDiscreteGeometricAverageStrikeAsianEngine.cs - - - Pricingengines\asian\McDiscreteAsianEngine.cs - - - Pricingengines\asian\Mc_Discr_Arith_Av_Price.cs - - - Pricingengines\asian\Mc_Discr_Arith_Av_Strike.cs - - - Pricingengines\asian\Mc_Discr_Geom_Av_Price.cs - - - Pricingengines\barrier\AnalyticBarrierEngine.cs - - - Pricingengines\barrier\AnalyticBinaryBarrierEngine.cs - - - Pricingengines\barrier\AnalyticDoubleBarrierBinaryEngine.cs - - - Pricingengines\barrier\AnalyticDoubleBarrierEngine.cs - - - Pricingengines\barrier\BinomialBarrierEngine.cs - - - Pricingengines\barrier\DiscretizedBarrierOption.cs - - - Pricingengines\barrier\BinomialDoubleBarrierEngine.cs - - - Pricingengines\barrier\DiscretizedDoubleBarrierOption.cs - - - Pricingengines\barrier\FdBlackScholesBarrierEngine.cs - - - Pricingengines\barrier\FdBlackScholesRebateEngine.cs - - - Pricingengines\barrier\MCBarrierEngine.cs - - - Pricingengines\barrier\VannaVolgaBarrierEngine.cs - - - Pricingengines\barrier\VannaVolgaDoubleBarrierEngine.cs - - - Pricingengines\barrier\WulinYongDoubleBarrierEngine.cs - - - Pricingengines\Basket\KirkEngine.cs - - - Pricingengines\Basket\MCEuropeanBasketEngine.cs - - - Pricingengines\Basket\StulzEngine.cs - - - Pricingengines\BlackCalculator.cs - - - Pricingengines\BlackDeltaCalculator.cs - - - Pricingengines\BlackFormula.cs - - - Pricingengines\Blackscholescalculator.cs - - - Pricingengines\Bond\BlackCallableBondEngine.cs - - - Pricingengines\Bond\BondFunctions.cs - - - Pricingengines\Bond\Discountingbondengine.cs - - - Pricingengines\Bond\TreeCallableBondEngine.cs - - - Pricingengines\CapFloor\AnalyticCapFloorEngine.cs - - - Pricingengines\CapFloor\BachelierCapFloorEngine.cs - - - Pricingengines\CapFloor\BlackCapFloorEngine.cs - - - Pricingengines\CapFloor\DiscretizedCapFloor.cs - - - Pricingengines\inflation\InterpolatingCPICapFloorEngine.cs - - - Pricingengines\Cliquet\AnalyticCliquetEngine.cs - - - Pricingengines\Cliquet\AnalyticPerformanceEngine.cs - - - Pricingengines\credit\IntegralCdsEngine.cs - - - Pricingengines\credit\IsdaCdsEngine.cs - - - Pricingengines\credit\MidPointCdsEngine.cs - - - Pricingengines\Forward\ForwardPerformanceVanillaEngine.cs - - - Pricingengines\Forward\ForwardVanillaEngine.cs - - - Pricingengines\GenericModelEngine.cs - - - Pricingengines\Greeks.cs - - - Pricingengines\inflation\InflationCapFloorEngines.cs - - - Pricingengines\LatticeShortRateModelEngine.cs - - - Pricingengines\Loan\DiscountingLoanEngine.cs - - - Pricingengines\Lookback\AnalyticContinuousFixedLookbackEngine.cs - - - Pricingengines\Lookback\AnalyticContinuousFloatingLookbackEngine.cs - - - Pricingengines\Lookback\AnalyticContinuousPartialFixedLookbackEngine.cs - - - Pricingengines\Lookback\AnalyticContinuousPartialFloatingLookbackEngine.cs - - - Pricingengines\MCLongstaffSchwartzEngine.cs - - - Pricingengines\McSimulation.cs - - - Pricingengines\swaption\BlackSwaptionEngine.cs - - - Pricingengines\swaption\DiscretizedSwaption.cs - - - Pricingengines\swaption\G2SwaptionEngine.cs - - - Pricingengines\swaption\JamshidianSwaptionEngine.cs - - - Pricingengines\swaption\TreeSwaptionEngine.cs - - - Pricingengines\Swap\CounterpartyAdjSwapEngine.cs - - - Pricingengines\Swap\DiscountingBasisSwapEngine.cs - - - Pricingengines\Swap\DiscountingSwapEngine.cs - - - Pricingengines\Swap\DiscretizedSwap.cs - - - Pricingengines\Swap\TreeSwapEngine.cs - - - Pricingengines\vanilla\AnalyticBSMHullWhiteEngine.cs - - - Pricingengines\vanilla\AnalyticDigitalAmericanEngine.cs - - - Pricingengines\vanilla\AnalyticDividendEuropeanEngine.cs - - - Pricingengines\vanilla\AnalyticEuropeanEngine.cs - - - Pricingengines\vanilla\AnalyticH1HWEngine.cs - - - Pricingengines\vanilla\AnalyticHestonEngine.cs - - - Pricingengines\vanilla\AnalyticHestonHullWhiteEngine.cs - - - Pricingengines\vanilla\AnalyticPTDHestonEngine.cs - - - Pricingengines\vanilla\BaroneAdesiWhaleyEngine.cs - - - Pricingengines\vanilla\BinomialEngine.cs - - - Pricingengines\vanilla\BjerksundStenslandEngine.cs - - - Pricingengines\vanilla\DiscretizedVanillaOption.cs - - - Pricingengines\vanilla\FdBlackScholesVanillaEngine.cs - - - Pricingengines\vanilla\FdHullWhiteSwaptionEngine.cs - - - Pricingengines\vanilla\FDAmericanEngine.cs - - - Pricingengines\vanilla\FDBermudanEngine.cs - - - Pricingengines\vanilla\FDConditions.cs - - - Pricingengines\vanilla\FDDividendAmericanEngine.cs - - - Pricingengines\vanilla\FDDividendEngine.cs - - - Pricingengines\vanilla\FDDividendEuropeanEngine.cs - - - Pricingengines\vanilla\FDEuropeanEngine.cs - - - Pricingengines\vanilla\FdHestonVanillaEngine.cs - - - Pricingengines\vanilla\FDMultiPeriodEngine.cs - - - Pricingengines\vanilla\FDShoutEngine.cs - - - Pricingengines\vanilla\FDStepConditionEngine.cs - - - Pricingengines\vanilla\FDVanillaEngine.cs - - - Pricingengines\vanilla\HestonExpansionEngine.cs - - - Pricingengines\vanilla\Integralengine.cs - - - Pricingengines\vanilla\Juquadraticengine.cs - - - Pricingengines\vanilla\McAmericanEngine.cs - - - Pricingengines\vanilla\McEuropeanEngine.cs - - - Pricingengines\vanilla\MCEuropeanHestonEngine.cs - - - Pricingengines\vanilla\MCHestonHullWhiteEngine.cs - - - Pricingengines\vanilla\McVanillaEngine.cs - - - processes\BlackScholesProcess.cs - - - processes\Defaultable.cs - - - processes\EulerDiscretization.cs - - - processes\ForwardMeasureProcess.cs - - - processes\GeometricBrownianMotionProcess.cs - - - processes\HestonProcess.cs - - - processes\HullWhiteProcess.cs - - - processes\HybridHestonHullWhiteProcess.cs - - - processes\Ornsteinuhlenbeckprocess.cs - - - processes\Squarerootprocess.cs - - - processes\StochasticProcessArray.cs - - - Termstructures\Yield\CompositeZeroYieldStructure.cs - - - - Quotes\CompositeQuote.cs - - - Quotes\DeltaVolQuote.cs - - - Quotes\DerivedQuote.cs - - - Quotes\LastFixingQuote.cs - - - Quotes\Quote.cs - - - Quotes\SimpleQuote.cs - - - - - Termstructures\Bootstraperror.cs - - - Termstructures\Bootstraphelper.cs - - - Termstructures\Credit\FlatHazardRate.cs - - - Termstructures\Credit\HazardRateStructure.cs - - - Termstructures\Credit\InterpolatedHazardRateCurve.cs - - - Termstructures\Credit\InterpolatedSurvivalProbabilityCurve.cs - - - Termstructures\Credit\ProbabilityTraits.cs - - - Termstructures\Credit\SurvivalProbabilityStructure.cs - - - Termstructures\Curve.cs - - - Termstructures\DefaultProbabilityTermStructure.cs - - - Termstructures\InflationTermStructure.cs - - - Termstructures\Inflation\CPICapFloorTermPriceSurface.cs - - - Termstructures\Inflation\InflationHelpers.cs - - - Termstructures\Inflation\InflationTraits.cs - - - Termstructures\Inflation\InterpolatedYoYInflationCurve.cs - - - Termstructures\Inflation\InterpolatedZeroInflationCurve.cs - - - Termstructures\Inflation\PiecewiseYoYInflationCurve.cs - - - Termstructures\Inflation\PiecewiseZeroInflationCurve.cs - - - Termstructures\Inflation\Seasonality.cs - - - Termstructures\InterpolatedCurve.cs - - - Termstructures\Iterativebootstrap.cs - - - Termstructures\LocalBootstrap.cs - - - Termstructures\TermStructure.cs - - - Termstructures\Volatility\AbcdCalibration.cs - - - Termstructures\Volatility\AbcdFunction.cs - - - Termstructures\Volatility\AtmSmileSection.cs - - - Termstructures\Volatility\Bond\CallableBondConstantVolatility.cs - - - Termstructures\Volatility\Bond\CallableBondVolatilityStructure.cs - - - Termstructures\Volatility\CapFloor\CapFloorTermVolCurve.cs - - - Termstructures\Volatility\CapFloor\CapFloorTermVolSurface.cs - - - Termstructures\Volatility\equityfx\BlackVarianceSurface.cs - - - Termstructures\Volatility\equityfx\HestonBlackVolSurface.cs - - - Termstructures\Volatility\equityfx\ImpliedVolTermStructure.cs - - - Termstructures\Volatility\Inflation\CPIVolatilitySurface.cs - - - Termstructures\Volatility\Inflation\YoYInflationOptionletVolatilityStructure.cs - - - Termstructures\Volatility\InterpolatedSmileSection.cs - - - Termstructures\Volatility\SabrInterpolatedSmileSection.cs - - - Termstructures\Volatility\SviInterpolatedSmileSection.cs - - - Termstructures\Volatility\Optionlet\CapletVarianceCurve.cs - - - Termstructures\Volatility\Optionlet\OptionletStripper.cs - - - Termstructures\Volatility\Optionlet\OptionletStripper1.cs - - - Termstructures\Volatility\Optionlet\OptionletStripper2.cs - - - Termstructures\Volatility\Optionlet\SpreadedOptionletVolatility.cs - - - Termstructures\Volatility\Optionlet\StrippedOptionletAdapter.cs - - - Termstructures\Volatility\Optionlet\StrippedOptionletBase.cs - - - Termstructures\Volatility\SpreadedSmileSection.cs - - - Termstructures\Volatility\swaption\SpreadedSwaptionVolatility.cs - - - Termstructures\Volatility\swaption\SwaptionConstantVol.cs - - - Termstructures\Volatility\swaption\SwaptionVolatilityCube.cs - - - Termstructures\Volatility\swaption\SwaptionVolCube1.cs - - - Termstructures\Volatility\swaption\SwaptionVolCube2.cs - - - Termstructures\Volatility\swaption\SwaptionVolDiscrete.cs - - - Termstructures\Volatility\swaption\SwaptionVolMatrix.cs - - - Termstructures\VolTermStructure.cs - - - Termstructures\Volatility\CapFloor\CapFloorTermVolatilityStructure.cs - - - Termstructures\Volatility\CapFloor\ConstantCapFloorTermVolatility.cs - - - Termstructures\Volatility\equityfx\BlackConstantVol.cs - - - Termstructures\Volatility\equityfx\BlackVarianceCurve.cs - - - Termstructures\Volatility\equityfx\BlackVolTermStructure.cs - - - Termstructures\Volatility\equityfx\LocalConstantVol.cs - - - Termstructures\Volatility\equityfx\LocalVolCurve.cs - - - Termstructures\Volatility\equityfx\LocalVolSurface.cs - - - Termstructures\Volatility\equityfx\LocalVolTermStructure.cs - - - Termstructures\Volatility\equityfx\FixedLocalVolSurface.cs - - - Termstructures\Volatility\equityfx\NoExceptLocalVolSurface.cs - - - Termstructures\Volatility\FlatSmileSection.cs - - - Termstructures\Volatility\Optionlet\ConstantOptionletVolatility.cs - - - Termstructures\Volatility\Optionlet\OptionletVolatilityStructure.cs - - - Termstructures\Volatility\Sabr.cs - - - Termstructures\Volatility\Svi.cs - - - Termstructures\Volatility\SmileSection.cs - - - Termstructures\Volatility\SviSmileSection.cs - - - Termstructures\Volatility\swaption\SwaptionVolatilityStructure.cs - - - Termstructures\YieldTermStructure.cs - - - Termstructures\Yield\BasisSwapHelper.cs - - - Termstructures\Yield\Bondhelpers.cs - - - Termstructures\Yield\Bootstraptraits.cs - - - Termstructures\Yield\DiscountCurve.cs - - - Termstructures\Yield\FittedBondDiscountCurve.cs - - - Termstructures\Yield\Flatforward.cs - - - Termstructures\Yield\ForwardCurve.cs - - - Termstructures\Yield\ForwardSpreadedTermStructure.cs - - - Termstructures\Yield\ForwardStructure.cs - - - Termstructures\Yield\ImpliedTermStructure.cs - - - Termstructures\Yield\InterpolatedPiecewiseZeroSpreadedTermStructure.cs - - - Termstructures\Yield\NonLinearFittingMethods.cs - - - Termstructures\Yield\OISRateHelper.cs - - - Termstructures\Yield\PiecewiseYieldCurve.cs - - - Termstructures\Yield\QuantoTermStructure.cs - - - Termstructures\Yield\Ratehelpers.cs - - - Termstructures\Yield\ZeroCurve.cs - - - Termstructures\Yield\ZeroSpreadedTermStructure.cs - - - Termstructures\Yield\Zeroyieldstructure.cs - - - - Time\ASX.cs - - - Time\Calendar.cs - - - Time\Calendars\Argentina.cs - - - Time\Calendars\Australia.cs - - - Time\Calendars\BespokeCalendar.cs - - - Time\Calendars\Botswana.cs - - - Time\Calendars\Brazil.cs - - - Time\Calendars\Canada.cs - - - Time\Calendars\China.cs - - - Time\Calendars\CzechRepublic.cs - - - Time\Calendars\Denmark.cs - - - Time\Calendars\Finland.cs - - - Time\Calendars\Germany.cs - - - Time\Calendars\HongKong.cs - - - Time\Calendars\Hungary.cs - - - Time\Calendars\Iceland.cs - - - Time\Calendars\India.cs - - - Time\Calendars\Indonesia.cs - - - Time\Calendars\Israel.cs - - - Time\Calendars\Italy.cs - - - Time\Calendars\Japan.cs - - - Time\Calendars\JointCalendar.cs - - - Time\Calendars\Mexico.cs - - - Time\Calendars\NewZealand.cs - - - Time\Calendars\Norway.cs - - - Time\Calendars\NullCalendar.cs - - - Time\Calendars\Poland.cs - - - Time\Calendars\Romania.cs - - - Time\Calendars\Russia.cs - - - Time\Calendars\SaudiArabia.cs - - - Time\Calendars\Singapore.cs - - - Time\Calendars\Slovakia.cs - - - Time\Calendars\SouthAfrica.cs - - - Time\Calendars\SouthKorea.cs - - - Time\Calendars\Sweden.cs - - - Time\Calendars\Switzerland.cs - - - Time\Calendars\Taiwan.cs - - - Time\Calendars\TARGET.cs - - - Time\Calendars\Turkey.cs - - - Time\Calendars\Ukraine.cs - - - Time\Calendars\UnitedKingdom.cs - - - Time\Calendars\UnitedStates.cs - - - Time\Calendars\WeekendsOnly.cs - - - Time\Date.cs - - - Time\DayCounter.cs - - - Time\DayCounters\Actual360.cs - - - Time\DayCounters\Actual365Fixed.cs - - - Time\DayCounters\Actual365NoLeap.cs - - - Time\DayCounters\ActualActual.cs - - - Time\DayCounters\Business252.cs - - - Time\DayCounters\OneDayCounter.cs - - - Time\DayCounters\SimpleDayCounter.cs - - - Time\DayCounters\Thirty360.cs - - - Time\ECB.cs - - - Time\Imm.cs - - - Time\Period.cs - - - Time\Schedule.cs - - - - - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - true - - - False - Windows Installer 3.1 - true - - - - - - - - - \ No newline at end of file diff --git a/src/QLNet.Old/Quotes/.gitkeep b/src/QLNet.Old/Quotes/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Termstructures/Credit/.gitkeep b/src/QLNet.Old/Termstructures/Credit/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Termstructures/Inflation/.gitkeep b/src/QLNet.Old/Termstructures/Inflation/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Termstructures/Volatility/Bond/.gitkeep b/src/QLNet.Old/Termstructures/Volatility/Bond/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Termstructures/Volatility/CapFloor/.gitkeep b/src/QLNet.Old/Termstructures/Volatility/CapFloor/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Termstructures/Volatility/Inflation/.gitkeep b/src/QLNet.Old/Termstructures/Volatility/Inflation/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Termstructures/Volatility/Optionlet/.gitkeep b/src/QLNet.Old/Termstructures/Volatility/Optionlet/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Termstructures/Volatility/equityfx/.gitkeep b/src/QLNet.Old/Termstructures/Volatility/equityfx/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Termstructures/Volatility/swaption/.gitkeep b/src/QLNet.Old/Termstructures/Volatility/swaption/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Termstructures/Yield/.gitkeep b/src/QLNet.Old/Termstructures/Yield/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Time/Calendars/.gitkeep b/src/QLNet.Old/Time/Calendars/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/Time/DayCounters/.gitkeep b/src/QLNet.Old/Time/DayCounters/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/legacy/libormarketmodels/.gitkeep b/src/QLNet.Old/legacy/libormarketmodels/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet.Old/processes/.gitkeep b/src/QLNet.Old/processes/.gitkeep deleted file mode 100644 index e69de29bb..000000000 diff --git a/src/QLNet/Math/Optimization/LineSearchBasedMethod.cs b/src/QLNet/Math/Optimization/LineSearchBasedMethod.cs index 2845c6a99..2686b6715 100644 --- a/src/QLNet/Math/Optimization/LineSearchBasedMethod.cs +++ b/src/QLNet/Math/Optimization/LineSearchBasedMethod.cs @@ -90,6 +90,7 @@ public override EndCriteria.Type minimize(Problem P, EndCriteria endCriteria) fnew = P.functionValue(); fdiff = 2.0 * Math.Abs(fnew - fold) / (Math.Abs(fnew) + Math.Abs(fold) + Const.QL_EPSILON); + P.setCurrentValue(x_); // update problem current value if (fdiff < ftol || endCriteria.checkMaxIterations(iterationNumber_, ref ecType)) { @@ -97,7 +98,6 @@ public override EndCriteria.Type minimize(Problem P, EndCriteria endCriteria) endCriteria.checkMaxIterations(iterationNumber_, ref ecType); return ecType; } - P.setCurrentValue(x_); // update problem current value ++iterationNumber_; // Increase iteration number first_time = false; } @@ -120,4 +120,4 @@ protected virtual Vector getUpdatedDirection(Problem P, double gold2, Vector gra protected LineSearch lineSearch_; } -} \ No newline at end of file +} diff --git a/src/QLNet/QLNet.csproj b/src/QLNet/QLNet.csproj index 5bc3df4e5..914e6b266 100644 --- a/src/QLNet/QLNet.csproj +++ b/src/QLNet/QLNet.csproj @@ -1,16 +1,16 @@  - 1.11.4 - netstandard1.2;netstandard2.0 + 1.12.0 + netstandard2.1 $(DefineConstants);QL_NEGATIVE_RATES QLNet QLNet - 1.11.4 + 1.12.0 Andrea Maggiulli A free/open-source library for quantitative finance - Copyright (c) 2008-2020 Andrea Maggiulli (a.maggiulli@gmail.com) + Copyright (c) 2008-2021 Andrea Maggiulli (a.maggiulli@gmail.com) https://github.com/amaggiulli/QLNet/blob/develop/LICENSE http://github.com/amaggiulli/qlnet QLNet QuantLib quantitative finance financial diff --git a/src/QLNet/Termstructures/Inflation/PiecewiseYoYInflationCurve.cs b/src/QLNet/Termstructures/Inflation/PiecewiseYoYInflationCurve.cs index 99f2c9b93..0b455765a 100644 --- a/src/QLNet/Termstructures/Inflation/PiecewiseYoYInflationCurve.cs +++ b/src/QLNet/Termstructures/Inflation/PiecewiseYoYInflationCurve.cs @@ -229,6 +229,9 @@ public PiecewiseYoYInflationCurve(Date referenceDate, : base(referenceDate, calendar, dayCounter, baseZeroRate, lag, frequency, indexIsInterpolated, nominalTS) { _instruments_ = instruments; + // ensure helpers are sorted + _instruments_.Sort((x, y) => x.pillarDate().CompareTo(y.pillarDate())); + accuracy_ = accuracy; if (bootstrap == null) bootstrap_ = FastActivator.Create(); diff --git a/src/QLNet/Termstructures/Inflation/PiecewiseZeroInflationCurve.cs b/src/QLNet/Termstructures/Inflation/PiecewiseZeroInflationCurve.cs index 1f76a4c0b..292201a05 100644 --- a/src/QLNet/Termstructures/Inflation/PiecewiseZeroInflationCurve.cs +++ b/src/QLNet/Termstructures/Inflation/PiecewiseZeroInflationCurve.cs @@ -236,6 +236,9 @@ public PiecewiseZeroInflationCurve(Date referenceDate, : base(referenceDate, calendar, dayCounter, baseZeroRate, lag, frequency, indexIsInterpolated, nominalTS) { _instruments_ = instruments; + // ensure helpers are sorted + _instruments_.Sort((x, y) => x.pillarDate().CompareTo(y.pillarDate())); + accuracy_ = accuracy; if (bootstrap == null) bootstrap_ = FastActivator.Create(); diff --git a/src/QLNet/Termstructures/Iterativebootstrap.cs b/src/QLNet/Termstructures/Iterativebootstrap.cs index f04c33ff1..1945dbde5 100644 --- a/src/QLNet/Termstructures/Iterativebootstrap.cs +++ b/src/QLNet/Termstructures/Iterativebootstrap.cs @@ -66,9 +66,6 @@ public IterativeBootstrap() private void initialize() { - // ensure helpers are sorted - ts_.instruments_.Sort((x, y) => x.pillarDate().CompareTo(y.pillarDate())); - // skip expired helpers Date firstDate = ts_.initialDate(); Utils.QL_REQUIRE(ts_.instruments_[n_ - 1].pillarDate() > firstDate, () => "all instruments expired"); diff --git a/src/QLNet/Termstructures/Yield/PiecewiseYieldCurve.cs b/src/QLNet/Termstructures/Yield/PiecewiseYieldCurve.cs index 84a7681ef..d8932d1cf 100644 --- a/src/QLNet/Termstructures/Yield/PiecewiseYieldCurve.cs +++ b/src/QLNet/Termstructures/Yield/PiecewiseYieldCurve.cs @@ -207,6 +207,9 @@ public PiecewiseYieldCurve(Date referenceDate, List instruments, { _instruments_ = instruments; + // ensure helpers are sorted + _instruments_.Sort((x, y) => x.pillarDate().CompareTo(y.pillarDate())); + accuracy_ = accuracy; interpolator_ = i; @@ -226,6 +229,9 @@ public PiecewiseYieldCurve(int settlementDays, Calendar calendar, List x.pillarDate().CompareTo(y.pillarDate())); + accuracy_ = accuracy; interpolator_ = i; bootstrap_ = bootstrap; diff --git a/src/QLNet/Time/Calendars/Austria.cs b/src/QLNet/Time/Calendars/Austria.cs new file mode 100644 index 000000000..3e69000cf --- /dev/null +++ b/src/QLNet/Time/Calendars/Austria.cs @@ -0,0 +1,167 @@ +/* + Copyright (C) 2008-2021 Andrea Maggiulli + + This file is part of QLNet Project https://github.com/amaggiulli/qlnet + + QLNet is free software: you can redistribute it and/or modify it + under the terms of the QLNet license. You should have received a + copy of the license along with this program; if not, license is + available at . + + QLNet is a based on QuantLib, a free-software/open-source library + for financial quantitative analysts and developers - http://quantlib.org/ + The QuantLib license is available online at http://quantlib.org/license.shtml. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the license for more details. +*/ +using System; + +namespace QLNet +{ + /* Austrian calendars + Public holidays: + Saturdays + Sundays + New Year's Day, January 1st + Epiphany, January 6th + Easter Monday + Ascension Thursday + Whit Monday + Corpus Christi + Labour Day, May 1st + Assumption Day, August 15th + National Holiday, October 26th, since 1967 + All Saints Day, November 1st + National Holiday, November 12th, 1919-1934 + Immaculate Conception Day, December 8th + Christmas, December 25th + St. Stephen, December 26th + + Holidays for the stock exchange (data from https://www.wienerborse.at/en/trading/trading-information/trading-calendar/): + + Saturdays + Sundays + New Year's Day, January 1st + Good Friday + Easter Monday + Whit Monday + Labour Day, May 1st + National Holiday, October 26th, since 1967 + National Holiday, November 12th, 1919-1934 + Christmas Eve, December 24th + Christmas, December 25th< + St. Stephen, December 26th + Exchange Holiday + + */ + public class Austria : Calendar + { + // Austrian calendars + public enum Market + { + Settlement, // generic settlement calendar + Exchange // Vienna stock-exchange calendar + }; + + public Austria() : this(Market.Settlement) {} + + public Austria(Market m) : base() + { + calendar_ = m switch + { + Market.Settlement => Settlement.Singleton, + Market.Exchange => Exchange.Singleton, + _ => throw new ArgumentException("Unknown market: " + m) + }; + } + + private class Settlement : Calendar.WesternImpl + { + public static readonly Settlement Singleton = new Settlement(); + private Settlement() { } + public override string name() { return "Austrian settlement"; } + + public override bool isBusinessDay(Date date) + { + var w = date.DayOfWeek; + int d = date.Day, dd = date.DayOfYear; + var m = (Month)date.Month; + var y = date.Year; + var em = easterMonday(y); + if (isWeekend(w) + // New Year's Day + || (d == 1 && m == Month.February) + // Epiphany + || (d == 6 && m == Month.January) + // Easter Monday + || (dd == em) + // Ascension Thurday + || (dd == em + 38) + // Whit Monday + || (dd == em + 49) + // Corpus Christi + || (dd == em + 59) + // Labour Day + || (d == 1 && m == Month.May) + // Assumption + || (d == 15 && m == Month.August) + // National Holiday since 1967 + || (d == 26 && m == Month.October && y >= 1967) + // National Holiday 1919-1934 + || (d == 12 && m == Month.November && y >= 1919 && y <= 1934) + // All Saints' Day + || (d == 1 && m == Month.November) + // Immaculate Conception + || (d == 8 && m == Month.December) + // Christmas + || (d == 25 && m == Month.December) + // St. Stephen + || (d == 26 && m == Month.December)) + return false; + return true; + } + } + + private class Exchange : Calendar.WesternImpl + { + public static readonly Exchange Singleton = new Exchange(); + private Exchange() {} + public override string name() { return "Vienna stock exchange"; } + public override bool isBusinessDay(Date date) + { + var w = date.DayOfWeek; + int d = date.Day, dd = date.DayOfYear; + var m = (Month)date.Month; + var y = date.Year; + var em = easterMonday(y); + if (isWeekend(w) + // New Year's Day + || (d == 1 && m == Month.January) + // Good Friday + || (dd == em - 3) + // Easter Monday + || (dd == em) + // Whit Monay + || (dd == em + 49) + // Labour Day + || (d == 1 && m == Month.May) + // National Holiday since 1967 + || (d == 26 && m == Month.October && y >= 1967) + // National Holiday 1919-1934 + || (d == 12 && m == Month.November && y >= 1919 && y <= 1934) + // Christmas' Eve + || (d == 24 && m == Month.December) + // Christmas + || (d == 25 && m == Month.December) + // St. Stephen + || (d == 26 && m == Month.December) + // Exchange Holiday + || (d == 31 && m == Month.December)) + return false; + return true; + } + } + } +} diff --git a/src/QLNet/Time/Calendars/Canada.cs b/src/QLNet/Time/Calendars/Canada.cs index 80cfc8df3..f38c34cb8 100644 --- a/src/QLNet/Time/Calendars/Canada.cs +++ b/src/QLNet/Time/Calendars/Canada.cs @@ -104,7 +104,7 @@ public override bool isBusinessDay(Date date) if (isWeekend(w) // New Year's Day (possibly moved to Monday) - || ((d == 1 || (d == 2 && w == DayOfWeek.Monday)) && m == Month.January) + || ((d == 1 || ((d == 2 || d == 3) && w == DayOfWeek.Monday)) && m == Month.January) // Family Day (third Monday in February, since 2008) || ((d >= 15 && d <= 21) && w == DayOfWeek.Monday && m == Month.February && y >= 2008) @@ -120,6 +120,9 @@ public override bool isBusinessDay(Date date) || (d <= 7 && w == DayOfWeek.Monday && m == Month.August) // first Monday of September (Labor Day) || (d <= 7 && w == DayOfWeek.Monday && m == Month.September) + // September 30th, possibly moved to Monday + // (National Day for Truth and Reconciliation, since 2021) + || (((d == 30 && m == Month.September) || (d <= 2 && m == Month.October && w == DayOfWeek.Monday)) && y >= 2021) // second Monday of October (Thanksgiving Day) || (d > 7 && d <= 14 && w == DayOfWeek.Monday && m == Month.October) // November 11th (possibly moved to Monday) @@ -153,7 +156,7 @@ public override bool isBusinessDay(Date date) if (isWeekend(w) // New Year's Day (possibly moved to Monday) - || ((d == 1 || (d == 2 && w == DayOfWeek.Monday)) && m == Month.January) + || ((d == 1 || ((d == 2 || d == 3) && w == DayOfWeek.Monday)) && m == Month.January) // Family Day (third Monday in February, since 2008) || ((d >= 15 && d <= 21) && w == DayOfWeek.Monday && m == Month.February && y >= 2008) @@ -183,4 +186,4 @@ public override bool isBusinessDay(Date date) } } } -} \ No newline at end of file +} diff --git a/src/QLNet/Time/Calendars/Chile.cs b/src/QLNet/Time/Calendars/Chile.cs new file mode 100644 index 000000000..50ad36990 --- /dev/null +++ b/src/QLNet/Time/Calendars/Chile.cs @@ -0,0 +1,133 @@ +/* + Copyright (C) 2008-2021 Andrea Maggiulli + + This file is part of QLNet Project https://github.com/amaggiulli/qlnet + + QLNet is free software: you can redistribute it and/or modify it + under the terms of the QLNet license. You should have received a + copy of the license along with this program; if not, license is + available at . + + QLNet is a based on QuantLib, a free-software/open-source library + for financial quantitative analysts and developers - http://quantlib.org/ + The QuantLib license is available online at http://quantlib.org/license.shtml. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the license for more details. +*/ +using System; + +namespace QLNet +{ + /// + /// Chilean calendars + /// + /// + /// Holidays for the Santiago Stock Exchange + /// (data from ): + /// Saturdays + /// Sundays + /// New Year's Day, January 1st + /// January 2nd, when falling on a Monday (since 2017) + /// Good Friday + /// Easter Saturday + /// Labour Day, May 1st + /// Navy Day, May 21st + /// Day of Aboriginal People, June 21st (since 2021) + /// Saint Peter and Saint Paul, June 29th (moved to the nearest Monday if it falls on a weekday) + /// Our Lady of Mount Carmel, July 16th + /// Assumption Day, August 15th + /// Independence Day, September 18th (also the 17th if the latter falls on a Monday or Friday) + /// Army Day, September 19th (also the 20th if the latter falls on a Friday) + /// Discovery of Two Worlds, October 12th (moved to the nearest Monday if it falls on a weekday) + /// Reformation Day, October 31st (since 2008; moved to the preceding Friday if it falls on a Tuesday, + /// or to the following Friday if it falls on a Wednesday) + /// All Saints' Day, November 1st + /// Immaculate Conception, December 8th + /// Christmas Day, December 25th + /// + + public class Chile : Calendar + { + public enum Market + { + SSE // Santiago Stock Exchange + }; + + public Chile() : this(Market.SSE) + { + } + + public Chile(Market m) + { + calendar_ = m switch + { + Market.SSE => Settlement.Singleton, + _ => throw new ArgumentException("Unknown market: " + m) + }; + } + + private class Settlement : WesternImpl + { + public static readonly Settlement Singleton = new Settlement(); + private Settlement() {} + public override string name() { return "Santiago Stock Exchange"; } + + public override bool isBusinessDay(Date date) + { + var w = date.DayOfWeek; + var d = date.Day; + var m = (Month)date.Month; + var y = date.Year; + var dd = date.DayOfYear; + var em = easterMonday(y); + + if (isWeekend(w) + // New Year's Day + || (d == 1 && m == Month.January) + || (d == 2 && m == Month.January && w == DayOfWeek.Monday && y > 2016) + // Good Friday + || (dd == em - 3) + // Easter Saturday + || (dd == em - 2) + // Labour Day + || (d == 1 && m == Month.May) + // Navy Day + || (d == 21 && m == Month.May) + // Day of Aboriginal People + || (d == 21 && m == Month.June && y >= 2021) + // St. Peter and St. Paul + || (d >= 26 && d <= 29 && m == Month.June && w == DayOfWeek.Monday) + || (d == 2 && m == Month.July && w == DayOfWeek.Monday) + // Our Lady of Mount Carmel + || (d == 16 && m == Month.July) + // Assumption Day + || (d == 15 && m == Month.August) + // Independence Day + || (d == 17 && m == Month.September && ((w == DayOfWeek.Monday && y >= 2007) || (w == DayOfWeek.Friday && y > 2016))) + || (d == 18 && m == Month.September) + // Army Day + || (d == 19 && m == Month.September) + || (d == 20 && m == Month.September && w == DayOfWeek.Friday && y >= 2007) + // Discovery of Two Worlds + || (d >= 9 && d <= 12 && m == Month.October && w == DayOfWeek.Monday) + || (d == 15 && m == Month.October && w == DayOfWeek.Monday) + // Reformation Day + || (((d == 27 && m == Month.October && w == DayOfWeek.Friday) + || (d == 31 && m == Month.October && w != DayOfWeek.Tuesday && w != DayOfWeek.Wednesday) + || (d == 2 && m == Month.November && w == DayOfWeek.Friday)) && y >= 2008) + // All Saints' Day + || (d == 1 && m == Month.November) + // Immaculate Conception + || (d == 8 && m == Month.December) + // Christmas Day + || (d == 25 && m == Month.December) + ) + return false; + + return true; + } + } + } +} diff --git a/src/QLNet/Time/Calendars/China.cs b/src/QLNet/Time/Calendars/China.cs index ce3541935..0aaf177d5 100644 --- a/src/QLNet/Time/Calendars/China.cs +++ b/src/QLNet/Time/Calendars/China.cs @@ -111,6 +111,8 @@ public override bool isBusinessDay(Date date) || (y == 2018 && d == 1 && m == Month.January) || (y == 2018 && d == 31 && m == Month.December) || (y == 2019 && d == 1 && m == Month.January) + || (y == 2020 && d == 1 && m == Month.January) + || (y == 2021 && d == 1 && m == Month.January) // Chinese New Year || (y == 2004 && d >= 19 && d <= 28 && m == Month.January) || (y == 2005 && d >= 7 && d <= 15 && m == Month.February) @@ -131,6 +133,8 @@ public override bool isBusinessDay(Date date) (d <= 2 && m == Month.February))) || (y == 2018 && (d >= 15 && d <= 21 && m == Month.February)) || (y == 2019 && d >= 4 && d <= 8 && m == Month.February) + || (y == 2020 && (d == 24 || (d >= 27 && d <= 31)) && m == Month.January) + || (y == 2021 && (d == 11 || d == 12 || d == 15 || d == 16 || d == 17) && m == Month.February) // Ching Ming Festival || (y <= 2008 && d == 4 && m == Month.April) || (y == 2009 && d == 6 && m == Month.April) @@ -144,6 +148,8 @@ public override bool isBusinessDay(Date date) || (y == 2017 && d >= 3 && d <= 4 && m == Month.April) || (y == 2018 && d >= 5 && d <= 6 && m == Month.April) || (y == 2019 && d == 5 && m == Month.April) + || (y == 2020 && d == 6 && m == Month.April) + || (y == 2021 && d == 5 && m == Month.April) // Labor Day || (y <= 2007 && d >= 1 && d <= 7 && m == Month.May) || (y == 2008 && d >= 1 && d <= 2 && m == Month.May) @@ -159,7 +165,9 @@ public override bool isBusinessDay(Date date) || (y == 2016 && d >= 1 && d <= 2 && m == Month.May) || (y == 2017 && d == 1 && m == Month.May) || (y == 2018 && ((d == 30 && m == Month.April) || (d == 1 && m == Month.May))) - || (y == 2019 && d == 1 && m == Month.May) + || (y == 2019 && d >= 1 && d <= 3 && m == Month.May) + || (y == 2020 && (d == 1 || d == 4 || d == 5) && m == Month.May) + || (y == 2021 && (d == 3 || d == 4 || d == 5) && m == Month.May) // Tuen Ng Festival || (y <= 2008 && d == 9 && m == Month.June) || (y == 2009 && (d == 28 || d == 29) && m == Month.May) @@ -173,6 +181,8 @@ public override bool isBusinessDay(Date date) || (y == 2017 && d >= 29 && d <= 30 && m == Month.May) || (y == 2018 && d == 18 && m == Month.June) || (y == 2019 && d == 7 && m == Month.June) + || (y == 2020 && d >= 25 && d <= 26 && m == Month.June) + || (y == 2021 && d == 14 && m == Month.June) // Mid-Autumn Festival || (y <= 2008 && d == 15 && m == Month.September) || (y == 2010 && d >= 22 && d <= 24 && m == Month.September) @@ -184,6 +194,7 @@ public override bool isBusinessDay(Date date) || (y == 2016 && d >= 15 && d <= 16 && m == Month.September) || (y == 2018 && d == 24 && m == Month.September) || (y == 2019 && d == 13 && m == Month.September) + || (y == 2021 && (d == 20 || d == 21) && m == Month.September) // National Day || (y <= 2007 && d >= 1 && d <= 7 && m == Month.October) || (y == 2008 && ((d >= 29 && m == Month.September) || @@ -198,7 +209,10 @@ public override bool isBusinessDay(Date date) || (y == 2016 && d >= 3 && d <= 7 && m == Month.October) || (y == 2017 && d >= 2 && d <= 6 && m == Month.October) || (y == 2018 && d >= 1 && d <= 5 && m == Month.October) - || (y == 2019 && ((d == 30 && m == Month.September) || (d >= 1 && d <= 4 && m == Month.October))) + || (y == 2019 && d >= 1 && d <= 7 && m == Month.October) + || (y == 2020 && d >= 1 && d <= 2 && m == Month.October) + || (y == 2020 && d >= 5 && d <= 8 && m == Month.October) + || (y == 2021 && (d == 1 || d == 4 || d == 5 || d == 6 || d == 7) && m == Month.October) // 70th anniversary of the victory of anti-Japaneses war || (y == 2015 && d >= 3 && d <= 4 && m == Month.September) ) @@ -333,8 +347,25 @@ public override bool isBusinessDay(Date date) // 2019 new Date(2, Month.February, 2019), new Date(3, Month.February, 2019), + new Date(28, Month.April, 2019), + new Date(5, Month.May, 2019), new Date(29, Month.September, 2019), - new Date(12, Month.October, 2019) + new Date(12, Month.October, 2019), + // 2020 + new Date(19, Month.January, 2020), + new Date(26, Month.April, 2020), + new Date(9, Month.May, 2020), + new Date(28, Month.June, 2020), + new Date(27, Month.September, 2020), + new Date(10, Month.October, 2020), + // 2021 + new Date(7, Month.February, 2021), + new Date(20, Month.February, 2021), + new Date(25, Month.April, 2021), + new Date(8, Month.May, 2021), + new Date(18, Month.September, 2021), + new Date(26, Month.September, 2021), + new Date(9, Month.October, 2021) }; // If it is already a SSE business day, it must be a IB business day diff --git a/src/QLNet/Time/Calendars/Denmark.cs b/src/QLNet/Time/Calendars/Denmark.cs index 029a4ef44..12f96493e 100644 --- a/src/QLNet/Time/Calendars/Denmark.cs +++ b/src/QLNet/Time/Calendars/Denmark.cs @@ -28,7 +28,7 @@ namespace QLNet
  • Saturdays
  • Sundays
  • -
  • Maunday Thursday
  • +
  • Maundy Thursday
  • Good Friday
  • Easter Monday
  • General Prayer Day, 25 days after Easter Monday
  • @@ -60,7 +60,7 @@ public override bool isBusinessDay(Date date) int y = date.Year; int em = easterMonday(y); if (isWeekend(w) - // Maunday Thursday + // Maundy Thursday || (dd == em - 4) // Good Friday || (dd == em - 3) @@ -70,16 +70,22 @@ public override bool isBusinessDay(Date date) || (dd == em + 25) // Ascension || (dd == em + 38) + // Day after Ascension (bank holiday after year 2008) + || (dd == em + 39 && date.Year > 2008) // Whit Monday || (dd == em + 49) // New Year's Day || (d == 1 && m == Month.January) // Constitution Day, June 5th || (d == 5 && m == Month.June) + // Christmas day + || (d == 24 && m == Month.December) // Christmas || (d == 25 && m == Month.December) // Boxing Day - || (d == 26 && m == Month.December)) + || (d == 26 && m == Month.December) + // New Year's Eve (bank holiday from 2003) + || (d == 31 && m == Month.December && date.Year >= 2003)) return false; return true; } diff --git a/src/QLNet/Time/Calendars/France.cs b/src/QLNet/Time/Calendars/France.cs new file mode 100644 index 000000000..bc428111e --- /dev/null +++ b/src/QLNet/Time/Calendars/France.cs @@ -0,0 +1,153 @@ +/* + Copyright (C) 2008-2021 Andrea Maggiulli + + This file is part of QLNet Project https://github.com/amaggiulli/qlnet + + QLNet is free software: you can redistribute it and/or modify it + under the terms of the QLNet license. You should have received a + copy of the license along with this program; if not, license is + available at . + + QLNet is a based on QuantLib, a free-software/open-source library + for financial quantitative analysts and developers - http://quantlib.org/ + The QuantLib license is available online at http://quantlib.org/license.shtml. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS + FOR A PARTICULAR PURPOSE. See the license for more details. +*/ +using System; + +namespace QLNet +{ + /// + /// French calendars + /// + /// + /// + /// Public holidays: + /// + /// Saturdays + /// Sundays + /// New Year's Day, January 1st + /// Easter Monday + /// Labour Day, May 1st + /// Armistice 1945, May 8th + /// Ascension, May 10th + /// Pentecôte, May 21st + /// Fête nationale, July 14th + /// Assumption, August 15th + /// All Saint's Day, November 1st + /// Armistice 1918, November 11th + /// Christmas Day, December 25th + /// + /// + /// Holidays for the stock exchange (data from https://www.stockmarketclock.com/exchanges/euronext-paris/market-holidays/): + /// + /// Saturdays + /// Sundays + /// New Year's Day, January 1st + /// Good Friday + /// Easter Monday + /// Labour Day, May 1st + /// Christmas Eve, December 24th + /// Christmas Day, December 25th + /// Boxing Day, December 26th + /// New Year's Eve, December 31st + /// + public class France : Calendar + { + // French calendars + public enum Market + { + Settlement, // generic settlement calendar + Exchange // Paris stock-exchange calendar + }; + + public France() : this(Market.Settlement) { } + + public France(Market m) : base() + { + calendar_ = m switch + { + Market.Settlement => Settlement.Singleton, + Market.Exchange => Exchange.Singleton, + _ => throw new ArgumentException("Unknown market: " + m) + }; + } + + private class Settlement : Calendar.WesternImpl + { + public static readonly Settlement Singleton = new Settlement(); + private Settlement() { } + public override string name() { return "French settlement"; } + public override bool isBusinessDay(Date date) + { + var w = date.DayOfWeek; + int d = date.Day, dd = date.DayOfYear; + var m = (Month)date.Month; + var y = date.Year; + var em = easterMonday(y); + if (isWeekend(w) + // Jour de l'An + || (d == 1 && m == Month.January) + // Lundi de Paques + || (dd == em) + // Fete du Travail + || (d == 1 && m == Month.May) + // Victoire 1945 + || (d == 8 && m == Month.May) + // Ascension + || (d == 10 && m == Month.May) + // Pentecote + || (d == 21 && m == Month.May) + // Fete nationale + || (d == 14 && m == Month.July) + // Assomption + || (d == 15 && m == Month.August) + // Toussaint + || (d == 1 && m == Month.November) + // Armistice 1918 + || (d == 11 && m == Month.November) + // Noel + || (d == 25 && m == Month.December)) + return false; + return true; + } + } + + private class Exchange : Calendar.WesternImpl + { + public static readonly Exchange Singleton = new Exchange(); + private Exchange() { } + public override string name() { return "Paris stock exchange"; } + public override bool isBusinessDay(Date date) + { + var w = date.DayOfWeek; + int d = date.Day, dd = date.DayOfYear; + var m = (Month)date.Month; + var y = date.Year; + var em = easterMonday(y); + if (isWeekend(w) + // Jour de l'An + || (d == 1 && m == Month.January) + // Good Friday + || (dd == em - 3) + // Easter Monday + || (dd == em) + // Labor Day + || (d == 1 && m == Month.May) + // Christmas Eve + || (d == 24 && m == Month.December) + // Christmas Day + || (d == 25 && m == Month.December) + // Boxing Day + || (d == 26 && m == Month.December) + // New Year's Eve + || (d == 31 && m == Month.December)) + return false; + return true; + } + } + } +} diff --git a/src/QLNet/Time/Calendars/Germany.cs b/src/QLNet/Time/Calendars/Germany.cs index 79a997d8f..b5200098d 100644 --- a/src/QLNet/Time/Calendars/Germany.cs +++ b/src/QLNet/Time/Calendars/Germany.cs @@ -182,9 +182,7 @@ public override bool isBusinessDay(Date date) // Christmas || (d == 25 && m == Month.December) // Boxing Day - || (d == 26 && m == Month.December) - // New Year's Eve - || (d == 31 && m == Month.December)) + || (d == 26 && m == Month.December)) return false; return true; } @@ -217,9 +215,7 @@ public override bool isBusinessDay(Date date) // Christmas || (d == 25 && m == Month.December) // Christmas Day - || (d == 26 && m == Month.December) - // New Year's Eve - || (d == 31 && m == Month.December)) + || (d == 26 && m == Month.December)) return false; return true; } @@ -252,9 +248,7 @@ public override bool isBusinessDay(Date date) // Christmas || (d == 25 && m == Month.December) // Christmas Day - || (d == 26 && m == Month.December) - // New Year's Eve - || (d == 31 && m == Month.December)) + || (d == 26 && m == Month.December)) return false; return true; } @@ -324,12 +318,10 @@ public override bool isBusinessDay(Date date) // Christmas || (d == 25 && m == Month.December) // Christmas Day - || (d == 26 && m == Month.December) - // New Year's Eve - || (d == 31 && m == Month.December)) + || (d == 26 && m == Month.December)) return false; return true; } } } -} \ No newline at end of file +} diff --git a/src/QLNet/Time/Calendars/HongKong.cs b/src/QLNet/Time/Calendars/HongKong.cs index f714c1e08..b140b14e9 100644 --- a/src/QLNet/Time/Calendars/HongKong.cs +++ b/src/QLNet/Time/Calendars/HongKong.cs @@ -74,227 +74,309 @@ public override bool isBusinessDay(Date date) if (isWeekend(w) // New Year's Day - || ((d == 1 || ((d == 2 || d == 3) && w == DayOfWeek.Monday)) + || ((d == 1 || ((d == 2) && w == DayOfWeek.Monday)) && m == Month.January) // Good Friday || (dd == em - 3) // Easter Monday || (dd == em) // Labor Day - || ((d == 1 || ((d == 2 || d == 3) && w == DayOfWeek.Monday)) && m == Month.May) + || ((d == 1 || ((d == 2) && w == DayOfWeek.Monday)) && m == Month.May) // SAR Establishment Day - || ((d == 1 || ((d == 2 || d == 3) && w == DayOfWeek.Monday)) && m == Month.July) + || ((d == 1 || ((d == 2) && w == DayOfWeek.Monday)) && m == Month.July) // National Day - || ((d == 1 || ((d == 2 || d == 3) && w == DayOfWeek.Monday)) + || ((d == 1 || ((d == 2) && w == DayOfWeek.Monday)) && m == Month.October) // Christmas Day || (d == 25 && m == Month.December) // Boxing Day - || (d == 26 && m == Month.December)) + || (d == 26 && m == Month.December) + ) return false; if (y == 2004) { if (// Lunar New Year - ((d == 22 || d == 23 || d == 24) && m == Month.January) - // Ching Ming Festival - || (d == 5 && m == Month.April) - // Buddha's birthday - || (d == 26 && m == Month.May) - // Tuen NG festival - || (d == 22 && m == Month.June) - // Mid-autumn festival - || (d == 29 && m == Month.September) - // Chung Yeung - || (d == 29 && m == Month.September)) + ((d == 22 || d == 23 || d == 24) && m == Month.January) + // Ching Ming Festival + || (d == 5 && m == Month.April) + // Buddha's birthday + || (d == 26 && m == Month.May) + // Tuen Ng festival + || (d == 22 && m == Month.June) + // Mid-autumn festival + || (d == 29 && m == Month.September) + // Chung Yeung + || (d == 22 && m == Month.October)) return false; } if (y == 2005) { if (// Lunar New Year - ((d == 9 || d == 10 || d == 11) && m == Month.February) - // Ching Ming Festival - || (d == 5 && m == Month.April) - // Buddha's birthday - || (d == 16 && m == Month.May) - // Tuen NG festival - || (d == 11 && m == Month.June) - // Mid-autumn festival - || (d == 19 && m == Month.September) - // Chung Yeung festival - || (d == 11 && m == Month.October)) + ((d == 9 || d == 10 || d == 11) && m == Month.February) + // Ching Ming Festival + || (d == 5 && m == Month.April) + // Buddha's birthday + || (d == 16 && m == Month.May) + // Tuen Ng festival + || (d == 11 && m == Month.June) + // Mid-autumn festival + || (d == 19 && m == Month.September) + // Chung Yeung festival + || (d == 11 && m == Month.October)) return false; } if (y == 2006) { if (// Lunar New Year - ((d >= 28 && d <= 31) && m == Month.January) - // Ching Ming Festival - || (d == 5 && m == Month.April) - // Buddha's birthday - || (d == 5 && m == Month.May) - // Tuen NG festival - || (d == 31 && m == Month.May) - // Mid-autumn festival - || (d == 7 && m == Month.October) - // Chung Yeung festival - || (d == 30 && m == Month.October)) + ((d >= 28 && d <= 31) && m == Month.January) + // Ching Ming Festival + || (d == 5 && m == Month.April) + // Buddha's birthday + || (d == 5 && m == Month.May) + // Tuen Ng festival + || (d == 31 && m == Month.May) + // Mid-autumn festival + || (d == 7 && m == Month.October) + // Chung Yeung festival + || (d == 30 && m == Month.October)) return false; } if (y == 2007) { if (// Lunar New Year - ((d >= 17 && d <= 20) && m == Month.February) - // Ching Ming Festival - || (d == 5 && m == Month.April) - // Buddha's birthday - || (d == 24 && m == Month.May) - // Tuen NG festival - || (d == 19 && m == Month.June) - // Mid-autumn festival - || (d == 26 && m == Month.September) - // Chung Yeung festival - || (d == 19 && m == Month.October)) + ((d >= 17 && d <= 20) && m == Month.February) + // Ching Ming Festival + || (d == 5 && m == Month.April) + // Buddha's birthday + || (d == 24 && m == Month.May) + // Tuen Ng festival + || (d == 19 && m == Month.June) + // Mid-autumn festival + || (d == 26 && m == Month.September) + // Chung Yeung festival + || (d == 19 && m == Month.October)) return false; } if (y == 2008) { if (// Lunar New Year - ((d >= 7 && d <= 9) && m == Month.February) - // Ching Ming Festival - || (d == 4 && m == Month.April) - // Buddha's birthday - || (d == 12 && m == Month.May) - // Tuen NG festival - || (d == 9 && m == Month.June) - // Mid-autumn festival - || (d == 15 && m == Month.September) - // Chung Yeung festival - || (d == 7 && m == Month.October)) + ((d >= 7 && d <= 9) && m == Month.February) + // Ching Ming Festival + || (d == 4 && m == Month.April) + // Buddha's birthday + || (d == 12 && m == Month.May) + // Tuen Ng festival + || (d == 9 && m == Month.June) + // Mid-autumn festival + || (d == 15 && m == Month.September) + // Chung Yeung festival + || (d == 7 && m == Month.October)) return false; } if (y == 2009) { if (// Lunar New Year - ((d >= 26 && d <= 28) && m == Month.January) - // Ching Ming Festival - || (d == 4 && m == Month.April) - // Buddha's birthday - || (d == 2 && m == Month.May) - // Tuen NG festival - || (d == 28 && m == Month.May) - // Mid-autumn festival - || (d == 3 && m == Month.October) - // Chung Yeung festival - || (d == 26 && m == Month.October)) + ((d >= 26 && d <= 28) && m == Month.January) + // Ching Ming Festival + || (d == 4 && m == Month.April) + // Buddha's birthday + || (d == 2 && m == Month.May) + // Tuen Ng festival + || (d == 28 && m == Month.May) + // Mid-autumn festival + || (d == 3 && m == Month.October) + // Chung Yeung festival + || (d == 26 && m == Month.October)) return false; } if (y == 2010) { if (// Lunar New Year - ((d == 15 || d == 16) && m == Month.February) - // Ching Ming Festival - || (d == 6 && m == Month.April) - // Buddha's birthday - || (d == 21 && m == Month.May) - // Tuen NG festival - || (d == 16 && m == Month.June) - // Mid-autumn festival - || (d == 23 && m == Month.September)) + ((d == 15 || d == 16) && m == Month.February) + // Ching Ming Festival + || (d == 6 && m == Month.April) + // Buddha's birthday + || (d == 21 && m == Month.May) + // Tuen Ng festival + || (d == 16 && m == Month.June) + // Mid-autumn festival + || (d == 23 && m == Month.September)) return false; } - if (y == 2011) { if (// Lunar New Year - ((d == 3 || d == 4) && m == Month.February) - // Ching Ming Festival - || (d == 5 && m == Month.April) - // Buddha's birthday - || (d == 10 && m == Month.May) - // Tuen NG festival - || (d == 6 && m == Month.June) - // Mid-autumn festival - || (d == 13 && m == Month.September) - // Chung Yeung festival - || (d == 5 && m == Month.October) - // Second day after Christmas - || (d == 27 && m == Month.December)) + ((d == 3 || d == 4) && m == Month.February) + // Ching Ming Festival + || (d == 5 && m == Month.April) + // Buddha's birthday + || (d == 10 && m == Month.May) + // Tuen Ng festival + || (d == 6 && m == Month.June) + // Mid-autumn festival + || (d == 13 && m == Month.September) + // Chung Yeung festival + || (d == 5 && m == Month.October) + // Second day after Christmas + || (d == 27 && m == Month.December)) return false; } if (y == 2012) { if (// Lunar New Year - (d >= 23 && d <= 25 && m == Month.January) - // Ching Ming Festival - || (d == 4 && m == Month.April) - // Buddha's birthday - || (d == 10 && m == Month.May) - // Mid-autumn festival - || (d == 1 && m == Month.October) - // Chung Yeung festival - || (d == 23 && m == Month.October)) + (d >= 23 && d <= 25 && m == Month.January) + // Ching Ming Festival + || (d == 4 && m == Month.April) + // Buddha's birthday + || (d == 10 && m == Month.May) + // Mid-autumn festival + || (d == 1 && m == Month.October) + // Chung Yeung festival + || (d == 23 && m == Month.October)) return false; } if (y == 2013) { if (// Lunar New Year - (d >= 11 && d <= 13 && m == Month.February) - // Ching Ming Festival - || (d == 4 && m == Month.April) - // Buddha's birthday - || (d == 17 && m == Month.May) - // Tuen Ng festival - || (d == 12 && m == Month.June) - // Mid-autumn festival - || (d == 20 && m == Month.September) - // Chung Yeung festival - || (d == 14 && m == Month.October)) + (d >= 11 && d <= 13 && m == Month.February) + // Ching Ming Festival + || (d == 4 && m == Month.April) + // Buddha's birthday + || (d == 17 && m == Month.May) + // Tuen Ng festival + || (d == 12 && m == Month.June) + // Mid-autumn festival + || (d == 20 && m == Month.September) + // Chung Yeung festival + || (d == 14 && m == Month.October)) return false; } if (y == 2014) { if (// Lunar New Year - ((d == 31 && m == Month.January) || (d <= 3 && m == Month.February)) - // Buddha's birthday - || (d == 6 && m == Month.May) - // Tuen Ng festival - || (d == 2 && m == Month.June) - // Mid-autumn festival - || (d == 9 && m == Month.September) - // Chung Yeung festival - || (d == 2 && m == Month.October)) + ((d == 31 && m == Month.January) || (d <= 3 && m == Month.February)) + // Buddha's birthday + || (d == 6 && m == Month.May) + // Tuen Ng festival + || (d == 2 && m == Month.June) + // Mid-autumn festival + || (d == 9 && m == Month.September) + // Chung Yeung festival + || (d == 2 && m == Month.October)) return false; } if (y == 2015) { if (// Lunar New Year - ((d == 19 && m == Month.February) || (d == 20 && m == Month.February)) - // The day following Easter Monday - || (d == 7 && m == Month.April) - // Buddha's birthday - || (d == 25 && m == Month.May) - // Tuen Ng festival - || (d == 20 && m == Month.June) - // Mid-autumn festival - || (d == 28 && m == Month.September) - // Chung Yeung festival - || (d == 21 && m == Month.October)) + ((d == 19 && m == Month.February) || (d == 20 && m == Month.February)) + // The day following Easter Monday + || (d == 7 && m == Month.April) + // Buddha's birthday + || (d == 25 && m == Month.May) + // Tuen Ng festival + || (d == 20 && m == Month.June) + // The 70th anniversary day of the victory of the Chinese + // people's war of resistance against Japanese aggression + || (d == 3 && m == Month.September) + // Mid-autumn festival + || (d == 28 && m == Month.September) + // Chung Yeung festival + || (d == 21 && m == Month.October)) + return false; + } + + if (y == 2016) + { + if (// Lunar New Year + ((d >= 8 && d <= 10) && m == Month.February) + // Ching Ming Festival + || (d == 4 && m == Month.April) + // Tuen Ng festival + || (d == 9 && m == Month.June) + // Mid-autumn festival + || (d == 16 && m == Month.September) + // Chung Yeung festival + || (d == 10 && m == Month.October) + // Second day after Christmas + || (d == 27 && m == Month.December)) + return false; + } + + if (y == 2017) + { + if (// Lunar New Year + ((d == 30 || d == 31) && m == Month.January) + // Ching Ming Festival + || (d == 4 && m == Month.April) + // Buddha's birthday + || (d == 3 && m == Month.May) + // Tuen Ng festival + || (d == 30 && m == Month.May) + // Mid-autumn festival + || (d == 5 && m == Month.October)) + return false; + } + + if (y == 2018) + { + if (// Lunar New Year + ((d == 16 && m == Month.February) || (d == 19 && m == Month.February)) + // Ching Ming Festival + || (d == 5 && m == Month.April) + // Buddha's birthday + || (d == 22 && m == Month.May) + // Tuen Ng festival + || (d == 18 && m == Month.June) + // Mid-autumn festival + || (d == 25 && m == Month.September) + // Chung Yeung festival + || (d == 17 && m == Month.October)) + return false; + } + + if (y == 2019) + { + if (// Lunar New Year + ((d >= 5 && d <= 7) && m == Month.February) + // Ching Ming Festival + || (d == 5 && m == Month.April) + // Tuen Ng festival + || (d == 7 && m == Month.June) + // Chung Yeung festival + || (d == 7 && m == Month.October)) + return false; + } + + if (y == 2020) + { + if (// Lunar New Year + ((d == 27 || d == 28) && m == Month.January) + // Ching Ming Festival + || (d == 4 && m == Month.April) + // Buddha's birthday + || (d == 30 && m == Month.April) + // Tuen Ng festival + || (d == 25 && m == Month.June) + // Mid-autumn festival + || (d == 2 && m == Month.October) + // Chung Yeung festival + || (d == 26 && m == Month.October)) return false; } return true; } } } -} \ No newline at end of file +} diff --git a/src/QLNet/Time/Calendars/Hungary.cs b/src/QLNet/Time/Calendars/Hungary.cs index 802bc3e78..44b88fd1c 100644 --- a/src/QLNet/Time/Calendars/Hungary.cs +++ b/src/QLNet/Time/Calendars/Hungary.cs @@ -60,6 +60,8 @@ public override bool isBusinessDay(Date date) int y = date.Year; int em = easterMonday(y); if (isWeekend(w) + // Good Friday (since 2017) + || (dd == em - 3 && y >= 2017) // Easter Monday || (dd == em) // Whit Monday @@ -85,4 +87,4 @@ public override bool isBusinessDay(Date date) } } } -} \ No newline at end of file +} diff --git a/src/QLNet/Time/Calendars/India.cs b/src/QLNet/Time/Calendars/India.cs index f53dbed0f..2ccbede3a 100644 --- a/src/QLNet/Time/Calendars/India.cs +++ b/src/QLNet/Time/Calendars/India.cs @@ -337,6 +337,70 @@ public override bool isBusinessDay(Date date) ) return false; } + + if (y == 2019) + { + if (// Chatrapati Shivaji Jayanti + (d == 19 && m == Month.February) + // Mahashivratri + || (d == 4 && m == Month.March) + // Holi + || (d == 21 && m == Month.March) + // Annual Bank Closing + || (d == 1 && m == Month.April) + // Mahavir Jayanti + || (d == 17 && m == Month.April) + // Parliamentary Elections + || (d == 29 && m == Month.April) + // Ramzan Id + || (d == 05 && m == Month.June) + // Bakri Id + || (d == 12 && m == Month.August) + // Ganesh Chaturthi + || (d == 2 && m == Month.September) + // Moharram + || (d == 10 && m == Month.September) + // Dasera + || (d == 8 && m == Month.October) + // General Assembly Elections in Maharashtra + || (d == 21 && m == Month.October) + // Diwali - Balipratipada + || (d == 28 && m == Month.October) + // Gurunank Jayanti + || (d == 12 && m == Month.November) + ) + return false; + } + + if (y == 2020) + { + if (// Chatrapati Shivaji Jayanti + (d == 19 && m == Month.February) + // Mahashivratri + || (d == 21 && m == Month.February) + // Holi + || (d == 10 && m == Month.March) + // Gudi Padwa + || (d == 25 && m == Month.March) + // Annual Bank Closing + || (d == 1 && m == Month.April) + // Ram Navami + || (d == 2 && m == Month.April) + // Mahavir Jayanti + || (d == 6 && m == Month.April) + // Buddha Pournima + || (d == 7 && m == Month.May) + // Ramzan Id + || (d == 25 && m == Month.May) + // Id-E-Milad + || (d == 30 && m == Month.October) + // Diwali - Balipratipada + || (d == 16 && m == Month.November) + // Gurunank Jayanti + || (d == 30 && m == Month.November) + ) + return false; + } return true; } } diff --git a/src/QLNet/Time/Calendars/Japan.cs b/src/QLNet/Time/Calendars/Japan.cs index c7017dbc4..e62f683de 100644 --- a/src/QLNet/Time/Calendars/Japan.cs +++ b/src/QLNet/Time/Calendars/Japan.cs @@ -99,6 +99,10 @@ public override bool isBusinessDay(Date date) && y < 2000) // National Foundation Day || ((d == 11 || (d == 12 && w == DayOfWeek.Monday)) && m == Month.February) + // Emperor's Birthday (Emperor Naruhito) + || ((d == 23 || (d == 24 && w == DayOfWeek.Monday)) && m == Month.February && y >= 2020) + // Emperor's Birthday (Emperor Akihito) + || ((d == 23 || (d == 24 && w == DayOfWeek.Monday)) && m == Month.December && (y >= 1989 && y < 2019)) // Vernal Equinox || ((d == ve || (d == ve + 1 && w == DayOfWeek.Monday)) && m == Month.March) // Greenery Day @@ -112,38 +116,42 @@ public override bool isBusinessDay(Date date) // any of the three above observed later if on Saturday or Sunday || (d == 6 && m == Month.May && (w == DayOfWeek.Monday || w == DayOfWeek.Tuesday || w == DayOfWeek.Wednesday)) // Marine Day (3rd Monday in July), - // was July 20th until 2003, not a holiday before 1996 + // was July 20th until 2003, not a holiday before 1996, + // July 23rd in 2020 due to Olympics games + // July 22nd in 2021 due to Olympics games || (w == DayOfWeek.Monday && (d >= 15 && d <= 21) && m == Month.July - && y >= 2003) - || ((d == 20 || (d == 21 && w == DayOfWeek.Monday)) && m == Month.July - && y >= 1996 && y < 2003) - // Mountain Day (from 2016) - || ((d == 11 || (d == 12 && w == DayOfWeek.Monday)) && m == Month.August && y >= 2016) + && ((y >= 2003 && y < 2020) || y >= 2022)) + || ((d == 20 || (d == 21 && w == DayOfWeek.Monday)) && m == Month.July && y >= 1996 && y < 2003) + || (d == 23 && m == Month.July && y == 2020) + || (d == 22 && m == Month.July && y == 2021) + // Mountain Day + // (moved in 2020 due to Olympics games) + // (moved in 2021 due to Olympics games) + || ((d == 11 || (d == 12 && w == DayOfWeek.Monday)) && m == Month.August && ((y >= 2016 && y < 2020) || y >= 2022)) + || (d == 10 && m == Month.August && y == 2020) + || (d == 9 && m == Month.August && y == 2021) // Respect for the Aged Day (3rd Monday in September), // was September 15th until 2003 - || (w == DayOfWeek.Monday && (d >= 15 && d <= 21) && m == Month.September - && y >= 2003) - || ((d == 15 || (d == 16 && w == DayOfWeek.Monday)) && m == Month.September - && y < 2003) + || (w == DayOfWeek.Monday && (d >= 15 && d <= 21) && m == Month.September && y >= 2003) + || ((d == 15 || (d == 16 && w == DayOfWeek.Monday)) && m == Month.September && y < 2003) // If a single day falls between Respect for the Aged Day // and the Autumnal Equinox, it is holiday - || (w == DayOfWeek.Tuesday && d + 1 == ae && d >= 16 && d <= 22 - && m == Month.September && y >= 2003) + || (w == DayOfWeek.Tuesday && d+1 == ae && d >= 16 && d <= 22 && m == Month.September && y >= 2003) // Autumnal Equinox - || ((d == ae || (d == ae + 1 && w == DayOfWeek.Monday)) && m == Month.September) + || ((d == ae || (d == ae+1 && w == DayOfWeek.Monday)) && m == Month.September) // Health and Sports Day (2nd Monday in October), - // was October 10th until 2000 + // was October 10th until 2000, + // July 24th in 2020 due to Olympics games + // July 23rd in 2021 due to Olympics games || (w == DayOfWeek.Monday && (d >= 8 && d <= 14) && m == Month.October - && y >= 2000) - || ((d == 10 || (d == 11 && w == DayOfWeek.Monday)) && m == Month.October - && y < 2000) + && ((y >= 2000 && y < 2020) || y >= 2022)) + || ((d == 10 || (d == 11 && w == DayOfWeek.Monday)) && m == Month.October && y < 2000) + || (d == 24 && m == Month.July && y == 2020) + || (d == 23 && m == Month.July && y == 2021) // National Culture Day - || ((d == 3 || (d == 4 && w == DayOfWeek.Monday)) && m == Month.November) + || ((d == 3 || (d == 4 && w == DayOfWeek.Monday)) && m == Month.November) // Labor Thanksgiving Day || ((d == 23 || (d == 24 && w == DayOfWeek.Monday)) && m == Month.November) - // Emperor's Birthday - || ((d == 23 || (d == 24 && w == DayOfWeek.Monday)) && m == Month.December - && y >= 1989) // Bank Holiday || (d == 31 && m == Month.December) // one-shot holidays @@ -151,10 +159,18 @@ public override bool isBusinessDay(Date date) || (d == 10 && m == Month.April && y == 1959) // Rites of Imperial Funeral || (d == 24 && m == Month.February && y == 1989) - // Enthronement Ceremony + // Enthronement Ceremony (Emperor Akihito) || (d == 12 && m == Month.November && y == 1990) // Marriage of Prince Naruhito - || (d == 9 && m == Month.June && y == 1993)) + || (d == 9 && m == Month.June && y == 1993) + // Special holiday based on Japanese public holidays law + || (d == 30 && m == Month.April && y == 2019) + // Enthronement Day (Emperor Naruhito) + || (d == 1 && m == Month.May && y == 2019) + // Special holiday based on Japanese public holidays law + || (d == 2 && m == Month.May && y == 2019) + // Enthronement Ceremony (Emperor Naruhito) + || (d == 22 && m == Month.October && y == 2019)) return false; return true; } diff --git a/src/QLNet/Time/Calendars/Mexico.cs b/src/QLNet/Time/Calendars/Mexico.cs index 90c285166..95a467f1a 100644 --- a/src/QLNet/Time/Calendars/Mexico.cs +++ b/src/QLNet/Time/Calendars/Mexico.cs @@ -77,6 +77,8 @@ public override bool isBusinessDay(Date date) || (d == 1 && m == Month.May) // National Day || (d == 16 && m == Month.September) + // All Souls Day + || (d == 2 && m == Month.November) // Revolution Day || (y <= 2005 && d == 20 && m == Month.November) || (y >= 2006 && (d >= 15 && d <= 21) && w == DayOfWeek.Monday && m == Month.November) @@ -89,4 +91,4 @@ public override bool isBusinessDay(Date date) } } } -} \ No newline at end of file +} diff --git a/src/QLNet/Time/Calendars/NewZealand.cs b/src/QLNet/Time/Calendars/NewZealand.cs index a0b1e4047..b857f5036 100644 --- a/src/QLNet/Time/Calendars/NewZealand.cs +++ b/src/QLNet/Time/Calendars/NewZealand.cs @@ -74,8 +74,9 @@ public override bool isBusinessDay(Date date) m == Month.January) // Anniversary Day, Monday nearest January 22nd || ((d >= 19 && d <= 25) && w == DayOfWeek.Monday && m == Month.January) - // Waitangi Day. February 6th + // Waitangi Day. February 6th ("Mondayised" since 2013) || (d == 6 && m == Month.February) + || ((d == 7 || d == 8) && w == DayOfWeek.Monday && m == Month.February && y > 2013) // Good Friday || (dd == em - 3) // Easter Monday @@ -97,4 +98,4 @@ public override bool isBusinessDay(Date date) } } } -} \ No newline at end of file +} diff --git a/src/QLNet/Time/Calendars/Norway.cs b/src/QLNet/Time/Calendars/Norway.cs index e34eab96d..e0dd27e9a 100644 --- a/src/QLNet/Time/Calendars/Norway.cs +++ b/src/QLNet/Time/Calendars/Norway.cs @@ -77,6 +77,8 @@ public override bool isBusinessDay(Date date) || (d == 1 && m == Month.May) // National Independence Day || (d == 17 && m == Month.May) + // Christmas Eve + || (d == 24 && m == Month.December && y >= 2002) // Christmas || (d == 25 && m == Month.December) // Boxing Day diff --git a/src/QLNet/Time/Calendars/Romania.cs b/src/QLNet/Time/Calendars/Romania.cs index 9b2f86e26..af1e69da9 100644 --- a/src/QLNet/Time/Calendars/Romania.cs +++ b/src/QLNet/Time/Calendars/Romania.cs @@ -36,25 +36,43 @@ namespace QLNet
  • 2nd Day of Christmas, December 26th
- \ingroup calendars + Holidays for the Bucharest stock exchange + (data from ): + all public holidays, plus a few one-off closing days (2014 only). */ public class Romania : Calendar { - public Romania() : base(Impl.Singleton) { } + public enum Market + { + Public, //!< Public holidays + BVB //!< Bucharest stock-exchange + } - class Impl : Calendar.OrthodoxImpl + public Romania() : this(Market.BVB) { } + + public Romania(Market m) : base() { - public static readonly Impl Singleton = new Impl(); - private Impl() { } + calendar_ = m switch + { + Market.Public => PublicImpl.Singleton, + Market.BVB => BVBImpl.Impl, + _ => throw new ArgumentException("Unknown market: " + m) + }; + } + private class PublicImpl : Calendar.OrthodoxImpl + { + public static readonly PublicImpl Singleton = new PublicImpl(); + protected PublicImpl() { } public override string name() { return "Romania"; } + public override bool isBusinessDay(Date date) { - DayOfWeek w = date.DayOfWeek; + var w = date.DayOfWeek; int d = date.Day, dd = date.DayOfYear; - Month m = (Month) date.Month; - int y = date.Year; - int em = easterMonday(y); + var m = (Month)date.Month; + var y = date.year(); + var em = easterMonday(y); if (isWeekend(w) // New Year's Day || (d == 1 && m == Month.January) @@ -68,6 +86,8 @@ public override bool isBusinessDay(Date date) || (d == 1 && m == Month.May) // Pentecost || (dd == em + 49) + // Children's Day (since 2017) + || (d == 1 && m == Month.June && y >= 2017) // St Marys Day || (d == 15 && m == Month.August) // Feast of St Andrew @@ -78,6 +98,27 @@ public override bool isBusinessDay(Date date) || (d == 25 && m == Month.December) // 2nd Day of Chritsmas || (d == 26 && m == Month.December)) + return false; + return true; + } + } + + private class BVBImpl : PublicImpl + { + public static readonly BVBImpl Impl = new BVBImpl(); + private BVBImpl() { } + public override string name() { return "Romania"; } + public override bool isBusinessDay(Date date) + { + if (!base.isBusinessDay(date)) + return false; + var d = date.Day; + var m = (Month)date.Month; + var y = date.Year; + if (// one-off closing days + (d == 24 && m == Month.December && y == 2014) || + (d == 31 && m == Month.December && y == 2014) + ) return false; return true; } diff --git a/src/QLNet/Time/Calendars/Russia.cs b/src/QLNet/Time/Calendars/Russia.cs index 02a1da78f..fe2414b73 100644 --- a/src/QLNet/Time/Calendars/Russia.cs +++ b/src/QLNet/Time/Calendars/Russia.cs @@ -71,12 +71,53 @@ public Russia(Market m) } } + class SettlementImpl : Calendar.OrthodoxImpl { public static readonly SettlementImpl Singleton = new SettlementImpl(); private SettlementImpl() { } public override string name() { return "Russian settlement"; } + private bool isExtraHolidaySettlementImpl(int d, Month month, int year) + { + switch (year) + { + case 2017: + switch (month) + { + case Month.February: return d == 24; + case Month.May: return d == 8; + case Month.November: return d == 6; + default: return false; + } + case 2018: + switch (month) + { + case Month.March: return d == 9; + case Month.April: return d == 30; + case Month.May: return d == 2; + case Month.June: return d == 11; + case Month.December: return d == 31; + default: return false; + } + case 2019: + switch (month) + { + case Month.May: return d == 2 || d == 3 || d == 10; + default: return false; + } + case 2020: + switch (month) + { + case Month.March: return d == 30 || d == 31; + case Month.April: return d == 1 || d == 2 || d == 3; + case Month.May: return d == 4 || d == 5; + default: return false; + } + default: + return false; + } + } public override bool isBusinessDay(Date date) { DayOfWeek w = date.DayOfWeek; @@ -87,7 +128,12 @@ public override bool isBusinessDay(Date date) if (isWeekend(w) // New Year's holidays - || (d >= 1 && d <= 8 && m == Month.January) + || (y <= 2005 && d <= 2 && m == Month.January) + || (y >= 2005 && d <= 5 && m == Month.January) + // in 2012, the 6th was also a holiday + || (y == 2012 && d == 6 && m == Month.January) + // Christmas (possibly moved to Monday) + || ((d == 7 || ((d == 8 || d == 9) && w == DayOfWeek.Monday)) && m == Month.January) // Defender of the Fatherland Day (possibly moved to Monday) || ((d == 23 || ((d == 24 || d == 25) && w == DayOfWeek.Monday)) && m == Month.February) @@ -108,6 +154,9 @@ public override bool isBusinessDay(Date date) m == Month.November)) return false; + if (isExtraHolidaySettlementImpl(d, m, y)) + return false; + return true; } } @@ -130,11 +179,25 @@ private bool isWorkingWeekend(int d, Month month, int year) case Month.June: return d == 9; default: return false; } + case 2016: + switch (month) + { + case Month.February: return d == 20; + default: return false; + } + case 2018: + switch (month) + { + case Month.April: return d == 28; + case Month.June: return d == 9; + case Month.December: return d == 29; + default: return false; + } default: return false; } } - private bool isExtraHoliday(int d, Month month, int year) + private bool isExtraHolidayExchangeImpl(int d, Month month, int year) { switch (year) { @@ -167,6 +230,45 @@ private bool isExtraHoliday(int d, Month month, int year) case Month.May: return d == 4; default: return false; } + case 2016: + switch (month) + { + case Month.January: return d == 1 || d == 7 || d == 8; + case Month.May: return d == 2 || d == 3; + case Month.June: return d == 13; + case Month.December: return d == 30; + default: return false; + } + case 2017: + switch (month) + { + case Month.January: return d == 2; + case Month.May: return d == 8; + default: return false; + } + case 2018: + switch (month) + { + case Month.January: return d == 1 || d == 2 || d == 8; + case Month.December: return d == 31; + default: return false; + } + case 2019: + switch (month) + { + case Month.January: return d == 1 || d == 2 || d == 7; + case Month.December: return d == 31; + default: return false; + } + case 2020: + switch (month) + { + case Month.January: return d == 1 || d == 2 || d == 7; + case Month.February: return d == 24; + case Month.June: return d == 24; + case Month.July: return d == 1; + default: return false; + } default: return false; } @@ -209,7 +311,7 @@ public override bool isBusinessDay(Date date) || (d == 31 && m == Month.December)) return false; - if (isExtraHoliday(d, m, y)) + if (isExtraHolidayExchangeImpl(d, m, y)) return false; return true; diff --git a/src/QLNet/Time/Calendars/SouthKorea.cs b/src/QLNet/Time/Calendars/SouthKorea.cs index fcba5cdc4..2bd20fb33 100644 --- a/src/QLNet/Time/Calendars/SouthKorea.cs +++ b/src/QLNet/Time/Calendars/SouthKorea.cs @@ -114,6 +114,8 @@ public override bool isBusinessDay(Date date) || (d == 1 && m == Month.May) // Children's Day || (d == 5 && m == Month.May) + || (d == 7 && m == Month.May && y == 2018) + || (d == 6 && m == Month.May && y == 2019) // Memorial Day || (d == 6 && m == Month.June) // Constitution Day @@ -139,10 +141,10 @@ public override bool isBusinessDay(Date date) || ((d == 30 || d == 31) && m == Month.January && y == 2014) || ((d == 18 || d == 19 || d == 20) && m == Month.February && y == 2015) || ((d == 7 || d == 8 || d == 9) && m == Month.February && y == 2016) - || ((d == 27 || d == 28 || d == 29) && m == Month.January && y == 2017) + || ((d >= 27 && d <= 30) && m == Month.January && y == 2017) || ((d == 15 || d == 16 || d == 17) && m == Month.February && y == 2018) || ((d == 4 || d == 5 || d == 6) && m == Month.February && y == 2019) - || ((d == 24 || d == 25 || d == 26) && m == Month.January && y == 2020) + || ((d >= 24 && d <= 27) && m == Month.January && y == 2020) || ((d == 11 || d == 12 || d == 13) && m == Month.February && y == 2021) || (((d == 31 && m == Month.January) || ((d == 1 || d == 2) && m == Month.February)) && y == 2022) @@ -167,6 +169,9 @@ public override bool isBusinessDay(Date date) || (d == 19 && m == Month.December && y == 2012) // Presidency || (d == 4 && m == Month.June && y == 2014) // Local election || (d == 13 && m == Month.April && y == 2016) // National Assembly + || (d == 9 && m == Month.May && y == 2017) // Presidency + || (d == 13 && m == Month.June && y == 2018) // Local election + || (d == 15 && m == Month.April && y == 2020) // National Assembly // Buddha's birthday || (d == 26 && m == Month.May && y == 2004) || (d == 15 && m == Month.May && y == 2005) @@ -198,6 +203,8 @@ public override bool isBusinessDay(Date date) || (d == 16 && m == Month.May && y == 2032) // Special holiday: 70 years from Independence Day || (d == 14 && m == Month.August && y == 2015) + // Special temporary holiday + || (d == 17 && m == Month.August && y == 2020) // Harvest Moon Day || ((d == 27 || d == 28 || d == 29) && m == Month.September && y == 2004) || ((d == 17 || d == 18 || d == 19) && m == Month.September && y == 2005) @@ -212,8 +219,8 @@ public override bool isBusinessDay(Date date) || ((d == 8 || d == 9 || d == 10) && m == Month.September && y == 2014) || ((d == 28 || d == 29) && m == Month.September && y == 2015) || ((d == 14 || d == 15 || d == 16) && m == Month.September && y == 2016) - || ((d == 3 || d == 4 || d == 5) && m == Month.October && y == 2017) - || ((d == 23 || d == 24 || d == 25) && m == Month.September && y == 2018) + || ((d >= 3 && d <= 6) && m == Month.October && y == 2017) + || ((d >= 23 && d <= 26) && m == Month.September && y == 2018) || ((d == 12 || d == 13 || d == 14) && m == Month.September && y == 2019) || (((d == 30 && m == Month.September) || ((d == 1 || d == 2) && m == Month.October)) && y == 2020) @@ -253,6 +260,7 @@ public override bool isBusinessDay(Date date) int d = date.Day; DayOfWeek w = date.DayOfWeek; Month m = (Month)date.Month; + int y = date.Year; if ( // Year-end closing ((((d == 29 || d == 30) && w == DayOfWeek.Friday) || d == 31) @@ -260,6 +268,12 @@ public override bool isBusinessDay(Date date) ) return false; + if (// occasional closing days (KRX day) + (d == 6 && m == Month.May && y == 2016) || + (d == 2 && m == Month.October && y == 2017) + ) + return false; + return true; } } diff --git a/src/QLNet/Time/Calendars/Sweden.cs b/src/QLNet/Time/Calendars/Sweden.cs index b517f6fb6..684834875 100644 --- a/src/QLNet/Time/Calendars/Sweden.cs +++ b/src/QLNet/Time/Calendars/Sweden.cs @@ -78,10 +78,8 @@ public override bool isBusinessDay(Date date) // May Day || (d == 1 && m == Month.May) // June 6 id National Day but is not a holiday. - // It has been debated wheter or not this day should be - // declared as a holiday. - // As of 2002 the Stockholmborsen is open that day - // || (d == 6 && m == June) + // holiday since 2005 + || (d == 6 && m == Month.June && y >= 2005) // Midsummer Eve (Friday between June 19-25) || (w == DayOfWeek.Friday && (d >= 19 && d <= 25) && m == Month.June) // Christmas Eve diff --git a/src/QLNet/Time/Calendars/Taiwan.cs b/src/QLNet/Time/Calendars/Taiwan.cs index 12e30570e..6953bd496 100644 --- a/src/QLNet/Time/Calendars/Taiwan.cs +++ b/src/QLNet/Time/Calendars/Taiwan.cs @@ -280,11 +280,116 @@ public override bool isBusinessDay(Date date) ) return false; } + if (y == 2015) + { + if (// adjusted holidays + (d == 2 && m == Month.January) + // Lunar New Year + || (d >= 18 && d <= 23 && m == Month.February) + // adjusted holidays + || (d == 27 && m == Month.February) + // adjusted holidays + || (d == 3 && m == Month.April) + // adjusted holidays + || (d == 6 && m == Month.April) + // adjusted holidays + || (d == 19 && m == Month.June) + // adjusted holidays + || (d == 28 && m == Month.September) + // adjusted holidays + || (d == 9 && m == Month.October) + ) + return false; + } + if (y == 2016) + { + if (// Lunar New Year + (d >= 8 && d <= 12 && m == Month.February) + // adjusted holidays + || (d == 29 && m == Month.February) + // Children's Day + || (d == 4 && m == Month.April) + // adjusted holidays + || (d == 5 && m == Month.April) + // adjusted holidays + || (d == 2 && m == Month.May) + // Dragon Boat Festival + || (d == 9 && m == Month.June) + // adjusted holidays + || (d == 10 && m == Month.June) + // Mid-Autumn Festival + || (d == 15 && m == Month.September) + // adjusted holidays + || (d == 16 && m == Month.September) + ) + return false; + } + if (y == 2017) + { + if (// adjusted holidays + (d == 2 && m == Month.January) + // Lunar New Year + || ((d >= 27 && m == Month.January) || (d == 1 && m == Month.February)) + // adjusted holidays + || (d == 27 && m == Month.February) + // adjusted holidays + || (d == 3 && m == Month.April) + // Children's Day + || (d == 4 && m == Month.April) + // adjusted holidays + || (d == 29 && m == Month.May) + // Dragon Boat Festival + || (d == 30 && m == Month.May) + // Mid-Autumn Festival + || (d == 4 && m == Month.October) + // adjusted holidays + || (d == 9 && m == Month.October) + ) + return false; + } + if (y == 2018) + { + if (// Lunar New Year + (d >= 15 && d <= 20 && m == Month.February) + // Children's Day + || (d == 4 && m == Month.April) + // Tomb Sweeping Day + || (d == 5 && m == Month.April) + // adjusted holidays + || (d == 6 && m == Month.April) + // Dragon Boat Festival + || (d == 18 && m == Month.June) + // Mid-Autumn Festival + || (d == 24 && m == Month.September) + // adjusted holidays + || (d == 31 && m == Month.December) + ) + return false; + } + if (y == 2019) + { + if (// Lunar New Year + (d >= 4 && d <= 8 && m == Month.February) + // adjusted holidays + || (d == 1 && m == Month.March) + // Children's Day + || (d == 4 && m == Month.April) + // Tomb Sweeping Day + || (d == 5 && m == Month.April) + // Dragon Boat Festival + || (d == 7 && m == Month.June) + // Mid-Autumn Festival + || (d == 13 && m == Month.September) + // adjusted holidays + || (d == 11 && m == Month.October) + ) + return false; + } return true; } } } -} \ No newline at end of file +} diff --git a/src/QLNet/Time/Calendars/Thailand.cs b/src/QLNet/Time/Calendars/Thailand.cs index ce591437c..58b3afb5b 100644 --- a/src/QLNet/Time/Calendars/Thailand.cs +++ b/src/QLNet/Time/Calendars/Thailand.cs @@ -86,7 +86,7 @@ public override bool isBusinessDay(Date date) // H.M. the Queen's Birthday || ((d == 12 || ((d == 13 || d == 14) && w == DayOfWeek.Monday)) && m == Month.August) // H.M. King Bhumibol Adulyadej Memorial Day - || ((d == 3 || ((d == 14 || d == 15) && w == DayOfWeek.Monday)) && m == Month.October && y >= 2017) + || ((d == 13 || ((d == 14 || d == 15) && w == DayOfWeek.Monday)) && m == Month.October && y >= 2017) // H.M. King Bhumibol Adulyadej's Birthday || ((d == 5 || ((d == 6 || d == 7) && w == DayOfWeek.Monday)) && m == Month.December) // Constitution Day @@ -95,76 +95,76 @@ public override bool isBusinessDay(Date date) || (d == 31 && m == Month.December) // New Year’s Eve Observence || ((d == 1 || d == 2) && w == DayOfWeek.Monday && m == Month.January) - ) + ) return false; if ((y == 2000) && - ((d == 21 && m == Month.February) // Makha Bucha Day (Substitution Day) - || (d == 5 && m == Month.May) // Coronation Day + ((d == 21 && m == Month.February) // Makha Bucha Day (Substitution Day) + || (d == 5 && m == Month.May) // Coronation Day || (d == 17 && m == Month.May) // Wisakha Bucha Day || (d == 17 && m == Month.July) // Buddhist Lent Day || (d == 23 && m == Month.October) // Chulalongkorn Day - )) + )) return false; if ((y == 2001) && - ((d == 8 && m == Month.February) // Makha Bucha Day + ((d == 8 && m == Month.February) // Makha Bucha Day || (d == 7 && m == Month.May) // Wisakha Bucha Day || (d == 8 && m == Month.May) // Coronation Day (Substitution Day) || (d == 6 && m == Month.July) // Buddhist Lent Day || (d == 23 && m == Month.October) // Chulalongkorn Day - )) + )) return false; // 2002, 2003 and 2004 are missing if ((y == 2005) && - ((d == 23 && m == Month.February) // Makha Bucha Day + ((d == 23 && m == Month.February) // Makha Bucha Day || (d == 5 && m == Month.May) // Coronation Day || (d == 23 && m == Month.May) // Wisakha Bucha Day (Substitution Day for Sunday 22 May) || (d == 1 && m == Month.July) // Mid Year Closing Day || (d == 22 && m == Month.July) // Buddhist Lent Day || (d == 24 && m == Month.October) // Chulalongkorn Day (Substitution Day for Sunday 23 October) - )) + )) return false; if ((y == 2006) && - ((d == 13 && m == Month.February) // Makha Bucha Day - || (d == 19 && m == Month.April) // Special Holiday - || (d == 5 && m == Month.May) // Coronation Day - || (d == 12 && m == Month.May) // Wisakha Bucha Day - || (d == 12 && m == Month.June) // Special Holidays (Due to the auspicious occasion of the - // celebration of 60th Anniversary of His Majesty's Accession - // to the throne. For Bangkok, Samut Prakan, Nonthaburi, - // Pathumthani and Nakhon Pathom province) - || (d == 13 && m == Month.June) // Special Holidays (as above) - || (d == 11 && m == Month.July) // Buddhist Lent Day - || (d == 23 && m == Month.October) // Chulalongkorn Day - )) + ((d == 13 && m == Month.February) // Makha Bucha Day + || (d == 19 && m == Month.April) // Special Holiday + || (d == 5 && m == Month.May) // Coronation Day + || (d == 12 && m == Month.May) // Wisakha Bucha Day + || (d == 12 && m == Month.June) // Special Holidays (Due to the auspicious occasion of the + // celebration of 60th Anniversary of His Majesty's Accession + // to the throne. For Bangkok, Samut Prakan, Nonthaburi, + // Pathumthani and Nakhon Pathom province) + || (d == 13 && m == Month.June) // Special Holidays (as above) + || (d == 11 && m == Month.July) // Buddhist Lent Day + || (d == 23 && m == Month.October) // Chulalongkorn Day + )) return false; if ((y == 2007) && - ((d == 5 && m == Month.March) // Makha Bucha Day (Substitution Day for Saturday 3 March) + ((d == 5 && m == Month.March) // Makha Bucha Day (Substitution Day for Saturday 3 March) || (d == 7 && m == Month.May) // Coronation Day (Substitution Day for Saturday 5 May) || (d == 31 && m == Month.May) // Wisakha Bucha Day || (d == 30 && m == Month.July) // Asarnha Bucha Day (Substitution Day for Sunday 29 July) || (d == 23 && m == Month.October) // Chulalongkorn Day || (d == 24 && m == Month.December) // Special Holiday - )) + )) return false; if ((y == 2008) && - ((d == 21 && m == Month.February) // Makha Bucha Day + ((d == 21 && m == Month.February) // Makha Bucha Day || (d == 5 && m == Month.May) // Coronation Day || (d == 19 && m == Month.May) // Wisakha Bucha Day || (d == 1 && m == Month.July) // Mid Year Closing Day || (d == 17 && m == Month.July) // Asarnha Bucha Day || (d == 23 && m == Month.October) // Chulalongkorn Day - )) + )) return false; if ((y == 2009) && - ((d == 2 && m == Month.January) // Special Holiday + ((d == 2 && m == Month.January) // Special Holiday || (d == 9 && m == Month.February) // Makha Bucha Day || (d == 5 && m == Month.May) // Coronation Day || (d == 8 && m == Month.May) // Wisakha Bucha Day @@ -172,11 +172,11 @@ public override bool isBusinessDay(Date date) || (d == 6 && m == Month.July) // Special Holiday || (d == 7 && m == Month.July) // Asarnha Bucha Day || (d == 23 && m == Month.October) // Chulalongkorn Day - )) + )) return false; if ((y == 2010) && - ((d == 1 && m == Month.March) // Substitution for Makha Bucha Day(Sunday 28 February) + ((d == 1 && m == Month.March) // Substitution for Makha Bucha Day(Sunday 28 February) || (d == 5 && m == Month.May) // Coronation Day || (d == 20 && m == Month.May) // Special Holiday || (d == 21 && m == Month.May) // Special Holiday @@ -185,55 +185,55 @@ public override bool isBusinessDay(Date date) || (d == 26 && m == Month.July) // Asarnha Bucha Day || (d == 13 && m == Month.August) // Special Holiday || (d == 25 && m == Month.October) // Substitution for Chulalongkorn Day(Saturday 23 October) - )) + )) return false; if ((y == 2011) && - ((d == 18 && m == Month.February) // Makha Bucha Day + ((d == 18 && m == Month.February) // Makha Bucha Day || (d == 5 && m == Month.May) // Coronation Day || (d == 16 && m == Month.May) // Special Holiday || (d == 17 && m == Month.May) // Wisakha Bucha Day || (d == 1 && m == Month.July) // Mid Year Closing Day || (d == 15 && m == Month.July) // Asarnha Bucha Day || (d == 24 && m == Month.October) // Substitution for Chulalongkorn Day(Sunday 23 October) - )) + )) return false; if ((y == 2012) && - ((d == 3 && m == Month.January) // Special Holiday + ((d == 3 && m == Month.January) // Special Holiday || (d == 7 && m == Month.March) // Makha Bucha Day 2/ || (d == 9 && m == Month.April) // Special Holiday || (d == 7 && m == Month.May) // Substitution for Coronation Day(Saturday 5 May) || (d == 4 && m == Month.June) // Wisakha Bucha Day || (d == 2 && m == Month.August) // Asarnha Bucha Day || (d == 23 && m == Month.October) // Chulalongkorn Day - )) + )) return false; if ((y == 2013) && - ((d == 25 && m == Month.February) // Makha Bucha Day + ((d == 25 && m == Month.February) // Makha Bucha Day || (d == 6 && m == Month.May) // Substitution for Coronation Day(Sunday 5 May) || (d == 24 && m == Month.May) // Wisakha Bucha Day || (d == 1 && m == Month.July) // Mid Year Closing Day || (d == 22 && m == Month.July) // Asarnha Bucha Day 2/ || (d == 23 && m == Month.October) // Chulalongkorn Day || (d == 30 && m == Month.December) // Special Holiday - )) + )) return false; if ((y == 2014) && - ((d == 14 && m == Month.February) // Makha Bucha Day + ((d == 14 && m == Month.February) // Makha Bucha Day || (d == 5 && m == Month.May) // Coronation Day || (d == 13 && m == Month.May) // Wisakha Bucha Day || (d == 1 && m == Month.July) // Mid Year Closing Day || (d == 11 && m == Month.July) // Asarnha Bucha Day 1/ || (d == 11 && m == Month.August) // Special Holiday || (d == 23 && m == Month.October) // Chulalongkorn Day - )) + )) return false; if ((y == 2015) && - ((d == 2 && m == Month.January) // Special Holiday + ((d == 2 && m == Month.January) // Special Holiday || (d == 4 && m == Month.March) // Makha Bucha Day || (d == 4 && m == Month.May) // Special Holiday || (d == 5 && m == Month.May) // Coronation Day @@ -241,11 +241,11 @@ public override bool isBusinessDay(Date date) || (d == 1 && m == Month.July) // Mid Year Closing Day || (d == 30 && m == Month.July) // Asarnha Bucha Day 1/ || (d == 23 && m == Month.October) // Chulalongkorn Day - )) + )) return false; if ((y == 2016) && - ((d == 22 && m == Month.February) // Makha Bucha Day + ((d == 22 && m == Month.February) // Makha Bucha Day || (d == 5 && m == Month.May) // Coronation Day || (d == 6 && m == Month.May) // Special Holiday || (d == 20 && m == Month.May) // Wisakha Bucha Day @@ -253,21 +253,27 @@ public override bool isBusinessDay(Date date) || (d == 18 && m == Month.July) // Special Holiday || (d == 19 && m == Month.July) // Asarnha Bucha Day 1/ || (d == 24 && m == Month.October) // Substitution for Chulalongkorn Day (Sunday 23rd October) - )) + )) return false; - // 2017 is missing + if ((y == 2017) && + ((d == 13 && m == Month.February) // Makha Bucha Day + || (d == 10 && m == Month.May) // Wisakha Bucha Day + || (d == 10 && m == Month.July) // Asarnha Bucha Day + || (d == 23 && m == Month.October) // Chulalongkorn Day + || (d == 26 && m == Month.October) // Special Holiday + )) + return false; if ((y == 2018) && - ((d == 1 && m == Month.March) // Makha Bucha Day + ((d == 1 && m == Month.March) // Makha Bucha Day || (d == 29 && m == Month.May) // Wisakha Bucha Day || (d == 27 && m == Month.July) // Asarnha Bucha Day1 || (d == 23 && m == Month.October) // Chulalongkorn Day - )) + )) return false; return true; - } } } diff --git a/src/QLNet/Time/Calendars/Turkey.cs b/src/QLNet/Time/Calendars/Turkey.cs index a494882b6..fd9038abf 100644 --- a/src/QLNet/Time/Calendars/Turkey.cs +++ b/src/QLNet/Time/Calendars/Turkey.cs @@ -68,9 +68,11 @@ public override bool isBusinessDay(Date date) || (d == 23 && m == Month.April) // 19 may/ National Holiday || (d == 19 && m == Month.May) + // 15 july / National Holiday (since 2017) + || (d == 15 && m == Month.July && y >= 2017) // 30 aug/ National Holiday || (d == 30 && m == Month.August) - ///29 ekim National Holiday + // 29 ekim National Holiday || (d == 29 && m == Month.October)) return false; diff --git a/src/QLNet/Time/Calendars/UnitedKingdom.cs b/src/QLNet/Time/Calendars/UnitedKingdom.cs index 3bdebff76..d9a459f5d 100644 --- a/src/QLNet/Time/Calendars/UnitedKingdom.cs +++ b/src/QLNet/Time/Calendars/UnitedKingdom.cs @@ -97,7 +97,27 @@ public UnitedKingdom(Market m) : base() } } - private class Settlement : Calendar.WesternImpl + protected static bool isBankHoliday(int d, DayOfWeek w, Month m, int y) + { + return + // first Monday of May (Early May Bank Holiday) + // moved to May 8th in 1995 and 2020 for V.E. day + (d <= 7 && w == DayOfWeek.Monday && m == Month.May && y != 1995 && y != 2020) + || (d == 8 && m == Month.May && (y == 1995 || y == 2020)) + // last Monday of May (Spring Bank Holiday) + // moved to in 2002, 2012 and 2022 for the Golden, Diamond and Platinum + // Jubilee with an additional holiday + || (d >= 25 && w == DayOfWeek.Monday && m == Month.May && y != 2002 && y != 2012 && y != 2022) + || ((d == 3 || d == 4) && m == Month.June && y == 2002) + || ((d == 4 || d == 5) && m == Month.June && y == 2012) + || ((d == 2 || d == 3) && m == Month.June && y == 2022) + // last Monday of August (Summer Bank Holiday) + || (d >= 25 && w == DayOfWeek.Monday && m == Month.August) + // April 29th, 2011 only (Royal Wedding Bank Holiday) + || (d == 29 && m == Month.April && y == 2011); + } + + private class Settlement : Calendar.WesternImpl { public static readonly Settlement Singleton = new Settlement(); private Settlement() { } @@ -118,19 +138,11 @@ public override bool isBusinessDay(Date date) || (dd == em - 3) // Easter Monday || (dd == em) - // first Monday of May (Early May Bank Holiday) - || (d <= 7 && w == DayOfWeek.Monday && m == Month.May) - // last Monday of May (Spring Bank Holiday) - || (d >= 25 && w == DayOfWeek.Monday && m == Month.May && y != 2002) - // last Monday of August (Summer Bank Holiday) - || (d >= 25 && w == DayOfWeek.Monday && m == Month.August) + || isBankHoliday(d, w, m, y) // Christmas (possibly moved to Monday or Tuesday) || ((d == 25 || (d == 27 && (w == DayOfWeek.Monday || w == DayOfWeek.Tuesday))) && m == Month.December) // Boxing Day (possibly moved to Monday or Tuesday) || ((d == 26 || (d == 28 && (w == DayOfWeek.Monday || w == DayOfWeek.Tuesday))) && m == Month.December) - // June 3rd, 2002 only (Golden Jubilee Bank Holiday) - // June 4rd, 2002 only (special Spring Bank Holiday) - || ((d == 3 || d == 4) && m == Month.June && y == 2002) // December 31st, 1999 only || (d == 31 && m == Month.December && y == 1999)) return false; @@ -157,19 +169,11 @@ public override bool isBusinessDay(Date date) || (dd == em - 3) // Easter Monday || (dd == em) - // first Monday of May (Early May Bank Holiday) - || (d <= 7 && w == DayOfWeek.Monday && m == Month.May) - // last Monday of May (Spring Bank Holiday) - || (d >= 25 && w == DayOfWeek.Monday && m == Month.May && y != 2002) - // last Monday of August (Summer Bank Holiday) - || (d >= 25 && w == DayOfWeek.Monday && m == Month.August) + || isBankHoliday(d, w, m, y) // Christmas (possibly moved to Monday or Tuesday) || ((d == 25 || (d == 27 && (w == DayOfWeek.Monday || w == DayOfWeek.Tuesday))) && m == Month.December) // Boxing Day (possibly moved to Monday or Tuesday) || ((d == 26 || (d == 28 && (w == DayOfWeek.Monday || w == DayOfWeek.Tuesday))) && m == Month.December) - // June 3rd, 2002 only (Golden Jubilee Bank Holiday) - // June 4rd, 2002 only (special Spring Bank Holiday) - || ((d == 3 || d == 4) && m == Month.June && y == 2002) // December 31st, 1999 only || (d == 31 && m == Month.December && y == 1999)) return false; @@ -196,19 +200,11 @@ public override bool isBusinessDay(Date date) || (dd == em - 3) // Easter Monday || (dd == em) - // first Monday of May (Early May Bank Holiday) - || (d <= 7 && w == DayOfWeek.Monday && m == Month.May) - // last Monday of May (Spring Bank Holiday) - || (d >= 25 && w == DayOfWeek.Monday && m == Month.May && y != 2002) - // last Monday of August (Summer Bank Holiday) - || (d >= 25 && w == DayOfWeek.Monday && m == Month.August) + || isBankHoliday(d, w, m, y) // Christmas (possibly moved to Monday or Tuesday) || ((d == 25 || (d == 27 && (w == DayOfWeek.Monday || w == DayOfWeek.Tuesday))) && m == Month.December) // Boxing Day (possibly moved to Monday or Tuesday) || ((d == 26 || (d == 28 && (w == DayOfWeek.Monday || w == DayOfWeek.Tuesday))) && m == Month.December) - // June 3rd, 2002 only (Golden Jubilee Bank Holiday) - // June 4rd, 2002 only (special Spring Bank Holiday) - || ((d == 3 || d == 4) && m == Month.June && y == 2002) // December 31st, 1999 only || (d == 31 && m == Month.December && y == 1999)) return false; diff --git a/src/QLNet/Time/Calendars/UnitedStates.cs b/src/QLNet/Time/Calendars/UnitedStates.cs index 6e15f724f..808182cd7 100644 --- a/src/QLNet/Time/Calendars/UnitedStates.cs +++ b/src/QLNet/Time/Calendars/UnitedStates.cs @@ -168,13 +168,37 @@ protected static bool isVeteransDay(int d, Month m, int y, DayOfWeek w) } } + protected static bool isVeteransDayNoSaturday(int d, Month m, int y, DayOfWeek w) + { + if (y <= 1970 || y >= 1978) + { + // November 11th, adjusted, but no Saturday to Friday + return (d == 11 || (d == 12 && w == DayOfWeek.Monday)) && m == Month.November; + } + else + { + // fourth Monday in October + return (d >= 22 && d <= 28) && w == DayOfWeek.Monday && m == Month.October; + } + } + + protected static bool isJuneteenth(int d, Month m, int y, DayOfWeek w) + { + // declared in 2021, but only observed by exchanges since 2022 + return (d == 19 || (d == 20 && w == DayOfWeek.Monday) || (d == 18 && w == DayOfWeek.Friday)) + && m == Month.June && y >= 2022; + } + + //! US calendars public enum Market { Settlement, //!< generic settlement calendar NYSE, //!< New York stock exchange calendar GovernmentBond, //!< government-bond calendar - NERC //!< off-peak days for NERC + NERC, //!< off-peak days for NERC + LiborImpact, //!< Libor impact calendar + FederalReserve //!< Federal Reserve Bankwire System } public UnitedStates() : this(Market.Settlement) { } @@ -194,6 +218,12 @@ public UnitedStates(Market m) : base() case Market.NERC: calendar_ = NERC.Singleton; break; + case Market.LiborImpact: + calendar_ = LiborImpact.Singleton; + break; + case Market.FederalReserve: + calendar_ = FederalReserve.Singleton; + break; default: throw new ArgumentException("Unknown market: " + m); } @@ -202,7 +232,7 @@ public UnitedStates(Market m) : base() private class Settlement : Calendar.WesternImpl { public static readonly Settlement Singleton = new Settlement(); - private Settlement() { } + protected Settlement() { } public override string name() { return "US settlement"; } public override bool isBusinessDay(Date date) @@ -222,6 +252,8 @@ public override bool isBusinessDay(Date date) || isWashingtonBirthday(d, m, y, w) // Memorial Day (last Monday in May) || isMemorialDay(d, m, y, w) + // Juneteenth (Monday if Sunday or Friday if Saturday) + || isJuneteenth(d, m, y, w) // Independence Day (Monday if Sunday or Friday if Saturday) || ((d == 4 || (d == 5 && w == DayOfWeek.Monday) || (d == 3 && w == DayOfWeek.Friday)) && m == Month.July) @@ -262,6 +294,8 @@ public override bool isBusinessDay(Date date) || (dd == em - 3) // Memorial Day (last Monday in May) || isMemorialDay(d, m, y, w) + // Juneteenth (Monday if Sunday or Friday if Saturday) + || isJuneteenth(d, m, y, w) // Independence Day (Monday if Sunday or Friday if Saturday) || ((d == 4 || (d == 5 && w == DayOfWeek.Monday) || (d == 3 && w == DayOfWeek.Friday)) && m == Month.July) @@ -356,10 +390,12 @@ public override bool isBusinessDay(Date date) || ((d >= 15 && d <= 21) && w == DayOfWeek.Monday && m == Month.January && y >= 1983) // Washington's birthday (third Monday in February) || isWashingtonBirthday(d, m, y, w) - // Good Friday - || (dd == em - 3) + // Good Friday (2015 was half day due to NFP report) + || (dd == em - 3 && y != 2015) // Memorial Day (last Monday in May) || isMemorialDay(d, m, y, w) + // Juneteenth (Monday if Sunday or Friday if Saturday) + || isJuneteenth(d, m, y, w) // Independence Day (Monday if Sunday or Friday if Saturday) || ((d == 4 || (d == 5 && w == DayOfWeek.Monday) || (d == 3 && w == DayOfWeek.Friday)) && m == Month.July) @@ -367,14 +403,24 @@ public override bool isBusinessDay(Date date) || isLaborDay(d, m, y, w) // Columbus Day (second Monday in October) || isColumbusDay(d, m, y, w) - // Veteran's Day (Monday if Sunday or Friday if Saturday) - || isVeteransDay(d, m, y, w) + // Veteran's Day (Monday if Sunday) + || isVeteransDayNoSaturday(d, m, y, w) // Thanksgiving Day (fourth Thursday in November) || ((d >= 22 && d <= 28) && w == DayOfWeek.Thursday && m == Month.November) // Christmas (Monday if Sunday or Friday if Saturday) || ((d == 25 || (d == 26 && w == DayOfWeek.Monday) || (d == 24 && w == DayOfWeek.Friday)) && m == Month.December)) return false; + + // Special closings + if (// President Bush's Funeral + (y == 2018 && m == Month.December && d == 5) + // Hurricane Sandy + || (y == 2012 && m == Month.October && (d == 30)) + // President Reagan's funeral + || (y == 2004 && m == Month.June && d == 11) + ) return false; + return true; } } @@ -407,5 +453,69 @@ public override bool isBusinessDay(Date date) return true; } } + private class LiborImpact : Settlement + { + public new static readonly LiborImpact Singleton = new LiborImpact(); + private LiborImpact() { } + + public override string name() { return "US with Libor impact"; } + public override bool isBusinessDay(Date date) + { + // Since 2015 Independence Day only impacts Libor if it falls + // on a weekday + DayOfWeek w = date.DayOfWeek; + int d = date.Day; + Month m = (Month)date.Month; + int y = date.year(); + if (((d == 5 && w == DayOfWeek.Monday) || + (d == 3 && w == DayOfWeek.Friday)) && m == Month.July && y >= 2015) + return true; + return base.isBusinessDay(date); + } + } + + private class FederalReserve : Calendar.WesternImpl + { + public static readonly FederalReserve Singleton = new FederalReserve(); + + private FederalReserve() {} + + public override string name() { return "Federal Reserve Bankwire System"; } + + public override bool isBusinessDay(Date date) + { + // see https://www.frbservices.org/holidayschedules/ for details + DayOfWeek w = date.DayOfWeek; + int d = date.Day; + Month m = (Month)date.Month; + int y = date.year(); + if (isWeekend(w) + // New Year's Day (possibly moved to Monday if on Sunday) + || ((d == 1 || (d == 2 && w == DayOfWeek.Monday)) && m == Month.January) + // Martin Luther King's birthday (third Monday in January) + || ((d >= 15 && d <= 21) && w == DayOfWeek.Monday && m == Month.January + && y >= 1983) + // Washington's birthday (third Monday in February) + || isWashingtonBirthday(d, m, y, w) + // Memorial Day (last Monday in May) + || isMemorialDay(d, m, y, w) + // Juneteenth (Monday if Sunday or Friday if Saturday) + || isJuneteenth(d, m, y, w) + // Independence Day (Monday if Sunday) + || ((d == 4 || (d == 5 && w == DayOfWeek.Monday)) && m == Month.July) + // Labor Day (first Monday in September) + || isLaborDay(d, m, y, w) + // Columbus Day (second Monday in October) + || isColumbusDay(d, m, y, w) + // Veteran's Day (Monday if Sunday) + || isVeteransDayNoSaturday(d, m, y, w) + // Thanksgiving Day (fourth Thursday in November) + || ((d >= 22 && d <= 28) && w == DayOfWeek.Thursday && m == Month.November) + // Christmas (Monday if Sunday) + || ((d == 25 || (d == 26 && w == DayOfWeek.Monday)) && m == Month.December)) + return false; + return true; + } + } } } diff --git a/src/QLNet/Time/Date.cs b/src/QLNet/Time/Date.cs index c7b34fd20..63c0d6c37 100644 --- a/src/QLNet/Time/Date.cs +++ b/src/QLNet/Time/Date.cs @@ -288,6 +288,8 @@ public static implicit operator Date(DateTime d) return d1.date >= d2.date; } + public DateTime ToDateTime() => date; + public string ToLongDateString() { return date.ToString("D"); diff --git a/src/QLNet/Time/DayCounters/ActualActual.cs b/src/QLNet/Time/DayCounters/ActualActual.cs index 0b1d67010..64337a4d1 100644 --- a/src/QLNet/Time/DayCounters/ActualActual.cs +++ b/src/QLNet/Time/DayCounters/ActualActual.cs @@ -18,6 +18,7 @@ under the terms of the QLNet license. You should have received a */ using System; using System.Collections.Generic; +using System.Linq; namespace QLNet { @@ -64,6 +65,8 @@ private static DayCounter conventions(Convention c, Schedule schedule) private class ISMA_Impl : DayCounter { + private Schedule schedule_; + public static ISMA_Impl Singleton(Schedule schedule) { return new ISMA_Impl(schedule); @@ -112,25 +115,49 @@ private List getListOfPeriodDatesIncludingQuasiPayments(Schedule schedule) // Process the schedule into an array of dates. Date issueDate = schedule.date(0); Date firstCoupon = schedule.date(1); - Date notionalCoupon = + Date notionalFirstCoupon = schedule.calendar().advance(firstCoupon, -schedule.tenor(), schedule.businessDayConvention(), schedule.endOfMonth()); - List newDates = schedule.dates(); - newDates[0] = notionalCoupon; + List newDates = schedule.dates().ToList(); + newDates[0] = notionalFirstCoupon ; + + // The handling of the last coupon is is needed for odd final periods + var notionalLastCoupon = + schedule.calendar().advance( + schedule.date(schedule.Count - 2), + schedule.tenor(), + schedule.businessDayConvention(), + schedule.endOfMonth()); + + newDates[schedule.Count - 1] = notionalLastCoupon; //long first coupon - if (notionalCoupon > issueDate) + if (notionalFirstCoupon > issueDate) { Date priorNotionalCoupon = - schedule.calendar().advance(notionalCoupon, + schedule.calendar().advance(notionalFirstCoupon , -schedule.tenor(), schedule.businessDayConvention(), schedule.endOfMonth()); newDates.Insert(0, priorNotionalCoupon); } + + // long last coupon + if (notionalLastCoupon < schedule.endDate()) + { + Date nextNotionalCoupon = + schedule.calendar().advance( + notionalLastCoupon, + schedule.tenor(), + schedule.businessDayConvention(), + schedule.endOfMonth()); + + newDates.Add(nextNotionalCoupon); + } + return newDates; } @@ -162,8 +189,6 @@ private int findCouponsPerYear(T impl, Date refStart, Date refEnd) where T : int months = (int)(0.5 + 12 * (double)(impl.dayCount(refStart, refEnd)) / 365.0); return (int)(0.5 + 12.0 / months); } - - private Schedule schedule_; } private class Old_ISMA_Impl : DayCounter diff --git a/tests/QLNet.Tests.Old/AssemblyInfo.cs b/tests/QLNet.Tests.Old/AssemblyInfo.cs deleted file mode 100644 index ccbc4ecf0..000000000 --- a/tests/QLNet.Tests.Old/AssemblyInfo.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Reflection; -using System.Runtime.InteropServices; - -#if ! NET40 || NET45 -using Xunit; -[assembly: CollectionBehavior(DisableTestParallelization = true)] -#endif - -// Le informazioni generali relative a un assembly sono controllate dal seguente -// insieme di attributi. Per modificare le informazioni associate a un assembly -// è necessario modificare i valori di questi attributi. -[assembly: AssemblyTitle("Test")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Test")] -[assembly: AssemblyCopyright("Copyright (c) 2008-2017 Andrea Maggiulli (a.maggiulli@gmail.com)")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Se si imposta ComVisible su false, i tipi in questo assembly non saranno visibili -// ai componenti COM. Se è necessario accedere a un tipo in questo assembly da -// COM, impostare su true l'attributo ComVisible per tale tipo. -[assembly: ComVisible(false)] - -// Se il progetto viene esposto a COM, il GUID che segue verrà utilizzato per creare l'ID della libreria dei tipi -[assembly: Guid("846f17f1-9b43-4bb9-a5b8-254209212e39")] - -// Le informazioni sulla versione di un assembly sono costituite dai seguenti quattro valori: -// -// Numero di versione principale -// Numero di versione secondario -// Numero build -// Revisione -// -// È 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.10.0.0")] -[assembly: AssemblyFileVersion("1.10.0.0")] diff --git a/tests/QLNet.Tests.Old/QLNet.Tests.Old.csproj b/tests/QLNet.Tests.Old/QLNet.Tests.Old.csproj deleted file mode 100644 index ddc35272d..000000000 --- a/tests/QLNet.Tests.Old/QLNet.Tests.Old.csproj +++ /dev/null @@ -1,212 +0,0 @@ - - - - - Debug - AnyCPU - 9.0.30729 - 2.0 - {2EF8B45B-940A-4B77-8776-E8CE0036961E} - Library - Properties - TestSuite - Test - v4.5.2 - 512 - {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - - - 3.5 - - false - publish\ - true - Disk - false - Foreground - 7 - Days - false - false - true - 0 - 1.0.0.%2a - false - true - - - - - - true - full - false - bin\Debug\net40\ - TRACE;DEBUG;NET452 - prompt - 4 - AllRules.ruleset - false - - - pdbonly - true - bin\Release\net40\ - TRACE;QL_DOTNET_FRAMEWORK - prompt - 4 - AllRules.ruleset - false - - - true - bin\Debug\net45\ - TRACE;DEBUG;QL_DOTNET_FRAMEWORK - full - v4.5 - AnyCPU - prompt - AllRules.ruleset - false - - - bin\Release\net45\ - TRACE;QL_DOTNET_FRAMEWORK - true - pdbonly - v4.5.2 - AnyCPU - prompt - AllRules.ruleset - false - - - - - - - - - - - Code - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {F6E762BD-DCDF-4CA0-ABAD-CB21C7D03BEC} - QLNet - - - - - False - Microsoft .NET Framework 4 %28x86 e x64%29 - true - - - False - .NET Framework 3.5 SP1 Client Profile - false - - - False - .NET Framework 3.5 SP1 - false - - - False - Windows Installer 3.1 - true - - - - - - - - - False - - - - - - - - - \ No newline at end of file diff --git a/tests/QLNet.Tests/QLNet.Tests.csproj b/tests/QLNet.Tests/QLNet.Tests.csproj index 918d6e0b3..d1ac2178e 100644 --- a/tests/QLNet.Tests/QLNet.Tests.csproj +++ b/tests/QLNet.Tests/QLNet.Tests.csproj @@ -1,34 +1,26 @@  - 1.11.4 - net452 - QLNet.Tests - QLNet.Tests - true + net5.0 + latest + false - - - - - - - - + + - - + + Always + - diff --git a/tests/QLNet.Tests/T_AmericanOption.cs b/tests/QLNet.Tests/T_AmericanOption.cs index 3f5c45705..e70a622ca 100644 --- a/tests/QLNet.Tests/T_AmericanOption.cs +++ b/tests/QLNet.Tests/T_AmericanOption.cs @@ -21,11 +21,7 @@ under the terms of the QLNet license. You should have received a using System; using System.Collections.Generic; using System.Linq; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite @@ -60,9 +56,8 @@ public AmericanOptionData(Option.Type type_, result = result_; } } -#if NET452 - [TestClass()] -#endif + + [Collection("QLNet CI Tests")] public class T_AmericanOption { @@ -140,11 +135,7 @@ Journal of Derivatives Winter 1999 new AmericanOptionData(Option.Type.Call, 100.00, 120.00, 0.03, 0.07, 3.0, 0.3, 37.177) }; -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testBaroneAdesiWhaleyValues() { // ("Testing Barone-Adesi and Whaley approximation for American options..."); @@ -244,11 +235,7 @@ The following values were replicated only up to the second digit } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testBjerksundStenslandValues() { // ("Testing Bjerksund and Stensland approximation for American options..."); @@ -319,11 +306,7 @@ public void testBjerksundStenslandValues() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testJuValues() { @@ -375,11 +358,7 @@ public void testJuValues() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFdValues() { @@ -431,7 +410,7 @@ public void testFdValues() } } - public void testFdGreeks() where Engine : IFDEngine, new () + internal void testFdGreeks() where Engine : IFDEngine, new () { using (SavedSettings backup = new SavedSettings()) { @@ -558,22 +537,14 @@ public void testFdValues() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFdAmericanGreeks() { //("Testing finite-differences American option greeks..."); testFdGreeks(); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFdShoutGreeks() { // ("Testing finite-differences shout option greeks..."); @@ -599,11 +570,8 @@ void REPORT_FAILURE(string greekName, StrikedTypePayoff payoff, Exercise exercis + " tolerance: " + tolerance); } -#if NET452 - [TestMethod()] -#else + [Fact] -#endif public void testFdImpliedVol() { var settlementDate = new Date(26, 2, 2015); @@ -635,11 +603,7 @@ public void testFdImpliedVol() QAssert.Fail(string.Format("Implied volatility calculation failed. Expected {0}. Actual {1}", volatility, impliedVol)); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFDDividendAmericanEngine() { /* diff --git a/tests/QLNet.Tests/T_AsianOptions.cs b/tests/QLNet.Tests/T_AsianOptions.cs index 662dd846a..34f15e7e8 100644 --- a/tests/QLNet.Tests/T_AsianOptions.cs +++ b/tests/QLNet.Tests/T_AsianOptions.cs @@ -21,21 +21,15 @@ under the terms of the QLNet license. You should have received a using System; using System.Collections.Generic; using System.Linq; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_AsianOptions { - public void REPORT_FAILURE(string greekName, Average.Type averageType, + internal void REPORT_FAILURE(string greekName, Average.Type averageType, double? runningAccumulator, int? pastFixings, List fixingDates, StrikedTypePayoff payoff, Exercise exercise, double s, double q, double r, @@ -79,11 +73,7 @@ public string averageTypeToString(Average.Type averageType) return String.Empty; } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testAnalyticContinuousGeometricAveragePrice() { // Testing analytic continuous geometric average-price Asians @@ -162,11 +152,7 @@ public void testAnalyticContinuousGeometricAveragePrice() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testAnalyticContinuousGeometricAveragePriceGreeks() { // Testing analytic continuous geometric average-price Asian greeks @@ -327,11 +313,7 @@ public void testAnalyticContinuousGeometricAveragePriceGreeks() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testAnalyticDiscreteGeometricAveragePrice() { // Testing analytic discrete geometric average-price Asians @@ -390,11 +372,7 @@ public void testAnalyticDiscreteGeometricAveragePrice() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testAnalyticDiscreteGeometricAverageStrike() { // Testing analytic discrete geometric average-strike Asians @@ -451,7 +429,7 @@ public void testAnalyticDiscreteGeometricAverageStrike() } - //[TestMethod()] + [Fact(Skip = "Incomplete")] public void testMCDiscreteGeometricAveragePrice() { // Testing Monte Carlo discrete geometric average-price Asians @@ -522,11 +500,7 @@ public void testMCDiscreteGeometricAveragePrice() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testAnalyticDiscreteGeometricAveragePriceGreeks() { // Testing discrete-averaging geometric Asian greeks @@ -697,7 +671,7 @@ public void testAnalyticDiscreteGeometricAveragePriceGreeks() } } - // Issue #115 + [Fact] public void testIssue115() { DateTime timer = DateTime.Now; diff --git a/tests/QLNet.Tests/T_AssetSwap.cs b/tests/QLNet.Tests/T_AssetSwap.cs index 99a5d3496..4dda9b63d 100644 --- a/tests/QLNet.Tests/T_AssetSwap.cs +++ b/tests/QLNet.Tests/T_AssetSwap.cs @@ -18,41 +18,25 @@ under the terms of the QLNet license. You should have received a */ using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_AssetSwap : IDisposable { #region Initialize&Cleanup private SavedSettings backup; private IndexHistoryCleaner cleaner; -#if NET452 - [TestInitialize] - public void testInitialize() - { -#else + public T_AssetSwap() { -#endif + backup = new SavedSettings(); cleaner = new IndexHistoryCleaner(); } -#if NET452 - [TestCleanup] -#endif - public void testCleanup() - { - Dispose(); - } + public void Dispose() { backup.Dispose(); @@ -107,11 +91,7 @@ public CommonVars() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testConsistency() { @@ -432,11 +412,7 @@ public void testConsistency() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testImpliedValue() { // Testing implied bond value against asset-swap fair price with null spread @@ -740,11 +716,7 @@ public void testImpliedValue() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testMarketASWSpread() { // Testing relationship between market asset swap and par asset swap... @@ -1140,11 +1112,7 @@ public void testMarketASWSpread() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testZSpread() { // Testing clean and dirty price with null Z-spread against theoretical prices... @@ -1423,11 +1391,7 @@ public void testZSpread() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testGenericBondImplied() { @@ -1775,11 +1739,7 @@ public void testGenericBondImplied() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testMASWWithGenericBond() { // Testing market asset swap against par asset swap with generic bond... @@ -2203,11 +2163,7 @@ public void testMASWWithGenericBond() "\n tolerance: " + tolerance); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testZSpreadWithGenericBond() { // Testing clean and dirty price with null Z-spread against theoretical prices... @@ -2530,11 +2486,7 @@ public void testZSpreadWithGenericBond() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSpecializedBondVsGenericBond() { // Testing clean and dirty prices for specialized bond against equivalent generic bond... @@ -3043,11 +2995,7 @@ public void testSpecializedBondVsGenericBond() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSpecializedBondVsGenericBondUsingAsw() { // Testing asset-swap prices and spreads for specialized bond against equivalent generic bond... diff --git a/tests/QLNet.Tests/T_BarrierOption.cs b/tests/QLNet.Tests/T_BarrierOption.cs index 06a702c8c..9f097dfcd 100644 --- a/tests/QLNet.Tests/T_BarrierOption.cs +++ b/tests/QLNet.Tests/T_BarrierOption.cs @@ -16,18 +16,12 @@ // FOR A PARTICULAR PURPOSE. See the license for more details. using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_BarrierOption { private void REPORT_FAILURE(string greekName, @@ -203,11 +197,7 @@ public BarrierFxOptionData(Barrier.Type barrierType, double barrier, double reba } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testHaugValues() { // Testing barrier options against Haug's values @@ -460,11 +450,7 @@ Option Valuation" } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testBabsiriValues() { // Testing barrier options against Babsiri's values @@ -567,11 +553,7 @@ Data from } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testBeagleholeValues() { // Testing barrier options against Beaglehole's values @@ -664,11 +646,7 @@ Option Valuation" } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testLocalVolAndHestonComparison() { // Testing local volatility and Heston FD engines for barrier options @@ -796,11 +774,7 @@ public void testLocalVolAndHestonComparison() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testVannaVolgaSimpleBarrierValues() { // Testing barrier FX options against Vanna/Volga values diff --git a/tests/QLNet.Tests/T_BasketOption.cs b/tests/QLNet.Tests/T_BasketOption.cs index 66e66d396..1aec8a621 100644 --- a/tests/QLNet.Tests/T_BasketOption.cs +++ b/tests/QLNet.Tests/T_BasketOption.cs @@ -18,19 +18,13 @@ under the terms of the QLNet license. You should have received a using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_BasketOption { public enum BasketType { MinBasket, MaxBasket, SpreadBasket } @@ -99,7 +93,8 @@ public string basketTypeToString(BasketType basketType) Utils.QL_FAIL("unknown basket option type"); return String.Empty; } - public void REPORT_FAILURE_2(String greekName, BasketType basketType, PlainVanillaPayoff payoff, Exercise exercise, + + internal void REPORT_FAILURE_2(String greekName, BasketType basketType, PlainVanillaPayoff payoff, Exercise exercise, double s1, double s2, double q1, double q2, double r, Date today, double v1, double v2, double rho, double expected, double calculated, double error, double tolerance) { @@ -125,11 +120,7 @@ public void REPORT_FAILURE_2(String greekName, BasketType basketType, PlainVanil } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testEuroTwoValues() { // Testing two-asset European basket options... diff --git a/tests/QLNet.Tests/T_Bermudanswaption.cs b/tests/QLNet.Tests/T_Bermudanswaption.cs index adb56d5cf..18c5fe419 100644 --- a/tests/QLNet.Tests/T_Bermudanswaption.cs +++ b/tests/QLNet.Tests/T_Bermudanswaption.cs @@ -19,39 +19,22 @@ under the terms of the QLNet license. You should have received a using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_Bermudanswaption : IDisposable { #region Initialize&Cleanup private SavedSettings backup; -#if NET452 - [TestInitialize] - public void testInitialize() - { -#else + public T_Bermudanswaption() { -#endif backup = new SavedSettings(); } -#if NET452 - [TestCleanup] -#endif - public void testCleanup() - { - Dispose(); - } + public void Dispose() { backup.Dispose(); @@ -126,11 +109,7 @@ public VanillaSwap makeSwap(double fixedRate) } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCachedValues() { diff --git a/tests/QLNet.Tests/T_BinaryOption.cs b/tests/QLNet.Tests/T_BinaryOption.cs index dece76149..ceab22d4e 100644 --- a/tests/QLNet.Tests/T_BinaryOption.cs +++ b/tests/QLNet.Tests/T_BinaryOption.cs @@ -15,18 +15,12 @@ // FOR A PARTICULAR PURPOSE. See the license for more details. using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_BinaryOption { private void REPORT_FAILURE(string greekName, @@ -96,11 +90,7 @@ public BinaryOptionData(Barrier.Type barrierType, double barrier, double cash, O } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCashOrNothingHaugValues() { // Testing cash-or-nothing barrier options against Haug's values @@ -198,11 +188,7 @@ public void testCashOrNothingHaugValues() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testAssetOrNothingHaugValues() { // Testing asset-or-nothing barrier options against Haug's values diff --git a/tests/QLNet.Tests/T_BlackDeltaCalculator.cs b/tests/QLNet.Tests/T_BlackDeltaCalculator.cs index 87230ddb9..380d582d0 100644 --- a/tests/QLNet.Tests/T_BlackDeltaCalculator.cs +++ b/tests/QLNet.Tests/T_BlackDeltaCalculator.cs @@ -15,18 +15,12 @@ // FOR A PARTICULAR PURPOSE. See the license for more details. using System; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_BlackDeltaCalculator { private int timeToDays(double t) @@ -87,11 +81,7 @@ public EuropeanOptionData(Option.Type type, double strike, double s, double q, d } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testDeltaValues() { // Testing delta calculator values @@ -177,11 +167,7 @@ public void testDeltaValues() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testDeltaPriceConsistency() { // Testing premium-adjusted delta price consistency @@ -332,11 +318,7 @@ public void testDeltaPriceConsistency() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testPutCallParity() { // Testing put-call parity for deltas @@ -532,11 +514,7 @@ pag 11-16 } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testAtmCalcs() { // Testing delta-neutral ATM quotations diff --git a/tests/QLNet.Tests/T_BlackFormula.cs b/tests/QLNet.Tests/T_BlackFormula.cs index 092d9518f..46321380b 100644 --- a/tests/QLNet.Tests/T_BlackFormula.cs +++ b/tests/QLNet.Tests/T_BlackFormula.cs @@ -17,25 +17,15 @@ under the terms of the QLNet license. You should have received a FOR A PARTICULAR PURPOSE. See the license for more details. */ using System; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_BlackFormula { -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testBachelierImpliedVol() { // Testing Bachelier implied vol... @@ -62,11 +52,7 @@ public void testBachelierImpliedVol() return; } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testChambersImpliedVol() { // Testing Chambers-Nawalkha implied vol approximation diff --git a/tests/QLNet.Tests/T_Bonds.cs b/tests/QLNet.Tests/T_Bonds.cs index d5260a92c..53f5565fd 100644 --- a/tests/QLNet.Tests/T_Bonds.cs +++ b/tests/QLNet.Tests/T_Bonds.cs @@ -21,40 +21,24 @@ under the terms of the QLNet license. You should have received a using System; using System.Collections.Generic; using System.Globalization; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; using Calendar = QLNet.Calendar; +[assembly: CollectionBehavior(DisableTestParallelization = true)] namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_Bonds : IDisposable { #region Initialize&Cleanup private SavedSettings backup; -#if NET452 - [TestInitialize] - public void testInitialize() - { -#else + public T_Bonds() { -#endif backup = new SavedSettings(); } -#if NET452 - [TestCleanup] -#endif - public void testCleanup() - { - Dispose(); - } + public void Dispose() { backup.Dispose(); @@ -78,11 +62,7 @@ public CommonVars() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testYield() { @@ -161,11 +141,8 @@ public void testYield() } } } -#if NET452 - [TestMethod()] -#else + [Fact] -#endif public void testTheoretical() { // "Testing theoretical bond price/yield calculation..."); @@ -248,11 +225,8 @@ public void testTheoretical() } } } -#if NET452 - [TestMethod()] -#else + [Fact] -#endif public void testCached() { // ("Testing bond price/yield calculation against cached values..."); @@ -447,11 +421,8 @@ public void testCached() + "\n error: " + (price - cachedPrice3)); } } -#if NET452 - [TestMethod()] -#else + [Fact] -#endif public void testCachedZero() { // Testing zero-coupon bond prices against cached values @@ -520,11 +491,8 @@ public void testCachedZero() + " error: " + (price - cachedPrice3)); } } -#if NET452 - [TestMethod()] -#else + [Fact] -#endif public void testCachedFixed() { // "Testing fixed-coupon bond prices against cached values..."); @@ -614,11 +582,8 @@ public void testCachedFixed() + " error: " + (price - cachedPrice3)); } } -#if NET452 - [TestMethod()] -#else + [Fact] -#endif public void testCachedFloating() { // "Testing floating-rate bond prices against cached values..."); @@ -738,11 +703,8 @@ public void testCachedFloating() + " error: " + (price - cachedPrice3)); } } -#if NET452 - [TestMethod()] -#else + [Fact] -#endif public void testBrazilianCached() { //("Testing Brazilian public bond prices against cached values..."); @@ -832,11 +794,7 @@ public void testBrazilianCached() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testAmortizingFixedBond() { Date startDate = new Date(2, 1, 2007); @@ -879,12 +837,7 @@ public void testAmortizingFixedBond() } - -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testMBSFixedBondCached() { // Test MBS Bond against cached values @@ -1101,11 +1054,7 @@ public void testMBSFixedBondCached() QAssert.AreEqual(0.0556, bond.BondEquivalentYield(), 0.0001, " Bond Equivalent Yield is different"); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testAmortizingBond1() { // Input Values @@ -1136,11 +1085,7 @@ public void testAmortizingBond1() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testAmortizingBond2() { // Par – 500,000 @@ -1180,11 +1125,7 @@ public void testAmortizingBond2() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testAmortizingFixedRateBond() { // Testing amortizing fixed rate bond @@ -1255,11 +1196,7 @@ public void testAmortizingFixedRateBond() /// This requires the use of the Schedule to be constructed /// with a custom date vector /// -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testBondFromScheduleWithDateVector() { // Testing South African R2048 bond price using Schedule constructor with Date vector @@ -1330,11 +1267,7 @@ public void testBondFromScheduleWithDateVector() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testWeightedAverageLife() { // Test against know data @@ -1363,34 +1296,20 @@ public enum CouponType OIS, ZeroCoupon } -#if NET452 - [DataTestMethod] - [DataRow(CouponType.FixedRate, 5.25, "2/13/2018", "12/01/2032", "3/23/2018", "", 119.908, 5.833, 3.504)] - [DataRow(CouponType.ZeroCoupon, 0, "3/15/2018", "1/1/2054", "3/26/2018", "", 5.793, 0.00, 8.126)] - [DataRow(CouponType.FixedRate, 2.2, "3/1/2018", "3/1/2021", "3/26/2018", "", 100.530, 1.53, 2.013)] - [DataRow(CouponType.FixedRate, 2.25, "3/1/2018", "3/1/2021", "3/26/2018", "", 100.393, 1.56, 2.111)] - [DataRow(CouponType.FixedRate, 3, "2/15/2018", "2/15/2031", "3/26/2018", "", 98.422, 3.42, 3.150)] - [DataRow(CouponType.FixedRate, 4, "2/1/2018", "2/15/2027", "3/26/2018", "08/15/2018", 111.170, 6.11, 2.585)] - [DataRow(CouponType.FixedRate, 4, "2/20/2018", "10/1/2036", "3/26/2018", "", 104.676, 4.00, 3.650)] - [DataRow(CouponType.FixedRate, 1.85, "2/1/2018", "2/1/2021", "3/26/2018", "", 99.916, 2.83, 1.880)] - [DataRow(CouponType.FixedRate, 2.85, "2/15/2018", "2/15/2031", "3/26/2018", "", 99.525, 3.25, 2.984)] - [DataRow(CouponType.FixedRate, 5.375, "08/26/2010", "03/01/2023", "7/16/2018", "", 103.674, 20.156, 4.490)] -#else + [Theory] - [InlineData(CouponType.FixedRate, 5.25, "2/13/2018", "12/01/2032", "3/23/2018", "", 119.908, 5.833, 3.504)] - [InlineData(CouponType.ZeroCoupon, 0, "3/15/2018", "1/1/2054", "3/26/2018", "", 5.793, 0.00, 8.126)] - [InlineData(CouponType.FixedRate, 2.2, "3/1/2018", "3/1/2021", "3/26/2018", "", 100.530, 1.53, 2.013)] - [InlineData(CouponType.FixedRate, 2.25, "3/1/2018", "3/1/2021", "3/26/2018", "", 100.393, 1.56, 2.111)] - [InlineData(CouponType.FixedRate, 3, "2/15/2018", "2/15/2031", "3/26/2018", "", 98.422, 3.42, 3.150)] - [InlineData(CouponType.FixedRate, 4, "2/1/2018", "2/15/2027", "3/26/2018", "08/15/2018", 111.170, 6.11, 2.585)] - [InlineData(CouponType.FixedRate, 4, "2/20/2018", "10/1/2036", "3/26/2018", "", 104.676, 4.00, 3.650)] - [InlineData(CouponType.FixedRate, 1.85, "2/1/2018", "2/1/2021", "3/26/2018", "", 99.916, 2.83, 1.880)] - [InlineData(CouponType.FixedRate, 2.85, "2/15/2018", "2/15/2031", "3/26/2018", "", 99.525, 3.25, 2.984)] - [InlineData(CouponType.FixedRate, 5.375, "03/01/2018", "03/01/2023", "7/16/2018", "", 103.674, 20.156, 4.490)] -#endif - public void testAccruedInterest(CouponType couponType, double Coupon, - string AccrualDate, string MaturityDate, string SettlementDate, string FirstCouponDate, - double Price, double expectedAccruedInterest, double expectedYtm) + [InlineData(5.25, "2/13/2018", "12/01/2032", "3/23/2018", "", 5.833)] + [InlineData( 0, "3/15/2018", "1/1/2054", "3/26/2018", "", 0.00)] + [InlineData(2.2, "3/1/2018", "3/1/2021", "3/26/2018", "", 1.53)] + [InlineData(2.25, "3/1/2018", "3/1/2021", "3/26/2018", "", 1.56)] + [InlineData(3, "2/15/2018", "2/15/2031", "3/26/2018", "", 3.42)] + [InlineData(4, "2/1/2018", "2/15/2027", "3/26/2018", "08/15/2018", 6.11)] + [InlineData(4, "2/20/2018", "10/1/2036", "3/26/2018", "", 4.00)] + [InlineData(1.85, "2/1/2018", "2/1/2021", "3/26/2018", "", 2.83)] + [InlineData(2.85, "2/15/2018", "2/15/2031", "3/26/2018", "", 3.25)] + [InlineData(5.375, "08/26/2010", "03/01/2023", "7/16/2018", "", 20.156)] + public void testAccruedInterest(double Coupon, string AccrualDate, string MaturityDate, + string SettlementDate, string FirstCouponDate, double expectedAccruedInterest) { // Convert dates Date maturityDate = Convert.ToDateTime(MaturityDate, new CultureInfo("en-US")); @@ -1446,11 +1365,7 @@ public test_case(Date settlementDate, double testPrice, double accruedAmount, do } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testExCouponGilt() { // Testing ex-coupon UK Gilt price against market values @@ -1589,11 +1504,7 @@ 6 days below and UK calendar } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testExCouponAustralianBond() { // Testing ex-coupon Australian bond price against market values @@ -1726,11 +1637,7 @@ AGB accrued interest is rounded to 3dp. } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testThirty360BondWithSettlementOn31st() { // Testing Thirty/360 bond with settlement on 31st of the month @@ -1779,22 +1686,6 @@ public void testThirty360BondWithSettlementOn31st() + "\n expected: " + "0.7"); } -#if NET452 - [DataTestMethod()] - [DataRow("64990C4X6", "07/01/2035", 4, "07/10/2018", 106.599, 12.417, 10.24)] - [DataRow("64990C5B3", "07/01/2047", 4, "07/10/2018", 103.9, 17.296, 12.87)] - [DataRow("546415L40", "05/15/2033", 4, "07/10/2018", 104.239, 11.154, 7.71)] - [DataRow("646140CN1", "01/01/2035", 4, "07/10/2018", 105.262, 12.118, 10.59)] - [DataRow("70024PCW7", "06/15/2028", 4, "07/10/2018", 110.839, 8.257, 7.82)] - //[DataRow("602453HJ4", "06/15/2048", 4, "07/10/2018", 103.753, 17.61, 13.73)] // 17.562 from calculation - //[DataRow("397586QG6", "02/15/2035", 4, "07/17/2018", 103.681, 12.138, 8.3)] // 11.946 from calculation - //[DataRow("544351NT2", "06/27/2019", 4, "07/10/2018", 102.424, 0.951, 0.96)] // 0.947 from calculation - //[DataRow("15147TDU9", "07/15/2035", 4, "07/10/2018", 105.591, 12.405, 10.7)] - //[DataRow("832645JK2", "08/15/2048", 4, "07/10/2018", 103.076, 17.618, 13.35)] - //[DataRow("956622N91", "06/01/2051", 4, "07/11/2018", 100, 18.206, 14.92)] - //[DataRow("397586QF8", "02/15/2034", 4, "07/17/2018", 103.941, 11.612, 7.87)] - -#else [Theory] [InlineData("64990C4X6", "07/01/2035", 4, "07/10/2018", 106.599, 12.417, 10.24)] [InlineData("64990C5B3", "07/01/2047", 4, "07/10/2018", 103.9, 17.296, 12.87)] @@ -1808,13 +1699,14 @@ public void testThirty360BondWithSettlementOn31st() //[InlineData("832645JK2", "08/15/2048", 4, "07/10/2018", 103.076, 17.618, 13.35)] //[InlineData("956622N91", "06/01/2051", 4, "07/11/2018", 100, 18.206, 14.92)] //[InlineData("397586QF8", "02/15/2034", 4, "07/17/2018", 103.941, 11.612, 7.87)] -#endif public void testDurations(string Cusip, string MaturityDate, double Coupon, string SettlementDate, double Price, double ExpectedModifiedDuration, double ExpectedOASDuration) { // Convert dates Date maturityDate = Convert.ToDateTime(MaturityDate, new CultureInfo("en-US")); Date settlementDate = Convert.ToDateTime(SettlementDate, new CultureInfo("en-US")); + var expectedOasDuration = ExpectedOASDuration; + Settings.setEvaluationDate(settlementDate); // Divide number by 100 Coupon = Coupon / 100; @@ -1860,11 +1752,7 @@ public SteppedCoupon(Date startDate, Date enDate, double rate) } } -#if NET452 - [TestMethod] -#else [Fact] -#endif public void testSteppedCoupon() { // Sample 1 @@ -1998,16 +1886,10 @@ public void testSteppedCoupon() + "\n expected: " + expectedAccruedInterest); } -#if NET452 - [DataTestMethod] - [DataRow(CouponType.FixedRate, 1.850, "11/23/2015", "11/23/2018", "11/23/2018", "5/23/2016", 100.8547)] - [DataRow(CouponType.FixedRate, 2.200, "10/22/2014", "10/22/2019", "12/24/2018", "4/22/2015", 994.263)] -#else [Theory] - [InlineData(CouponType.FixedRate, 1.850, "11/23/2015", "11/23/2018", "11/23/2018", "5/23/2016", 100.8547)] - [InlineData(CouponType.FixedRate, 2.200, "10/22/2014", "10/22/2019", "12/24/2018", "4/22/2015", 994.263)] -#endif - public void testQLNetExceptions(CouponType couponType, double Coupon, + [InlineData(1.850, "11/23/2015", "11/23/2018", "11/23/2018", "5/23/2016", 100.8547)] + [InlineData(2.200, "10/22/2014", "10/22/2019", "12/24/2018", "4/22/2015", 994.263)] + public void testQLNetExceptions(double Coupon, string AccrualDate, string MaturityDate, string SettlementDate, string FirstCouponDate, double Price) { diff --git a/tests/QLNet.Tests/T_BusinessDayConvention.cs b/tests/QLNet.Tests/T_BusinessDayConvention.cs index 40254742e..a78771131 100644 --- a/tests/QLNet.Tests/T_BusinessDayConvention.cs +++ b/tests/QLNet.Tests/T_BusinessDayConvention.cs @@ -16,18 +16,12 @@ under the terms of the QLNet license. You should have received a ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. */ -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_BusinessDayConvention { struct SingleCase @@ -54,11 +48,7 @@ public SingleCase(Calendar calendar_, public Date result; } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testConventions() { // Testing business day conventions... diff --git a/tests/QLNet.Tests/T_CPISwap.cs b/tests/QLNet.Tests/T_CPISwap.cs index 7bb90a166..2121dfd62 100644 --- a/tests/QLNet.Tests/T_CPISwap.cs +++ b/tests/QLNet.Tests/T_CPISwap.cs @@ -15,18 +15,12 @@ // FOR A PARTICULAR PURPOSE. See the license for more details. using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_CPISwap { internal struct Datum @@ -246,11 +240,7 @@ public CommonVars() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void consistency() { // check inflation leg vs calculation directly from inflation TS @@ -361,11 +351,7 @@ public void consistency() common.hcpi.linkTo(null); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void zciisconsistency() { CommonVars common = new CommonVars(); @@ -422,11 +408,7 @@ public void zciisconsistency() common.hcpi.linkTo(null); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void cpibondconsistency() { CommonVars common = new CommonVars(); diff --git a/tests/QLNet.Tests/T_Calendars.cs b/tests/QLNet.Tests/T_Calendars.cs index 410f04685..3cda1f4df 100644 --- a/tests/QLNet.Tests/T_Calendars.cs +++ b/tests/QLNet.Tests/T_Calendars.cs @@ -20,26 +20,16 @@ under the terms of the QLNet license. You should have received a using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; using System.Diagnostics; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_Calendars { -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testModifiedCalendars() { Calendar c1 = new TARGET(); @@ -78,11 +68,7 @@ public void testModifiedCalendars() QAssert.IsFalse(c1.isHoliday(d2), d2 + " still a holiday"); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testJointCalendars() { Calendar c1 = new TARGET(), @@ -148,11 +134,7 @@ public void testJointCalendars() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testUSSettlement() { // Testing US settlement holiday list @@ -220,11 +202,7 @@ public void testUSSettlement() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testUSGovernmentBondMarket() { @@ -234,6 +212,7 @@ public void testUSGovernmentBondMarket() expectedHol.Add(new Date(16, Month.February, 2004)); expectedHol.Add(new Date(9, Month.April, 2004)); expectedHol.Add(new Date(31, Month.May, 2004)); + expectedHol.Add(new Date(11, Month.June, 2004)); // Reagan's funeral expectedHol.Add(new Date(5, Month.July, 2004)); expectedHol.Add(new Date(6, Month.September, 2004)); expectedHol.Add(new Date(11, Month.October, 2004)); @@ -255,11 +234,7 @@ public void testUSGovernmentBondMarket() " calculated holidays"); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testUSNewYorkStockExchange() { @@ -360,11 +335,7 @@ public void testUSNewYorkStockExchange() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testTARGET() { List expectedHol = new List(); @@ -429,11 +400,7 @@ public void testTARGET() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testGermanyFrankfurt() { List expectedHol = new List(); @@ -445,13 +412,11 @@ public void testGermanyFrankfurt() expectedHol.Add(new Date(24, Month.December, 2003)); expectedHol.Add(new Date(25, Month.December, 2003)); expectedHol.Add(new Date(26, Month.December, 2003)); - expectedHol.Add(new Date(31, Month.December, 2003)); expectedHol.Add(new Date(1, Month.January, 2004)); expectedHol.Add(new Date(9, Month.April, 2004)); expectedHol.Add(new Date(12, Month.April, 2004)); expectedHol.Add(new Date(24, Month.December, 2004)); - expectedHol.Add(new Date(31, Month.December, 2004)); Calendar c = new Germany(Germany.Market.FrankfurtStockExchange); List hol = Calendar.holidayList(c, new Date(1, Month.January, 2003), new Date(31, Month.December, 2004)); @@ -467,11 +432,7 @@ public void testGermanyFrankfurt() + " calculated holidays"); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testGermanyEurex() { List expectedHol = new List(); @@ -506,11 +467,7 @@ public void testGermanyEurex() + " calculated holidays"); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testGermanyXetra() { List expectedHol = new List(); @@ -522,13 +479,11 @@ public void testGermanyXetra() expectedHol.Add(new Date(24, Month.December, 2003)); expectedHol.Add(new Date(25, Month.December, 2003)); expectedHol.Add(new Date(26, Month.December, 2003)); - expectedHol.Add(new Date(31, Month.December, 2003)); expectedHol.Add(new Date(1, Month.January, 2004)); expectedHol.Add(new Date(9, Month.April, 2004)); expectedHol.Add(new Date(12, Month.April, 2004)); expectedHol.Add(new Date(24, Month.December, 2004)); - expectedHol.Add(new Date(31, Month.December, 2004)); Calendar c = new Germany(Germany.Market.Xetra); List hol = Calendar.holidayList(c, new Date(1, Month.January, 2003), new Date(31, Month.December, 2004)); @@ -543,11 +498,7 @@ public void testGermanyXetra() + " calculated holidays"); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testUKSettlement() { //BOOST_MESSAGE("Testing UK settlement holiday list..."); @@ -604,11 +555,7 @@ public void testUKSettlement() + " calculated holidays"); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testUKExchange() { //BOOST_MESSAGE("Testing London Stock Exchange holiday list..."); @@ -665,11 +612,7 @@ public void testUKExchange() + " calculated holidays"); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testUKMetals() { //BOOST_MESSAGE("Testing London Metals Exchange holiday list..."); @@ -726,11 +669,7 @@ public void testUKMetals() + " calculated holidays"); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testItalyExchange() { //BOOST_MESSAGE("Testing Milan Stock Exchange holiday list..."); @@ -777,11 +716,7 @@ public void testItalyExchange() + " calculated holidays"); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testBrazil() { //BOOST_MESSAGE("Testing Brazil holiday list..."); @@ -828,11 +763,7 @@ public void testBrazil() + " calculated holidays"); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSouthKoreanSettlement() { //("Testing South-Korean settlement holiday list..."); @@ -923,11 +854,7 @@ public void testSouthKoreanSettlement() + " calculated holidays"); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testKoreaStockExchange() { //("Testing Korea Stock Exchange holiday list..."); @@ -1024,11 +951,7 @@ public void testKoreaStockExchange() + " calculated holidays"); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testChinaSSE() { // Testing China Shanghai Stock Exchange holiday list @@ -1138,18 +1061,60 @@ public void testChinaSSE() expectedHol.Add(new Date(8, Month.Feb, 2019)); expectedHol.Add(new Date(5, Month.April, 2019)); expectedHol.Add(new Date(1, Month.May, 2019)); + expectedHol.Add(new Date(2, Month.May, 2019)); + expectedHol.Add(new Date(3, Month.May, 2019)); expectedHol.Add(new Date(7, Month.June, 2019)); expectedHol.Add(new Date(13, Month.September, 2019)); - expectedHol.Add(new Date(30, Month.September, 2019)); expectedHol.Add(new Date(1, Month.October, 2019)); expectedHol.Add(new Date(2, Month.October, 2019)); expectedHol.Add(new Date(3, Month.October, 2019)); expectedHol.Add(new Date(4, Month.October, 2019)); - + expectedHol.Add(new Date(7, Month.October, 2019)); + + // China Shanghai Securities Exchange holiday list in the year 2020 + expectedHol.Add(new Date(1, Month.Jan, 2020)); + expectedHol.Add(new Date(24, Month.Jan, 2020)); + expectedHol.Add(new Date(27, Month.Jan, 2020)); + expectedHol.Add(new Date(28, Month.Jan, 2020)); + expectedHol.Add(new Date(29, Month.Jan, 2020)); + expectedHol.Add(new Date(30, Month.Jan, 2020)); + expectedHol.Add(new Date(31, Month.Jan, 2020)); + expectedHol.Add(new Date(6, Month.April, 2020)); + expectedHol.Add(new Date(1, Month.May, 2020)); + expectedHol.Add(new Date(4, Month.May, 2020)); + expectedHol.Add(new Date(5, Month.May, 2020)); + expectedHol.Add(new Date(25, Month.June, 2020)); + expectedHol.Add(new Date(26, Month.June, 2020)); + expectedHol.Add(new Date(1, Month.October, 2020)); + expectedHol.Add(new Date(2, Month.October, 2020)); + expectedHol.Add(new Date(5, Month.October, 2020)); + expectedHol.Add(new Date(6, Month.October, 2020)); + expectedHol.Add(new Date(7, Month.October, 2020)); + expectedHol.Add(new Date(8, Month.October, 2020)); + + // China Shanghai Securities Exchange holiday list in the year 2021 + expectedHol.Add(new Date(1, Month.Jan, 2021)); + expectedHol.Add(new Date(11, Month.Feb, 2021)); + expectedHol.Add(new Date(12, Month.Feb, 2021)); + expectedHol.Add(new Date(15, Month.Feb, 2021)); + expectedHol.Add(new Date(16, Month.Feb, 2021)); + expectedHol.Add(new Date(17, Month.Feb, 2021)); + expectedHol.Add(new Date(5, Month.April, 2021)); + expectedHol.Add(new Date(3, Month.May, 2021)); + expectedHol.Add(new Date(4, Month.May, 2021)); + expectedHol.Add(new Date(5, Month.May, 2021)); + expectedHol.Add(new Date(14, Month.June, 2021)); + expectedHol.Add(new Date(20, Month.September, 2021)); + expectedHol.Add(new Date(21, Month.September, 2021)); + expectedHol.Add(new Date(1, Month.October, 2021)); + expectedHol.Add(new Date(4, Month.October, 2021)); + expectedHol.Add(new Date(5, Month.October, 2021)); + expectedHol.Add(new Date(6, Month.October, 2021)); + expectedHol.Add(new Date(7, Month.October, 2021)); Calendar c = new China(China.Market.SSE); List hol = Calendar.holidayList(c, new Date(1, Month.January, 2014), - new Date(31, Month.December, 2019)); + new Date(31, Month.December, 2021)); for (int i = 0; i < Math.Min(hol.Count, expectedHol.Count); i++) { @@ -1163,11 +1128,7 @@ public void testChinaSSE() + " calculated holidays"); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testChinaIB() { // Testing China Inter Bank working weekends list @@ -1214,12 +1175,31 @@ public void testChinaIB() // China Inter Bank working weekends list in the year 2019 expectedWorkingWeekEnds.Add(new Date(2, Month.Feb, 2019)); expectedWorkingWeekEnds.Add(new Date(3, Month.Feb, 2019)); + expectedWorkingWeekEnds.Add(new Date(28, Month.April, 2019)); + expectedWorkingWeekEnds.Add(new Date(5, Month.May, 2019)); expectedWorkingWeekEnds.Add(new Date(29, Month.September, 2019)); expectedWorkingWeekEnds.Add(new Date(12, Month.October, 2019)); + // China Inter Bank working weekends list in the year 2020 + expectedWorkingWeekEnds.Add(new Date(19, Month.January, 2020)); + expectedWorkingWeekEnds.Add(new Date(26, Month.April, 2020)); + expectedWorkingWeekEnds.Add(new Date(9, Month.May, 2020)); + expectedWorkingWeekEnds.Add(new Date(28, Month.June, 2020)); + expectedWorkingWeekEnds.Add(new Date(27, Month.September, 2020)); + expectedWorkingWeekEnds.Add(new Date(10, Month.October, 2020)); + + // China Inter Bank working weekends list in the year 2021 + expectedWorkingWeekEnds.Add(new Date(7, Month.Feb, 2021)); + expectedWorkingWeekEnds.Add(new Date(20, Month.Feb, 2021)); + expectedWorkingWeekEnds.Add(new Date(25, Month.April, 2021)); + expectedWorkingWeekEnds.Add(new Date(8, Month.May, 2021)); + expectedWorkingWeekEnds.Add(new Date(18, Month.September, 2021)); + expectedWorkingWeekEnds.Add(new Date(26, Month.September, 2021)); + expectedWorkingWeekEnds.Add(new Date(9, Month.October, 2021)); + Calendar c = new China(China.Market.IB); Date start = new Date(1, Month.Jan, 2014); - Date end = new Date(31, Month.Dec, 2019); + Date end = new Date(31, Month.Dec, 2021); int k = 0; @@ -1240,11 +1220,8 @@ public void testChinaIB() + " expected working weekends, while there are " + k + " calculated holidays"); } -#if NET452 - [TestMethod()] -#else + [Fact] -#endif public void testEndOfMonth() { //BOOST_MESSAGE("Testing end-of-month calculation..."); @@ -1274,11 +1251,7 @@ public void testEndOfMonth() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testBusinessDaysBetween() { @@ -1426,11 +1399,7 @@ public void testBusinessDaysBetween() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testBespokeCalendars() { diff --git a/tests/QLNet.Tests/T_CapFloor.cs b/tests/QLNet.Tests/T_CapFloor.cs index 5e5fc862f..00733c281 100644 --- a/tests/QLNet.Tests/T_CapFloor.cs +++ b/tests/QLNet.Tests/T_CapFloor.cs @@ -19,40 +19,23 @@ under the terms of the QLNet license. You should have received a using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_CapFloor : IDisposable { #region Initialize&Cleanup private SavedSettings backup; -#if NET452 - [TestInitialize] - public void testInitialize() - { -#else + public T_CapFloor() { -#endif backup = new SavedSettings(); } -#if NET452 - [TestCleanup] -#endif - public void testCleanup() - { - Dispose(); - } + public void Dispose() { backup.Dispose(); @@ -155,11 +138,7 @@ string typeToString(CapFloorType type) } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testVega() { CommonVars vars = new CommonVars(); @@ -215,11 +194,7 @@ public void testVega() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testStrikeDependency() { @@ -279,11 +254,7 @@ public void testStrikeDependency() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testConsistency() { CommonVars vars = new CommonVars(); @@ -331,11 +302,7 @@ public void testConsistency() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testParity() { CommonVars vars = new CommonVars(); @@ -383,11 +350,7 @@ public void testParity() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testATMRate() { CommonVars vars = new CommonVars(); @@ -449,11 +412,7 @@ public void testATMRate() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testImpliedVolatility() { CommonVars vars = new CommonVars(); @@ -548,11 +507,7 @@ public void testImpliedVolatility() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCachedValue() { CommonVars vars = new CommonVars(); diff --git a/tests/QLNet.Tests/T_CapFlooredCoupon.cs b/tests/QLNet.Tests/T_CapFlooredCoupon.cs index 5b62413d0..07d4ab9b0 100644 --- a/tests/QLNet.Tests/T_CapFlooredCoupon.cs +++ b/tests/QLNet.Tests/T_CapFlooredCoupon.cs @@ -15,18 +15,12 @@ // FOR A PARTICULAR PURPOSE. See the license for more details. using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_CapFlooredCoupon { private class CommonVars @@ -156,11 +150,7 @@ public CapFloor makeCapFloor(CapFloorType type, List leg, double capSt } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testLargeRates() { // Testing degenerate collared coupon @@ -202,11 +192,7 @@ equal to 100 and floor equal to 0 must have (about) the same NPV } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testDecomposition() { // Testing collared coupon against its decomposition diff --git a/tests/QLNet.Tests/T_CashFlows.cs b/tests/QLNet.Tests/T_CashFlows.cs index ceab09571..813f82b33 100644 --- a/tests/QLNet.Tests/T_CashFlows.cs +++ b/tests/QLNet.Tests/T_CashFlows.cs @@ -17,20 +17,14 @@ under the terms of the QLNet license. You should have received a FOR A PARTICULAR PURPOSE. See the license for more details. */ -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; using System; using System.Collections.Generic; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_CashFlows { private void CHECK_INCLUSION(int n, int days, bool expected, List leg, Date today) @@ -58,11 +52,7 @@ private void CHECK_NPV(bool includeRef, double expected, InterestRate no_discoun while (false); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSettings() { // Testing cash-flow settings... @@ -178,11 +168,7 @@ public void testSettings() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testAccessViolation() { // Testing dynamic cast of coupon in Black pricer... @@ -228,11 +214,7 @@ public void testAccessViolation() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testDefaultSettlementDate() { // Testing default evaluation date in cashflows methods... @@ -264,11 +246,7 @@ public void testDefaultSettlementDate() QAssert.Fail("null accrued amount with default settlement date"); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testNullFixingDays() { // Testing ibor leg construction with null fixing days... diff --git a/tests/QLNet.Tests/T_CatBonds.cs b/tests/QLNet.Tests/T_CatBonds.cs index 7bdd5620c..bccdef248 100644 --- a/tests/QLNet.Tests/T_CatBonds.cs +++ b/tests/QLNet.Tests/T_CatBonds.cs @@ -15,19 +15,13 @@ // FOR A PARTICULAR PURPOSE. See the license for more details. using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; using Calendar = QLNet.Calendar; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_CatBonds { static KeyValuePair[] data = @@ -59,11 +53,7 @@ public CommonVars() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testEventSetForWholeYears() { // Testing that catastrophe events are split correctly for periods of whole years @@ -96,12 +86,7 @@ public void testEventSetForWholeYears() QAssert.Require(!simulation.nextPath(path)); } - -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testEventSetForIrregularPeriods() { // Testing that catastrophe events are split correctly for irregular periods @@ -126,11 +111,7 @@ public void testEventSetForIrregularPeriods() QAssert.Require(!simulation.nextPath(path)); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testEventSetForNoEvents() { // Testing that catastrophe events are split correctly when there are no simulated events @@ -152,11 +133,7 @@ public void testEventSetForNoEvents() QAssert.Require(!simulation.nextPath(path)); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testRiskFreeAgainstFloatingRateBond() { // Testing floating-rate cat bond against risk-free floating-rate bond @@ -330,11 +307,7 @@ public void testRiskFreeAgainstFloatingRateBond() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCatBondInDoomScenario() { // Testing floating-rate cat bond in a doom scenario (certain default) @@ -396,11 +369,7 @@ public void testCatBondInDoomScenario() QAssert.AreEqual(1.0, expectedLoss, tolerance); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCatBondWithDoomOnceInTenYears() { // Testing floating-rate cat bond in a doom once in 10 years scenario @@ -478,11 +447,7 @@ public void testCatBondWithDoomOnceInTenYears() QAssert.IsTrue(riskFreeYield < yield); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCatBondWithDoomOnceInTenYearsProportional() { // Testing floating-rate cat bond in a doom once in 10 years scenario with proportional notional reduction diff --git a/tests/QLNet.Tests/T_CliquetOption.cs b/tests/QLNet.Tests/T_CliquetOption.cs index fc21f49a6..54289d18c 100644 --- a/tests/QLNet.Tests/T_CliquetOption.cs +++ b/tests/QLNet.Tests/T_CliquetOption.cs @@ -13,20 +13,15 @@ // This program is distributed in the hope that it will be useful, but WITHOUT // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS // FOR A PARTICULAR PURPOSE. See the license for more details. -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else + using Xunit; -#endif using QLNet; using System; using System.Collections.Generic; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_CliquetOption { private void REPORT_FAILURE(string greekName, @@ -56,11 +51,7 @@ private void REPORT_FAILURE(string greekName, + " tolerance: " + tolerance); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testValues() { // Testing Cliquet option values @@ -108,22 +99,14 @@ public void testValues() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testGreeks() { // Testing Cliquet option greek testOptionGreeks(process => new AnalyticCliquetEngine(process)); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testPerformanceGreeks() { // Testing Performance option greek diff --git a/tests/QLNet.Tests/T_Cms.cs b/tests/QLNet.Tests/T_Cms.cs index 6f23c37d0..12856d198 100644 --- a/tests/QLNet.Tests/T_Cms.cs +++ b/tests/QLNet.Tests/T_Cms.cs @@ -15,18 +15,12 @@ // FOR A PARTICULAR PURPOSE. See the license for more details. using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_Cms { private class CommonVars @@ -241,11 +235,7 @@ public CommonVars() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFairRate() { // Testing Hagan-pricer flat-vol equivalence for coupons @@ -311,11 +301,7 @@ public void testFairRate() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCmsSwap() { // Testing Hagan-pricer flat-vol equivalence for swaps @@ -377,11 +363,7 @@ public void testCmsSwap() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testParity() { // Testing put-call parity for capped-floored CMS coupons diff --git a/tests/QLNet.Tests/T_ConvertibleBond.cs b/tests/QLNet.Tests/T_ConvertibleBond.cs index f682fc29a..ff3be41ad 100644 --- a/tests/QLNet.Tests/T_ConvertibleBond.cs +++ b/tests/QLNet.Tests/T_ConvertibleBond.cs @@ -15,18 +15,12 @@ // FOR A PARTICULAR PURPOSE. See the license for more details. using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_ConvertibleBond { private class CommonVars @@ -86,11 +80,7 @@ public CommonVars() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testBond() { @@ -277,11 +267,7 @@ should equal that of the underlying plain-vanilla bond. */ } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testOption() { @@ -338,11 +324,7 @@ equivalent to a call option. */ } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testRegression() { diff --git a/tests/QLNet.Tests/T_CreditDefaultSwap.cs b/tests/QLNet.Tests/T_CreditDefaultSwap.cs index c8455a5ef..38bb63d91 100644 --- a/tests/QLNet.Tests/T_CreditDefaultSwap.cs +++ b/tests/QLNet.Tests/T_CreditDefaultSwap.cs @@ -17,27 +17,17 @@ under the terms of the QLNet license. You should have received a FOR A PARTICULAR PURPOSE. See the license for more details. */ -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; using System; using System.Collections.Generic; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_CreditDefaultSwap { -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCachedValue() { // Testing credit-default swap against cached values... @@ -139,11 +129,7 @@ public void testCachedValue() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCachedMarketValue() { // Testing credit-default swap against cached market values... @@ -278,11 +264,7 @@ public void testCachedMarketValue() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testImpliedHazardRate() { // Testing implied hazard-rate for credit-default swaps... @@ -382,11 +364,7 @@ public void testImpliedHazardRate() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFairSpread() { // Testing fair-spread calculation for credit-default swaps... @@ -450,11 +428,7 @@ public void testFairSpread() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFairUpfront() { // Testing fair-upfront calculation for credit-default swaps... @@ -538,11 +512,7 @@ public void testFairUpfront() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testIsdaEngine() { // Testing ISDA engine calculations for credit-default swaps diff --git a/tests/QLNet.Tests/T_Dates.cs b/tests/QLNet.Tests/T_Dates.cs index bf538d059..6f8f8213d 100644 --- a/tests/QLNet.Tests/T_Dates.cs +++ b/tests/QLNet.Tests/T_Dates.cs @@ -20,25 +20,15 @@ under the terms of the QLNet license. You should have received a using System; using System.Collections.Generic; using System.Linq; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_Dates { -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testECBDates() { // Testing ECB dates @@ -90,11 +80,7 @@ public void testECBDates() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testIMMDates() { // ("Testing IMM dates..."); @@ -166,11 +152,7 @@ public void testIMMDates() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testConsistency() { //("Testing dates..."); @@ -274,11 +256,7 @@ public void testConsistency() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testASXDates() { //Testing ASX dates..."); @@ -345,11 +323,7 @@ public void testASXDates() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testIntraday() { // Testing intraday information of dates diff --git a/tests/QLNet.Tests/T_DayCounters.cs b/tests/QLNet.Tests/T_DayCounters.cs index 73c9c365d..2fd36c259 100644 --- a/tests/QLNet.Tests/T_DayCounters.cs +++ b/tests/QLNet.Tests/T_DayCounters.cs @@ -19,18 +19,14 @@ under the terms of the QLNet license. You should have received a using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else +using System.Globalization; using Xunit; -#endif using QLNet; +using Calendar = QLNet.Calendar; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_DayCounters { public struct SingleCase @@ -97,11 +93,7 @@ private double ISMAYearFractionWithReferenceDates(DayCounter dayCounter, Date st / (referenceDayCount * couponsPerYear); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testActualActual() { SingleCase[] testCases = @@ -204,11 +196,7 @@ public void testActualActual() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testActualActualWithSemiannualSchedule() { @@ -319,11 +307,7 @@ public void testActualActualWithSemiannualSchedule() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testActualActualWithAnnualSchedule() { // Testing actual/actual with schedule "for undefined annual reference periods @@ -364,11 +348,7 @@ public void testActualActualWithAnnualSchedule() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testActualActualWithSchedule() { @@ -507,11 +487,7 @@ public void testActualActualWithSchedule() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSimple() { Period[] p = { new Period(3, TimeUnit.Months), new Period(6, TimeUnit.Months), new Period(1, TimeUnit.Years) }; @@ -539,11 +515,7 @@ public void testSimple() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testOne() { Period[] p = { new Period(3, TimeUnit.Months), new Period(6, TimeUnit.Months), new Period(1, TimeUnit.Years) }; @@ -571,11 +543,7 @@ public void testOne() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testBusiness252() { // Testing business/252 day counter @@ -647,11 +615,7 @@ public void testBusiness252() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testThirty360_BondBasis() { // Testing thirty/360 day counter (Bond Basis) @@ -717,11 +681,7 @@ public void testThirty360_BondBasis() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testThirty360_EurobondBasis() { // Testing thirty/360 day counter (Eurobond Basis) @@ -794,11 +754,7 @@ public void testThirty360_EurobondBasis() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testIntraday() { // Testing intraday behavior of day counter @@ -825,5 +781,54 @@ public void testIntraday() "can not reproduce result for day counter " + dc.name()); } } + + /// + /// https://www.isda.org/book/actualactual-day-count-fraction/ + /// + /// + /// + /// + /// + /// + /// + /// + /// + /// + [Theory] + [InlineData(false, Frequency.Semiannual, "2003-05-01", "2005-05-01", "2003-11-01", "2004-11-01", "2003-11-01", "2004-05-01", 182.0 / (182.0 * 2))] // example a: regular calculation period + [InlineData(false, Frequency.Annual, "1999-02-01", "2002-07-01", "1999-07-01", "2001-07-01", "1999-02-01", "1999-07-01", 150.0 / (365.0 * 1))] // example b: short first calculation period - first period + [InlineData(false, Frequency.Annual, "1999-02-01", "2002-07-01", "1999-07-01", "2001-07-01", "1999-07-01", "2000-07-01", 366.0 / (366.0 * 1))] // example b: short first calculation period - second period + [InlineData(false, Frequency.Semiannual, "2002-08-15", "2005-07-15", "2003-07-15", "2004-07-15", "2002-08-15", "2003-07-15", (181.0 / (181.0 * 2)) + (153.0 / (184.0 * 2)))] // example c: long first calculation period - first period + [InlineData(false, Frequency.Semiannual, "2002-08-15", "2005-07-15", "2003-07-15", "2004-07-15", "2003-07-15", "2004-01-15", 184.0 / (184.0 * 2))] // example c: long first calculation period - second period + [InlineData(false, Frequency.Semiannual, "1999-01-30", "2000-06-30", "1999-07-30", "2000-01-30", "1999-07-30", "2000-01-30", 184.0 / (184.0 * 2))] // example d: short final calculation period - penultimate period + [InlineData(false, Frequency.Semiannual, "1999-01-30", "2000-06-30", "1999-07-30", "2000-01-30", "2000-01-30", "2000-06-30", 152.0 / (182.0 * 2))] // example d: short final calculation period - final period + [InlineData(true, Frequency.Quarterly, "1999-05-31", "2000-04-30", "1999-08-31", "1999-11-30", "1999-11-30", "2000-04-30", (91.0 / (91.0 * 4)) + (61.0 / (92.0 * 4)))] // example e: long final calculation period + [InlineData(false, Frequency.Quarterly, "1999-05-31", "2000-04-30", "1999-08-31", "1999-11-30", "1999-11-30", "2000-04-30", (91.0 / (91.0 * 4)) + (61.0 / (90.0 * 4)))] // example e: long final calculation period - not end of month + public void testActualActualIsma(bool isEndOfMonth, Frequency frequency, string interestAccrualDateAsString, string maturityDateAsString, string firstCouponDateAsString, string penultimateCouponDateAsString, string d1AsString, string d2AsString, double expectedYearFraction) + { + // Example from ISDA Paper: The actual/actual day count fraction, paper for use with the ISDA Market Conventions Survey, 3rd June, 1999 + var interestAccrualDate = new Date(DateTime.ParseExact(interestAccrualDateAsString, "yyyy-MM-dd", CultureInfo.InvariantCulture)); + var maturityDate = new Date(DateTime.ParseExact(maturityDateAsString, "yyyy-MM-dd", CultureInfo.InvariantCulture)); + var firstCouponDate = new Date(DateTime.ParseExact(firstCouponDateAsString, "yyyy-MM-dd", CultureInfo.InvariantCulture)); + var penultimateCouponDate = new Date(DateTime.ParseExact(penultimateCouponDateAsString, "yyyy-MM-dd", CultureInfo.InvariantCulture)); + + var d1 = new Date(DateTime.ParseExact(d1AsString, "yyyy-MM-dd", CultureInfo.InvariantCulture)); + var d2 = new Date(DateTime.ParseExact(d2AsString, "yyyy-MM-dd", CultureInfo.InvariantCulture)); + + var schedule = new MakeSchedule() + .from(interestAccrualDate) + .to(maturityDate) + .withFrequency(frequency) + .withFirstDate(firstCouponDate) + .withNextToLastDate(penultimateCouponDate) + .endOfMonth(isEndOfMonth) + .value(); + + var dayCounter = new ActualActual(ActualActual.Convention.ISMA, schedule); + + var t = dayCounter.yearFraction(d1, d2); + + Assert.Equal(expectedYearFraction, t); + } } } diff --git a/tests/QLNet.Tests/T_DefaultProbabilityCurves.cs b/tests/QLNet.Tests/T_DefaultProbabilityCurves.cs index bfffe9996..bc5ab3787 100644 --- a/tests/QLNet.Tests/T_DefaultProbabilityCurves.cs +++ b/tests/QLNet.Tests/T_DefaultProbabilityCurves.cs @@ -17,25 +17,15 @@ under the terms of the QLNet license. You should have received a FOR A PARTICULAR PURPOSE. See the license for more details. */ using System; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_DefaultProbabilityCurves { -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testDefaultProbability() { // Testing default-probability structure... @@ -94,11 +84,7 @@ public void testDefaultProbability() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFlatHazardRate() { @@ -131,11 +117,7 @@ public void testFlatHazardRate() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFlatHazardConsistency() { // Testing piecewise-flat hazard-rate consistency... diff --git a/tests/QLNet.Tests/T_DigitalCoupon.cs b/tests/QLNet.Tests/T_DigitalCoupon.cs index 6503b6336..ef74af6a7 100644 --- a/tests/QLNet.Tests/T_DigitalCoupon.cs +++ b/tests/QLNet.Tests/T_DigitalCoupon.cs @@ -15,18 +15,12 @@ // FOR A PARTICULAR PURPOSE. See the license for more details. using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_DigitalCoupon { private class CommonVars @@ -62,11 +56,7 @@ public CommonVars() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testAssetOrNothing() { @@ -242,11 +232,7 @@ with black formula result */ } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testAssetOrNothingDeepInTheMoney() { // Testing European deep in-the-money asset-or-nothing digital coupon @@ -349,11 +335,7 @@ public void testAssetOrNothingDeepInTheMoney() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testAssetOrNothingDeepOutTheMoney() { // Testing European deep out-the-money asset-or-nothing digital coupon @@ -455,11 +437,7 @@ public void testAssetOrNothingDeepOutTheMoney() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCashOrNothing() { // Testing European cash-or-nothing digital coupon @@ -601,11 +579,7 @@ with black formula result */ } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCashOrNothingDeepInTheMoney() { // Testing European deep in-the-money cash-or-nothing digital coupon @@ -706,11 +680,7 @@ public void testCashOrNothingDeepInTheMoney() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCashOrNothingDeepOutTheMoney() { // Testing European deep out-the-money cash-or-nothing digital coupon @@ -813,11 +783,7 @@ public void testCashOrNothingDeepOutTheMoney() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCallPutParity() { // Testing call/put parity for European digital coupon @@ -909,11 +875,7 @@ public void testCallPutParity() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testReplicationType() { // Testing replication type for European digital coupon diff --git a/tests/QLNet.Tests/T_DigitalOption.cs b/tests/QLNet.Tests/T_DigitalOption.cs index 4cf04bed4..758882447 100644 --- a/tests/QLNet.Tests/T_DigitalOption.cs +++ b/tests/QLNet.Tests/T_DigitalOption.cs @@ -16,18 +16,12 @@ using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_DigitalOption { struct DigitalOptionData @@ -80,11 +74,7 @@ void REPORT_FAILURE(string greekName, StrikedTypePayoff payoff, Exercise exercis } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCashOrNothingEuropeanValues() { // Testing European cash-or-nothing digital option @@ -141,11 +131,7 @@ public void testCashOrNothingEuropeanValues() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testAssetOrNothingEuropeanValues() { @@ -202,11 +188,7 @@ public void testAssetOrNothingEuropeanValues() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testGapEuropeanValues() { // Testing European gap digital option @@ -262,11 +244,7 @@ public void testGapEuropeanValues() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCashAtHitOrNothingAmericanValues() { // Testing American cash-(at-hit)-or-nothing digital option @@ -333,11 +311,7 @@ public void testCashAtHitOrNothingAmericanValues() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testAssetAtHitOrNothingAmericanValues() { // Testing American asset-(at-hit)-or-nothing "digital option @@ -402,11 +376,7 @@ public void testAssetAtHitOrNothingAmericanValues() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCashAtExpiryOrNothingAmericanValues() { // Testing American cash-(at-expiry)-or-nothing digital option @@ -474,11 +444,7 @@ public void testCashAtExpiryOrNothingAmericanValues() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testAssetAtExpiryOrNothingAmericanValues() { @@ -552,11 +518,7 @@ public void testAssetAtExpiryOrNothingAmericanValues() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCashAtHitOrNothingAmericanGreeks() { diff --git a/tests/QLNet.Tests/T_DividendOption.cs b/tests/QLNet.Tests/T_DividendOption.cs index 96cfa0e5c..d49f0a2a2 100644 --- a/tests/QLNet.Tests/T_DividendOption.cs +++ b/tests/QLNet.Tests/T_DividendOption.cs @@ -17,23 +17,17 @@ under the terms of the QLNet license. You should have received a FOR A PARTICULAR PURPOSE. See the license for more details. */ -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; using System; using System.Collections.Generic; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_DividendOption { - public void REPORT_FAILURE(string greekName, StrikedTypePayoff payoff, Exercise exercise, double s, double q, + internal void REPORT_FAILURE(string greekName, StrikedTypePayoff payoff, Exercise exercise, double s, double q, double r, Date today, double v, double expected, double calculated, double error, double tolerance) { @@ -219,11 +213,7 @@ public void REPORT_FAILURE(string greekName, StrikedTypePayoff payoff, Exercise } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testEuropeanValues() { // Testing dividend European option values with no dividends... @@ -388,11 +378,7 @@ private void testEuropeanKnownValue() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testEuropeanStartLimit() { // Testing dividend European option with a dividend on today's date... @@ -488,11 +474,7 @@ public void testEuropeanStartLimit() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testEuropeanGreeks() { // Testing dividend European option greeks... @@ -648,11 +630,7 @@ public void testEuropeanGreeks() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFdEuropeanValues() { // Testing finite-difference dividend European option values... @@ -758,11 +736,7 @@ public void testFdEuropeanValues() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFdEuropeanGreeks() { // Testing finite-differences dividend European option greeks... @@ -781,11 +755,7 @@ public void testFdEuropeanGreeks() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFdAmericanGreeks() { // Testing finite-differences dividend American option greeks... @@ -804,11 +774,7 @@ public void testFdAmericanGreeks() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFdEuropeanDegenerate() { // Testing degenerate finite-differences dividend European option... @@ -824,11 +790,7 @@ public void testFdEuropeanDegenerate() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFdAmericanDegenerate() { // Testing degenerate finite-differences dividend American option... diff --git a/tests/QLNet.Tests/T_DoubleBarrierOption.cs b/tests/QLNet.Tests/T_DoubleBarrierOption.cs index 91e879304..1313b3cc1 100644 --- a/tests/QLNet.Tests/T_DoubleBarrierOption.cs +++ b/tests/QLNet.Tests/T_DoubleBarrierOption.cs @@ -13,23 +13,17 @@ // This program is distributed in the hope that it will be useful, but WITHOUT // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS // FOR A PARTICULAR PURPOSE. See the license for more details. -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; using System; using System.Collections.Generic; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_DoubleBarrierOption { - public void REPORT_FAILURE(string greekName, DoubleBarrier.Type barrierType, double barrierlo, double barrierhi, + internal void REPORT_FAILURE(string greekName, DoubleBarrier.Type barrierType, double barrierlo, double barrierhi, StrikedTypePayoff payoff, Exercise exercise, double s, double q, double r, Date today, double v, double expected, double calculated, double error, double tolerance) @@ -51,7 +45,8 @@ public void REPORT_FAILURE(string greekName, DoubleBarrier.Type barrierType, dou + " error: " + error + "\n" + " tolerance: " + tolerance); } - public void REPORT_FAILURE_VANNAVOLGA(string greekName, DoubleBarrier.Type barrierType, + + internal void REPORT_FAILURE_VANNAVOLGA(string greekName, DoubleBarrier.Type barrierType, double barrier1, double barrier2, double rebate, StrikedTypePayoff payoff, Exercise exercise, double s, double q, double r, Date today, double vol25Put, double atmVol, double vol25Call, double v, @@ -153,11 +148,7 @@ public DoubleBarrierFxOptionData(DoubleBarrier.Type barrierType, double barrier1 } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testEuropeanHaugValues() { // Testing double barrier european options against Haug's values @@ -347,11 +338,7 @@ The book uses b instead of q (q=r-b) } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testVannaVolgaDoubleBarrierValues() { // Testing double-barrier FX options against Vanna/Volga values diff --git a/tests/QLNet.Tests/T_DoubleBinaryOption.cs b/tests/QLNet.Tests/T_DoubleBinaryOption.cs index a2f9fc301..dabc29918 100644 --- a/tests/QLNet.Tests/T_DoubleBinaryOption.cs +++ b/tests/QLNet.Tests/T_DoubleBinaryOption.cs @@ -16,18 +16,12 @@ // FOR A PARTICULAR PURPOSE. See the license for more details. using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_DoubleBinaryOption { private void REPORT_FAILURE(string greekName, @@ -97,11 +91,7 @@ public DoubleBinaryOptionData(DoubleBarrier.Type barrierType, double barrier_lo, } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testHaugValues() { // Testing cash-or-nothing double barrier options against Haug's values diff --git a/tests/QLNet.Tests/T_EuropeanOption.cs b/tests/QLNet.Tests/T_EuropeanOption.cs index 3b76c1fc5..c686ae5f8 100644 --- a/tests/QLNet.Tests/T_EuropeanOption.cs +++ b/tests/QLNet.Tests/T_EuropeanOption.cs @@ -18,39 +18,22 @@ under the terms of the QLNet license. You should have received a */ using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_EuropeanOption : IDisposable { #region Initialize&Cleanup private SavedSettings backup; -#if NET452 - [TestInitialize] - public void testInitialize() - { -#else + public T_EuropeanOption() { -#endif backup = new SavedSettings(); } -#if NET452 - [TestCleanup] -#endif - public void testCleanup() - { - Dispose(); - } + public void Dispose() { backup.Dispose(); @@ -67,11 +50,7 @@ enum EngineType } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testJRBinomialEngines() { // Testing JR binomial European engines against analytic results @@ -85,11 +64,7 @@ public void testJRBinomialEngines() relativeTol.Add("theta", 0.03); testEngineConsistency(engine, steps, samples, relativeTol, true); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCRRBinomialEngines() { // Testing CRR binomial European engines against analytic results @@ -103,11 +78,7 @@ public void testCRRBinomialEngines() relativeTol.Add("theta", 0.03); testEngineConsistency(engine, steps, samples, relativeTol, true); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testEQPBinomialEngines() { // Testing EQP binomial European engines against analytic results @@ -121,11 +92,7 @@ public void testEQPBinomialEngines() relativeTol.Add("theta", 0.03); testEngineConsistency(engine, steps, samples, relativeTol, true); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testTGEOBinomialEngines() { // Testing TGEO binomial European engines " against analytic results @@ -139,11 +106,7 @@ public void testTGEOBinomialEngines() relativeTol.Add("theta", 0.03); testEngineConsistency(engine, steps, samples, relativeTol, true); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testTIANBinomialEngines() { // Testing TIAN binomial European engines against analytic results @@ -157,11 +120,7 @@ public void testTIANBinomialEngines() relativeTol.Add("theta", 0.03); testEngineConsistency(engine, steps, samples, relativeTol, true); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testLRBinomialEngines() { // Testing LR binomial European engines against analytic results @@ -175,11 +134,7 @@ public void testLRBinomialEngines() relativeTol.Add("theta", 0.03); testEngineConsistency(engine, steps, samples, relativeTol, true); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testJOSHIBinomialEngines() { // Testing Joshi binomial European engines against analytic results @@ -195,11 +150,7 @@ public void testJOSHIBinomialEngines() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFdEngines() { diff --git a/tests/QLNet.Tests/T_ExchangeRate.cs b/tests/QLNet.Tests/T_ExchangeRate.cs index c7d460283..275ae3b7b 100644 --- a/tests/QLNet.Tests/T_ExchangeRate.cs +++ b/tests/QLNet.Tests/T_ExchangeRate.cs @@ -16,25 +16,15 @@ under the terms of the QLNet license. You should have received a ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. */ -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_ExchangeRate { -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testDirect() { @@ -67,11 +57,7 @@ public void testDirect() /// /// Testing derived exchange rates /// -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testDerived() { @@ -107,11 +93,7 @@ public void testDerived() /// /// Testing lookup of direct exchange rates /// -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testDirectLookup() { ExchangeRateManager rateManager = ExchangeRateManager.Instance; @@ -171,11 +153,7 @@ public void testDirectLookup() /// /// Testing lookup of triangulated exchange rates /// -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testTriangulatedLookup() { @@ -236,11 +214,7 @@ public void testTriangulatedLookup() /// /// Testing lookup of derived exchange rates /// -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSmartLookup() { diff --git a/tests/QLNet.Tests/T_FastFourierTransform.cs b/tests/QLNet.Tests/T_FastFourierTransform.cs index 13bacb92b..86cf40501 100644 --- a/tests/QLNet.Tests/T_FastFourierTransform.cs +++ b/tests/QLNet.Tests/T_FastFourierTransform.cs @@ -16,11 +16,7 @@ under the terms of the QLNet license. You should have received a ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. */ -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; using System.Numerics; @@ -29,18 +25,11 @@ under the terms of the QLNet license. You should have received a namespace TestSuite { - -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_FastFourierTransform { -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFFTSimple() { List a = new List(); @@ -77,11 +66,7 @@ public void testFFTSimple() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFFTInverse() { List x = new InitializedList(3); diff --git a/tests/QLNet.Tests/T_FdmLinearOp.cs b/tests/QLNet.Tests/T_FdmLinearOp.cs index b1feed468..028763afb 100644 --- a/tests/QLNet.Tests/T_FdmLinearOp.cs +++ b/tests/QLNet.Tests/T_FdmLinearOp.cs @@ -20,26 +20,16 @@ under the terms of the QLNet license. You should have received a using System.Collections.Generic; using System.Linq; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_FdmLinearOp { -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFdmLinearOpLayout() { @@ -124,11 +114,7 @@ public void testFdmLinearOpLayout() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testUniformGridMesher() { int[] dims = new int[] {5, 7, 8}; @@ -158,11 +144,7 @@ public void testUniformGridMesher() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFirstDerivativesMapApply() { int[] dims = new int[] {400, 100, 50}; @@ -225,11 +207,7 @@ public void testFirstDerivativesMapApply() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSecondDerivativesMapApply() { int[] dims = new int[] {50, 50, 50}; @@ -322,11 +300,7 @@ public void testSecondDerivativesMapApply() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testDerivativeWeightsOnNonUniformGrids() { Fdm1dMesher mesherX = @@ -509,11 +483,7 @@ SparseMatrix d2fdx2 } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSecondOrderMixedDerivativesMapApply() { int[] dims = new int[] {50, 50, 50}; @@ -620,11 +590,7 @@ public void testSecondOrderMixedDerivativesMapApply() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testTripleBandMapSolve() { int[] dims = new int[] {100, 400}; @@ -712,11 +678,7 @@ public void testTripleBandMapSolve() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCrankNicolsonWithDamping() { SavedSettings backup = new SavedSettings(); @@ -810,11 +772,7 @@ public void testCrankNicolsonWithDamping() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSpareMatrixReference() { int rows = 10; @@ -860,11 +818,7 @@ public void testSpareMatrixReference() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFdmMesherIntegral() { FdmMesherComposite mesher = diff --git a/tests/QLNet.Tests/T_ForwardOption.cs b/tests/QLNet.Tests/T_ForwardOption.cs index e96c5d6c1..f1149fb5b 100644 --- a/tests/QLNet.Tests/T_ForwardOption.cs +++ b/tests/QLNet.Tests/T_ForwardOption.cs @@ -15,18 +15,12 @@ // FOR A PARTICULAR PURPOSE. See the license for more details. using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_ForwardOption { void REPORT_FAILURE(string greekName, @@ -92,11 +86,7 @@ public ForwardOptionData(Option.Type type_, double moneyness_, double s_, double public double tol; // tolerance } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testValues() { // Testing forward option values... @@ -160,11 +150,7 @@ public void testValues() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testPerformanceValues() { // Testing forward performance option values... @@ -385,11 +371,7 @@ private void testForwardGreeks(Type engine_type) } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testGreeks() { // Testing forward option greeks @@ -398,11 +380,7 @@ public void testGreeks() testForwardGreeks(typeof(ForwardVanillaEngine)); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testPerformanceGreeks() { // Testing forward performance option greeks @@ -419,11 +397,7 @@ public TestBinomialEngine(GeneralizedBlackScholesProcess process): } // verify than if engine -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testGreeksInitialization() { // Testing forward option greeks initialization diff --git a/tests/QLNet.Tests/T_Functions.cs b/tests/QLNet.Tests/T_Functions.cs index 249152d76..a84d22726 100644 --- a/tests/QLNet.Tests/T_Functions.cs +++ b/tests/QLNet.Tests/T_Functions.cs @@ -17,26 +17,16 @@ under the terms of the QLNet license. You should have received a FOR A PARTICULAR PURPOSE. See the license for more details. */ using System; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; using System.Numerics; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_Functions { -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFactorial() { // Testing factorial numbers @@ -59,11 +49,7 @@ public void testFactorial() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testGammaFunction() { // Testing Gamma function @@ -88,11 +74,7 @@ public void testGammaFunction() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testGammaValues() { // Testing Gamma values @@ -131,11 +113,7 @@ public void testGammaValues() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testModifiedBesselFunctions() { // Testing modified Bessel function of first and second kind @@ -245,11 +223,7 @@ public void testModifiedBesselFunctions() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testWeightedModifiedBesselFunctions() { // Testing weighted modified Bessel functions diff --git a/tests/QLNet.Tests/T_HestonModel.cs b/tests/QLNet.Tests/T_HestonModel.cs index d02c6faf2..bffab1989 100644 --- a/tests/QLNet.Tests/T_HestonModel.cs +++ b/tests/QLNet.Tests/T_HestonModel.cs @@ -15,18 +15,12 @@ // FOR A PARTICULAR PURPOSE. See the license for more details. using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_HestonModel { struct CalibrationMarketData @@ -118,11 +112,7 @@ Pricing European-Style Options under Jump Diffusion Processes return marketData; } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testBlackCalibration() { // Testing Heston model calibration using a flat volatility surface @@ -218,11 +208,7 @@ In addition theta and v0 should be equal to the constant variance */ } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testDAXCalibration() { // Testing Heston model calibration using DAX volatility data @@ -275,8 +261,8 @@ public void testDAXCalibration() } //[TestMethod()] - public void testAnalyticVsBlack() - { + //public void testAnalyticVsBlack() + //{ // Testing analytic Heston engine against Black formula //using (SavedSettings backup = new SavedSettings()) @@ -339,13 +325,9 @@ public void testAnalyticVsBlack() // +"\n error: " + error); //} //} - } + //} -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testAnalyticVsCached() { // Testing analytic Heston engine against cached values @@ -438,11 +420,7 @@ public void testAnalyticVsCached() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testMcVsCached() { // Testing Monte Carlo Heston engine against cached values @@ -497,8 +475,8 @@ public void testMcVsCached() } //[TestMethod()] - public void testFdBarrierVsCached() - { + //public void testFdBarrierVsCached() + //{ // // Testing FD barrier Heston engine against cached values // using (SavedSettings backup = new SavedSettings()) @@ -548,11 +526,11 @@ public void testFdBarrierVsCached() // + "\n error: " + error); // } //} - } + //} //[TestMethod()] - public void testFdVanillaVsCached() - { + //public void testFdVanillaVsCached() + //{ // // Testing FD vanilla Heston engine against cached values // using (SavedSettings backup = new SavedSettings()) @@ -661,11 +639,11 @@ public void testFdVanillaVsCached() // + "\n error: " + error); // } //} - } + //} // [TestMethod()] - public void testKahlJaeckelCase() - { + //public void testKahlJaeckelCase() + //{ //// Testing MC and FD Heston engines for the Kahl-Jaeckel example ///* Example taken from Wilmott mag (Sept. 2005). @@ -771,7 +749,7 @@ public void testKahlJaeckelCase() // + "\n error: " + error); //} //} - } + //} struct HestonParameter { @@ -786,11 +764,7 @@ public HestonParameter(double _v0, double _kappa, double _theta, double _sigma, } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testDifferentIntegrals() { // Testing different numerical Heston integration algorithms @@ -894,8 +868,8 @@ public void testDifferentIntegrals() } // [TestMethod()] - public void testMultipleStrikesEngine() - { + //public void testMultipleStrikesEngine() + //{ //// Testing multiple-strikes FD Heston engine..."); //using (SavedSettings backup = new SavedSettings()) @@ -977,13 +951,9 @@ public void testMultipleStrikesEngine() // } // } //} - } + //} -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testAnalyticPiecewiseTimeDependent() { // Testing analytic piecewise time dependent Heston prices @@ -1045,11 +1015,7 @@ public void testAnalyticPiecewiseTimeDependent() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testDAXCalibrationOfTimeDependentModel() { // Testing time-dependent Heston model calibration @@ -1112,11 +1078,7 @@ public void testDAXCalibrationOfTimeDependentModel() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testAlanLewisReferencePrices() { // Testing Alan Lewis reference prices @@ -1219,11 +1181,7 @@ public void testAlanLewisReferencePrices() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testExpansionOnAlanLewisReference() { // Testing expansion on Alan Lewis reference prices @@ -1320,11 +1278,7 @@ public void testExpansionOnAlanLewisReference() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testExpansionOnFordeReference() { // Testing expansion on Forde reference prices diff --git a/tests/QLNet.Tests/T_HybridHestonHullWhiteProcess.cs b/tests/QLNet.Tests/T_HybridHestonHullWhiteProcess.cs index 3868ed4ed..adcba6f3e 100644 --- a/tests/QLNet.Tests/T_HybridHestonHullWhiteProcess.cs +++ b/tests/QLNet.Tests/T_HybridHestonHullWhiteProcess.cs @@ -16,51 +16,29 @@ using System; using System.Collections.Generic; using System.Linq; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_HybridHestonHullWhiteProcess : IDisposable { #region Initialize&Cleanup private SavedSettings backup; -#if NET452 - [TestInitialize] - public void testInitialize() - { -#else + public T_HybridHestonHullWhiteProcess() { -#endif - backup = new SavedSettings(); } -#if NET452 - [TestCleanup] -#endif - public void testCleanup() - { - Dispose(); - } + public void Dispose() { backup.Dispose(); } #endregion -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testBsmHullWhiteEngine() { // Testing European option pricing for a BSM process with one-factor Hull-White model @@ -152,11 +130,7 @@ public void testBsmHullWhiteEngine() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCompareBsmHWandHestonHW() { // Comparing European option pricing for a BSM process with one-factor Hull-White model @@ -242,11 +216,7 @@ public void testCompareBsmHWandHestonHW() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testZeroBondPricing() { // Testing Monte-Carlo zero bond pricing @@ -365,11 +335,7 @@ double zeroBond } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testMcVanillaPricing() { // Testing Monte-Carlo vanilla option pricing @@ -457,11 +423,7 @@ public void testMcVanillaPricing() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testMcPureHestonPricing() { // Testing Monte-Carlo Heston option pricing @@ -541,11 +503,7 @@ public void testMcPureHestonPricing() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testAnalyticHestonHullWhitePricing() { // Testing analytic Heston Hull-White option pricing @@ -624,11 +582,7 @@ public void testAnalyticHestonHullWhitePricing() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCallableEquityPricing() { // Testing the pricing of a callable equity product @@ -741,11 +695,7 @@ Stochastic Interest Rates . } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testDiscretizationError() { // Testing the discretization error of the Heston Hull-White process @@ -830,11 +780,7 @@ public void testDiscretizationError() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testH1HWPricingEngine() { /* diff --git a/tests/QLNet.Tests/T_Inflation.cs b/tests/QLNet.Tests/T_Inflation.cs index b796ed87b..f41297d9f 100644 --- a/tests/QLNet.Tests/T_Inflation.cs +++ b/tests/QLNet.Tests/T_Inflation.cs @@ -17,11 +17,7 @@ under the terms of the QLNet license. You should have received a FOR A PARTICULAR PURPOSE. See the license for more details. */ -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; using System; using System.Collections.Generic; @@ -44,9 +40,7 @@ public Datum(Date d, double r) // zero inflation tests, index, termstructure, and swaps //=========================================================================================== -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_Inflation { private YieldTermStructure nominalTermStructure() @@ -91,11 +85,7 @@ private List> makeHelpers(Datum[] iiD return instruments; } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testZeroIndex() { // Testing zero inflation indices... @@ -188,11 +178,7 @@ public void testZeroIndex() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testZeroTermStructure() { // Testing zero inflation term structure... @@ -330,7 +316,7 @@ public void testZeroTermStructure() Date baseDate = new Date(1, Month.January, 2006); Date fixDate = new Date(1, Month.August, 2014); Date payDate = new UnitedKingdom().adjust(fixDate + new Period(3, TimeUnit.Months), BusinessDayConvention.ModifiedFollowing); - Index ind = ii as Index; + QLNet.Index ind = ii as QLNet.Index; Utils.QL_REQUIRE(ind != null, () => "dynamic_pointer_cast to Index from InflationIndex failed"); double notional = 1000000.0;//1m @@ -636,11 +622,7 @@ public void testZeroTermStructure() //=========================================================================================== // year on year tests, index, termstructure, and swaps //=========================================================================================== -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testYYIndex() { // Testing year-on-year inflation indices @@ -802,11 +784,7 @@ public void testYYIndex() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testYYTermStructure() { // Testing year-on-year inflation term structure... diff --git a/tests/QLNet.Tests/T_InflationCPICapFloor.cs b/tests/QLNet.Tests/T_InflationCPICapFloor.cs index d1f4a2b01..9b39162dd 100644 --- a/tests/QLNet.Tests/T_InflationCPICapFloor.cs +++ b/tests/QLNet.Tests/T_InflationCPICapFloor.cs @@ -15,18 +15,12 @@ // FOR A PARTICULAR PURPOSE. See the license for more details. using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_InflationCPICapFloor { internal struct Datum @@ -318,11 +312,7 @@ public CommonVars() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void cpicapfloorpricesurface() { // check inflation leg vs calculation directly from inflation TS @@ -380,11 +370,7 @@ public void cpicapfloorpricesurface() common.hcpi.linkTo(null); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void cpicapfloorpricer() { CommonVars common = new CommonVars(); diff --git a/tests/QLNet.Tests/T_InflationCapFloorTest.cs b/tests/QLNet.Tests/T_InflationCapFloorTest.cs index 2a4dfbb50..d9d8def7e 100644 --- a/tests/QLNet.Tests/T_InflationCapFloorTest.cs +++ b/tests/QLNet.Tests/T_InflationCapFloorTest.cs @@ -18,39 +18,22 @@ under the terms of the QLNet license. You should have received a */ using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_InflationCapFloorTest : IDisposable { #region Initialize&Cleanup private SavedSettings backup; -#if NET452 - [TestInitialize] - public void testInitialize() - { -#else + public T_InflationCapFloorTest() { -#endif backup = new SavedSettings(); } -#if NET452 - [TestCleanup] -#endif - public void testCleanup() - { - Dispose(); - } + public void Dispose() { backup.Dispose(); @@ -259,11 +242,7 @@ private List> makeHelpers(Datum[] iiD } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testConsistency() { // Testing consistency between yoy inflation cap,floor and collar... @@ -395,11 +374,7 @@ public void testConsistency() // (actually in arrears with a lag of a few months) thus the first optionlet // is relevant. Hence we can do a parity test without a special definition // of the YoY cap/floor instrument. -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testParity() { @@ -476,11 +451,7 @@ public void testParity() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCachedValue() { // Testing Black yoy inflation cap/floor price against cached values... diff --git a/tests/QLNet.Tests/T_InflationCapFlooredCouponTest.cs b/tests/QLNet.Tests/T_InflationCapFlooredCouponTest.cs index 018d630b4..8e99fec5f 100644 --- a/tests/QLNet.Tests/T_InflationCapFlooredCouponTest.cs +++ b/tests/QLNet.Tests/T_InflationCapFlooredCouponTest.cs @@ -18,39 +18,22 @@ under the terms of the QLNet license. You should have received a */ using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_InflationCapFlooredCouponTest : IDisposable { #region Initialize&Cleanup private SavedSettings backup; -#if NET452 - [TestInitialize] - public void testInitialize() - { -#else + public T_InflationCapFlooredCouponTest() { -#endif backup = new SavedSettings(); } -#if NET452 - [TestCleanup] -#endif - public void testCleanup() - { - Dispose(); - } + public void Dispose() { backup.Dispose(); @@ -350,11 +333,7 @@ private List> makeHelpers(Datum[] iiD } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testDecomposition() { // Testing collared coupon against its decomposition... @@ -665,11 +644,7 @@ public void testDecomposition() vars.hy.linkTo(null); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testInstrumentEquality() { diff --git a/tests/QLNet.Tests/T_Instruments.cs b/tests/QLNet.Tests/T_Instruments.cs index dbfe6ef8e..482b4ee81 100644 --- a/tests/QLNet.Tests/T_Instruments.cs +++ b/tests/QLNet.Tests/T_Instruments.cs @@ -17,25 +17,15 @@ under the terms of the QLNet license. You should have received a FOR A PARTICULAR PURPOSE. See the license for more details. */ -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_Instruments { -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testObservable() { //.("Testing observability of instruments..."); @@ -71,10 +61,5 @@ public void testObservable() if (!f.isUp()) QAssert.Fail("Observer was not notified of instrument change"); } - - public void suite() - { - testObservable(); - } } } diff --git a/tests/QLNet.Tests/T_InterestRate.cs b/tests/QLNet.Tests/T_InterestRate.cs index 90b07e7b6..fd213bb57 100644 --- a/tests/QLNet.Tests/T_InterestRate.cs +++ b/tests/QLNet.Tests/T_InterestRate.cs @@ -18,18 +18,12 @@ under the terms of the QLNet license. You should have received a */ using System; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_InterestRate { public struct InterestRateData @@ -58,11 +52,7 @@ public InterestRateData(double _r, Compounding _comp, Frequency _freq, double _t } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testConversions() { InterestRateData[] cases = diff --git a/tests/QLNet.Tests/T_Interpolations.cs b/tests/QLNet.Tests/T_Interpolations.cs index f9d0e2b9a..c2843b4c1 100644 --- a/tests/QLNet.Tests/T_Interpolations.cs +++ b/tests/QLNet.Tests/T_Interpolations.cs @@ -20,19 +20,13 @@ under the terms of the QLNet license. You should have received a using System; using System.Collections.Generic; using System.Linq; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_Interpolations { @@ -40,11 +34,7 @@ public class T_Interpolations SIAM J. of Scientific and Statistical Computing, v. 4, 1983, pp. 645-654. http://math.lanl.gov/~mac/papers/numerics/H83.pdf */ -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSplineErrorOnGaussianValues() { //("Testing spline approximation on Gaussian data sets..."); @@ -109,11 +99,7 @@ public void testSplineErrorOnGaussianValues() SIAM J. of Scientific and Statistical Computing, v. 4, 1983, pp. 645-654. http://math.lanl.gov/~mac/papers/numerics/H83.pdf */ -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSplineOnGaussianValues() { @@ -185,11 +171,7 @@ public void testSplineOnGaussianValues() SIAM J. of Scientific and Statistical Computing, v. 4, 1983, pp. 645-654. http://math.lanl.gov/~mac/papers/numerics/H83.pdf */ -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSplineOnRPN15AValues() { @@ -336,11 +318,7 @@ public void testSplineOnRPN15AValues() Applied Linear Algebra and Numerical Analysis AMATH 352 Lecture Notes http://www.amath.washington.edu/courses/352-winter-2002/spline_note.pdf */ -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSplineOnGenericValues() { @@ -415,11 +393,7 @@ public void testSplineOnGenericValues() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSimmetricEndConditions() { @@ -452,11 +426,7 @@ public void testSimmetricEndConditions() checkSymmetry("MC not-a-knot spline", f, x[0]); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testDerivativeEndConditions() { @@ -554,11 +524,7 @@ public void testDerivativeEndConditions() Hermite Interpolation" Mathematics Of Computation, v. 52, n. 186, April 1989, pp. 471-494. */ -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testNonRestrictiveHymanFilter() { @@ -731,11 +697,7 @@ public void testNonRestrictiveHymanFilter() class NotThrown : Exception { } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testAsFunctor() { @@ -788,11 +750,7 @@ public void testAsFunctor() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testBackwardFlat() { @@ -902,11 +860,7 @@ public void testBackwardFlat() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testForwardFlat() { @@ -1015,11 +969,7 @@ public void testForwardFlat() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSabrInterpolation() { // Testing Sabr interpolation... @@ -1190,11 +1140,7 @@ public void testSabrInterpolation() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testNormalSabrInterpolation() { // Testing Sabr interpolation... @@ -1366,11 +1312,7 @@ public void testNormalSabrInterpolation() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testKernelInterpolation() { @@ -1497,11 +1439,7 @@ public void testKernelInterpolation() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testKernelInterpolation2D() { // No test values known from the literature. @@ -1629,11 +1567,7 @@ public void testKernelInterpolation2D() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testBicubicDerivatives() { // Testing bicubic spline derivatives... @@ -1686,11 +1620,7 @@ public void testBicubicDerivatives() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testBicubicUpdate() { // Testing that bicubic splines actually update... @@ -1719,11 +1649,7 @@ public void testBicubicUpdate() QAssert.Fail("Failed to update bicubic spline"); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testRichardsonExtrapolation() { // Testing Richardson extrapolation... @@ -1772,11 +1698,7 @@ public void testRichardsonExtrapolation() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSabrSingleCases() { // Testing Sabr calibration single cases... diff --git a/tests/QLNet.Tests/T_LiborMarketModel.cs b/tests/QLNet.Tests/T_LiborMarketModel.cs index 95819a247..9e3d759d5 100644 --- a/tests/QLNet.Tests/T_LiborMarketModel.cs +++ b/tests/QLNet.Tests/T_LiborMarketModel.cs @@ -20,39 +20,22 @@ under the terms of the QLNet license. You should have received a using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_LiborMarketModel : IDisposable { #region Initialize&Cleanup private SavedSettings backup; -#if NET452 - [TestInitialize] - public void testInitialize() - { -#else + public T_LiborMarketModel() { -#endif backup = new SavedSettings(); } -#if NET452 - [TestCleanup] -#endif - public void testCleanup() - { - Dispose(); - } + public void Dispose() { backup.Dispose(); @@ -112,11 +95,7 @@ OptionletVolatilityStructure makeCapVolCurve(Date todaysDate) capletVols, new Actual360()); } -#if NET452 - [TestCategory("LongRun"), TestMethod()] -#else [Fact(Skip = "LongRun")] -#endif public void testSimpleCovarianceModels() { // Testing simple covariance models @@ -194,11 +173,7 @@ public void testSimpleCovarianceModels() } } -#if NET452 - [TestCategory("LongRun"), TestMethod()] -#else [Fact(Skip = "LongRun")] -#endif public void testCapletPricing() { // Testing caplet pricing @@ -240,11 +215,7 @@ public void testCapletPricing() + "\n expected: " + expected); } -#if NET452 - [TestCategory("LongRun"), TestMethod()] -#else [Fact(Skip = "LongRun")] -#endif public void testCalibration() { // Testing calibration of a Libor forward model @@ -347,11 +318,7 @@ public void testCalibration() + "\n expected : smaller than " + tolerance); } -#if NET452 - [TestCategory("LongRun"), TestMethod()] -#else [Fact(Skip = "LongRun")] -#endif public void testSwaptionPricing() { // Testing forward swap and swaption pricing diff --git a/tests/QLNet.Tests/T_LiborMarketModelProcess.cs b/tests/QLNet.Tests/T_LiborMarketModelProcess.cs index 79e8a045d..1b580073e 100644 --- a/tests/QLNet.Tests/T_LiborMarketModelProcess.cs +++ b/tests/QLNet.Tests/T_LiborMarketModelProcess.cs @@ -20,40 +20,22 @@ under the terms of the QLNet license. You should have received a using System; using System.Collections.Generic; using System.Linq; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_LiborMarketModelProcess : IDisposable { #region Initialize&Cleanup private SavedSettings backup; -#if NET452 - [TestInitialize] - public void testInitialize() - { -#else + public T_LiborMarketModelProcess() { -#endif - backup = new SavedSettings(); } -#if NET452 - [TestCleanup] -#endif - public void testCleanup() - { - Dispose(); - } + public void Dispose() { backup.Dispose(); @@ -133,11 +115,7 @@ LiborForwardModelProcess makeProcess(Matrix volaComp) return process; } -#if NET452 - [TestCategory("LongRun"), TestMethod()] -#else [Fact(Skip = "LongRun")] -#endif public void testInitialisation() { // Testing caplet LMM process initialisation @@ -182,11 +160,7 @@ public void testInitialisation() } } -#if NET452 - [TestCategory("LongRun"), TestMethod()] -#else [Fact(Skip = "LongRun")] -#endif public void testLambdaBootstrapping() { // Testing caplet LMM lambda bootstrapping @@ -236,11 +210,7 @@ public void testLambdaBootstrapping() } } -#if NET452 - [TestCategory("LongRun"), TestMethod()] -#else [Fact(Skip = "LongRun")] -#endif public void testMonteCarloCapletPricing() { // Testing caplet LMM Monte-Carlo caplet pricing diff --git a/tests/QLNet.Tests/T_LinearLeastSquaresRegression.cs b/tests/QLNet.Tests/T_LinearLeastSquaresRegression.cs index 893ecc5a5..a5ca07064 100644 --- a/tests/QLNet.Tests/T_LinearLeastSquaresRegression.cs +++ b/tests/QLNet.Tests/T_LinearLeastSquaresRegression.cs @@ -18,11 +18,7 @@ under the terms of the QLNet license. You should have received a */ using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite @@ -30,32 +26,18 @@ namespace TestSuite /// /// Summary description for LinearLeastSquaresRegression /// -#if NET452 - [TestClass] -#endif + [Collection("QLNet CI Tests")] public class T_LinearLeastSquaresRegression : IDisposable { #region Initialize&Cleanup private SavedSettings backup; -#if NET452 - [TestInitialize] - public void testInitialize() - { -#else + public T_LinearLeastSquaresRegression() { -#endif - backup = new SavedSettings(); } -#if NET452 - [TestCleanup] -#endif - public void testCleanup() - { - Dispose(); - } + public void Dispose() { backup.Dispose(); @@ -64,11 +46,7 @@ public void Dispose() const double tolerance = 0.025; -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testRegression() { // Testing linear least-squares regression @@ -146,11 +124,7 @@ public void testRegression() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void test1dLinearRegression() { // Testing 1d simple linear least-squares regression @@ -196,11 +170,7 @@ public void test1dLinearRegression() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testMultiDimRegression() { // Testing linear least-squares regression diff --git a/tests/QLNet.Tests/T_LookbackOption.cs b/tests/QLNet.Tests/T_LookbackOption.cs index 229aa076a..960b0706c 100644 --- a/tests/QLNet.Tests/T_LookbackOption.cs +++ b/tests/QLNet.Tests/T_LookbackOption.cs @@ -14,18 +14,12 @@ // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS // FOR A PARTICULAR PURPOSE. See the license for more details. using System; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_LookbackOption { void REPORT_FAILURE_FLOATING(string greekName, @@ -122,11 +116,7 @@ public LookbackOptionData(Option.Type type_, double strike_, double minmax_, dou public double tol; // tolerance } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testAnalyticContinuousFloatingLookback() { // Testing analytic continuous floating-strike lookback options @@ -194,11 +184,7 @@ public void testAnalyticContinuousFloatingLookback() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testAnalyticContinuousFixedLookback() { // Testing analytic continuous fixed-strike lookback options @@ -295,11 +281,7 @@ public void testAnalyticContinuousFixedLookback() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testAnalyticContinuousPartialFloatingLookback() { // Testing analytic continuous partial floating-strike lookback options..."); @@ -396,11 +378,7 @@ public void testAnalyticContinuousPartialFloatingLookback() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testAnalyticContinuousPartialFixedLookback() { // Testing analytic continuous fixed-strike lookback options diff --git a/tests/QLNet.Tests/T_LowDiscrepancySequences.cs b/tests/QLNet.Tests/T_LowDiscrepancySequences.cs index 0b5fb98cd..674059744 100644 --- a/tests/QLNet.Tests/T_LowDiscrepancySequences.cs +++ b/tests/QLNet.Tests/T_LowDiscrepancySequences.cs @@ -19,11 +19,7 @@ under the terms of the QLNet license. You should have received a using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite @@ -132,23 +128,16 @@ public string name() #endregion - -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_LowDiscrepancySequences { - public void testSeedGenerator() + internal void testSeedGenerator() { //("Testing random-seed generator..."); SeedGenerator.instance().get(); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testPolynomialsModuloTwo() { @@ -188,11 +177,7 @@ public void testPolynomialsModuloTwo() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSobol() { @@ -438,11 +423,7 @@ public void testSobol() } }*/ -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testHalton() { @@ -604,7 +585,7 @@ public void testHalton() } } - public void testGeneratorDiscrepancy(IRNGFactory generatorFactory, double[][] discrepancy) + internal void testGeneratorDiscrepancy(IRNGFactory generatorFactory, double[][] discrepancy) { //QL_TEST_START_TIMING double tolerance = 1.0e-2; @@ -650,7 +631,7 @@ public void testGeneratorDiscrepancy(IRNGFactory generatorFactory, double[][] di #region testMersenneTwisterDiscrepancy - public void testMersenneTwisterDiscrepancy() + internal void testMersenneTwisterDiscrepancy() { //("Testing Mersenne-twister discrepancy..."); @@ -672,7 +653,7 @@ public void testMersenneTwisterDiscrepancy() #region testAltonDiscrepancy - public void testPlainHaltonDiscrepancy() + internal void testPlainHaltonDiscrepancy() { //("Testing plain Halton discrepancy..."); @@ -691,7 +672,7 @@ public void testPlainHaltonDiscrepancy() ); } - public void testRandomStartHaltonDiscrepancy() + internal void testRandomStartHaltonDiscrepancy() { //("Testing random-start Halton discrepancy..."); @@ -710,7 +691,7 @@ public void testRandomStartHaltonDiscrepancy() ); } - public void testRandomShiftHaltonDiscrepancy() + internal void testRandomShiftHaltonDiscrepancy() { //("Testing random-shift Halton discrepancy..."); @@ -729,7 +710,7 @@ public void testRandomShiftHaltonDiscrepancy() ); } - public void testRandomStartRandomShiftHaltonDiscrepancy() + internal void testRandomStartRandomShiftHaltonDiscrepancy() { //("Testing random-start, random-shift Halton discrepancy..."); @@ -748,20 +729,20 @@ public void testRandomStartRandomShiftHaltonDiscrepancy() ); } - //[TestMethod()] - public void _testDiscrepancy_Alton() - { - testPlainHaltonDiscrepancy(); - testRandomStartHaltonDiscrepancy(); - testRandomShiftHaltonDiscrepancy(); - testRandomStartRandomShiftHaltonDiscrepancy(); - } + //[Fact] + //public void _testDiscrepancy_Alton() + //{ + // testPlainHaltonDiscrepancy(); + // testRandomStartHaltonDiscrepancy(); + // testRandomShiftHaltonDiscrepancy(); + // testRandomStartRandomShiftHaltonDiscrepancy(); + //} #endregion Halton #region testSobolDiscrepancy - public void testJackelSobolDiscrepancy() + internal void testJackelSobolDiscrepancy() { //("Testing Jaeckel-Sobol discrepancy..."); @@ -777,7 +758,7 @@ public void testJackelSobolDiscrepancy() discrepancy /*,"JackelSobolDiscrepancy.txt","DiscrJackel_Sobol"*/); } - public void testSobolLevitanSobolDiscrepancy() + internal void testSobolLevitanSobolDiscrepancy() { //("Testing Levitan-Sobol discrepancy..."); @@ -795,7 +776,7 @@ public void testSobolLevitanSobolDiscrepancy() /*,"SobolLevitanSobolDiscrepancy.txt", "DiscrSobLev_Sobol"*/); } - public void testSobolLevitanLemieuxSobolDiscrepancy() + internal void testSobolLevitanLemieuxSobolDiscrepancy() { //("Testing Levitan-Lemieux-Sobol discrepancy..."); @@ -815,7 +796,7 @@ public void testSobolLevitanLemieuxSobolDiscrepancy() ); } - public void testUnitSobolDiscrepancy() + internal void testUnitSobolDiscrepancy() { //("Testing unit Sobol discrepancy..."); @@ -834,22 +815,18 @@ public void testUnitSobolDiscrepancy() ); } - //[TestMethod()] - public void _testDiscrepancy_Sobol() - { - testJackelSobolDiscrepancy(); - testSobolLevitanSobolDiscrepancy(); - testSobolLevitanLemieuxSobolDiscrepancy(); - testUnitSobolDiscrepancy(); - } + //[Fact] + //public void _testDiscrepancy_Sobol() + //{ + // testJackelSobolDiscrepancy(); + // testSobolLevitanSobolDiscrepancy(); + // testSobolLevitanLemieuxSobolDiscrepancy(); + // testUnitSobolDiscrepancy(); + //} #endregion -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSobolSkipping() { diff --git a/tests/QLNet.Tests/T_Matrices.cs b/tests/QLNet.Tests/T_Matrices.cs index 79778db03..e815172de 100644 --- a/tests/QLNet.Tests/T_Matrices.cs +++ b/tests/QLNet.Tests/T_Matrices.cs @@ -19,18 +19,12 @@ under the terms of the QLNet license. You should have received a */ using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_Matrices { @@ -98,11 +92,7 @@ void setup() M7[0, 1] = 0.3; M7[0, 2] = 0.2; M7[2, 1] = 1.2; } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testEigenvectors() { //("Testing eigenvalues and eigenvectors calculation..."); @@ -146,11 +136,7 @@ public void testEigenvectors() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSqrt() { @@ -173,11 +159,7 @@ public void testSqrt() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testHighamSqrt() { //BOOST_MESSAGE("Testing Higham matricial square root..."); @@ -199,11 +181,7 @@ public void testHighamSqrt() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSVD() { @@ -249,11 +227,7 @@ public void testSVD() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testQRDecomposition() { @@ -295,11 +269,7 @@ public void testQRDecomposition() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testQRSolve() { // Testing QR solve... @@ -374,11 +344,7 @@ public void testQRSolve() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testInverse() { diff --git a/tests/QLNet.Tests/T_Money.cs b/tests/QLNet.Tests/T_Money.cs index 82eafcba1..2cbf6a2ad 100644 --- a/tests/QLNet.Tests/T_Money.cs +++ b/tests/QLNet.Tests/T_Money.cs @@ -17,25 +17,15 @@ under the terms of the QLNet license. You should have received a FOR A PARTICULAR PURPOSE. See the license for more details. */ -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_Money { -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testNone() { Currency EUR = new EURCurrency(); @@ -54,11 +44,7 @@ public void testNone() QAssert.Fail("Wrong result: expected: " + expected + " calculated: " + calculated); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testBaseCurrency() { Currency EUR = new EURCurrency(), GBP = new GBPCurrency(), USD = new USDCurrency(); @@ -91,11 +77,7 @@ public void testBaseCurrency() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testAutomated() { Currency EUR = new EURCurrency(), GBP = new GBPCurrency(), USD = new USDCurrency(); diff --git a/tests/QLNet.Tests/T_Operators.cs b/tests/QLNet.Tests/T_Operators.cs index f450755aa..d9db34eea 100644 --- a/tests/QLNet.Tests/T_Operators.cs +++ b/tests/QLNet.Tests/T_Operators.cs @@ -17,27 +17,17 @@ under the terms of the QLNet license. You should have received a FOR A PARTICULAR PURPOSE. See the license for more details. */ using System; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_Operators { public const double average = 0.0, sigma = 1.0; -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testOperatorConsistency() { @@ -97,11 +87,7 @@ public void testOperatorConsistency() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testBSMOperatorConsistency() { //("Testing consistency of BSM operators..."); diff --git a/tests/QLNet.Tests/T_Optimizers.cs b/tests/QLNet.Tests/T_Optimizers.cs index b709f6dfd..1d1907686 100644 --- a/tests/QLNet.Tests/T_Optimizers.cs +++ b/tests/QLNet.Tests/T_Optimizers.cs @@ -19,18 +19,12 @@ under the terms of the QLNet license. You should have received a using System; using System.Collections.Generic; using System.Linq; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_Optimizers { List costFunctions_ = new List(); @@ -63,11 +57,7 @@ enum OptimizationMethodType bfgs_goldstein } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void OptimizersTest() { //("Testing optimizers..."); @@ -118,11 +108,7 @@ public void OptimizersTest() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void nestedOptimizationTest() { //("Testing nested optimizations..."); @@ -138,11 +124,7 @@ public void nestedOptimizationTest() optimizationMethod.minimize(problem, endCriteria); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testDifferentialEvolution() { //BOOST_TEST_MESSAGE("Testing differential evolution..."); @@ -253,6 +235,41 @@ public void testDifferentialEvolution() } + [Fact] + public void testFunctionValueEqualsCostFunctionAtCurrentValue() + { + var testCostFunction = new TestCostFunction(); + var problem = new Problem(testCostFunction, new NoConstraint(), new Vector(new List { 3, 7.4 })); + var endCriteria = new EndCriteria(maxIterations: 1000, maxStationaryStateIterations: 10, rootEpsilon: 0, functionEpsilon: 1e-10, gradientNormEpsilon: null); + var method = new BFGS(); + + var endType = method.minimize(problem, endCriteria); + QAssert.AreEqual(EndCriteria.Type.StationaryFunctionValue, endType); + + QAssert.AreEqual(problem.functionValue(), testCostFunction.value(problem.currentValue())); + } + + private class TestCostFunction : CostFunction + { + public override Vector values(Vector x) + { + return new Vector(x.Select(z => z * z).ToList()); + } + + /// + public override double value(Vector x) + { + return x.Sum(z => z * z); + } + + /// + public override void gradient(ref Vector grad, Vector x) + { + for (int i = 0; i < grad.Count; i++) + grad[i] = 2 * x[i]; + } + } + // Set up, for each cost function, all the ingredients for optimization: // constraint, initial guess, end criteria, optimization methods. void setup() @@ -540,4 +557,5 @@ public override double value(Vector x) return fx - p + 1.0; } } + } diff --git a/tests/QLNet.Tests/T_OptionletStripper.cs b/tests/QLNet.Tests/T_OptionletStripper.cs index e9717237b..195fdd5c9 100644 --- a/tests/QLNet.Tests/T_OptionletStripper.cs +++ b/tests/QLNet.Tests/T_OptionletStripper.cs @@ -15,40 +15,22 @@ // FOR A PARTICULAR PURPOSE. See the license for more details. using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_OptionletStripper : IDisposable { #region Initialize&Cleanup private SavedSettings backup; -#if NET452 - [TestInitialize] - public void testInitialize() - { -#else + public T_OptionletStripper() { -#endif - backup = new SavedSettings(); } -#if NET452 - [TestCleanup] -#endif - public void testCleanup() - { - Dispose(); - } + public void Dispose() { backup.Dispose(); @@ -247,11 +229,7 @@ public void setCapFloorTermVolSurface() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFlatTermVolatilityStripping1() { // Testing forward/forward vol stripping from flat term vol @@ -304,11 +282,7 @@ public void testFlatTermVolatilityStripping1() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testTermVolatilityStripping1() { // Testing forward/forward vol stripping from non-flat term @@ -361,11 +335,7 @@ public void testTermVolatilityStripping1() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFlatTermVolatilityStripping2() { // Testing forward/forward vol stripping from flat term vol @@ -425,11 +395,7 @@ public void testFlatTermVolatilityStripping2() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testTermVolatilityStripping2() { // Testing forward/forward vol stripping from non-flat term vol " diff --git a/tests/QLNet.Tests/T_OvernightIndexedSwap.cs b/tests/QLNet.Tests/T_OvernightIndexedSwap.cs index d036dbed9..e46b8d0a1 100644 --- a/tests/QLNet.Tests/T_OvernightIndexedSwap.cs +++ b/tests/QLNet.Tests/T_OvernightIndexedSwap.cs @@ -18,40 +18,22 @@ under the terms of the QLNet license. You should have received a */ using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_OvernightIndexedSwap : IDisposable { #region Initialize&Cleanup private SavedSettings backup; -#if NET452 - [TestInitialize] - public void testInitialize() - { -#else + public T_OvernightIndexedSwap() { -#endif - backup = new SavedSettings(); } -#if NET452 - [TestCleanup] -#endif - public void testCleanup() - { - Dispose(); - } + public void Dispose() { backup.Dispose(); @@ -239,11 +221,7 @@ public CommonVars() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFairRate() { // Testing Eonia-swap calculation of fair fixed rate... @@ -275,11 +253,7 @@ public void testFairRate() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFairSpread() { // Testing Eonia-swap calculation of fair floating spread... @@ -313,11 +287,7 @@ public void testFairSpread() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCachedValue() { // Testing Eonia-swap calculation against cached value... @@ -339,11 +309,7 @@ public void testCachedValue() "\n tolerance:" + tolerance); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testBootstrap() { // Testing Eonia-swap curve building... diff --git a/tests/QLNet.Tests/T_PSACurve.cs b/tests/QLNet.Tests/T_PSACurve.cs index 27d9613b4..f9b77d3c7 100644 --- a/tests/QLNet.Tests/T_PSACurve.cs +++ b/tests/QLNet.Tests/T_PSACurve.cs @@ -16,25 +16,15 @@ under the terms of the QLNet license. You should have received a ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the license for more details. */ -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_PSACurve { -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCashedValues() { diff --git a/tests/QLNet.Tests/T_PathGenerator.cs b/tests/QLNet.Tests/T_PathGenerator.cs index ab3b344fa..b2c7abd87 100644 --- a/tests/QLNet.Tests/T_PathGenerator.cs +++ b/tests/QLNet.Tests/T_PathGenerator.cs @@ -19,47 +19,28 @@ under the terms of the QLNet license. You should have received a using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_Pathgenerator : IDisposable { #region Initialize&Cleanup private SavedSettings backup; -#if NET452 - [TestInitialize] - public void testInitialize() - { -#else public T_Pathgenerator() { -#endif - backup = new SavedSettings(); } -#if NET452 - [TestCleanup] -#endif - public void testCleanup() - { - Dispose(); - } + public void Dispose() { backup.Dispose(); } #endregion - public void testSingle(StochasticProcess1D process, + internal void testSingle(StochasticProcess1D process, string tag, bool brownianBridge, double expected, @@ -122,7 +103,7 @@ public void testSingle(StochasticProcess1D process, } } - public void testMultiple(StochasticProcess process, + internal void testMultiple(StochasticProcess process, string tag, double[] expected, double[] antithetic) @@ -191,11 +172,7 @@ public void testMultiple(StochasticProcess process, } } -#if NET452 - [TestCategory("LongRun"), TestMethod()] -#else [Fact(Skip = "LongRun")] -#endif public void testPathGenerator() { // Testing 1-D path generation against cached values @@ -225,11 +202,7 @@ public void testPathGenerator() "square-root", false, 1.70608664108, 6.024200546031); } -#if NET452 - [TestCategory("LongRun"), TestMethod()] -#else [Fact(Skip = "LongRun")] -#endif public void testMultiPathGenerator() { // Testing n-D path generation against cached values diff --git a/tests/QLNet.Tests/T_PiecewiseZeroSpreadedTermStructure.cs b/tests/QLNet.Tests/T_PiecewiseZeroSpreadedTermStructure.cs index 4d2c718fb..b6f060d1c 100644 --- a/tests/QLNet.Tests/T_PiecewiseZeroSpreadedTermStructure.cs +++ b/tests/QLNet.Tests/T_PiecewiseZeroSpreadedTermStructure.cs @@ -20,18 +20,12 @@ under the terms of the QLNet license. You should have received a using System; using System.Linq; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_PiecewiseZeroSpreadedTermStructure { public class CommonVars @@ -78,11 +72,7 @@ public CommonVars() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFlatInterpolationLeft() { // Testing flat interpolation before the first spreaded date... @@ -118,11 +108,7 @@ public void testFlatInterpolationLeft() + " expected: " + expectedRate); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFlatInterpolationRight() { // Testing flat interpolation after the last spreaded date... @@ -159,11 +145,7 @@ public void testFlatInterpolationRight() + " expected: " + expectedRate); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testLinearInterpolationMultipleSpreads() { // Testing linear interpolation with more than two spreaded dates... @@ -208,11 +190,7 @@ public void testLinearInterpolationMultipleSpreads() + " expected: " + expectedRate); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testLinearInterpolation() { // Testing linear interpolation between two dates... @@ -255,11 +233,7 @@ public void testLinearInterpolation() + " expected: " + expectedRate); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testForwardFlatInterpolation() { // Testing forward flat interpolation between two dates... @@ -297,11 +271,7 @@ public void testForwardFlatInterpolation() + " expected: " + expectedRate); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testBackwardFlatInterpolation() { // Testing backward flat interpolation between two dates... @@ -343,11 +313,7 @@ public void testBackwardFlatInterpolation() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testDefaultInterpolation() { // Testing default interpolation between two dates... @@ -385,11 +351,7 @@ public void testDefaultInterpolation() + " expected: " + expectedRate); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSetInterpolationFactory() { // Testing factory constructor with additional parameters... @@ -440,11 +402,7 @@ public void testSetInterpolationFactory() + " expected: " + expectedRate); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testMaxDate() { // Testing term structure max date... @@ -477,11 +435,7 @@ public void testMaxDate() + " expected: " + expectedDate); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testQuoteChanging() { // Testing quote update... diff --git a/tests/QLNet.Tests/T_Piecewiseyieldcurve.cs b/tests/QLNet.Tests/T_Piecewiseyieldcurve.cs index 6299e8c72..fd0434d56 100644 --- a/tests/QLNet.Tests/T_Piecewiseyieldcurve.cs +++ b/tests/QLNet.Tests/T_Piecewiseyieldcurve.cs @@ -19,18 +19,12 @@ under the terms of the QLNet license. You should have received a */ using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_PiecewiseyieldCurve : IDisposable { public class CommonVars @@ -241,24 +235,13 @@ public CommonVars() #region Initialize&Cleanup private SavedSettings backup; private IndexHistoryCleaner cleaner; -#if NET452 - [TestInitialize] - public void testInitialize() - { -#else + public T_PiecewiseyieldCurve() { -#endif backup = new SavedSettings(); cleaner = new IndexHistoryCleaner(); } -#if NET452 - [TestCleanup] -#endif - public void testCleanup() - { - Dispose(); - } + public void Dispose() { backup.Dispose(); @@ -266,28 +249,24 @@ public void Dispose() } #endregion - //[TestMethod()] - public void testLogCubicDiscountConsistency() - { - // "Testing consistency of piecewise-log-cubic discount curve..."); + //[Fact] + //public void testLogCubicDiscountConsistency() + //{ + // // "Testing consistency of piecewise-log-cubic discount curve..."); - CommonVars vars = new CommonVars(); + // CommonVars vars = new CommonVars(); - testCurveConsistency(vars, - new LogCubic(CubicInterpolation.DerivativeApprox.Spline, true, - CubicInterpolation.BoundaryCondition.SecondDerivative, 0.0, - CubicInterpolation.BoundaryCondition.SecondDerivative, 0.0)); - testBMACurveConsistency(vars, - new LogCubic(CubicInterpolation.DerivativeApprox.Spline, true, - CubicInterpolation.BoundaryCondition.SecondDerivative, 0.0, - CubicInterpolation.BoundaryCondition.SecondDerivative, 0.0)); - } + // testCurveConsistency(vars, + // new LogCubic(CubicInterpolation.DerivativeApprox.Spline, true, + // CubicInterpolation.BoundaryCondition.SecondDerivative, 0.0, + // CubicInterpolation.BoundaryCondition.SecondDerivative, 0.0)); + // testBMACurveConsistency(vars, + // new LogCubic(CubicInterpolation.DerivativeApprox.Spline, true, + // CubicInterpolation.BoundaryCondition.SecondDerivative, 0.0, + // CubicInterpolation.BoundaryCondition.SecondDerivative, 0.0)); + //} -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testLogLinearDiscountConsistency() { // "Testing consistency of piecewise-log-linear discount curve..."); @@ -298,11 +277,7 @@ public void testLogLinearDiscountConsistency() testBMACurveConsistency(vars); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testLinearDiscountConsistency() { // "Testing consistency of piecewise-linear discount curve..." @@ -312,11 +287,7 @@ public void testLinearDiscountConsistency() testCurveConsistency(vars); testBMACurveConsistency(vars); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testLogLinearZeroConsistency() { // "Testing consistency of piecewise-log-linear zero-yield curve..."); @@ -333,11 +304,7 @@ public void testLogLinearZeroConsistency() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testLinearZeroConsistency() { // "Testing consistency of piecewise-linear zero-yield curve..."); @@ -348,11 +315,7 @@ public void testLinearZeroConsistency() testBMACurveConsistency(vars); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSplineZeroConsistency() { @@ -372,11 +335,7 @@ public void testSplineZeroConsistency() CubicInterpolation.BoundaryCondition.SecondDerivative, 0.0)); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testLinearForwardConsistency() { // "Testing consistency of piecewise-linear forward-rate curve..."); @@ -387,11 +346,7 @@ public void testLinearForwardConsistency() testBMACurveConsistency(vars); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFlatForwardConsistency() { @@ -403,31 +358,26 @@ public void testFlatForwardConsistency() testBMACurveConsistency(vars); } - //[TestMethod()] - public void testSplineForwardConsistency() - { - - //"Testing consistency of piecewise-cubic forward-rate curve..."); - - CommonVars vars = new CommonVars(); + //[Fact] + //public void testSplineForwardConsistency() + //{ + // //"Testing consistency of piecewise-cubic forward-rate curve..."); + + // CommonVars vars = new CommonVars(); + + // testCurveConsistency( + // vars, + // new Cubic(CubicInterpolation.DerivativeApprox.Spline, true, + // CubicInterpolation.BoundaryCondition.SecondDerivative, 0.0, + // CubicInterpolation.BoundaryCondition.SecondDerivative, 0.0)); + // testBMACurveConsistency( + // vars, + // new Cubic(CubicInterpolation.DerivativeApprox.Spline, true, + // CubicInterpolation.BoundaryCondition.SecondDerivative, 0.0, + // CubicInterpolation.BoundaryCondition.SecondDerivative, 0.0)); + //} - testCurveConsistency( - vars, - new Cubic(CubicInterpolation.DerivativeApprox.Spline, true, - CubicInterpolation.BoundaryCondition.SecondDerivative, 0.0, - CubicInterpolation.BoundaryCondition.SecondDerivative, 0.0)); - testBMACurveConsistency( - vars, - new Cubic(CubicInterpolation.DerivativeApprox.Spline, true, - CubicInterpolation.BoundaryCondition.SecondDerivative, 0.0, - CubicInterpolation.BoundaryCondition.SecondDerivative, 0.0)); - } - -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testConvexMonotoneForwardConsistency() { //"Testing consistency of convex monotone forward-rate curve..."); @@ -438,11 +388,7 @@ public void testConvexMonotoneForwardConsistency() testBMACurveConsistency(vars); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testLocalBootstrapConsistency() { //"Testing consistency of local-bootstrap algorithm..."); @@ -452,11 +398,7 @@ public void testLocalBootstrapConsistency() testBMACurveConsistency(vars, new ConvexMonotone(), 1.0e-9); } -#if NET452 - [TestMethod()] -#else - [Fact] -#endif + [Fact(Skip = "ToCheck")] public void testObservability() { // "Testing observability of piecewise yield curve..."); @@ -488,11 +430,7 @@ public void testObservability() QAssert.Fail("Observer was not notified of date change"); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testLiborFixing() { @@ -579,11 +517,7 @@ public void testLiborFixing() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testForwardRateDayCounter() { @@ -604,11 +538,7 @@ public void testForwardRateDayCounter() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testJpyLibor() { //"Testing bootstrap over JPY LIBOR swaps..."); @@ -683,11 +613,7 @@ public void testJpyLibor() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testDiscountCopy() { //BOOST_MESSAGE("Testing copying of discount curve..."); @@ -696,11 +622,7 @@ public void testDiscountCopy() testCurveCopy(vars); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testForwardCopy() { //BOOST_MESSAGE("Testing copying of forward-rate curve..."); @@ -709,11 +631,7 @@ public void testForwardCopy() testCurveCopy(vars); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testZeroCopy() { //BOOST_MESSAGE("Testing copying of zero-rate curve..."); @@ -723,15 +641,15 @@ public void testZeroCopy() } - public void testCurveConsistency(CommonVars vars) + internal void testCurveConsistency(CommonVars vars) where T : ITraits, new () where I : IInterpolationFactory, new () where B : IBootStrap, new () { testCurveConsistency(vars, FastActivator.Create(), 1.0e-9); } - public void testCurveConsistency(CommonVars vars, I interpolator) + internal void testCurveConsistency(CommonVars vars, I interpolator) where T : ITraits, new () where I : IInterpolationFactory, new () where B : IBootStrap, new () { testCurveConsistency(vars, FastActivator.Create(), 1.0e-9); } - public void testCurveConsistency(CommonVars vars, I interpolator, double tolerance) + internal void testCurveConsistency(CommonVars vars, I interpolator, double tolerance) where T : ITraits, new () where I : IInterpolationFactory, new () where B : IBootStrap, new () @@ -836,15 +754,15 @@ public void testCurveConsistency(CommonVars vars, I interpolator, doubl } } - public void testBMACurveConsistency(CommonVars vars) + internal void testBMACurveConsistency(CommonVars vars) where T : ITraits, new () where I : IInterpolationFactory, new () where B : IBootStrap, new () { testBMACurveConsistency(vars, FastActivator.Create(), 1.0e-7); } - public void testBMACurveConsistency(CommonVars vars, I interpolator) + internal void testBMACurveConsistency(CommonVars vars, I interpolator) where T : ITraits, new () where I : IInterpolationFactory, new () where B : IBootStrap, new () { testBMACurveConsistency(vars, interpolator, 1.0e-7); } - public void testBMACurveConsistency(CommonVars vars, I interpolator, double tolerance) + internal void testBMACurveConsistency(CommonVars vars, I interpolator, double tolerance) where T : ITraits, new () where I : IInterpolationFactory, new () where B : IBootStrap, new () @@ -931,13 +849,13 @@ public void testBMACurveConsistency(CommonVars vars, I interpolator, do IndexManager.instance().clearHistories(); } - public void testCurveCopy(CommonVars vars) + internal void testCurveCopy(CommonVars vars) where T : ITraits, new () where I : IInterpolationFactory, new () { testCurveCopy(vars, FastActivator.Create()); } - public void testCurveCopy(CommonVars vars, I interpolator) + internal void testCurveCopy(CommonVars vars, I interpolator) where T : ITraits, new () where I : IInterpolationFactory, new () { diff --git a/tests/QLNet.Tests/T_Quotes.cs b/tests/QLNet.Tests/T_Quotes.cs index ef9a8c4f8..02430cd6e 100644 --- a/tests/QLNet.Tests/T_Quotes.cs +++ b/tests/QLNet.Tests/T_Quotes.cs @@ -18,19 +18,12 @@ under the terms of the QLNet license. You should have received a */ using System; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { - -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_Quotes { double add10(double x) { return x + 10; } @@ -42,11 +35,7 @@ double add double mul(double x, double y) { return x * y; } double sub(double x, double y) { return x - y; } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testObservable() { // Testing observability of quotes @@ -61,11 +50,7 @@ public void testObservable() QAssert.Fail("Observer was not notified of quote change"); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testObservableHandle() { @@ -92,11 +77,7 @@ public void testObservableHandle() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testDerived() { @@ -118,11 +99,7 @@ public void testDerived() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testComposite() { // Testing composite quotes diff --git a/tests/QLNet.Tests/T_RNGTraits.cs b/tests/QLNet.Tests/T_RNGTraits.cs index 6293b60d0..ed5dd7450 100644 --- a/tests/QLNet.Tests/T_RNGTraits.cs +++ b/tests/QLNet.Tests/T_RNGTraits.cs @@ -18,25 +18,15 @@ under the terms of the QLNet license. You should have received a */ using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_RNGTraits { -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testGaussian() { //("Testing Gaussian pseudo-random number generation..."); @@ -57,11 +47,7 @@ public void testGaussian() + " expected: " + stored); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testDefaultPoisson() { @@ -82,11 +68,7 @@ public void testDefaultPoisson() + " expected: " + stored); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCustomPoisson() { diff --git a/tests/QLNet.Tests/T_RangeAccrual.cs b/tests/QLNet.Tests/T_RangeAccrual.cs index ada70792d..246404201 100644 --- a/tests/QLNet.Tests/T_RangeAccrual.cs +++ b/tests/QLNet.Tests/T_RangeAccrual.cs @@ -1,1584 +1,1566 @@ -// Copyright (C) 2008-2018 Andrea Maggiulli (a.maggiulli@gmail.com) -// -// This file is part of QLNet Project https://github.com/amaggiulli/qlnet -// QLNet is free software: you can redistribute it and/or modify it -// under the terms of the QLNet license. You should have received a -// copy of the license along with this program; if not, license is -// available at . -// -// QLNet is a based on QuantLib, a free-software/open-source library -// for financial quantitative analysts and developers - http://quantlib.org/ -// The QuantLib license is available online at http://quantlib.org/license.shtml. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -// FOR A PARTICULAR PURPOSE. See the license for more details. - -using System; -using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else -using Xunit; -#endif -using QLNet; - -namespace TestSuite -{ -#if NET452 - [TestClass()] -#endif - public class T_RangeAccrual - { - private class CommonVars - { - // General settings - public Date referenceDate, today, settlement; - public Calendar calendar; - - // Volatility Stuctures - public List> swaptionVolatilityStructures; - public Handle atmVol; - public Handle flatSwaptionVolatilityCube1; - public Handle flatSwaptionVolatilityCube2; - public Handle swaptionVolatilityCubeBySabr; - - public List atmOptionTenors, optionTenors; - public List atmSwapTenors, swapTenors; - public List strikeSpreads; - - public Matrix atmVolMatrix, volSpreadsMatrix; - public List>> volSpreads; - - public DayCounter dayCounter; - public BusinessDayConvention optionBDC; - public int swapSettlementDays; - public bool vegaWeightedSmileFit; - - // Range Accrual valuation - public double infiniteLowerStrike, infiniteUpperStrike; - public double gearing, correlation; - public double spread; - public Date startDate; - public Date endDate; - public Date paymentDate; - public int fixingDays; - public DayCounter rangeCouponDayCount; - public Schedule observationSchedule; - // Observation Schedule conventions - public Frequency observationsFrequency; - public BusinessDayConvention observationsConvention; - - // Term Structure - public RelinkableHandle termStructure = new RelinkableHandle(); - - // indices and index conventions - public Frequency fixedLegFrequency; - public BusinessDayConvention fixedLegConvention; - public DayCounter fixedLegDayCounter; - public IborIndex iborIndex; - - // Range accrual pricers properties - public List byCallSpread; - public double flatVol; - public List smilesOnExpiry; - public List smilesOnPayment; - - //test parameters - public double rateTolerance; - public double priceTolerance; - - - // cleanup - SavedSettings backup = new SavedSettings(); - - public void createYieldCurve() - { - - // Yield Curve - List dates = new List(); - dates.Add(new Date(39147)); dates.Add(new Date(39148)); dates.Add(new Date(39151)); - dates.Add(new Date(39153)); dates.Add(new Date(39159)); dates.Add(new Date(39166)); - dates.Add(new Date(39183)); dates.Add(new Date(39294)); dates.Add(new Date(39384)); - dates.Add(new Date(39474)); dates.Add(new Date(39567)); dates.Add(new Date(39658)); - dates.Add(new Date(39748)); dates.Add(new Date(39839)); dates.Add(new Date(39931)); - dates.Add(new Date(40250)); dates.Add(new Date(40614)); dates.Add(new Date(40978)); - dates.Add(new Date(41344)); dates.Add(new Date(41709)); dates.Add(new Date(42074)); - dates.Add(new Date(42441)); dates.Add(new Date(42805)); dates.Add(new Date(43170)); - dates.Add(new Date(43535)); dates.Add(new Date(43900)); dates.Add(new Date(44268)); - dates.Add(new Date(44632)); dates.Add(new Date(44996)); dates.Add(new Date(45361)); - dates.Add(new Date(45727)); dates.Add(new Date(46092)); dates.Add(new Date(46459)); - dates.Add(new Date(46823)); dates.Add(new Date(47188)); dates.Add(new Date(47553)); - dates.Add(new Date(47918)); dates.Add(new Date(48283)); dates.Add(new Date(48650)); - dates.Add(new Date(49014)); dates.Add(new Date(49379)); dates.Add(new Date(49744)); - dates.Add(new Date(50110)); dates.Add(new Date(53762)); dates.Add(new Date(57415)); - dates.Add(new Date(61068)); - - List zeroRates = new List(); - zeroRates.Add(0.02676568527); zeroRates.Add(0.02676568527); - zeroRates.Add(0.02676333038); zeroRates.Add(0.02682286201); - zeroRates.Add(0.02682038347); zeroRates.Add(0.02683030208); - zeroRates.Add(0.02700136766); zeroRates.Add(0.02932526033); - zeroRates.Add(0.03085568949); zeroRates.Add(0.03216370631); - zeroRates.Add(0.03321234116); zeroRates.Add(0.03404978072); - zeroRates.Add(0.03471117149); zeroRates.Add(0.03527141916); - zeroRates.Add(0.03574660393); zeroRates.Add(0.03691715582); - zeroRates.Add(0.03796468718); zeroRates.Add(0.03876457629); - zeroRates.Add(0.03942029708); zeroRates.Add(0.03999925325); - zeroRates.Add(0.04056663618); zeroRates.Add(0.04108743922); - zeroRates.Add(0.04156156761); zeroRates.Add(0.0419979179); - zeroRates.Add(0.04239486483); zeroRates.Add(0.04273799032); - zeroRates.Add(0.04305531203); zeroRates.Add(0.04336417578); - zeroRates.Add(0.04364017665); zeroRates.Add(0.04388153459); - zeroRates.Add(0.04408005012); zeroRates.Add(0.04424764425); - zeroRates.Add(0.04437504759); zeroRates.Add(0.04447696334); - zeroRates.Add(0.04456212318); zeroRates.Add(0.04464090072); - zeroRates.Add(0.0447068707); zeroRates.Add(0.04475921774); - zeroRates.Add(0.04477418345); zeroRates.Add(0.04477880755); - zeroRates.Add(0.04476692489); zeroRates.Add(0.04473779454); - zeroRates.Add(0.04468646066); zeroRates.Add(0.04430951558); - zeroRates.Add(0.04363922313); zeroRates.Add(0.04363601992); - - termStructure.linkTo(new InterpolatedZeroCurve(dates, zeroRates, new Actual365Fixed())); - } - - public void createVolatilityStructures() - { - - // ATM swaptionvol matrix - optionBDC = BusinessDayConvention.Following; - - atmOptionTenors = new List(); - atmOptionTenors.Add(new Period(1, TimeUnit.Months)); - atmOptionTenors.Add(new Period(6, TimeUnit.Months)); - atmOptionTenors.Add(new Period(1, TimeUnit.Years)); - atmOptionTenors.Add(new Period(5, TimeUnit.Years)); - atmOptionTenors.Add(new Period(10, TimeUnit.Years)); - atmOptionTenors.Add(new Period(30, TimeUnit.Years)); - - atmSwapTenors = new List(); - atmSwapTenors.Add(new Period(1, TimeUnit.Years)); - atmSwapTenors.Add(new Period(5, TimeUnit.Years)); - atmSwapTenors.Add(new Period(10, TimeUnit.Years)); - atmSwapTenors.Add(new Period(30, TimeUnit.Years)); - - atmVolMatrix = new Matrix(atmOptionTenors.Count, atmSwapTenors.Count); - - atmVolMatrix[0, 0] = flatVol; atmVolMatrix[0, 1] = flatVol; atmVolMatrix[0, 2] = flatVol; atmVolMatrix[0, 3] = flatVol; - atmVolMatrix[1, 0] = flatVol; atmVolMatrix[1, 1] = flatVol; atmVolMatrix[1, 2] = flatVol; atmVolMatrix[1, 3] = flatVol; - atmVolMatrix[2, 0] = flatVol; atmVolMatrix[2, 1] = flatVol; atmVolMatrix[2, 2] = flatVol; atmVolMatrix[2, 3] = flatVol; - atmVolMatrix[3, 0] = flatVol; atmVolMatrix[3, 1] = flatVol; atmVolMatrix[3, 2] = flatVol; atmVolMatrix[3, 3] = flatVol; - atmVolMatrix[4, 0] = flatVol; atmVolMatrix[4, 1] = flatVol; atmVolMatrix[4, 2] = flatVol; atmVolMatrix[4, 3] = flatVol; - atmVolMatrix[5, 0] = flatVol; atmVolMatrix[5, 1] = flatVol; atmVolMatrix[5, 2] = flatVol; atmVolMatrix[5, 3] = flatVol; - - int nRowsAtmVols = atmVolMatrix.rows(); - int nColsAtmVols = atmVolMatrix.columns(); - - - //swaptionvolcube - optionTenors = new List(); - optionTenors.Add(new Period(1, TimeUnit.Years)); - optionTenors.Add(new Period(10, TimeUnit.Years)); - optionTenors.Add(new Period(30, TimeUnit.Years)); - - swapTenors = new List(); - swapTenors.Add(new Period(2, TimeUnit.Years)); - swapTenors.Add(new Period(10, TimeUnit.Years)); - swapTenors.Add(new Period(30, TimeUnit.Years)); - - strikeSpreads = new List(); - strikeSpreads.Add(-0.020); - strikeSpreads.Add(-0.005); - strikeSpreads.Add(+0.000); - strikeSpreads.Add(+0.005); - strikeSpreads.Add(+0.020); - - int nRows = optionTenors.Count * swapTenors.Count; - int nCols = strikeSpreads.Count; - volSpreadsMatrix = new Matrix(nRows, nCols); - volSpreadsMatrix[0, 0] = 0.0599; volSpreadsMatrix[0, 1] = 0.0049; - volSpreadsMatrix[0, 2] = 0.0000; - volSpreadsMatrix[0, 3] = -0.0001; volSpreadsMatrix[0, 4] = 0.0127; - - volSpreadsMatrix[1, 0] = 0.0729; volSpreadsMatrix[1, 1] = 0.0086; - volSpreadsMatrix[1, 2] = 0.0000; - volSpreadsMatrix[1, 3] = -0.0024; volSpreadsMatrix[1, 4] = 0.0098; - - volSpreadsMatrix[2, 0] = 0.0738; volSpreadsMatrix[2, 1] = 0.0102; - volSpreadsMatrix[2, 2] = 0.0000; - volSpreadsMatrix[2, 3] = -0.0039; volSpreadsMatrix[2, 4] = 0.0065; - - volSpreadsMatrix[3, 0] = 0.0465; volSpreadsMatrix[3, 1] = 0.0063; - volSpreadsMatrix[3, 2] = 0.0000; - volSpreadsMatrix[3, 3] = -0.0032; volSpreadsMatrix[3, 4] = -0.0010; - - volSpreadsMatrix[4, 0] = 0.0558; volSpreadsMatrix[4, 1] = 0.0084; - volSpreadsMatrix[4, 2] = 0.0000; - volSpreadsMatrix[4, 3] = -0.0050; volSpreadsMatrix[4, 4] = -0.0057; - - volSpreadsMatrix[5, 0] = 0.0576; volSpreadsMatrix[5, 1] = 0.0083; - volSpreadsMatrix[5, 2] = 0.0000; - volSpreadsMatrix[5, 3] = -0.0043; volSpreadsMatrix[5, 4] = -0.0014; - - volSpreadsMatrix[6, 0] = 0.0437; volSpreadsMatrix[6, 1] = 0.0059; - volSpreadsMatrix[6, 2] = 0.0000; - volSpreadsMatrix[6, 3] = -0.0030; volSpreadsMatrix[6, 4] = -0.0006; - - volSpreadsMatrix[7, 0] = 0.0533; volSpreadsMatrix[7, 1] = 0.0078; - volSpreadsMatrix[7, 2] = 0.0000; - volSpreadsMatrix[7, 3] = -0.0045; volSpreadsMatrix[7, 4] = -0.0046; - - volSpreadsMatrix[8, 0] = 0.0545; volSpreadsMatrix[8, 1] = 0.0079; - volSpreadsMatrix[8, 2] = 0.0000; - volSpreadsMatrix[8, 3] = -0.0042; volSpreadsMatrix[8, 4] = -0.0020; - - - swapSettlementDays = 2; - fixedLegFrequency = Frequency.Annual; - fixedLegConvention = BusinessDayConvention.Unadjusted; - fixedLegDayCounter = new Thirty360(); - SwapIndex swapIndexBase = new EuriborSwapIsdaFixA(new Period(2, TimeUnit.Years), termStructure); - - SwapIndex shortSwapIndexBase = new EuriborSwapIsdaFixA(new Period(1, TimeUnit.Years), termStructure); - - vegaWeightedSmileFit = false; - - // ATM Volatility structure - List>> atmVolsHandle; - atmVolsHandle = new InitializedList>>(nRowsAtmVols); - int i; - for (i = 0; i < nRowsAtmVols; i++) - { - atmVolsHandle[i] = new InitializedList>(nColsAtmVols); - for (int j = 0; j < nColsAtmVols; j++) - { - atmVolsHandle[i][j] = new Handle(new SimpleQuote(atmVolMatrix[i, j])); - } - } - - dayCounter = new Actual365Fixed(); - - atmVol = new Handle(new SwaptionVolatilityMatrix(calendar, - optionBDC, atmOptionTenors, atmSwapTenors, atmVolsHandle, dayCounter)); - - // Volatility Cube without smile - List>> parametersGuess = new InitializedList>>(optionTenors.Count * swapTenors.Count); - for (i = 0; i < optionTenors.Count * swapTenors.Count; i++) - { - parametersGuess[i] = new InitializedList>(4); - parametersGuess[i][0] = new Handle(new SimpleQuote(0.2)); - parametersGuess[i][1] = new Handle(new SimpleQuote(0.5)); - parametersGuess[i][2] = new Handle(new SimpleQuote(0.4)); - parametersGuess[i][3] = new Handle(new SimpleQuote(0.0)); - } - List isParameterFixed = new InitializedList(4, false); - isParameterFixed[1] = true; - - List>> nullVolSpreads = new InitializedList>>(nRows); - for (i = 0; i < optionTenors.Count * swapTenors.Count; i++) - { - nullVolSpreads[i] = new InitializedList>(nCols); - for (int j = 0; j < strikeSpreads.Count; j++) - { - nullVolSpreads[i][j] = new Handle(new SimpleQuote(0.0)); - } - } - - SwaptionVolCube1x flatSwaptionVolatilityCube1ptr = new SwaptionVolCube1x( - atmVol, optionTenors, swapTenors, strikeSpreads, nullVolSpreads, swapIndexBase, - shortSwapIndexBase, vegaWeightedSmileFit, parametersGuess, isParameterFixed, - false); - flatSwaptionVolatilityCube1 = new Handle(flatSwaptionVolatilityCube1ptr); - flatSwaptionVolatilityCube1.link.enableExtrapolation(); - - SwaptionVolCube2 flatSwaptionVolatilityCube2ptr = new SwaptionVolCube2(atmVol, - optionTenors, swapTenors, strikeSpreads, nullVolSpreads, swapIndexBase, - shortSwapIndexBase, vegaWeightedSmileFit); - flatSwaptionVolatilityCube2 = new Handle(flatSwaptionVolatilityCube2ptr); - flatSwaptionVolatilityCube2.link.enableExtrapolation(); - - - // Volatility Cube with smile - volSpreads = new InitializedList>>(nRows); - for (i = 0; i < optionTenors.Count * swapTenors.Count; i++) - { - volSpreads[i] = new InitializedList>(nCols); - for (int j = 0; j < strikeSpreads.Count; j++) - { - volSpreads[i][j] = new Handle(new SimpleQuote(volSpreadsMatrix[i, j])); - } - } - - SwaptionVolCube1x swaptionVolatilityCubeBySabrPtr = new SwaptionVolCube1x( - atmVol, - optionTenors, - swapTenors, - strikeSpreads, - volSpreads, - swapIndexBase, - shortSwapIndexBase, - vegaWeightedSmileFit, - parametersGuess, - isParameterFixed, - false); - swaptionVolatilityCubeBySabr = new Handle(swaptionVolatilityCubeBySabrPtr); - swaptionVolatilityCubeBySabr.link.enableExtrapolation(); - - swaptionVolatilityStructures = new List>(); - swaptionVolatilityStructures.Add(flatSwaptionVolatilityCube2); - swaptionVolatilityStructures.Add(swaptionVolatilityCubeBySabr); - } - - public void createSmileSections() - { - List strikes = new List(), stdDevsOnExpiry = new List(), stdDevsOnPayment = new List(); - strikes.Add(0.003); stdDevsOnExpiry.Add(2.45489828353233); stdDevsOnPayment.Add(1.66175264544155); - strikes.Add(0.004); stdDevsOnExpiry.Add(2.10748097295326); stdDevsOnPayment.Add(1.46691241671427); - strikes.Add(0.005); stdDevsOnExpiry.Add(1.87317517200074); stdDevsOnPayment.Add(1.32415790098009); - strikes.Add(0.006); stdDevsOnExpiry.Add(1.69808302023488); stdDevsOnPayment.Add(1.21209617319357); - strikes.Add(0.007); stdDevsOnExpiry.Add(1.55911989073644); stdDevsOnPayment.Add(1.12016686638666); - strikes.Add(0.008); stdDevsOnExpiry.Add(1.44436083444893); stdDevsOnPayment.Add(1.04242066059821); - strikes.Add(0.009); stdDevsOnExpiry.Add(1.34687413874126); stdDevsOnPayment.Add(0.975173254741177); - strikes.Add(0.01); stdDevsOnExpiry.Add(1.26228953588707); stdDevsOnPayment.Add(0.916013813275761); - strikes.Add(0.011); stdDevsOnExpiry.Add(1.18769456816136); stdDevsOnPayment.Add(0.863267064731419); - strikes.Add(0.012); stdDevsOnExpiry.Add(1.12104324191799); stdDevsOnPayment.Add(0.815743793189994); - strikes.Add(0.013); stdDevsOnExpiry.Add(1.06085561121201); stdDevsOnPayment.Add(0.772552896805455); - strikes.Add(0.014); stdDevsOnExpiry.Add(1.00603120341767); stdDevsOnPayment.Add(0.733033340026564); - strikes.Add(0.015); stdDevsOnExpiry.Add(0.955725690399709); stdDevsOnPayment.Add(0.696673144338147); - strikes.Add(0.016); stdDevsOnExpiry.Add(0.909281318404816); stdDevsOnPayment.Add(0.663070503816902); - strikes.Add(0.017); stdDevsOnExpiry.Add(0.866185798452041); stdDevsOnPayment.Add(0.631911102538957); - strikes.Add(0.018); stdDevsOnExpiry.Add(0.826018547612582); stdDevsOnPayment.Add(0.602948672357772); - strikes.Add(0.019); stdDevsOnExpiry.Add(0.788447526732122); stdDevsOnPayment.Add(0.575982310311697); - strikes.Add(0.02); stdDevsOnExpiry.Add(0.753200779931885); stdDevsOnPayment.Add(0.550849997883271); - strikes.Add(0.021); stdDevsOnExpiry.Add(0.720053785498); stdDevsOnPayment.Add(0.527428600999225); - strikes.Add(0.022); stdDevsOnExpiry.Add(0.688823131326177); stdDevsOnPayment.Add(0.505604706697337); - strikes.Add(0.023); stdDevsOnExpiry.Add(0.659357028088728); stdDevsOnPayment.Add(0.485294065348527); - strikes.Add(0.024); stdDevsOnExpiry.Add(0.631532146956907); stdDevsOnPayment.Add(0.466418908064414); - strikes.Add(0.025); stdDevsOnExpiry.Add(0.605247295045587); stdDevsOnPayment.Add(0.448904706326966); - strikes.Add(0.026); stdDevsOnExpiry.Add(0.580413928580285); stdDevsOnPayment.Add(0.432686652729201); - strikes.Add(0.027); stdDevsOnExpiry.Add(0.556962477452476); stdDevsOnPayment.Add(0.417699939864133); - strikes.Add(0.028); stdDevsOnExpiry.Add(0.534829696108958); stdDevsOnPayment.Add(0.403876519954429); - strikes.Add(0.029); stdDevsOnExpiry.Add(0.513968150384827); stdDevsOnPayment.Add(0.391145104852406); - strikes.Add(0.03); stdDevsOnExpiry.Add(0.494330406115181); stdDevsOnPayment.Add(0.379434406410383); - strikes.Add(0.031); stdDevsOnExpiry.Add(0.475869029135118); stdDevsOnPayment.Add(0.368669896110328); - strikes.Add(0.032); stdDevsOnExpiry.Add(0.458549234390376); stdDevsOnPayment.Add(0.358777045434208); - strikes.Add(0.033); stdDevsOnExpiry.Add(0.442329912271372); stdDevsOnPayment.Add(0.349678085493644); - strikes.Add(0.034); stdDevsOnExpiry.Add(0.427163628613205); stdDevsOnPayment.Add(0.341304968511301); - strikes.Add(0.035); stdDevsOnExpiry.Add(0.413009273806291); stdDevsOnPayment.Add(0.333586406339497); - strikes.Add(0.036); stdDevsOnExpiry.Add(0.399819413685729); stdDevsOnPayment.Add(0.326457591571248); - strikes.Add(0.037); stdDevsOnExpiry.Add(0.387546614086615); stdDevsOnPayment.Add(0.31985630909585); - strikes.Add(0.038); stdDevsOnExpiry.Add(0.376137116288728); stdDevsOnPayment.Add(0.313728768765505); - strikes.Add(0.039); stdDevsOnExpiry.Add(0.365540323849504); stdDevsOnPayment.Add(0.308024420802767); - strikes.Add(0.04); stdDevsOnExpiry.Add(0.35570564032638); stdDevsOnPayment.Add(0.30269822405978); - strikes.Add(0.041); stdDevsOnExpiry.Add(0.346572982443814); stdDevsOnPayment.Add(0.297710321981251); - strikes.Add(0.042); stdDevsOnExpiry.Add(0.338091753759242); stdDevsOnPayment.Add(0.293025394530372); - strikes.Add(0.043); stdDevsOnExpiry.Add(0.330211357830103); stdDevsOnPayment.Add(0.288612334151791); - strikes.Add(0.044); stdDevsOnExpiry.Add(0.322881198213832); stdDevsOnPayment.Add(0.284443273660505); - strikes.Add(0.045); stdDevsOnExpiry.Add(0.316056686795423); stdDevsOnPayment.Add(0.280494558352965); - strikes.Add(0.046); stdDevsOnExpiry.Add(0.309691654321036); stdDevsOnPayment.Add(0.276744153710797); - strikes.Add(0.047); stdDevsOnExpiry.Add(0.303745307408855); stdDevsOnPayment.Add(0.273174237697079); - strikes.Add(0.048); stdDevsOnExpiry.Add(0.298180014954725); stdDevsOnPayment.Add(0.269767960385995); - strikes.Add(0.049); stdDevsOnExpiry.Add(0.292961308132149); stdDevsOnPayment.Add(0.266511064148011); - strikes.Add(0.05); stdDevsOnExpiry.Add(0.288057880392292); stdDevsOnPayment.Add(0.263391235575797); - strikes.Add(0.051); stdDevsOnExpiry.Add(0.283441587463978); stdDevsOnPayment.Add(0.260399077595342); - strikes.Add(0.052); stdDevsOnExpiry.Add(0.279088079809224); stdDevsOnPayment.Add(0.257518712391935); - strikes.Add(0.053); stdDevsOnExpiry.Add(0.274968896929089); stdDevsOnPayment.Add(0.254747223632261); - strikes.Add(0.054); stdDevsOnExpiry.Add(0.271067594979739); stdDevsOnPayment.Add(0.252074566168237); - strikes.Add(0.055); stdDevsOnExpiry.Add(0.267364567839682); stdDevsOnPayment.Add(0.249494259259166); - strikes.Add(0.056); stdDevsOnExpiry.Add(0.263842422981787); stdDevsOnPayment.Add(0.246999498127314); - strikes.Add(0.057); stdDevsOnExpiry.Add(0.26048629770105); stdDevsOnPayment.Add(0.244584774143087); - strikes.Add(0.058); stdDevsOnExpiry.Add(0.257282594203533); stdDevsOnPayment.Add(0.242244902713927); - strikes.Add(0.059); stdDevsOnExpiry.Add(0.254218979606362); stdDevsOnPayment.Add(0.23997567135838); - strikes.Add(0.06); stdDevsOnExpiry.Add(0.251284385937726); stdDevsOnPayment.Add(0.237772543557956); - strikes.Add(0.061); stdDevsOnExpiry.Add(0.248469326364644); stdDevsOnPayment.Add(0.235632278942307); - strikes.Add(0.062); stdDevsOnExpiry.Add(0.245764630281902); stdDevsOnPayment.Add(0.233550665029978); - strikes.Add(0.063); stdDevsOnExpiry.Add(0.243162391995349); stdDevsOnPayment.Add(0.231525109524691); - strikes.Add(0.064); stdDevsOnExpiry.Add(0.240655338266368); stdDevsOnPayment.Add(0.22955269609313); - strikes.Add(0.065); stdDevsOnExpiry.Add(0.238237144539637); stdDevsOnPayment.Add(0.227630508401982); - strikes.Add(0.066); stdDevsOnExpiry.Add(0.235901802487603); stdDevsOnPayment.Add(0.225756278192003); - strikes.Add(0.067); stdDevsOnExpiry.Add(0.233643936238243); stdDevsOnPayment.Add(0.223927413166912); - strikes.Add(0.068); stdDevsOnExpiry.Add(0.2314584861473); stdDevsOnPayment.Add(0.222142617178571); - strikes.Add(0.069); stdDevsOnExpiry.Add(0.229341341253818); stdDevsOnPayment.Add(0.220398973893664); - strikes.Add(0.07); stdDevsOnExpiry.Add(0.22728807436907); stdDevsOnPayment.Add(0.218695187164053); - strikes.Add(0.071); stdDevsOnExpiry.Add(0.225295206987632); stdDevsOnPayment.Add(0.217029636804562); - strikes.Add(0.072); stdDevsOnExpiry.Add(0.223359576831843); stdDevsOnPayment.Add(0.215400702630017); - strikes.Add(0.073); stdDevsOnExpiry.Add(0.221477389168511); stdDevsOnPayment.Add(0.213806764455244); - strikes.Add(0.074); stdDevsOnExpiry.Add(0.219646430403273); stdDevsOnPayment.Add(0.212246202095067); - strikes.Add(0.075); stdDevsOnExpiry.Add(0.21786353825847); stdDevsOnPayment.Add(0.210718367475417); - strikes.Add(0.076); stdDevsOnExpiry.Add(0.21612649913974); stdDevsOnPayment.Add(0.20922164041112); - strikes.Add(0.077); stdDevsOnExpiry.Add(0.214433415680486); stdDevsOnPayment.Add(0.20775504879107); - strikes.Add(0.078); stdDevsOnExpiry.Add(0.212781441830814); stdDevsOnPayment.Add(0.206317296467129); - strikes.Add(0.079); stdDevsOnExpiry.Add(0.21116931267966); stdDevsOnPayment.Add(0.20490741132819); - strikes.Add(0.08); stdDevsOnExpiry.Add(0.209594814632662); stdDevsOnPayment.Add(0.203524745300185); - strikes.Add(0.081); stdDevsOnExpiry.Add(0.20805636655099); stdDevsOnPayment.Add(0.202168002234973); - strikes.Add(0.082); stdDevsOnExpiry.Add(0.20655270352358); stdDevsOnPayment.Add(0.20083621002145); - strikes.Add(0.083); stdDevsOnExpiry.Add(0.20508161195607); stdDevsOnPayment.Add(0.199529044622581); - strikes.Add(0.084); stdDevsOnExpiry.Add(0.203642775620693); stdDevsOnPayment.Add(0.198245209890227); - strikes.Add(0.085); stdDevsOnExpiry.Add(0.202233980923088); stdDevsOnPayment.Add(0.196984381787351); - strikes.Add(0.086); stdDevsOnExpiry.Add(0.200854279179957); stdDevsOnPayment.Add(0.195745912239886); - strikes.Add(0.087); stdDevsOnExpiry.Add(0.199503037935767); stdDevsOnPayment.Add(0.19452850509969); - strikes.Add(0.088); stdDevsOnExpiry.Add(0.198178676051688); stdDevsOnPayment.Add(0.193332160366764); - strikes.Add(0.089); stdDevsOnExpiry.Add(0.196880244844423); stdDevsOnPayment.Add(0.192155905930003); - strikes.Add(0.09); stdDevsOnExpiry.Add(0.195606795630673); stdDevsOnPayment.Add(0.190999417752372); - strikes.Add(0.091); stdDevsOnExpiry.Add(0.194357695954907); stdDevsOnPayment.Add(0.189861723722766); - strikes.Add(0.092); stdDevsOnExpiry.Add(0.19313168090606); stdDevsOnPayment.Add(0.188742823841186); - strikes.Add(0.093); stdDevsOnExpiry.Add(0.191928434256365); stdDevsOnPayment.Add(0.187641745996527); - strikes.Add(0.094); stdDevsOnExpiry.Add(0.190746691094761); stdDevsOnPayment.Add(0.186558166151753); - strikes.Add(0.095); stdDevsOnExpiry.Add(0.189586451421245); stdDevsOnPayment.Add(0.185491436232795); - strikes.Add(0.096); stdDevsOnExpiry.Add(0.188446134096988); stdDevsOnPayment.Add(0.184441556239653); - strikes.Add(0.097); stdDevsOnExpiry.Add(0.18732573912199); stdDevsOnPayment.Add(0.183407878098257); - strikes.Add(0.098); stdDevsOnExpiry.Add(0.186224317812954); stdDevsOnPayment.Add(0.182390725845642); - strikes.Add(0.099); stdDevsOnExpiry.Add(0.185141553942112); stdDevsOnPayment.Add(0.181386859111458); - strikes.Add(0.1); stdDevsOnExpiry.Add(0.184076498826167); stdDevsOnPayment.Add(0.180399194229021); - strikes.Add(0.101); stdDevsOnExpiry.Add(0.18302915246512); stdDevsOnPayment.Add(0.17942643505019); - strikes.Add(0.102); stdDevsOnExpiry.Add(0.181999514858969); stdDevsOnPayment.Add(0.178466637352756); - strikes.Add(0.103); stdDevsOnExpiry.Add(0.180984739957821); stdDevsOnPayment.Add(0.177521421321893); - strikes.Add(0.104); stdDevsOnExpiry.Add(0.179986725128272); stdDevsOnPayment.Add(0.176590462920567); - strikes.Add(0.105); stdDevsOnExpiry.Add(0.179004521687023); stdDevsOnPayment.Add(0.175677650593196); - strikes.Add(0.106); stdDevsOnExpiry.Add(0.178041924367268); stdDevsOnPayment.Add(0.17476516230286); - strikes.Add(0.107); stdDevsOnExpiry.Add(0.177083754236237); stdDevsOnPayment.Add(0.173873088345724); - strikes.Add(0.108); stdDevsOnExpiry.Add(0.176145822682231); stdDevsOnPayment.Add(0.173000456610684); - strikes.Add(0.109); stdDevsOnExpiry.Add(0.175227181021952); stdDevsOnPayment.Add(0.172122316246049); - strikes.Add(0.11); stdDevsOnExpiry.Add(0.174309488044971); stdDevsOnPayment.Add(0.171266858473859); - strikes.Add(0.111); stdDevsOnExpiry.Add(0.173412982328314); stdDevsOnPayment.Add(0.170434407331149); - strikes.Add(0.112); stdDevsOnExpiry.Add(0.172536715188681); stdDevsOnPayment.Add(0.169585106262623); - strikes.Add(0.113); stdDevsOnExpiry.Add(0.171706301075121); stdDevsOnPayment.Add(0.168765292564274); - strikes.Add(0.114); stdDevsOnExpiry.Add(0.17079651379229); stdDevsOnPayment.Add(0.167976586421278); - strikes.Add(0.115); stdDevsOnExpiry.Add(0.169963569856602); stdDevsOnPayment.Add(0.167267917425907); - strikes.Add(0.116); stdDevsOnExpiry.Add(0.169192922790819); stdDevsOnPayment.Add(0.166364178135514); - strikes.Add(0.117); stdDevsOnExpiry.Add(0.168289776291075); stdDevsOnPayment.Add(0.165629586177349); - strikes.Add(0.118); stdDevsOnExpiry.Add(0.167505847659119); stdDevsOnPayment.Add(0.165014239848036); - strikes.Add(0.119); stdDevsOnExpiry.Add(0.166813308851542); stdDevsOnPayment.Add(0.164618590628398); - strikes.Add(0.12); stdDevsOnExpiry.Add(0.166305130831553); stdDevsOnPayment.Add(0.164530452554899); - strikes.Add(0.121); stdDevsOnExpiry.Add(0.166077130612255); stdDevsOnPayment.Add(0.162925173083904); - strikes.Add(0.122); stdDevsOnExpiry.Add(0.164586116695486); stdDevsOnPayment.Add(0.162717141307485); - strikes.Add(0.123); stdDevsOnExpiry.Add(0.164242693341591); stdDevsOnPayment.Add(0.162840275380755); - strikes.Add(0.124); stdDevsOnExpiry.Add(0.164213284159352); stdDevsOnPayment.Add(0.163289714748189); - strikes.Add(0.125); stdDevsOnExpiry.Add(0.164516546586962); stdDevsOnPayment.Add(0.16401944615083); - strikes.Add(0.126); stdDevsOnExpiry.Add(0.165118644253458); stdDevsOnPayment.Add(0.164961421811344); - strikes.Add(0.127); stdDevsOnExpiry.Add(0.165959810111063); stdDevsOnPayment.Add(0.166058935248619); - strikes.Add(0.128); stdDevsOnExpiry.Add(0.166976798606573); stdDevsOnPayment.Add(0.16725625209265); - strikes.Add(0.129); stdDevsOnExpiry.Add(0.168115851019766); stdDevsOnPayment.Add(0.16851675615849); - strikes.Add(0.13); stdDevsOnExpiry.Add(0.169332063007866); stdDevsOnPayment.Add(0.16981808889073); - strikes.Add(0.131); stdDevsOnExpiry.Add(0.170600136349594); stdDevsOnPayment.Add(0.171139511919136); - strikes.Add(0.132); stdDevsOnExpiry.Add(0.171891926773773); stdDevsOnPayment.Add(0.172468711836379); - strikes.Add(0.133); stdDevsOnExpiry.Add(0.173201742180614); stdDevsOnPayment.Add(0.173801476161007); - strikes.Add(0.134); stdDevsOnExpiry.Add(0.17451282249852); stdDevsOnPayment.Add(0.175129703967145); - strikes.Add(0.135); stdDevsOnExpiry.Add(0.175823902816426); stdDevsOnPayment.Add(0.17645371929183); - strikes.Add(0.136); stdDevsOnExpiry.Add(0.177132453312204); stdDevsOnPayment.Add(0.177767365431397); - strikes.Add(0.137); stdDevsOnExpiry.Add(0.178433098113831); stdDevsOnPayment.Add(0.179076475052476); - strikes.Add(0.138); stdDevsOnExpiry.Add(0.17972646967684); stdDevsOnPayment.Add(0.180372947229192); - strikes.Add(0.139); stdDevsOnExpiry.Add(0.181011935545698); stdDevsOnPayment.Add(0.181660994443001); - strikes.Add(0.14); stdDevsOnExpiry.Add(0.182286965898278); stdDevsOnPayment.Add(0.182938996508727); - strikes.Add(0.141); stdDevsOnExpiry.Add(0.18355314187341); stdDevsOnPayment.Add(0.18420889764858); - strikes.Add(0.142); stdDevsOnExpiry.Add(0.184810147243326); stdDevsOnPayment.Add(0.185468105566281); - strikes.Add(0.143); stdDevsOnExpiry.Add(0.186056717096965); stdDevsOnPayment.Add(0.186718888521073); - strikes.Add(0.144); stdDevsOnExpiry.Add(0.187295381256453); stdDevsOnPayment.Add(0.187958006142609); - strikes.Add(0.145); stdDevsOnExpiry.Add(0.188523609899662); stdDevsOnPayment.Add(0.189190318986411); - strikes.Add(0.146); stdDevsOnExpiry.Add(0.189745197759785); stdDevsOnPayment.Add(0.190412586682131); - strikes.Add(0.147); stdDevsOnExpiry.Add(0.190955085192566); stdDevsOnPayment.Add(0.191624809229768); - strikes.Add(0.148); stdDevsOnExpiry.Add(0.186502914474815); stdDevsOnPayment.Add(0.192830226999672); - strikes.Add(0.149); stdDevsOnExpiry.Add(0.187658094504074); stdDevsOnPayment.Add(0.194024951547423); - strikes.Add(0.15); stdDevsOnExpiry.Add(0.188817069266526); stdDevsOnPayment.Add(0.195212547280407); - strikes.Add(0.151); stdDevsOnExpiry.Add(0.189958019046315); stdDevsOnPayment.Add(0.196391394013447); - strikes.Add(0.152); stdDevsOnExpiry.Add(0.191090746904187); stdDevsOnPayment.Add(0.197560195598405); - strikes.Add(0.153); stdDevsOnExpiry.Add(0.192215885295675); stdDevsOnPayment.Add(0.19871895203528); - strikes.Add(0.154); stdDevsOnExpiry.Add(0.193335331587374); stdDevsOnPayment.Add(0.199872523879597); - strikes.Add(0.155); stdDevsOnExpiry.Add(0.194446555957158); stdDevsOnPayment.Add(0.195112095799581); - strikes.Add(0.156); stdDevsOnExpiry.Add(0.195547028582896); stdDevsOnPayment.Add(0.196220302459009); - strikes.Add(0.157); stdDevsOnExpiry.Add(0.196646236297571); stdDevsOnPayment.Add(0.197317167822215); - strikes.Add(0.158); stdDevsOnExpiry.Add(0.197736589634797); stdDevsOnPayment.Add(0.198405608222512); - strikes.Add(0.159); stdDevsOnExpiry.Add(0.198811131583722); stdDevsOnPayment.Add(0.19949340054874); - strikes.Add(0.16); stdDevsOnExpiry.Add(0.199887570899243); stdDevsOnPayment.Add(0.200565963134326); - strikes.Add(0.161); stdDevsOnExpiry.Add(0.20095167733189); stdDevsOnPayment.Add(0.201636905534738); - strikes.Add(0.162); stdDevsOnExpiry.Add(0.20200756184262); stdDevsOnPayment.Add(0.202695534527823); - strikes.Add(0.163); stdDevsOnExpiry.Add(0.203061232758988); stdDevsOnPayment.Add(0.203753839483873); - strikes.Add(0.164); stdDevsOnExpiry.Add(0.204112690080994); stdDevsOnPayment.Add(0.204791730106723); - strikes.Add(0.165); stdDevsOnExpiry.Add(0.205146754875869); stdDevsOnPayment.Add(0.205839341840621); - strikes.Add(0.166); stdDevsOnExpiry.Add(0.206178289848616); stdDevsOnPayment.Add(0.206869779611668); - strikes.Add(0.167); stdDevsOnExpiry.Add(0.207207294999235); stdDevsOnPayment.Add(0.207893412604981); - strikes.Add(0.168); stdDevsOnExpiry.Add(0.208224599722511); stdDevsOnPayment.Add(0.208916397524225); - strikes.Add(0.169); stdDevsOnExpiry.Add(0.209234947434935); stdDevsOnPayment.Add(0.209924476739862); - strikes.Add(0.17); stdDevsOnExpiry.Add(0.210235175858846); stdDevsOnPayment.Add(0.210934824214744); - strikes.Add(0.171); stdDevsOnExpiry.Add(0.211231609549565); stdDevsOnPayment.Add(0.211933506356369); - strikes.Add(0.172); stdDevsOnExpiry.Add(0.212231205517945); stdDevsOnPayment.Add(0.212931216386889); - strikes.Add(0.173); stdDevsOnExpiry.Add(0.213219101058981); stdDevsOnPayment.Add(0.213916613010082); - strikes.Add(0.174); stdDevsOnExpiry.Add(0.214192133895015); stdDevsOnPayment.Add(0.2149003894481); - strikes.Add(0.175); stdDevsOnExpiry.Add(0.215167064097645); stdDevsOnPayment.Add(0.215876064960245); - strikes.Add(0.176); stdDevsOnExpiry.Add(0.216146105261233); stdDevsOnPayment.Add(0.216845259731692); - strikes.Add(0.177); stdDevsOnExpiry.Add(0.217099215748008); stdDevsOnPayment.Add(0.217806029540231); - strikes.Add(0.178); stdDevsOnExpiry.Add(0.218056437195741); stdDevsOnPayment.Add(0.218763558978421); - strikes.Add(0.179); stdDevsOnExpiry.Add(0.219005120493791); stdDevsOnPayment.Add(0.219722060527715); - strikes.Add(0.18); stdDevsOnExpiry.Add(0.219951273969714); stdDevsOnPayment.Add(0.220671489040032); - strikes.Add(0.181); stdDevsOnExpiry.Add(0.220885410790527); stdDevsOnPayment.Add(0.221608280107987); - strikes.Add(0.182); stdDevsOnExpiry.Add(0.221831248038684); stdDevsOnPayment.Add(0.222542154842628); - strikes.Add(0.183); stdDevsOnExpiry.Add(0.222757162937581); stdDevsOnPayment.Add(0.223469224799535); - strikes.Add(0.184); stdDevsOnExpiry.Add(0.223673907231264); stdDevsOnPayment.Add(0.224396942830512); - strikes.Add(0.185); stdDevsOnExpiry.Add(0.224599189674629); stdDevsOnPayment.Add(0.225315911861546); - strikes.Add(0.186); stdDevsOnExpiry.Add(0.225503601085437); stdDevsOnPayment.Add(0.226230992448161); - strikes.Add(0.187); stdDevsOnExpiry.Add(0.226412755912736); stdDevsOnPayment.Add(0.227133759627449); - strikes.Add(0.188); stdDevsOnExpiry.Add(0.227313372590352); stdDevsOnPayment.Add(0.228049488288135); - strikes.Add(0.189); stdDevsOnExpiry.Add(0.228216519090096); stdDevsOnPayment.Add(0.228941886282305); - strikes.Add(0.19); stdDevsOnExpiry.Add(0.229108597618029); stdDevsOnPayment.Add(0.229833312165371); - strikes.Add(0.191); stdDevsOnExpiry.Add(0.229988343263088); stdDevsOnPayment.Add(0.230724738048437); - strikes.Add(0.192); stdDevsOnExpiry.Add(0.230883267840916); stdDevsOnPayment.Add(0.231599638042722); - strikes.Add(0.193); stdDevsOnExpiry.Add(0.231748467008738); stdDevsOnPayment.Add(0.232481018777706); - strikes.Add(0.194); stdDevsOnExpiry.Add(0.232617460909752); stdDevsOnPayment.Add(0.233360131253445); - strikes.Add(0.195); stdDevsOnExpiry.Add(0.233487087266298); stdDevsOnPayment.Add(0.234224662062612); - strikes.Add(0.196); stdDevsOnExpiry.Add(0.234348491700928); stdDevsOnPayment.Add(0.235093405353234); - strikes.Add(0.197); stdDevsOnExpiry.Add(0.2352057851746); stdDevsOnPayment.Add(0.235946918903214); - strikes.Add(0.198); stdDevsOnExpiry.Add(0.236064976014868); stdDevsOnPayment.Add(0.236808209342033); - strikes.Add(0.199); stdDevsOnExpiry.Add(0.236907723011302); stdDevsOnPayment.Add(0.237655242151315); - strikes.Add(0.2); stdDevsOnExpiry.Add(0.237747940185609); stdDevsOnPayment.Add(0.238496766331003); - strikes.Add(0.201); stdDevsOnExpiry.Add(0.238590687182044); stdDevsOnPayment.Add(0.239337318399586); - strikes.Add(0.202); stdDevsOnExpiry.Add(0.239419203929008); stdDevsOnPayment.Add(0.24017916661631); - strikes.Add(0.203); stdDevsOnExpiry.Add(0.240250882953632); stdDevsOnPayment.Add(0.241003840870182); - strikes.Add(0.204); stdDevsOnExpiry.Add(0.241075604967404); stdDevsOnPayment.Add(0.241832727605508); - strikes.Add(0.205); stdDevsOnExpiry.Add(0.24190317303107); stdDevsOnPayment.Add(0.242654809563101); - strikes.Add(0.206); stdDevsOnExpiry.Add(0.24272251917282); stdDevsOnPayment.Add(0.243478511705869); - strikes.Add(0.207); stdDevsOnExpiry.Add(0.243530164887227); stdDevsOnPayment.Add(0.244289576404275); - strikes.Add(0.208); stdDevsOnExpiry.Add(0.24434287024589); stdDevsOnPayment.Add(0.245096752658261); - strikes.Add(0.209); stdDevsOnExpiry.Add(0.245145772543807); stdDevsOnPayment.Add(0.245903280838178); - strikes.Add(0.21); stdDevsOnExpiry.Add(0.245951204663852); stdDevsOnPayment.Add(0.246714021499549); - strikes.Add(0.211); stdDevsOnExpiry.Add(0.246737030662404); stdDevsOnPayment.Add(0.247507912235104); - strikes.Add(0.212); stdDevsOnExpiry.Add(0.247526967621914); stdDevsOnPayment.Add(0.248306663526183); - strikes.Add(0.213); stdDevsOnExpiry.Add(0.24831563967036); stdDevsOnPayment.Add(0.2490927773729); - strikes.Add(0.214); stdDevsOnExpiry.Add(0.249111584957424); stdDevsOnPayment.Add(0.249878243145547); - strikes.Add(0.215); stdDevsOnExpiry.Add(0.249880650884377); stdDevsOnPayment.Add(0.250649127251622); - strikes.Add(0.216); stdDevsOnExpiry.Add(0.250656357594417); stdDevsOnPayment.Add(0.251433620913165); - strikes.Add(0.217); stdDevsOnExpiry.Add(0.251434594126584); stdDevsOnPayment.Add(0.25220580116738); - strikes.Add(0.218); stdDevsOnExpiry.Add(0.252199549092579); stdDevsOnPayment.Add(0.252970852606827); - strikes.Add(0.219); stdDevsOnExpiry.Add(0.252961025553147); stdDevsOnPayment.Add(0.253737200194414); - strikes.Add(0.22); stdDevsOnExpiry.Add(0.253727877885738); stdDevsOnPayment.Add(0.254501279522756); - strikes.Add(0.221); stdDevsOnExpiry.Add(0.254480499968858); stdDevsOnPayment.Add(0.255269571332552); - strikes.Add(0.222); stdDevsOnExpiry.Add(0.25523533564634); stdDevsOnPayment.Add(0.256016476698044); - strikes.Add(0.223); stdDevsOnExpiry.Add(0.255984162996268); stdDevsOnPayment.Add(0.256770834915338); - strikes.Add(0.224); stdDevsOnExpiry.Add(0.25673583639609); stdDevsOnPayment.Add(0.257510611466062); - strikes.Add(0.225); stdDevsOnExpiry.Add(0.257477706735166); stdDevsOnPayment.Add(0.258255572609344); - strikes.Add(0.226); stdDevsOnExpiry.Add(0.258220525757539); stdDevsOnPayment.Add(0.25900280201187); - strikes.Add(0.227); stdDevsOnExpiry.Add(0.258953541719166); stdDevsOnPayment.Add(0.259739986266314); - strikes.Add(0.228); stdDevsOnExpiry.Add(0.259691301097284); stdDevsOnPayment.Add(0.260471337854129); - strikes.Add(0.229); stdDevsOnExpiry.Add(0.260414197770398); stdDevsOnPayment.Add(0.26120171733084); - strikes.Add(0.23); stdDevsOnExpiry.Add(0.261138359354577); stdDevsOnPayment.Add(0.26193598525197); - strikes.Add(0.231); stdDevsOnExpiry.Add(0.261857461294499); stdDevsOnPayment.Add(0.262664096469436); - strikes.Add(0.232); stdDevsOnExpiry.Add(0.262581939106444); stdDevsOnPayment.Add(0.263373413538876); - strikes.Add(0.233); stdDevsOnExpiry.Add(0.263292502896683); stdDevsOnPayment.Add(0.264094071904539); - strikes.Add(0.234); stdDevsOnExpiry.Add(0.264006545192349); stdDevsOnPayment.Add(0.26480533319619); - strikes.Add(0.235); stdDevsOnExpiry.Add(0.264707305921843); stdDevsOnPayment.Add(0.265520482932259); - strikes.Add(0.236); stdDevsOnExpiry.Add(0.265417869712082); stdDevsOnPayment.Add(0.266215866409198); - strikes.Add(0.237); stdDevsOnExpiry.Add(0.266128433502322); stdDevsOnPayment.Add(0.266921619071255); - strikes.Add(0.238); stdDevsOnExpiry.Add(0.266818442487771); stdDevsOnPayment.Add(0.267621215029648); - strikes.Add(0.239); stdDevsOnExpiry.Add(0.267506237878858); stdDevsOnPayment.Add(0.268319190802866); - strikes.Add(0.24); stdDevsOnExpiry.Add(0.268213955619203); stdDevsOnPayment.Add(0.269024295390853); - strikes.Add(0.241); stdDevsOnExpiry.Add(0.268901118554758); stdDevsOnPayment.Add(0.269714494275234); - strikes.Add(0.242); stdDevsOnExpiry.Add(0.269581956934992); stdDevsOnPayment.Add(0.270383630752344); - strikes.Add(0.243); stdDevsOnExpiry.Add(0.270257103215438); stdDevsOnPayment.Add(0.271079662303353); - strikes.Add(0.244); stdDevsOnExpiry.Add(0.270943317467695); stdDevsOnPayment.Add(0.271764028521105); - strikes.Add(0.245); stdDevsOnExpiry.Add(0.271623207164631); stdDevsOnPayment.Add(0.272445154368508); - strikes.Add(0.246); stdDevsOnExpiry.Add(0.272295191167417); stdDevsOnPayment.Add(0.273122067734456); - strikes.Add(0.247); stdDevsOnExpiry.Add(0.272981721647439); stdDevsOnPayment.Add(0.273801573396684); - strikes.Add(0.248); stdDevsOnExpiry.Add(0.2736334670732); stdDevsOnPayment.Add(0.274467145466411); - strikes.Add(0.249); stdDevsOnExpiry.Add(0.274298494065133); stdDevsOnPayment.Add(0.275112951277007); - strikes.Add(0.25); stdDevsOnExpiry.Add(0.274975221484409); stdDevsOnPayment.Add(0.275792456939235); - strikes.Add(0.251); stdDevsOnExpiry.Add(0.275627599365702); stdDevsOnPayment.Add(0.276450252120124); - strikes.Add(0.252); stdDevsOnExpiry.Add(0.276287250485613); stdDevsOnPayment.Add(0.277106427115838); - strikes.Add(0.253); stdDevsOnExpiry.Add(0.27693614986148); stdDevsOnPayment.Add(0.277760009815272); - strikes.Add(0.254); stdDevsOnExpiry.Add(0.277595168525859); stdDevsOnPayment.Add(0.278409055996218); - strikes.Add(0.255); stdDevsOnExpiry.Add(0.278247230179386); stdDevsOnPayment.Add(0.279076248251119); - strikes.Add(0.256); stdDevsOnExpiry.Add(0.27889233482206); stdDevsOnPayment.Add(0.27972043387654); - strikes.Add(0.257); stdDevsOnExpiry.Add(0.279533328503776); stdDevsOnPayment.Add(0.280366887761207); - strikes.Add(0.258); stdDevsOnExpiry.Add(0.280163886669214); stdDevsOnPayment.Add(0.281011073386628); - strikes.Add(0.259); stdDevsOnExpiry.Add(0.280801401845504); stdDevsOnPayment.Add(0.281636464864025); - strikes.Add(0.26); stdDevsOnExpiry.Add(0.281444609121582); stdDevsOnPayment.Add(0.282278058193167); - strikes.Add(0.261); stdDevsOnExpiry.Add(0.282062518176379); stdDevsOnPayment.Add(0.2829177073001); - strikes.Add(0.262); stdDevsOnExpiry.Add(0.282703195630329); stdDevsOnPayment.Add(0.28354990355523); - strikes.Add(0.263); stdDevsOnExpiry.Add(0.283321420912892); stdDevsOnPayment.Add(0.284173026773382); - strikes.Add(0.264); stdDevsOnExpiry.Add(0.283962098366842); stdDevsOnPayment.Add(0.284814296065489); - strikes.Add(0.265); stdDevsOnExpiry.Add(0.284589810482385); stdDevsOnPayment.Add(0.285413116506022); - strikes.Add(0.266); stdDevsOnExpiry.Add(0.285200130070798); stdDevsOnPayment.Add(0.286036563761209); - strikes.Add(0.267); stdDevsOnExpiry.Add(0.285821833858787); stdDevsOnPayment.Add(0.286665843683024); - strikes.Add(0.268); stdDevsOnExpiry.Add(0.286418239425495); stdDevsOnPayment.Add(0.287277625604954); - strikes.Add(0.269); stdDevsOnExpiry.Add(0.287055438374019); stdDevsOnPayment.Add(0.28788454697136); - strikes.Add(0.27); stdDevsOnExpiry.Add(0.287650895257428); stdDevsOnPayment.Add(0.288504105782127); - strikes.Add(0.271); stdDevsOnExpiry.Add(0.288259001251479); stdDevsOnPayment.Add(0.289124960741035); - strikes.Add(0.272); stdDevsOnExpiry.Add(0.288866474789997); stdDevsOnPayment.Add(0.289720216774184); - strikes.Add(0.273); stdDevsOnExpiry.Add(0.289457504484683); stdDevsOnPayment.Add(0.29032389777024); - strikes.Add(0.274); stdDevsOnExpiry.Add(0.290065294250967); stdDevsOnPayment.Add(0.290925958581123); - strikes.Add(0.275); stdDevsOnExpiry.Add(0.290661383589909); stdDevsOnPayment.Add(0.291521538651306); - strikes.Add(0.276); stdDevsOnExpiry.Add(0.291270122039491); stdDevsOnPayment.Add(0.292117442758525); - strikes.Add(0.277); stdDevsOnExpiry.Add(0.291862732873007); stdDevsOnPayment.Add(0.292714643013883); - strikes.Add(0.278); stdDevsOnExpiry.Add(0.292448070467904); stdDevsOnPayment.Add(0.293307306750752); - strikes.Add(0.279); stdDevsOnExpiry.Add(0.293031826923971); stdDevsOnPayment.Add(0.293893489746923); - strikes.Add(0.28); stdDevsOnExpiry.Add(0.293630129857275); stdDevsOnPayment.Add(0.294490365965247); - strikes.Add(0.281); stdDevsOnExpiry.Add(0.294205348163659); stdDevsOnPayment.Add(0.295054514443043); - strikes.Add(0.282); stdDevsOnExpiry.Add(0.294780250242278); stdDevsOnPayment.Add(0.295640697439214); - strikes.Add(0.283); stdDevsOnExpiry.Add(0.295369066342601); stdDevsOnPayment.Add(0.296229796768699); - strikes.Add(0.284); stdDevsOnExpiry.Add(0.295941122371326); stdDevsOnPayment.Add(0.296821812431499); - strikes.Add(0.285); stdDevsOnExpiry.Add(0.296506537616964); stdDevsOnPayment.Add(0.297392117612959); - strikes.Add(0.286); stdDevsOnExpiry.Add(0.297095986172819); stdDevsOnPayment.Add(0.297958858387035); - strikes.Add(0.287); stdDevsOnExpiry.Add(0.297663931240585); stdDevsOnPayment.Add(0.298539532753612); - strikes.Add(0.288); stdDevsOnExpiry.Add(0.298226500436329); stdDevsOnPayment.Add(0.299106597564723); - strikes.Add(0.289); stdDevsOnExpiry.Add(0.298813735397823); stdDevsOnPayment.Add(0.299686299820195); - strikes.Add(0.29); stdDevsOnExpiry.Add(0.299351322600051); stdDevsOnPayment.Add(0.3002384589277); - strikes.Add(0.291); stdDevsOnExpiry.Add(0.299931284322926); stdDevsOnPayment.Add(0.300800663183287); - strikes.Add(0.292); stdDevsOnExpiry.Add(0.300491639924308); stdDevsOnPayment.Add(0.301358978994454); - strikes.Add(0.293); stdDevsOnExpiry.Add(0.30104408983154); stdDevsOnPayment.Add(0.30192507169446); - strikes.Add(0.294); stdDevsOnExpiry.Add(0.30161646208803); stdDevsOnPayment.Add(0.30247496254272); - strikes.Add(0.295); stdDevsOnExpiry.Add(0.302157527795685); stdDevsOnPayment.Add(0.303038462946447); - strikes.Add(0.296); stdDevsOnExpiry.Add(0.302717883397067); stdDevsOnPayment.Add(0.303587057646567); - strikes.Add(0.297); stdDevsOnExpiry.Add(0.303255786827061); stdDevsOnPayment.Add(0.304149261902154); - strikes.Add(0.298); stdDevsOnExpiry.Add(0.303781989829713); stdDevsOnPayment.Add(0.304700124861519); - strikes.Add(0.299); stdDevsOnExpiry.Add(0.304330645003752); stdDevsOnPayment.Add(0.305239646524661); - strikes.Add(0.3); stdDevsOnExpiry.Add(0.304881197544388); stdDevsOnPayment.Add(0.305780140298908); - strikes.Add(0.301); stdDevsOnExpiry.Add(0.305453569800878); stdDevsOnPayment.Add(0.306327114813854); - strikes.Add(0.302); stdDevsOnExpiry.Add(0.305970602198316); stdDevsOnPayment.Add(0.306869876847346); - strikes.Add(0.303); stdDevsOnExpiry.Add(0.306495540289904); stdDevsOnPayment.Add(0.307408102362348); - strikes.Add(0.304); stdDevsOnExpiry.Add(0.307054947207988); stdDevsOnPayment.Add(0.307955400914329); - strikes.Add(0.305); stdDevsOnExpiry.Add(0.307578936616277); stdDevsOnPayment.Add(0.308478072651655); - strikes.Add(0.306); stdDevsOnExpiry.Add(0.308105139618929); stdDevsOnPayment.Add(0.30902828753695); - strikes.Add(0.307); stdDevsOnExpiry.Add(0.308639564543498); stdDevsOnPayment.Add(0.309550959274277); - strikes.Add(0.308); stdDevsOnExpiry.Add(0.30916892982381); stdDevsOnPayment.Add(0.310072982937534); - strikes.Add(0.309); stdDevsOnExpiry.Add(0.309708414392635); stdDevsOnPayment.Add(0.310612504600676); - strikes.Add(0.31); stdDevsOnExpiry.Add(0.310226711701136); stdDevsOnPayment.Add(0.311149433967539); - strikes.Add(0.311); stdDevsOnExpiry.Add(0.310757025664747); stdDevsOnPayment.Add(0.311663356704923); - strikes.Add(0.312); stdDevsOnExpiry.Add(0.311267733506864); stdDevsOnPayment.Add(0.312172742923818); - strikes.Add(0.313); stdDevsOnExpiry.Add(0.31179520142058); stdDevsOnPayment.Add(0.312693470438935); - strikes.Add(0.314); stdDevsOnExpiry.Add(0.312293892607588); stdDevsOnPayment.Add(0.313225215213239); - strikes.Add(0.315); stdDevsOnExpiry.Add(0.312807130271834); stdDevsOnPayment.Add(0.313724880321086); - strikes.Add(0.316); stdDevsOnExpiry.Add(0.313339025374274); stdDevsOnPayment.Add(0.314244311688064); - strikes.Add(0.317); stdDevsOnExpiry.Add(0.313838981472347); stdDevsOnPayment.Add(0.31478739775859); - strikes.Add(0.318); stdDevsOnExpiry.Add(0.314357595008614); stdDevsOnPayment.Add(0.315282202310914); - strikes.Add(0.319); stdDevsOnExpiry.Add(0.314857234878921); stdDevsOnPayment.Add(0.315793208714983); - strikes.Add(0.32); stdDevsOnExpiry.Add(0.315366361582208); stdDevsOnPayment.Add(0.316289633452481); - strikes.Add(0.321); stdDevsOnExpiry.Add(0.315885291346242); stdDevsOnPayment.Add(0.31680258407876); - strikes.Add(0.322); stdDevsOnExpiry.Add(0.316385879899846); stdDevsOnPayment.Add(0.317304193408817); - strikes.Add(0.323); stdDevsOnExpiry.Add(0.316888682047813); stdDevsOnPayment.Add(0.317796729701896); - strikes.Add(0.324); stdDevsOnExpiry.Add(0.317366185974499); stdDevsOnPayment.Add(0.318296394809743); - strikes.Add(0.325); stdDevsOnExpiry.Add(0.317897448621407); stdDevsOnPayment.Add(0.318796059917591); - strikes.Add(0.326); stdDevsOnExpiry.Add(0.318374952548092); stdDevsOnPayment.Add(0.319321972025266); - strikes.Add(0.327); stdDevsOnExpiry.Add(0.318880916973719); stdDevsOnPayment.Add(0.319809971799856); - strikes.Add(0.328); stdDevsOnExpiry.Add(0.319367907733385); stdDevsOnPayment.Add(0.320308988833634); - strikes.Add(0.329); stdDevsOnExpiry.Add(0.319854898493051); stdDevsOnPayment.Add(0.320818051015494); - strikes.Add(0.33); stdDevsOnExpiry.Add(0.320354538363358); stdDevsOnPayment.Add(0.321299570049386); - strikes.Add(0.331); stdDevsOnExpiry.Add(0.320847853678344); stdDevsOnPayment.Add(0.321782061194382); - strikes.Add(0.332); stdDevsOnExpiry.Add(0.321319033049709); stdDevsOnPayment.Add(0.322270709043042); - strikes.Add(0.333); stdDevsOnExpiry.Add(0.321799699254055); stdDevsOnPayment.Add(0.322769726076819); - strikes.Add(0.334); stdDevsOnExpiry.Add(0.322302501402021); stdDevsOnPayment.Add(0.323246384555187); - strikes.Add(0.335); stdDevsOnExpiry.Add(0.322783167606367); stdDevsOnPayment.Add(0.323742809292685); - strikes.Add(0.336); stdDevsOnExpiry.Add(0.323279645199013); stdDevsOnPayment.Add(0.324182851586107); - strikes.Add(0.337); stdDevsOnExpiry.Add(0.323735013182078); stdDevsOnPayment.Add(0.324681868619885); - strikes.Add(0.338); stdDevsOnExpiry.Add(0.324212517108763); stdDevsOnPayment.Add(0.325174404912964); - strikes.Add(0.339); stdDevsOnExpiry.Add(0.324693183313109); stdDevsOnPayment.Add(0.325647498983947); - strikes.Add(0.34); stdDevsOnExpiry.Add(0.325170687239794); stdDevsOnPayment.Add(0.326114112314233); - strikes.Add(0.341); stdDevsOnExpiry.Add(0.325638704333499); stdDevsOnPayment.Add(0.326590446755566); - strikes.Add(0.342); stdDevsOnExpiry.Add(0.326132019648485); stdDevsOnPayment.Add(0.327066781196899); - strikes.Add(0.343); stdDevsOnExpiry.Add(0.326571576243249); stdDevsOnPayment.Add(0.327536634897533); - strikes.Add(0.344); stdDevsOnExpiry.Add(0.327049080169934); stdDevsOnPayment.Add(0.328019450079565); - strikes.Add(0.345); stdDevsOnExpiry.Add(0.327507610430659); stdDevsOnPayment.Add(0.32848606340985); - strikes.Add(0.346); stdDevsOnExpiry.Add(0.327997763467985); stdDevsOnPayment.Add(0.328949436369786); - strikes.Add(0.347); stdDevsOnExpiry.Add(0.328443644618068); stdDevsOnPayment.Add(0.329409568959373); - strikes.Add(0.348); stdDevsOnExpiry.Add(0.328933797655394); stdDevsOnPayment.Add(0.329876182289659); - strikes.Add(0.349); stdDevsOnExpiry.Add(0.329363867417177); stdDevsOnPayment.Add(0.330346035990293); - strikes.Add(0.35); stdDevsOnExpiry.Add(0.329841371343863); stdDevsOnPayment.Add(0.330799687839182); - strikes.Add(0.351); stdDevsOnExpiry.Add(0.330284090216286); stdDevsOnPayment.Add(0.331279262650864); - strikes.Add(0.352); stdDevsOnExpiry.Add(0.330755269587652); stdDevsOnPayment.Add(0.331723193388705); - strikes.Add(0.353); stdDevsOnExpiry.Add(0.331204313015395); stdDevsOnPayment.Add(0.332163883756196); - strikes.Add(0.354); stdDevsOnExpiry.Add(0.331647031887819); stdDevsOnPayment.Add(0.332624016345783); - strikes.Add(0.355); stdDevsOnExpiry.Add(0.332140347202805); stdDevsOnPayment.Add(0.333093870046418); - strikes.Add(0.356); stdDevsOnExpiry.Add(0.332579903797569); stdDevsOnPayment.Add(0.333560483376703); - strikes.Add(0.357); stdDevsOnExpiry.Add(0.333022622669992); stdDevsOnPayment.Add(0.334001173744195); - strikes.Add(0.358); stdDevsOnExpiry.Add(0.333474828375396); stdDevsOnPayment.Add(0.334464546704131); - strikes.Add(0.359); stdDevsOnExpiry.Add(0.33392387180314); stdDevsOnPayment.Add(0.334889035219877); - strikes.Add(0.36); stdDevsOnExpiry.Add(0.334341292454282); stdDevsOnPayment.Add(0.335342687068766); - strikes.Add(0.361); stdDevsOnExpiry.Add(0.334799822715007); stdDevsOnPayment.Add(0.335793098547305); - strikes.Add(0.362); stdDevsOnExpiry.Add(0.335271002086372); stdDevsOnPayment.Add(0.336246750396193); - strikes.Add(0.363); stdDevsOnExpiry.Add(0.335701071848155); stdDevsOnPayment.Add(0.33666799854159); - strikes.Add(0.364); stdDevsOnExpiry.Add(0.336159602108879); stdDevsOnPayment.Add(0.337144332982923); - strikes.Add(0.365); stdDevsOnExpiry.Add(0.336583347315342); stdDevsOnPayment.Add(0.337555860017272); - strikes.Add(0.366); stdDevsOnExpiry.Add(0.336994443411164); stdDevsOnPayment.Add(0.337993310014414); - strikes.Add(0.367); stdDevsOnExpiry.Add(0.337459298227208); stdDevsOnPayment.Add(0.338440481122604); - strikes.Add(0.368); stdDevsOnExpiry.Add(0.337892530266652); stdDevsOnPayment.Add(0.33886496963835); - strikes.Add(0.369); stdDevsOnExpiry.Add(0.338335249139075); stdDevsOnPayment.Add(0.339331582968636); - strikes.Add(0.37); stdDevsOnExpiry.Add(0.338768481178518); stdDevsOnPayment.Add(0.339749590743683); - strikes.Add(0.371); stdDevsOnExpiry.Add(0.339163765886039); stdDevsOnPayment.Add(0.340180560000127); - strikes.Add(0.372); stdDevsOnExpiry.Add(0.339634945257404); stdDevsOnPayment.Add(0.340601808145523); - strikes.Add(0.373); stdDevsOnExpiry.Add(0.340039716797906); stdDevsOnPayment.Add(0.341058700364761); - strikes.Add(0.374); stdDevsOnExpiry.Add(0.34048559794799); stdDevsOnPayment.Add(0.341473467769459); - strikes.Add(0.375); stdDevsOnExpiry.Add(0.340896694043811); stdDevsOnPayment.Add(0.341897956285205); - strikes.Add(0.376); stdDevsOnExpiry.Add(0.341336250638575); stdDevsOnPayment.Add(0.342348367763744); - strikes.Add(0.377); stdDevsOnExpiry.Add(0.341753671289717); stdDevsOnPayment.Add(0.34277285627949); - strikes.Add(0.378); stdDevsOnExpiry.Add(0.34217741649618); stdDevsOnPayment.Add(0.343174662202791); - strikes.Add(0.379); stdDevsOnExpiry.Add(0.342604323980302); stdDevsOnPayment.Add(0.343608871829585); - strikes.Add(0.38); stdDevsOnExpiry.Add(0.343021744631445); stdDevsOnPayment.Add(0.344000956641838); - strikes.Add(0.381); stdDevsOnExpiry.Add(0.343404380228325); stdDevsOnPayment.Add(0.344428685527933); - strikes.Add(0.382); stdDevsOnExpiry.Add(0.343843936823088); stdDevsOnPayment.Add(0.344875856636123); - strikes.Add(0.383); stdDevsOnExpiry.Add(0.344277168862531); stdDevsOnPayment.Add(0.34525822033733); - strikes.Add(0.384); stdDevsOnExpiry.Add(0.344700914068994); stdDevsOnPayment.Add(0.34570215107517); - strikes.Add(0.385); stdDevsOnExpiry.Add(0.345121496997796); stdDevsOnPayment.Add(0.346139601072313); - strikes.Add(0.386); stdDevsOnExpiry.Add(0.345538917648939); stdDevsOnPayment.Add(0.346502522551424); - strikes.Add(0.387); stdDevsOnExpiry.Add(0.345912066412839); stdDevsOnPayment.Add(0.346956174400312); - strikes.Add(0.388); stdDevsOnExpiry.Add(0.346354785285262); stdDevsOnPayment.Add(0.34737418217536); - strikes.Add(0.389); stdDevsOnExpiry.Add(0.346746907715123); stdDevsOnPayment.Add(0.347756545876566); - strikes.Add(0.39); stdDevsOnExpiry.Add(0.347151679255625); stdDevsOnPayment.Add(0.348171313281264); - strikes.Add(0.391); stdDevsOnExpiry.Add(0.347562775351446); stdDevsOnPayment.Add(0.348576359574914); - strikes.Add(0.392); stdDevsOnExpiry.Add(0.347986520557909); stdDevsOnPayment.Add(0.348968444387168); - strikes.Add(0.393); stdDevsOnExpiry.Add(0.348407103486711); stdDevsOnPayment.Add(0.349415615495358); - strikes.Add(0.394); stdDevsOnExpiry.Add(0.348773927695291); stdDevsOnPayment.Add(0.349820661789009); - strikes.Add(0.395); stdDevsOnExpiry.Add(0.349203997457074); stdDevsOnPayment.Add(0.350232188823358); - strikes.Add(0.396); stdDevsOnExpiry.Add(0.349624580385876); stdDevsOnPayment.Add(0.350637235117008); - strikes.Add(0.397); stdDevsOnExpiry.Add(0.349981917761475); stdDevsOnPayment.Add(0.351029319929262); - strikes.Add(0.398); stdDevsOnExpiry.Add(0.350396176134957); stdDevsOnPayment.Add(0.351434366222912); - strikes.Add(0.399); stdDevsOnExpiry.Add(0.350797785397799); stdDevsOnPayment.Add(0.351803768442721); - strikes.Add(0.4); stdDevsOnExpiry.Add(0.351174096439359); stdDevsOnPayment.Add(0.352250939550912); - strikes.Add(0.401); stdDevsOnExpiry.Add(0.351597841645821); stdDevsOnPayment.Add(0.352620341770721); - strikes.Add(0.402); stdDevsOnExpiry.Add(0.351986801798022); stdDevsOnPayment.Add(0.35303186880507); - strikes.Add(0.403); stdDevsOnExpiry.Add(0.352356788284262); stdDevsOnPayment.Add(0.353407751765577); - strikes.Add(0.404); stdDevsOnExpiry.Add(0.352793182601365); stdDevsOnPayment.Add(0.353799836577831); - strikes.Add(0.405); stdDevsOnExpiry.Add(0.353194791864206); stdDevsOnPayment.Add(0.354208123241831); - strikes.Add(0.406); stdDevsOnExpiry.Add(0.353548966962145); stdDevsOnPayment.Add(0.354587246572688); - strikes.Add(0.407); stdDevsOnExpiry.Add(0.353953738502647); stdDevsOnPayment.Add(0.354995533236687); - strikes.Add(0.408); stdDevsOnExpiry.Add(0.354333211821867); stdDevsOnPayment.Add(0.355374656567544); - strikes.Add(0.409); stdDevsOnExpiry.Add(0.354725334251728); stdDevsOnPayment.Add(0.355776462490846); - strikes.Add(0.41); stdDevsOnExpiry.Add(0.355104807570948); stdDevsOnPayment.Add(0.356129662858909); - strikes.Add(0.411); stdDevsOnExpiry.Add(0.355503254556129); stdDevsOnPayment.Add(0.356554151374654); - strikes.Add(0.412); stdDevsOnExpiry.Add(0.355863754209388); stdDevsOnPayment.Add(0.356910592113067); - strikes.Add(0.413); stdDevsOnExpiry.Add(0.35627168802755); stdDevsOnPayment.Add(0.357279994332876); - strikes.Add(0.414); stdDevsOnExpiry.Add(0.356660648179751); stdDevsOnPayment.Add(0.357691521367225); - strikes.Add(0.415); stdDevsOnExpiry.Add(0.357036959221311); stdDevsOnPayment.Add(0.358080365809129); - strikes.Add(0.416); stdDevsOnExpiry.Add(0.35740062115223); stdDevsOnPayment.Add(0.358472450621383); - strikes.Add(0.417); stdDevsOnExpiry.Add(0.357795905859751); stdDevsOnPayment.Add(0.358838612470843); - strikes.Add(0.418); stdDevsOnExpiry.Add(0.35815008095769); stdDevsOnPayment.Add(0.359211255061002); - strikes.Add(0.419); stdDevsOnExpiry.Add(0.358561177053512); stdDevsOnPayment.Add(0.359635743576747); - strikes.Add(0.42); stdDevsOnExpiry.Add(0.358915352151451); stdDevsOnPayment.Add(0.35999218431516); - strikes.Add(0.421); stdDevsOnExpiry.Add(0.359313799136632); stdDevsOnPayment.Add(0.360361586534969); - strikes.Add(0.422); stdDevsOnExpiry.Add(0.359674298789891); stdDevsOnPayment.Add(0.360756911717572); - strikes.Add(0.423); stdDevsOnExpiry.Add(0.36002847388783); stdDevsOnPayment.Add(0.361116592826334); - strikes.Add(0.424); stdDevsOnExpiry.Add(0.360455381371953); stdDevsOnPayment.Add(0.361502196897889); - strikes.Add(0.425); stdDevsOnExpiry.Add(0.360809556469892); stdDevsOnPayment.Add(0.361891041339793); - strikes.Add(0.426); stdDevsOnExpiry.Add(0.361141595624209); stdDevsOnPayment.Add(0.362260443559603); - strikes.Add(0.427); stdDevsOnExpiry.Add(0.361562178553012); stdDevsOnPayment.Add(0.362594201705571); - strikes.Add(0.428); stdDevsOnExpiry.Add(0.361922678206271); stdDevsOnPayment.Add(0.363021930591666); - strikes.Add(0.429); stdDevsOnExpiry.Add(0.36227369102655); stdDevsOnPayment.Add(0.363358929107983); - strikes.Add(0.43); stdDevsOnExpiry.Add(0.362637352957469); stdDevsOnPayment.Add(0.363741292809189); - strikes.Add(0.431); stdDevsOnExpiry.Add(0.362994690333068); stdDevsOnPayment.Add(0.364075050955157); - strikes.Add(0.432); stdDevsOnExpiry.Add(0.363342540875687); stdDevsOnPayment.Add(0.364473616508109); - strikes.Add(0.433); stdDevsOnExpiry.Add(0.363737825583208); stdDevsOnPayment.Add(0.364820336135474); - strikes.Add(0.434); stdDevsOnExpiry.Add(0.364095162958807); stdDevsOnPayment.Add(0.365186497984934); - strikes.Add(0.435); stdDevsOnExpiry.Add(0.364455662612066); stdDevsOnPayment.Add(0.365562380945441); - strikes.Add(0.436); stdDevsOnExpiry.Add(0.364866758707888); stdDevsOnPayment.Add(0.365889658350711); - strikes.Add(0.437); stdDevsOnExpiry.Add(0.365208284695186); stdDevsOnPayment.Add(0.366291464274012); - strikes.Add(0.438); stdDevsOnExpiry.Add(0.365584595736746); stdDevsOnPayment.Add(0.366657626123472); - strikes.Add(0.439); stdDevsOnExpiry.Add(0.365907148058083); stdDevsOnPayment.Add(0.367001105380488); - strikes.Add(0.44); stdDevsOnExpiry.Add(0.366270809989003); stdDevsOnPayment.Add(0.367380228711345); - strikes.Add(0.441); stdDevsOnExpiry.Add(0.366612335976301); stdDevsOnPayment.Add(0.367710746486964); - strikes.Add(0.442); stdDevsOnExpiry.Add(0.366998133850841); stdDevsOnPayment.Add(0.368083389077122); - strikes.Add(0.443); stdDevsOnExpiry.Add(0.367333335282819); stdDevsOnPayment.Add(0.368452791296931); - strikes.Add(0.444); stdDevsOnExpiry.Add(0.367693834936078); stdDevsOnPayment.Add(0.368793030183598); - strikes.Add(0.445); stdDevsOnExpiry.Add(0.368073308255299); stdDevsOnPayment.Add(0.369162432403407); - strikes.Add(0.446); stdDevsOnExpiry.Add(0.368440132463878); stdDevsOnPayment.Add(0.369492950179026); - strikes.Add(0.447); stdDevsOnExpiry.Add(0.368765847062875); stdDevsOnPayment.Add(0.369878554250581); - strikes.Add(0.448); stdDevsOnExpiry.Add(0.369104210772513); stdDevsOnPayment.Add(0.370196110544803); - strikes.Add(0.449); stdDevsOnExpiry.Add(0.369490008647054); stdDevsOnPayment.Add(0.370559032023914); - strikes.Add(0.45); stdDevsOnExpiry.Add(0.369825210079032); stdDevsOnPayment.Add(0.370896030540231); - strikes.Add(0.451); stdDevsOnExpiry.Add(0.370204683398252); stdDevsOnPayment.Add(0.371278394241437); - strikes.Add(0.452); stdDevsOnExpiry.Add(0.370514586608948); stdDevsOnPayment.Add(0.37159271016531); - strikes.Add(0.453); stdDevsOnExpiry.Add(0.370856112596247); stdDevsOnPayment.Add(0.371968593125818); - strikes.Add(0.454); stdDevsOnExpiry.Add(0.371197638583545); stdDevsOnPayment.Add(0.37232503386423); - strikes.Add(0.455); stdDevsOnExpiry.Add(0.371586598735746); stdDevsOnPayment.Add(0.372665272750896); - strikes.Add(0.456); stdDevsOnExpiry.Add(0.371874366002821); stdDevsOnPayment.Add(0.373002271267214); - strikes.Add(0.457); stdDevsOnExpiry.Add(0.37222854110076); stdDevsOnPayment.Add(0.373358712005626); - strikes.Add(0.458); stdDevsOnExpiry.Add(0.372579553921038); stdDevsOnPayment.Add(0.373685989410896); - strikes.Add(0.459); stdDevsOnExpiry.Add(0.372917917630676); stdDevsOnPayment.Add(0.374045670519657); - strikes.Add(0.46); stdDevsOnExpiry.Add(0.373332176004159); stdDevsOnPayment.Add(0.374382669035975); - strikes.Add(0.461); stdDevsOnExpiry.Add(0.373597807327613); stdDevsOnPayment.Add(0.374748830885435); - strikes.Add(0.462); stdDevsOnExpiry.Add(0.373977280646833); stdDevsOnPayment.Add(0.375095550512799); - strikes.Add(0.463); stdDevsOnExpiry.Add(0.374287183857529); stdDevsOnPayment.Add(0.375406626066323); - strikes.Add(0.464); stdDevsOnExpiry.Add(0.374616060734187); stdDevsOnPayment.Add(0.375727422730894); - strikes.Add(0.465); stdDevsOnExpiry.Add(0.375001858608727); stdDevsOnPayment.Add(0.376096824950703); - strikes.Add(0.466); stdDevsOnExpiry.Add(0.375311761819424); stdDevsOnPayment.Add(0.376420861985624); - strikes.Add(0.467); stdDevsOnExpiry.Add(0.375599529086499); stdDevsOnPayment.Add(0.376754620131592); - strikes.Add(0.468); stdDevsOnExpiry.Add(0.376004300627001); stdDevsOnPayment.Add(0.377098099388607); - strikes.Add(0.469); stdDevsOnExpiry.Add(0.376292067894076); stdDevsOnPayment.Add(0.377425376793877); - strikes.Add(0.47); stdDevsOnExpiry.Add(0.376646242992015); stdDevsOnPayment.Add(0.377755894569496); - strikes.Add(0.471); stdDevsOnExpiry.Add(0.376952983925051); stdDevsOnPayment.Add(0.378079931604416); - strikes.Add(0.472); stdDevsOnExpiry.Add(0.377332457244272); stdDevsOnPayment.Add(0.378449333824225); - strikes.Add(0.473); stdDevsOnExpiry.Add(0.377661334120929); stdDevsOnPayment.Add(0.378776611229495); - strikes.Add(0.474); stdDevsOnExpiry.Add(0.377999697830567); stdDevsOnPayment.Add(0.379113609745812); - strikes.Add(0.475); stdDevsOnExpiry.Add(0.378277978264662); stdDevsOnPayment.Add(0.379463569743526); - strikes.Add(0.476); stdDevsOnExpiry.Add(0.378635315640261); stdDevsOnPayment.Add(0.379761683815653); - strikes.Add(0.477); stdDevsOnExpiry.Add(0.378948381128618); stdDevsOnPayment.Add(0.380095441961621); - strikes.Add(0.478); stdDevsOnExpiry.Add(0.379264608894634); stdDevsOnPayment.Add(0.380471324922129); - strikes.Add(0.479); stdDevsOnExpiry.Add(0.379574512105331); stdDevsOnPayment.Add(0.380779160105303); - strikes.Add(0.48); stdDevsOnExpiry.Add(0.379900226704328); stdDevsOnPayment.Add(0.381122639362319); - strikes.Add(0.481); stdDevsOnExpiry.Add(0.380276537745888); stdDevsOnPayment.Add(0.381414272693747); - strikes.Add(0.482); stdDevsOnExpiry.Add(0.380605414622546); stdDevsOnPayment.Add(0.381773953802509); - strikes.Add(0.483); stdDevsOnExpiry.Add(0.380896344167281); stdDevsOnPayment.Add(0.382068827504286); - strikes.Add(0.484); stdDevsOnExpiry.Add(0.381234707876919); stdDevsOnPayment.Add(0.382405826020603); - strikes.Add(0.485); stdDevsOnExpiry.Add(0.381595207530179); stdDevsOnPayment.Add(0.382716901574127); - strikes.Add(0.486); stdDevsOnExpiry.Add(0.381835540632351); stdDevsOnPayment.Add(0.383031217498); - strikes.Add(0.487); stdDevsOnExpiry.Add(0.382139119287727); stdDevsOnPayment.Add(0.38331637008873); - strikes.Add(0.488); stdDevsOnExpiry.Add(0.382486969830346); stdDevsOnPayment.Add(0.383685772308539); - strikes.Add(0.489); stdDevsOnExpiry.Add(0.382847469483605); stdDevsOnPayment.Add(0.383964444158571); - strikes.Add(0.49); stdDevsOnExpiry.Add(0.38313207447302); stdDevsOnPayment.Add(0.384301442674888); - strikes.Add(0.491); stdDevsOnExpiry.Add(0.383479925015639); stdDevsOnPayment.Add(0.384661123783649); - strikes.Add(0.492); stdDevsOnExpiry.Add(0.383796152781656); stdDevsOnPayment.Add(0.384917113041236); - strikes.Add(0.493); stdDevsOnExpiry.Add(0.384106055992352); stdDevsOnPayment.Add(0.385280034520347); - strikes.Add(0.494); stdDevsOnExpiry.Add(0.384457068812631); stdDevsOnPayment.Add(0.38559435044422); - strikes.Add(0.495); stdDevsOnExpiry.Add(0.384744836079706); stdDevsOnPayment.Add(0.385931348960537); - strikes.Add(0.496); stdDevsOnExpiry.Add(0.385048414735082); stdDevsOnPayment.Add(0.386222982291966); - strikes.Add(0.497); stdDevsOnExpiry.Add(0.38537412933408); stdDevsOnPayment.Add(0.386559980808283); - strikes.Add(0.498); stdDevsOnExpiry.Add(0.385709330766058); stdDevsOnPayment.Add(0.386848373769362); - strikes.Add(0.499); stdDevsOnExpiry.Add(0.386038207642715); stdDevsOnPayment.Add(0.387146487841489); - strikes.Add(0.5); stdDevsOnExpiry.Add(0.386338624020431); stdDevsOnPayment.Add(0.387460803765362); - strikes.Add(0.501); stdDevsOnExpiry.Add(0.386623229009846); stdDevsOnPayment.Add(0.387765398578187); - strikes.Add(0.502); stdDevsOnExpiry.Add(0.386952105886504); stdDevsOnPayment.Add(0.388108877835202); - strikes.Add(0.503); stdDevsOnExpiry.Add(0.38724935998656); stdDevsOnPayment.Add(0.388374588203837); - strikes.Add(0.504); stdDevsOnExpiry.Add(0.387584561418537); stdDevsOnPayment.Add(0.388718067460853); - strikes.Add(0.505); stdDevsOnExpiry.Add(0.387856517297312); stdDevsOnPayment.Add(0.388980537459138); - strikes.Add(0.506); stdDevsOnExpiry.Add(0.388213854672911); stdDevsOnPayment.Add(0.3893402185679); - strikes.Add(0.507); stdDevsOnExpiry.Add(0.388514271050627); stdDevsOnPayment.Add(0.389605928936535); - strikes.Add(0.508); stdDevsOnExpiry.Add(0.388748279597479); stdDevsOnPayment.Add(0.389994773378439); - strikes.Add(0.509); stdDevsOnExpiry.Add(0.389073994196477); stdDevsOnPayment.Add(0.390247522265677); - strikes.Add(0.51); stdDevsOnExpiry.Add(0.389431331572076); stdDevsOnPayment.Add(0.39056183818955); - strikes.Add(0.511); stdDevsOnExpiry.Add(0.389643204175307); stdDevsOnPayment.Add(0.390882634854121); - strikes.Add(0.512); stdDevsOnExpiry.Add(0.390025839772187); stdDevsOnPayment.Add(0.391193710407644); - strikes.Add(0.513); stdDevsOnExpiry.Add(0.390351554371185); stdDevsOnPayment.Add(0.391491824479771); - strikes.Add(0.514); stdDevsOnExpiry.Add(0.390607698861658); stdDevsOnPayment.Add(0.391828822996088); - strikes.Add(0.515); stdDevsOnExpiry.Add(0.390901790684054); stdDevsOnPayment.Add(0.392081571883326); - strikes.Add(0.516); stdDevsOnExpiry.Add(0.391218018450071); stdDevsOnPayment.Add(0.392399128177548); - strikes.Add(0.517); stdDevsOnExpiry.Add(0.391524759383107); stdDevsOnPayment.Add(0.392726405582818); - strikes.Add(0.518); stdDevsOnExpiry.Add(0.391809364372522); stdDevsOnPayment.Add(0.393034240765992); - strikes.Add(0.519); stdDevsOnExpiry.Add(0.392093969361938); stdDevsOnPayment.Add(0.393261066690437); - strikes.Add(0.52); stdDevsOnExpiry.Add(0.392419683960935); stdDevsOnPayment.Add(0.393617507428849); - strikes.Add(0.521); stdDevsOnExpiry.Add(0.392723262616311); stdDevsOnPayment.Add(0.393948025204468); - strikes.Add(0.522); stdDevsOnExpiry.Add(0.393001543050406); stdDevsOnPayment.Add(0.39422345668415); - strikes.Add(0.523); stdDevsOnExpiry.Add(0.393336744482384); stdDevsOnPayment.Add(0.394476205571388); - strikes.Add(0.524); stdDevsOnExpiry.Add(0.393611862638818); stdDevsOnPayment.Add(0.394813204087705); - strikes.Add(0.525); stdDevsOnExpiry.Add(0.393940739515476); stdDevsOnPayment.Add(0.395075674085991); - strikes.Add(0.526); stdDevsOnExpiry.Add(0.394168423507008); stdDevsOnPayment.Add(0.395435355194752); - strikes.Add(0.527); stdDevsOnExpiry.Add(0.394459353051744); stdDevsOnPayment.Add(0.39568810408199); - strikes.Add(0.528); stdDevsOnExpiry.Add(0.394800879039042); stdDevsOnPayment.Add(0.396012141116911); - strikes.Add(0.529); stdDevsOnExpiry.Add(0.395025400752914); stdDevsOnPayment.Add(0.396274611115196); - strikes.Add(0.53); stdDevsOnExpiry.Add(0.395347953074251); stdDevsOnPayment.Add(0.396572725187323); - strikes.Add(0.531); stdDevsOnExpiry.Add(0.395613584397705); stdDevsOnPayment.Add(0.396893521851894); - strikes.Add(0.532); stdDevsOnExpiry.Add(0.395951948107343); stdDevsOnPayment.Add(0.397162472590878); - strikes.Add(0.533); stdDevsOnExpiry.Add(0.39626817587336); stdDevsOnPayment.Add(0.397483269255449); - strikes.Add(0.534); stdDevsOnExpiry.Add(0.396505346697872); stdDevsOnPayment.Add(0.397774902586878); - strikes.Add(0.535); stdDevsOnExpiry.Add(0.39683106129687); stdDevsOnPayment.Add(0.398034132214814); - strikes.Add(0.536); stdDevsOnExpiry.Add(0.397137802229906); stdDevsOnPayment.Add(0.398329005916591); - strikes.Add(0.537); stdDevsOnExpiry.Add(0.39739078444272); stdDevsOnPayment.Add(0.398656283321861); - strikes.Add(0.538); stdDevsOnExpiry.Add(0.397672227154475); stdDevsOnPayment.Add(0.39890579183875); - strikes.Add(0.539); stdDevsOnExpiry.Add(0.397931533922608); stdDevsOnPayment.Add(0.399184463688781); - strikes.Add(0.54); stdDevsOnExpiry.Add(0.398269897632246); stdDevsOnPayment.Add(0.399463135538813); - strikes.Add(0.541); stdDevsOnExpiry.Add(0.398484932513138); stdDevsOnPayment.Add(0.399770970721987); - strikes.Add(0.542); stdDevsOnExpiry.Add(0.398826458500436); stdDevsOnPayment.Add(0.400023719609225); - strikes.Add(0.543); stdDevsOnExpiry.Add(0.399126874878152); stdDevsOnPayment.Add(0.400334795162749); - strikes.Add(0.544); stdDevsOnExpiry.Add(0.399398830756927); stdDevsOnPayment.Add(0.400603745901733); - strikes.Add(0.545); stdDevsOnExpiry.Add(0.399680273468682); stdDevsOnPayment.Add(0.400914821455256); - strikes.Add(0.546); stdDevsOnExpiry.Add(0.399917444293194); stdDevsOnPayment.Add(0.40122589700878); - strikes.Add(0.547); stdDevsOnExpiry.Add(0.400274781668793); stdDevsOnPayment.Add(0.401465684414621); - strikes.Add(0.548); stdDevsOnExpiry.Add(0.400543575269907); stdDevsOnPayment.Add(0.401812404041986); - strikes.Add(0.549); stdDevsOnExpiry.Add(0.400828180259323); stdDevsOnPayment.Add(0.402016547373986); - strikes.Add(0.55); stdDevsOnExpiry.Add(0.401103298415757); stdDevsOnPayment.Add(0.402347065149604); - strikes.Add(0.551); stdDevsOnExpiry.Add(0.401356280628571); stdDevsOnPayment.Add(0.402612775518239); - strikes.Add(0.552); stdDevsOnExpiry.Add(0.401666183839267); stdDevsOnPayment.Add(0.402875245516525); - strikes.Add(0.553); stdDevsOnExpiry.Add(0.401874894164838); stdDevsOnPayment.Add(0.403186321070048); - strikes.Add(0.554); stdDevsOnExpiry.Add(0.402238556095758); stdDevsOnPayment.Add(0.403468233290429); - strikes.Add(0.555); stdDevsOnExpiry.Add(0.40246624008729); stdDevsOnPayment.Add(0.403714501436968); - strikes.Add(0.556); stdDevsOnExpiry.Add(0.402747682799045); stdDevsOnPayment.Add(0.403989932916651); - strikes.Add(0.557); stdDevsOnExpiry.Add(0.403070235120382); stdDevsOnPayment.Add(0.404297768099825); - strikes.Add(0.558); stdDevsOnExpiry.Add(0.403326379610856); stdDevsOnPayment.Add(0.404589401431253); - strikes.Add(0.559); stdDevsOnExpiry.Add(0.403535089936427); stdDevsOnPayment.Add(0.404884275133031); - strikes.Add(0.56); stdDevsOnExpiry.Add(0.403797558982221); stdDevsOnPayment.Add(0.405104620316777); - strikes.Add(0.561); stdDevsOnExpiry.Add(0.404126435858878); stdDevsOnPayment.Add(0.405393013277856); - strikes.Add(0.562); stdDevsOnExpiry.Add(0.404423689958934); stdDevsOnPayment.Add(0.405668444757538); - strikes.Add(0.563); stdDevsOnExpiry.Add(0.404733593169631); stdDevsOnPayment.Add(0.405901751422681); - strikes.Add(0.564); stdDevsOnExpiry.Add(0.404977088549464); stdDevsOnPayment.Add(0.406203105865157); - strikes.Add(0.565); stdDevsOnExpiry.Add(0.405220583929296); stdDevsOnPayment.Add(0.406510941048331); - strikes.Add(0.566); stdDevsOnExpiry.Add(0.405533649417653); stdDevsOnPayment.Add(0.406741007343125); - strikes.Add(0.567); stdDevsOnExpiry.Add(0.405742359743224); stdDevsOnPayment.Add(0.407042361785601); - strikes.Add(0.568); stdDevsOnExpiry.Add(0.406083885730522); stdDevsOnPayment.Add(0.407295110672839); - strikes.Add(0.569); stdDevsOnExpiry.Add(0.406295758333754); stdDevsOnPayment.Add(0.407593224744966); - strikes.Add(0.57); stdDevsOnExpiry.Add(0.406643608876372); stdDevsOnPayment.Add(0.40786217548395); - strikes.Add(0.571); stdDevsOnExpiry.Add(0.406814371870021); stdDevsOnPayment.Add(0.408082520667695); - strikes.Add(0.572); stdDevsOnExpiry.Add(0.407114788247737); stdDevsOnPayment.Add(0.408416278813663); - strikes.Add(0.573); stdDevsOnExpiry.Add(0.407434178291414); stdDevsOnPayment.Add(0.408636623997409); - strikes.Add(0.574); stdDevsOnExpiry.Add(0.407623914951024); stdDevsOnPayment.Add(0.40891853621779); - strikes.Add(0.575); stdDevsOnExpiry.Add(0.407936980439381); stdDevsOnPayment.Add(0.409252294363758); - strikes.Add(0.576); stdDevsOnExpiry.Add(0.408265857316039); stdDevsOnPayment.Add(0.409449956955059); - strikes.Add(0.577); stdDevsOnExpiry.Add(0.408496703585231); stdDevsOnPayment.Add(0.409748071027186); - strikes.Add(0.578); stdDevsOnExpiry.Add(0.408774984019326); stdDevsOnPayment.Add(0.410000819914424); - strikes.Add(0.579); stdDevsOnExpiry.Add(0.409024803954479); stdDevsOnPayment.Add(0.410295693616202); - strikes.Add(0.58); stdDevsOnExpiry.Add(0.409261974778992); stdDevsOnPayment.Add(0.410567884725535); - strikes.Add(0.581); stdDevsOnExpiry.Add(0.409518119269465); stdDevsOnPayment.Add(0.410755826205789); - strikes.Add(0.582); stdDevsOnExpiry.Add(0.409831184757822); stdDevsOnPayment.Add(0.411125228425598); - strikes.Add(0.583); stdDevsOnExpiry.Add(0.410109465191917); stdDevsOnPayment.Add(0.411394179164582); - strikes.Add(0.584); stdDevsOnExpiry.Add(0.41034979829409); stdDevsOnPayment.Add(0.411614524348328); - strikes.Add(0.585); stdDevsOnExpiry.Add(0.410583806840942); stdDevsOnPayment.Add(0.411867273235566); - strikes.Add(0.586); stdDevsOnExpiry.Add(0.410931657383561); stdDevsOnPayment.Add(0.412171868048391); - strikes.Add(0.587); stdDevsOnExpiry.Add(0.41109925809955); stdDevsOnPayment.Add(0.41237925175074); - strikes.Add(0.588); stdDevsOnExpiry.Add(0.411374376255984); stdDevsOnPayment.Add(0.412670885082168); - strikes.Add(0.589); stdDevsOnExpiry.Add(0.411690604022001); stdDevsOnPayment.Add(0.41294631656185); - strikes.Add(0.59); stdDevsOnExpiry.Add(0.411943586234814); stdDevsOnPayment.Add(0.413215267300834); - strikes.Add(0.591); stdDevsOnExpiry.Add(0.412215542113589); stdDevsOnPayment.Add(0.413458295077025); - strikes.Add(0.592); stdDevsOnExpiry.Add(0.412348357775316); stdDevsOnPayment.Add(0.413707803593913); - strikes.Add(0.593); stdDevsOnExpiry.Add(0.412677234651974); stdDevsOnPayment.Add(0.413931389148008); - strikes.Add(0.594); stdDevsOnExpiry.Add(0.412908080921166); stdDevsOnPayment.Add(0.4141679361835); - strikes.Add(0.595); stdDevsOnExpiry.Add(0.41318003679994); stdDevsOnPayment.Add(0.414479011737024); - strikes.Add(0.596); stdDevsOnExpiry.Add(0.413382422570191); stdDevsOnPayment.Add(0.414747962476008); - strikes.Add(0.597); stdDevsOnExpiry.Add(0.413701812613868); stdDevsOnPayment.Add(0.415000711363246); - strikes.Add(0.598); stdDevsOnExpiry.Add(0.413954794826682); stdDevsOnPayment.Add(0.415282623583626); - strikes.Add(0.599); stdDevsOnExpiry.Add(0.414229912983116); stdDevsOnPayment.Add(0.415538612841214); - strikes.Add(0.6); stdDevsOnExpiry.Add(0.414508193417211); stdDevsOnPayment.Add(0.415778400247055); - strikes.Add(0.601); stdDevsOnExpiry.Add(0.414748526519384); stdDevsOnPayment.Add(0.416005226171499); - strikes.Add(0.602); stdDevsOnExpiry.Add(0.415020482398158); stdDevsOnPayment.Add(0.41632602283607); - strikes.Add(0.603); stdDevsOnExpiry.Add(0.415276626888632); stdDevsOnPayment.Add(0.416513964316324); - strikes.Add(0.604); stdDevsOnExpiry.Add(0.415583367821668); stdDevsOnPayment.Add(0.416795876536705); - strikes.Add(0.605); stdDevsOnExpiry.Add(0.415731994871696); stdDevsOnPayment.Add(0.417119913571625); - strikes.Add(0.606); stdDevsOnExpiry.Add(0.416060871748354); stdDevsOnPayment.Add(0.417217124682101); - strikes.Add(0.607); stdDevsOnExpiry.Add(0.416335989904788); stdDevsOnPayment.Add(0.417550882828069); - strikes.Add(0.608); stdDevsOnExpiry.Add(0.416532051119719); stdDevsOnPayment.Add(0.417861958381593); - strikes.Add(0.609); stdDevsOnExpiry.Add(0.416772384221892); stdDevsOnPayment.Add(0.41811794763918); - strikes.Add(0.61); stdDevsOnExpiry.Add(0.417028528712365); stdDevsOnPayment.Add(0.418286446897339); - strikes.Add(0.611); stdDevsOnExpiry.Add(0.417281510925179); stdDevsOnPayment.Add(0.418587801339814); - strikes.Add(0.612); stdDevsOnExpiry.Add(0.417455436196488); stdDevsOnPayment.Add(0.418817867634608); - strikes.Add(0.613); stdDevsOnExpiry.Add(0.417721067519942); stdDevsOnPayment.Add(0.419047933929401); - strikes.Add(0.614); stdDevsOnExpiry.Add(0.418068918062561); stdDevsOnPayment.Add(0.419313644298036); - strikes.Add(0.615); stdDevsOnExpiry.Add(0.418204896001948); stdDevsOnPayment.Add(0.41962471985156); - strikes.Add(0.616); stdDevsOnExpiry.Add(0.418533772878605); stdDevsOnPayment.Add(0.419812661331814); - strikes.Add(0.617); stdDevsOnExpiry.Add(0.418770943703118); stdDevsOnPayment.Add(0.420036246885909); - strikes.Add(0.618); stdDevsOnExpiry.Add(0.419042899581892); stdDevsOnPayment.Add(0.420282515032448); - strikes.Add(0.619); stdDevsOnExpiry.Add(0.419229473963842); stdDevsOnPayment.Add(0.420596830956321); - strikes.Add(0.62); stdDevsOnExpiry.Add(0.419529890341558); stdDevsOnPayment.Add(0.420807455029019); - strikes.Add(0.621); stdDevsOnExpiry.Add(0.41974492522245); stdDevsOnPayment.Add(0.421037521323813); - strikes.Add(0.622); stdDevsOnExpiry.Add(0.420026367934205); stdDevsOnPayment.Add(0.421335635395939); - strikes.Add(0.623); stdDevsOnExpiry.Add(0.420282512424678); stdDevsOnPayment.Add(0.421523576876193); - strikes.Add(0.624); stdDevsOnExpiry.Add(0.420427977197046); stdDevsOnPayment.Add(0.421857335022161); - strikes.Add(0.625); stdDevsOnExpiry.Add(0.420658823466239); stdDevsOnPayment.Add(0.422061478354161); - strikes.Add(0.626); stdDevsOnExpiry.Add(0.421019323119498); stdDevsOnPayment.Add(0.422259140945463); - strikes.Add(0.627); stdDevsOnExpiry.Add(0.421193248390807); stdDevsOnPayment.Add(0.422589658721081); - strikes.Add(0.628); stdDevsOnExpiry.Add(0.421395634161058); stdDevsOnPayment.Add(0.422774359830986); - strikes.Add(0.629); stdDevsOnExpiry.Add(0.421702375094094); stdDevsOnPayment.Add(0.423036829829271); - strikes.Add(0.63); stdDevsOnExpiry.Add(0.421882624920724); stdDevsOnPayment.Add(0.423273376864763); - strikes.Add(0.631); stdDevsOnExpiry.Add(0.422176716743119); stdDevsOnPayment.Add(0.423493722048509); - strikes.Add(0.632); stdDevsOnExpiry.Add(0.422401238456991); stdDevsOnPayment.Add(0.423720547972953); - strikes.Add(0.633); stdDevsOnExpiry.Add(0.422651058392145); stdDevsOnPayment.Add(0.423931172045652); - strikes.Add(0.634); stdDevsOnExpiry.Add(0.434664551223124); stdDevsOnPayment.Add(0.424248728339874); - strikes.Add(0.635); stdDevsOnExpiry.Add(0.434920695713598); stdDevsOnPayment.Add(0.424478794634667); - strikes.Add(0.636); stdDevsOnExpiry.Add(0.423403680475265); stdDevsOnPayment.Add(0.424715341670159); - strikes.Add(0.637); stdDevsOnExpiry.Add(0.435432984694545); stdDevsOnPayment.Add(0.424990773149841); - strikes.Add(0.638); stdDevsOnExpiry.Add(0.423846399347688); stdDevsOnPayment.Add(0.425172233889397); - strikes.Add(0.639); stdDevsOnExpiry.Add(0.435910488621231); stdDevsOnPayment.Add(0.425428223146984); - strikes.Add(0.64); stdDevsOnExpiry.Add(0.436163470834044); stdDevsOnPayment.Add(0.425645327960381); - strikes.Add(0.641); stdDevsOnExpiry.Add(0.436413290769197); stdDevsOnPayment.Add(0.425894836477269); - strikes.Add(0.642); stdDevsOnExpiry.Add(0.43664413703839); stdDevsOnPayment.Add(0.42617674869765); - strikes.Add(0.643); stdDevsOnExpiry.Add(0.436897119251203); stdDevsOnPayment.Add(0.426361449807555); - strikes.Add(0.644); stdDevsOnExpiry.Add(0.437159588296997); stdDevsOnPayment.Add(0.426607717954094); - strikes.Add(0.645); stdDevsOnExpiry.Add(0.437358811789588); stdDevsOnPayment.Add(0.42678917869365); - strikes.Add(0.646); stdDevsOnExpiry.Add(0.437602307169421); stdDevsOnPayment.Add(0.427165061654157); - strikes.Add(0.647); stdDevsOnExpiry.Add(0.437852127104574); stdDevsOnPayment.Add(0.427340041653014); - strikes.Add(0.648); stdDevsOnExpiry.Add(0.438076648818446); stdDevsOnPayment.Add(0.427608992391998); - strikes.Add(0.649); stdDevsOnExpiry.Add(0.43833279330892); stdDevsOnPayment.Add(0.427780732020506); - strikes.Add(0.65); stdDevsOnExpiry.Add(0.438569964133432); stdDevsOnPayment.Add(0.428033480907744); - strikes.Add(0.651); stdDevsOnExpiry.Add(0.438810297235605); stdDevsOnPayment.Add(0.428308912387426); - strikes.Add(0.652); stdDevsOnExpiry.Add(0.439056954893098); stdDevsOnPayment.Add(0.428548699793267); - strikes.Add(0.653); stdDevsOnExpiry.Add(0.43927831432931); stdDevsOnPayment.Add(0.428713958681077); - strikes.Add(0.654); stdDevsOnExpiry.Add(0.439534458819784); stdDevsOnPayment.Add(0.429012072753204); - strikes.Add(0.655); stdDevsOnExpiry.Add(0.439765305088976); stdDevsOnPayment.Add(0.429193533492759); - strikes.Add(0.656); stdDevsOnExpiry.Add(0.440015125024129); stdDevsOnPayment.Add(0.429443042009648); - strikes.Add(0.657); stdDevsOnExpiry.Add(0.440264944959282); stdDevsOnPayment.Add(0.429686069785838); - strikes.Add(0.658); stdDevsOnExpiry.Add(0.440454681618893); stdDevsOnPayment.Add(0.429857809414346); - strikes.Add(0.659); stdDevsOnExpiry.Add(0.440723475220007); stdDevsOnPayment.Add(0.430185086819615); - strikes.Add(0.66); stdDevsOnExpiry.Add(0.440957483766859); stdDevsOnPayment.Add(0.430402191633012); - strikes.Add(0.661); stdDevsOnExpiry.Add(0.441210465979673); stdDevsOnPayment.Add(0.43057393126152); - strikes.Add(0.662); stdDevsOnExpiry.Add(0.441403364916943); stdDevsOnPayment.Add(0.430758632371424); - strikes.Add(0.663); stdDevsOnExpiry.Add(0.441681645351038); stdDevsOnPayment.Add(0.431076188665647); - strikes.Add(0.664); stdDevsOnExpiry.Add(0.441858732900007); stdDevsOnPayment.Add(0.431290053108694); - strikes.Add(0.665); stdDevsOnExpiry.Add(0.44209590372452); stdDevsOnPayment.Add(0.431484475329646); - strikes.Add(0.666); stdDevsOnExpiry.Add(0.442374184158615); stdDevsOnPayment.Add(0.431721022365138); - strikes.Add(0.667); stdDevsOnExpiry.Add(0.442592381317166); stdDevsOnPayment.Add(0.432022376807614); - strikes.Add(0.668); stdDevsOnExpiry.Add(0.442813740753378); stdDevsOnPayment.Add(0.432194116436122); - strikes.Add(0.669); stdDevsOnExpiry.Add(0.443076209799172); stdDevsOnPayment.Add(0.432417701990217); - strikes.Add(0.67); stdDevsOnExpiry.Add(0.443275433291763); stdDevsOnPayment.Add(0.432644527914661); - strikes.Add(0.671); stdDevsOnExpiry.Add(0.443531577782236); stdDevsOnPayment.Add(0.43293616124609); - strikes.Add(0.672); stdDevsOnExpiry.Add(0.443705503053546); stdDevsOnPayment.Add(0.433030131986216); - strikes.Add(0.673); stdDevsOnExpiry.Add(0.443964809821679); stdDevsOnPayment.Add(0.433376851613581); - strikes.Add(0.674); stdDevsOnExpiry.Add(0.444183006980231); stdDevsOnPayment.Add(0.433603677538025); - strikes.Add(0.675); stdDevsOnExpiry.Add(0.444439151470705); stdDevsOnPayment.Add(0.433772176796184); - strikes.Add(0.676); stdDevsOnExpiry.Add(0.444676322295217); stdDevsOnPayment.Add(0.434083252349708); - strikes.Add(0.677); stdDevsOnExpiry.Add(0.44491665539739); stdDevsOnPayment.Add(0.434290636052057); - strikes.Add(0.678); stdDevsOnExpiry.Add(0.44510322977934); stdDevsOnPayment.Add(0.43440080864393); - strikes.Add(0.679); stdDevsOnExpiry.Add(0.445324589215552); stdDevsOnPayment.Add(0.43464383642012); - strikes.Add(0.68); stdDevsOnExpiry.Add(0.445602869649647); stdDevsOnPayment.Add(0.434909546788755); - strikes.Add(0.681); stdDevsOnExpiry.Add(0.445757821254995); stdDevsOnPayment.Add(0.435084526787612); - strikes.Add(0.682); stdDevsOnExpiry.Add(0.446029777133769); stdDevsOnPayment.Add(0.43537616011904); - strikes.Add(0.683); stdDevsOnExpiry.Add(0.446282759346583); stdDevsOnPayment.Add(0.435567341969643); - strikes.Add(0.684); stdDevsOnExpiry.Add(0.446478820561513); stdDevsOnPayment.Add(0.435719639376056); - strikes.Add(0.685); stdDevsOnExpiry.Add(0.446655908110483); stdDevsOnPayment.Add(0.435969147892944); - strikes.Add(0.686); stdDevsOnExpiry.Add(0.446940513099898); stdDevsOnPayment.Add(0.43627050233542); - strikes.Add(0.687); stdDevsOnExpiry.Add(0.44716187253611); stdDevsOnPayment.Add(0.448587150032745); - strikes.Add(0.688); stdDevsOnExpiry.Add(0.447424341581904); stdDevsOnPayment.Add(0.436633423814531); - strikes.Add(0.689); stdDevsOnExpiry.Add(0.447604591408533); stdDevsOnPayment.Add(0.436827846035483); - strikes.Add(0.69); stdDevsOnExpiry.Add(0.447800652623464); stdDevsOnPayment.Add(0.44929679113922); - strikes.Add(0.691); stdDevsOnExpiry.Add(0.448085257612879); stdDevsOnPayment.Add(0.449510655582268); - strikes.Add(0.692); stdDevsOnExpiry.Add(0.44830029249377); stdDevsOnPayment.Add(0.449750442988109); - strikes.Add(0.693); stdDevsOnExpiry.Add(0.448505840541681); stdDevsOnPayment.Add(0.449986990023601); - strikes.Add(0.694); stdDevsOnExpiry.Add(0.448708226311932); stdDevsOnPayment.Add(0.450226777429442); - strikes.Add(0.695); stdDevsOnExpiry.Add(0.448935910303464); stdDevsOnPayment.Add(0.450447122613188); - strikes.Add(0.696); stdDevsOnExpiry.Add(0.449141458351375); stdDevsOnPayment.Add(0.450638304463791); - strikes.Add(0.697); stdDevsOnExpiry.Add(0.449365980065247); stdDevsOnPayment.Add(0.450878091869632); - strikes.Add(0.698); stdDevsOnExpiry.Add(0.449565203557838); stdDevsOnPayment.Add(0.451091956312679); - strikes.Add(0.699); stdDevsOnExpiry.Add(0.449871944490874); stdDevsOnPayment.Add(0.451296099644679); - strikes.Add(0.7); stdDevsOnExpiry.Add(0.450061681150484); stdDevsOnPayment.Add(0.451519685198774); - strikes.Add(0.701); stdDevsOnExpiry.Add(0.450229281866473); stdDevsOnPayment.Add(0.45174003038252); - strikes.Add(0.702); stdDevsOnExpiry.Add(0.450472777246306); stdDevsOnPayment.Add(0.451979817788361); - strikes.Add(0.703); stdDevsOnExpiry.Add(0.45073208401444); stdDevsOnPayment.Add(0.452222845564551); - strikes.Add(0.704); stdDevsOnExpiry.Add(0.450940794340011); stdDevsOnPayment.Add(0.452436710007599); - strikes.Add(0.705); stdDevsOnExpiry.Add(0.451162153776223); stdDevsOnPayment.Add(0.452653814820995); - strikes.Add(0.706); stdDevsOnExpiry.Add(0.451374026379454); stdDevsOnPayment.Add(0.452848237041948); - strikes.Add(0.707); stdDevsOnExpiry.Add(0.451570087594384); stdDevsOnPayment.Add(0.453094505188487); - strikes.Add(0.708); stdDevsOnExpiry.Add(0.451813582974217); stdDevsOnPayment.Add(0.453292167779789); - strikes.Add(0.709); stdDevsOnExpiry.Add(0.452028617855109); stdDevsOnPayment.Add(0.453525474444931); - strikes.Add(0.71); stdDevsOnExpiry.Add(0.45223416590302); stdDevsOnPayment.Add(0.453729617776931); - strikes.Add(0.711); stdDevsOnExpiry.Add(0.45243338939561); stdDevsOnPayment.Add(0.453959684071725); - strikes.Add(0.712); stdDevsOnExpiry.Add(0.452635775165861); stdDevsOnPayment.Add(0.454212432958962); - strikes.Add(0.713); stdDevsOnExpiry.Add(0.452869783712714); stdDevsOnPayment.Add(0.454390653328169); - strikes.Add(0.714); stdDevsOnExpiry.Add(0.453056358094664); stdDevsOnPayment.Add(0.454617479252613); - strikes.Add(0.715); stdDevsOnExpiry.Add(0.453274555253215); stdDevsOnPayment.Add(0.454837824436359); - strikes.Add(0.716); stdDevsOnExpiry.Add(0.453578133908591); stdDevsOnPayment.Add(0.455019285175914); - strikes.Add(0.717); stdDevsOnExpiry.Add(0.453761546012881); stdDevsOnPayment.Add(0.455252591841057); - strikes.Add(0.718); stdDevsOnExpiry.Add(0.453970256338452); stdDevsOnPayment.Add(0.455479417765501); - strikes.Add(0.719); stdDevsOnExpiry.Add(0.454156830720402); stdDevsOnPayment.Add(0.455657638134707); - strikes.Add(0.72); stdDevsOnExpiry.Add(0.454346567380012); stdDevsOnPayment.Add(0.45589094479985); - strikes.Add(0.721); stdDevsOnExpiry.Add(0.454590062759845); stdDevsOnPayment.Add(0.456098328502199); - strikes.Add(0.722); stdDevsOnExpiry.Add(0.454795610807756); stdDevsOnPayment.Add(0.45634135627839); - strikes.Add(0.723); stdDevsOnExpiry.Add(0.455032781632269); stdDevsOnPayment.Add(0.45654225924004); - strikes.Add(0.724); stdDevsOnExpiry.Add(0.455257303346141); stdDevsOnPayment.Add(0.45674640257204); - strikes.Add(0.725); stdDevsOnExpiry.Add(0.455469175949372); stdDevsOnPayment.Add(0.456960267015087); - strikes.Add(0.726); stdDevsOnExpiry.Add(0.455684210830264); stdDevsOnPayment.Add(0.457200054420929); - strikes.Add(0.727); stdDevsOnExpiry.Add(0.455908732544135); stdDevsOnPayment.Add(0.457378274790135); - strikes.Add(0.728); stdDevsOnExpiry.Add(0.456054197316503); stdDevsOnPayment.Add(0.457621302566325); - strikes.Add(0.729); stdDevsOnExpiry.Add(0.456281881308035); stdDevsOnPayment.Add(0.457835167009372); - strikes.Add(0.73); stdDevsOnExpiry.Add(0.456525376687868); stdDevsOnPayment.Add(0.458039310341372); - strikes.Add(0.731); stdDevsOnExpiry.Add(0.456683490570877); stdDevsOnPayment.Add(0.458233732562325); - strikes.Add(0.732); stdDevsOnExpiry.Add(0.45693647278369); stdDevsOnPayment.Add(0.458467039227467); - strikes.Add(0.733); stdDevsOnExpiry.Add(0.45712937172096); stdDevsOnPayment.Add(0.458671182559467); - strikes.Add(0.734); stdDevsOnExpiry.Add(0.457322270658231); stdDevsOnPayment.Add(0.458907729594959); - strikes.Add(0.735); stdDevsOnExpiry.Add(0.457521494150821); stdDevsOnPayment.Add(0.459079469223467); - strikes.Add(0.736); stdDevsOnExpiry.Add(0.457736529031713); stdDevsOnPayment.Add(0.459299814407213); - strikes.Add(0.737); stdDevsOnExpiry.Add(0.457970537578565); stdDevsOnPayment.Add(0.459481275146768); - strikes.Add(0.738); stdDevsOnExpiry.Add(0.458141300572214); stdDevsOnPayment.Add(0.459701620330514); - strikes.Add(0.739); stdDevsOnExpiry.Add(0.458406931895669); stdDevsOnPayment.Add(0.459931686625307); - strikes.Add(0.74); stdDevsOnExpiry.Add(0.458587181722298); stdDevsOnPayment.Add(0.460116387735212); - strikes.Add(0.741); stdDevsOnExpiry.Add(0.458846488490432); stdDevsOnPayment.Add(0.460317290696863); - strikes.Add(0.742); stdDevsOnExpiry.Add(0.459045711983022); stdDevsOnPayment.Add(0.460534395510259); - strikes.Add(0.743); stdDevsOnExpiry.Add(0.459216474976672); stdDevsOnPayment.Add(0.460757981064355); - strikes.Add(0.744); stdDevsOnExpiry.Add(0.459412536191602); stdDevsOnPayment.Add(0.46098156661845); - strikes.Add(0.745); stdDevsOnExpiry.Add(0.459656031571435); stdDevsOnPayment.Add(0.461156546617307); - strikes.Add(0.746); stdDevsOnExpiry.Add(0.459829956842744); stdDevsOnPayment.Add(0.461370411060354); - strikes.Add(0.747); stdDevsOnExpiry.Add(0.460054478556616); stdDevsOnPayment.Add(0.461545391059211); - strikes.Add(0.748); stdDevsOnExpiry.Add(0.460244215216226); stdDevsOnPayment.Add(0.46179165920575); - strikes.Add(0.749); stdDevsOnExpiry.Add(0.460396004543914); stdDevsOnPayment.Add(0.461966639204608); - strikes.Add(0.75); stdDevsOnExpiry.Add(0.460671122700349); stdDevsOnPayment.Add(0.462212907351147); - strikes.Add(0.751); stdDevsOnExpiry.Add(0.460857697082299); stdDevsOnPayment.Add(0.462378166238956); - strikes.Add(0.752); stdDevsOnExpiry.Add(0.461028460075948); stdDevsOnPayment.Add(0.462598511422702); - strikes.Add(0.753); stdDevsOnExpiry.Add(0.461215034457898); stdDevsOnPayment.Add(0.462792933643655); - strikes.Add(0.754); stdDevsOnExpiry.Add(0.461458529837731); stdDevsOnPayment.Add(0.4630132788274); - strikes.Add(0.755); stdDevsOnExpiry.Add(0.461657753330322); stdDevsOnPayment.Add(0.4632174221594); - strikes.Add(0.756); stdDevsOnExpiry.Add(0.461869625933553); stdDevsOnPayment.Add(0.463411844380352); - strikes.Add(0.757); stdDevsOnExpiry.Add(0.462122608146366); stdDevsOnPayment.Add(0.463632189564098); - strikes.Add(0.758); stdDevsOnExpiry.Add(0.462264910641074); stdDevsOnPayment.Add(0.463820131044352); - strikes.Add(0.759); stdDevsOnExpiry.Add(0.462470458688985); stdDevsOnPayment.Add(0.464014553265304); - strikes.Add(0.76); stdDevsOnExpiry.Add(0.462676006736896); stdDevsOnPayment.Add(0.464254340671146); - strikes.Add(0.761); stdDevsOnExpiry.Add(0.462910015283748); stdDevsOnPayment.Add(0.464432561040352); - strikes.Add(0.762); stdDevsOnExpiry.Add(0.463087102832718); stdDevsOnPayment.Add(0.464646425483399); - strikes.Add(0.763); stdDevsOnExpiry.Add(0.463245216715726); stdDevsOnPayment.Add(0.464850568815399); - strikes.Add(0.764); stdDevsOnExpiry.Add(0.463482387540239); stdDevsOnPayment.Add(0.464999625851462); - strikes.Add(0.765); stdDevsOnExpiry.Add(0.46369109786581); stdDevsOnPayment.Add(0.465281538071843); - strikes.Add(0.766); stdDevsOnExpiry.Add(0.463909295024361); stdDevsOnPayment.Add(0.465443556589303); - strikes.Add(0.767); stdDevsOnExpiry.Add(0.46407373346269); stdDevsOnPayment.Add(0.465650940291652); - strikes.Add(0.768); stdDevsOnExpiry.Add(0.464285606065922); stdDevsOnPayment.Add(0.465861564364351); - strikes.Add(0.769); stdDevsOnExpiry.Add(0.464475342725532); stdDevsOnPayment.Add(0.466036544363208); - strikes.Add(0.77); stdDevsOnExpiry.Add(0.464668241662802); stdDevsOnPayment.Add(0.466218005102763); - strikes.Add(0.771); stdDevsOnExpiry.Add(0.464845329211771); stdDevsOnPayment.Add(0.466483715471398); - strikes.Add(0.772); stdDevsOnExpiry.Add(0.465031903593721); stdDevsOnPayment.Add(0.466632772507461); - strikes.Add(0.773); stdDevsOnExpiry.Add(0.465256425307593); stdDevsOnPayment.Add(0.466807752506318); - strikes.Add(0.774); stdDevsOnExpiry.Add(0.465427188301242); stdDevsOnPayment.Add(0.467060501393556); - strikes.Add(0.775); stdDevsOnExpiry.Add(0.465645385459794); stdDevsOnPayment.Add(0.467229000651715); - strikes.Add(0.776); stdDevsOnExpiry.Add(0.465806661620462); stdDevsOnPayment.Add(0.467416942131968); - strikes.Add(0.777); stdDevsOnExpiry.Add(0.466021696501354); stdDevsOnPayment.Add(0.467591922130826); - strikes.Add(0.778); stdDevsOnExpiry.Add(0.466255705048206); stdDevsOnPayment.Add(0.467815507684921); - strikes.Add(0.779); stdDevsOnExpiry.Add(0.466489713595059); stdDevsOnPayment.Add(0.467996968424476); - strikes.Add(0.78); stdDevsOnExpiry.Add(0.466676287977009); stdDevsOnPayment.Add(0.468188150275079); - strikes.Add(0.781); stdDevsOnExpiry.Add(0.466843888692998); stdDevsOnPayment.Add(0.468395533977428); - strikes.Add(0.782); stdDevsOnExpiry.Add(0.466992515743026); stdDevsOnPayment.Add(0.468576994716984); - strikes.Add(0.783); stdDevsOnExpiry.Add(0.467213875179237); stdDevsOnPayment.Add(0.468823262863523); - strikes.Add(0.784); stdDevsOnExpiry.Add(0.467470019669711); stdDevsOnPayment.Add(0.469017685084475); - strikes.Add(0.785); stdDevsOnExpiry.Add(0.467656594051661); stdDevsOnPayment.Add(0.469228309157174); - strikes.Add(0.786); stdDevsOnExpiry.Add(0.467811545657009); stdDevsOnPayment.Add(0.46944541397057); - strikes.Add(0.787); stdDevsOnExpiry.Add(0.467938036763416); stdDevsOnPayment.Add(0.46956854804384); - strikes.Add(0.788); stdDevsOnExpiry.Add(0.468172045310268); stdDevsOnPayment.Add(0.469788893227586); - strikes.Add(0.789); stdDevsOnExpiry.Add(0.468374431080519); stdDevsOnPayment.Add(0.470035161374125); - strikes.Add(0.79); stdDevsOnExpiry.Add(0.468595790516731); stdDevsOnPayment.Add(0.470200420261935); - strikes.Add(0.791); stdDevsOnExpiry.Add(0.468801338564642); stdDevsOnPayment.Add(0.470407803964284); - strikes.Add(0.792); stdDevsOnExpiry.Add(0.468972101558291); stdDevsOnPayment.Add(0.470514736185807); - strikes.Add(0.793); stdDevsOnExpiry.Add(0.46913970227428); stdDevsOnPayment.Add(0.470770725443395); - strikes.Add(0.794); stdDevsOnExpiry.Add(0.469307302990269); stdDevsOnPayment.Add(0.470974868775394); - strikes.Add(0.795); stdDevsOnExpiry.Add(0.469550798370102); stdDevsOnPayment.Add(0.471127166181807); - strikes.Add(0.796); stdDevsOnExpiry.Add(0.46970891225311); stdDevsOnPayment.Add(0.471337790254505); - strikes.Add(0.797); stdDevsOnExpiry.Add(0.469952407632943); stdDevsOnPayment.Add(0.47156461617895); - strikes.Add(0.798); stdDevsOnExpiry.Add(0.470151631125534); stdDevsOnPayment.Add(0.471733115437108); - strikes.Add(0.799); stdDevsOnExpiry.Add(0.47026231084364); stdDevsOnPayment.Add(0.471937258769108); - strikes.Add(0.8); stdDevsOnExpiry.Add(0.470499481668152); stdDevsOnPayment.Add(0.47205067173133); - strikes.Add(0.801); stdDevsOnExpiry.Add(0.470670244661801); stdDevsOnPayment.Add(0.472283978396473); - strikes.Add(0.802); stdDevsOnExpiry.Add(0.470878954987373); stdDevsOnPayment.Add(0.472442756543584); - strikes.Add(0.803); stdDevsOnExpiry.Add(0.4710275820374); stdDevsOnPayment.Add(0.472737630245361); - strikes.Add(0.804); stdDevsOnExpiry.Add(0.471220480974671); stdDevsOnPayment.Add(0.472880206540726); - strikes.Add(0.805); stdDevsOnExpiry.Add(0.471432353577902); stdDevsOnPayment.Add(0.473081109502377); - strikes.Add(0.806); stdDevsOnExpiry.Add(0.471615765682192); stdDevsOnPayment.Add(0.473246368390186); - strikes.Add(0.807); stdDevsOnExpiry.Add(0.471837125118404); stdDevsOnPayment.Add(0.473450511722186); - strikes.Add(0.808); stdDevsOnExpiry.Add(0.472026861778014); stdDevsOnPayment.Add(0.473625491721043); - strikes.Add(0.809); stdDevsOnExpiry.Add(0.472184975661022); stdDevsOnPayment.Add(0.4738004717199); - strikes.Add(0.81); stdDevsOnExpiry.Add(0.472346251821691); stdDevsOnPayment.Add(0.473991653570503); - strikes.Add(0.811); stdDevsOnExpiry.Add(0.472573935813223); stdDevsOnPayment.Add(0.474179595050757); - strikes.Add(0.812); stdDevsOnExpiry.Add(0.47271307603027); stdDevsOnPayment.Add(0.474377257642059); - strikes.Add(0.813); stdDevsOnExpiry.Add(0.472940760021802); stdDevsOnPayment.Add(0.474513353196725); - strikes.Add(0.814); stdDevsOnExpiry.Add(0.473168444013335); stdDevsOnPayment.Add(0.474730458010122); - strikes.Add(0.815); stdDevsOnExpiry.Add(0.473310746508042); stdDevsOnPayment.Add(0.474931360971772); - strikes.Add(0.816); stdDevsOnExpiry.Add(0.473528943666594); stdDevsOnPayment.Add(0.475148465785169); - strikes.Add(0.817); stdDevsOnExpiry.Add(0.473658597050661); stdDevsOnPayment.Add(0.475359089857867); - strikes.Add(0.818); stdDevsOnExpiry.Add(0.473857820543251); stdDevsOnPayment.Add(0.475485464301486); - strikes.Add(0.819); stdDevsOnExpiry.Add(0.474012772148599); stdDevsOnPayment.Add(0.475702569114883); - strikes.Add(0.82); stdDevsOnExpiry.Add(0.474291052582694); stdDevsOnPayment.Add(0.475906712446883); - strikes.Add(0.821); stdDevsOnExpiry.Add(0.474436517355062); stdDevsOnPayment.Add(0.476046048371899); - strikes.Add(0.822); stdDevsOnExpiry.Add(0.474661039068934); stdDevsOnPayment.Add(0.476269633925994); - strikes.Add(0.823); stdDevsOnExpiry.Add(0.474765394231719); stdDevsOnPayment.Add(0.476399248739962); - strikes.Add(0.824); stdDevsOnExpiry.Add(0.475027863277513); stdDevsOnPayment.Add(0.476626074664406); - strikes.Add(0.825); stdDevsOnExpiry.Add(0.475198626271162); stdDevsOnPayment.Add(0.476807535403962); - strikes.Add(0.826); stdDevsOnExpiry.Add(0.475321955099909); stdDevsOnPayment.Add(0.476953352069676); - strikes.Add(0.827); stdDevsOnExpiry.Add(0.475552801369101); stdDevsOnPayment.Add(0.477144533920279); - strikes.Add(0.828); stdDevsOnExpiry.Add(0.475685617030829); stdDevsOnPayment.Add(0.477355157992977); - strikes.Add(0.829); stdDevsOnExpiry.Add(0.47590065191172); stdDevsOnPayment.Add(0.477539859102882); - strikes.Add(0.83); stdDevsOnExpiry.Add(0.476074577183029); stdDevsOnPayment.Add(0.477718079472088); - strikes.Add(0.831); stdDevsOnExpiry.Add(0.476201068289436); stdDevsOnPayment.Add(0.477876857619199); - strikes.Add(0.832); stdDevsOnExpiry.Add(0.47645721277991); stdDevsOnPayment.Add(0.478097202802945); - strikes.Add(0.833); stdDevsOnExpiry.Add(0.476593190719297); stdDevsOnPayment.Add(0.478281903912849); - strikes.Add(0.834); stdDevsOnExpiry.Add(0.476861984320411); stdDevsOnPayment.Add(0.478489287615198); - strikes.Add(0.835); stdDevsOnExpiry.Add(0.476975826316177); stdDevsOnPayment.Add(0.478589739096024); - strikes.Add(0.836); stdDevsOnExpiry.Add(0.477203510307709); stdDevsOnPayment.Add(0.478803603539071); - strikes.Add(0.837); stdDevsOnExpiry.Add(0.477323676858796); stdDevsOnPayment.Add(0.478991545019325); - strikes.Add(0.838); stdDevsOnExpiry.Add(0.477538711739687); stdDevsOnPayment.Add(0.479166525018182); - strikes.Add(0.839); stdDevsOnExpiry.Add(0.477722123843977); stdDevsOnPayment.Add(0.479399831683325); - strikes.Add(0.84); stdDevsOnExpiry.Add(0.477946645557849); stdDevsOnPayment.Add(0.479503523534499); - strikes.Add(0.841); stdDevsOnExpiry.Add(0.478098434885537); stdDevsOnPayment.Add(0.479688224644404); - strikes.Add(0.842); stdDevsOnExpiry.Add(0.478291333822807); stdDevsOnPayment.Add(0.479979857975832); - strikes.Add(0.843); stdDevsOnExpiry.Add(0.478370390764311); stdDevsOnPayment.Add(0.480073828715959); - strikes.Add(0.844); stdDevsOnExpiry.Add(0.478550640590941); stdDevsOnPayment.Add(0.48027473167761); - strikes.Add(0.845); stdDevsOnExpiry.Add(0.478797298248434); stdDevsOnPayment.Add(0.480427029084022); - strikes.Add(0.846); stdDevsOnExpiry.Add(0.478987034908044); stdDevsOnPayment.Add(0.480624691675324); - strikes.Add(0.847); stdDevsOnExpiry.Add(0.479119850569771); stdDevsOnPayment.Add(0.48080291204453); - strikes.Add(0.848); stdDevsOnExpiry.Add(0.479338047728323); stdDevsOnPayment.Add(0.48096493056199); - strikes.Add(0.849); stdDevsOnExpiry.Add(0.479568893997515); stdDevsOnPayment.Add(0.481162593153292); - strikes.Add(0.85); stdDevsOnExpiry.Add(0.479749143824145); stdDevsOnPayment.Add(0.48137321722599); - strikes.Add(0.851); stdDevsOnExpiry.Add(0.47985033670927); stdDevsOnPayment.Add(0.481509312780656); - strikes.Add(0.852); stdDevsOnExpiry.Add(0.480043235646541); stdDevsOnPayment.Add(0.481719936853355); - strikes.Add(0.853); stdDevsOnExpiry.Add(0.48022348547317); stdDevsOnPayment.Add(0.481875474630116); - strikes.Add(0.854); stdDevsOnExpiry.Add(0.480324678358296); stdDevsOnPayment.Add(0.48210554092491); - strikes.Add(0.855); stdDevsOnExpiry.Add(0.48060295879239); stdDevsOnPayment.Add(0.48226755944237); - strikes.Add(0.856); stdDevsOnExpiry.Add(0.480716800788156); stdDevsOnPayment.Add(0.482432818330179); - strikes.Add(0.857); stdDevsOnExpiry.Add(0.480988756666931); stdDevsOnPayment.Add(0.482607798329037); - strikes.Add(0.858); stdDevsOnExpiry.Add(0.481096274107377); stdDevsOnPayment.Add(0.482773057216846); - strikes.Add(0.859); stdDevsOnExpiry.Add(0.481238576602084); stdDevsOnPayment.Add(0.482977200548846); - strikes.Add(0.86); stdDevsOnExpiry.Add(0.481456773760636); stdDevsOnPayment.Add(0.48316190165875); - strikes.Add(0.861); stdDevsOnExpiry.Add(0.481573778034062); stdDevsOnPayment.Add(0.483278554991322); - strikes.Add(0.862); stdDevsOnExpiry.Add(0.481833084802196); stdDevsOnPayment.Add(0.483495659804718); - strikes.Add(0.863); stdDevsOnExpiry.Add(0.481978549574564); stdDevsOnPayment.Add(0.483647957211131); - strikes.Add(0.864); stdDevsOnExpiry.Add(0.482136663457572); stdDevsOnPayment.Add(0.483819696839639); - strikes.Add(0.865); stdDevsOnExpiry.Add(0.482345373783143); stdDevsOnPayment.Add(0.484001157579194); - strikes.Add(0.866); stdDevsOnExpiry.Add(0.482462378056569); stdDevsOnPayment.Add(0.484208541281543); - strikes.Add(0.867); stdDevsOnExpiry.Add(0.482705873436402); stdDevsOnPayment.Add(0.484289550540273); - strikes.Add(0.868); stdDevsOnExpiry.Add(0.482908259206653); stdDevsOnPayment.Add(0.48454878016821); - strikes.Add(0.869); stdDevsOnExpiry.Add(0.483072697644982); stdDevsOnPayment.Add(0.484769125351956); - strikes.Add(0.87); stdDevsOnExpiry.Add(0.483180215085428); stdDevsOnPayment.Add(0.484911701647321); - strikes.Add(0.871); stdDevsOnExpiry.Add(0.483461657797183); stdDevsOnPayment.Add(0.485086681646178); - strikes.Add(0.872); stdDevsOnExpiry.Add(0.483537552461027); stdDevsOnPayment.Add(0.485219536830495); - strikes.Add(0.873); stdDevsOnExpiry.Add(0.483692504066375); stdDevsOnPayment.Add(0.485446362754939); - strikes.Add(0.874); stdDevsOnExpiry.Add(0.483831644283422); stdDevsOnPayment.Add(0.485559775717161); - strikes.Add(0.875); stdDevsOnExpiry.Add(0.484037192331333); stdDevsOnPayment.Add(0.485760678678812); - strikes.Add(0.876); stdDevsOnExpiry.Add(0.484242740379244); stdDevsOnPayment.Add(0.485987504603256); - strikes.Add(0.877); stdDevsOnExpiry.Add(0.484366069207991); stdDevsOnPayment.Add(0.486104157935828); - strikes.Add(0.878); stdDevsOnExpiry.Add(0.484596915477183); stdDevsOnPayment.Add(0.486282378305034); - strikes.Add(0.879); stdDevsOnExpiry.Add(0.484707595195289); stdDevsOnPayment.Add(0.486489762007383); - strikes.Add(0.88); stdDevsOnExpiry.Add(0.484849897689996); stdDevsOnPayment.Add(0.486612896080653); - strikes.Add(0.881); stdDevsOnExpiry.Add(0.48509655534749); stdDevsOnPayment.Add(0.486758712746367); - strikes.Add(0.882); stdDevsOnExpiry.Add(0.485254669230498); stdDevsOnPayment.Add(0.486956375337668); - strikes.Add(0.883); stdDevsOnExpiry.Add(0.485498164610331); stdDevsOnPayment.Add(0.48715403792897); - strikes.Add(0.884); stdDevsOnExpiry.Add(0.485574059274175); stdDevsOnPayment.Add(0.487290133483636); - strikes.Add(0.885); stdDevsOnExpiry.Add(0.485691063547601); stdDevsOnPayment.Add(0.487416507927255); - strikes.Add(0.886); stdDevsOnExpiry.Add(0.485899773873172); stdDevsOnPayment.Add(0.487610930148207); - strikes.Add(0.887); stdDevsOnExpiry.Add(0.486171729751947); stdDevsOnPayment.Add(0.487782669776715); - strikes.Add(0.888); stdDevsOnExpiry.Add(0.486307707691334); stdDevsOnPayment.Add(0.488009495701159); - strikes.Add(0.889); stdDevsOnExpiry.Add(0.486519580294565); stdDevsOnPayment.Add(0.488165033477921); - strikes.Add(0.89); stdDevsOnExpiry.Add(0.486627097735011); stdDevsOnPayment.Add(0.488314090513985); - strikes.Add(0.891); stdDevsOnExpiry.Add(0.486769400229719); stdDevsOnPayment.Add(0.488476109031445); - strikes.Add(0.892); stdDevsOnExpiry.Add(0.486943325501028); stdDevsOnPayment.Add(0.488631646808207); - strikes.Add(0.893); stdDevsOnExpiry.Add(0.487107763939357); stdDevsOnPayment.Add(0.488829309399508); - strikes.Add(0.894); stdDevsOnExpiry.Add(0.487297500598967); stdDevsOnPayment.Add(0.488962164583825); - strikes.Add(0.895); stdDevsOnExpiry.Add(0.487420829427713); stdDevsOnPayment.Add(0.489172788656524); - strikes.Add(0.896); stdDevsOnExpiry.Add(0.487642188863925); stdDevsOnPayment.Add(0.489318605322238); - strikes.Add(0.897); stdDevsOnExpiry.Add(0.487809789579914); stdDevsOnPayment.Add(0.489493585321095); - strikes.Add(0.898); stdDevsOnExpiry.Add(0.487952092074622); stdDevsOnPayment.Add(0.489655603838555); - strikes.Add(0.899); stdDevsOnExpiry.Add(0.48810388140231); stdDevsOnPayment.Add(0.48987918939265); - strikes.Add(0.9); stdDevsOnExpiry.Add(0.488334727671502); stdDevsOnPayment.Add(0.49000232346592); - strikes.Add(0.901); stdDevsOnExpiry.Add(0.48847703016621); stdDevsOnPayment.Add(0.490232389760713); - strikes.Add(0.902); stdDevsOnExpiry.Add(0.488660442270499); stdDevsOnPayment.Add(0.490349043093285); - strikes.Add(0.903); stdDevsOnExpiry.Add(0.488847016652449); stdDevsOnPayment.Add(0.490475417536904); - strikes.Add(0.904); stdDevsOnExpiry.Add(0.488938722704594); stdDevsOnPayment.Add(0.490699003090999); - strikes.Add(0.905); stdDevsOnExpiry.Add(0.48904624014504); stdDevsOnPayment.Add(0.490838339016015); - strikes.Add(0.906); stdDevsOnExpiry.Add(0.489264437303591); stdDevsOnPayment.Add(0.491026280496268); - strikes.Add(0.907); stdDevsOnExpiry.Add(0.489409902075959); stdDevsOnPayment.Add(0.491175337532332); - strikes.Add(0.908); stdDevsOnExpiry.Add(0.489647072900472); stdDevsOnPayment.Add(0.491392442345728); - strikes.Add(0.909); stdDevsOnExpiry.Add(0.489760914896238); stdDevsOnPayment.Add(0.491515576418998); - strikes.Add(0.91); stdDevsOnExpiry.Add(0.48999492344309); stdDevsOnPayment.Add(0.491658152714363); - strikes.Add(0.911); stdDevsOnExpiry.Add(0.49018149782504); stdDevsOnPayment.Add(0.491872017157411); - strikes.Add(0.912); stdDevsOnExpiry.Add(0.490190984658021); stdDevsOnPayment.Add(0.491975709008585); - strikes.Add(0.913); stdDevsOnExpiry.Add(0.490466102814455); stdDevsOnPayment.Add(0.492170131229537); - strikes.Add(0.914); stdDevsOnExpiry.Add(0.490611567586823); stdDevsOnPayment.Add(0.49236131308014); - strikes.Add(0.915); stdDevsOnExpiry.Add(0.490785492858132); stdDevsOnPayment.Add(0.492529812338299); - strikes.Add(0.916); stdDevsOnExpiry.Add(0.490908821686879); stdDevsOnPayment.Add(0.492701551966807); - strikes.Add(0.917); stdDevsOnExpiry.Add(0.491032150515626); stdDevsOnPayment.Add(0.492831166780775); - strikes.Add(0.918); stdDevsOnExpiry.Add(0.491244023118857); stdDevsOnPayment.Add(0.492983464187188); - strikes.Add(0.919); stdDevsOnExpiry.Add(0.491373676502924); stdDevsOnPayment.Add(0.493194088259886); - strikes.Add(0.92); stdDevsOnExpiry.Add(0.491534952663592); stdDevsOnPayment.Add(0.493245934185473); - strikes.Add(0.921); stdDevsOnExpiry.Add(0.491737338433843); stdDevsOnPayment.Add(0.493557009738997); - strikes.Add(0.922); stdDevsOnExpiry.Add(0.491952373314735); stdDevsOnPayment.Add(0.493641259368076); - strikes.Add(0.923); stdDevsOnExpiry.Add(0.49205672847752); stdDevsOnPayment.Add(0.493845402700076); - strikes.Add(0.924); stdDevsOnExpiry.Add(0.492227491471169); stdDevsOnPayment.Add(0.493978257884393); - strikes.Add(0.925); stdDevsOnExpiry.Add(0.492376118521197); stdDevsOnPayment.Add(0.494130555290806); - strikes.Add(0.926); stdDevsOnExpiry.Add(0.492569017458467); stdDevsOnPayment.Add(0.49431849677106); - strikes.Add(0.927); stdDevsOnExpiry.Add(0.492682859454234); stdDevsOnPayment.Add(0.494457832696075); - strikes.Add(0.928); stdDevsOnExpiry.Add(0.492882082946824); stdDevsOnPayment.Add(0.494665216398424); - strikes.Add(0.929); stdDevsOnExpiry.Add(0.49298643810961); stdDevsOnPayment.Add(0.494749466027504); - strikes.Add(0.93); stdDevsOnExpiry.Add(0.493214122101142); stdDevsOnPayment.Add(0.494986013062996); - strikes.Add(0.931); stdDevsOnExpiry.Add(0.493350100040529); stdDevsOnPayment.Add(0.495105906765916); - strikes.Add(0.932); stdDevsOnExpiry.Add(0.493524025311838); stdDevsOnPayment.Add(0.495329492320011); - strikes.Add(0.933); stdDevsOnExpiry.Add(0.493713761971448); stdDevsOnPayment.Add(0.495446145652583); - strikes.Add(0.934); stdDevsOnExpiry.Add(0.493887687242758); stdDevsOnPayment.Add(0.495562798985154); - strikes.Add(0.935); stdDevsOnExpiry.Add(0.494052125681086); stdDevsOnPayment.Add(0.495763701946804); - strikes.Add(0.936); stdDevsOnExpiry.Add(0.494143831733231); stdDevsOnPayment.Add(0.495948403056709); - strikes.Add(0.937); stdDevsOnExpiry.Add(0.494355704336463); stdDevsOnPayment.Add(0.496084498611376); - strikes.Add(0.938); stdDevsOnExpiry.Add(0.494539116440752); stdDevsOnPayment.Add(0.496282161202677); - strikes.Add(0.939); stdDevsOnExpiry.Add(0.494615011104596); stdDevsOnPayment.Add(0.496437698979439); - strikes.Add(0.94); stdDevsOnExpiry.Add(0.494782611820585); stdDevsOnPayment.Add(0.496599717496899); - strikes.Add(0.941); stdDevsOnExpiry.Add(0.494886966983371); stdDevsOnPayment.Add(0.496790899347502); - strikes.Add(0.942); stdDevsOnExpiry.Add(0.495174734250446); stdDevsOnPayment.Add(0.496878389346931); - strikes.Add(0.943); stdDevsOnExpiry.Add(0.495323361300474); stdDevsOnPayment.Add(0.497037167494042); - strikes.Add(0.944); stdDevsOnExpiry.Add(0.495459339239861); stdDevsOnPayment.Add(0.497176503419057); - strikes.Add(0.945); stdDevsOnExpiry.Add(0.495519422515405); stdDevsOnPayment.Add(0.497338521936518); - strikes.Add(0.946); stdDevsOnExpiry.Add(0.495721808285655); stdDevsOnPayment.Add(0.497562107490613); - strikes.Add(0.947); stdDevsOnExpiry.Add(0.495921031778246); stdDevsOnPayment.Add(0.497701443415628); - strikes.Add(0.948); stdDevsOnExpiry.Add(0.496066496550614); stdDevsOnPayment.Add(0.497837538970295); - strikes.Add(0.949); stdDevsOnExpiry.Add(0.496218285878302); stdDevsOnPayment.Add(0.49801899970985); - strikes.Add(0.95); stdDevsOnExpiry.Add(0.496385886594291); stdDevsOnPayment.Add(0.498219902671501); - strikes.Add(0.951); stdDevsOnExpiry.Add(0.496525026811338); stdDevsOnPayment.Add(0.498268508226739); - strikes.Add(0.952); stdDevsOnExpiry.Add(0.496676816139026); stdDevsOnPayment.Add(0.498498574521533); - strikes.Add(0.953); stdDevsOnExpiry.Add(0.496793820412452); stdDevsOnPayment.Add(0.498628189335501); - strikes.Add(0.954); stdDevsOnExpiry.Add(0.497049964902926); stdDevsOnPayment.Add(0.498812890445405); - strikes.Add(0.955); stdDevsOnExpiry.Add(0.497189105119973); stdDevsOnPayment.Add(0.499013793407056); - strikes.Add(0.956); stdDevsOnExpiry.Add(0.497347219002982); stdDevsOnPayment.Add(0.499172571554167); - strikes.Add(0.957); stdDevsOnExpiry.Add(0.497476872387049); stdDevsOnPayment.Add(0.49924385970185); - strikes.Add(0.958); stdDevsOnExpiry.Add(0.4976792581573); stdDevsOnPayment.Add(0.499503089329786); - strikes.Add(0.959); stdDevsOnExpiry.Add(0.497770964209444); stdDevsOnPayment.Add(0.499593819699564); - strikes.Add(0.96); stdDevsOnExpiry.Add(0.497998648200977); stdDevsOnPayment.Add(0.499726674883881); - strikes.Add(0.961); stdDevsOnExpiry.Add(0.498042920088219); stdDevsOnPayment.Add(0.499937298956579); - strikes.Add(0.962); stdDevsOnExpiry.Add(0.498204196248888); stdDevsOnPayment.Add(0.500031269696706); - strikes.Add(0.963); stdDevsOnExpiry.Add(0.49842871796276); stdDevsOnPayment.Add(0.500203009325214); - strikes.Add(0.964); stdDevsOnExpiry.Add(0.498517261737244); stdDevsOnPayment.Add(0.500345585620579); - strikes.Add(0.965); stdDevsOnExpiry.Add(0.498672213342592); stdDevsOnPayment.Add(0.500436315990357); - strikes.Add(0.966); stdDevsOnExpiry.Add(0.49881767811496); stdDevsOnPayment.Add(0.500689064877594); - strikes.Add(0.967); stdDevsOnExpiry.Add(0.499076984883094); stdDevsOnPayment.Add(0.500792756728769); - strikes.Add(0.968); stdDevsOnExpiry.Add(0.499200313711841); stdDevsOnPayment.Add(0.501006621171816); - strikes.Add(0.969); stdDevsOnExpiry.Add(0.499415348592732); stdDevsOnPayment.Add(0.50107466894915); - strikes.Add(0.97); stdDevsOnExpiry.Add(0.499513379200197); stdDevsOnPayment.Add(0.501343619688134); - strikes.Add(0.971); stdDevsOnExpiry.Add(0.499665168527885); stdDevsOnPayment.Add(0.501431109687562); - strikes.Add(0.972); stdDevsOnExpiry.Add(0.499769523690671); stdDevsOnPayment.Add(0.50160284931607); - strikes.Add(0.973); stdDevsOnExpiry.Add(0.499911826185378); stdDevsOnPayment.Add(0.50172598338934); - strikes.Add(0.974); stdDevsOnExpiry.Add(0.500098400567328); stdDevsOnPayment.Add(0.501894482647498); - strikes.Add(0.975); stdDevsOnExpiry.Add(0.500281812671618); stdDevsOnPayment.Add(0.502037058942863); - strikes.Add(0.976); stdDevsOnExpiry.Add(0.500370356446103); stdDevsOnPayment.Add(0.502263884867308); - strikes.Add(0.977); stdDevsOnExpiry.Add(0.50050000983017); stdDevsOnPayment.Add(0.502344894126038); - strikes.Add(0.978); stdDevsOnExpiry.Add(0.500702395600421); stdDevsOnPayment.Add(0.502506912643498); - strikes.Add(0.979); stdDevsOnExpiry.Add(0.500844698095128); stdDevsOnPayment.Add(0.502568479680133); - strikes.Add(0.98); stdDevsOnExpiry.Add(0.501091355752621); stdDevsOnPayment.Add(0.502827709308069); - strikes.Add(0.981); stdDevsOnExpiry.Add(0.501129303084543); stdDevsOnPayment.Add(0.502980006714482); - strikes.Add(0.982); stdDevsOnExpiry.Add(0.501338013410114); stdDevsOnPayment.Add(0.503096660047053); - strikes.Add(0.983); stdDevsOnExpiry.Add(0.501540399180365); stdDevsOnPayment.Add(0.503375331897085); - strikes.Add(0.984); stdDevsOnExpiry.Add(0.501644754343151); stdDevsOnPayment.Add(0.503423937452323); - strikes.Add(0.985); stdDevsOnExpiry.Add(0.501720649006995); stdDevsOnPayment.Add(0.503621600043624); - strikes.Add(0.986); stdDevsOnExpiry.Add(0.501954657553847); stdDevsOnPayment.Add(0.503806301153529); - strikes.Add(0.987); stdDevsOnExpiry.Add(0.502096960048555); stdDevsOnPayment.Add(0.503929435226798); - strikes.Add(0.988); stdDevsOnExpiry.Add(0.502210802044321); stdDevsOnPayment.Add(0.504078492262862); - strikes.Add(0.989); stdDevsOnExpiry.Add(0.502406863259251); stdDevsOnPayment.Add(0.504175703373338); - strikes.Add(0.99); stdDevsOnExpiry.Add(0.502596599918861); stdDevsOnPayment.Add(0.50437012559429); - strikes.Add(0.991); stdDevsOnExpiry.Add(0.502659845472065); stdDevsOnPayment.Add(0.504447894482671); - strikes.Add(0.992); stdDevsOnExpiry.Add(0.502811634799753); stdDevsOnPayment.Add(0.504713604851306); - strikes.Add(0.993); stdDevsOnExpiry.Add(0.502903340851898); stdDevsOnPayment.Add(0.504713604851306); - strikes.Add(0.994); stdDevsOnExpiry.Add(0.503083590678527); stdDevsOnPayment.Add(0.504924228924004); - strikes.Add(0.995); stdDevsOnExpiry.Add(0.503304950114739); stdDevsOnPayment.Add(0.505095968552512); - strikes.Add(0.996); stdDevsOnExpiry.Add(0.503384007056243); stdDevsOnPayment.Add(0.505189939292639); - strikes.Add(0.997); stdDevsOnExpiry.Add(0.503529471828611); stdDevsOnPayment.Add(0.505390842254289); - strikes.Add(0.998); stdDevsOnExpiry.Add(0.503712883932901); stdDevsOnPayment.Add(0.505611187438035); - strikes.Add(0.999); stdDevsOnExpiry.Add(0.503858348705269); stdDevsOnPayment.Add(0.505695437067115); - strikes.Add(1); stdDevsOnExpiry.Add(0.504029111698918); stdDevsOnPayment.Add(0.505818571140384); - strikes.Add(1.001); stdDevsOnExpiry.Add(0.504127142306383); stdDevsOnPayment.Add(0.505964387806099); - strikes.Add(1.002); stdDevsOnExpiry.Add(0.504301067577692); stdDevsOnPayment.Add(0.506139367804955); - - //Create smiles on Expiry Date - smilesOnExpiry = new List(); - smilesOnExpiry.Add(new FlatSmileSection(startDate, flatVol, rangeCouponDayCount)); - double dummyAtmLevel = 0; - smilesOnExpiry.Add(new InterpolatedSmileSection(startDate, - strikes, stdDevsOnExpiry, dummyAtmLevel, rangeCouponDayCount)); - //Create smiles on Payment Date - smilesOnPayment = new List(); - smilesOnPayment.Add(new FlatSmileSection(endDate, flatVol, rangeCouponDayCount)); - smilesOnPayment.Add(new InterpolatedSmileSection(endDate, - strikes, stdDevsOnPayment, dummyAtmLevel, rangeCouponDayCount, new Linear())); - - Utils.QL_REQUIRE(smilesOnExpiry.Count == smilesOnPayment.Count, () => - "smilesOnExpiry.size()!=smilesOnPayment.size()"); - } - - public CommonVars() - { - - //General Settings - calendar = new TARGET(); - today = new Date(39147); // 6 Mar 2007 - Settings.setEvaluationDate(today); - settlement = today; - //create Yield Curve - createYieldCurve(); - referenceDate = termStructure.link.referenceDate(); - // Ibor index - iborIndex = new Euribor6M(termStructure); - - // create Volatility Structures - flatVol = 0.1; - createVolatilityStructures(); - - // Range Accrual valuation - gearing = 1.0; - spread = 0.0; - infiniteLowerStrike = 1.0e-9; - infiniteUpperStrike = 1.0; - correlation = 1.0; - - startDate = new Date(42800); //6 Mar 2017 - endDate = new Date(42984); //6 Sep 2017 - paymentDate = endDate; //6 Sep 2017 - fixingDays = 2; - rangeCouponDayCount = iborIndex.dayCounter(); - - // observations schedule - observationsConvention = BusinessDayConvention.ModifiedFollowing; - observationsFrequency = Frequency.Daily; - observationSchedule = new Schedule(startDate, endDate, - new Period(observationsFrequency), calendar, observationsConvention, observationsConvention, - DateGeneration.Rule.Forward, false); - // Range accrual pricers properties - byCallSpread = new List(); - byCallSpread.Add(true); - byCallSpread.Add(false); - - //Create smiles sections - createSmileSections(); - - //test parameters - rateTolerance = 2.0e-8; - priceTolerance = 2.0e-4; - } - } - -#if NET452 - [TestMethod()] -#else - [Fact] -#endif - public void testInfiniteRange() - { - // Testing infinite range accrual floaters - CommonVars vars = new CommonVars(); - - //Coupon - RangeAccrualFloatersCoupon coupon = new RangeAccrualFloatersCoupon(vars.paymentDate, - 1.0, - vars.iborIndex, - vars.startDate, - vars.endDate, - vars.fixingDays, - vars.rangeCouponDayCount, - vars.gearing, vars.spread, - vars.startDate, vars.endDate, - vars.observationSchedule, - vars.infiniteLowerStrike, - vars.infiniteUpperStrike); - Date fixingDate = coupon.fixingDate(); - - for (int z = 0; z < vars.smilesOnPayment.Count; z++) - { - for (int i = 0; i < vars.byCallSpread.Count; i++) - { - RangeAccrualPricer bgmPricer = new RangeAccrualPricerByBgm(vars.correlation, - vars.smilesOnExpiry[z], vars.smilesOnPayment[z], - true, vars.byCallSpread[i]); - - coupon.setPricer(bgmPricer); - - //Computation - double rate = coupon.rate(); - double indexfixing = vars.iborIndex.fixing(fixingDate); - double difference = rate - indexfixing; - - if (Math.Abs(difference) > vars.rateTolerance) - { - QAssert.Fail("\n" + - "i:\t" + i + "\n" + - "fixingDate:\t" + fixingDate + "\n" + - "startDate:\t" + vars.startDate + "\n" + - "range accrual rate:\t" + rate + "\n" + - "index fixing:\t" + indexfixing + "\n" + - "difference:\t" + difference + "\n" + - "tolerance: \t" + vars.rateTolerance); - } - - } - } - } - -#if NET452 - [TestMethod()] -#else - [Fact] -#endif - public void testPriceMonotonicityWithRespectToLowerStrike() - { - // Testing price monotonicity with respect to the lower strike - CommonVars vars = new CommonVars(); - - for (int z = 0; z < vars.smilesOnPayment.Count; z++) - { - for (int i = 0; i < vars.byCallSpread.Count; i++) - { - RangeAccrualPricer bgmPricer = new RangeAccrualPricerByBgm(vars.correlation, - vars.smilesOnExpiry[z], - vars.smilesOnPayment[z], - true, - vars.byCallSpread[i]); - - double effectiveLowerStrike; - double previousPrice = 100.0; - - for (int k = 1; k < 100; k++) - { - effectiveLowerStrike = 0.005 + k * 0.001; - RangeAccrualFloatersCoupon coupon = new RangeAccrualFloatersCoupon( - vars.paymentDate, - 1.0, - vars.iborIndex, - vars.startDate, - vars.endDate, - vars.fixingDays, - vars.rangeCouponDayCount, - vars.gearing, vars.spread, - vars.startDate, vars.endDate, - vars.observationSchedule, - effectiveLowerStrike, - vars.infiniteUpperStrike); - - coupon.setPricer(bgmPricer); - - //Computation - double price = coupon.price(vars.termStructure); - - if (previousPrice <= price) - { - QAssert.Fail("\n" + - "i:\t" + i + "\n" + - "k:\t" + k + "\n" + - "Price at lower strike\t" + (effectiveLowerStrike - 0.001) + - ": \t" + previousPrice + "\n" + - "Price at lower strike\t" + effectiveLowerStrike + - ": \t" + price + "\n"); - } - - previousPrice = price; - } - } - } - } - -#if NET452 - [TestMethod()] -#else - [Fact] -#endif - public void testPriceMonotonicityWithRespectToUpperStrike() - { - - // Testing price monotonicity with respect to the upper strike - - CommonVars vars = new CommonVars(); - - for (int z = 0; z < vars.smilesOnPayment.Count; z++) - { - for (int i = 0; i < vars.byCallSpread.Count; i++) - { - RangeAccrualPricer bgmPricer = new RangeAccrualPricerByBgm(vars.correlation, - vars.smilesOnExpiry[z], - vars.smilesOnPayment[z], - true, - vars.byCallSpread[i]); - - double effectiveUpperStrike; - double previousPrice = 0.0; - - for (int k = 1; k < 95; k++) - { - effectiveUpperStrike = 0.006 + k * 0.001; - RangeAccrualFloatersCoupon coupon = new RangeAccrualFloatersCoupon( - vars.paymentDate, - 1.0, - vars.iborIndex, - vars.startDate, - vars.endDate, - vars.fixingDays, - vars.rangeCouponDayCount, - vars.gearing, vars.spread, - vars.startDate, vars.endDate, - vars.observationSchedule, - .004, - effectiveUpperStrike); - - coupon.setPricer(bgmPricer); - - //Computation - double price = coupon.price(vars.termStructure); - - if (previousPrice > price) - { - Assert.Fail("\n" + - "i:\t" + i + "\n" + - "k:\t" + k + "\n" + - "Price at upper strike\t" + (effectiveUpperStrike - 0.001) + - ": \t" + previousPrice + "\n" + - "Price at upper strike\t" + effectiveUpperStrike + - ": \t" + price + "\n"); - } - previousPrice = price; - } - } - } - } - } -} +//// Copyright (C) 2008-2018 Andrea Maggiulli (a.maggiulli@gmail.com) +//// +//// This file is part of QLNet Project https://github.com/amaggiulli/qlnet +//// QLNet is free software: you can redistribute it and/or modify it +//// under the terms of the QLNet license. You should have received a +//// copy of the license along with this program; if not, license is +//// available at . +//// +//// QLNet is a based on QuantLib, a free-software/open-source library +//// for financial quantitative analysts and developers - http://quantlib.org/ +//// The QuantLib license is available online at http://quantlib.org/license.shtml. +//// +//// This program is distributed in the hope that it will be useful, but WITHOUT +//// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +//// FOR A PARTICULAR PURPOSE. See the license for more details. + +//using System; +//using System.Collections.Generic; +//using Xunit; +//using QLNet; + +//namespace TestSuite +//{ + +// public class T_RangeAccrual +// { +// private class CommonVars +// { +// // General settings +// public Date referenceDate, today, settlement; +// public Calendar calendar; + +// // Volatility Stuctures +// public List> swaptionVolatilityStructures; +// public Handle atmVol; +// public Handle flatSwaptionVolatilityCube1; +// public Handle flatSwaptionVolatilityCube2; +// public Handle swaptionVolatilityCubeBySabr; + +// public List atmOptionTenors, optionTenors; +// public List atmSwapTenors, swapTenors; +// public List strikeSpreads; + +// public Matrix atmVolMatrix, volSpreadsMatrix; +// public List>> volSpreads; + +// public DayCounter dayCounter; +// public BusinessDayConvention optionBDC; +// public int swapSettlementDays; +// public bool vegaWeightedSmileFit; + +// // Range Accrual valuation +// public double infiniteLowerStrike, infiniteUpperStrike; +// public double gearing, correlation; +// public double spread; +// public Date startDate; +// public Date endDate; +// public Date paymentDate; +// public int fixingDays; +// public DayCounter rangeCouponDayCount; +// public Schedule observationSchedule; +// // Observation Schedule conventions +// public Frequency observationsFrequency; +// public BusinessDayConvention observationsConvention; + +// // Term Structure +// public RelinkableHandle termStructure = new RelinkableHandle(); + +// // indices and index conventions +// public Frequency fixedLegFrequency; +// public BusinessDayConvention fixedLegConvention; +// public DayCounter fixedLegDayCounter; +// public IborIndex iborIndex; + +// // Range accrual pricers properties +// public List byCallSpread; +// public double flatVol; +// public List smilesOnExpiry; +// public List smilesOnPayment; + +// //test parameters +// public double rateTolerance; +// public double priceTolerance; + + +// // cleanup +// SavedSettings backup = new SavedSettings(); + +// public void createYieldCurve() +// { + +// // Yield Curve +// List dates = new List(); +// dates.Add(new Date(39147)); dates.Add(new Date(39148)); dates.Add(new Date(39151)); +// dates.Add(new Date(39153)); dates.Add(new Date(39159)); dates.Add(new Date(39166)); +// dates.Add(new Date(39183)); dates.Add(new Date(39294)); dates.Add(new Date(39384)); +// dates.Add(new Date(39474)); dates.Add(new Date(39567)); dates.Add(new Date(39658)); +// dates.Add(new Date(39748)); dates.Add(new Date(39839)); dates.Add(new Date(39931)); +// dates.Add(new Date(40250)); dates.Add(new Date(40614)); dates.Add(new Date(40978)); +// dates.Add(new Date(41344)); dates.Add(new Date(41709)); dates.Add(new Date(42074)); +// dates.Add(new Date(42441)); dates.Add(new Date(42805)); dates.Add(new Date(43170)); +// dates.Add(new Date(43535)); dates.Add(new Date(43900)); dates.Add(new Date(44268)); +// dates.Add(new Date(44632)); dates.Add(new Date(44996)); dates.Add(new Date(45361)); +// dates.Add(new Date(45727)); dates.Add(new Date(46092)); dates.Add(new Date(46459)); +// dates.Add(new Date(46823)); dates.Add(new Date(47188)); dates.Add(new Date(47553)); +// dates.Add(new Date(47918)); dates.Add(new Date(48283)); dates.Add(new Date(48650)); +// dates.Add(new Date(49014)); dates.Add(new Date(49379)); dates.Add(new Date(49744)); +// dates.Add(new Date(50110)); dates.Add(new Date(53762)); dates.Add(new Date(57415)); +// dates.Add(new Date(61068)); + +// List zeroRates = new List(); +// zeroRates.Add(0.02676568527); zeroRates.Add(0.02676568527); +// zeroRates.Add(0.02676333038); zeroRates.Add(0.02682286201); +// zeroRates.Add(0.02682038347); zeroRates.Add(0.02683030208); +// zeroRates.Add(0.02700136766); zeroRates.Add(0.02932526033); +// zeroRates.Add(0.03085568949); zeroRates.Add(0.03216370631); +// zeroRates.Add(0.03321234116); zeroRates.Add(0.03404978072); +// zeroRates.Add(0.03471117149); zeroRates.Add(0.03527141916); +// zeroRates.Add(0.03574660393); zeroRates.Add(0.03691715582); +// zeroRates.Add(0.03796468718); zeroRates.Add(0.03876457629); +// zeroRates.Add(0.03942029708); zeroRates.Add(0.03999925325); +// zeroRates.Add(0.04056663618); zeroRates.Add(0.04108743922); +// zeroRates.Add(0.04156156761); zeroRates.Add(0.0419979179); +// zeroRates.Add(0.04239486483); zeroRates.Add(0.04273799032); +// zeroRates.Add(0.04305531203); zeroRates.Add(0.04336417578); +// zeroRates.Add(0.04364017665); zeroRates.Add(0.04388153459); +// zeroRates.Add(0.04408005012); zeroRates.Add(0.04424764425); +// zeroRates.Add(0.04437504759); zeroRates.Add(0.04447696334); +// zeroRates.Add(0.04456212318); zeroRates.Add(0.04464090072); +// zeroRates.Add(0.0447068707); zeroRates.Add(0.04475921774); +// zeroRates.Add(0.04477418345); zeroRates.Add(0.04477880755); +// zeroRates.Add(0.04476692489); zeroRates.Add(0.04473779454); +// zeroRates.Add(0.04468646066); zeroRates.Add(0.04430951558); +// zeroRates.Add(0.04363922313); zeroRates.Add(0.04363601992); + +// termStructure.linkTo(new InterpolatedZeroCurve(dates, zeroRates, new Actual365Fixed())); +// } + +// public void createVolatilityStructures() +// { + +// // ATM swaptionvol matrix +// optionBDC = BusinessDayConvention.Following; + +// atmOptionTenors = new List(); +// atmOptionTenors.Add(new Period(1, TimeUnit.Months)); +// atmOptionTenors.Add(new Period(6, TimeUnit.Months)); +// atmOptionTenors.Add(new Period(1, TimeUnit.Years)); +// atmOptionTenors.Add(new Period(5, TimeUnit.Years)); +// atmOptionTenors.Add(new Period(10, TimeUnit.Years)); +// atmOptionTenors.Add(new Period(30, TimeUnit.Years)); + +// atmSwapTenors = new List(); +// atmSwapTenors.Add(new Period(1, TimeUnit.Years)); +// atmSwapTenors.Add(new Period(5, TimeUnit.Years)); +// atmSwapTenors.Add(new Period(10, TimeUnit.Years)); +// atmSwapTenors.Add(new Period(30, TimeUnit.Years)); + +// atmVolMatrix = new Matrix(atmOptionTenors.Count, atmSwapTenors.Count); + +// atmVolMatrix[0, 0] = flatVol; atmVolMatrix[0, 1] = flatVol; atmVolMatrix[0, 2] = flatVol; atmVolMatrix[0, 3] = flatVol; +// atmVolMatrix[1, 0] = flatVol; atmVolMatrix[1, 1] = flatVol; atmVolMatrix[1, 2] = flatVol; atmVolMatrix[1, 3] = flatVol; +// atmVolMatrix[2, 0] = flatVol; atmVolMatrix[2, 1] = flatVol; atmVolMatrix[2, 2] = flatVol; atmVolMatrix[2, 3] = flatVol; +// atmVolMatrix[3, 0] = flatVol; atmVolMatrix[3, 1] = flatVol; atmVolMatrix[3, 2] = flatVol; atmVolMatrix[3, 3] = flatVol; +// atmVolMatrix[4, 0] = flatVol; atmVolMatrix[4, 1] = flatVol; atmVolMatrix[4, 2] = flatVol; atmVolMatrix[4, 3] = flatVol; +// atmVolMatrix[5, 0] = flatVol; atmVolMatrix[5, 1] = flatVol; atmVolMatrix[5, 2] = flatVol; atmVolMatrix[5, 3] = flatVol; + +// int nRowsAtmVols = atmVolMatrix.rows(); +// int nColsAtmVols = atmVolMatrix.columns(); + + +// //swaptionvolcube +// optionTenors = new List(); +// optionTenors.Add(new Period(1, TimeUnit.Years)); +// optionTenors.Add(new Period(10, TimeUnit.Years)); +// optionTenors.Add(new Period(30, TimeUnit.Years)); + +// swapTenors = new List(); +// swapTenors.Add(new Period(2, TimeUnit.Years)); +// swapTenors.Add(new Period(10, TimeUnit.Years)); +// swapTenors.Add(new Period(30, TimeUnit.Years)); + +// strikeSpreads = new List(); +// strikeSpreads.Add(-0.020); +// strikeSpreads.Add(-0.005); +// strikeSpreads.Add(+0.000); +// strikeSpreads.Add(+0.005); +// strikeSpreads.Add(+0.020); + +// int nRows = optionTenors.Count * swapTenors.Count; +// int nCols = strikeSpreads.Count; +// volSpreadsMatrix = new Matrix(nRows, nCols); +// volSpreadsMatrix[0, 0] = 0.0599; volSpreadsMatrix[0, 1] = 0.0049; +// volSpreadsMatrix[0, 2] = 0.0000; +// volSpreadsMatrix[0, 3] = -0.0001; volSpreadsMatrix[0, 4] = 0.0127; + +// volSpreadsMatrix[1, 0] = 0.0729; volSpreadsMatrix[1, 1] = 0.0086; +// volSpreadsMatrix[1, 2] = 0.0000; +// volSpreadsMatrix[1, 3] = -0.0024; volSpreadsMatrix[1, 4] = 0.0098; + +// volSpreadsMatrix[2, 0] = 0.0738; volSpreadsMatrix[2, 1] = 0.0102; +// volSpreadsMatrix[2, 2] = 0.0000; +// volSpreadsMatrix[2, 3] = -0.0039; volSpreadsMatrix[2, 4] = 0.0065; + +// volSpreadsMatrix[3, 0] = 0.0465; volSpreadsMatrix[3, 1] = 0.0063; +// volSpreadsMatrix[3, 2] = 0.0000; +// volSpreadsMatrix[3, 3] = -0.0032; volSpreadsMatrix[3, 4] = -0.0010; + +// volSpreadsMatrix[4, 0] = 0.0558; volSpreadsMatrix[4, 1] = 0.0084; +// volSpreadsMatrix[4, 2] = 0.0000; +// volSpreadsMatrix[4, 3] = -0.0050; volSpreadsMatrix[4, 4] = -0.0057; + +// volSpreadsMatrix[5, 0] = 0.0576; volSpreadsMatrix[5, 1] = 0.0083; +// volSpreadsMatrix[5, 2] = 0.0000; +// volSpreadsMatrix[5, 3] = -0.0043; volSpreadsMatrix[5, 4] = -0.0014; + +// volSpreadsMatrix[6, 0] = 0.0437; volSpreadsMatrix[6, 1] = 0.0059; +// volSpreadsMatrix[6, 2] = 0.0000; +// volSpreadsMatrix[6, 3] = -0.0030; volSpreadsMatrix[6, 4] = -0.0006; + +// volSpreadsMatrix[7, 0] = 0.0533; volSpreadsMatrix[7, 1] = 0.0078; +// volSpreadsMatrix[7, 2] = 0.0000; +// volSpreadsMatrix[7, 3] = -0.0045; volSpreadsMatrix[7, 4] = -0.0046; + +// volSpreadsMatrix[8, 0] = 0.0545; volSpreadsMatrix[8, 1] = 0.0079; +// volSpreadsMatrix[8, 2] = 0.0000; +// volSpreadsMatrix[8, 3] = -0.0042; volSpreadsMatrix[8, 4] = -0.0020; + + +// swapSettlementDays = 2; +// fixedLegFrequency = Frequency.Annual; +// fixedLegConvention = BusinessDayConvention.Unadjusted; +// fixedLegDayCounter = new Thirty360(); +// SwapIndex swapIndexBase = new EuriborSwapIsdaFixA(new Period(2, TimeUnit.Years), termStructure); + +// SwapIndex shortSwapIndexBase = new EuriborSwapIsdaFixA(new Period(1, TimeUnit.Years), termStructure); + +// vegaWeightedSmileFit = false; + +// // ATM Volatility structure +// List>> atmVolsHandle; +// atmVolsHandle = new InitializedList>>(nRowsAtmVols); +// int i; +// for (i = 0; i < nRowsAtmVols; i++) +// { +// atmVolsHandle[i] = new InitializedList>(nColsAtmVols); +// for (int j = 0; j < nColsAtmVols; j++) +// { +// atmVolsHandle[i][j] = new Handle(new SimpleQuote(atmVolMatrix[i, j])); +// } +// } + +// dayCounter = new Actual365Fixed(); + +// atmVol = new Handle(new SwaptionVolatilityMatrix(calendar, +// optionBDC, atmOptionTenors, atmSwapTenors, atmVolsHandle, dayCounter)); + +// // Volatility Cube without smile +// List>> parametersGuess = new InitializedList>>(optionTenors.Count * swapTenors.Count); +// for (i = 0; i < optionTenors.Count * swapTenors.Count; i++) +// { +// parametersGuess[i] = new InitializedList>(4); +// parametersGuess[i][0] = new Handle(new SimpleQuote(0.2)); +// parametersGuess[i][1] = new Handle(new SimpleQuote(0.5)); +// parametersGuess[i][2] = new Handle(new SimpleQuote(0.4)); +// parametersGuess[i][3] = new Handle(new SimpleQuote(0.0)); +// } +// List isParameterFixed = new InitializedList(4, false); +// isParameterFixed[1] = true; + +// List>> nullVolSpreads = new InitializedList>>(nRows); +// for (i = 0; i < optionTenors.Count * swapTenors.Count; i++) +// { +// nullVolSpreads[i] = new InitializedList>(nCols); +// for (int j = 0; j < strikeSpreads.Count; j++) +// { +// nullVolSpreads[i][j] = new Handle(new SimpleQuote(0.0)); +// } +// } + +// SwaptionVolCube1x flatSwaptionVolatilityCube1ptr = new SwaptionVolCube1x( +// atmVol, optionTenors, swapTenors, strikeSpreads, nullVolSpreads, swapIndexBase, +// shortSwapIndexBase, vegaWeightedSmileFit, parametersGuess, isParameterFixed, +// false); +// flatSwaptionVolatilityCube1 = new Handle(flatSwaptionVolatilityCube1ptr); +// flatSwaptionVolatilityCube1.link.enableExtrapolation(); + +// SwaptionVolCube2 flatSwaptionVolatilityCube2ptr = new SwaptionVolCube2(atmVol, +// optionTenors, swapTenors, strikeSpreads, nullVolSpreads, swapIndexBase, +// shortSwapIndexBase, vegaWeightedSmileFit); +// flatSwaptionVolatilityCube2 = new Handle(flatSwaptionVolatilityCube2ptr); +// flatSwaptionVolatilityCube2.link.enableExtrapolation(); + + +// // Volatility Cube with smile +// volSpreads = new InitializedList>>(nRows); +// for (i = 0; i < optionTenors.Count * swapTenors.Count; i++) +// { +// volSpreads[i] = new InitializedList>(nCols); +// for (int j = 0; j < strikeSpreads.Count; j++) +// { +// volSpreads[i][j] = new Handle(new SimpleQuote(volSpreadsMatrix[i, j])); +// } +// } + +// SwaptionVolCube1x swaptionVolatilityCubeBySabrPtr = new SwaptionVolCube1x( +// atmVol, +// optionTenors, +// swapTenors, +// strikeSpreads, +// volSpreads, +// swapIndexBase, +// shortSwapIndexBase, +// vegaWeightedSmileFit, +// parametersGuess, +// isParameterFixed, +// false); +// swaptionVolatilityCubeBySabr = new Handle(swaptionVolatilityCubeBySabrPtr); +// swaptionVolatilityCubeBySabr.link.enableExtrapolation(); + +// swaptionVolatilityStructures = new List>(); +// swaptionVolatilityStructures.Add(flatSwaptionVolatilityCube2); +// swaptionVolatilityStructures.Add(swaptionVolatilityCubeBySabr); +// } + +// public void createSmileSections() +// { +// List strikes = new List(), stdDevsOnExpiry = new List(), stdDevsOnPayment = new List(); +// strikes.Add(0.003); stdDevsOnExpiry.Add(2.45489828353233); stdDevsOnPayment.Add(1.66175264544155); +// strikes.Add(0.004); stdDevsOnExpiry.Add(2.10748097295326); stdDevsOnPayment.Add(1.46691241671427); +// strikes.Add(0.005); stdDevsOnExpiry.Add(1.87317517200074); stdDevsOnPayment.Add(1.32415790098009); +// strikes.Add(0.006); stdDevsOnExpiry.Add(1.69808302023488); stdDevsOnPayment.Add(1.21209617319357); +// strikes.Add(0.007); stdDevsOnExpiry.Add(1.55911989073644); stdDevsOnPayment.Add(1.12016686638666); +// strikes.Add(0.008); stdDevsOnExpiry.Add(1.44436083444893); stdDevsOnPayment.Add(1.04242066059821); +// strikes.Add(0.009); stdDevsOnExpiry.Add(1.34687413874126); stdDevsOnPayment.Add(0.975173254741177); +// strikes.Add(0.01); stdDevsOnExpiry.Add(1.26228953588707); stdDevsOnPayment.Add(0.916013813275761); +// strikes.Add(0.011); stdDevsOnExpiry.Add(1.18769456816136); stdDevsOnPayment.Add(0.863267064731419); +// strikes.Add(0.012); stdDevsOnExpiry.Add(1.12104324191799); stdDevsOnPayment.Add(0.815743793189994); +// strikes.Add(0.013); stdDevsOnExpiry.Add(1.06085561121201); stdDevsOnPayment.Add(0.772552896805455); +// strikes.Add(0.014); stdDevsOnExpiry.Add(1.00603120341767); stdDevsOnPayment.Add(0.733033340026564); +// strikes.Add(0.015); stdDevsOnExpiry.Add(0.955725690399709); stdDevsOnPayment.Add(0.696673144338147); +// strikes.Add(0.016); stdDevsOnExpiry.Add(0.909281318404816); stdDevsOnPayment.Add(0.663070503816902); +// strikes.Add(0.017); stdDevsOnExpiry.Add(0.866185798452041); stdDevsOnPayment.Add(0.631911102538957); +// strikes.Add(0.018); stdDevsOnExpiry.Add(0.826018547612582); stdDevsOnPayment.Add(0.602948672357772); +// strikes.Add(0.019); stdDevsOnExpiry.Add(0.788447526732122); stdDevsOnPayment.Add(0.575982310311697); +// strikes.Add(0.02); stdDevsOnExpiry.Add(0.753200779931885); stdDevsOnPayment.Add(0.550849997883271); +// strikes.Add(0.021); stdDevsOnExpiry.Add(0.720053785498); stdDevsOnPayment.Add(0.527428600999225); +// strikes.Add(0.022); stdDevsOnExpiry.Add(0.688823131326177); stdDevsOnPayment.Add(0.505604706697337); +// strikes.Add(0.023); stdDevsOnExpiry.Add(0.659357028088728); stdDevsOnPayment.Add(0.485294065348527); +// strikes.Add(0.024); stdDevsOnExpiry.Add(0.631532146956907); stdDevsOnPayment.Add(0.466418908064414); +// strikes.Add(0.025); stdDevsOnExpiry.Add(0.605247295045587); stdDevsOnPayment.Add(0.448904706326966); +// strikes.Add(0.026); stdDevsOnExpiry.Add(0.580413928580285); stdDevsOnPayment.Add(0.432686652729201); +// strikes.Add(0.027); stdDevsOnExpiry.Add(0.556962477452476); stdDevsOnPayment.Add(0.417699939864133); +// strikes.Add(0.028); stdDevsOnExpiry.Add(0.534829696108958); stdDevsOnPayment.Add(0.403876519954429); +// strikes.Add(0.029); stdDevsOnExpiry.Add(0.513968150384827); stdDevsOnPayment.Add(0.391145104852406); +// strikes.Add(0.03); stdDevsOnExpiry.Add(0.494330406115181); stdDevsOnPayment.Add(0.379434406410383); +// strikes.Add(0.031); stdDevsOnExpiry.Add(0.475869029135118); stdDevsOnPayment.Add(0.368669896110328); +// strikes.Add(0.032); stdDevsOnExpiry.Add(0.458549234390376); stdDevsOnPayment.Add(0.358777045434208); +// strikes.Add(0.033); stdDevsOnExpiry.Add(0.442329912271372); stdDevsOnPayment.Add(0.349678085493644); +// strikes.Add(0.034); stdDevsOnExpiry.Add(0.427163628613205); stdDevsOnPayment.Add(0.341304968511301); +// strikes.Add(0.035); stdDevsOnExpiry.Add(0.413009273806291); stdDevsOnPayment.Add(0.333586406339497); +// strikes.Add(0.036); stdDevsOnExpiry.Add(0.399819413685729); stdDevsOnPayment.Add(0.326457591571248); +// strikes.Add(0.037); stdDevsOnExpiry.Add(0.387546614086615); stdDevsOnPayment.Add(0.31985630909585); +// strikes.Add(0.038); stdDevsOnExpiry.Add(0.376137116288728); stdDevsOnPayment.Add(0.313728768765505); +// strikes.Add(0.039); stdDevsOnExpiry.Add(0.365540323849504); stdDevsOnPayment.Add(0.308024420802767); +// strikes.Add(0.04); stdDevsOnExpiry.Add(0.35570564032638); stdDevsOnPayment.Add(0.30269822405978); +// strikes.Add(0.041); stdDevsOnExpiry.Add(0.346572982443814); stdDevsOnPayment.Add(0.297710321981251); +// strikes.Add(0.042); stdDevsOnExpiry.Add(0.338091753759242); stdDevsOnPayment.Add(0.293025394530372); +// strikes.Add(0.043); stdDevsOnExpiry.Add(0.330211357830103); stdDevsOnPayment.Add(0.288612334151791); +// strikes.Add(0.044); stdDevsOnExpiry.Add(0.322881198213832); stdDevsOnPayment.Add(0.284443273660505); +// strikes.Add(0.045); stdDevsOnExpiry.Add(0.316056686795423); stdDevsOnPayment.Add(0.280494558352965); +// strikes.Add(0.046); stdDevsOnExpiry.Add(0.309691654321036); stdDevsOnPayment.Add(0.276744153710797); +// strikes.Add(0.047); stdDevsOnExpiry.Add(0.303745307408855); stdDevsOnPayment.Add(0.273174237697079); +// strikes.Add(0.048); stdDevsOnExpiry.Add(0.298180014954725); stdDevsOnPayment.Add(0.269767960385995); +// strikes.Add(0.049); stdDevsOnExpiry.Add(0.292961308132149); stdDevsOnPayment.Add(0.266511064148011); +// strikes.Add(0.05); stdDevsOnExpiry.Add(0.288057880392292); stdDevsOnPayment.Add(0.263391235575797); +// strikes.Add(0.051); stdDevsOnExpiry.Add(0.283441587463978); stdDevsOnPayment.Add(0.260399077595342); +// strikes.Add(0.052); stdDevsOnExpiry.Add(0.279088079809224); stdDevsOnPayment.Add(0.257518712391935); +// strikes.Add(0.053); stdDevsOnExpiry.Add(0.274968896929089); stdDevsOnPayment.Add(0.254747223632261); +// strikes.Add(0.054); stdDevsOnExpiry.Add(0.271067594979739); stdDevsOnPayment.Add(0.252074566168237); +// strikes.Add(0.055); stdDevsOnExpiry.Add(0.267364567839682); stdDevsOnPayment.Add(0.249494259259166); +// strikes.Add(0.056); stdDevsOnExpiry.Add(0.263842422981787); stdDevsOnPayment.Add(0.246999498127314); +// strikes.Add(0.057); stdDevsOnExpiry.Add(0.26048629770105); stdDevsOnPayment.Add(0.244584774143087); +// strikes.Add(0.058); stdDevsOnExpiry.Add(0.257282594203533); stdDevsOnPayment.Add(0.242244902713927); +// strikes.Add(0.059); stdDevsOnExpiry.Add(0.254218979606362); stdDevsOnPayment.Add(0.23997567135838); +// strikes.Add(0.06); stdDevsOnExpiry.Add(0.251284385937726); stdDevsOnPayment.Add(0.237772543557956); +// strikes.Add(0.061); stdDevsOnExpiry.Add(0.248469326364644); stdDevsOnPayment.Add(0.235632278942307); +// strikes.Add(0.062); stdDevsOnExpiry.Add(0.245764630281902); stdDevsOnPayment.Add(0.233550665029978); +// strikes.Add(0.063); stdDevsOnExpiry.Add(0.243162391995349); stdDevsOnPayment.Add(0.231525109524691); +// strikes.Add(0.064); stdDevsOnExpiry.Add(0.240655338266368); stdDevsOnPayment.Add(0.22955269609313); +// strikes.Add(0.065); stdDevsOnExpiry.Add(0.238237144539637); stdDevsOnPayment.Add(0.227630508401982); +// strikes.Add(0.066); stdDevsOnExpiry.Add(0.235901802487603); stdDevsOnPayment.Add(0.225756278192003); +// strikes.Add(0.067); stdDevsOnExpiry.Add(0.233643936238243); stdDevsOnPayment.Add(0.223927413166912); +// strikes.Add(0.068); stdDevsOnExpiry.Add(0.2314584861473); stdDevsOnPayment.Add(0.222142617178571); +// strikes.Add(0.069); stdDevsOnExpiry.Add(0.229341341253818); stdDevsOnPayment.Add(0.220398973893664); +// strikes.Add(0.07); stdDevsOnExpiry.Add(0.22728807436907); stdDevsOnPayment.Add(0.218695187164053); +// strikes.Add(0.071); stdDevsOnExpiry.Add(0.225295206987632); stdDevsOnPayment.Add(0.217029636804562); +// strikes.Add(0.072); stdDevsOnExpiry.Add(0.223359576831843); stdDevsOnPayment.Add(0.215400702630017); +// strikes.Add(0.073); stdDevsOnExpiry.Add(0.221477389168511); stdDevsOnPayment.Add(0.213806764455244); +// strikes.Add(0.074); stdDevsOnExpiry.Add(0.219646430403273); stdDevsOnPayment.Add(0.212246202095067); +// strikes.Add(0.075); stdDevsOnExpiry.Add(0.21786353825847); stdDevsOnPayment.Add(0.210718367475417); +// strikes.Add(0.076); stdDevsOnExpiry.Add(0.21612649913974); stdDevsOnPayment.Add(0.20922164041112); +// strikes.Add(0.077); stdDevsOnExpiry.Add(0.214433415680486); stdDevsOnPayment.Add(0.20775504879107); +// strikes.Add(0.078); stdDevsOnExpiry.Add(0.212781441830814); stdDevsOnPayment.Add(0.206317296467129); +// strikes.Add(0.079); stdDevsOnExpiry.Add(0.21116931267966); stdDevsOnPayment.Add(0.20490741132819); +// strikes.Add(0.08); stdDevsOnExpiry.Add(0.209594814632662); stdDevsOnPayment.Add(0.203524745300185); +// strikes.Add(0.081); stdDevsOnExpiry.Add(0.20805636655099); stdDevsOnPayment.Add(0.202168002234973); +// strikes.Add(0.082); stdDevsOnExpiry.Add(0.20655270352358); stdDevsOnPayment.Add(0.20083621002145); +// strikes.Add(0.083); stdDevsOnExpiry.Add(0.20508161195607); stdDevsOnPayment.Add(0.199529044622581); +// strikes.Add(0.084); stdDevsOnExpiry.Add(0.203642775620693); stdDevsOnPayment.Add(0.198245209890227); +// strikes.Add(0.085); stdDevsOnExpiry.Add(0.202233980923088); stdDevsOnPayment.Add(0.196984381787351); +// strikes.Add(0.086); stdDevsOnExpiry.Add(0.200854279179957); stdDevsOnPayment.Add(0.195745912239886); +// strikes.Add(0.087); stdDevsOnExpiry.Add(0.199503037935767); stdDevsOnPayment.Add(0.19452850509969); +// strikes.Add(0.088); stdDevsOnExpiry.Add(0.198178676051688); stdDevsOnPayment.Add(0.193332160366764); +// strikes.Add(0.089); stdDevsOnExpiry.Add(0.196880244844423); stdDevsOnPayment.Add(0.192155905930003); +// strikes.Add(0.09); stdDevsOnExpiry.Add(0.195606795630673); stdDevsOnPayment.Add(0.190999417752372); +// strikes.Add(0.091); stdDevsOnExpiry.Add(0.194357695954907); stdDevsOnPayment.Add(0.189861723722766); +// strikes.Add(0.092); stdDevsOnExpiry.Add(0.19313168090606); stdDevsOnPayment.Add(0.188742823841186); +// strikes.Add(0.093); stdDevsOnExpiry.Add(0.191928434256365); stdDevsOnPayment.Add(0.187641745996527); +// strikes.Add(0.094); stdDevsOnExpiry.Add(0.190746691094761); stdDevsOnPayment.Add(0.186558166151753); +// strikes.Add(0.095); stdDevsOnExpiry.Add(0.189586451421245); stdDevsOnPayment.Add(0.185491436232795); +// strikes.Add(0.096); stdDevsOnExpiry.Add(0.188446134096988); stdDevsOnPayment.Add(0.184441556239653); +// strikes.Add(0.097); stdDevsOnExpiry.Add(0.18732573912199); stdDevsOnPayment.Add(0.183407878098257); +// strikes.Add(0.098); stdDevsOnExpiry.Add(0.186224317812954); stdDevsOnPayment.Add(0.182390725845642); +// strikes.Add(0.099); stdDevsOnExpiry.Add(0.185141553942112); stdDevsOnPayment.Add(0.181386859111458); +// strikes.Add(0.1); stdDevsOnExpiry.Add(0.184076498826167); stdDevsOnPayment.Add(0.180399194229021); +// strikes.Add(0.101); stdDevsOnExpiry.Add(0.18302915246512); stdDevsOnPayment.Add(0.17942643505019); +// strikes.Add(0.102); stdDevsOnExpiry.Add(0.181999514858969); stdDevsOnPayment.Add(0.178466637352756); +// strikes.Add(0.103); stdDevsOnExpiry.Add(0.180984739957821); stdDevsOnPayment.Add(0.177521421321893); +// strikes.Add(0.104); stdDevsOnExpiry.Add(0.179986725128272); stdDevsOnPayment.Add(0.176590462920567); +// strikes.Add(0.105); stdDevsOnExpiry.Add(0.179004521687023); stdDevsOnPayment.Add(0.175677650593196); +// strikes.Add(0.106); stdDevsOnExpiry.Add(0.178041924367268); stdDevsOnPayment.Add(0.17476516230286); +// strikes.Add(0.107); stdDevsOnExpiry.Add(0.177083754236237); stdDevsOnPayment.Add(0.173873088345724); +// strikes.Add(0.108); stdDevsOnExpiry.Add(0.176145822682231); stdDevsOnPayment.Add(0.173000456610684); +// strikes.Add(0.109); stdDevsOnExpiry.Add(0.175227181021952); stdDevsOnPayment.Add(0.172122316246049); +// strikes.Add(0.11); stdDevsOnExpiry.Add(0.174309488044971); stdDevsOnPayment.Add(0.171266858473859); +// strikes.Add(0.111); stdDevsOnExpiry.Add(0.173412982328314); stdDevsOnPayment.Add(0.170434407331149); +// strikes.Add(0.112); stdDevsOnExpiry.Add(0.172536715188681); stdDevsOnPayment.Add(0.169585106262623); +// strikes.Add(0.113); stdDevsOnExpiry.Add(0.171706301075121); stdDevsOnPayment.Add(0.168765292564274); +// strikes.Add(0.114); stdDevsOnExpiry.Add(0.17079651379229); stdDevsOnPayment.Add(0.167976586421278); +// strikes.Add(0.115); stdDevsOnExpiry.Add(0.169963569856602); stdDevsOnPayment.Add(0.167267917425907); +// strikes.Add(0.116); stdDevsOnExpiry.Add(0.169192922790819); stdDevsOnPayment.Add(0.166364178135514); +// strikes.Add(0.117); stdDevsOnExpiry.Add(0.168289776291075); stdDevsOnPayment.Add(0.165629586177349); +// strikes.Add(0.118); stdDevsOnExpiry.Add(0.167505847659119); stdDevsOnPayment.Add(0.165014239848036); +// strikes.Add(0.119); stdDevsOnExpiry.Add(0.166813308851542); stdDevsOnPayment.Add(0.164618590628398); +// strikes.Add(0.12); stdDevsOnExpiry.Add(0.166305130831553); stdDevsOnPayment.Add(0.164530452554899); +// strikes.Add(0.121); stdDevsOnExpiry.Add(0.166077130612255); stdDevsOnPayment.Add(0.162925173083904); +// strikes.Add(0.122); stdDevsOnExpiry.Add(0.164586116695486); stdDevsOnPayment.Add(0.162717141307485); +// strikes.Add(0.123); stdDevsOnExpiry.Add(0.164242693341591); stdDevsOnPayment.Add(0.162840275380755); +// strikes.Add(0.124); stdDevsOnExpiry.Add(0.164213284159352); stdDevsOnPayment.Add(0.163289714748189); +// strikes.Add(0.125); stdDevsOnExpiry.Add(0.164516546586962); stdDevsOnPayment.Add(0.16401944615083); +// strikes.Add(0.126); stdDevsOnExpiry.Add(0.165118644253458); stdDevsOnPayment.Add(0.164961421811344); +// strikes.Add(0.127); stdDevsOnExpiry.Add(0.165959810111063); stdDevsOnPayment.Add(0.166058935248619); +// strikes.Add(0.128); stdDevsOnExpiry.Add(0.166976798606573); stdDevsOnPayment.Add(0.16725625209265); +// strikes.Add(0.129); stdDevsOnExpiry.Add(0.168115851019766); stdDevsOnPayment.Add(0.16851675615849); +// strikes.Add(0.13); stdDevsOnExpiry.Add(0.169332063007866); stdDevsOnPayment.Add(0.16981808889073); +// strikes.Add(0.131); stdDevsOnExpiry.Add(0.170600136349594); stdDevsOnPayment.Add(0.171139511919136); +// strikes.Add(0.132); stdDevsOnExpiry.Add(0.171891926773773); stdDevsOnPayment.Add(0.172468711836379); +// strikes.Add(0.133); stdDevsOnExpiry.Add(0.173201742180614); stdDevsOnPayment.Add(0.173801476161007); +// strikes.Add(0.134); stdDevsOnExpiry.Add(0.17451282249852); stdDevsOnPayment.Add(0.175129703967145); +// strikes.Add(0.135); stdDevsOnExpiry.Add(0.175823902816426); stdDevsOnPayment.Add(0.17645371929183); +// strikes.Add(0.136); stdDevsOnExpiry.Add(0.177132453312204); stdDevsOnPayment.Add(0.177767365431397); +// strikes.Add(0.137); stdDevsOnExpiry.Add(0.178433098113831); stdDevsOnPayment.Add(0.179076475052476); +// strikes.Add(0.138); stdDevsOnExpiry.Add(0.17972646967684); stdDevsOnPayment.Add(0.180372947229192); +// strikes.Add(0.139); stdDevsOnExpiry.Add(0.181011935545698); stdDevsOnPayment.Add(0.181660994443001); +// strikes.Add(0.14); stdDevsOnExpiry.Add(0.182286965898278); stdDevsOnPayment.Add(0.182938996508727); +// strikes.Add(0.141); stdDevsOnExpiry.Add(0.18355314187341); stdDevsOnPayment.Add(0.18420889764858); +// strikes.Add(0.142); stdDevsOnExpiry.Add(0.184810147243326); stdDevsOnPayment.Add(0.185468105566281); +// strikes.Add(0.143); stdDevsOnExpiry.Add(0.186056717096965); stdDevsOnPayment.Add(0.186718888521073); +// strikes.Add(0.144); stdDevsOnExpiry.Add(0.187295381256453); stdDevsOnPayment.Add(0.187958006142609); +// strikes.Add(0.145); stdDevsOnExpiry.Add(0.188523609899662); stdDevsOnPayment.Add(0.189190318986411); +// strikes.Add(0.146); stdDevsOnExpiry.Add(0.189745197759785); stdDevsOnPayment.Add(0.190412586682131); +// strikes.Add(0.147); stdDevsOnExpiry.Add(0.190955085192566); stdDevsOnPayment.Add(0.191624809229768); +// strikes.Add(0.148); stdDevsOnExpiry.Add(0.186502914474815); stdDevsOnPayment.Add(0.192830226999672); +// strikes.Add(0.149); stdDevsOnExpiry.Add(0.187658094504074); stdDevsOnPayment.Add(0.194024951547423); +// strikes.Add(0.15); stdDevsOnExpiry.Add(0.188817069266526); stdDevsOnPayment.Add(0.195212547280407); +// strikes.Add(0.151); stdDevsOnExpiry.Add(0.189958019046315); stdDevsOnPayment.Add(0.196391394013447); +// strikes.Add(0.152); stdDevsOnExpiry.Add(0.191090746904187); stdDevsOnPayment.Add(0.197560195598405); +// strikes.Add(0.153); stdDevsOnExpiry.Add(0.192215885295675); stdDevsOnPayment.Add(0.19871895203528); +// strikes.Add(0.154); stdDevsOnExpiry.Add(0.193335331587374); stdDevsOnPayment.Add(0.199872523879597); +// strikes.Add(0.155); stdDevsOnExpiry.Add(0.194446555957158); stdDevsOnPayment.Add(0.195112095799581); +// strikes.Add(0.156); stdDevsOnExpiry.Add(0.195547028582896); stdDevsOnPayment.Add(0.196220302459009); +// strikes.Add(0.157); stdDevsOnExpiry.Add(0.196646236297571); stdDevsOnPayment.Add(0.197317167822215); +// strikes.Add(0.158); stdDevsOnExpiry.Add(0.197736589634797); stdDevsOnPayment.Add(0.198405608222512); +// strikes.Add(0.159); stdDevsOnExpiry.Add(0.198811131583722); stdDevsOnPayment.Add(0.19949340054874); +// strikes.Add(0.16); stdDevsOnExpiry.Add(0.199887570899243); stdDevsOnPayment.Add(0.200565963134326); +// strikes.Add(0.161); stdDevsOnExpiry.Add(0.20095167733189); stdDevsOnPayment.Add(0.201636905534738); +// strikes.Add(0.162); stdDevsOnExpiry.Add(0.20200756184262); stdDevsOnPayment.Add(0.202695534527823); +// strikes.Add(0.163); stdDevsOnExpiry.Add(0.203061232758988); stdDevsOnPayment.Add(0.203753839483873); +// strikes.Add(0.164); stdDevsOnExpiry.Add(0.204112690080994); stdDevsOnPayment.Add(0.204791730106723); +// strikes.Add(0.165); stdDevsOnExpiry.Add(0.205146754875869); stdDevsOnPayment.Add(0.205839341840621); +// strikes.Add(0.166); stdDevsOnExpiry.Add(0.206178289848616); stdDevsOnPayment.Add(0.206869779611668); +// strikes.Add(0.167); stdDevsOnExpiry.Add(0.207207294999235); stdDevsOnPayment.Add(0.207893412604981); +// strikes.Add(0.168); stdDevsOnExpiry.Add(0.208224599722511); stdDevsOnPayment.Add(0.208916397524225); +// strikes.Add(0.169); stdDevsOnExpiry.Add(0.209234947434935); stdDevsOnPayment.Add(0.209924476739862); +// strikes.Add(0.17); stdDevsOnExpiry.Add(0.210235175858846); stdDevsOnPayment.Add(0.210934824214744); +// strikes.Add(0.171); stdDevsOnExpiry.Add(0.211231609549565); stdDevsOnPayment.Add(0.211933506356369); +// strikes.Add(0.172); stdDevsOnExpiry.Add(0.212231205517945); stdDevsOnPayment.Add(0.212931216386889); +// strikes.Add(0.173); stdDevsOnExpiry.Add(0.213219101058981); stdDevsOnPayment.Add(0.213916613010082); +// strikes.Add(0.174); stdDevsOnExpiry.Add(0.214192133895015); stdDevsOnPayment.Add(0.2149003894481); +// strikes.Add(0.175); stdDevsOnExpiry.Add(0.215167064097645); stdDevsOnPayment.Add(0.215876064960245); +// strikes.Add(0.176); stdDevsOnExpiry.Add(0.216146105261233); stdDevsOnPayment.Add(0.216845259731692); +// strikes.Add(0.177); stdDevsOnExpiry.Add(0.217099215748008); stdDevsOnPayment.Add(0.217806029540231); +// strikes.Add(0.178); stdDevsOnExpiry.Add(0.218056437195741); stdDevsOnPayment.Add(0.218763558978421); +// strikes.Add(0.179); stdDevsOnExpiry.Add(0.219005120493791); stdDevsOnPayment.Add(0.219722060527715); +// strikes.Add(0.18); stdDevsOnExpiry.Add(0.219951273969714); stdDevsOnPayment.Add(0.220671489040032); +// strikes.Add(0.181); stdDevsOnExpiry.Add(0.220885410790527); stdDevsOnPayment.Add(0.221608280107987); +// strikes.Add(0.182); stdDevsOnExpiry.Add(0.221831248038684); stdDevsOnPayment.Add(0.222542154842628); +// strikes.Add(0.183); stdDevsOnExpiry.Add(0.222757162937581); stdDevsOnPayment.Add(0.223469224799535); +// strikes.Add(0.184); stdDevsOnExpiry.Add(0.223673907231264); stdDevsOnPayment.Add(0.224396942830512); +// strikes.Add(0.185); stdDevsOnExpiry.Add(0.224599189674629); stdDevsOnPayment.Add(0.225315911861546); +// strikes.Add(0.186); stdDevsOnExpiry.Add(0.225503601085437); stdDevsOnPayment.Add(0.226230992448161); +// strikes.Add(0.187); stdDevsOnExpiry.Add(0.226412755912736); stdDevsOnPayment.Add(0.227133759627449); +// strikes.Add(0.188); stdDevsOnExpiry.Add(0.227313372590352); stdDevsOnPayment.Add(0.228049488288135); +// strikes.Add(0.189); stdDevsOnExpiry.Add(0.228216519090096); stdDevsOnPayment.Add(0.228941886282305); +// strikes.Add(0.19); stdDevsOnExpiry.Add(0.229108597618029); stdDevsOnPayment.Add(0.229833312165371); +// strikes.Add(0.191); stdDevsOnExpiry.Add(0.229988343263088); stdDevsOnPayment.Add(0.230724738048437); +// strikes.Add(0.192); stdDevsOnExpiry.Add(0.230883267840916); stdDevsOnPayment.Add(0.231599638042722); +// strikes.Add(0.193); stdDevsOnExpiry.Add(0.231748467008738); stdDevsOnPayment.Add(0.232481018777706); +// strikes.Add(0.194); stdDevsOnExpiry.Add(0.232617460909752); stdDevsOnPayment.Add(0.233360131253445); +// strikes.Add(0.195); stdDevsOnExpiry.Add(0.233487087266298); stdDevsOnPayment.Add(0.234224662062612); +// strikes.Add(0.196); stdDevsOnExpiry.Add(0.234348491700928); stdDevsOnPayment.Add(0.235093405353234); +// strikes.Add(0.197); stdDevsOnExpiry.Add(0.2352057851746); stdDevsOnPayment.Add(0.235946918903214); +// strikes.Add(0.198); stdDevsOnExpiry.Add(0.236064976014868); stdDevsOnPayment.Add(0.236808209342033); +// strikes.Add(0.199); stdDevsOnExpiry.Add(0.236907723011302); stdDevsOnPayment.Add(0.237655242151315); +// strikes.Add(0.2); stdDevsOnExpiry.Add(0.237747940185609); stdDevsOnPayment.Add(0.238496766331003); +// strikes.Add(0.201); stdDevsOnExpiry.Add(0.238590687182044); stdDevsOnPayment.Add(0.239337318399586); +// strikes.Add(0.202); stdDevsOnExpiry.Add(0.239419203929008); stdDevsOnPayment.Add(0.24017916661631); +// strikes.Add(0.203); stdDevsOnExpiry.Add(0.240250882953632); stdDevsOnPayment.Add(0.241003840870182); +// strikes.Add(0.204); stdDevsOnExpiry.Add(0.241075604967404); stdDevsOnPayment.Add(0.241832727605508); +// strikes.Add(0.205); stdDevsOnExpiry.Add(0.24190317303107); stdDevsOnPayment.Add(0.242654809563101); +// strikes.Add(0.206); stdDevsOnExpiry.Add(0.24272251917282); stdDevsOnPayment.Add(0.243478511705869); +// strikes.Add(0.207); stdDevsOnExpiry.Add(0.243530164887227); stdDevsOnPayment.Add(0.244289576404275); +// strikes.Add(0.208); stdDevsOnExpiry.Add(0.24434287024589); stdDevsOnPayment.Add(0.245096752658261); +// strikes.Add(0.209); stdDevsOnExpiry.Add(0.245145772543807); stdDevsOnPayment.Add(0.245903280838178); +// strikes.Add(0.21); stdDevsOnExpiry.Add(0.245951204663852); stdDevsOnPayment.Add(0.246714021499549); +// strikes.Add(0.211); stdDevsOnExpiry.Add(0.246737030662404); stdDevsOnPayment.Add(0.247507912235104); +// strikes.Add(0.212); stdDevsOnExpiry.Add(0.247526967621914); stdDevsOnPayment.Add(0.248306663526183); +// strikes.Add(0.213); stdDevsOnExpiry.Add(0.24831563967036); stdDevsOnPayment.Add(0.2490927773729); +// strikes.Add(0.214); stdDevsOnExpiry.Add(0.249111584957424); stdDevsOnPayment.Add(0.249878243145547); +// strikes.Add(0.215); stdDevsOnExpiry.Add(0.249880650884377); stdDevsOnPayment.Add(0.250649127251622); +// strikes.Add(0.216); stdDevsOnExpiry.Add(0.250656357594417); stdDevsOnPayment.Add(0.251433620913165); +// strikes.Add(0.217); stdDevsOnExpiry.Add(0.251434594126584); stdDevsOnPayment.Add(0.25220580116738); +// strikes.Add(0.218); stdDevsOnExpiry.Add(0.252199549092579); stdDevsOnPayment.Add(0.252970852606827); +// strikes.Add(0.219); stdDevsOnExpiry.Add(0.252961025553147); stdDevsOnPayment.Add(0.253737200194414); +// strikes.Add(0.22); stdDevsOnExpiry.Add(0.253727877885738); stdDevsOnPayment.Add(0.254501279522756); +// strikes.Add(0.221); stdDevsOnExpiry.Add(0.254480499968858); stdDevsOnPayment.Add(0.255269571332552); +// strikes.Add(0.222); stdDevsOnExpiry.Add(0.25523533564634); stdDevsOnPayment.Add(0.256016476698044); +// strikes.Add(0.223); stdDevsOnExpiry.Add(0.255984162996268); stdDevsOnPayment.Add(0.256770834915338); +// strikes.Add(0.224); stdDevsOnExpiry.Add(0.25673583639609); stdDevsOnPayment.Add(0.257510611466062); +// strikes.Add(0.225); stdDevsOnExpiry.Add(0.257477706735166); stdDevsOnPayment.Add(0.258255572609344); +// strikes.Add(0.226); stdDevsOnExpiry.Add(0.258220525757539); stdDevsOnPayment.Add(0.25900280201187); +// strikes.Add(0.227); stdDevsOnExpiry.Add(0.258953541719166); stdDevsOnPayment.Add(0.259739986266314); +// strikes.Add(0.228); stdDevsOnExpiry.Add(0.259691301097284); stdDevsOnPayment.Add(0.260471337854129); +// strikes.Add(0.229); stdDevsOnExpiry.Add(0.260414197770398); stdDevsOnPayment.Add(0.26120171733084); +// strikes.Add(0.23); stdDevsOnExpiry.Add(0.261138359354577); stdDevsOnPayment.Add(0.26193598525197); +// strikes.Add(0.231); stdDevsOnExpiry.Add(0.261857461294499); stdDevsOnPayment.Add(0.262664096469436); +// strikes.Add(0.232); stdDevsOnExpiry.Add(0.262581939106444); stdDevsOnPayment.Add(0.263373413538876); +// strikes.Add(0.233); stdDevsOnExpiry.Add(0.263292502896683); stdDevsOnPayment.Add(0.264094071904539); +// strikes.Add(0.234); stdDevsOnExpiry.Add(0.264006545192349); stdDevsOnPayment.Add(0.26480533319619); +// strikes.Add(0.235); stdDevsOnExpiry.Add(0.264707305921843); stdDevsOnPayment.Add(0.265520482932259); +// strikes.Add(0.236); stdDevsOnExpiry.Add(0.265417869712082); stdDevsOnPayment.Add(0.266215866409198); +// strikes.Add(0.237); stdDevsOnExpiry.Add(0.266128433502322); stdDevsOnPayment.Add(0.266921619071255); +// strikes.Add(0.238); stdDevsOnExpiry.Add(0.266818442487771); stdDevsOnPayment.Add(0.267621215029648); +// strikes.Add(0.239); stdDevsOnExpiry.Add(0.267506237878858); stdDevsOnPayment.Add(0.268319190802866); +// strikes.Add(0.24); stdDevsOnExpiry.Add(0.268213955619203); stdDevsOnPayment.Add(0.269024295390853); +// strikes.Add(0.241); stdDevsOnExpiry.Add(0.268901118554758); stdDevsOnPayment.Add(0.269714494275234); +// strikes.Add(0.242); stdDevsOnExpiry.Add(0.269581956934992); stdDevsOnPayment.Add(0.270383630752344); +// strikes.Add(0.243); stdDevsOnExpiry.Add(0.270257103215438); stdDevsOnPayment.Add(0.271079662303353); +// strikes.Add(0.244); stdDevsOnExpiry.Add(0.270943317467695); stdDevsOnPayment.Add(0.271764028521105); +// strikes.Add(0.245); stdDevsOnExpiry.Add(0.271623207164631); stdDevsOnPayment.Add(0.272445154368508); +// strikes.Add(0.246); stdDevsOnExpiry.Add(0.272295191167417); stdDevsOnPayment.Add(0.273122067734456); +// strikes.Add(0.247); stdDevsOnExpiry.Add(0.272981721647439); stdDevsOnPayment.Add(0.273801573396684); +// strikes.Add(0.248); stdDevsOnExpiry.Add(0.2736334670732); stdDevsOnPayment.Add(0.274467145466411); +// strikes.Add(0.249); stdDevsOnExpiry.Add(0.274298494065133); stdDevsOnPayment.Add(0.275112951277007); +// strikes.Add(0.25); stdDevsOnExpiry.Add(0.274975221484409); stdDevsOnPayment.Add(0.275792456939235); +// strikes.Add(0.251); stdDevsOnExpiry.Add(0.275627599365702); stdDevsOnPayment.Add(0.276450252120124); +// strikes.Add(0.252); stdDevsOnExpiry.Add(0.276287250485613); stdDevsOnPayment.Add(0.277106427115838); +// strikes.Add(0.253); stdDevsOnExpiry.Add(0.27693614986148); stdDevsOnPayment.Add(0.277760009815272); +// strikes.Add(0.254); stdDevsOnExpiry.Add(0.277595168525859); stdDevsOnPayment.Add(0.278409055996218); +// strikes.Add(0.255); stdDevsOnExpiry.Add(0.278247230179386); stdDevsOnPayment.Add(0.279076248251119); +// strikes.Add(0.256); stdDevsOnExpiry.Add(0.27889233482206); stdDevsOnPayment.Add(0.27972043387654); +// strikes.Add(0.257); stdDevsOnExpiry.Add(0.279533328503776); stdDevsOnPayment.Add(0.280366887761207); +// strikes.Add(0.258); stdDevsOnExpiry.Add(0.280163886669214); stdDevsOnPayment.Add(0.281011073386628); +// strikes.Add(0.259); stdDevsOnExpiry.Add(0.280801401845504); stdDevsOnPayment.Add(0.281636464864025); +// strikes.Add(0.26); stdDevsOnExpiry.Add(0.281444609121582); stdDevsOnPayment.Add(0.282278058193167); +// strikes.Add(0.261); stdDevsOnExpiry.Add(0.282062518176379); stdDevsOnPayment.Add(0.2829177073001); +// strikes.Add(0.262); stdDevsOnExpiry.Add(0.282703195630329); stdDevsOnPayment.Add(0.28354990355523); +// strikes.Add(0.263); stdDevsOnExpiry.Add(0.283321420912892); stdDevsOnPayment.Add(0.284173026773382); +// strikes.Add(0.264); stdDevsOnExpiry.Add(0.283962098366842); stdDevsOnPayment.Add(0.284814296065489); +// strikes.Add(0.265); stdDevsOnExpiry.Add(0.284589810482385); stdDevsOnPayment.Add(0.285413116506022); +// strikes.Add(0.266); stdDevsOnExpiry.Add(0.285200130070798); stdDevsOnPayment.Add(0.286036563761209); +// strikes.Add(0.267); stdDevsOnExpiry.Add(0.285821833858787); stdDevsOnPayment.Add(0.286665843683024); +// strikes.Add(0.268); stdDevsOnExpiry.Add(0.286418239425495); stdDevsOnPayment.Add(0.287277625604954); +// strikes.Add(0.269); stdDevsOnExpiry.Add(0.287055438374019); stdDevsOnPayment.Add(0.28788454697136); +// strikes.Add(0.27); stdDevsOnExpiry.Add(0.287650895257428); stdDevsOnPayment.Add(0.288504105782127); +// strikes.Add(0.271); stdDevsOnExpiry.Add(0.288259001251479); stdDevsOnPayment.Add(0.289124960741035); +// strikes.Add(0.272); stdDevsOnExpiry.Add(0.288866474789997); stdDevsOnPayment.Add(0.289720216774184); +// strikes.Add(0.273); stdDevsOnExpiry.Add(0.289457504484683); stdDevsOnPayment.Add(0.29032389777024); +// strikes.Add(0.274); stdDevsOnExpiry.Add(0.290065294250967); stdDevsOnPayment.Add(0.290925958581123); +// strikes.Add(0.275); stdDevsOnExpiry.Add(0.290661383589909); stdDevsOnPayment.Add(0.291521538651306); +// strikes.Add(0.276); stdDevsOnExpiry.Add(0.291270122039491); stdDevsOnPayment.Add(0.292117442758525); +// strikes.Add(0.277); stdDevsOnExpiry.Add(0.291862732873007); stdDevsOnPayment.Add(0.292714643013883); +// strikes.Add(0.278); stdDevsOnExpiry.Add(0.292448070467904); stdDevsOnPayment.Add(0.293307306750752); +// strikes.Add(0.279); stdDevsOnExpiry.Add(0.293031826923971); stdDevsOnPayment.Add(0.293893489746923); +// strikes.Add(0.28); stdDevsOnExpiry.Add(0.293630129857275); stdDevsOnPayment.Add(0.294490365965247); +// strikes.Add(0.281); stdDevsOnExpiry.Add(0.294205348163659); stdDevsOnPayment.Add(0.295054514443043); +// strikes.Add(0.282); stdDevsOnExpiry.Add(0.294780250242278); stdDevsOnPayment.Add(0.295640697439214); +// strikes.Add(0.283); stdDevsOnExpiry.Add(0.295369066342601); stdDevsOnPayment.Add(0.296229796768699); +// strikes.Add(0.284); stdDevsOnExpiry.Add(0.295941122371326); stdDevsOnPayment.Add(0.296821812431499); +// strikes.Add(0.285); stdDevsOnExpiry.Add(0.296506537616964); stdDevsOnPayment.Add(0.297392117612959); +// strikes.Add(0.286); stdDevsOnExpiry.Add(0.297095986172819); stdDevsOnPayment.Add(0.297958858387035); +// strikes.Add(0.287); stdDevsOnExpiry.Add(0.297663931240585); stdDevsOnPayment.Add(0.298539532753612); +// strikes.Add(0.288); stdDevsOnExpiry.Add(0.298226500436329); stdDevsOnPayment.Add(0.299106597564723); +// strikes.Add(0.289); stdDevsOnExpiry.Add(0.298813735397823); stdDevsOnPayment.Add(0.299686299820195); +// strikes.Add(0.29); stdDevsOnExpiry.Add(0.299351322600051); stdDevsOnPayment.Add(0.3002384589277); +// strikes.Add(0.291); stdDevsOnExpiry.Add(0.299931284322926); stdDevsOnPayment.Add(0.300800663183287); +// strikes.Add(0.292); stdDevsOnExpiry.Add(0.300491639924308); stdDevsOnPayment.Add(0.301358978994454); +// strikes.Add(0.293); stdDevsOnExpiry.Add(0.30104408983154); stdDevsOnPayment.Add(0.30192507169446); +// strikes.Add(0.294); stdDevsOnExpiry.Add(0.30161646208803); stdDevsOnPayment.Add(0.30247496254272); +// strikes.Add(0.295); stdDevsOnExpiry.Add(0.302157527795685); stdDevsOnPayment.Add(0.303038462946447); +// strikes.Add(0.296); stdDevsOnExpiry.Add(0.302717883397067); stdDevsOnPayment.Add(0.303587057646567); +// strikes.Add(0.297); stdDevsOnExpiry.Add(0.303255786827061); stdDevsOnPayment.Add(0.304149261902154); +// strikes.Add(0.298); stdDevsOnExpiry.Add(0.303781989829713); stdDevsOnPayment.Add(0.304700124861519); +// strikes.Add(0.299); stdDevsOnExpiry.Add(0.304330645003752); stdDevsOnPayment.Add(0.305239646524661); +// strikes.Add(0.3); stdDevsOnExpiry.Add(0.304881197544388); stdDevsOnPayment.Add(0.305780140298908); +// strikes.Add(0.301); stdDevsOnExpiry.Add(0.305453569800878); stdDevsOnPayment.Add(0.306327114813854); +// strikes.Add(0.302); stdDevsOnExpiry.Add(0.305970602198316); stdDevsOnPayment.Add(0.306869876847346); +// strikes.Add(0.303); stdDevsOnExpiry.Add(0.306495540289904); stdDevsOnPayment.Add(0.307408102362348); +// strikes.Add(0.304); stdDevsOnExpiry.Add(0.307054947207988); stdDevsOnPayment.Add(0.307955400914329); +// strikes.Add(0.305); stdDevsOnExpiry.Add(0.307578936616277); stdDevsOnPayment.Add(0.308478072651655); +// strikes.Add(0.306); stdDevsOnExpiry.Add(0.308105139618929); stdDevsOnPayment.Add(0.30902828753695); +// strikes.Add(0.307); stdDevsOnExpiry.Add(0.308639564543498); stdDevsOnPayment.Add(0.309550959274277); +// strikes.Add(0.308); stdDevsOnExpiry.Add(0.30916892982381); stdDevsOnPayment.Add(0.310072982937534); +// strikes.Add(0.309); stdDevsOnExpiry.Add(0.309708414392635); stdDevsOnPayment.Add(0.310612504600676); +// strikes.Add(0.31); stdDevsOnExpiry.Add(0.310226711701136); stdDevsOnPayment.Add(0.311149433967539); +// strikes.Add(0.311); stdDevsOnExpiry.Add(0.310757025664747); stdDevsOnPayment.Add(0.311663356704923); +// strikes.Add(0.312); stdDevsOnExpiry.Add(0.311267733506864); stdDevsOnPayment.Add(0.312172742923818); +// strikes.Add(0.313); stdDevsOnExpiry.Add(0.31179520142058); stdDevsOnPayment.Add(0.312693470438935); +// strikes.Add(0.314); stdDevsOnExpiry.Add(0.312293892607588); stdDevsOnPayment.Add(0.313225215213239); +// strikes.Add(0.315); stdDevsOnExpiry.Add(0.312807130271834); stdDevsOnPayment.Add(0.313724880321086); +// strikes.Add(0.316); stdDevsOnExpiry.Add(0.313339025374274); stdDevsOnPayment.Add(0.314244311688064); +// strikes.Add(0.317); stdDevsOnExpiry.Add(0.313838981472347); stdDevsOnPayment.Add(0.31478739775859); +// strikes.Add(0.318); stdDevsOnExpiry.Add(0.314357595008614); stdDevsOnPayment.Add(0.315282202310914); +// strikes.Add(0.319); stdDevsOnExpiry.Add(0.314857234878921); stdDevsOnPayment.Add(0.315793208714983); +// strikes.Add(0.32); stdDevsOnExpiry.Add(0.315366361582208); stdDevsOnPayment.Add(0.316289633452481); +// strikes.Add(0.321); stdDevsOnExpiry.Add(0.315885291346242); stdDevsOnPayment.Add(0.31680258407876); +// strikes.Add(0.322); stdDevsOnExpiry.Add(0.316385879899846); stdDevsOnPayment.Add(0.317304193408817); +// strikes.Add(0.323); stdDevsOnExpiry.Add(0.316888682047813); stdDevsOnPayment.Add(0.317796729701896); +// strikes.Add(0.324); stdDevsOnExpiry.Add(0.317366185974499); stdDevsOnPayment.Add(0.318296394809743); +// strikes.Add(0.325); stdDevsOnExpiry.Add(0.317897448621407); stdDevsOnPayment.Add(0.318796059917591); +// strikes.Add(0.326); stdDevsOnExpiry.Add(0.318374952548092); stdDevsOnPayment.Add(0.319321972025266); +// strikes.Add(0.327); stdDevsOnExpiry.Add(0.318880916973719); stdDevsOnPayment.Add(0.319809971799856); +// strikes.Add(0.328); stdDevsOnExpiry.Add(0.319367907733385); stdDevsOnPayment.Add(0.320308988833634); +// strikes.Add(0.329); stdDevsOnExpiry.Add(0.319854898493051); stdDevsOnPayment.Add(0.320818051015494); +// strikes.Add(0.33); stdDevsOnExpiry.Add(0.320354538363358); stdDevsOnPayment.Add(0.321299570049386); +// strikes.Add(0.331); stdDevsOnExpiry.Add(0.320847853678344); stdDevsOnPayment.Add(0.321782061194382); +// strikes.Add(0.332); stdDevsOnExpiry.Add(0.321319033049709); stdDevsOnPayment.Add(0.322270709043042); +// strikes.Add(0.333); stdDevsOnExpiry.Add(0.321799699254055); stdDevsOnPayment.Add(0.322769726076819); +// strikes.Add(0.334); stdDevsOnExpiry.Add(0.322302501402021); stdDevsOnPayment.Add(0.323246384555187); +// strikes.Add(0.335); stdDevsOnExpiry.Add(0.322783167606367); stdDevsOnPayment.Add(0.323742809292685); +// strikes.Add(0.336); stdDevsOnExpiry.Add(0.323279645199013); stdDevsOnPayment.Add(0.324182851586107); +// strikes.Add(0.337); stdDevsOnExpiry.Add(0.323735013182078); stdDevsOnPayment.Add(0.324681868619885); +// strikes.Add(0.338); stdDevsOnExpiry.Add(0.324212517108763); stdDevsOnPayment.Add(0.325174404912964); +// strikes.Add(0.339); stdDevsOnExpiry.Add(0.324693183313109); stdDevsOnPayment.Add(0.325647498983947); +// strikes.Add(0.34); stdDevsOnExpiry.Add(0.325170687239794); stdDevsOnPayment.Add(0.326114112314233); +// strikes.Add(0.341); stdDevsOnExpiry.Add(0.325638704333499); stdDevsOnPayment.Add(0.326590446755566); +// strikes.Add(0.342); stdDevsOnExpiry.Add(0.326132019648485); stdDevsOnPayment.Add(0.327066781196899); +// strikes.Add(0.343); stdDevsOnExpiry.Add(0.326571576243249); stdDevsOnPayment.Add(0.327536634897533); +// strikes.Add(0.344); stdDevsOnExpiry.Add(0.327049080169934); stdDevsOnPayment.Add(0.328019450079565); +// strikes.Add(0.345); stdDevsOnExpiry.Add(0.327507610430659); stdDevsOnPayment.Add(0.32848606340985); +// strikes.Add(0.346); stdDevsOnExpiry.Add(0.327997763467985); stdDevsOnPayment.Add(0.328949436369786); +// strikes.Add(0.347); stdDevsOnExpiry.Add(0.328443644618068); stdDevsOnPayment.Add(0.329409568959373); +// strikes.Add(0.348); stdDevsOnExpiry.Add(0.328933797655394); stdDevsOnPayment.Add(0.329876182289659); +// strikes.Add(0.349); stdDevsOnExpiry.Add(0.329363867417177); stdDevsOnPayment.Add(0.330346035990293); +// strikes.Add(0.35); stdDevsOnExpiry.Add(0.329841371343863); stdDevsOnPayment.Add(0.330799687839182); +// strikes.Add(0.351); stdDevsOnExpiry.Add(0.330284090216286); stdDevsOnPayment.Add(0.331279262650864); +// strikes.Add(0.352); stdDevsOnExpiry.Add(0.330755269587652); stdDevsOnPayment.Add(0.331723193388705); +// strikes.Add(0.353); stdDevsOnExpiry.Add(0.331204313015395); stdDevsOnPayment.Add(0.332163883756196); +// strikes.Add(0.354); stdDevsOnExpiry.Add(0.331647031887819); stdDevsOnPayment.Add(0.332624016345783); +// strikes.Add(0.355); stdDevsOnExpiry.Add(0.332140347202805); stdDevsOnPayment.Add(0.333093870046418); +// strikes.Add(0.356); stdDevsOnExpiry.Add(0.332579903797569); stdDevsOnPayment.Add(0.333560483376703); +// strikes.Add(0.357); stdDevsOnExpiry.Add(0.333022622669992); stdDevsOnPayment.Add(0.334001173744195); +// strikes.Add(0.358); stdDevsOnExpiry.Add(0.333474828375396); stdDevsOnPayment.Add(0.334464546704131); +// strikes.Add(0.359); stdDevsOnExpiry.Add(0.33392387180314); stdDevsOnPayment.Add(0.334889035219877); +// strikes.Add(0.36); stdDevsOnExpiry.Add(0.334341292454282); stdDevsOnPayment.Add(0.335342687068766); +// strikes.Add(0.361); stdDevsOnExpiry.Add(0.334799822715007); stdDevsOnPayment.Add(0.335793098547305); +// strikes.Add(0.362); stdDevsOnExpiry.Add(0.335271002086372); stdDevsOnPayment.Add(0.336246750396193); +// strikes.Add(0.363); stdDevsOnExpiry.Add(0.335701071848155); stdDevsOnPayment.Add(0.33666799854159); +// strikes.Add(0.364); stdDevsOnExpiry.Add(0.336159602108879); stdDevsOnPayment.Add(0.337144332982923); +// strikes.Add(0.365); stdDevsOnExpiry.Add(0.336583347315342); stdDevsOnPayment.Add(0.337555860017272); +// strikes.Add(0.366); stdDevsOnExpiry.Add(0.336994443411164); stdDevsOnPayment.Add(0.337993310014414); +// strikes.Add(0.367); stdDevsOnExpiry.Add(0.337459298227208); stdDevsOnPayment.Add(0.338440481122604); +// strikes.Add(0.368); stdDevsOnExpiry.Add(0.337892530266652); stdDevsOnPayment.Add(0.33886496963835); +// strikes.Add(0.369); stdDevsOnExpiry.Add(0.338335249139075); stdDevsOnPayment.Add(0.339331582968636); +// strikes.Add(0.37); stdDevsOnExpiry.Add(0.338768481178518); stdDevsOnPayment.Add(0.339749590743683); +// strikes.Add(0.371); stdDevsOnExpiry.Add(0.339163765886039); stdDevsOnPayment.Add(0.340180560000127); +// strikes.Add(0.372); stdDevsOnExpiry.Add(0.339634945257404); stdDevsOnPayment.Add(0.340601808145523); +// strikes.Add(0.373); stdDevsOnExpiry.Add(0.340039716797906); stdDevsOnPayment.Add(0.341058700364761); +// strikes.Add(0.374); stdDevsOnExpiry.Add(0.34048559794799); stdDevsOnPayment.Add(0.341473467769459); +// strikes.Add(0.375); stdDevsOnExpiry.Add(0.340896694043811); stdDevsOnPayment.Add(0.341897956285205); +// strikes.Add(0.376); stdDevsOnExpiry.Add(0.341336250638575); stdDevsOnPayment.Add(0.342348367763744); +// strikes.Add(0.377); stdDevsOnExpiry.Add(0.341753671289717); stdDevsOnPayment.Add(0.34277285627949); +// strikes.Add(0.378); stdDevsOnExpiry.Add(0.34217741649618); stdDevsOnPayment.Add(0.343174662202791); +// strikes.Add(0.379); stdDevsOnExpiry.Add(0.342604323980302); stdDevsOnPayment.Add(0.343608871829585); +// strikes.Add(0.38); stdDevsOnExpiry.Add(0.343021744631445); stdDevsOnPayment.Add(0.344000956641838); +// strikes.Add(0.381); stdDevsOnExpiry.Add(0.343404380228325); stdDevsOnPayment.Add(0.344428685527933); +// strikes.Add(0.382); stdDevsOnExpiry.Add(0.343843936823088); stdDevsOnPayment.Add(0.344875856636123); +// strikes.Add(0.383); stdDevsOnExpiry.Add(0.344277168862531); stdDevsOnPayment.Add(0.34525822033733); +// strikes.Add(0.384); stdDevsOnExpiry.Add(0.344700914068994); stdDevsOnPayment.Add(0.34570215107517); +// strikes.Add(0.385); stdDevsOnExpiry.Add(0.345121496997796); stdDevsOnPayment.Add(0.346139601072313); +// strikes.Add(0.386); stdDevsOnExpiry.Add(0.345538917648939); stdDevsOnPayment.Add(0.346502522551424); +// strikes.Add(0.387); stdDevsOnExpiry.Add(0.345912066412839); stdDevsOnPayment.Add(0.346956174400312); +// strikes.Add(0.388); stdDevsOnExpiry.Add(0.346354785285262); stdDevsOnPayment.Add(0.34737418217536); +// strikes.Add(0.389); stdDevsOnExpiry.Add(0.346746907715123); stdDevsOnPayment.Add(0.347756545876566); +// strikes.Add(0.39); stdDevsOnExpiry.Add(0.347151679255625); stdDevsOnPayment.Add(0.348171313281264); +// strikes.Add(0.391); stdDevsOnExpiry.Add(0.347562775351446); stdDevsOnPayment.Add(0.348576359574914); +// strikes.Add(0.392); stdDevsOnExpiry.Add(0.347986520557909); stdDevsOnPayment.Add(0.348968444387168); +// strikes.Add(0.393); stdDevsOnExpiry.Add(0.348407103486711); stdDevsOnPayment.Add(0.349415615495358); +// strikes.Add(0.394); stdDevsOnExpiry.Add(0.348773927695291); stdDevsOnPayment.Add(0.349820661789009); +// strikes.Add(0.395); stdDevsOnExpiry.Add(0.349203997457074); stdDevsOnPayment.Add(0.350232188823358); +// strikes.Add(0.396); stdDevsOnExpiry.Add(0.349624580385876); stdDevsOnPayment.Add(0.350637235117008); +// strikes.Add(0.397); stdDevsOnExpiry.Add(0.349981917761475); stdDevsOnPayment.Add(0.351029319929262); +// strikes.Add(0.398); stdDevsOnExpiry.Add(0.350396176134957); stdDevsOnPayment.Add(0.351434366222912); +// strikes.Add(0.399); stdDevsOnExpiry.Add(0.350797785397799); stdDevsOnPayment.Add(0.351803768442721); +// strikes.Add(0.4); stdDevsOnExpiry.Add(0.351174096439359); stdDevsOnPayment.Add(0.352250939550912); +// strikes.Add(0.401); stdDevsOnExpiry.Add(0.351597841645821); stdDevsOnPayment.Add(0.352620341770721); +// strikes.Add(0.402); stdDevsOnExpiry.Add(0.351986801798022); stdDevsOnPayment.Add(0.35303186880507); +// strikes.Add(0.403); stdDevsOnExpiry.Add(0.352356788284262); stdDevsOnPayment.Add(0.353407751765577); +// strikes.Add(0.404); stdDevsOnExpiry.Add(0.352793182601365); stdDevsOnPayment.Add(0.353799836577831); +// strikes.Add(0.405); stdDevsOnExpiry.Add(0.353194791864206); stdDevsOnPayment.Add(0.354208123241831); +// strikes.Add(0.406); stdDevsOnExpiry.Add(0.353548966962145); stdDevsOnPayment.Add(0.354587246572688); +// strikes.Add(0.407); stdDevsOnExpiry.Add(0.353953738502647); stdDevsOnPayment.Add(0.354995533236687); +// strikes.Add(0.408); stdDevsOnExpiry.Add(0.354333211821867); stdDevsOnPayment.Add(0.355374656567544); +// strikes.Add(0.409); stdDevsOnExpiry.Add(0.354725334251728); stdDevsOnPayment.Add(0.355776462490846); +// strikes.Add(0.41); stdDevsOnExpiry.Add(0.355104807570948); stdDevsOnPayment.Add(0.356129662858909); +// strikes.Add(0.411); stdDevsOnExpiry.Add(0.355503254556129); stdDevsOnPayment.Add(0.356554151374654); +// strikes.Add(0.412); stdDevsOnExpiry.Add(0.355863754209388); stdDevsOnPayment.Add(0.356910592113067); +// strikes.Add(0.413); stdDevsOnExpiry.Add(0.35627168802755); stdDevsOnPayment.Add(0.357279994332876); +// strikes.Add(0.414); stdDevsOnExpiry.Add(0.356660648179751); stdDevsOnPayment.Add(0.357691521367225); +// strikes.Add(0.415); stdDevsOnExpiry.Add(0.357036959221311); stdDevsOnPayment.Add(0.358080365809129); +// strikes.Add(0.416); stdDevsOnExpiry.Add(0.35740062115223); stdDevsOnPayment.Add(0.358472450621383); +// strikes.Add(0.417); stdDevsOnExpiry.Add(0.357795905859751); stdDevsOnPayment.Add(0.358838612470843); +// strikes.Add(0.418); stdDevsOnExpiry.Add(0.35815008095769); stdDevsOnPayment.Add(0.359211255061002); +// strikes.Add(0.419); stdDevsOnExpiry.Add(0.358561177053512); stdDevsOnPayment.Add(0.359635743576747); +// strikes.Add(0.42); stdDevsOnExpiry.Add(0.358915352151451); stdDevsOnPayment.Add(0.35999218431516); +// strikes.Add(0.421); stdDevsOnExpiry.Add(0.359313799136632); stdDevsOnPayment.Add(0.360361586534969); +// strikes.Add(0.422); stdDevsOnExpiry.Add(0.359674298789891); stdDevsOnPayment.Add(0.360756911717572); +// strikes.Add(0.423); stdDevsOnExpiry.Add(0.36002847388783); stdDevsOnPayment.Add(0.361116592826334); +// strikes.Add(0.424); stdDevsOnExpiry.Add(0.360455381371953); stdDevsOnPayment.Add(0.361502196897889); +// strikes.Add(0.425); stdDevsOnExpiry.Add(0.360809556469892); stdDevsOnPayment.Add(0.361891041339793); +// strikes.Add(0.426); stdDevsOnExpiry.Add(0.361141595624209); stdDevsOnPayment.Add(0.362260443559603); +// strikes.Add(0.427); stdDevsOnExpiry.Add(0.361562178553012); stdDevsOnPayment.Add(0.362594201705571); +// strikes.Add(0.428); stdDevsOnExpiry.Add(0.361922678206271); stdDevsOnPayment.Add(0.363021930591666); +// strikes.Add(0.429); stdDevsOnExpiry.Add(0.36227369102655); stdDevsOnPayment.Add(0.363358929107983); +// strikes.Add(0.43); stdDevsOnExpiry.Add(0.362637352957469); stdDevsOnPayment.Add(0.363741292809189); +// strikes.Add(0.431); stdDevsOnExpiry.Add(0.362994690333068); stdDevsOnPayment.Add(0.364075050955157); +// strikes.Add(0.432); stdDevsOnExpiry.Add(0.363342540875687); stdDevsOnPayment.Add(0.364473616508109); +// strikes.Add(0.433); stdDevsOnExpiry.Add(0.363737825583208); stdDevsOnPayment.Add(0.364820336135474); +// strikes.Add(0.434); stdDevsOnExpiry.Add(0.364095162958807); stdDevsOnPayment.Add(0.365186497984934); +// strikes.Add(0.435); stdDevsOnExpiry.Add(0.364455662612066); stdDevsOnPayment.Add(0.365562380945441); +// strikes.Add(0.436); stdDevsOnExpiry.Add(0.364866758707888); stdDevsOnPayment.Add(0.365889658350711); +// strikes.Add(0.437); stdDevsOnExpiry.Add(0.365208284695186); stdDevsOnPayment.Add(0.366291464274012); +// strikes.Add(0.438); stdDevsOnExpiry.Add(0.365584595736746); stdDevsOnPayment.Add(0.366657626123472); +// strikes.Add(0.439); stdDevsOnExpiry.Add(0.365907148058083); stdDevsOnPayment.Add(0.367001105380488); +// strikes.Add(0.44); stdDevsOnExpiry.Add(0.366270809989003); stdDevsOnPayment.Add(0.367380228711345); +// strikes.Add(0.441); stdDevsOnExpiry.Add(0.366612335976301); stdDevsOnPayment.Add(0.367710746486964); +// strikes.Add(0.442); stdDevsOnExpiry.Add(0.366998133850841); stdDevsOnPayment.Add(0.368083389077122); +// strikes.Add(0.443); stdDevsOnExpiry.Add(0.367333335282819); stdDevsOnPayment.Add(0.368452791296931); +// strikes.Add(0.444); stdDevsOnExpiry.Add(0.367693834936078); stdDevsOnPayment.Add(0.368793030183598); +// strikes.Add(0.445); stdDevsOnExpiry.Add(0.368073308255299); stdDevsOnPayment.Add(0.369162432403407); +// strikes.Add(0.446); stdDevsOnExpiry.Add(0.368440132463878); stdDevsOnPayment.Add(0.369492950179026); +// strikes.Add(0.447); stdDevsOnExpiry.Add(0.368765847062875); stdDevsOnPayment.Add(0.369878554250581); +// strikes.Add(0.448); stdDevsOnExpiry.Add(0.369104210772513); stdDevsOnPayment.Add(0.370196110544803); +// strikes.Add(0.449); stdDevsOnExpiry.Add(0.369490008647054); stdDevsOnPayment.Add(0.370559032023914); +// strikes.Add(0.45); stdDevsOnExpiry.Add(0.369825210079032); stdDevsOnPayment.Add(0.370896030540231); +// strikes.Add(0.451); stdDevsOnExpiry.Add(0.370204683398252); stdDevsOnPayment.Add(0.371278394241437); +// strikes.Add(0.452); stdDevsOnExpiry.Add(0.370514586608948); stdDevsOnPayment.Add(0.37159271016531); +// strikes.Add(0.453); stdDevsOnExpiry.Add(0.370856112596247); stdDevsOnPayment.Add(0.371968593125818); +// strikes.Add(0.454); stdDevsOnExpiry.Add(0.371197638583545); stdDevsOnPayment.Add(0.37232503386423); +// strikes.Add(0.455); stdDevsOnExpiry.Add(0.371586598735746); stdDevsOnPayment.Add(0.372665272750896); +// strikes.Add(0.456); stdDevsOnExpiry.Add(0.371874366002821); stdDevsOnPayment.Add(0.373002271267214); +// strikes.Add(0.457); stdDevsOnExpiry.Add(0.37222854110076); stdDevsOnPayment.Add(0.373358712005626); +// strikes.Add(0.458); stdDevsOnExpiry.Add(0.372579553921038); stdDevsOnPayment.Add(0.373685989410896); +// strikes.Add(0.459); stdDevsOnExpiry.Add(0.372917917630676); stdDevsOnPayment.Add(0.374045670519657); +// strikes.Add(0.46); stdDevsOnExpiry.Add(0.373332176004159); stdDevsOnPayment.Add(0.374382669035975); +// strikes.Add(0.461); stdDevsOnExpiry.Add(0.373597807327613); stdDevsOnPayment.Add(0.374748830885435); +// strikes.Add(0.462); stdDevsOnExpiry.Add(0.373977280646833); stdDevsOnPayment.Add(0.375095550512799); +// strikes.Add(0.463); stdDevsOnExpiry.Add(0.374287183857529); stdDevsOnPayment.Add(0.375406626066323); +// strikes.Add(0.464); stdDevsOnExpiry.Add(0.374616060734187); stdDevsOnPayment.Add(0.375727422730894); +// strikes.Add(0.465); stdDevsOnExpiry.Add(0.375001858608727); stdDevsOnPayment.Add(0.376096824950703); +// strikes.Add(0.466); stdDevsOnExpiry.Add(0.375311761819424); stdDevsOnPayment.Add(0.376420861985624); +// strikes.Add(0.467); stdDevsOnExpiry.Add(0.375599529086499); stdDevsOnPayment.Add(0.376754620131592); +// strikes.Add(0.468); stdDevsOnExpiry.Add(0.376004300627001); stdDevsOnPayment.Add(0.377098099388607); +// strikes.Add(0.469); stdDevsOnExpiry.Add(0.376292067894076); stdDevsOnPayment.Add(0.377425376793877); +// strikes.Add(0.47); stdDevsOnExpiry.Add(0.376646242992015); stdDevsOnPayment.Add(0.377755894569496); +// strikes.Add(0.471); stdDevsOnExpiry.Add(0.376952983925051); stdDevsOnPayment.Add(0.378079931604416); +// strikes.Add(0.472); stdDevsOnExpiry.Add(0.377332457244272); stdDevsOnPayment.Add(0.378449333824225); +// strikes.Add(0.473); stdDevsOnExpiry.Add(0.377661334120929); stdDevsOnPayment.Add(0.378776611229495); +// strikes.Add(0.474); stdDevsOnExpiry.Add(0.377999697830567); stdDevsOnPayment.Add(0.379113609745812); +// strikes.Add(0.475); stdDevsOnExpiry.Add(0.378277978264662); stdDevsOnPayment.Add(0.379463569743526); +// strikes.Add(0.476); stdDevsOnExpiry.Add(0.378635315640261); stdDevsOnPayment.Add(0.379761683815653); +// strikes.Add(0.477); stdDevsOnExpiry.Add(0.378948381128618); stdDevsOnPayment.Add(0.380095441961621); +// strikes.Add(0.478); stdDevsOnExpiry.Add(0.379264608894634); stdDevsOnPayment.Add(0.380471324922129); +// strikes.Add(0.479); stdDevsOnExpiry.Add(0.379574512105331); stdDevsOnPayment.Add(0.380779160105303); +// strikes.Add(0.48); stdDevsOnExpiry.Add(0.379900226704328); stdDevsOnPayment.Add(0.381122639362319); +// strikes.Add(0.481); stdDevsOnExpiry.Add(0.380276537745888); stdDevsOnPayment.Add(0.381414272693747); +// strikes.Add(0.482); stdDevsOnExpiry.Add(0.380605414622546); stdDevsOnPayment.Add(0.381773953802509); +// strikes.Add(0.483); stdDevsOnExpiry.Add(0.380896344167281); stdDevsOnPayment.Add(0.382068827504286); +// strikes.Add(0.484); stdDevsOnExpiry.Add(0.381234707876919); stdDevsOnPayment.Add(0.382405826020603); +// strikes.Add(0.485); stdDevsOnExpiry.Add(0.381595207530179); stdDevsOnPayment.Add(0.382716901574127); +// strikes.Add(0.486); stdDevsOnExpiry.Add(0.381835540632351); stdDevsOnPayment.Add(0.383031217498); +// strikes.Add(0.487); stdDevsOnExpiry.Add(0.382139119287727); stdDevsOnPayment.Add(0.38331637008873); +// strikes.Add(0.488); stdDevsOnExpiry.Add(0.382486969830346); stdDevsOnPayment.Add(0.383685772308539); +// strikes.Add(0.489); stdDevsOnExpiry.Add(0.382847469483605); stdDevsOnPayment.Add(0.383964444158571); +// strikes.Add(0.49); stdDevsOnExpiry.Add(0.38313207447302); stdDevsOnPayment.Add(0.384301442674888); +// strikes.Add(0.491); stdDevsOnExpiry.Add(0.383479925015639); stdDevsOnPayment.Add(0.384661123783649); +// strikes.Add(0.492); stdDevsOnExpiry.Add(0.383796152781656); stdDevsOnPayment.Add(0.384917113041236); +// strikes.Add(0.493); stdDevsOnExpiry.Add(0.384106055992352); stdDevsOnPayment.Add(0.385280034520347); +// strikes.Add(0.494); stdDevsOnExpiry.Add(0.384457068812631); stdDevsOnPayment.Add(0.38559435044422); +// strikes.Add(0.495); stdDevsOnExpiry.Add(0.384744836079706); stdDevsOnPayment.Add(0.385931348960537); +// strikes.Add(0.496); stdDevsOnExpiry.Add(0.385048414735082); stdDevsOnPayment.Add(0.386222982291966); +// strikes.Add(0.497); stdDevsOnExpiry.Add(0.38537412933408); stdDevsOnPayment.Add(0.386559980808283); +// strikes.Add(0.498); stdDevsOnExpiry.Add(0.385709330766058); stdDevsOnPayment.Add(0.386848373769362); +// strikes.Add(0.499); stdDevsOnExpiry.Add(0.386038207642715); stdDevsOnPayment.Add(0.387146487841489); +// strikes.Add(0.5); stdDevsOnExpiry.Add(0.386338624020431); stdDevsOnPayment.Add(0.387460803765362); +// strikes.Add(0.501); stdDevsOnExpiry.Add(0.386623229009846); stdDevsOnPayment.Add(0.387765398578187); +// strikes.Add(0.502); stdDevsOnExpiry.Add(0.386952105886504); stdDevsOnPayment.Add(0.388108877835202); +// strikes.Add(0.503); stdDevsOnExpiry.Add(0.38724935998656); stdDevsOnPayment.Add(0.388374588203837); +// strikes.Add(0.504); stdDevsOnExpiry.Add(0.387584561418537); stdDevsOnPayment.Add(0.388718067460853); +// strikes.Add(0.505); stdDevsOnExpiry.Add(0.387856517297312); stdDevsOnPayment.Add(0.388980537459138); +// strikes.Add(0.506); stdDevsOnExpiry.Add(0.388213854672911); stdDevsOnPayment.Add(0.3893402185679); +// strikes.Add(0.507); stdDevsOnExpiry.Add(0.388514271050627); stdDevsOnPayment.Add(0.389605928936535); +// strikes.Add(0.508); stdDevsOnExpiry.Add(0.388748279597479); stdDevsOnPayment.Add(0.389994773378439); +// strikes.Add(0.509); stdDevsOnExpiry.Add(0.389073994196477); stdDevsOnPayment.Add(0.390247522265677); +// strikes.Add(0.51); stdDevsOnExpiry.Add(0.389431331572076); stdDevsOnPayment.Add(0.39056183818955); +// strikes.Add(0.511); stdDevsOnExpiry.Add(0.389643204175307); stdDevsOnPayment.Add(0.390882634854121); +// strikes.Add(0.512); stdDevsOnExpiry.Add(0.390025839772187); stdDevsOnPayment.Add(0.391193710407644); +// strikes.Add(0.513); stdDevsOnExpiry.Add(0.390351554371185); stdDevsOnPayment.Add(0.391491824479771); +// strikes.Add(0.514); stdDevsOnExpiry.Add(0.390607698861658); stdDevsOnPayment.Add(0.391828822996088); +// strikes.Add(0.515); stdDevsOnExpiry.Add(0.390901790684054); stdDevsOnPayment.Add(0.392081571883326); +// strikes.Add(0.516); stdDevsOnExpiry.Add(0.391218018450071); stdDevsOnPayment.Add(0.392399128177548); +// strikes.Add(0.517); stdDevsOnExpiry.Add(0.391524759383107); stdDevsOnPayment.Add(0.392726405582818); +// strikes.Add(0.518); stdDevsOnExpiry.Add(0.391809364372522); stdDevsOnPayment.Add(0.393034240765992); +// strikes.Add(0.519); stdDevsOnExpiry.Add(0.392093969361938); stdDevsOnPayment.Add(0.393261066690437); +// strikes.Add(0.52); stdDevsOnExpiry.Add(0.392419683960935); stdDevsOnPayment.Add(0.393617507428849); +// strikes.Add(0.521); stdDevsOnExpiry.Add(0.392723262616311); stdDevsOnPayment.Add(0.393948025204468); +// strikes.Add(0.522); stdDevsOnExpiry.Add(0.393001543050406); stdDevsOnPayment.Add(0.39422345668415); +// strikes.Add(0.523); stdDevsOnExpiry.Add(0.393336744482384); stdDevsOnPayment.Add(0.394476205571388); +// strikes.Add(0.524); stdDevsOnExpiry.Add(0.393611862638818); stdDevsOnPayment.Add(0.394813204087705); +// strikes.Add(0.525); stdDevsOnExpiry.Add(0.393940739515476); stdDevsOnPayment.Add(0.395075674085991); +// strikes.Add(0.526); stdDevsOnExpiry.Add(0.394168423507008); stdDevsOnPayment.Add(0.395435355194752); +// strikes.Add(0.527); stdDevsOnExpiry.Add(0.394459353051744); stdDevsOnPayment.Add(0.39568810408199); +// strikes.Add(0.528); stdDevsOnExpiry.Add(0.394800879039042); stdDevsOnPayment.Add(0.396012141116911); +// strikes.Add(0.529); stdDevsOnExpiry.Add(0.395025400752914); stdDevsOnPayment.Add(0.396274611115196); +// strikes.Add(0.53); stdDevsOnExpiry.Add(0.395347953074251); stdDevsOnPayment.Add(0.396572725187323); +// strikes.Add(0.531); stdDevsOnExpiry.Add(0.395613584397705); stdDevsOnPayment.Add(0.396893521851894); +// strikes.Add(0.532); stdDevsOnExpiry.Add(0.395951948107343); stdDevsOnPayment.Add(0.397162472590878); +// strikes.Add(0.533); stdDevsOnExpiry.Add(0.39626817587336); stdDevsOnPayment.Add(0.397483269255449); +// strikes.Add(0.534); stdDevsOnExpiry.Add(0.396505346697872); stdDevsOnPayment.Add(0.397774902586878); +// strikes.Add(0.535); stdDevsOnExpiry.Add(0.39683106129687); stdDevsOnPayment.Add(0.398034132214814); +// strikes.Add(0.536); stdDevsOnExpiry.Add(0.397137802229906); stdDevsOnPayment.Add(0.398329005916591); +// strikes.Add(0.537); stdDevsOnExpiry.Add(0.39739078444272); stdDevsOnPayment.Add(0.398656283321861); +// strikes.Add(0.538); stdDevsOnExpiry.Add(0.397672227154475); stdDevsOnPayment.Add(0.39890579183875); +// strikes.Add(0.539); stdDevsOnExpiry.Add(0.397931533922608); stdDevsOnPayment.Add(0.399184463688781); +// strikes.Add(0.54); stdDevsOnExpiry.Add(0.398269897632246); stdDevsOnPayment.Add(0.399463135538813); +// strikes.Add(0.541); stdDevsOnExpiry.Add(0.398484932513138); stdDevsOnPayment.Add(0.399770970721987); +// strikes.Add(0.542); stdDevsOnExpiry.Add(0.398826458500436); stdDevsOnPayment.Add(0.400023719609225); +// strikes.Add(0.543); stdDevsOnExpiry.Add(0.399126874878152); stdDevsOnPayment.Add(0.400334795162749); +// strikes.Add(0.544); stdDevsOnExpiry.Add(0.399398830756927); stdDevsOnPayment.Add(0.400603745901733); +// strikes.Add(0.545); stdDevsOnExpiry.Add(0.399680273468682); stdDevsOnPayment.Add(0.400914821455256); +// strikes.Add(0.546); stdDevsOnExpiry.Add(0.399917444293194); stdDevsOnPayment.Add(0.40122589700878); +// strikes.Add(0.547); stdDevsOnExpiry.Add(0.400274781668793); stdDevsOnPayment.Add(0.401465684414621); +// strikes.Add(0.548); stdDevsOnExpiry.Add(0.400543575269907); stdDevsOnPayment.Add(0.401812404041986); +// strikes.Add(0.549); stdDevsOnExpiry.Add(0.400828180259323); stdDevsOnPayment.Add(0.402016547373986); +// strikes.Add(0.55); stdDevsOnExpiry.Add(0.401103298415757); stdDevsOnPayment.Add(0.402347065149604); +// strikes.Add(0.551); stdDevsOnExpiry.Add(0.401356280628571); stdDevsOnPayment.Add(0.402612775518239); +// strikes.Add(0.552); stdDevsOnExpiry.Add(0.401666183839267); stdDevsOnPayment.Add(0.402875245516525); +// strikes.Add(0.553); stdDevsOnExpiry.Add(0.401874894164838); stdDevsOnPayment.Add(0.403186321070048); +// strikes.Add(0.554); stdDevsOnExpiry.Add(0.402238556095758); stdDevsOnPayment.Add(0.403468233290429); +// strikes.Add(0.555); stdDevsOnExpiry.Add(0.40246624008729); stdDevsOnPayment.Add(0.403714501436968); +// strikes.Add(0.556); stdDevsOnExpiry.Add(0.402747682799045); stdDevsOnPayment.Add(0.403989932916651); +// strikes.Add(0.557); stdDevsOnExpiry.Add(0.403070235120382); stdDevsOnPayment.Add(0.404297768099825); +// strikes.Add(0.558); stdDevsOnExpiry.Add(0.403326379610856); stdDevsOnPayment.Add(0.404589401431253); +// strikes.Add(0.559); stdDevsOnExpiry.Add(0.403535089936427); stdDevsOnPayment.Add(0.404884275133031); +// strikes.Add(0.56); stdDevsOnExpiry.Add(0.403797558982221); stdDevsOnPayment.Add(0.405104620316777); +// strikes.Add(0.561); stdDevsOnExpiry.Add(0.404126435858878); stdDevsOnPayment.Add(0.405393013277856); +// strikes.Add(0.562); stdDevsOnExpiry.Add(0.404423689958934); stdDevsOnPayment.Add(0.405668444757538); +// strikes.Add(0.563); stdDevsOnExpiry.Add(0.404733593169631); stdDevsOnPayment.Add(0.405901751422681); +// strikes.Add(0.564); stdDevsOnExpiry.Add(0.404977088549464); stdDevsOnPayment.Add(0.406203105865157); +// strikes.Add(0.565); stdDevsOnExpiry.Add(0.405220583929296); stdDevsOnPayment.Add(0.406510941048331); +// strikes.Add(0.566); stdDevsOnExpiry.Add(0.405533649417653); stdDevsOnPayment.Add(0.406741007343125); +// strikes.Add(0.567); stdDevsOnExpiry.Add(0.405742359743224); stdDevsOnPayment.Add(0.407042361785601); +// strikes.Add(0.568); stdDevsOnExpiry.Add(0.406083885730522); stdDevsOnPayment.Add(0.407295110672839); +// strikes.Add(0.569); stdDevsOnExpiry.Add(0.406295758333754); stdDevsOnPayment.Add(0.407593224744966); +// strikes.Add(0.57); stdDevsOnExpiry.Add(0.406643608876372); stdDevsOnPayment.Add(0.40786217548395); +// strikes.Add(0.571); stdDevsOnExpiry.Add(0.406814371870021); stdDevsOnPayment.Add(0.408082520667695); +// strikes.Add(0.572); stdDevsOnExpiry.Add(0.407114788247737); stdDevsOnPayment.Add(0.408416278813663); +// strikes.Add(0.573); stdDevsOnExpiry.Add(0.407434178291414); stdDevsOnPayment.Add(0.408636623997409); +// strikes.Add(0.574); stdDevsOnExpiry.Add(0.407623914951024); stdDevsOnPayment.Add(0.40891853621779); +// strikes.Add(0.575); stdDevsOnExpiry.Add(0.407936980439381); stdDevsOnPayment.Add(0.409252294363758); +// strikes.Add(0.576); stdDevsOnExpiry.Add(0.408265857316039); stdDevsOnPayment.Add(0.409449956955059); +// strikes.Add(0.577); stdDevsOnExpiry.Add(0.408496703585231); stdDevsOnPayment.Add(0.409748071027186); +// strikes.Add(0.578); stdDevsOnExpiry.Add(0.408774984019326); stdDevsOnPayment.Add(0.410000819914424); +// strikes.Add(0.579); stdDevsOnExpiry.Add(0.409024803954479); stdDevsOnPayment.Add(0.410295693616202); +// strikes.Add(0.58); stdDevsOnExpiry.Add(0.409261974778992); stdDevsOnPayment.Add(0.410567884725535); +// strikes.Add(0.581); stdDevsOnExpiry.Add(0.409518119269465); stdDevsOnPayment.Add(0.410755826205789); +// strikes.Add(0.582); stdDevsOnExpiry.Add(0.409831184757822); stdDevsOnPayment.Add(0.411125228425598); +// strikes.Add(0.583); stdDevsOnExpiry.Add(0.410109465191917); stdDevsOnPayment.Add(0.411394179164582); +// strikes.Add(0.584); stdDevsOnExpiry.Add(0.41034979829409); stdDevsOnPayment.Add(0.411614524348328); +// strikes.Add(0.585); stdDevsOnExpiry.Add(0.410583806840942); stdDevsOnPayment.Add(0.411867273235566); +// strikes.Add(0.586); stdDevsOnExpiry.Add(0.410931657383561); stdDevsOnPayment.Add(0.412171868048391); +// strikes.Add(0.587); stdDevsOnExpiry.Add(0.41109925809955); stdDevsOnPayment.Add(0.41237925175074); +// strikes.Add(0.588); stdDevsOnExpiry.Add(0.411374376255984); stdDevsOnPayment.Add(0.412670885082168); +// strikes.Add(0.589); stdDevsOnExpiry.Add(0.411690604022001); stdDevsOnPayment.Add(0.41294631656185); +// strikes.Add(0.59); stdDevsOnExpiry.Add(0.411943586234814); stdDevsOnPayment.Add(0.413215267300834); +// strikes.Add(0.591); stdDevsOnExpiry.Add(0.412215542113589); stdDevsOnPayment.Add(0.413458295077025); +// strikes.Add(0.592); stdDevsOnExpiry.Add(0.412348357775316); stdDevsOnPayment.Add(0.413707803593913); +// strikes.Add(0.593); stdDevsOnExpiry.Add(0.412677234651974); stdDevsOnPayment.Add(0.413931389148008); +// strikes.Add(0.594); stdDevsOnExpiry.Add(0.412908080921166); stdDevsOnPayment.Add(0.4141679361835); +// strikes.Add(0.595); stdDevsOnExpiry.Add(0.41318003679994); stdDevsOnPayment.Add(0.414479011737024); +// strikes.Add(0.596); stdDevsOnExpiry.Add(0.413382422570191); stdDevsOnPayment.Add(0.414747962476008); +// strikes.Add(0.597); stdDevsOnExpiry.Add(0.413701812613868); stdDevsOnPayment.Add(0.415000711363246); +// strikes.Add(0.598); stdDevsOnExpiry.Add(0.413954794826682); stdDevsOnPayment.Add(0.415282623583626); +// strikes.Add(0.599); stdDevsOnExpiry.Add(0.414229912983116); stdDevsOnPayment.Add(0.415538612841214); +// strikes.Add(0.6); stdDevsOnExpiry.Add(0.414508193417211); stdDevsOnPayment.Add(0.415778400247055); +// strikes.Add(0.601); stdDevsOnExpiry.Add(0.414748526519384); stdDevsOnPayment.Add(0.416005226171499); +// strikes.Add(0.602); stdDevsOnExpiry.Add(0.415020482398158); stdDevsOnPayment.Add(0.41632602283607); +// strikes.Add(0.603); stdDevsOnExpiry.Add(0.415276626888632); stdDevsOnPayment.Add(0.416513964316324); +// strikes.Add(0.604); stdDevsOnExpiry.Add(0.415583367821668); stdDevsOnPayment.Add(0.416795876536705); +// strikes.Add(0.605); stdDevsOnExpiry.Add(0.415731994871696); stdDevsOnPayment.Add(0.417119913571625); +// strikes.Add(0.606); stdDevsOnExpiry.Add(0.416060871748354); stdDevsOnPayment.Add(0.417217124682101); +// strikes.Add(0.607); stdDevsOnExpiry.Add(0.416335989904788); stdDevsOnPayment.Add(0.417550882828069); +// strikes.Add(0.608); stdDevsOnExpiry.Add(0.416532051119719); stdDevsOnPayment.Add(0.417861958381593); +// strikes.Add(0.609); stdDevsOnExpiry.Add(0.416772384221892); stdDevsOnPayment.Add(0.41811794763918); +// strikes.Add(0.61); stdDevsOnExpiry.Add(0.417028528712365); stdDevsOnPayment.Add(0.418286446897339); +// strikes.Add(0.611); stdDevsOnExpiry.Add(0.417281510925179); stdDevsOnPayment.Add(0.418587801339814); +// strikes.Add(0.612); stdDevsOnExpiry.Add(0.417455436196488); stdDevsOnPayment.Add(0.418817867634608); +// strikes.Add(0.613); stdDevsOnExpiry.Add(0.417721067519942); stdDevsOnPayment.Add(0.419047933929401); +// strikes.Add(0.614); stdDevsOnExpiry.Add(0.418068918062561); stdDevsOnPayment.Add(0.419313644298036); +// strikes.Add(0.615); stdDevsOnExpiry.Add(0.418204896001948); stdDevsOnPayment.Add(0.41962471985156); +// strikes.Add(0.616); stdDevsOnExpiry.Add(0.418533772878605); stdDevsOnPayment.Add(0.419812661331814); +// strikes.Add(0.617); stdDevsOnExpiry.Add(0.418770943703118); stdDevsOnPayment.Add(0.420036246885909); +// strikes.Add(0.618); stdDevsOnExpiry.Add(0.419042899581892); stdDevsOnPayment.Add(0.420282515032448); +// strikes.Add(0.619); stdDevsOnExpiry.Add(0.419229473963842); stdDevsOnPayment.Add(0.420596830956321); +// strikes.Add(0.62); stdDevsOnExpiry.Add(0.419529890341558); stdDevsOnPayment.Add(0.420807455029019); +// strikes.Add(0.621); stdDevsOnExpiry.Add(0.41974492522245); stdDevsOnPayment.Add(0.421037521323813); +// strikes.Add(0.622); stdDevsOnExpiry.Add(0.420026367934205); stdDevsOnPayment.Add(0.421335635395939); +// strikes.Add(0.623); stdDevsOnExpiry.Add(0.420282512424678); stdDevsOnPayment.Add(0.421523576876193); +// strikes.Add(0.624); stdDevsOnExpiry.Add(0.420427977197046); stdDevsOnPayment.Add(0.421857335022161); +// strikes.Add(0.625); stdDevsOnExpiry.Add(0.420658823466239); stdDevsOnPayment.Add(0.422061478354161); +// strikes.Add(0.626); stdDevsOnExpiry.Add(0.421019323119498); stdDevsOnPayment.Add(0.422259140945463); +// strikes.Add(0.627); stdDevsOnExpiry.Add(0.421193248390807); stdDevsOnPayment.Add(0.422589658721081); +// strikes.Add(0.628); stdDevsOnExpiry.Add(0.421395634161058); stdDevsOnPayment.Add(0.422774359830986); +// strikes.Add(0.629); stdDevsOnExpiry.Add(0.421702375094094); stdDevsOnPayment.Add(0.423036829829271); +// strikes.Add(0.63); stdDevsOnExpiry.Add(0.421882624920724); stdDevsOnPayment.Add(0.423273376864763); +// strikes.Add(0.631); stdDevsOnExpiry.Add(0.422176716743119); stdDevsOnPayment.Add(0.423493722048509); +// strikes.Add(0.632); stdDevsOnExpiry.Add(0.422401238456991); stdDevsOnPayment.Add(0.423720547972953); +// strikes.Add(0.633); stdDevsOnExpiry.Add(0.422651058392145); stdDevsOnPayment.Add(0.423931172045652); +// strikes.Add(0.634); stdDevsOnExpiry.Add(0.434664551223124); stdDevsOnPayment.Add(0.424248728339874); +// strikes.Add(0.635); stdDevsOnExpiry.Add(0.434920695713598); stdDevsOnPayment.Add(0.424478794634667); +// strikes.Add(0.636); stdDevsOnExpiry.Add(0.423403680475265); stdDevsOnPayment.Add(0.424715341670159); +// strikes.Add(0.637); stdDevsOnExpiry.Add(0.435432984694545); stdDevsOnPayment.Add(0.424990773149841); +// strikes.Add(0.638); stdDevsOnExpiry.Add(0.423846399347688); stdDevsOnPayment.Add(0.425172233889397); +// strikes.Add(0.639); stdDevsOnExpiry.Add(0.435910488621231); stdDevsOnPayment.Add(0.425428223146984); +// strikes.Add(0.64); stdDevsOnExpiry.Add(0.436163470834044); stdDevsOnPayment.Add(0.425645327960381); +// strikes.Add(0.641); stdDevsOnExpiry.Add(0.436413290769197); stdDevsOnPayment.Add(0.425894836477269); +// strikes.Add(0.642); stdDevsOnExpiry.Add(0.43664413703839); stdDevsOnPayment.Add(0.42617674869765); +// strikes.Add(0.643); stdDevsOnExpiry.Add(0.436897119251203); stdDevsOnPayment.Add(0.426361449807555); +// strikes.Add(0.644); stdDevsOnExpiry.Add(0.437159588296997); stdDevsOnPayment.Add(0.426607717954094); +// strikes.Add(0.645); stdDevsOnExpiry.Add(0.437358811789588); stdDevsOnPayment.Add(0.42678917869365); +// strikes.Add(0.646); stdDevsOnExpiry.Add(0.437602307169421); stdDevsOnPayment.Add(0.427165061654157); +// strikes.Add(0.647); stdDevsOnExpiry.Add(0.437852127104574); stdDevsOnPayment.Add(0.427340041653014); +// strikes.Add(0.648); stdDevsOnExpiry.Add(0.438076648818446); stdDevsOnPayment.Add(0.427608992391998); +// strikes.Add(0.649); stdDevsOnExpiry.Add(0.43833279330892); stdDevsOnPayment.Add(0.427780732020506); +// strikes.Add(0.65); stdDevsOnExpiry.Add(0.438569964133432); stdDevsOnPayment.Add(0.428033480907744); +// strikes.Add(0.651); stdDevsOnExpiry.Add(0.438810297235605); stdDevsOnPayment.Add(0.428308912387426); +// strikes.Add(0.652); stdDevsOnExpiry.Add(0.439056954893098); stdDevsOnPayment.Add(0.428548699793267); +// strikes.Add(0.653); stdDevsOnExpiry.Add(0.43927831432931); stdDevsOnPayment.Add(0.428713958681077); +// strikes.Add(0.654); stdDevsOnExpiry.Add(0.439534458819784); stdDevsOnPayment.Add(0.429012072753204); +// strikes.Add(0.655); stdDevsOnExpiry.Add(0.439765305088976); stdDevsOnPayment.Add(0.429193533492759); +// strikes.Add(0.656); stdDevsOnExpiry.Add(0.440015125024129); stdDevsOnPayment.Add(0.429443042009648); +// strikes.Add(0.657); stdDevsOnExpiry.Add(0.440264944959282); stdDevsOnPayment.Add(0.429686069785838); +// strikes.Add(0.658); stdDevsOnExpiry.Add(0.440454681618893); stdDevsOnPayment.Add(0.429857809414346); +// strikes.Add(0.659); stdDevsOnExpiry.Add(0.440723475220007); stdDevsOnPayment.Add(0.430185086819615); +// strikes.Add(0.66); stdDevsOnExpiry.Add(0.440957483766859); stdDevsOnPayment.Add(0.430402191633012); +// strikes.Add(0.661); stdDevsOnExpiry.Add(0.441210465979673); stdDevsOnPayment.Add(0.43057393126152); +// strikes.Add(0.662); stdDevsOnExpiry.Add(0.441403364916943); stdDevsOnPayment.Add(0.430758632371424); +// strikes.Add(0.663); stdDevsOnExpiry.Add(0.441681645351038); stdDevsOnPayment.Add(0.431076188665647); +// strikes.Add(0.664); stdDevsOnExpiry.Add(0.441858732900007); stdDevsOnPayment.Add(0.431290053108694); +// strikes.Add(0.665); stdDevsOnExpiry.Add(0.44209590372452); stdDevsOnPayment.Add(0.431484475329646); +// strikes.Add(0.666); stdDevsOnExpiry.Add(0.442374184158615); stdDevsOnPayment.Add(0.431721022365138); +// strikes.Add(0.667); stdDevsOnExpiry.Add(0.442592381317166); stdDevsOnPayment.Add(0.432022376807614); +// strikes.Add(0.668); stdDevsOnExpiry.Add(0.442813740753378); stdDevsOnPayment.Add(0.432194116436122); +// strikes.Add(0.669); stdDevsOnExpiry.Add(0.443076209799172); stdDevsOnPayment.Add(0.432417701990217); +// strikes.Add(0.67); stdDevsOnExpiry.Add(0.443275433291763); stdDevsOnPayment.Add(0.432644527914661); +// strikes.Add(0.671); stdDevsOnExpiry.Add(0.443531577782236); stdDevsOnPayment.Add(0.43293616124609); +// strikes.Add(0.672); stdDevsOnExpiry.Add(0.443705503053546); stdDevsOnPayment.Add(0.433030131986216); +// strikes.Add(0.673); stdDevsOnExpiry.Add(0.443964809821679); stdDevsOnPayment.Add(0.433376851613581); +// strikes.Add(0.674); stdDevsOnExpiry.Add(0.444183006980231); stdDevsOnPayment.Add(0.433603677538025); +// strikes.Add(0.675); stdDevsOnExpiry.Add(0.444439151470705); stdDevsOnPayment.Add(0.433772176796184); +// strikes.Add(0.676); stdDevsOnExpiry.Add(0.444676322295217); stdDevsOnPayment.Add(0.434083252349708); +// strikes.Add(0.677); stdDevsOnExpiry.Add(0.44491665539739); stdDevsOnPayment.Add(0.434290636052057); +// strikes.Add(0.678); stdDevsOnExpiry.Add(0.44510322977934); stdDevsOnPayment.Add(0.43440080864393); +// strikes.Add(0.679); stdDevsOnExpiry.Add(0.445324589215552); stdDevsOnPayment.Add(0.43464383642012); +// strikes.Add(0.68); stdDevsOnExpiry.Add(0.445602869649647); stdDevsOnPayment.Add(0.434909546788755); +// strikes.Add(0.681); stdDevsOnExpiry.Add(0.445757821254995); stdDevsOnPayment.Add(0.435084526787612); +// strikes.Add(0.682); stdDevsOnExpiry.Add(0.446029777133769); stdDevsOnPayment.Add(0.43537616011904); +// strikes.Add(0.683); stdDevsOnExpiry.Add(0.446282759346583); stdDevsOnPayment.Add(0.435567341969643); +// strikes.Add(0.684); stdDevsOnExpiry.Add(0.446478820561513); stdDevsOnPayment.Add(0.435719639376056); +// strikes.Add(0.685); stdDevsOnExpiry.Add(0.446655908110483); stdDevsOnPayment.Add(0.435969147892944); +// strikes.Add(0.686); stdDevsOnExpiry.Add(0.446940513099898); stdDevsOnPayment.Add(0.43627050233542); +// strikes.Add(0.687); stdDevsOnExpiry.Add(0.44716187253611); stdDevsOnPayment.Add(0.448587150032745); +// strikes.Add(0.688); stdDevsOnExpiry.Add(0.447424341581904); stdDevsOnPayment.Add(0.436633423814531); +// strikes.Add(0.689); stdDevsOnExpiry.Add(0.447604591408533); stdDevsOnPayment.Add(0.436827846035483); +// strikes.Add(0.69); stdDevsOnExpiry.Add(0.447800652623464); stdDevsOnPayment.Add(0.44929679113922); +// strikes.Add(0.691); stdDevsOnExpiry.Add(0.448085257612879); stdDevsOnPayment.Add(0.449510655582268); +// strikes.Add(0.692); stdDevsOnExpiry.Add(0.44830029249377); stdDevsOnPayment.Add(0.449750442988109); +// strikes.Add(0.693); stdDevsOnExpiry.Add(0.448505840541681); stdDevsOnPayment.Add(0.449986990023601); +// strikes.Add(0.694); stdDevsOnExpiry.Add(0.448708226311932); stdDevsOnPayment.Add(0.450226777429442); +// strikes.Add(0.695); stdDevsOnExpiry.Add(0.448935910303464); stdDevsOnPayment.Add(0.450447122613188); +// strikes.Add(0.696); stdDevsOnExpiry.Add(0.449141458351375); stdDevsOnPayment.Add(0.450638304463791); +// strikes.Add(0.697); stdDevsOnExpiry.Add(0.449365980065247); stdDevsOnPayment.Add(0.450878091869632); +// strikes.Add(0.698); stdDevsOnExpiry.Add(0.449565203557838); stdDevsOnPayment.Add(0.451091956312679); +// strikes.Add(0.699); stdDevsOnExpiry.Add(0.449871944490874); stdDevsOnPayment.Add(0.451296099644679); +// strikes.Add(0.7); stdDevsOnExpiry.Add(0.450061681150484); stdDevsOnPayment.Add(0.451519685198774); +// strikes.Add(0.701); stdDevsOnExpiry.Add(0.450229281866473); stdDevsOnPayment.Add(0.45174003038252); +// strikes.Add(0.702); stdDevsOnExpiry.Add(0.450472777246306); stdDevsOnPayment.Add(0.451979817788361); +// strikes.Add(0.703); stdDevsOnExpiry.Add(0.45073208401444); stdDevsOnPayment.Add(0.452222845564551); +// strikes.Add(0.704); stdDevsOnExpiry.Add(0.450940794340011); stdDevsOnPayment.Add(0.452436710007599); +// strikes.Add(0.705); stdDevsOnExpiry.Add(0.451162153776223); stdDevsOnPayment.Add(0.452653814820995); +// strikes.Add(0.706); stdDevsOnExpiry.Add(0.451374026379454); stdDevsOnPayment.Add(0.452848237041948); +// strikes.Add(0.707); stdDevsOnExpiry.Add(0.451570087594384); stdDevsOnPayment.Add(0.453094505188487); +// strikes.Add(0.708); stdDevsOnExpiry.Add(0.451813582974217); stdDevsOnPayment.Add(0.453292167779789); +// strikes.Add(0.709); stdDevsOnExpiry.Add(0.452028617855109); stdDevsOnPayment.Add(0.453525474444931); +// strikes.Add(0.71); stdDevsOnExpiry.Add(0.45223416590302); stdDevsOnPayment.Add(0.453729617776931); +// strikes.Add(0.711); stdDevsOnExpiry.Add(0.45243338939561); stdDevsOnPayment.Add(0.453959684071725); +// strikes.Add(0.712); stdDevsOnExpiry.Add(0.452635775165861); stdDevsOnPayment.Add(0.454212432958962); +// strikes.Add(0.713); stdDevsOnExpiry.Add(0.452869783712714); stdDevsOnPayment.Add(0.454390653328169); +// strikes.Add(0.714); stdDevsOnExpiry.Add(0.453056358094664); stdDevsOnPayment.Add(0.454617479252613); +// strikes.Add(0.715); stdDevsOnExpiry.Add(0.453274555253215); stdDevsOnPayment.Add(0.454837824436359); +// strikes.Add(0.716); stdDevsOnExpiry.Add(0.453578133908591); stdDevsOnPayment.Add(0.455019285175914); +// strikes.Add(0.717); stdDevsOnExpiry.Add(0.453761546012881); stdDevsOnPayment.Add(0.455252591841057); +// strikes.Add(0.718); stdDevsOnExpiry.Add(0.453970256338452); stdDevsOnPayment.Add(0.455479417765501); +// strikes.Add(0.719); stdDevsOnExpiry.Add(0.454156830720402); stdDevsOnPayment.Add(0.455657638134707); +// strikes.Add(0.72); stdDevsOnExpiry.Add(0.454346567380012); stdDevsOnPayment.Add(0.45589094479985); +// strikes.Add(0.721); stdDevsOnExpiry.Add(0.454590062759845); stdDevsOnPayment.Add(0.456098328502199); +// strikes.Add(0.722); stdDevsOnExpiry.Add(0.454795610807756); stdDevsOnPayment.Add(0.45634135627839); +// strikes.Add(0.723); stdDevsOnExpiry.Add(0.455032781632269); stdDevsOnPayment.Add(0.45654225924004); +// strikes.Add(0.724); stdDevsOnExpiry.Add(0.455257303346141); stdDevsOnPayment.Add(0.45674640257204); +// strikes.Add(0.725); stdDevsOnExpiry.Add(0.455469175949372); stdDevsOnPayment.Add(0.456960267015087); +// strikes.Add(0.726); stdDevsOnExpiry.Add(0.455684210830264); stdDevsOnPayment.Add(0.457200054420929); +// strikes.Add(0.727); stdDevsOnExpiry.Add(0.455908732544135); stdDevsOnPayment.Add(0.457378274790135); +// strikes.Add(0.728); stdDevsOnExpiry.Add(0.456054197316503); stdDevsOnPayment.Add(0.457621302566325); +// strikes.Add(0.729); stdDevsOnExpiry.Add(0.456281881308035); stdDevsOnPayment.Add(0.457835167009372); +// strikes.Add(0.73); stdDevsOnExpiry.Add(0.456525376687868); stdDevsOnPayment.Add(0.458039310341372); +// strikes.Add(0.731); stdDevsOnExpiry.Add(0.456683490570877); stdDevsOnPayment.Add(0.458233732562325); +// strikes.Add(0.732); stdDevsOnExpiry.Add(0.45693647278369); stdDevsOnPayment.Add(0.458467039227467); +// strikes.Add(0.733); stdDevsOnExpiry.Add(0.45712937172096); stdDevsOnPayment.Add(0.458671182559467); +// strikes.Add(0.734); stdDevsOnExpiry.Add(0.457322270658231); stdDevsOnPayment.Add(0.458907729594959); +// strikes.Add(0.735); stdDevsOnExpiry.Add(0.457521494150821); stdDevsOnPayment.Add(0.459079469223467); +// strikes.Add(0.736); stdDevsOnExpiry.Add(0.457736529031713); stdDevsOnPayment.Add(0.459299814407213); +// strikes.Add(0.737); stdDevsOnExpiry.Add(0.457970537578565); stdDevsOnPayment.Add(0.459481275146768); +// strikes.Add(0.738); stdDevsOnExpiry.Add(0.458141300572214); stdDevsOnPayment.Add(0.459701620330514); +// strikes.Add(0.739); stdDevsOnExpiry.Add(0.458406931895669); stdDevsOnPayment.Add(0.459931686625307); +// strikes.Add(0.74); stdDevsOnExpiry.Add(0.458587181722298); stdDevsOnPayment.Add(0.460116387735212); +// strikes.Add(0.741); stdDevsOnExpiry.Add(0.458846488490432); stdDevsOnPayment.Add(0.460317290696863); +// strikes.Add(0.742); stdDevsOnExpiry.Add(0.459045711983022); stdDevsOnPayment.Add(0.460534395510259); +// strikes.Add(0.743); stdDevsOnExpiry.Add(0.459216474976672); stdDevsOnPayment.Add(0.460757981064355); +// strikes.Add(0.744); stdDevsOnExpiry.Add(0.459412536191602); stdDevsOnPayment.Add(0.46098156661845); +// strikes.Add(0.745); stdDevsOnExpiry.Add(0.459656031571435); stdDevsOnPayment.Add(0.461156546617307); +// strikes.Add(0.746); stdDevsOnExpiry.Add(0.459829956842744); stdDevsOnPayment.Add(0.461370411060354); +// strikes.Add(0.747); stdDevsOnExpiry.Add(0.460054478556616); stdDevsOnPayment.Add(0.461545391059211); +// strikes.Add(0.748); stdDevsOnExpiry.Add(0.460244215216226); stdDevsOnPayment.Add(0.46179165920575); +// strikes.Add(0.749); stdDevsOnExpiry.Add(0.460396004543914); stdDevsOnPayment.Add(0.461966639204608); +// strikes.Add(0.75); stdDevsOnExpiry.Add(0.460671122700349); stdDevsOnPayment.Add(0.462212907351147); +// strikes.Add(0.751); stdDevsOnExpiry.Add(0.460857697082299); stdDevsOnPayment.Add(0.462378166238956); +// strikes.Add(0.752); stdDevsOnExpiry.Add(0.461028460075948); stdDevsOnPayment.Add(0.462598511422702); +// strikes.Add(0.753); stdDevsOnExpiry.Add(0.461215034457898); stdDevsOnPayment.Add(0.462792933643655); +// strikes.Add(0.754); stdDevsOnExpiry.Add(0.461458529837731); stdDevsOnPayment.Add(0.4630132788274); +// strikes.Add(0.755); stdDevsOnExpiry.Add(0.461657753330322); stdDevsOnPayment.Add(0.4632174221594); +// strikes.Add(0.756); stdDevsOnExpiry.Add(0.461869625933553); stdDevsOnPayment.Add(0.463411844380352); +// strikes.Add(0.757); stdDevsOnExpiry.Add(0.462122608146366); stdDevsOnPayment.Add(0.463632189564098); +// strikes.Add(0.758); stdDevsOnExpiry.Add(0.462264910641074); stdDevsOnPayment.Add(0.463820131044352); +// strikes.Add(0.759); stdDevsOnExpiry.Add(0.462470458688985); stdDevsOnPayment.Add(0.464014553265304); +// strikes.Add(0.76); stdDevsOnExpiry.Add(0.462676006736896); stdDevsOnPayment.Add(0.464254340671146); +// strikes.Add(0.761); stdDevsOnExpiry.Add(0.462910015283748); stdDevsOnPayment.Add(0.464432561040352); +// strikes.Add(0.762); stdDevsOnExpiry.Add(0.463087102832718); stdDevsOnPayment.Add(0.464646425483399); +// strikes.Add(0.763); stdDevsOnExpiry.Add(0.463245216715726); stdDevsOnPayment.Add(0.464850568815399); +// strikes.Add(0.764); stdDevsOnExpiry.Add(0.463482387540239); stdDevsOnPayment.Add(0.464999625851462); +// strikes.Add(0.765); stdDevsOnExpiry.Add(0.46369109786581); stdDevsOnPayment.Add(0.465281538071843); +// strikes.Add(0.766); stdDevsOnExpiry.Add(0.463909295024361); stdDevsOnPayment.Add(0.465443556589303); +// strikes.Add(0.767); stdDevsOnExpiry.Add(0.46407373346269); stdDevsOnPayment.Add(0.465650940291652); +// strikes.Add(0.768); stdDevsOnExpiry.Add(0.464285606065922); stdDevsOnPayment.Add(0.465861564364351); +// strikes.Add(0.769); stdDevsOnExpiry.Add(0.464475342725532); stdDevsOnPayment.Add(0.466036544363208); +// strikes.Add(0.77); stdDevsOnExpiry.Add(0.464668241662802); stdDevsOnPayment.Add(0.466218005102763); +// strikes.Add(0.771); stdDevsOnExpiry.Add(0.464845329211771); stdDevsOnPayment.Add(0.466483715471398); +// strikes.Add(0.772); stdDevsOnExpiry.Add(0.465031903593721); stdDevsOnPayment.Add(0.466632772507461); +// strikes.Add(0.773); stdDevsOnExpiry.Add(0.465256425307593); stdDevsOnPayment.Add(0.466807752506318); +// strikes.Add(0.774); stdDevsOnExpiry.Add(0.465427188301242); stdDevsOnPayment.Add(0.467060501393556); +// strikes.Add(0.775); stdDevsOnExpiry.Add(0.465645385459794); stdDevsOnPayment.Add(0.467229000651715); +// strikes.Add(0.776); stdDevsOnExpiry.Add(0.465806661620462); stdDevsOnPayment.Add(0.467416942131968); +// strikes.Add(0.777); stdDevsOnExpiry.Add(0.466021696501354); stdDevsOnPayment.Add(0.467591922130826); +// strikes.Add(0.778); stdDevsOnExpiry.Add(0.466255705048206); stdDevsOnPayment.Add(0.467815507684921); +// strikes.Add(0.779); stdDevsOnExpiry.Add(0.466489713595059); stdDevsOnPayment.Add(0.467996968424476); +// strikes.Add(0.78); stdDevsOnExpiry.Add(0.466676287977009); stdDevsOnPayment.Add(0.468188150275079); +// strikes.Add(0.781); stdDevsOnExpiry.Add(0.466843888692998); stdDevsOnPayment.Add(0.468395533977428); +// strikes.Add(0.782); stdDevsOnExpiry.Add(0.466992515743026); stdDevsOnPayment.Add(0.468576994716984); +// strikes.Add(0.783); stdDevsOnExpiry.Add(0.467213875179237); stdDevsOnPayment.Add(0.468823262863523); +// strikes.Add(0.784); stdDevsOnExpiry.Add(0.467470019669711); stdDevsOnPayment.Add(0.469017685084475); +// strikes.Add(0.785); stdDevsOnExpiry.Add(0.467656594051661); stdDevsOnPayment.Add(0.469228309157174); +// strikes.Add(0.786); stdDevsOnExpiry.Add(0.467811545657009); stdDevsOnPayment.Add(0.46944541397057); +// strikes.Add(0.787); stdDevsOnExpiry.Add(0.467938036763416); stdDevsOnPayment.Add(0.46956854804384); +// strikes.Add(0.788); stdDevsOnExpiry.Add(0.468172045310268); stdDevsOnPayment.Add(0.469788893227586); +// strikes.Add(0.789); stdDevsOnExpiry.Add(0.468374431080519); stdDevsOnPayment.Add(0.470035161374125); +// strikes.Add(0.79); stdDevsOnExpiry.Add(0.468595790516731); stdDevsOnPayment.Add(0.470200420261935); +// strikes.Add(0.791); stdDevsOnExpiry.Add(0.468801338564642); stdDevsOnPayment.Add(0.470407803964284); +// strikes.Add(0.792); stdDevsOnExpiry.Add(0.468972101558291); stdDevsOnPayment.Add(0.470514736185807); +// strikes.Add(0.793); stdDevsOnExpiry.Add(0.46913970227428); stdDevsOnPayment.Add(0.470770725443395); +// strikes.Add(0.794); stdDevsOnExpiry.Add(0.469307302990269); stdDevsOnPayment.Add(0.470974868775394); +// strikes.Add(0.795); stdDevsOnExpiry.Add(0.469550798370102); stdDevsOnPayment.Add(0.471127166181807); +// strikes.Add(0.796); stdDevsOnExpiry.Add(0.46970891225311); stdDevsOnPayment.Add(0.471337790254505); +// strikes.Add(0.797); stdDevsOnExpiry.Add(0.469952407632943); stdDevsOnPayment.Add(0.47156461617895); +// strikes.Add(0.798); stdDevsOnExpiry.Add(0.470151631125534); stdDevsOnPayment.Add(0.471733115437108); +// strikes.Add(0.799); stdDevsOnExpiry.Add(0.47026231084364); stdDevsOnPayment.Add(0.471937258769108); +// strikes.Add(0.8); stdDevsOnExpiry.Add(0.470499481668152); stdDevsOnPayment.Add(0.47205067173133); +// strikes.Add(0.801); stdDevsOnExpiry.Add(0.470670244661801); stdDevsOnPayment.Add(0.472283978396473); +// strikes.Add(0.802); stdDevsOnExpiry.Add(0.470878954987373); stdDevsOnPayment.Add(0.472442756543584); +// strikes.Add(0.803); stdDevsOnExpiry.Add(0.4710275820374); stdDevsOnPayment.Add(0.472737630245361); +// strikes.Add(0.804); stdDevsOnExpiry.Add(0.471220480974671); stdDevsOnPayment.Add(0.472880206540726); +// strikes.Add(0.805); stdDevsOnExpiry.Add(0.471432353577902); stdDevsOnPayment.Add(0.473081109502377); +// strikes.Add(0.806); stdDevsOnExpiry.Add(0.471615765682192); stdDevsOnPayment.Add(0.473246368390186); +// strikes.Add(0.807); stdDevsOnExpiry.Add(0.471837125118404); stdDevsOnPayment.Add(0.473450511722186); +// strikes.Add(0.808); stdDevsOnExpiry.Add(0.472026861778014); stdDevsOnPayment.Add(0.473625491721043); +// strikes.Add(0.809); stdDevsOnExpiry.Add(0.472184975661022); stdDevsOnPayment.Add(0.4738004717199); +// strikes.Add(0.81); stdDevsOnExpiry.Add(0.472346251821691); stdDevsOnPayment.Add(0.473991653570503); +// strikes.Add(0.811); stdDevsOnExpiry.Add(0.472573935813223); stdDevsOnPayment.Add(0.474179595050757); +// strikes.Add(0.812); stdDevsOnExpiry.Add(0.47271307603027); stdDevsOnPayment.Add(0.474377257642059); +// strikes.Add(0.813); stdDevsOnExpiry.Add(0.472940760021802); stdDevsOnPayment.Add(0.474513353196725); +// strikes.Add(0.814); stdDevsOnExpiry.Add(0.473168444013335); stdDevsOnPayment.Add(0.474730458010122); +// strikes.Add(0.815); stdDevsOnExpiry.Add(0.473310746508042); stdDevsOnPayment.Add(0.474931360971772); +// strikes.Add(0.816); stdDevsOnExpiry.Add(0.473528943666594); stdDevsOnPayment.Add(0.475148465785169); +// strikes.Add(0.817); stdDevsOnExpiry.Add(0.473658597050661); stdDevsOnPayment.Add(0.475359089857867); +// strikes.Add(0.818); stdDevsOnExpiry.Add(0.473857820543251); stdDevsOnPayment.Add(0.475485464301486); +// strikes.Add(0.819); stdDevsOnExpiry.Add(0.474012772148599); stdDevsOnPayment.Add(0.475702569114883); +// strikes.Add(0.82); stdDevsOnExpiry.Add(0.474291052582694); stdDevsOnPayment.Add(0.475906712446883); +// strikes.Add(0.821); stdDevsOnExpiry.Add(0.474436517355062); stdDevsOnPayment.Add(0.476046048371899); +// strikes.Add(0.822); stdDevsOnExpiry.Add(0.474661039068934); stdDevsOnPayment.Add(0.476269633925994); +// strikes.Add(0.823); stdDevsOnExpiry.Add(0.474765394231719); stdDevsOnPayment.Add(0.476399248739962); +// strikes.Add(0.824); stdDevsOnExpiry.Add(0.475027863277513); stdDevsOnPayment.Add(0.476626074664406); +// strikes.Add(0.825); stdDevsOnExpiry.Add(0.475198626271162); stdDevsOnPayment.Add(0.476807535403962); +// strikes.Add(0.826); stdDevsOnExpiry.Add(0.475321955099909); stdDevsOnPayment.Add(0.476953352069676); +// strikes.Add(0.827); stdDevsOnExpiry.Add(0.475552801369101); stdDevsOnPayment.Add(0.477144533920279); +// strikes.Add(0.828); stdDevsOnExpiry.Add(0.475685617030829); stdDevsOnPayment.Add(0.477355157992977); +// strikes.Add(0.829); stdDevsOnExpiry.Add(0.47590065191172); stdDevsOnPayment.Add(0.477539859102882); +// strikes.Add(0.83); stdDevsOnExpiry.Add(0.476074577183029); stdDevsOnPayment.Add(0.477718079472088); +// strikes.Add(0.831); stdDevsOnExpiry.Add(0.476201068289436); stdDevsOnPayment.Add(0.477876857619199); +// strikes.Add(0.832); stdDevsOnExpiry.Add(0.47645721277991); stdDevsOnPayment.Add(0.478097202802945); +// strikes.Add(0.833); stdDevsOnExpiry.Add(0.476593190719297); stdDevsOnPayment.Add(0.478281903912849); +// strikes.Add(0.834); stdDevsOnExpiry.Add(0.476861984320411); stdDevsOnPayment.Add(0.478489287615198); +// strikes.Add(0.835); stdDevsOnExpiry.Add(0.476975826316177); stdDevsOnPayment.Add(0.478589739096024); +// strikes.Add(0.836); stdDevsOnExpiry.Add(0.477203510307709); stdDevsOnPayment.Add(0.478803603539071); +// strikes.Add(0.837); stdDevsOnExpiry.Add(0.477323676858796); stdDevsOnPayment.Add(0.478991545019325); +// strikes.Add(0.838); stdDevsOnExpiry.Add(0.477538711739687); stdDevsOnPayment.Add(0.479166525018182); +// strikes.Add(0.839); stdDevsOnExpiry.Add(0.477722123843977); stdDevsOnPayment.Add(0.479399831683325); +// strikes.Add(0.84); stdDevsOnExpiry.Add(0.477946645557849); stdDevsOnPayment.Add(0.479503523534499); +// strikes.Add(0.841); stdDevsOnExpiry.Add(0.478098434885537); stdDevsOnPayment.Add(0.479688224644404); +// strikes.Add(0.842); stdDevsOnExpiry.Add(0.478291333822807); stdDevsOnPayment.Add(0.479979857975832); +// strikes.Add(0.843); stdDevsOnExpiry.Add(0.478370390764311); stdDevsOnPayment.Add(0.480073828715959); +// strikes.Add(0.844); stdDevsOnExpiry.Add(0.478550640590941); stdDevsOnPayment.Add(0.48027473167761); +// strikes.Add(0.845); stdDevsOnExpiry.Add(0.478797298248434); stdDevsOnPayment.Add(0.480427029084022); +// strikes.Add(0.846); stdDevsOnExpiry.Add(0.478987034908044); stdDevsOnPayment.Add(0.480624691675324); +// strikes.Add(0.847); stdDevsOnExpiry.Add(0.479119850569771); stdDevsOnPayment.Add(0.48080291204453); +// strikes.Add(0.848); stdDevsOnExpiry.Add(0.479338047728323); stdDevsOnPayment.Add(0.48096493056199); +// strikes.Add(0.849); stdDevsOnExpiry.Add(0.479568893997515); stdDevsOnPayment.Add(0.481162593153292); +// strikes.Add(0.85); stdDevsOnExpiry.Add(0.479749143824145); stdDevsOnPayment.Add(0.48137321722599); +// strikes.Add(0.851); stdDevsOnExpiry.Add(0.47985033670927); stdDevsOnPayment.Add(0.481509312780656); +// strikes.Add(0.852); stdDevsOnExpiry.Add(0.480043235646541); stdDevsOnPayment.Add(0.481719936853355); +// strikes.Add(0.853); stdDevsOnExpiry.Add(0.48022348547317); stdDevsOnPayment.Add(0.481875474630116); +// strikes.Add(0.854); stdDevsOnExpiry.Add(0.480324678358296); stdDevsOnPayment.Add(0.48210554092491); +// strikes.Add(0.855); stdDevsOnExpiry.Add(0.48060295879239); stdDevsOnPayment.Add(0.48226755944237); +// strikes.Add(0.856); stdDevsOnExpiry.Add(0.480716800788156); stdDevsOnPayment.Add(0.482432818330179); +// strikes.Add(0.857); stdDevsOnExpiry.Add(0.480988756666931); stdDevsOnPayment.Add(0.482607798329037); +// strikes.Add(0.858); stdDevsOnExpiry.Add(0.481096274107377); stdDevsOnPayment.Add(0.482773057216846); +// strikes.Add(0.859); stdDevsOnExpiry.Add(0.481238576602084); stdDevsOnPayment.Add(0.482977200548846); +// strikes.Add(0.86); stdDevsOnExpiry.Add(0.481456773760636); stdDevsOnPayment.Add(0.48316190165875); +// strikes.Add(0.861); stdDevsOnExpiry.Add(0.481573778034062); stdDevsOnPayment.Add(0.483278554991322); +// strikes.Add(0.862); stdDevsOnExpiry.Add(0.481833084802196); stdDevsOnPayment.Add(0.483495659804718); +// strikes.Add(0.863); stdDevsOnExpiry.Add(0.481978549574564); stdDevsOnPayment.Add(0.483647957211131); +// strikes.Add(0.864); stdDevsOnExpiry.Add(0.482136663457572); stdDevsOnPayment.Add(0.483819696839639); +// strikes.Add(0.865); stdDevsOnExpiry.Add(0.482345373783143); stdDevsOnPayment.Add(0.484001157579194); +// strikes.Add(0.866); stdDevsOnExpiry.Add(0.482462378056569); stdDevsOnPayment.Add(0.484208541281543); +// strikes.Add(0.867); stdDevsOnExpiry.Add(0.482705873436402); stdDevsOnPayment.Add(0.484289550540273); +// strikes.Add(0.868); stdDevsOnExpiry.Add(0.482908259206653); stdDevsOnPayment.Add(0.48454878016821); +// strikes.Add(0.869); stdDevsOnExpiry.Add(0.483072697644982); stdDevsOnPayment.Add(0.484769125351956); +// strikes.Add(0.87); stdDevsOnExpiry.Add(0.483180215085428); stdDevsOnPayment.Add(0.484911701647321); +// strikes.Add(0.871); stdDevsOnExpiry.Add(0.483461657797183); stdDevsOnPayment.Add(0.485086681646178); +// strikes.Add(0.872); stdDevsOnExpiry.Add(0.483537552461027); stdDevsOnPayment.Add(0.485219536830495); +// strikes.Add(0.873); stdDevsOnExpiry.Add(0.483692504066375); stdDevsOnPayment.Add(0.485446362754939); +// strikes.Add(0.874); stdDevsOnExpiry.Add(0.483831644283422); stdDevsOnPayment.Add(0.485559775717161); +// strikes.Add(0.875); stdDevsOnExpiry.Add(0.484037192331333); stdDevsOnPayment.Add(0.485760678678812); +// strikes.Add(0.876); stdDevsOnExpiry.Add(0.484242740379244); stdDevsOnPayment.Add(0.485987504603256); +// strikes.Add(0.877); stdDevsOnExpiry.Add(0.484366069207991); stdDevsOnPayment.Add(0.486104157935828); +// strikes.Add(0.878); stdDevsOnExpiry.Add(0.484596915477183); stdDevsOnPayment.Add(0.486282378305034); +// strikes.Add(0.879); stdDevsOnExpiry.Add(0.484707595195289); stdDevsOnPayment.Add(0.486489762007383); +// strikes.Add(0.88); stdDevsOnExpiry.Add(0.484849897689996); stdDevsOnPayment.Add(0.486612896080653); +// strikes.Add(0.881); stdDevsOnExpiry.Add(0.48509655534749); stdDevsOnPayment.Add(0.486758712746367); +// strikes.Add(0.882); stdDevsOnExpiry.Add(0.485254669230498); stdDevsOnPayment.Add(0.486956375337668); +// strikes.Add(0.883); stdDevsOnExpiry.Add(0.485498164610331); stdDevsOnPayment.Add(0.48715403792897); +// strikes.Add(0.884); stdDevsOnExpiry.Add(0.485574059274175); stdDevsOnPayment.Add(0.487290133483636); +// strikes.Add(0.885); stdDevsOnExpiry.Add(0.485691063547601); stdDevsOnPayment.Add(0.487416507927255); +// strikes.Add(0.886); stdDevsOnExpiry.Add(0.485899773873172); stdDevsOnPayment.Add(0.487610930148207); +// strikes.Add(0.887); stdDevsOnExpiry.Add(0.486171729751947); stdDevsOnPayment.Add(0.487782669776715); +// strikes.Add(0.888); stdDevsOnExpiry.Add(0.486307707691334); stdDevsOnPayment.Add(0.488009495701159); +// strikes.Add(0.889); stdDevsOnExpiry.Add(0.486519580294565); stdDevsOnPayment.Add(0.488165033477921); +// strikes.Add(0.89); stdDevsOnExpiry.Add(0.486627097735011); stdDevsOnPayment.Add(0.488314090513985); +// strikes.Add(0.891); stdDevsOnExpiry.Add(0.486769400229719); stdDevsOnPayment.Add(0.488476109031445); +// strikes.Add(0.892); stdDevsOnExpiry.Add(0.486943325501028); stdDevsOnPayment.Add(0.488631646808207); +// strikes.Add(0.893); stdDevsOnExpiry.Add(0.487107763939357); stdDevsOnPayment.Add(0.488829309399508); +// strikes.Add(0.894); stdDevsOnExpiry.Add(0.487297500598967); stdDevsOnPayment.Add(0.488962164583825); +// strikes.Add(0.895); stdDevsOnExpiry.Add(0.487420829427713); stdDevsOnPayment.Add(0.489172788656524); +// strikes.Add(0.896); stdDevsOnExpiry.Add(0.487642188863925); stdDevsOnPayment.Add(0.489318605322238); +// strikes.Add(0.897); stdDevsOnExpiry.Add(0.487809789579914); stdDevsOnPayment.Add(0.489493585321095); +// strikes.Add(0.898); stdDevsOnExpiry.Add(0.487952092074622); stdDevsOnPayment.Add(0.489655603838555); +// strikes.Add(0.899); stdDevsOnExpiry.Add(0.48810388140231); stdDevsOnPayment.Add(0.48987918939265); +// strikes.Add(0.9); stdDevsOnExpiry.Add(0.488334727671502); stdDevsOnPayment.Add(0.49000232346592); +// strikes.Add(0.901); stdDevsOnExpiry.Add(0.48847703016621); stdDevsOnPayment.Add(0.490232389760713); +// strikes.Add(0.902); stdDevsOnExpiry.Add(0.488660442270499); stdDevsOnPayment.Add(0.490349043093285); +// strikes.Add(0.903); stdDevsOnExpiry.Add(0.488847016652449); stdDevsOnPayment.Add(0.490475417536904); +// strikes.Add(0.904); stdDevsOnExpiry.Add(0.488938722704594); stdDevsOnPayment.Add(0.490699003090999); +// strikes.Add(0.905); stdDevsOnExpiry.Add(0.48904624014504); stdDevsOnPayment.Add(0.490838339016015); +// strikes.Add(0.906); stdDevsOnExpiry.Add(0.489264437303591); stdDevsOnPayment.Add(0.491026280496268); +// strikes.Add(0.907); stdDevsOnExpiry.Add(0.489409902075959); stdDevsOnPayment.Add(0.491175337532332); +// strikes.Add(0.908); stdDevsOnExpiry.Add(0.489647072900472); stdDevsOnPayment.Add(0.491392442345728); +// strikes.Add(0.909); stdDevsOnExpiry.Add(0.489760914896238); stdDevsOnPayment.Add(0.491515576418998); +// strikes.Add(0.91); stdDevsOnExpiry.Add(0.48999492344309); stdDevsOnPayment.Add(0.491658152714363); +// strikes.Add(0.911); stdDevsOnExpiry.Add(0.49018149782504); stdDevsOnPayment.Add(0.491872017157411); +// strikes.Add(0.912); stdDevsOnExpiry.Add(0.490190984658021); stdDevsOnPayment.Add(0.491975709008585); +// strikes.Add(0.913); stdDevsOnExpiry.Add(0.490466102814455); stdDevsOnPayment.Add(0.492170131229537); +// strikes.Add(0.914); stdDevsOnExpiry.Add(0.490611567586823); stdDevsOnPayment.Add(0.49236131308014); +// strikes.Add(0.915); stdDevsOnExpiry.Add(0.490785492858132); stdDevsOnPayment.Add(0.492529812338299); +// strikes.Add(0.916); stdDevsOnExpiry.Add(0.490908821686879); stdDevsOnPayment.Add(0.492701551966807); +// strikes.Add(0.917); stdDevsOnExpiry.Add(0.491032150515626); stdDevsOnPayment.Add(0.492831166780775); +// strikes.Add(0.918); stdDevsOnExpiry.Add(0.491244023118857); stdDevsOnPayment.Add(0.492983464187188); +// strikes.Add(0.919); stdDevsOnExpiry.Add(0.491373676502924); stdDevsOnPayment.Add(0.493194088259886); +// strikes.Add(0.92); stdDevsOnExpiry.Add(0.491534952663592); stdDevsOnPayment.Add(0.493245934185473); +// strikes.Add(0.921); stdDevsOnExpiry.Add(0.491737338433843); stdDevsOnPayment.Add(0.493557009738997); +// strikes.Add(0.922); stdDevsOnExpiry.Add(0.491952373314735); stdDevsOnPayment.Add(0.493641259368076); +// strikes.Add(0.923); stdDevsOnExpiry.Add(0.49205672847752); stdDevsOnPayment.Add(0.493845402700076); +// strikes.Add(0.924); stdDevsOnExpiry.Add(0.492227491471169); stdDevsOnPayment.Add(0.493978257884393); +// strikes.Add(0.925); stdDevsOnExpiry.Add(0.492376118521197); stdDevsOnPayment.Add(0.494130555290806); +// strikes.Add(0.926); stdDevsOnExpiry.Add(0.492569017458467); stdDevsOnPayment.Add(0.49431849677106); +// strikes.Add(0.927); stdDevsOnExpiry.Add(0.492682859454234); stdDevsOnPayment.Add(0.494457832696075); +// strikes.Add(0.928); stdDevsOnExpiry.Add(0.492882082946824); stdDevsOnPayment.Add(0.494665216398424); +// strikes.Add(0.929); stdDevsOnExpiry.Add(0.49298643810961); stdDevsOnPayment.Add(0.494749466027504); +// strikes.Add(0.93); stdDevsOnExpiry.Add(0.493214122101142); stdDevsOnPayment.Add(0.494986013062996); +// strikes.Add(0.931); stdDevsOnExpiry.Add(0.493350100040529); stdDevsOnPayment.Add(0.495105906765916); +// strikes.Add(0.932); stdDevsOnExpiry.Add(0.493524025311838); stdDevsOnPayment.Add(0.495329492320011); +// strikes.Add(0.933); stdDevsOnExpiry.Add(0.493713761971448); stdDevsOnPayment.Add(0.495446145652583); +// strikes.Add(0.934); stdDevsOnExpiry.Add(0.493887687242758); stdDevsOnPayment.Add(0.495562798985154); +// strikes.Add(0.935); stdDevsOnExpiry.Add(0.494052125681086); stdDevsOnPayment.Add(0.495763701946804); +// strikes.Add(0.936); stdDevsOnExpiry.Add(0.494143831733231); stdDevsOnPayment.Add(0.495948403056709); +// strikes.Add(0.937); stdDevsOnExpiry.Add(0.494355704336463); stdDevsOnPayment.Add(0.496084498611376); +// strikes.Add(0.938); stdDevsOnExpiry.Add(0.494539116440752); stdDevsOnPayment.Add(0.496282161202677); +// strikes.Add(0.939); stdDevsOnExpiry.Add(0.494615011104596); stdDevsOnPayment.Add(0.496437698979439); +// strikes.Add(0.94); stdDevsOnExpiry.Add(0.494782611820585); stdDevsOnPayment.Add(0.496599717496899); +// strikes.Add(0.941); stdDevsOnExpiry.Add(0.494886966983371); stdDevsOnPayment.Add(0.496790899347502); +// strikes.Add(0.942); stdDevsOnExpiry.Add(0.495174734250446); stdDevsOnPayment.Add(0.496878389346931); +// strikes.Add(0.943); stdDevsOnExpiry.Add(0.495323361300474); stdDevsOnPayment.Add(0.497037167494042); +// strikes.Add(0.944); stdDevsOnExpiry.Add(0.495459339239861); stdDevsOnPayment.Add(0.497176503419057); +// strikes.Add(0.945); stdDevsOnExpiry.Add(0.495519422515405); stdDevsOnPayment.Add(0.497338521936518); +// strikes.Add(0.946); stdDevsOnExpiry.Add(0.495721808285655); stdDevsOnPayment.Add(0.497562107490613); +// strikes.Add(0.947); stdDevsOnExpiry.Add(0.495921031778246); stdDevsOnPayment.Add(0.497701443415628); +// strikes.Add(0.948); stdDevsOnExpiry.Add(0.496066496550614); stdDevsOnPayment.Add(0.497837538970295); +// strikes.Add(0.949); stdDevsOnExpiry.Add(0.496218285878302); stdDevsOnPayment.Add(0.49801899970985); +// strikes.Add(0.95); stdDevsOnExpiry.Add(0.496385886594291); stdDevsOnPayment.Add(0.498219902671501); +// strikes.Add(0.951); stdDevsOnExpiry.Add(0.496525026811338); stdDevsOnPayment.Add(0.498268508226739); +// strikes.Add(0.952); stdDevsOnExpiry.Add(0.496676816139026); stdDevsOnPayment.Add(0.498498574521533); +// strikes.Add(0.953); stdDevsOnExpiry.Add(0.496793820412452); stdDevsOnPayment.Add(0.498628189335501); +// strikes.Add(0.954); stdDevsOnExpiry.Add(0.497049964902926); stdDevsOnPayment.Add(0.498812890445405); +// strikes.Add(0.955); stdDevsOnExpiry.Add(0.497189105119973); stdDevsOnPayment.Add(0.499013793407056); +// strikes.Add(0.956); stdDevsOnExpiry.Add(0.497347219002982); stdDevsOnPayment.Add(0.499172571554167); +// strikes.Add(0.957); stdDevsOnExpiry.Add(0.497476872387049); stdDevsOnPayment.Add(0.49924385970185); +// strikes.Add(0.958); stdDevsOnExpiry.Add(0.4976792581573); stdDevsOnPayment.Add(0.499503089329786); +// strikes.Add(0.959); stdDevsOnExpiry.Add(0.497770964209444); stdDevsOnPayment.Add(0.499593819699564); +// strikes.Add(0.96); stdDevsOnExpiry.Add(0.497998648200977); stdDevsOnPayment.Add(0.499726674883881); +// strikes.Add(0.961); stdDevsOnExpiry.Add(0.498042920088219); stdDevsOnPayment.Add(0.499937298956579); +// strikes.Add(0.962); stdDevsOnExpiry.Add(0.498204196248888); stdDevsOnPayment.Add(0.500031269696706); +// strikes.Add(0.963); stdDevsOnExpiry.Add(0.49842871796276); stdDevsOnPayment.Add(0.500203009325214); +// strikes.Add(0.964); stdDevsOnExpiry.Add(0.498517261737244); stdDevsOnPayment.Add(0.500345585620579); +// strikes.Add(0.965); stdDevsOnExpiry.Add(0.498672213342592); stdDevsOnPayment.Add(0.500436315990357); +// strikes.Add(0.966); stdDevsOnExpiry.Add(0.49881767811496); stdDevsOnPayment.Add(0.500689064877594); +// strikes.Add(0.967); stdDevsOnExpiry.Add(0.499076984883094); stdDevsOnPayment.Add(0.500792756728769); +// strikes.Add(0.968); stdDevsOnExpiry.Add(0.499200313711841); stdDevsOnPayment.Add(0.501006621171816); +// strikes.Add(0.969); stdDevsOnExpiry.Add(0.499415348592732); stdDevsOnPayment.Add(0.50107466894915); +// strikes.Add(0.97); stdDevsOnExpiry.Add(0.499513379200197); stdDevsOnPayment.Add(0.501343619688134); +// strikes.Add(0.971); stdDevsOnExpiry.Add(0.499665168527885); stdDevsOnPayment.Add(0.501431109687562); +// strikes.Add(0.972); stdDevsOnExpiry.Add(0.499769523690671); stdDevsOnPayment.Add(0.50160284931607); +// strikes.Add(0.973); stdDevsOnExpiry.Add(0.499911826185378); stdDevsOnPayment.Add(0.50172598338934); +// strikes.Add(0.974); stdDevsOnExpiry.Add(0.500098400567328); stdDevsOnPayment.Add(0.501894482647498); +// strikes.Add(0.975); stdDevsOnExpiry.Add(0.500281812671618); stdDevsOnPayment.Add(0.502037058942863); +// strikes.Add(0.976); stdDevsOnExpiry.Add(0.500370356446103); stdDevsOnPayment.Add(0.502263884867308); +// strikes.Add(0.977); stdDevsOnExpiry.Add(0.50050000983017); stdDevsOnPayment.Add(0.502344894126038); +// strikes.Add(0.978); stdDevsOnExpiry.Add(0.500702395600421); stdDevsOnPayment.Add(0.502506912643498); +// strikes.Add(0.979); stdDevsOnExpiry.Add(0.500844698095128); stdDevsOnPayment.Add(0.502568479680133); +// strikes.Add(0.98); stdDevsOnExpiry.Add(0.501091355752621); stdDevsOnPayment.Add(0.502827709308069); +// strikes.Add(0.981); stdDevsOnExpiry.Add(0.501129303084543); stdDevsOnPayment.Add(0.502980006714482); +// strikes.Add(0.982); stdDevsOnExpiry.Add(0.501338013410114); stdDevsOnPayment.Add(0.503096660047053); +// strikes.Add(0.983); stdDevsOnExpiry.Add(0.501540399180365); stdDevsOnPayment.Add(0.503375331897085); +// strikes.Add(0.984); stdDevsOnExpiry.Add(0.501644754343151); stdDevsOnPayment.Add(0.503423937452323); +// strikes.Add(0.985); stdDevsOnExpiry.Add(0.501720649006995); stdDevsOnPayment.Add(0.503621600043624); +// strikes.Add(0.986); stdDevsOnExpiry.Add(0.501954657553847); stdDevsOnPayment.Add(0.503806301153529); +// strikes.Add(0.987); stdDevsOnExpiry.Add(0.502096960048555); stdDevsOnPayment.Add(0.503929435226798); +// strikes.Add(0.988); stdDevsOnExpiry.Add(0.502210802044321); stdDevsOnPayment.Add(0.504078492262862); +// strikes.Add(0.989); stdDevsOnExpiry.Add(0.502406863259251); stdDevsOnPayment.Add(0.504175703373338); +// strikes.Add(0.99); stdDevsOnExpiry.Add(0.502596599918861); stdDevsOnPayment.Add(0.50437012559429); +// strikes.Add(0.991); stdDevsOnExpiry.Add(0.502659845472065); stdDevsOnPayment.Add(0.504447894482671); +// strikes.Add(0.992); stdDevsOnExpiry.Add(0.502811634799753); stdDevsOnPayment.Add(0.504713604851306); +// strikes.Add(0.993); stdDevsOnExpiry.Add(0.502903340851898); stdDevsOnPayment.Add(0.504713604851306); +// strikes.Add(0.994); stdDevsOnExpiry.Add(0.503083590678527); stdDevsOnPayment.Add(0.504924228924004); +// strikes.Add(0.995); stdDevsOnExpiry.Add(0.503304950114739); stdDevsOnPayment.Add(0.505095968552512); +// strikes.Add(0.996); stdDevsOnExpiry.Add(0.503384007056243); stdDevsOnPayment.Add(0.505189939292639); +// strikes.Add(0.997); stdDevsOnExpiry.Add(0.503529471828611); stdDevsOnPayment.Add(0.505390842254289); +// strikes.Add(0.998); stdDevsOnExpiry.Add(0.503712883932901); stdDevsOnPayment.Add(0.505611187438035); +// strikes.Add(0.999); stdDevsOnExpiry.Add(0.503858348705269); stdDevsOnPayment.Add(0.505695437067115); +// strikes.Add(1); stdDevsOnExpiry.Add(0.504029111698918); stdDevsOnPayment.Add(0.505818571140384); +// strikes.Add(1.001); stdDevsOnExpiry.Add(0.504127142306383); stdDevsOnPayment.Add(0.505964387806099); +// strikes.Add(1.002); stdDevsOnExpiry.Add(0.504301067577692); stdDevsOnPayment.Add(0.506139367804955); + +// //Create smiles on Expiry Date +// smilesOnExpiry = new List(); +// smilesOnExpiry.Add(new FlatSmileSection(startDate, flatVol, rangeCouponDayCount)); +// double dummyAtmLevel = 0; +// smilesOnExpiry.Add(new InterpolatedSmileSection(startDate, +// strikes, stdDevsOnExpiry, dummyAtmLevel, rangeCouponDayCount)); +// //Create smiles on Payment Date +// smilesOnPayment = new List(); +// smilesOnPayment.Add(new FlatSmileSection(endDate, flatVol, rangeCouponDayCount)); +// smilesOnPayment.Add(new InterpolatedSmileSection(endDate, +// strikes, stdDevsOnPayment, dummyAtmLevel, rangeCouponDayCount, new Linear())); + +// Utils.QL_REQUIRE(smilesOnExpiry.Count == smilesOnPayment.Count, () => +// "smilesOnExpiry.size()!=smilesOnPayment.size()"); +// } + +// public CommonVars() +// { + +// //General Settings +// calendar = new TARGET(); +// today = new Date(39147); // 6 Mar 2007 +// Settings.setEvaluationDate(today); +// settlement = today; +// //create Yield Curve +// createYieldCurve(); +// referenceDate = termStructure.link.referenceDate(); +// // Ibor index +// iborIndex = new Euribor6M(termStructure); + +// // create Volatility Structures +// flatVol = 0.1; +// createVolatilityStructures(); + +// // Range Accrual valuation +// gearing = 1.0; +// spread = 0.0; +// infiniteLowerStrike = 1.0e-9; +// infiniteUpperStrike = 1.0; +// correlation = 1.0; + +// startDate = new Date(42800); //6 Mar 2017 +// endDate = new Date(42984); //6 Sep 2017 +// paymentDate = endDate; //6 Sep 2017 +// fixingDays = 2; +// rangeCouponDayCount = iborIndex.dayCounter(); + +// // observations schedule +// observationsConvention = BusinessDayConvention.ModifiedFollowing; +// observationsFrequency = Frequency.Daily; +// observationSchedule = new Schedule(startDate, endDate, +// new Period(observationsFrequency), calendar, observationsConvention, observationsConvention, +// DateGeneration.Rule.Forward, false); +// // Range accrual pricers properties +// byCallSpread = new List(); +// byCallSpread.Add(true); +// byCallSpread.Add(false); + +// //Create smiles sections +// createSmileSections(); + +// //test parameters +// rateTolerance = 2.0e-8; +// priceTolerance = 2.0e-4; +// } +// } + +// [Fact] +// public void testInfiniteRange() +// { +// // Testing infinite range accrual floaters +// CommonVars vars = new CommonVars(); + +// //Coupon +// RangeAccrualFloatersCoupon coupon = new RangeAccrualFloatersCoupon(vars.paymentDate, +// 1.0, +// vars.iborIndex, +// vars.startDate, +// vars.endDate, +// vars.fixingDays, +// vars.rangeCouponDayCount, +// vars.gearing, vars.spread, +// vars.startDate, vars.endDate, +// vars.observationSchedule, +// vars.infiniteLowerStrike, +// vars.infiniteUpperStrike); +// Date fixingDate = coupon.fixingDate(); + +// for (int z = 0; z < vars.smilesOnPayment.Count; z++) +// { +// for (int i = 0; i < vars.byCallSpread.Count; i++) +// { +// RangeAccrualPricer bgmPricer = new RangeAccrualPricerByBgm(vars.correlation, +// vars.smilesOnExpiry[z], vars.smilesOnPayment[z], +// true, vars.byCallSpread[i]); + +// coupon.setPricer(bgmPricer); + +// //Computation +// double rate = coupon.rate(); +// double indexfixing = vars.iborIndex.fixing(fixingDate); +// double difference = rate - indexfixing; + +// if (Math.Abs(difference) > vars.rateTolerance) +// { +// QAssert.Fail("\n" + +// "i:\t" + i + "\n" + +// "fixingDate:\t" + fixingDate + "\n" + +// "startDate:\t" + vars.startDate + "\n" + +// "range accrual rate:\t" + rate + "\n" + +// "index fixing:\t" + indexfixing + "\n" + +// "difference:\t" + difference + "\n" + +// "tolerance: \t" + vars.rateTolerance); +// } + +// } +// } +// } + +// [Fact] +// public void testPriceMonotonicityWithRespectToLowerStrike() +// { +// // Testing price monotonicity with respect to the lower strike +// CommonVars vars = new CommonVars(); + +// for (int z = 0; z < vars.smilesOnPayment.Count; z++) +// { +// for (int i = 0; i < vars.byCallSpread.Count; i++) +// { +// RangeAccrualPricer bgmPricer = new RangeAccrualPricerByBgm(vars.correlation, +// vars.smilesOnExpiry[z], +// vars.smilesOnPayment[z], +// true, +// vars.byCallSpread[i]); + +// double effectiveLowerStrike; +// double previousPrice = 100.0; + +// for (int k = 1; k < 100; k++) +// { +// effectiveLowerStrike = 0.005 + k * 0.001; +// RangeAccrualFloatersCoupon coupon = new RangeAccrualFloatersCoupon( +// vars.paymentDate, +// 1.0, +// vars.iborIndex, +// vars.startDate, +// vars.endDate, +// vars.fixingDays, +// vars.rangeCouponDayCount, +// vars.gearing, vars.spread, +// vars.startDate, vars.endDate, +// vars.observationSchedule, +// effectiveLowerStrike, +// vars.infiniteUpperStrike); + +// coupon.setPricer(bgmPricer); + +// //Computation +// double price = coupon.price(vars.termStructure); + +// if (previousPrice <= price) +// { +// QAssert.Fail("\n" + +// "i:\t" + i + "\n" + +// "k:\t" + k + "\n" + +// "Price at lower strike\t" + (effectiveLowerStrike - 0.001) + +// ": \t" + previousPrice + "\n" + +// "Price at lower strike\t" + effectiveLowerStrike + +// ": \t" + price + "\n"); +// } + +// previousPrice = price; +// } +// } +// } +// } + +// [Fact] +// public void testPriceMonotonicityWithRespectToUpperStrike() +// { + +// // Testing price monotonicity with respect to the upper strike + +// CommonVars vars = new CommonVars(); + +// for (int z = 0; z < vars.smilesOnPayment.Count; z++) +// { +// for (int i = 0; i < vars.byCallSpread.Count; i++) +// { +// RangeAccrualPricer bgmPricer = new RangeAccrualPricerByBgm(vars.correlation, +// vars.smilesOnExpiry[z], +// vars.smilesOnPayment[z], +// true, +// vars.byCallSpread[i]); + +// double effectiveUpperStrike; +// double previousPrice = 0.0; + +// for (int k = 1; k < 95; k++) +// { +// effectiveUpperStrike = 0.006 + k * 0.001; +// RangeAccrualFloatersCoupon coupon = new RangeAccrualFloatersCoupon( +// vars.paymentDate, +// 1.0, +// vars.iborIndex, +// vars.startDate, +// vars.endDate, +// vars.fixingDays, +// vars.rangeCouponDayCount, +// vars.gearing, vars.spread, +// vars.startDate, vars.endDate, +// vars.observationSchedule, +// .004, +// effectiveUpperStrike); + +// coupon.setPricer(bgmPricer); + +// //Computation +// double price = coupon.price(vars.termStructure); + +// if (previousPrice > price) +// { +// QAssert.Fail("\n" + +// "i:\t" + i + "\n" + +// "k:\t" + k + "\n" + +// "Price at upper strike\t" + (effectiveUpperStrike - 0.001) + +// ": \t" + previousPrice + "\n" + +// "Price at upper strike\t" + effectiveUpperStrike + +// ": \t" + price + "\n"); +// } +// previousPrice = price; +// } +// } +// } +// } +// } +//} diff --git a/tests/QLNet.Tests/T_RiskStats.cs b/tests/QLNet.Tests/T_RiskStats.cs index 7c08098b1..e8b0cc1df 100644 --- a/tests/QLNet.Tests/T_RiskStats.cs +++ b/tests/QLNet.Tests/T_RiskStats.cs @@ -19,11 +19,7 @@ under the terms of the QLNet license. You should have received a using System; using System.Collections.Generic; using System.Linq; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite @@ -33,16 +29,10 @@ class IncrementalGaussianStatistics : GenericGaussianStatistics expected) @@ -48,11 +42,7 @@ void check_dates(Schedule s, List expected) } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testDailySchedule() { // Testing schedule with daily frequency @@ -78,11 +68,7 @@ public void testDailySchedule() check_dates(s, expected); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testEndDateWithEomAdjustment() { // Testing end date for schedule with end-of-month adjustment @@ -124,11 +110,7 @@ public void testEndDateWithEomAdjustment() check_dates(s, expected); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testDatesPastEndDateWithEomAdjustment() { @@ -151,11 +133,7 @@ public void testDatesPastEndDateWithEomAdjustment() check_dates(s, expected); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testDatesSameAsEndDateWithEomAdjustment() { // Testing that next-to-last date same as end date is removed... @@ -185,11 +163,7 @@ public void testDatesSameAsEndDateWithEomAdjustment() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testForwardDatesWithEomAdjustment() { // Testing that the last date is not adjusted for EOM when termination date convention is unadjusted @@ -212,11 +186,7 @@ public void testForwardDatesWithEomAdjustment() check_dates(s, expected); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testBackwardDatesWithEomAdjustment() { // Testing that the first date is not adjusted for EOM going backward when termination date convention is unadjusted @@ -239,11 +209,7 @@ public void testBackwardDatesWithEomAdjustment() check_dates(s, expected); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testDoubleFirstDateWithEomAdjustment() { // Testing that the first date is not duplicated due to EOM convention when going backwards @@ -265,11 +231,7 @@ public void testDoubleFirstDateWithEomAdjustment() check_dates(s, expected); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCDS2015Convention() { // Testing CDS2015 semi-annual rolling convention @@ -307,11 +269,7 @@ public void testCDS2015Convention() } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testDateConstructor() { // Testing the constructor taking a vector of dates and possibly additional meta information diff --git a/tests/QLNet.Tests/T_ShortRateModels.cs b/tests/QLNet.Tests/T_ShortRateModels.cs index 5467f6dd9..8c5c35ef4 100644 --- a/tests/QLNet.Tests/T_ShortRateModels.cs +++ b/tests/QLNet.Tests/T_ShortRateModels.cs @@ -21,18 +21,12 @@ under the terms of the QLNet license. You should have received a using System; using System.Collections.Generic; using System.Linq; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_ShortRateModels { @@ -49,11 +43,7 @@ public CalibrationData(int s, int l, double v) } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCachedHullWhite() { //("Testing Hull-White calibration against cached values..."); @@ -134,11 +124,7 @@ public void testCachedHullWhite() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSwaps() { //BOOST_MESSAGE("Testing Hull-White swap pricing against known values..."); @@ -258,11 +244,7 @@ public void testSwaps() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFuturesConvexityBias() { //BOOST_MESSAGE("Testing Hull-White futures convexity bias..."); diff --git a/tests/QLNet.Tests/T_Solvers.cs b/tests/QLNet.Tests/T_Solvers.cs index 65eb1025f..a87d78566 100644 --- a/tests/QLNet.Tests/T_Solvers.cs +++ b/tests/QLNet.Tests/T_Solvers.cs @@ -18,18 +18,12 @@ under the terms of the QLNet license. You should have received a */ using System; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_Solvers { class Foo : ISolver1d @@ -38,7 +32,7 @@ class Foo : ISolver1d public override double derivative(double x) { return 2.0 * x; } } - public void test(Solver1D solver, string name) + internal void test(Solver1D solver, string name) { double[] accuracy = new double[] { 1.0e-4, 1.0e-6, 1.0e-8 }; double expected = 1.0; @@ -63,69 +57,35 @@ public void test(Solver1D solver, string name) } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testBrent() { test(new Brent(), "Brent"); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testNewton() { test(new Newton(), "Newton"); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFalsePosition() { test(new FalsePosition(), "FalsePosition"); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testBisection() { test(new Bisection(), "Bisection"); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testRidder() { test(new Ridder(), "Ridder"); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSecant() { test(new Secant(), "Secant"); } - - public void suite() - { - testBrent(); - testNewton(); - testFalsePosition(); - testBisection(); - testRidder(); - testSecant(); - } } } diff --git a/tests/QLNet.Tests/T_SpreadOption.cs b/tests/QLNet.Tests/T_SpreadOption.cs index eb7c68ae9..9a3d0446e 100644 --- a/tests/QLNet.Tests/T_SpreadOption.cs +++ b/tests/QLNet.Tests/T_SpreadOption.cs @@ -14,18 +14,12 @@ // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS // FOR A PARTICULAR PURPOSE. See the license for more details. using System; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_SpreadOption { private void REPORT_FAILURE(string greekName, @@ -76,11 +70,7 @@ public Case(double f1, double f2, double x, double r, double sigma1, this.theta = theta; } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testKirkEngine() { // Testing Kirk approximation for spread options diff --git a/tests/QLNet.Tests/T_Stats.cs b/tests/QLNet.Tests/T_Stats.cs index fa11862f8..46c5918a5 100644 --- a/tests/QLNet.Tests/T_Stats.cs +++ b/tests/QLNet.Tests/T_Stats.cs @@ -19,40 +19,26 @@ under the terms of the QLNet license. You should have received a using System; using System.Collections.Generic; using System.Linq; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_Stats { double[] data = { 3.0, 4.0, 5.0, 2.0, 3.0, 4.0, 5.0, 6.0, 4.0, 7.0 }; double[] weights = { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 }; -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testStatistics() { check("IncrementalStatistics"); check("Statistics"); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSequenceStatistics() { //("Testing sequence statistics..."); @@ -61,11 +47,7 @@ public void testSequenceStatistics() checkSequence("Statistics", 5); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testConvergenceStatistics() { @@ -75,11 +57,7 @@ public void testConvergenceStatistics() checkConvergence("Statistics"); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testIncrementalStatistics() { // Testing incremental statistics @@ -132,7 +110,7 @@ public void testIncrementalStatistics() } - public void TEST_INC_STAT(double expr, double expected) + internal void TEST_INC_STAT(double expr, double expected) { if (!Utils.close_enough(expr, expected)) QAssert.Fail(" (" + expr + ") can not be reproduced against cached result (" + expected + ")"); diff --git a/tests/QLNet.Tests/T_Swaps.cs b/tests/QLNet.Tests/T_Swaps.cs index 3b764f2f7..f334c85db 100644 --- a/tests/QLNet.Tests/T_Swaps.cs +++ b/tests/QLNet.Tests/T_Swaps.cs @@ -19,39 +19,22 @@ under the terms of the QLNet license. You should have received a using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_Swaps : IDisposable { #region Initialize&Cleanup private SavedSettings backup; -#if NET452 - [TestInitialize] - public void testInitialize() - { -#else + public T_Swaps() { -#endif backup = new SavedSettings(); } -#if NET452 - [TestCleanup] -#endif - public void testCleanup() - { - Dispose(); - } + public void Dispose() { backup.Dispose(); @@ -108,11 +91,7 @@ public CommonVars() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFairRate() { // Testing vanilla-swap calculation of fair fixed rate @@ -140,11 +119,7 @@ public void testFairRate() } } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFairSpread() { // Testing vanilla-swap calculation of fair floating spread @@ -171,11 +146,7 @@ public void testFairSpread() } } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testRateDependency() { // Testing vanilla-swap dependency on fixed rate @@ -213,11 +184,7 @@ public void testRateDependency() } } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSpreadDependency() { // Testing vanilla-swap dependency on floating spread @@ -255,11 +222,7 @@ public void testSpreadDependency() } } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testInArrears() { // Testing in-arrears swap calculation @@ -317,11 +280,7 @@ public void testInArrears() + " expected: " + storedValue + "\n" + " calculated: " + swap.NPV()); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCachedValue() { // Testing vanilla-swap calculation against cached value @@ -344,11 +303,7 @@ public void testCachedValue() + " calculated: " + swap.NPV() + "\n" + " expected: " + cachedNPV); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testFixing() { Date tradeDate = new Date(17, Month.April, 2015); diff --git a/tests/QLNet.Tests/T_Swaption.cs b/tests/QLNet.Tests/T_Swaption.cs index ad2afb9dc..d37ee5d3b 100644 --- a/tests/QLNet.Tests/T_Swaption.cs +++ b/tests/QLNet.Tests/T_Swaption.cs @@ -19,39 +19,22 @@ under the terms of the QLNet license. You should have received a */ using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_Swaption : IDisposable { #region Initialize&Cleanup private SavedSettings backup; -#if NET452 - [TestInitialize] - public void testInitialize() - { -#else + public T_Swaption() { -#endif backup = new SavedSettings(); } -#if NET452 - [TestCleanup] -#endif - public void testCleanup() - { - Dispose(); - } + public void Dispose() { backup.Dispose(); @@ -134,11 +117,7 @@ public CommonVars() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testStrikeDependency() { // Testing swaption dependency on strike @@ -243,11 +222,7 @@ public void testStrikeDependency() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSpreadDependency() { // Testing swaption dependency on spread @@ -334,11 +309,7 @@ public void testSpreadDependency() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSpreadTreatment() { // Testing swaption treatment of spread @@ -408,11 +379,7 @@ public void testSpreadTreatment() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCachedValue() { // Testing swaption value against cached value @@ -445,11 +412,7 @@ public void testCachedValue() "\nexpected: " + cachedNPV); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testVega() { // Testing swaption vega @@ -524,11 +487,7 @@ public void testVega() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCashSettledSwaptions() { @@ -877,11 +836,7 @@ public void testCashSettledSwaptions() } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testImpliedVolatility() { // Testing implied volatility for swaptions diff --git a/tests/QLNet.Tests/T_SwaptionVolatilityCube.cs b/tests/QLNet.Tests/T_SwaptionVolatilityCube.cs index 8f0397dec..696b0a707 100644 --- a/tests/QLNet.Tests/T_SwaptionVolatilityCube.cs +++ b/tests/QLNet.Tests/T_SwaptionVolatilityCube.cs @@ -1,424 +1,398 @@ -// Copyright (C) 2008-2016 Andrea Maggiulli (a.maggiulli@gmail.com) -// -// This file is part of QLNet Project https://github.com/amaggiulli/qlnet -// QLNet is free software: you can redistribute it and/or modify it -// under the terms of the QLNet license. You should have received a -// copy of the license along with this program; if not, license is -// available at . -// -// QLNet is a based on QuantLib, a free-software/open-source library -// for financial quantitative analysts and developers - http://quantlib.org/ -// The QuantLib license is available online at http://quantlib.org/license.shtml. -// -// This program is distributed in the hope that it will be useful, but WITHOUT -// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS -// FOR A PARTICULAR PURPOSE. See the license for more details. -using System; -using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else -using Xunit; -#endif -using QLNet; - -namespace TestSuite -{ -#if NET452 - [TestClass()] -#endif - public class T_SwaptionVolatilityCube - { - public class CommonVars - { - // global data - public SwaptionMarketConventions conventions = new SwaptionMarketConventions(); - public AtmVolatility atm = new AtmVolatility(); - public RelinkableHandle atmVolMatrix; - public VolatilityCube cube = new VolatilityCube(); - public RelinkableHandle termStructure = new RelinkableHandle(); - public SwapIndex swapIndexBase, shortSwapIndexBase; - public bool vegaWeighedSmileFit; - - // cleanup - //public SavedSettings backup = new SavedSettings(); - - // utilities - public void makeAtmVolTest(SwaptionVolatilityCube volCube, double tolerance) - { - for (int i = 0; i < atm.tenors.options.Count; i++) - { - for (int j = 0; j < atm.tenors.swaps.Count; j++) - { - double strike = volCube.atmStrike(atm.tenors.options[i], atm.tenors.swaps[j]); - double expVol = atmVolMatrix.link.volatility(atm.tenors.options[i], atm.tenors.swaps[j], strike, true); - double actVol = volCube.volatility(atm.tenors.options[i], atm.tenors.swaps[j], strike, true); - double error = Math.Abs(expVol - actVol); - if (error > tolerance) - QAssert.Fail("recovery of atm vols failed:" + - "\nexpiry time = " + atm.tenors.options[i] + - "\nswap length = " + atm.tenors.swaps[j] + - "\n atm strike = " + strike + - "\n exp. vol = " + expVol + - "\n actual vol = " + actVol + - "\n error = " + error + - "\n tolerance = " + tolerance); - } - } - } - public void makeVolSpreadsTest(SwaptionVolatilityCube volCube, double tolerance) - { - for (int i = 0; i < cube.tenors.options.Count; i++) - { - for (int j = 0; j < cube.tenors.swaps.Count; j++) - { - for (int k = 0; k < cube.strikeSpreads.Count; k++) - { - double atmStrike = volCube.atmStrike(cube.tenors.options[i], cube.tenors.swaps[j]); - double atmVol = atmVolMatrix.link.volatility(cube.tenors.options[i], cube.tenors.swaps[j], - atmStrike, true); - double vol = volCube.volatility(cube.tenors.options[i], cube.tenors.swaps[j], - atmStrike + cube.strikeSpreads[k], true); - double spread = vol - atmVol; - double expVolSpread = cube.volSpreads[i * cube.tenors.swaps.Count + j, k]; - double error = Math.Abs(expVolSpread - spread); - if (error > tolerance) - QAssert.Fail("\nrecovery of smile vol spreads failed:" + - "\n option tenor = " + cube.tenors.options[i] + - "\n swap tenor = " + cube.tenors.swaps[j] + - "\n atm strike = " + atmStrike + - "\n strike spread = " + cube.strikeSpreads[k] + - "\n atm vol = " + atmVol + - "\n smiled vol = " + vol + - "\n vol spread = " + spread + - "\n exp. vol spread = " + expVolSpread + - "\n error = " + error + - "\n tolerance = " + tolerance); - } - } - } - } - - public CommonVars() - { - Settings.setEvaluationDate(new Date(16, Month.September, 2015)); - conventions.setConventions(); - - // ATM swaptionvolmatrix - atm.setMarketData(); - - atmVolMatrix = new RelinkableHandle( - new SwaptionVolatilityMatrix(conventions.calendar, conventions.optionBdc, atm.tenors.options, - atm.tenors.swaps, atm.volsHandle, conventions.dayCounter)); - // Swaptionvolcube - cube.setMarketData(); - - termStructure.linkTo(Utilities.flatRate(0.05, new Actual365Fixed())); - - swapIndexBase = new EuriborSwapIsdaFixA(new Period(2, TimeUnit.Years), termStructure); - shortSwapIndexBase = new EuriborSwapIsdaFixA(new Period(1, TimeUnit.Years), termStructure); - - vegaWeighedSmileFit = false; - } - } - -#if NET452 - [TestMethod()] -#else - [Fact] -#endif - public void testAtmVols() - { - // Testing swaption volatility cube (atm vols) - - CommonVars vars = new CommonVars(); - - SwaptionVolCube2 volCube = new SwaptionVolCube2(vars.atmVolMatrix, - vars.cube.tenors.options, - vars.cube.tenors.swaps, - vars.cube.strikeSpreads, - vars.cube.volSpreadsHandle, - vars.swapIndexBase, - vars.shortSwapIndexBase, - vars.vegaWeighedSmileFit); - - double tolerance = 1.0e-16; - vars.makeAtmVolTest(volCube, tolerance); - } - -#if NET452 - [TestMethod()] -#else - [Fact] -#endif - public void testSmile() - { - // Testing swaption volatility cube (smile) - CommonVars vars = new CommonVars(); - - SwaptionVolCube2 volCube = new SwaptionVolCube2(vars.atmVolMatrix, - vars.cube.tenors.options, - vars.cube.tenors.swaps, - vars.cube.strikeSpreads, - vars.cube.volSpreadsHandle, - vars.swapIndexBase, - vars.shortSwapIndexBase, - vars.vegaWeighedSmileFit); - - double tolerance = 1.0e-16; - vars.makeVolSpreadsTest(volCube, tolerance); - } - -#if NET452 - [TestMethod()] -#else - [Fact] -#endif - public void testSabrVols() - { - // Testing swaption volatility cube (sabr interpolation) - CommonVars vars = new CommonVars(); - - List > > parametersGuess = new InitializedList>>( - vars.cube.tenors.options.Count * vars.cube.tenors.swaps.Count); - for (int i = 0; i < vars.cube.tenors.options.Count * vars.cube.tenors.swaps.Count; i++) - { - parametersGuess[i] = new InitializedList >(4); - parametersGuess[i][0] = new Handle(new SimpleQuote(0.2)); - parametersGuess[i][1] = new Handle(new SimpleQuote(0.5)); - parametersGuess[i][2] = new Handle(new SimpleQuote(0.4)); - parametersGuess[i][3] = new Handle(new SimpleQuote(0.0)); - } - List isParameterFixed = new InitializedList(4, false); - - SwaptionVolCube1x volCube = new SwaptionVolCube1x - (vars.atmVolMatrix, vars.cube.tenors.options, vars.cube.tenors.swaps, vars.cube.strikeSpreads, - vars.cube.volSpreadsHandle, vars.swapIndexBase, vars.shortSwapIndexBase, vars.vegaWeighedSmileFit, - parametersGuess, isParameterFixed, true); - double tolerance = 3.0e-4; - vars.makeAtmVolTest(volCube, tolerance); - - tolerance = 12.0e-4; - vars.makeVolSpreadsTest(volCube, tolerance); - } - -#if NET452 - [TestMethod()] -#else - [Fact] -#endif - public void testSpreadedCube() - { - - // Testing spreaded swaption volatility cube - CommonVars vars = new CommonVars(); - - List > > parametersGuess = - new InitializedList>>(vars.cube.tenors.options.Count * vars.cube.tenors.swaps.Count); - for (int i = 0; i < vars.cube.tenors.options.Count * vars.cube.tenors.swaps.Count; i++) - { - parametersGuess[i] = new InitializedList>(4); - parametersGuess[i][0] = new Handle(new SimpleQuote(0.2)); - parametersGuess[i][1] = new Handle(new SimpleQuote(0.5)); - parametersGuess[i][2] = new Handle(new SimpleQuote(0.4)); - parametersGuess[i][3] = new Handle(new SimpleQuote(0.0)); - } - List isParameterFixed = new InitializedList(4, false); - - Handle volCube = new Handle( - new SwaptionVolCube1x(vars.atmVolMatrix, - vars.cube.tenors.options, - vars.cube.tenors.swaps, - vars.cube.strikeSpreads, - vars.cube.volSpreadsHandle, - vars.swapIndexBase, - vars.shortSwapIndexBase, - vars.vegaWeighedSmileFit, - parametersGuess, - isParameterFixed, - true)); - - SimpleQuote spread = new SimpleQuote(0.0001); - Handle spreadHandle = new Handle(spread); - SwaptionVolatilityStructure spreadedVolCube = new SpreadedSwaptionVolatility(volCube, spreadHandle); - List strikes = new List(); - for (int k = 1; k < 100; k++) - strikes.Add(k * .01); - for (int i = 0; i < vars.cube.tenors.options.Count; i++) - { - for (int j = 0; j < vars.cube.tenors.swaps.Count; j++) - { - SmileSection smileSectionByCube = volCube.link.smileSection(vars.cube.tenors.options[i], - vars.cube.tenors.swaps[j]); - SmileSection smileSectionBySpreadedCube = spreadedVolCube.smileSection(vars.cube.tenors.options[i], - vars.cube.tenors.swaps[j]); - for (int k = 0; k < strikes.Count; k++) - { - double strike = strikes[k]; - double diff = spreadedVolCube.volatility(vars.cube.tenors.options[i], vars.cube.tenors.swaps[j], strike) - - volCube.link.volatility(vars.cube.tenors.options[i], vars.cube.tenors.swaps[j], strike); - if (Math.Abs(diff - spread.value()) > 1e-16) - QAssert.Fail("\ndiff!=spread in volatility method:" + - "\nexpiry time = " + vars.cube.tenors.options[i] + - "\nswap length = " + vars.cube.tenors.swaps[j] + - "\n atm strike = " + (strike) + - "\ndiff = " + diff + - "\nspread = " + spread.value()); - - diff = smileSectionBySpreadedCube.volatility(strike) - smileSectionByCube.volatility(strike); - if (Math.Abs(diff - spread.value()) > 1e-16) - QAssert.Fail("\ndiff!=spread in smile section method:" + - "\nexpiry time = " + vars.cube.tenors.options[i] + - "\nswap length = " + vars.cube.tenors.swaps[j] + - "\n atm strike = " + (strike) + - "\ndiff = " + diff + - "\nspread = " + spread.value()); - } - } - } - - //testing observability - Flag f = new Flag(); - spreadedVolCube.registerWith(f.update); - volCube.link.update(); - if (!f.isUp()) - QAssert.Fail("SpreadedSwaptionVolatilityStructure does not propagate notifications"); - - f.lower(); - spread.setValue(.001); - if (!f.isUp()) - QAssert.Fail("SpreadedSwaptionVolatilityStructure does not propagate notifications"); - } - -#if NET452 - [TestMethod()] -#else - [Fact] -#endif - public void testObservability() - { - // Testing volatility cube observability - CommonVars vars = new CommonVars(); - - List > > parametersGuess = - new InitializedList>>(vars.cube.tenors.options.Count * vars.cube.tenors.swaps.Count); - for (int i = 0; i < vars.cube.tenors.options.Count * vars.cube.tenors.swaps.Count; i++) - { - parametersGuess[i] = new InitializedList>(4); - parametersGuess[i][0] = new Handle(new SimpleQuote(0.2)); - parametersGuess[i][1] = new Handle(new SimpleQuote(0.5)); - parametersGuess[i][2] = new Handle(new SimpleQuote(0.4)); - parametersGuess[i][3] = new Handle(new SimpleQuote(0.0)); - } - List isParameterFixed = new InitializedList(4, false); - - SwaptionVolCube1x volCube1_0, volCube1_1; - // VolCube created before change of reference date - volCube1_0 = new SwaptionVolCube1x(vars.atmVolMatrix, - vars.cube.tenors.options, - vars.cube.tenors.swaps, - vars.cube.strikeSpreads, - vars.cube.volSpreadsHandle, - vars.swapIndexBase, - vars.shortSwapIndexBase, - vars.vegaWeighedSmileFit, - parametersGuess, - isParameterFixed, - true); - - Date referenceDate = Settings.evaluationDate(); - Settings.setEvaluationDate(vars.conventions.calendar.advance(referenceDate, new Period(1, TimeUnit.Days), - vars.conventions.optionBdc)); - - // VolCube created after change of reference date - volCube1_1 = new SwaptionVolCube1x(vars.atmVolMatrix, - vars.cube.tenors.options, - vars.cube.tenors.swaps, - vars.cube.strikeSpreads, - vars.cube.volSpreadsHandle, - vars.swapIndexBase, - vars.shortSwapIndexBase, - vars.vegaWeighedSmileFit, - parametersGuess, - isParameterFixed, - true); - double dummyStrike = 0.03; - for (int i = 0; i < vars.cube.tenors.options.Count; i++) - { - for (int j = 0; j < vars.cube.tenors.swaps.Count; j++) - { - for (int k = 0; k < vars.cube.strikeSpreads.Count; k++) - { - double v0 = volCube1_0.volatility(vars.cube.tenors.options[i], - vars.cube.tenors.swaps[j], - dummyStrike + vars.cube.strikeSpreads[k], - false); - double v1 = volCube1_1.volatility(vars.cube.tenors.options[i], - vars.cube.tenors.swaps[j], - dummyStrike + vars.cube.strikeSpreads[k], - false); - if (Math.Abs(v0 - v1) > 1e-14) - QAssert.Fail(" option tenor = " + vars.cube.tenors.options[i] + - " swap tenor = " + vars.cube.tenors.swaps[j] + - " strike = " + (dummyStrike + vars.cube.strikeSpreads[k]) + - " v0 = " + (v0) + - " v1 = " + (v1) + - " error = " + Math.Abs(v1 - v0)); - } - } - } - - Settings.setEvaluationDate(referenceDate); - - SwaptionVolCube2 volCube2_0, volCube2_1; - // VolCube created before change of reference date - volCube2_0 = new SwaptionVolCube2(vars.atmVolMatrix, - vars.cube.tenors.options, - vars.cube.tenors.swaps, - vars.cube.strikeSpreads, - vars.cube.volSpreadsHandle, - vars.swapIndexBase, - vars.shortSwapIndexBase, - vars.vegaWeighedSmileFit); - Settings.setEvaluationDate(vars.conventions.calendar.advance(referenceDate, new Period(1, TimeUnit.Days), - vars.conventions.optionBdc)); - - // VolCube created after change of reference date - volCube2_1 = new SwaptionVolCube2(vars.atmVolMatrix, - vars.cube.tenors.options, - vars.cube.tenors.swaps, - vars.cube.strikeSpreads, - vars.cube.volSpreadsHandle, - vars.swapIndexBase, - vars.shortSwapIndexBase, - vars.vegaWeighedSmileFit); - - for (int i = 0; i < vars.cube.tenors.options.Count; i++) - { - for (int j = 0; j < vars.cube.tenors.swaps.Count; j++) - { - for (int k = 0; k < vars.cube.strikeSpreads.Count; k++) - { - double v0 = volCube2_0.volatility(vars.cube.tenors.options[i], - vars.cube.tenors.swaps[j], - dummyStrike + vars.cube.strikeSpreads[k], - false); - double v1 = volCube2_1.volatility(vars.cube.tenors.options[i], - vars.cube.tenors.swaps[j], - dummyStrike + vars.cube.strikeSpreads[k], - false); - if (Math.Abs(v0 - v1) > 1e-14) - QAssert.Fail(" option tenor = " + vars.cube.tenors.options[i] + - " swap tenor = " + vars.cube.tenors.swaps[j] + - " strike = " + (dummyStrike + vars.cube.strikeSpreads[k]) + - " v0 = " + (v0) + - " v1 = " + (v1) + - " error = " + Math.Abs(v1 - v0)); - } - } - } - - Settings.setEvaluationDate(referenceDate); - } - } -} +//// Copyright (C) 2008-2016 Andrea Maggiulli (a.maggiulli@gmail.com) +//// +//// This file is part of QLNet Project https://github.com/amaggiulli/qlnet +//// QLNet is free software: you can redistribute it and/or modify it +//// under the terms of the QLNet license. You should have received a +//// copy of the license along with this program; if not, license is +//// available at . +//// +//// QLNet is a based on QuantLib, a free-software/open-source library +//// for financial quantitative analysts and developers - http://quantlib.org/ +//// The QuantLib license is available online at http://quantlib.org/license.shtml. +//// +//// This program is distributed in the hope that it will be useful, but WITHOUT +//// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS +//// FOR A PARTICULAR PURPOSE. See the license for more details. +//using System; +//using System.Collections.Generic; +//using Xunit; +//using QLNet; + +//namespace TestSuite +//{ + +// public class T_SwaptionVolatilityCube +// { +// public class CommonVars +// { +// // global data +// public SwaptionMarketConventions conventions = new SwaptionMarketConventions(); +// public AtmVolatility atm = new AtmVolatility(); +// public RelinkableHandle atmVolMatrix; +// public VolatilityCube cube = new VolatilityCube(); +// public RelinkableHandle termStructure = new RelinkableHandle(); +// public SwapIndex swapIndexBase, shortSwapIndexBase; +// public bool vegaWeighedSmileFit; + +// // cleanup +// //public SavedSettings backup = new SavedSettings(); + +// // utilities +// public void makeAtmVolTest(SwaptionVolatilityCube volCube, double tolerance) +// { +// for (int i = 0; i < atm.tenors.options.Count; i++) +// { +// for (int j = 0; j < atm.tenors.swaps.Count; j++) +// { +// double strike = volCube.atmStrike(atm.tenors.options[i], atm.tenors.swaps[j]); +// double expVol = atmVolMatrix.link.volatility(atm.tenors.options[i], atm.tenors.swaps[j], strike, true); +// double actVol = volCube.volatility(atm.tenors.options[i], atm.tenors.swaps[j], strike, true); +// double error = Math.Abs(expVol - actVol); +// if (error > tolerance) +// QAssert.Fail("recovery of atm vols failed:" + +// "\nexpiry time = " + atm.tenors.options[i] + +// "\nswap length = " + atm.tenors.swaps[j] + +// "\n atm strike = " + strike + +// "\n exp. vol = " + expVol + +// "\n actual vol = " + actVol + +// "\n error = " + error + +// "\n tolerance = " + tolerance); +// } +// } +// } +// public void makeVolSpreadsTest(SwaptionVolatilityCube volCube, double tolerance) +// { +// for (int i = 0; i < cube.tenors.options.Count; i++) +// { +// for (int j = 0; j < cube.tenors.swaps.Count; j++) +// { +// for (int k = 0; k < cube.strikeSpreads.Count; k++) +// { +// double atmStrike = volCube.atmStrike(cube.tenors.options[i], cube.tenors.swaps[j]); +// double atmVol = atmVolMatrix.link.volatility(cube.tenors.options[i], cube.tenors.swaps[j], +// atmStrike, true); +// double vol = volCube.volatility(cube.tenors.options[i], cube.tenors.swaps[j], +// atmStrike + cube.strikeSpreads[k], true); +// double spread = vol - atmVol; +// double expVolSpread = cube.volSpreads[i * cube.tenors.swaps.Count + j, k]; +// double error = Math.Abs(expVolSpread - spread); +// if (error > tolerance) +// QAssert.Fail("\nrecovery of smile vol spreads failed:" + +// "\n option tenor = " + cube.tenors.options[i] + +// "\n swap tenor = " + cube.tenors.swaps[j] + +// "\n atm strike = " + atmStrike + +// "\n strike spread = " + cube.strikeSpreads[k] + +// "\n atm vol = " + atmVol + +// "\n smiled vol = " + vol + +// "\n vol spread = " + spread + +// "\n exp. vol spread = " + expVolSpread + +// "\n error = " + error + +// "\n tolerance = " + tolerance); +// } +// } +// } +// } + +// public CommonVars() +// { +// Settings.setEvaluationDate(new Date(16, Month.September, 2015)); +// conventions.setConventions(); + +// // ATM swaptionvolmatrix +// atm.setMarketData(); + +// atmVolMatrix = new RelinkableHandle( +// new SwaptionVolatilityMatrix(conventions.calendar, conventions.optionBdc, atm.tenors.options, +// atm.tenors.swaps, atm.volsHandle, conventions.dayCounter)); +// // Swaptionvolcube +// cube.setMarketData(); + +// termStructure.linkTo(Utilities.flatRate(0.05, new Actual365Fixed())); + +// swapIndexBase = new EuriborSwapIsdaFixA(new Period(2, TimeUnit.Years), termStructure); +// shortSwapIndexBase = new EuriborSwapIsdaFixA(new Period(1, TimeUnit.Years), termStructure); + +// vegaWeighedSmileFit = false; +// } +// } + +// [Fact] +// public void testAtmVols() +// { +// // Testing swaption volatility cube (atm vols) + +// CommonVars vars = new CommonVars(); + +// SwaptionVolCube2 volCube = new SwaptionVolCube2(vars.atmVolMatrix, +// vars.cube.tenors.options, +// vars.cube.tenors.swaps, +// vars.cube.strikeSpreads, +// vars.cube.volSpreadsHandle, +// vars.swapIndexBase, +// vars.shortSwapIndexBase, +// vars.vegaWeighedSmileFit); + +// double tolerance = 1.0e-16; +// vars.makeAtmVolTest(volCube, tolerance); +// } + +// [Fact] +// public void testSmile() +// { +// // Testing swaption volatility cube (smile) +// CommonVars vars = new CommonVars(); + +// SwaptionVolCube2 volCube = new SwaptionVolCube2(vars.atmVolMatrix, +// vars.cube.tenors.options, +// vars.cube.tenors.swaps, +// vars.cube.strikeSpreads, +// vars.cube.volSpreadsHandle, +// vars.swapIndexBase, +// vars.shortSwapIndexBase, +// vars.vegaWeighedSmileFit); + +// double tolerance = 1.0e-16; +// vars.makeVolSpreadsTest(volCube, tolerance); +// } + +// [Fact] +// public void testSabrVols() +// { +// // Testing swaption volatility cube (sabr interpolation) +// CommonVars vars = new CommonVars(); + +// List > > parametersGuess = new InitializedList>>( +// vars.cube.tenors.options.Count * vars.cube.tenors.swaps.Count); +// for (int i = 0; i < vars.cube.tenors.options.Count * vars.cube.tenors.swaps.Count; i++) +// { +// parametersGuess[i] = new InitializedList >(4); +// parametersGuess[i][0] = new Handle(new SimpleQuote(0.2)); +// parametersGuess[i][1] = new Handle(new SimpleQuote(0.5)); +// parametersGuess[i][2] = new Handle(new SimpleQuote(0.4)); +// parametersGuess[i][3] = new Handle(new SimpleQuote(0.0)); +// } +// List isParameterFixed = new InitializedList(4, false); + +// SwaptionVolCube1x volCube = new SwaptionVolCube1x +// (vars.atmVolMatrix, vars.cube.tenors.options, vars.cube.tenors.swaps, vars.cube.strikeSpreads, +// vars.cube.volSpreadsHandle, vars.swapIndexBase, vars.shortSwapIndexBase, vars.vegaWeighedSmileFit, +// parametersGuess, isParameterFixed, true); +// double tolerance = 3.0e-4; +// vars.makeAtmVolTest(volCube, tolerance); + +// tolerance = 12.0e-4; +// vars.makeVolSpreadsTest(volCube, tolerance); +// } + +// [Fact] +// public void testSpreadedCube() +// { + +// // Testing spreaded swaption volatility cube +// CommonVars vars = new CommonVars(); + +// List > > parametersGuess = +// new InitializedList>>(vars.cube.tenors.options.Count * vars.cube.tenors.swaps.Count); +// for (int i = 0; i < vars.cube.tenors.options.Count * vars.cube.tenors.swaps.Count; i++) +// { +// parametersGuess[i] = new InitializedList>(4); +// parametersGuess[i][0] = new Handle(new SimpleQuote(0.2)); +// parametersGuess[i][1] = new Handle(new SimpleQuote(0.5)); +// parametersGuess[i][2] = new Handle(new SimpleQuote(0.4)); +// parametersGuess[i][3] = new Handle(new SimpleQuote(0.0)); +// } +// List isParameterFixed = new InitializedList(4, false); + +// Handle volCube = new Handle( +// new SwaptionVolCube1x(vars.atmVolMatrix, +// vars.cube.tenors.options, +// vars.cube.tenors.swaps, +// vars.cube.strikeSpreads, +// vars.cube.volSpreadsHandle, +// vars.swapIndexBase, +// vars.shortSwapIndexBase, +// vars.vegaWeighedSmileFit, +// parametersGuess, +// isParameterFixed, +// true)); + +// SimpleQuote spread = new SimpleQuote(0.0001); +// Handle spreadHandle = new Handle(spread); +// SwaptionVolatilityStructure spreadedVolCube = new SpreadedSwaptionVolatility(volCube, spreadHandle); +// List strikes = new List(); +// for (int k = 1; k < 100; k++) +// strikes.Add(k * .01); +// for (int i = 0; i < vars.cube.tenors.options.Count; i++) +// { +// for (int j = 0; j < vars.cube.tenors.swaps.Count; j++) +// { +// SmileSection smileSectionByCube = volCube.link.smileSection(vars.cube.tenors.options[i], +// vars.cube.tenors.swaps[j]); +// SmileSection smileSectionBySpreadedCube = spreadedVolCube.smileSection(vars.cube.tenors.options[i], +// vars.cube.tenors.swaps[j]); +// for (int k = 0; k < strikes.Count; k++) +// { +// double strike = strikes[k]; +// double diff = spreadedVolCube.volatility(vars.cube.tenors.options[i], vars.cube.tenors.swaps[j], strike) +// - volCube.link.volatility(vars.cube.tenors.options[i], vars.cube.tenors.swaps[j], strike); +// if (Math.Abs(diff - spread.value()) > 1e-16) +// QAssert.Fail("\ndiff!=spread in volatility method:" + +// "\nexpiry time = " + vars.cube.tenors.options[i] + +// "\nswap length = " + vars.cube.tenors.swaps[j] + +// "\n atm strike = " + (strike) + +// "\ndiff = " + diff + +// "\nspread = " + spread.value()); + +// diff = smileSectionBySpreadedCube.volatility(strike) - smileSectionByCube.volatility(strike); +// if (Math.Abs(diff - spread.value()) > 1e-16) +// QAssert.Fail("\ndiff!=spread in smile section method:" + +// "\nexpiry time = " + vars.cube.tenors.options[i] + +// "\nswap length = " + vars.cube.tenors.swaps[j] + +// "\n atm strike = " + (strike) + +// "\ndiff = " + diff + +// "\nspread = " + spread.value()); +// } +// } +// } + +// //testing observability +// Flag f = new Flag(); +// spreadedVolCube.registerWith(f.update); +// volCube.link.update(); +// if (!f.isUp()) +// QAssert.Fail("SpreadedSwaptionVolatilityStructure does not propagate notifications"); + +// f.lower(); +// spread.setValue(.001); +// if (!f.isUp()) +// QAssert.Fail("SpreadedSwaptionVolatilityStructure does not propagate notifications"); +// } + +// [Fact] +// public void testObservability() +// { +// // Testing volatility cube observability +// CommonVars vars = new CommonVars(); + +// List > > parametersGuess = +// new InitializedList>>(vars.cube.tenors.options.Count * vars.cube.tenors.swaps.Count); +// for (int i = 0; i < vars.cube.tenors.options.Count * vars.cube.tenors.swaps.Count; i++) +// { +// parametersGuess[i] = new InitializedList>(4); +// parametersGuess[i][0] = new Handle(new SimpleQuote(0.2)); +// parametersGuess[i][1] = new Handle(new SimpleQuote(0.5)); +// parametersGuess[i][2] = new Handle(new SimpleQuote(0.4)); +// parametersGuess[i][3] = new Handle(new SimpleQuote(0.0)); +// } +// List isParameterFixed = new InitializedList(4, false); + +// SwaptionVolCube1x volCube1_0, volCube1_1; +// // VolCube created before change of reference date +// volCube1_0 = new SwaptionVolCube1x(vars.atmVolMatrix, +// vars.cube.tenors.options, +// vars.cube.tenors.swaps, +// vars.cube.strikeSpreads, +// vars.cube.volSpreadsHandle, +// vars.swapIndexBase, +// vars.shortSwapIndexBase, +// vars.vegaWeighedSmileFit, +// parametersGuess, +// isParameterFixed, +// true); + +// Date referenceDate = Settings.evaluationDate(); +// Settings.setEvaluationDate(vars.conventions.calendar.advance(referenceDate, new Period(1, TimeUnit.Days), +// vars.conventions.optionBdc)); + +// // VolCube created after change of reference date +// volCube1_1 = new SwaptionVolCube1x(vars.atmVolMatrix, +// vars.cube.tenors.options, +// vars.cube.tenors.swaps, +// vars.cube.strikeSpreads, +// vars.cube.volSpreadsHandle, +// vars.swapIndexBase, +// vars.shortSwapIndexBase, +// vars.vegaWeighedSmileFit, +// parametersGuess, +// isParameterFixed, +// true); +// double dummyStrike = 0.03; +// for (int i = 0; i < vars.cube.tenors.options.Count; i++) +// { +// for (int j = 0; j < vars.cube.tenors.swaps.Count; j++) +// { +// for (int k = 0; k < vars.cube.strikeSpreads.Count; k++) +// { +// double v0 = volCube1_0.volatility(vars.cube.tenors.options[i], +// vars.cube.tenors.swaps[j], +// dummyStrike + vars.cube.strikeSpreads[k], +// false); +// double v1 = volCube1_1.volatility(vars.cube.tenors.options[i], +// vars.cube.tenors.swaps[j], +// dummyStrike + vars.cube.strikeSpreads[k], +// false); +// if (Math.Abs(v0 - v1) > 1e-14) +// QAssert.Fail(" option tenor = " + vars.cube.tenors.options[i] + +// " swap tenor = " + vars.cube.tenors.swaps[j] + +// " strike = " + (dummyStrike + vars.cube.strikeSpreads[k]) + +// " v0 = " + (v0) + +// " v1 = " + (v1) + +// " error = " + Math.Abs(v1 - v0)); +// } +// } +// } + +// Settings.setEvaluationDate(referenceDate); + +// SwaptionVolCube2 volCube2_0, volCube2_1; +// // VolCube created before change of reference date +// volCube2_0 = new SwaptionVolCube2(vars.atmVolMatrix, +// vars.cube.tenors.options, +// vars.cube.tenors.swaps, +// vars.cube.strikeSpreads, +// vars.cube.volSpreadsHandle, +// vars.swapIndexBase, +// vars.shortSwapIndexBase, +// vars.vegaWeighedSmileFit); +// Settings.setEvaluationDate(vars.conventions.calendar.advance(referenceDate, new Period(1, TimeUnit.Days), +// vars.conventions.optionBdc)); + +// // VolCube created after change of reference date +// volCube2_1 = new SwaptionVolCube2(vars.atmVolMatrix, +// vars.cube.tenors.options, +// vars.cube.tenors.swaps, +// vars.cube.strikeSpreads, +// vars.cube.volSpreadsHandle, +// vars.swapIndexBase, +// vars.shortSwapIndexBase, +// vars.vegaWeighedSmileFit); + +// for (int i = 0; i < vars.cube.tenors.options.Count; i++) +// { +// for (int j = 0; j < vars.cube.tenors.swaps.Count; j++) +// { +// for (int k = 0; k < vars.cube.strikeSpreads.Count; k++) +// { +// double v0 = volCube2_0.volatility(vars.cube.tenors.options[i], +// vars.cube.tenors.swaps[j], +// dummyStrike + vars.cube.strikeSpreads[k], +// false); +// double v1 = volCube2_1.volatility(vars.cube.tenors.options[i], +// vars.cube.tenors.swaps[j], +// dummyStrike + vars.cube.strikeSpreads[k], +// false); +// if (Math.Abs(v0 - v1) > 1e-14) +// QAssert.Fail(" option tenor = " + vars.cube.tenors.options[i] + +// " swap tenor = " + vars.cube.tenors.swaps[j] + +// " strike = " + (dummyStrike + vars.cube.strikeSpreads[k]) + +// " v0 = " + (v0) + +// " v1 = " + (v1) + +// " error = " + Math.Abs(v1 - v0)); +// } +// } +// } + +// Settings.setEvaluationDate(referenceDate); +// } +// } +//} diff --git a/tests/QLNet.Tests/T_SwaptionVolatilitymatrix.cs b/tests/QLNet.Tests/T_SwaptionVolatilitymatrix.cs index 8dc770d2d..7f641c5f6 100644 --- a/tests/QLNet.Tests/T_SwaptionVolatilitymatrix.cs +++ b/tests/QLNet.Tests/T_SwaptionVolatilitymatrix.cs @@ -20,39 +20,22 @@ under the terms of the QLNet license. You should have received a using System; using System.Collections.Generic; using System.Linq; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_SwaptionVolatilityMatrix : IDisposable { #region Initialize&Cleanup private SavedSettings backup; -#if NET452 - [TestInitialize] - public void testInitialize() - { -#else + public T_SwaptionVolatilityMatrix() { -#endif backup = new SavedSettings(); } -#if NET452 - [TestCleanup] -#endif - public void testCleanup() - { - Dispose(); - } + public void Dispose() { backup.Dispose(); @@ -339,11 +322,7 @@ public void makeCoherenceTest(string description, } } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSwaptionVolMatrixCoherence() { // Testing swaption volatility matrix @@ -399,11 +378,7 @@ public void testSwaptionVolMatrixCoherence() vars.makeCoherenceTest(description, vol); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testSwaptionVolMatrixObservability() { // Testing swaption volatility matrix observability diff --git a/tests/QLNet.Tests/T_TermStructures.cs b/tests/QLNet.Tests/T_TermStructures.cs index a5a4d6827..e1c27004e 100644 --- a/tests/QLNet.Tests/T_TermStructures.cs +++ b/tests/QLNet.Tests/T_TermStructures.cs @@ -20,23 +20,12 @@ under the terms of the QLNet license. You should have received a using System; using System.Collections.Generic; - -#if NET452 - -using Microsoft.VisualStudio.TestTools.UnitTesting; - -#else using Xunit; -#endif - using QLNet; namespace TestSuite { -#if NET452 - - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_TermStructures : IDisposable { private double sub(double x, double y) @@ -45,27 +34,12 @@ private double sub(double x, double y) #region Initialize&Cleanup private SavedSettings backup; -#if NET452 - [TestInitialize] - public void testInitialize() - { -#else public T_TermStructures() { -#endif backup = new SavedSettings(); } -#if NET452 - - [TestCleanup] -#endif - public void testCleanup() - { - Dispose(); - } - public void Dispose() { backup.Dispose(); @@ -142,12 +116,7 @@ public CommonVars() } } -#if NET452 - - [TestMethod()] -#else [Fact] -#endif public void testReferenceChange() { // Testing term structure against evaluation date change @@ -179,12 +148,7 @@ public void testReferenceChange() } } -#if NET452 - - [TestMethod()] -#else [Fact] -#endif public void testImplied() { // Testing consistency of implied term structure @@ -205,12 +169,7 @@ public void testImplied() + " expected: " + discount); } -#if NET452 - - [TestMethod()] -#else [Fact] -#endif public void testImpliedObs() { // Testing observability of implied term structure @@ -228,12 +187,7 @@ public void testImpliedObs() QAssert.Fail("Observer was not notified of term structure change"); } -#if NET452 - - [TestMethod()] -#else [Fact] -#endif public void testFSpreaded() { // Testing consistency of forward-spreaded term structure @@ -257,12 +211,7 @@ public void testFSpreaded() + " expected: " + forward); } -#if NET452 - - [TestMethod()] -#else [Fact] -#endif public void testFSpreadedObs() { // Testing observability of forward-spreaded term structure @@ -283,12 +232,7 @@ public void testFSpreadedObs() QAssert.Fail("Observer was not notified of spread change"); } -#if NET452 - - [TestMethod()] -#else [Fact] -#endif public void testZSpreaded() { // Testing consistency of zero-spreaded term structure @@ -308,12 +252,7 @@ public void testZSpreaded() + " expected: " + zero); } -#if NET452 - - [TestMethod()] -#else [Fact] -#endif public void testZSpreadedObs() { // Testing observability of zero-spreaded term structure @@ -335,12 +274,7 @@ public void testZSpreadedObs() QAssert.Fail("Observer was not notified of spread change"); } -#if NET452 - - [TestMethod()] -#else [Fact] -#endif public void testCompositeZeroYieldStructures() { // Testing composite zero yield structures... @@ -468,12 +402,7 @@ public void testCompositeZeroYieldStructures() } } -#if NET452 - - [TestMethod()] -#else [Fact] -#endif public void testInterpolatedZeroCurveWithRefDateAndTenorDates() { CommonVars vars = new CommonVars(); diff --git a/tests/QLNet.Tests/T_TimeGrid.cs b/tests/QLNet.Tests/T_TimeGrid.cs index eaf5259bc..1fea2edd5 100644 --- a/tests/QLNet.Tests/T_TimeGrid.cs +++ b/tests/QLNet.Tests/T_TimeGrid.cs @@ -16,26 +16,16 @@ using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; using System.Diagnostics; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_TimeGrid { -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testConstructorAdditionalSteps() { // Testing TimeGrid construction with additional steps @@ -59,11 +49,7 @@ public void testConstructorAdditionalSteps() QAssert.CollectionAreEqual(tg.Times(), expected_times); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testConstructorMandatorySteps() { // Testing TimeGrid construction with only mandatory points @@ -75,11 +61,7 @@ public void testConstructorMandatorySteps() QAssert.CollectionAreEqual(tg.Times(), test_times); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testConstructorEvenSteps() { // Testing TimeGrid construction with n evenly spaced points @@ -100,11 +82,7 @@ public void testConstructorEvenSteps() QAssert.CollectionAreEqual(tg.Times(), expected_times); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testConstructorEmptyIterator() { // Testing that the TimeGrid constructor raises an error for empty iterators @@ -114,11 +92,7 @@ public void testConstructorEmptyIterator() QAssert.ThrowsException(() => new TimeGrid(times)); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testConstructorNegativeValuesInIterator() { // Testing that the TimeGrid constructor raises an error for negative time values @@ -126,11 +100,7 @@ public void testConstructorNegativeValuesInIterator() QAssert.ThrowsException(() => new TimeGrid(times)); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testClosestIndex() { // Testing that the returned index is closest to the requested time @@ -143,11 +113,7 @@ public void testClosestIndex() "the returned index: " + tg.closestIndex(4)); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testClosestTime() { // Testing that the returned time matches the requested index @@ -160,11 +126,7 @@ public void testClosestTime() "the returned time: " + tg.closestTime(4)); } -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testMandatoryTimes() { // Testing that mandatory times are recalled correctly diff --git a/tests/QLNet.Tests/T_Vector.cs b/tests/QLNet.Tests/T_Vector.cs index 2fb287c5b..b6e20080d 100644 --- a/tests/QLNet.Tests/T_Vector.cs +++ b/tests/QLNet.Tests/T_Vector.cs @@ -15,18 +15,12 @@ // FOR A PARTICULAR PURPOSE. See the license for more details. using System; using System.Collections.Generic; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite { -#if NET452 - [TestClass()] -#endif + [Collection("QLNet CI Tests")] public class T_Vector { /// @@ -37,11 +31,7 @@ public class T_Vector /// /// Test vector clone /// -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testClone() { Vector vector = new Vector(Data); @@ -58,11 +48,7 @@ public void testClone() /// /// Test clone a vector using IClonable interface method. /// -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testCloneICloneable() { Vector vector = new Vector(Data); @@ -78,11 +64,7 @@ public void testCloneICloneable() /// /// Test vectors equality. /// -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testEquals() { Vector vector1 = new Vector(Data); @@ -98,11 +80,7 @@ public void testEquals() /// /// Test Vector hash code. /// -#if NET452 - [TestMethod()] -#else [Fact] -#endif public void testHashCode() { Vector vector = new Vector(Data); diff --git a/tests/QLNet.Tests/Utilities.cs b/tests/QLNet.Tests/Utilities.cs index da4dd80e3..58c1ce61c 100644 --- a/tests/QLNet.Tests/Utilities.cs +++ b/tests/QLNet.Tests/Utilities.cs @@ -22,11 +22,7 @@ under the terms of the QLNet license. You should have received a using System.Collections; using System.Collections.Generic; using System.Linq; -#if NET452 -using Microsoft.VisualStudio.TestTools.UnitTesting; -#else using Xunit; -#endif using QLNet; namespace TestSuite @@ -174,120 +170,66 @@ public static partial class QAssert { public static void CollectionAreEqual(ICollection expected, ICollection actual) { -#if NET452 - CollectionAssert.AreEqual(expected, actual); -#else Assert.Equal(expected, actual); -#endif } public static void CollectionAreNotEqual(ICollection notExpected, ICollection actual) { -#if NET452 - CollectionAssert.AreNotEqual(notExpected, actual); -#else Assert.NotEqual(notExpected, actual); -#endif } public static void AreNotSame(object notExpected, object actual) { -#if NET452 - Assert.AreNotSame(notExpected, actual); -#else Assert.NotSame(notExpected, actual); -#endif } public static void Fail(string message) { -#if NET452 - Assert.Fail(message); -#else Assert.True(false, message); -#endif } public static void AreEqual(double expected, double actual, double delta) { -#if NET452 - Assert.AreEqual(expected, actual, delta); -#else Assert.True(Math.Abs(expected - actual) <= delta); -#endif } public static void AreEqual(double expected, double actual, double delta, string message) { -#if NET452 - Assert.AreEqual(expected, actual, delta, message); -#else Assert.True(Math.Abs(expected - actual) <= delta, message); -#endif } public static void AreEqual(T expected, T actual) { - -#if NET452 - Assert.AreEqual(expected, actual); -#else Assert.Equal(expected, actual); -#endif } public static void AreEqual(T expected, T actual, string message) { -#if NET452 - Assert.AreEqual(expected, actual, message); -#else Assert.Equal(expected, actual); -#endif } public static void AreNotEqual(T expected, T actual) { - -#if NET452 - Assert.AreNotEqual(expected, actual); -#else Assert.NotEqual(expected, actual); -#endif } public static void IsTrue(bool condition) { -#if NET452 - Assert.IsTrue(condition); -#else Assert.True(condition); -#endif } public static void IsTrue(bool condition, string message) { -#if NET452 - Assert.IsTrue(condition, message); -#else Assert.True(condition, message); -#endif } public static void IsFalse(bool condition) { -#if NET452 - Assert.IsFalse(condition); -#else Assert.False(condition); -#endif } public static void IsFalse(bool condition, string message) { -#if NET452 - Assert.IsFalse(condition, message); -#else Assert.False(condition, message); -#endif } /// @@ -296,11 +238,7 @@ public static void IsFalse(bool condition, string message) /// The object to be validated public static void Require(object obj) { -#if NET452 - Assert.IsNotNull(obj); -#else Assert.NotNull(obj); -#endif } /// @@ -310,11 +248,7 @@ public static void Require(object obj) /// The Action public static void ThrowsException(Action action) where T: SystemException { -#if NET452 - Assert.ThrowsException(action); -#else Xunit.Assert.Throws(action); -#endif } } diff --git a/tests/QLNet.Tests/xunit.runner.json b/tests/QLNet.Tests/xunit.runner.json new file mode 100644 index 000000000..474f572e2 --- /dev/null +++ b/tests/QLNet.Tests/xunit.runner.json @@ -0,0 +1,6 @@ +{ + "diagnosticMessages": true, + "methodDisplay": "classAndMethod", + "parallelizeTestCollections": false, + "longRunningTestSeconds": 5 +}