/src/quantlib/ql/indexes/swap/chfliborswap.cpp
Line | Count | Source |
1 | | /* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ |
2 | | |
3 | | /* |
4 | | Copyright (C) 2006, 2007, 2008, 2011 Ferdinando Ametrano |
5 | | Copyright (C) 2006 Chiara Fornarola |
6 | | |
7 | | This file is part of QuantLib, a free-software/open-source library |
8 | | for financial quantitative analysts and developers - http://quantlib.org/ |
9 | | |
10 | | QuantLib is free software: you can redistribute it and/or modify it |
11 | | under the terms of the QuantLib license. You should have received a |
12 | | copy of the license along with this program; if not, please email |
13 | | <quantlib-dev@lists.sf.net>. The license is also available online at |
14 | | <https://www.quantlib.org/license.shtml>. |
15 | | |
16 | | This program is distributed in the hope that it will be useful, but WITHOUT |
17 | | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
18 | | FOR A PARTICULAR PURPOSE. See the license for more details. |
19 | | */ |
20 | | |
21 | | #include <ql/indexes/swap/chfliborswap.hpp> |
22 | | #include <ql/indexes/ibor/chflibor.hpp> |
23 | | #include <ql/time/calendars/target.hpp> |
24 | | #include <ql/time/daycounters/thirty360.hpp> |
25 | | #include <ql/currencies/europe.hpp> |
26 | | |
27 | | namespace QuantLib { |
28 | | |
29 | | ChfLiborSwapIsdaFix::ChfLiborSwapIsdaFix( |
30 | | const Period& tenor, |
31 | | const Handle<YieldTermStructure>& h) |
32 | 0 | : SwapIndex("ChfLiborSwapIsdaFix", // familyName |
33 | 0 | tenor, |
34 | 0 | 2, // settlementDays |
35 | 0 | CHFCurrency(), |
36 | 0 | TARGET(), |
37 | 0 | 1*Years, // fixedLegTenor |
38 | 0 | ModifiedFollowing, // fixedLegConvention |
39 | 0 | Thirty360(Thirty360::BondBasis), // fixedLegDaycounter |
40 | 0 | tenor > 1*Years ? |
41 | 0 | ext::shared_ptr<IborIndex>(new CHFLibor(6*Months, h)) : |
42 | 0 | ext::shared_ptr<IborIndex>(new CHFLibor(3*Months, h))) {} |
43 | | |
44 | | ChfLiborSwapIsdaFix::ChfLiborSwapIsdaFix( |
45 | | const Period& tenor, |
46 | | const Handle<YieldTermStructure>& forwarding, |
47 | | const Handle<YieldTermStructure>& discounting) |
48 | 0 | : SwapIndex("ChfLiborSwapIsdaFix", // familyName |
49 | 0 | tenor, |
50 | 0 | 2, // settlementDays |
51 | 0 | CHFCurrency(), |
52 | 0 | TARGET(), |
53 | 0 | 1*Years, // fixedLegTenor |
54 | 0 | ModifiedFollowing, // fixedLegConvention |
55 | 0 | Thirty360(Thirty360::BondBasis), // fixedLegDaycounter |
56 | 0 | tenor > 1*Years ? |
57 | 0 | ext::shared_ptr<IborIndex>(new CHFLibor(6*Months, forwarding)) : |
58 | 0 | ext::shared_ptr<IborIndex>(new CHFLibor(3*Months, forwarding)), |
59 | 0 | discounting) {} |
60 | | |
61 | | } |