#include <orea/simm/imschedulecalculator.hpp>
Collaboration diagram for IMScheduleCalculator:Classes | |
| struct | IMScheduleTradeData |
Public Types | |
| typedef CrifRecord::ProductClass | ProductClass |
| typedef CrifRecord::RiskType | RiskType |
| typedef SimmConfiguration::Regulation | Regulation |
| typedef SimmConfiguration::SimmSide | SimmSide |
Public Member Functions | |
| IMScheduleCalculator (const Crif &crif, const std::string &calculationCcy="USD", const QuantLib::ext::shared_ptr< ore::data::Market > market=nullptr, const bool determineWinningRegulations=true, const bool enforceIMRegulations=false, const bool quiet=false, const std::map< SimmSide, std::set< NettingSetDetails > > &hasSEC=std::map< SimmSide, std::set< NettingSetDetails > >(), const std::map< SimmSide, std::set< NettingSetDetails > > &hasCFTC=std::map< SimmSide, std::set< NettingSetDetails > >()) | |
| Construct the IMScheduleCalculator from a container of netted CRIF records. More... | |
| const std::map< SimmSide, std::set< std::string > > | finalTradeIds () const |
| Give back the set of portfolio IDs and trade IDs for which we have IM results. More... | |
| const std::string & | winningRegulations (const SimmSide &side, const ore::data::NettingSetDetails &nettingSetDetails) const |
| Return the winning regulation for each portfolioId. More... | |
| const std::map< ore::data::NettingSetDetails, string > & | winningRegulations (const SimmSide &side) const |
| const std::map< SimmSide, std::map< ore::data::NettingSetDetails, string > > & | winningRegulations () const |
| const std::map< std::string, IMScheduleResults > & | imScheduleSummaryResults (const SimmSide &side, const ore::data::NettingSetDetails &nsd) const |
| Give back the IM Schedule results container for the given portfolioId and IM side. More... | |
| const std::map< ore::data::NettingSetDetails, std::map< std::string, IMScheduleResults > > & | imScheduleSummaryResults (const SimmSide &side) const |
| const std::map< SimmSide, std::map< ore::data::NettingSetDetails, std::map< std::string, IMScheduleResults > > > & | imScheduleSummaryResults () const |
| const std::pair< std::string, IMScheduleResults > & | finalImScheduleSummaryResults (const SimmSide &side, const ore::data::NettingSetDetails &nsd) const |
| const std::map< ore::data::NettingSetDetails, std::pair< std::string, IMScheduleResults > > & | finalImScheduleSummaryResults (const SimmSide &side) const |
| const std::map< SimmSide, std::map< ore::data::NettingSetDetails, std::pair< std::string, IMScheduleResults > > > & | finalImScheduleSummaryResults () const |
| const std::vector< IMScheduleTradeData > & | imScheduleTradeResults (const std::string &tradeId) const |
| Give back the IM Schedule results container for the given tradeId and IM side. More... | |
| const std::map< std::string, std::vector< IMScheduleTradeData > > & | imScheduleTradeResults () const |
| const IMScheduleTradeData & | finalImScheduleTradeResults (const std::string &tradeId) const |
| const std::map< std::string, IMScheduleTradeData > & | finalImScheduleTradeResults () const |
| const std::string & | calculationCurrency () const |
| Return the calculator's calculation currency. More... | |
| void | populateFinalResults (const std::map< SimmSide, std::map< ore::data::NettingSetDetails, std::string > > &winningRegulations) |
Static Public Member Functions | |
| static const IMScheduleLabel | label (const ProductClass &productClass, const QuantLib::Real &maturity) |
| static const std::string | labelString (const IMScheduleLabel &label) |
Private Member Functions | |
| QuantLib::Real | multiplier (const IMScheduleLabel &label) |
| void | collectTradeData (const CrifRecord &cr, const bool enforceIMRegulations) |
| Collect trade data as defined by the CRIF records. More... | |
| void | populateResults (const ore::data::NettingSetDetails &nsd, const string ®ulation, const SimmSide &side) |
| void | populateFinalResults () |
| void | add (const SimmSide &side, const ore::data::NettingSetDetails &nsd, const std::string ®ulation, const CrifRecord::ProductClass &pc, const std::string &ccy, const QuantLib::Real &grossIM, const QuantLib::Real &grossRC=QuantLib::Null< QuantLib::Real >(), const QuantLib::Real &netRC=QuantLib::Null< QuantLib::Real >(), const QuantLib::Real &ngr=QuantLib::Null< QuantLib::Real >(), const QuantLib::Real &scheduleIM=QuantLib::Null< QuantLib::Real >()) |
| Add a margin result to either call or post results container depending on the SimmSide parameter. More... | |
Private Attributes | |
| ore::analytics::Crif | crif_ |
| The net sensitivities used in the calculation. More... | |
| std::string | calculationCcy_ |
| The SIMM calculation currency i.e. the currency of the SIMM results. More... | |
| QuantLib::ext::shared_ptr< ore::data::Market > | market_ |
| Market data for FX rates to use for converting amounts to USD. More... | |
| bool | quiet_ |
| If true, no logging is written out. More... | |
| std::map< SimmSide, std::set< NettingSetDetails > > | hasSEC_ |
| std::map< SimmSide, std::set< NettingSetDetails > > | hasCFTC_ |
| std::map< ore::data::NettingSetDetails, bool > | collectRegsIsEmpty_ |
| For each netting set, whether all CRIF records' collect regulations are empty. More... | |
| std::map< ore::data::NettingSetDetails, bool > | postRegsIsEmpty_ |
| For each netting set, whether all CRIF records' post regulations are empty. More... | |
| std::map< SimmSide, std::map< ore::data::NettingSetDetails, std::map< std::string, IMScheduleResults > > > | imScheduleResults_ |
| Containers, one for call and post, with an IMScheduleResults object for each regulation under each portfolio ID. More... | |
| std::map< SimmSide, std::map< ore::data::NettingSetDetails, std::pair< std::string, IMScheduleResults > > > | finalImScheduleResults_ |
| Containers, one for call and post, with an IMScheduleResults object for each portfolio ID. More... | |
| std::map< SimmSide, std::map< ore::data::NettingSetDetails, std::map< std::string, set< string > > > > | tradeIds_ |
| Container for keeping track of what trade IDs belong to each regulation. More... | |
| std::map< SimmSide, set< string > > | finalTradeIds_ |
| std::map< SimmSide, std::map< ore::data::NettingSetDetails, std::string > > | winningRegulations_ |
| Regulation with highest IM for each given netting set. More... | |
| std::map< std::string, std::vector< IMScheduleTradeData > > | finalTradeData_ |
| std::map< SimmSide, std::map< ore::data::NettingSetDetails, std::map< std::string, std::map< std::string, IMScheduleTradeData > > > > | nettingSetRegTradeData_ |
| Container for trade data, taking into account regulations applicable to each netting set. More... | |
| std::map< IMScheduleLabel, QuantLib::Real > | multiplierMap_ |
A class to calculate Schedule IM given a set of aggregated CRIF results for one or more portfolios.
Definition at line 35 of file imschedulecalculator.hpp.
| typedef CrifRecord::ProductClass ProductClass |
Definition at line 38 of file imschedulecalculator.hpp.
| typedef CrifRecord::RiskType RiskType |
Definition at line 39 of file imschedulecalculator.hpp.
Definition at line 40 of file imschedulecalculator.hpp.
| typedef SimmConfiguration::SimmSide SimmSide |
Definition at line 41 of file imschedulecalculator.hpp.
| IMScheduleCalculator | ( | const Crif & | crif, |
| const std::string & | calculationCcy = "USD", |
||
| const QuantLib::ext::shared_ptr< ore::data::Market > | market = nullptr, |
||
| const bool | determineWinningRegulations = true, |
||
| const bool | enforceIMRegulations = false, |
||
| const bool | quiet = false, |
||
| const std::map< SimmSide, std::set< NettingSetDetails > > & | hasSEC = std::map<SimmSide, std::set<NettingSetDetails>>(), |
||
| const std::map< SimmSide, std::set< NettingSetDetails > > & | hasCFTC = std::map<SimmSide, std::set<NettingSetDetails>>() |
||
| ) |
Construct the IMScheduleCalculator from a container of netted CRIF records.
Definition at line 53 of file imschedulecalculator.cpp.
Here is the call graph for this function:| const std::map< SimmSide, std::set< std::string > > finalTradeIds | ( | ) | const |
Give back the set of portfolio IDs and trade IDs for which we have IM results.
Definition at line 121 of file imschedulecalculator.hpp.
| const string & winningRegulations | ( | const SimmSide & | side, |
| const ore::data::NettingSetDetails & | nettingSetDetails | ||
| ) | const |
Return the winning regulation for each portfolioId.
Definition at line 271 of file imschedulecalculator.cpp.
Here is the call graph for this function:| const map< NettingSetDetails, string > & winningRegulations | ( | const SimmSide & | side | ) | const |
Definition at line 280 of file imschedulecalculator.cpp.
| const map< SimmConfiguration::SimmSide, map< NettingSetDetails, string > > & winningRegulations | ( | ) | const |
Definition at line 288 of file imschedulecalculator.cpp.
Here is the caller graph for this function:| const map< string, IMScheduleResults > & imScheduleSummaryResults | ( | const SimmSide & | side, |
| const ore::data::NettingSetDetails & | nsd | ||
| ) | const |
Give back the IM Schedule results container for the given portfolioId and IM side.
Definition at line 292 of file imschedulecalculator.cpp.
Here is the call graph for this function:| const map< NettingSetDetails, map< string, IMScheduleResults > > & imScheduleSummaryResults | ( | const SimmSide & | side | ) | const |
Definition at line 300 of file imschedulecalculator.cpp.
| const map< SimmConfiguration::SimmSide, map< NettingSetDetails, map< string, IMScheduleResults > > > & imScheduleSummaryResults | ( | ) | const |
Definition at line 308 of file imschedulecalculator.cpp.
Here is the caller graph for this function:| const pair< string, IMScheduleResults > & finalImScheduleSummaryResults | ( | const SimmSide & | side, |
| const ore::data::NettingSetDetails & | nsd | ||
| ) | const |
Definition at line 312 of file imschedulecalculator.cpp.
Here is the call graph for this function:| const map< NettingSetDetails, pair< string, IMScheduleResults > > & finalImScheduleSummaryResults | ( | const SimmSide & | side | ) | const |
Definition at line 321 of file imschedulecalculator.cpp.
| const std::map< SimmSide, std::map< ore::data::NettingSetDetails, std::pair< std::string, IMScheduleResults > > > & finalImScheduleSummaryResults | ( | ) | const |
Definition at line 138 of file imschedulecalculator.hpp.
Here is the caller graph for this function:| const vector< IMScheduleCalculator::IMScheduleTradeData > & imScheduleTradeResults | ( | const std::string & | tradeId | ) | const |
Give back the IM Schedule results container for the given tradeId and IM side.
Definition at line 328 of file imschedulecalculator.cpp.
| const map< string, vector< IMScheduleCalculator::IMScheduleTradeData > > & imScheduleTradeResults | ( | ) | const |
Definition at line 334 of file imschedulecalculator.cpp.
| const IMScheduleTradeData & finalImScheduleTradeResults | ( | const std::string & | tradeId | ) | const |
| const std::map< std::string, IMScheduleTradeData > & finalImScheduleTradeResults | ( | ) | const |
| const std::string & calculationCurrency | ( | ) | const |
Return the calculator's calculation currency.
Definition at line 150 of file imschedulecalculator.hpp.
|
static |
Definition at line 338 of file imschedulecalculator.cpp.
Here is the caller graph for this function:
|
static |
Definition at line 373 of file imschedulecalculator.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:| void populateFinalResults | ( | const std::map< SimmSide, std::map< ore::data::NettingSetDetails, std::string > > & | winningRegulations | ) |
|
private |
Definition at line 220 of file imschedulecalculator.hpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Collect trade data as defined by the CRIF records.
Definition at line 390 of file imschedulecalculator.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Populate the results structure with the higher level results after the IMs have been calculated at the (product class, maturity) level for each portfolio
Definition at line 461 of file imschedulecalculator.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Populate final (i.e. winning regulators') using own list of winning regulators, which were determined solely by the IMSchedule results (i.e. not including any external SIMM results)
Definition at line 572 of file imschedulecalculator.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Add a margin result to either call or post results container depending on the SimmSide parameter.
Definition at line 576 of file imschedulecalculator.cpp.
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
The net sensitivities used in the calculation.
Definition at line 160 of file imschedulecalculator.hpp.
|
private |
The SIMM calculation currency i.e. the currency of the SIMM results.
Definition at line 163 of file imschedulecalculator.hpp.
|
private |
Market data for FX rates to use for converting amounts to USD.
Definition at line 166 of file imschedulecalculator.hpp.
|
private |
If true, no logging is written out.
Definition at line 169 of file imschedulecalculator.hpp.
|
private |
Definition at line 171 of file imschedulecalculator.hpp.
|
private |
Definition at line 171 of file imschedulecalculator.hpp.
|
private |
For each netting set, whether all CRIF records' collect regulations are empty.
Definition at line 174 of file imschedulecalculator.hpp.
|
private |
For each netting set, whether all CRIF records' post regulations are empty.
Definition at line 177 of file imschedulecalculator.hpp.
|
private |
Containers, one for call and post, with an IMScheduleResults object for each regulation under each portfolio ID.
Definition at line 181 of file imschedulecalculator.hpp.
|
private |
Containers, one for call and post, with an IMScheduleResults object for each portfolio ID.
Definition at line 185 of file imschedulecalculator.hpp.
|
private |
Container for keeping track of what trade IDs belong to each regulation.
Definition at line 189 of file imschedulecalculator.hpp.
|
private |
Definition at line 191 of file imschedulecalculator.hpp.
|
private |
Regulation with highest IM for each given netting set.
Definition at line 195 of file imschedulecalculator.hpp.
|
private |
Container for trade data collected from CRIF report trade ID trade data
Definition at line 199 of file imschedulecalculator.hpp.
|
private |
Container for trade data, taking into account regulations applicable to each netting set.
Definition at line 203 of file imschedulecalculator.hpp.
|
private |
Definition at line 205 of file imschedulecalculator.hpp.