Logo
Fully annotated reference manual - version 1.8.12
Loading...
Searching...
No Matches
Functions
fxswap.cpp File Reference
#include <boost/make_shared.hpp>
#include <boost/test/unit_test.hpp>
#include <ored/marketdata/marketimpl.hpp>
#include <ored/portfolio/enginedata.hpp>
#include <ored/portfolio/fxforward.hpp>
#include <ored/portfolio/fxoption.hpp>
#include <ored/portfolio/fxswap.hpp>
#include <oret/toplevelfixture.hpp>
#include <ql/termstructures/volatility/equityfx/blackconstantvol.hpp>
#include <ql/termstructures/yield/flatforward.hpp>
#include <ql/time/daycounters/actualactual.hpp>

Go to the source code of this file.

Functions

 BOOST_AUTO_TEST_CASE (testFXSwap)
 

Function Documentation

◆ BOOST_AUTO_TEST_CASE()

BOOST_AUTO_TEST_CASE ( testFXSwap  )

Definition at line 139 of file fxswap.cpp.

139 {
140
141 BOOST_TEST_MESSAGE("Testing FXSwap...");
142
143 QuantLib::ext::shared_ptr<Market> market = QuantLib::ext::make_shared<TestMarket>();
144
145 string nearDate = "2015-10-27";
146 string farDate = "2015-11-03";
147 string nearBoughtCurrency = "EUR";
148 Real nearBoughtAmount = 224557621.490000;
149 string nearSoldCurrency = "USD";
150 Real nearSoldAmount = 250000000.000000;
151 Real farBoughtAmount = 250018000.00;
152 Real farSoldAmount = 224552207.77;
153
154 test(nearDate, farDate, nearBoughtCurrency, nearBoughtAmount, nearSoldCurrency, nearSoldAmount, farBoughtAmount,
155 farSoldAmount, market);
156
157 nearDate = "2015-07-14";
158 farDate = "2015-11-16";
159 nearBoughtCurrency = "CHF";
160 nearBoughtAmount = 97000000;
161 nearSoldCurrency = "USD";
162 nearSoldAmount = 103718911.06;
163 farBoughtAmount = 103923787.150000;
164 farSoldAmount = 96737000.000000;
165
166 test(nearDate, farDate, nearBoughtCurrency, nearBoughtAmount, nearSoldCurrency, nearSoldAmount, farBoughtAmount,
167 farSoldAmount, market);
168
169 nearDate = "2015-08-04";
170 farDate = "2015-11-30";
171 nearBoughtCurrency = "GBP";
172 nearBoughtAmount = 100227439.19;
173 nearSoldCurrency = "USD";
174 nearSoldAmount = 156000000;
175 farBoughtAmount = 156148000.000000;
176 farSoldAmount = 100400372.110000;
177
178 test(nearDate, farDate, nearBoughtCurrency, nearBoughtAmount, nearSoldCurrency, nearSoldAmount, farBoughtAmount,
179 farSoldAmount, market);
180}