From 8e1f36055618a4f9e598dfd8c9104c5378ec2f7a Mon Sep 17 00:00:00 2001 From: "jongbong.an" Date: Tue, 8 Oct 2024 09:23:02 +0900 Subject: [PATCH] added a kofr index --- QuantLib.vcxproj | 2 ++ QuantLib.vcxproj.filters | 6 +++++ ql/CMakeLists.txt | 2 ++ ql/indexes/ibor/Makefile.am | 2 ++ ql/indexes/ibor/all.hpp | 1 + ql/indexes/ibor/kofr.cpp | 31 ++++++++++++++++++++++++++ ql/indexes/ibor/kofr.hpp | 44 +++++++++++++++++++++++++++++++++++++ 7 files changed, 88 insertions(+) create mode 100644 ql/indexes/ibor/kofr.cpp create mode 100644 ql/indexes/ibor/kofr.hpp diff --git a/QuantLib.vcxproj b/QuantLib.vcxproj index c9e69684b9d..bc1236a45e9 100644 --- a/QuantLib.vcxproj +++ b/QuantLib.vcxproj @@ -848,6 +848,7 @@ + @@ -2137,6 +2138,7 @@ + diff --git a/QuantLib.vcxproj.filters b/QuantLib.vcxproj.filters index 001b00b67ee..de8e32fb43a 100644 --- a/QuantLib.vcxproj.filters +++ b/QuantLib.vcxproj.filters @@ -669,6 +669,9 @@ indexes\ibor + + indexes\ibor + indexes\ibor @@ -4613,6 +4616,9 @@ indexes\ibor + + indexes\ibor + indexes\ibor diff --git a/ql/CMakeLists.txt b/ql/CMakeLists.txt index ca7950156d0..1d8dc103927 100644 --- a/ql/CMakeLists.txt +++ b/ql/CMakeLists.txt @@ -235,6 +235,7 @@ set(QL_SOURCES indexes/ibor/euribor.cpp indexes/ibor/eurlibor.cpp indexes/ibor/fedfunds.cpp + indexes/ibor/kofr.cpp indexes/ibor/libor.cpp indexes/ibor/shibor.cpp indexes/ibor/sofr.cpp @@ -1261,6 +1262,7 @@ set(QL_HEADERS indexes/ibor/gbplibor.hpp indexes/ibor/jibar.hpp indexes/ibor/jpylibor.hpp + indexes/ibor/kofr.hpp indexes/ibor/libor.hpp indexes/ibor/mosprime.hpp indexes/ibor/nzdlibor.hpp diff --git a/ql/indexes/ibor/Makefile.am b/ql/indexes/ibor/Makefile.am index cc7721a4c0c..f0e17bf957a 100644 --- a/ql/indexes/ibor/Makefile.am +++ b/ql/indexes/ibor/Makefile.am @@ -23,6 +23,7 @@ this_include_HEADERS = \ gbplibor.hpp \ jibar.hpp \ jpylibor.hpp \ + kofr.hpp \ libor.hpp \ mosprime.hpp \ nzdlibor.hpp \ @@ -50,6 +51,7 @@ cpp_files = \ euribor.cpp \ eurlibor.cpp \ fedfunds.cpp \ + kofr.cpp \ libor.cpp \ shibor.cpp \ sofr.cpp \ diff --git a/ql/indexes/ibor/all.hpp b/ql/indexes/ibor/all.hpp index 4dbae78eaa9..52d07e304d0 100644 --- a/ql/indexes/ibor/all.hpp +++ b/ql/indexes/ibor/all.hpp @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include diff --git a/ql/indexes/ibor/kofr.cpp b/ql/indexes/ibor/kofr.cpp new file mode 100644 index 00000000000..2c0c7654871 --- /dev/null +++ b/ql/indexes/ibor/kofr.cpp @@ -0,0 +1,31 @@ +/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ + +/* + Copyright (C) 2024 Jongbong An + + This file is part of QuantLib, a free-software/open-source library + for financial quantitative analysts and developers - http://quantlib.org/ + + QuantLib is free software: you can redistribute it and/or modify it + under the terms of the QuantLib license. You should have received a + copy of the license along with this program; if not, please email + . The license is also available online at + . + + 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. +*/ + +#include +#include +#include +#include +#include + +namespace QuantLib { + Kofr::Kofr(const Handle& h) + : OvernightIndex( + "KOFR", 0, KRWCurrency(), SouthKorea(SouthKorea::Settlement), Actual365Fixed(), h) {} + +} diff --git a/ql/indexes/ibor/kofr.hpp b/ql/indexes/ibor/kofr.hpp new file mode 100644 index 00000000000..4f23ac702f5 --- /dev/null +++ b/ql/indexes/ibor/kofr.hpp @@ -0,0 +1,44 @@ +/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ + +/* + Copyright (C) 2024 Jongbong An + + This file is part of QuantLib, a free-software/open-source library + for financial quantitative analysts and developers - http://quantlib.org/ + + QuantLib is free software: you can redistribute it and/or modify it + under the terms of the QuantLib license. You should have received a + copy of the license along with this program; if not, please email + . The license is also available online at + . + + 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. +*/ + +/*! \file kofr.hpp + \brief %KOFR index +*/ + +#ifndef quantlib_kofr_hpp +#define quantlib_kofr_hpp + +#include + +namespace QuantLib { + + //! %KOFR index. + /*! Korea Overnight Financing Repo Rate (KOFR) published by Korea Securities Depository (KSD) + Please refer to + (1) https://www.bok.or.kr/eng/main/contents.do?menuNo=400399 (Overview) + (2) https://www.kofr.kr/main.jsp (Detailed information) + */ + class Kofr : public OvernightIndex { + public: + explicit Kofr(const Handle& h = {}); + }; + +} + +#endif