Hi
I am using Quantlib 0.9.7 for my Application.
And i set the evaluation date to 31 December 2008 for Fixed Rate Bond.
When i print the settlement date , for Window the Settlement Date is fine ..which is January 1st, 2009
But for AIX 64 bit application, the Settlement Date is bit weird...which comes out to be January 24th, 2011.
I guess , its pointing to the current date rather than taking the date which i have set to i.e. 31-December-2008.
Attaching the log file for both the Platforms.
Please guide me regarding this issue. Its having a huge impact on my application.
The code is given below:
cout<<" Fic Mis Date in Initialize Method: "<<this->mMisdate<<endl;
Settings::instance().evaluationDate() = this->mMisdate; try { Handle<YieldTermStructure> discountCurve(boost::shared_ptr<YieldTermStructure>( new ZeroCurve(instrumentInfoObj.vTermstructureDates,instrumentInfoObj.vTermstructureRates,instrumentInfoObj.dayCounter))); boost::shared_ptr<PricingEngine> bondEngine(new DiscountingBondEngine(discountCurve));
Date effectiveDate = instrumentInfoObj.issueDate+instrumentInfoObj.settlementDays;
cout<<" Effective Date "<<effectiveDate<<endl;
cout<<" Issue Date "<<instrumentInfoObj.issueDate<<endl; cout<<" Settlement Days "<<instrumentInfoObj.settlementDays<<endl; cout<<" Maturity Date "<<instrumentInfoObj.maturityDate<<endl; Schedule schedule(effectiveDate,
instrumentInfoObj.maturityDate, (QuantLib::Period)instrumentInfoObj.couponFrequency, instrumentInfoObj.calendar, QuantLib::Following, QuantLib::Following, DateGeneration::Forward, false); cout<<"Account Skey -------> "<<instrumentInfoObj.acctSkey<<" COUPON RATE-------->"<<instrumentInfoObj.couponRate<<endl;
this->mptrFixedRateBond = new FixedRateBond (instrumentInfoObj.settlementDays, 100, schedule, vector<double> (1,instrumentInfoObj.couponRate), instrumentInfoObj.dayCounter, QuantLib::Following, 100, instrumentInfoObj.issueDate); this->mptrFixedRateBond->setPricingEngine(bondEngine);
cout.precision(10); cout<<"NPV "<<this->mptrFixedRateBond->NPV()<<endl; cout<<"Settlement Date:"<<this->mptrFixedRateBond->settlementDate()<<endl; cout<<"Issue Date:"<<this->mptrFixedRateBond->issueDate()<<endl; cout<<"Maturity Date:"<<this->mptrFixedRateBond->maturityDate()<<endl; return ClsUConstants::TASK_SUCCESS;
Regards
Rohit ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
This post was updated on .
Hi..
Even i am also facing the same Issue. The evalaution Date setting even doesn;t work for me. And the NPV for the Instrument arrives to be zero on AIX machine for 64 bit build. I havn't checked for 32 bit. Really looking for the solution.. I am using Quantlib 0.9.7 and even tried with the latest code. Anyone ..who can clarify what this issue is?? Regards Geetika
|
In reply to this post by Rohit Rai
On Sun, 2011-01-23 at 13:35 +0530, Rohit Rai wrote:
> I am using Quantlib 0.9.7 for my Application. > > And i set the evaluation date to 31 December 2008 for Fixed Rate Bond. > When i print the settlement date , for Window the Settlement Date is > fine ..which is January 1st, 2009 > But for AIX 64 bit application, the Settlement Date is bit > weird...which comes out to be January 24th, 2011. > I guess , its pointing to the current date rather than taking the date > which i have set to i.e. 31-December-2008. It looks like a singleton not working. May you try replacing ql/patterns/singleton.hpp with the one I'm attaching, recompile and try again? Let me know if that works, so we can add the patch to next release. Also, is there any compiler define (to be used in a #ifdef) that lets one detect that one's on AIX? Thanks, Luigi -- Within C++, there is a much smaller and cleaner language struggling to get out. -- Bjarne Stroustrup ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users singleton.hpp (3K) Download Attachment |
Hi Luigi Thanks for your reply. I tried with the singleton.hpp file attached in the mail. I took the complete build and pointed to the Application. When i create the FixedRateBond object , the application gets hanged at this point of time, and neither it releases the memory(doesn't comes out of the process) nor it fails eventhough i have enabled the error line , infact all the options at the time of running the configure file. The Compiler flag is set to export CXXFLAGS='-qrtti=all'. Also when i set the Compiler Flag to export CXXFLAGS='-qrtti=all -fvisibility=default -qcheck=all', the Application release memory(process ends) but i don't get any Quantlib exception or error message. default fvisibility flag is Hidden and that is set to default. Reference : http://osdir.com/ml/finance.quantlib.user/2007-11/msg00054.html# qcheck flag is set so as to check the Null Pointer, object bounds and divisibility by zero at run time. Any idea regarding this? Am i missing any compiler option? Please help on this regard Also #ifdef for AIX used is #### Uncomment only one of the flags below #### FICPLATFORM = -DAIX5L -D__UNIX__ # Uncomment for AIX5.2 FICPLATFORM = -DAIX5L -D__UNIX__ -D__AIX52__ // Since i am using AIX5.2 Regards Rohit. From: Luigi Ballabio <[hidden email]> To: Rohit Rai <[hidden email]> Cc: [hidden email] Sent: Tue, 25 January, 2011 4:02:30 PM Subject: Re: Problem setting the evaluation date on AIX for 64 bit application On Sun, 2011-01-23 at 13:35 +0530, Rohit Rai wrote: > I am using Quantlib 0.9.7 for my Application. > > And i set the evaluation date to 31 December 2008 for Fixed Rate Bond. > When i print the settlement date , for Window the Settlement Date is > fine ..which is January 1st, 2009 > But for AIX 64 bit application, the Settlement Date is bit > weird...which comes out to be January 24th, 2011. > I guess , its pointing to the current date rather than taking the date > which i have set to i.e. 31-December-2008. It looks like a singleton not working. May you try replacing ql/patterns/singleton.hpp with the one I'm attaching, recompile and try again? Let me know if that works, so we can add the patch to next release. Also, is there any compiler define (to be used in a #ifdef) that lets one detect that one's on AIX? Thanks, Luigi -- Within C++, there is a much smaller and cleaner language struggling to get out. -- Bjarne Stroustrup ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
In reply to this post by Luigi Ballabio
Hi Luigi
I have also tried with the singleton file posted by you. The appilcation gets stuck in between. Is this the problem due to multiple instance setting for evaluation Date ??? Regards Geetika
|
In reply to this post by Rohit Rai
On Wed, 2011-01-26 at 14:01 +0530, Rohit Rai wrote:
> I tried with the singleton.hpp file attached in the mail. [...] the > application hangs Hmm. May you try the original singleton.hpp with all optimizations off? (it would be -O0 on gcc.) Also, are you running configure with the --enable-sessions or not? Thanks again, Luigi -- Better to remain silent and be thought a fool than to speak out and remove all doubt. -- Abraham Lincoln ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |