QuantLib: a free/open-source library for quantitative finance
Fully annotated sources - version 1.32
Loading...
Searching...
No Matches
asx.hpp
1/* -*- mode: c++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2
3/*
4 Copyright (C) 2000, 2001, 2002, 2003 RiskMap srl
5 Copyright (C) 2003, 2004, 2005, 2006, 2007 StatPro Italia srl
6 Copyright (C) 2004, 2005, 2006 Ferdinando Ametrano
7 Copyright (C) 2006 Katiuscia Manzoni
8 Copyright (C) 2015 Maddalena Zanzi
9
10 This file is part of QuantLib, a free-software/open-source library
11 for financial quantitative analysts and developers - http://quantlib.org/
12
13 QuantLib is free software: you can redistribute it and/or modify it
14 under the terms of the QuantLib license. You should have received a
15 copy of the license along with this program; if not, please email
16 <quantlib-dev@lists.sf.net>. The license is also available online at
17 <http://quantlib.org/license.shtml>.
18
19 This program is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
21 FOR A PARTICULAR PURPOSE. See the license for more details.
22*/
23
28#ifndef quantlib_asx_hpp
29#define quantlib_asx_hpp
30
31#include <ql/time/date.hpp>
32
33namespace QuantLib {
34
36 struct ASX {
37 enum Month { F = 1, G = 2, H = 3,
38 J = 4, K = 5, M = 6,
39 N = 7, Q = 8, U = 9,
40 V = 10, X = 11, Z = 12 };
41
43 static bool isASXdate(const Date& d,
44 bool mainCycle = true);
45
47 static bool isASXcode(const std::string& in,
48 bool mainCycle = true);
49
56 static std::string code(const Date& asxDate);
57
64 static Date date(const std::string& asxCode,
65 const Date& referenceDate = Date());
66
68
71 static Date nextDate(const Date& d = Date(),
72 bool mainCycle = true);
73
75
78 static Date nextDate(const std::string& asxCode,
79 bool mainCycle = true,
80 const Date& referenceDate = Date());
81
83
86 static std::string nextCode(const Date& d = Date(),
87 bool mainCycle = true);
88
90
93 static std::string nextCode(const std::string& asxCode,
94 bool mainCycle = true,
95 const Date& referenceDate = Date());
96 };
97
98}
99
100#endif
Concrete date class.
Definition: date.hpp:125
Definition: any.hpp:35
Main cycle of the Australian Securities Exchange (a.k.a. ASX) months.
Definition: asx.hpp:36
static Date date(const std::string &asxCode, const Date &referenceDate=Date())
Definition: asx.cpp:126
static std::string nextCode(const Date &d=Date(), bool mainCycle=true)
next ASX code following the given date
Definition: asx.cpp:197
static Date nextDate(const Date &d=Date(), bool mainCycle=true)
next ASX date following the given date
Definition: asx.cpp:165
static bool isASXcode(const std::string &in, bool mainCycle=true)
returns whether or not the given string is an ASX code
Definition: asx.cpp:56
static std::string code(const Date &asxDate)
Definition: asx.cpp:71
static bool isASXdate(const Date &d, bool mainCycle=true)
returns whether or not the given date is an ASX date
Definition: asx.cpp:35