-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlinkers.h
57 lines (43 loc) · 1.95 KB
/
linkers.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// Financial Analytics Library (FINAL)
// Copyright (c) 2004 - 2012 by Marek Sestak, [email protected]
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// 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
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
#ifndef linkersH
#define linkersH
#include <map>
#include "../utils/datetime.h"
#include "defs.h"
#include "calendar.h"
//---------------------------------------------------------------------------
namespace final {
class TDataSeries {
private:
std::map< TDate, floating > dataseries;
public:
TDataSeries() {}
virtual ~TDataSeries() {}
void Add( const TDate& adate, floating avalue );
void Clear();
virtual floating GetValue( const TDate& adate ) const;
virtual floating GetValue( int month, int year ) const;
}; // end of class TDataSeries
typedef enum { OATi, OATe, BTPSe, DBRe, GGBe, TII, SGBi, CANi, ACGBi } LinkerType;
floating CPIIndexValue( LinkerType linkertype, const TDate& avaluedate,
const TDataSeries& acpiseries, int ainterestaccruesfrom=0, int afirstcoupondate=0 );
floating CPIIndexRatio( LinkerType linkertype, const TDate& avaluedate,
const TDataSeries& acpiseries, floating abasecpiindexvalue,
int ainterestaccruesfrom=0, int afirstcoupondate=0 );
} // end of namespace final
//---------------------------------------------------------------------------
#endif // linkersH