Update of /cvsroot/quantlibaddin/QuantLibAddin/qlo
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv14963
Modified Files:
ratehelpers.cpp ratehelpers.hpp
Log Message:
added Futures front contract rolling days
Index: ratehelpers.hpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/ratehelpers.hpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ratehelpers.hpp 18 Jun 2006 12:55:34 -0000 1.2
--- ratehelpers.hpp 18 Jun 2006 18:54:32 -0000 1.3
***************
*** 84,88 ****
const std::vector<bool>& includeFlag,
const std::vector<long>& priority,
! const long nFutures);
}
--- 84,89 ----
const std::vector<bool>& includeFlag,
const std::vector<long>& priority,
! const long nFutures,
! const long frontContractRollingDays);
}
Index: ratehelpers.cpp
===================================================================
RCS file: /cvsroot/quantlibaddin/QuantLibAddin/qlo/ratehelpers.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** ratehelpers.cpp 18 Jun 2006 12:55:34 -0000 1.2
--- ratehelpers.cpp 18 Jun 2006 18:54:32 -0000 1.3
***************
*** 165,171 ****
const std::vector<bool>& includeFlag,
const std::vector<long>& priority,
! const long nFutures)
{
QL_REQUIRE(!instrumentHandles.empty(), "no instrument given");
QuantLib::Size nInstruments = instrumentHandles.size();
--- 165,175 ----
const std::vector<bool>& includeFlag,
const std::vector<long>& priority,
! const long nFutures,
! const long frontContractRollingDays)
{
QL_REQUIRE(!instrumentHandles.empty(), "no instrument given");
+ QL_REQUIRE(frontContractRollingDays>=0,
+ "negative (" << frontContractRollingDays <<
+ ")frontContractRollingDays");
QuantLib::Size nInstruments = instrumentHandles.size();
***************
*** 193,200 ****
earliestDate = temp->earliestDate();
if (includeFlag[i]) {
! if (!boost::dynamic_pointer_cast<FuturesRateHelper>(instruments[i]) && (earliestDate >= evalDate)) {
rhs.push_back(detail::RateHelperItem(temp->latestDate(),
priority[i], instrumentHandles[i]));
! } else if (futuresCounter<nFutures && (earliestDate-2 >= evalDate)) {
futuresCounter++;
rhs.push_back(detail::RateHelperItem(temp->latestDate(),
--- 197,206 ----
earliestDate = temp->earliestDate();
if (includeFlag[i]) {
! if (!boost::dynamic_pointer_cast<FuturesRateHelper>(instruments[i]) &&
! (earliestDate >= evalDate)) {
rhs.push_back(detail::RateHelperItem(temp->latestDate(),
priority[i], instrumentHandles[i]));
! } else if (futuresCounter<nFutures &&
! (earliestDate-2-frontContractRollingDays >= evalDate)) {
futuresCounter++;
rhs.push_back(detail::RateHelperItem(temp->latestDate(),
|