Class to hold market data adjustment factors - for example equity stock splits. More...
#include <ored/marketdata/adjustmentfactors.hpp>
Public Member Functions | |
AdjustmentFactors (QuantLib::Date asof) | |
bool | hasFactor (const std::string &name) const |
Check if we have any adjustment factors for a name. More... | |
QuantLib::Real | getFactor (const std::string &name, const QuantLib::Date &d) const |
Returns the adjustment factor for a name on a given date. More... | |
void | addFactor (std::string name, QuantLib::Date d, QuantLib::Real factor) |
Add an adjustment factor. More... | |
Public Member Functions inherited from XMLSerializable | |
virtual | ~XMLSerializable () |
virtual void | fromXML (XMLNode *node)=0 |
virtual XMLNode * | toXML (XMLDocument &doc) const =0 |
void | fromFile (const std::string &filename) |
void | toFile (const std::string &filename) const |
void | fromXMLString (const std::string &xml) |
Parse from XML string. More... | |
std::string | toXMLString () const |
Parse from XML string. More... | |
Serilaisation | |
QuantLib::Date | asof_ |
Asof date - only apply adjustments before this date. More... | |
std::map< std::string, std::vector< std::pair< QuantLib::Date, QuantLib::Real > > > | data_ |
Map of names to adjustment factors. More... | |
virtual void | fromXML (ore::data::XMLNode *node) override |
virtual ore::data::XMLNode * | toXML (ore::data::XMLDocument &doc) const override |
std::set< std::string > | names () const |
names with adjustment factors More... | |
std::set< QuantLib::Date > | dates (const std::string &name) const |
dates with contributions to an adjustment factor for a name More... | |
QuantLib::Real | getFactorContribution (const std::string &name, const QuantLib::Date &d) const |
gets the contribution to an adjustment factor for a name on a given date More... | |
Class to hold market data adjustment factors - for example equity stock splits.
Definition at line 28 of file adjustmentfactors.hpp.
AdjustmentFactors | ( | QuantLib::Date | asof | ) |
Definition at line 30 of file adjustmentfactors.hpp.
bool hasFactor | ( | const std::string & | name | ) | const |
Check if we have any adjustment factors for a name.
Definition at line 26 of file adjustmentfactors.cpp.
Real getFactor | ( | const std::string & | name, |
const QuantLib::Date & | d | ||
) | const |
Returns the adjustment factor for a name on a given date.
Definition at line 28 of file adjustmentfactors.cpp.
void addFactor | ( | std::string | name, |
QuantLib::Date | d, | ||
QuantLib::Real | factor | ||
) |
Add an adjustment factor.
Definition at line 52 of file adjustmentfactors.cpp.
|
overridevirtual |
Implements XMLSerializable.
Definition at line 56 of file adjustmentfactors.cpp.
|
overridevirtual |
Implements XMLSerializable.
Definition at line 70 of file adjustmentfactors.cpp.
std::set< std::string > names | ( | ) | const |
names with adjustment factors
Definition at line 83 of file adjustmentfactors.cpp.
std::set< QuantLib::Date > dates | ( | const std::string & | name | ) | const |
dates with contributions to an adjustment factor for a name
Definition at line 90 of file adjustmentfactors.cpp.
QuantLib::Real getFactorContribution | ( | const std::string & | name, |
const QuantLib::Date & | d | ||
) | const |
gets the contribution to an adjustment factor for a name on a given date
Definition at line 100 of file adjustmentfactors.cpp.
|
private |
Asof date - only apply adjustments before this date.
Definition at line 54 of file adjustmentfactors.hpp.
|
private |
Map of names to adjustment factors.
Definition at line 56 of file adjustmentfactors.hpp.