24#include <boost/timer/timer.hpp>
28#include <ql/index.hpp>
32using boost::timer::cpu_timer;
33using boost::timer::default_places;
44 ObservableSettings::instance().disableUpdates(
true);
48 QuantLib::ext::shared_ptr<Index> index;
49 std::string lastIndexName;
50 for (
auto& f : fixings) {
52 WLOG(
"Skipping fixing with empty name, value " << f.fixing <<
", date " << f.date);
55 if (lastIndexName != f.name) {
57 lastIndexName = f.name;
59 index->addFixing(f.date, f.fixing,
true);
60 TLOG(
"Added fixing for " << f.name <<
" (" << io::iso_date(f.date) <<
") value:" << f.fixing);
62 }
catch (
const std::exception& e) {
63 WLOG(
"Error during adding fixing for " << f.name <<
": " << e.what());
67 LOG(
"Added " <<
count <<
" of " << fixings.size() <<
" fixings in " << timer.format(default_places,
"%w")
QuantLib::ext::shared_ptr< Index > parseIndex(const string &s)
Convert std::string to QuantLib::Index.
Map text representations to QuantLib/QuantExt types.
Classes and functions for log message handling.
#define LOG(text)
Logging Macro (Level = Notice)
#define WLOG(text)
Logging Macro (Level = Warning)
#define TLOG(text)
Logging Macro (Level = Data)
bool operator<(const Dividend &d1, const Dividend &d2)
void applyFixings(const set< Fixing > &fixings)
Utility to write a vector of fixings in the QuantLib index manager's fixing history.
Serializable Credit Default Swap.
std::string name
Index name.
QuantLib::Date date
Fixing date.