frgomes / jquantlib Goto Github PK
View Code? Open in Web Editor NEWJQuantLib is a library for Quantitative Finance written in 100% Java
JQuantLib is a library for Quantitative Finance written in 100% Java
I have a problem with FixedRateBondHelper . The following lines of code are almost the same as the ones at which I am making reference, but adapted for a single bond case. The code breaks with the error
"Exception in thread "main" java.lang.UnsupportedOperationException: Work in progress
at org.jquantlib.QL.validateExperimentalMode(QL.java:391)
at org.jquantlib.termstructures.yieldcurves.FixedRateBondHelper.(FixedRateBondHelper.java:104)".
Furthermore, I have tried the entire code (allowing for multiple bonds) but the exception arises at the same way.
Thanks in advance
Date settlementDate = new Date(14, 5, 2018);
new Settings().setEvaluationDate(settlementDate);
double redemption = 100;
final double zc3mQuote = 0.0096;
final double zc6mQuote = 0.0145;
final double zc1yQuote = 0.0194;
final Quote zc3mRate = new SimpleQuote(zc3mQuote);
final Quote zc6mRate = new SimpleQuote(zc6mQuote);
final Quote zc1yRate = new SimpleQuote(zc1yQuote);
final DayCounter zcBondsDayCounter = new Actual365Fixed();
final int fixingDays = 3;
final int settlementDays = 3;
final Calendar calendar = new Target();
final RateHelper zc3m = new DepositRateHelper(new Handle<Quote>(zc3mRate), new Period(3, TimeUnit.Months),
fixingDays, calendar, BusinessDayConvention.ModifiedFollowing, true, zcBondsDayCounter);
final RateHelper zc6m = new DepositRateHelper(new Handle<Quote>(zc6mRate), new Period(6, TimeUnit.Months),
fixingDays, calendar, BusinessDayConvention.ModifiedFollowing, true, zcBondsDayCounter);
final RateHelper zc1y = new DepositRateHelper(new Handle<Quote>(zc1yRate), new Period(1, TimeUnit.Years),
fixingDays, calendar, BusinessDayConvention.ModifiedFollowing, true, zcBondsDayCounter);
final Date issueDate = new Date(15, Month.March, 2018);
final Date maturity = new Date(15, Month.March, 2020);
final double couponRate = 0.02;
final double marketQuote = 106.21875;
final List<SimpleQuote> quote = new ArrayList<SimpleQuote>();
final List<RelinkableHandle<Quote>> quoteHandle = new ArrayList<RelinkableHandle<Quote>>();
final SimpleQuote sq = new SimpleQuote(marketQuote);
final RelinkableHandle<Quote> handle = new RelinkableHandle<Quote>(sq);
quote.add(sq);
quoteHandle.add(handle);
System.out.println(quoteHandle.get(0));
final Schedule schedule = new Schedule(issueDate, maturity, new Period(Frequency.Semiannual),
new UnitedStates(UnitedStates.Market.GOVERNMENTBOND), BusinessDayConvention.Unadjusted,
BusinessDayConvention.Unadjusted, DateGeneration.Rule.Backward, false);
final FixedRateBondHelper bondHelper = new FixedRateBondHelper(quoteHandle.get(0), settlementDays, 100.0,
schedule, new double[] { couponRate }, new ActualActual(ActualActual.Convention.Bond),
BusinessDayConvention.Unadjusted, redemption, issueDate);
Hello,
Thank you for all the effort that you are making in creating a Java Quantlib library. I'm trying to use your library for options pricing and I don't find any example that could help me!
May you please publish some use cases that could be useful for anyone willing to use your library!
Best regards,
Ramzi Chaaben.
Add comments to this issue as we go along moving issue from Launchpad to GitHub.
The Developer's Guide is completely misleading as it is still pointing to Launchpad.
We can simply remove the Developer's Guide at this point.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.