Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
metals.hpp
Go to the documentation of this file.
1/*
2 Copyright (C) 2019 Quaternion Risk Management Ltd
3 All rights reserved.
4
5 This file is part of ORE, a free-software/open-source library
6 for transparent pricing and risk analysis - http://opensourcerisk.org
7
8 ORE is free software: you can redistribute it and/or modify it
9 under the terms of the Modified BSD License. You should have received a
10 copy of the license along with this program.
11 The license is also available online at <http://opensourcerisk.org>
12
13 This program is distributed on the basis that it will form a useful
14 contribution to risk analytics and model standardisation, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 FITNESS FOR A PARTICULAR PURPOSE. See the license for more details.
17*/
18
19/*! \file qle/currencies/metals.hpp
20 \brief Extend QuantLib currencies for precious metal codes
21
22 ISO number from http://fx.sauder.ubc.ca/currency_table.html \n
23 We assume all currencies have a format of "%1$.2f %3%" (2 decimal places)
24 \ingroup currencies
25*/
26
27#ifndef quantext_currencies_metals_hpp
28#define quantext_currencies_metals_hpp
29
30#include <ql/currency.hpp>
31
32namespace QuantExt {
33using namespace QuantLib;
34
35//! Troy ounce of Gold
36/*! The ISO three-letter code is XAU; the numeric code is 959.
37 \ingroup currencies
38 */
39class XAUCurrency : public Currency {
40public:
42};
43
44//! Troy ounce of Silver
45/*! The ISO three-letter code is XAG; the numeric code is 961.
46 \ingroup currencies
47 */
48class XAGCurrency : public Currency {
49public:
51};
52
53//! Troy ounce of Platinum
54/*! The ISO three-letter code is XPT; the numeric code is 962.
55 \ingroup currencies
56 */
57class XPTCurrency : public Currency {
58public:
60};
61
62//! Troy ounce of Palladium
63/*! The ISO three-letter code is XPD; the numeric code is 964.
64 \ingroup currencies
65 */
66class XPDCurrency : public Currency {
67public:
69};
70
71//! Check if a given \p currency is a metal.
72bool isMetal(const QuantLib::Currency& currency);
73
74} // namespace QuantExt
75#endif
Troy ounce of Silver.
Definition: metals.hpp:48
Troy ounce of Gold.
Definition: metals.hpp:39
Troy ounce of Palladium.
Definition: metals.hpp:66
Troy ounce of Platinum.
Definition: metals.hpp:57
bool isMetal(const Currency &currency)
Definition: metals.cpp:55