Skip to content

Commit d6fded9

Browse files
author
Andrew Packard
committed
adding swig input parameters
1 parent df15a77 commit d6fded9

3 files changed

Lines changed: 84 additions & 1 deletion

File tree

OREAnalytics-SWIG/SWIG/orea_app.i

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,13 @@ public:
137137
// const std::map<std::pair<RiskFactorKey, RiskFactorKey>, Real>& covarianceData();
138138
// TODO: API for setting a sensitivity stream
139139
// const boost::shared_ptr<SensitivityStream>& sensitivityStream();
140-
// Setters for exposure simulation
140+
// Setters for exposure simulation
141+
void setSimmVersion(const std::string& s) { simmVersion_ = s; }
142+
void setCrifFromBuffer(const std::string& csvBuffer,
143+
char eol = '\n', char delim = ',', char quoteChar = '\0', char escapeChar = '\\');
144+
void setSimmCalculationCurrency(const std::string& s) { simmCalculationCurrency_ = s; }
145+
void setSimmResultCurrency(const std::string& s) { simmResultCurrency_ = s; }
146+
void setSimmReportingCurrency(const std::string& s) { simmReportingCurrency_ = s; }
141147
void setAmc(bool b);
142148
void setAmcTradeTypes(const std::string& s); // todo: parse to set<string>
143149
void setExposureBaseCurrency(const std::string& s);
@@ -217,6 +223,12 @@ public:
217223
void setKvaTheirPdFloor(Real r);
218224
void setKvaOurCvaRiskWeight(Real r);
219225
void setKvaTheirCvaRiskWeight(Real r);
226+
// Setters for Credit Simulation
227+
void setCreditMigrationAnalytic(bool b) { creditMigrationAnalytic_ = b; }
228+
void setCreditMigrationDistributionGrid(const std::vector<Real>& grid) { creditMigrationDistributionGrid_ = grid; }
229+
void setCreditMigrationTimeSteps(const std::vector<Size>& ts) { creditMigrationTimeSteps_ = ts; }
230+
void setCreditSimulationParametersFromFile(const std::string& fileName);
231+
void setCreditMigrationOutputFiles(const std::string& s) { creditMigrationOutputFiles_ = s; }
220232
// Setters for cashflow npv and dynamic backtesting
221233
void setCashflowHorizon(const std::string& s);
222234
void setPortfolioFilterDate(const std::string& s);

OREData-SWIG/SWIG/ored.i

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@
4040

4141
%}
4242

43+
4344
%include ored_conventions.i
4445
%include ored_parsers.i
4546
%include ored_market.i
@@ -48,5 +49,6 @@
4849
%include ored_loader.i
4950
%include ored_marketdatum.i
5051
%include ored_reports.i
52+
%include ored_calendarAdjustmentConfig.i
5153

5254
#endif
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
/*
2+
Copyright (C) 2018, 2020 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+
#ifndef ored_CalendarAdjustmentConfig_i
20+
#define ored_CalendarAdjustmentConfig_i
21+
22+
%{
23+
// put c++ declarations here
24+
using ore::data::CalendarAdjustmentConfig;
25+
using std::map;
26+
using std::set;
27+
using std::string;
28+
using std::vector;
29+
using QuantLib::DateGeneration;
30+
using QuantLib::Calendar;
31+
%}
32+
33+
%shared_ptr(CalendarAdjustmentConfig)
34+
class CalendarAdjustmentConfig {
35+
public:
36+
// default constructor
37+
CalendarAdjustmentConfig();
38+
39+
// This method adds d to the list of holidays for cal name.
40+
void addHolidays(const string& calname, const Date& d);
41+
42+
// This method adds d to the list of business days for cal name.
43+
void addBusinessDays(const string& calname, const Date& d);
44+
45+
// This method adds s as a base calendar for cal name.
46+
void addBaseCalendar(const string& calname, const string& d);
47+
48+
// Returns all the holidays for a given cal name
49+
const set<Date>& getHolidays(const string& calname) const;
50+
51+
// Returns all the business days for a given calname
52+
const set<Date>& getBusinessDays(const string& calname) const;
53+
54+
set<string> getCalendars() const;
55+
56+
const string& getBaseCalendar(const string& calname) const;
57+
58+
// add all holidays and business days from c to this instance
59+
void append(const CalendarAdjustmentConfig& c);
60+
private:
61+
map<string, string> baseCalendars_;
62+
map<string, set<Date>> additionalHolidays_;
63+
map<string, set<Date>> additionalBusinessDays_;
64+
65+
string normalisedName(const string&) const;
66+
};
67+
68+
69+
#endif

0 commit comments

Comments
 (0)