45 const QuantLib::ext::shared_ptr<Trade>& trade,
49 const QuantLib::ext::shared_ptr<SimMarket>& simMarket,
51 QuantLib::ext::shared_ptr<NPVCube>& outputCube,
53 QuantLib::ext::shared_ptr<NPVCube>& outputCubeNettingSet,
61 bool isCloseOut =
false) = 0;
65 const QuantLib::ext::shared_ptr<Trade>& trade,
69 const QuantLib::ext::shared_ptr<SimMarket>& simMarket,
71 QuantLib::ext::shared_ptr<NPVCube>& outputCube,
73 QuantLib::ext::shared_ptr<NPVCube>& outputCubeNettingSet) = 0;
76 virtual void init(
const QuantLib::ext::shared_ptr<Portfolio>& portfolio,
const QuantLib::ext::shared_ptr<SimMarket>& simMarket) = 0;
92 virtual void calculate(
const QuantLib::ext::shared_ptr<Trade>& trade, Size tradeIndex,
93 const QuantLib::ext::shared_ptr<SimMarket>& simMarket, QuantLib::ext::shared_ptr<NPVCube>& outputCube,
94 QuantLib::ext::shared_ptr<NPVCube>& outputCubeNettingSet,
const Date& date, Size dateIndex,
95 Size sample,
bool isCloseOut =
false)
override;
97 virtual void calculateT0(
const QuantLib::ext::shared_ptr<Trade>& trade, Size tradeIndex,
98 const QuantLib::ext::shared_ptr<SimMarket>& simMarket, QuantLib::ext::shared_ptr<NPVCube>& outputCube,
99 QuantLib::ext::shared_ptr<NPVCube>& outputCubeNettingSet)
override;
101 virtual Real
npv(Size tradeIndex,
const QuantLib::ext::shared_ptr<Trade>& trade,
102 const QuantLib::ext::shared_ptr<SimMarket>& simMarket);
104 void init(
const QuantLib::ext::shared_ptr<Portfolio>& portfolio,
const QuantLib::ext::shared_ptr<SimMarket>& simMarket)
override;
124 CashflowCalculator(
const std::string& baseCcyCode,
const Date& t0Date,
const QuantLib::ext::shared_ptr<DateGrid>& dateGrid,
128 virtual void calculate(
const QuantLib::ext::shared_ptr<Trade>& trade, Size tradeIndex,
129 const QuantLib::ext::shared_ptr<SimMarket>& simMarket, QuantLib::ext::shared_ptr<NPVCube>& outputCube,
130 QuantLib::ext::shared_ptr<NPVCube>& outputCubeNettingSet,
const Date& date, Size dateIndex,
131 Size sample,
bool isCloseOut =
false)
override;
133 virtual void calculateT0(
const QuantLib::ext::shared_ptr<Trade>& trade, Size tradeIndex,
134 const QuantLib::ext::shared_ptr<SimMarket>& simMarket, QuantLib::ext::shared_ptr<NPVCube>& outputCube,
135 QuantLib::ext::shared_ptr<NPVCube>& outputCubeNettingSet)
override {}
137 void init(
const QuantLib::ext::shared_ptr<Portfolio>& portfolio,
const QuantLib::ext::shared_ptr<SimMarket>& simMarket)
override;
161 NPVCalculatorFXT0(
const std::string& baseCcyCode,
const QuantLib::ext::shared_ptr<Market>& t0Market, Size index = 0)
164 virtual void calculate(
const QuantLib::ext::shared_ptr<Trade>& trade, Size tradeIndex,
165 const QuantLib::ext::shared_ptr<SimMarket>& simMarket, QuantLib::ext::shared_ptr<NPVCube>& outputCube,
166 QuantLib::ext::shared_ptr<NPVCube>& outputCubeNettingSet,
const Date& date, Size dateIndex,
167 Size sample,
bool isCloseOut =
false)
override;
169 virtual void calculateT0(
const QuantLib::ext::shared_ptr<Trade>& trade, Size tradeIndex,
170 const QuantLib::ext::shared_ptr<SimMarket>& simMarket, QuantLib::ext::shared_ptr<NPVCube>& outputCube,
171 QuantLib::ext::shared_ptr<NPVCube>& outputCubeNettingSet)
override;
173 Real
npv(Size tradeIndex,
const QuantLib::ext::shared_ptr<Trade>& trade,
const QuantLib::ext::shared_ptr<SimMarket>& simMarket);
175 void init(
const QuantLib::ext::shared_ptr<Portfolio>& portfolio,
const QuantLib::ext::shared_ptr<SimMarket>& simMarket)
override;
virtual void calculateT0(const QuantLib::ext::shared_ptr< Trade > &trade, Size tradeIndex, const QuantLib::ext::shared_ptr< SimMarket > &simMarket, QuantLib::ext::shared_ptr< NPVCube > &outputCube, QuantLib::ext::shared_ptr< NPVCube > &outputCubeNettingSet) override
std::vector< double > fxRates_
void init(const QuantLib::ext::shared_ptr< Portfolio > &portfolio, const QuantLib::ext::shared_ptr< SimMarket > &simMarket) override
void initScenario() override
virtual void calculate(const QuantLib::ext::shared_ptr< Trade > &trade, Size tradeIndex, const QuantLib::ext::shared_ptr< SimMarket > &simMarket, QuantLib::ext::shared_ptr< NPVCube > &outputCube, QuantLib::ext::shared_ptr< NPVCube > &outputCubeNettingSet, const Date &date, Size dateIndex, Size sample, bool isCloseOut=false) override
std::vector< std::vector< Size > > tradeAndLegCcyIndex_
QuantLib::ext::shared_ptr< DateGrid > dateGrid_
CashflowCalculator(const std::string &baseCcyCode, const Date &t0Date, const QuantLib::ext::shared_ptr< DateGrid > &dateGrid, Size index)
Constructor takes the base ccy, date grid and index of cube to write to.
std::vector< Handle< Quote > > ccyQuotes_
NPVCalculatorFXT0(const std::string &baseCcyCode, const QuantLib::ext::shared_ptr< Market > &t0Market, Size index=0)
base ccy and index to write to
virtual void calculateT0(const QuantLib::ext::shared_ptr< Trade > &trade, Size tradeIndex, const QuantLib::ext::shared_ptr< SimMarket > &simMarket, QuantLib::ext::shared_ptr< NPVCube > &outputCube, QuantLib::ext::shared_ptr< NPVCube > &outputCubeNettingSet) override
std::vector< Size > tradeCcyIndex_
QuantLib::ext::shared_ptr< Market > t0Market_
std::vector< double > fxRates_
Real npv(Size tradeIndex, const QuantLib::ext::shared_ptr< Trade > &trade, const QuantLib::ext::shared_ptr< SimMarket > &simMarket)
void init(const QuantLib::ext::shared_ptr< Portfolio > &portfolio, const QuantLib::ext::shared_ptr< SimMarket > &simMarket) override
void initScenario() override
virtual void calculate(const QuantLib::ext::shared_ptr< Trade > &trade, Size tradeIndex, const QuantLib::ext::shared_ptr< SimMarket > &simMarket, QuantLib::ext::shared_ptr< NPVCube > &outputCube, QuantLib::ext::shared_ptr< NPVCube > &outputCubeNettingSet, const Date &date, Size dateIndex, Size sample, bool isCloseOut=false) override
virtual void calculateT0(const QuantLib::ext::shared_ptr< Trade > &trade, Size tradeIndex, const QuantLib::ext::shared_ptr< SimMarket > &simMarket, QuantLib::ext::shared_ptr< NPVCube > &outputCube, QuantLib::ext::shared_ptr< NPVCube > &outputCubeNettingSet) override
std::vector< Size > tradeCcyIndex_
std::vector< double > fxRates_
virtual Real npv(Size tradeIndex, const QuantLib::ext::shared_ptr< Trade > &trade, const QuantLib::ext::shared_ptr< SimMarket > &simMarket)
void init(const QuantLib::ext::shared_ptr< Portfolio > &portfolio, const QuantLib::ext::shared_ptr< SimMarket > &simMarket) override
void initScenario() override
virtual void calculate(const QuantLib::ext::shared_ptr< Trade > &trade, Size tradeIndex, const QuantLib::ext::shared_ptr< SimMarket > &simMarket, QuantLib::ext::shared_ptr< NPVCube > &outputCube, QuantLib::ext::shared_ptr< NPVCube > &outputCubeNettingSet, const Date &date, Size dateIndex, Size sample, bool isCloseOut=false) override
NPVCalculator(const std::string &baseCcyCode, Size index=0)
base ccy and index to write to
std::vector< Handle< Quote > > ccyQuotes_
ValuationCalculator interface.
virtual void initScenario()=0
virtual void init(const QuantLib::ext::shared_ptr< Portfolio > &portfolio, const QuantLib::ext::shared_ptr< SimMarket > &simMarket)=0
virtual void calculate(const QuantLib::ext::shared_ptr< Trade > &trade, Size tradeIndex, const QuantLib::ext::shared_ptr< SimMarket > &simMarket, QuantLib::ext::shared_ptr< NPVCube > &outputCube, QuantLib::ext::shared_ptr< NPVCube > &outputCubeNettingSet, const Date &date, Size dateIndex, Size sample, bool isCloseOut=false)=0
virtual ~ValuationCalculator()
virtual void calculateT0(const QuantLib::ext::shared_ptr< Trade > &trade, Size tradeIndex, const QuantLib::ext::shared_ptr< SimMarket > &simMarket, QuantLib::ext::shared_ptr< NPVCube > &outputCube, QuantLib::ext::shared_ptr< NPVCube > &outputCubeNettingSet)=0
A Market class that can be Simulated.