You can subscribe to this list here.
| 2000 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(17) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2001 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(23) |
| 2002 |
Jan
(18) |
Feb
(20) |
Mar
(22) |
Apr
(41) |
May
(28) |
Jun
(25) |
Jul
(10) |
Aug
(7) |
Sep
(5) |
Oct
(20) |
Nov
(13) |
Dec
(11) |
| 2003 |
Jan
(28) |
Feb
(5) |
Mar
(6) |
Apr
(5) |
May
(17) |
Jun
(6) |
Jul
(45) |
Aug
(35) |
Sep
(24) |
Oct
(50) |
Nov
(53) |
Dec
(6) |
| 2004 |
Jan
(4) |
Feb
(10) |
Mar
(52) |
Apr
(46) |
May
(8) |
Jun
(25) |
Jul
(12) |
Aug
(6) |
Sep
(8) |
Oct
(8) |
Nov
(9) |
Dec
(7) |
| 2005 |
Jan
(18) |
Feb
(60) |
Mar
(19) |
Apr
(26) |
May
(14) |
Jun
(27) |
Jul
(8) |
Aug
(15) |
Sep
(19) |
Oct
(53) |
Nov
(20) |
Dec
(23) |
| 2006 |
Jan
(16) |
Feb
(27) |
Mar
(33) |
Apr
(51) |
May
(36) |
Jun
(25) |
Jul
(54) |
Aug
(30) |
Sep
(25) |
Oct
(67) |
Nov
(43) |
Dec
(13) |
| 2007 |
Jan
(23) |
Feb
(27) |
Mar
(55) |
Apr
(79) |
May
(60) |
Jun
(66) |
Jul
(46) |
Aug
(30) |
Sep
(90) |
Oct
(49) |
Nov
(85) |
Dec
(74) |
| 2008 |
Jan
(68) |
Feb
(59) |
Mar
(64) |
Apr
(28) |
May
(66) |
Jun
(35) |
Jul
(73) |
Aug
(76) |
Sep
(65) |
Oct
(46) |
Nov
(41) |
Dec
(19) |
| 2009 |
Jan
(46) |
Feb
(90) |
Mar
(51) |
Apr
(104) |
May
(13) |
Jun
(24) |
Jul
(20) |
Aug
(39) |
Sep
(109) |
Oct
(101) |
Nov
(117) |
Dec
(57) |
| 2010 |
Jan
(55) |
Feb
(42) |
Mar
(39) |
Apr
(22) |
May
(33) |
Jun
(41) |
Jul
(25) |
Aug
(52) |
Sep
(75) |
Oct
(60) |
Nov
(62) |
Dec
(52) |
| 2011 |
Jan
(70) |
Feb
(31) |
Mar
(26) |
Apr
(28) |
May
(17) |
Jun
(38) |
Jul
(51) |
Aug
(35) |
Sep
(27) |
Oct
(35) |
Nov
(10) |
Dec
(20) |
| 2012 |
Jan
(21) |
Feb
(29) |
Mar
(13) |
Apr
(37) |
May
(33) |
Jun
(12) |
Jul
(34) |
Aug
(27) |
Sep
(29) |
Oct
(35) |
Nov
(58) |
Dec
(27) |
| 2013 |
Jan
(27) |
Feb
(16) |
Mar
(40) |
Apr
(16) |
May
(34) |
Jun
(37) |
Jul
(6) |
Aug
(3) |
Sep
(4) |
Oct
(49) |
Nov
(13) |
Dec
(12) |
| 2014 |
Jan
(15) |
Feb
(21) |
Mar
(11) |
Apr
(13) |
May
(27) |
Jun
(60) |
Jul
(19) |
Aug
(29) |
Sep
(20) |
Oct
(28) |
Nov
(41) |
Dec
(15) |
| 2015 |
Jan
(33) |
Feb
(29) |
Mar
(26) |
Apr
(17) |
May
(2) |
Jun
(13) |
Jul
(21) |
Aug
(30) |
Sep
(22) |
Oct
(15) |
Nov
(46) |
Dec
(20) |
| 2016 |
Jan
(6) |
Feb
(5) |
Mar
(9) |
Apr
(15) |
May
(9) |
Jun
(4) |
Jul
(3) |
Aug
(4) |
Sep
(39) |
Oct
(8) |
Nov
(5) |
Dec
(8) |
| 2017 |
Jan
(4) |
Feb
(14) |
Mar
(4) |
Apr
(16) |
May
(5) |
Jun
(10) |
Jul
(25) |
Aug
(2) |
Sep
(5) |
Oct
(11) |
Nov
(8) |
Dec
(11) |
| 2018 |
Jan
(7) |
Feb
(4) |
Mar
|
Apr
(1) |
May
(4) |
Jun
(21) |
Jul
(8) |
Aug
(3) |
Sep
(2) |
Oct
(2) |
Nov
(1) |
Dec
|
| 2019 |
Jan
(1) |
Feb
(5) |
Mar
(18) |
Apr
(9) |
May
(5) |
Jun
(21) |
Jul
(25) |
Aug
(25) |
Sep
(4) |
Oct
(2) |
Nov
(2) |
Dec
(5) |
| 2020 |
Jan
|
Feb
|
Mar
(3) |
Apr
|
May
(2) |
Jun
(2) |
Jul
(1) |
Aug
|
Sep
(1) |
Oct
(2) |
Nov
(6) |
Dec
|
| 2021 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
(1) |
May
(4) |
Jun
|
Jul
(1) |
Aug
|
Sep
(2) |
Oct
(9) |
Nov
(1) |
Dec
(5) |
| 2022 |
Jan
(7) |
Feb
(3) |
Mar
|
Apr
(2) |
May
(5) |
Jun
(3) |
Jul
(3) |
Aug
(3) |
Sep
(3) |
Oct
(14) |
Nov
|
Dec
(1) |
| 2023 |
Jan
(10) |
Feb
|
Mar
|
Apr
(2) |
May
|
Jun
(2) |
Jul
(2) |
Aug
(1) |
Sep
|
Oct
(5) |
Nov
|
Dec
|
| 2024 |
Jan
(8) |
Feb
|
Mar
(2) |
Apr
(1) |
May
|
Jun
|
Jul
(4) |
Aug
(5) |
Sep
|
Oct
(4) |
Nov
(1) |
Dec
(1) |
| 2025 |
Jan
(3) |
Feb
(2) |
Mar
(2) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2026 |
Jan
(1) |
Feb
(12) |
Mar
|
Apr
(2) |
May
(8) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: tibbar <tib...@gm...> - 2008-03-08 13:05:22
|
If you could send the code that would be fantastic - I can do some testing to
verify the results.
I think ideally as you say, the convertible class should also provide this
functionality, as it is only showing part of the option value.
Thanks
Allen Kuo wrote:
>
> Tibbar: the QL convertible bond doesn't consider stochastic interest
> rates, just stochastic stock prices. I think the volatility you
> entered below is for the latter, not the former. So I don't think it
> will reduce to a callable bond (where the optionality is a function of
> interest rate volatility). Nice project would be to integrate this
> feature into the convertible bond class- best way, I suppose, is to go
> back to the 2-D Black Scholes. Bloomberg also has a 2-D model. I don't
> think the TF or Ayache models naturally extend to stochastic interest
> rates. Was working on the generic 2-D PDE solver, but I got
> sidetracked with work.
>
> Callable bonds should come out in the next release- I can send you the
> pre-release code if you want.
>
> Luigi: Can I get this email address added to
> qua...@li... ?
>
> GZH
>
>
>
>
>
> On 3/8/08, tibbar <tib...@gm...> wrote:
>>
>> Here's where I've got to.
>>
>> I started with the convertible bond example and:
>>
>> - set conversion ratio to 0.0000001
>> - removed dividends
>> - removed the puttable bit
>> - set my callable terms
>>
>> But, it seems the market value of the callable bond is unaffected by the
>> choice of strike prices... (I tried high and low values).
>>
>> My program is below, I also have some specific questions on syntax:
>>
>> - what is the 1.20 for in:
>> SoftCallability(Callability::Price(
>> callPrices[i],
>>
>> Callability::Price::Clean),
>> schedule.date(callLength[i]),
>> 1.20)));
>>
>> - why do I get time to maturity as 4.00822 in the output, when i set it
>> to
>> 4? If I set it to 3, then the output says 3 exactly...
>>
>> - what is the 1 for in the coupon definition: std::vector<Real>
>> coupons(1,
>> 0.065)? Is this frequency of coupons per annum?
>>
>> I'll be grateful for any feedback.
>>
>> //// CODE SNIPPET/////
>> boost::timer timer;
>> std::cout << std::endl;
>>
>> Option::Type type(Option::Call);
>> Real underlying = 36.0;
>> Real spreadRate = 0.;//0.005;
>>
>> Spread dividendYield = 0.; //0.02;
>> Rate riskFreeRate = 0.05;
>> Volatility volatility = 0.10;
>>
>> Integer settlementDays = 0;
>> Integer length = 4;
>> Real redemption = 100.0;
>> Real conversionRatio = 0.0000001; //redemption/underlying; // at
>> the
>> money
>>
>> // set up dates/schedules
>> Calendar calendar = TARGET();
>> Date today = calendar.adjust(Date::todaysDate());
>>
>> Settings::instance().evaluationDate() = today;
>> Date settlementDate = calendar.advance(today, settlementDays,
>> Days);
>> Date exerciseDate = calendar.advance(settlementDate, length,
>> Years);
>> Date issueDate = calendar.advance(exerciseDate, -length, Years);
>>
>> BusinessDayConvention convention = ModifiedFollowing;
>>
>> Frequency frequency = Annual;
>>
>> Schedule schedule(issueDate, exerciseDate,
>> Period(frequency), calendar,
>> convention, convention,
>> DateGeneration::Backward, false);
>>
>> DividendSchedule dividends;
>> CallabilitySchedule callability;
>>
>> std::vector<Real> coupons(1, 0.065);
>>
>> DayCounter bondDayCount =Actual365Fixed(); // Thirty360();
>>
>> Integer callLength[] = { 1, 2, 3 }; // Call dates, years 2, 4.
>> // Integer putLength[] = { 3 }; // Put dates year 3
>>
>> // these need to be less than npv of redemption and future
>> coupons at 5%
>> to bite!
>> Real callPrices[] = { 140.0, 190.0, 102.0 };
>> // Real putPrices[]= { 105.0 };
>>
>> // Load call schedules
>> for (Size i=0; i<LENGTH(callLength); i++) {
>> callability.push_back(
>> boost::shared_ptr<Callability>(
>> new SoftCallability(Callability::Price(
>> callPrices[i],
>>
>> Callability::Price::Clean),
>> schedule.date(callLength[i]),
>> 1.20)));
>> }
>>
>> /* for (Size j=0; j<LENGTH(putLength); j++) {
>> callability.push_back(
>> boost::shared_ptr<Callability>(
>> new Callability(Callability::Price(
>> putPrices[j],
>>
>> Callability::Price::Clean),
>> Callability::Put,
>> schedule.date(putLength[j]))));
>> }
>> */
>>
>> DayCounter dayCounter = Actual365Fixed();
>> Time maturity = dayCounter.yearFraction(settlementDate,
>> exerciseDate);
>>
>> std::cout << "option type = " << type << std::endl;
>> std::cout << "Time to maturity = " << maturity
>> << std::endl;
>> std::cout << "Underlying price = " << underlying
>> << std::endl;
>> std::cout << "Risk-free interest rate = " <<
>> io::rate(riskFreeRate)
>> << std::endl;
>> std::cout << "Dividend yield = " << io::rate(dividendYield)
>> << std::endl;
>> std::cout << "Volatility = " << io::volatility(volatility)
>> << std::endl;
>> std::cout << std::endl;
>>
>> std::string method;
>> std::cout << std::endl ;
>>
>> // write column headings
>> Size widths[] = { 35, 14, 14 };
>> Size totalWidth = widths[0] + widths[1] + widths[2];
>> std::string rule(totalWidth, '-'), dblrule(totalWidth, '=');
>>
>> std::cout << dblrule << std::endl;
>> std::cout << "Tsiveriotis-Fernandes method" << std::endl;
>> std::cout << dblrule << std::endl;
>> std::cout << std::setw(widths[0]) << std::left << "Tree type"
>> << std::setw(widths[1]) << std::left << "European"
>> << std::setw(widths[1]) << std::left << "American"
>> << std::endl;
>> std::cout << rule << std::endl;
>>
>> boost::shared_ptr<Exercise> exercise(
>> new
>> EuropeanExercise(exerciseDate));
>> boost::shared_ptr<Exercise> amExercise(
>> new
>> AmericanExercise(settlementDate,
>>
>> exerciseDate));
>>
>> Handle underlyingH(
>> boost::shared_ptr(new SimpleQuote(underlying)));
>>
>> Handle<YieldTermStructure> flatTermStructure(
>> boost::shared_ptr<YieldTermStructure>(
>> new FlatForward(settlementDate, riskFreeRate,
>> dayCounter)));
>>
>> Handle<YieldTermStructure> flatDividendTS(
>> boost::shared_ptr<YieldTermStructure>(
>> new FlatForward(settlementDate, dividendYield,
>> dayCounter)));
>>
>> Handle<BlackVolTermStructure> flatVolTS(
>> boost::shared_ptr<BlackVolTermStructure>(
>> new BlackConstantVol(settlementDate, calendar,
>> volatility, dayCounter)));
>>
>>
>> boost::shared_ptr<BlackScholesMertonProcess> stochasticProcess(
>> new BlackScholesMertonProcess(underlyingH,
>>
>> flatDividendTS,
>>
>> flatTermStructure,
>> flatVolTS));
>>
>> Size timeSteps = 801;
>>
>> Handle creditSpread(
>> boost::shared_ptr(new SimpleQuote(spreadRate)));
>>
>> boost::shared_ptr rate(new SimpleQuote(riskFreeRate));
>>
>> Handle<YieldTermStructure> discountCurve(
>> boost::shared_ptr<YieldTermStructure>(
>> new FlatForward(today, Handle(rate), dayCounter)));
>>
>> boost::shared_ptr<PricingEngine> engine(
>> new
>> BinomialConvertibleEngine<JarrowRudd>(stochasticProcess,
>> timeSteps));
>>
>> ConvertibleFixedCouponBond europeanBond(
>> exercise, conversionRatio, dividends,
>> callability,
>> creditSpread, issueDate, settlementDays,
>> coupons, bondDayCount, schedule, redemption);
>> europeanBond.setPricingEngine(engine);
>>
>> ConvertibleFixedCouponBond americanBond(
>> amExercise, conversionRatio, dividends,
>> callability,
>> creditSpread, issueDate, settlementDays,
>> coupons, bondDayCount, schedule, redemption);
>> americanBond.setPricingEngine(engine);
>>
>> method = "Jarrow-Rudd";
>> europeanBond.setPricingEngine(boost::shared_ptr<PricingEngine>(
>> new
>> BinomialConvertibleEngine<JarrowRudd>(stochasticProcess,
>> timeSteps)));
>> americanBond.setPricingEngine(boost::shared_ptr<PricingEngine>(
>> new
>> BinomialConvertibleEngine<JarrowRudd>(stochasticProcess,
>> timeSteps)));
>> std::cout << std::setw(widths[0]) << std::left << method
>> << std::fixed
>> << std::setw(widths[1]) << std::left <<
>> europeanBond.NPV()
>> << std::setw(widths[2]) << std::left <<
>> americanBond.NPV()
>> << std::endl;
>>
>>
>>
>>
>> tibbar wrote:
>> >
>> > Could anyone give me some ideas of how to price callable bonds in
>> > quantlib?
>> >
>> > Bond features are:
>> >
>> > - initial deferred period where the bond is not callable
>> > - seperate strike price for exercise in each remaining year of the
>> bond's
>> > life.
>> >
>> > I've seen some discussions that the convertible bond class should be
>> used,
>> > but as a newbee I'm a little intimidated by the quantlib terminology.
>> >
>> > What I'd really need to know is what changes to make to the standard
>> > convertible sample code:
>> >
>> > http://quantlib.org/reference/_convertible_bonds_8cpp-example.html
>> >
>> > Many thanks.
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/callable-bonds-tp15903645p15910210.html
>> Sent from the quantlib-dev mailing list archive at Nabble.com.
>>
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> QuantLib-dev mailing list
>> Qua...@li...
>> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
>>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> QuantLib-dev mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
>
>
--
View this message in context: http://www.nabble.com/callable-bonds-tp15903645p15912878.html
Sent from the quantlib-dev mailing list archive at Nabble.com.
|
|
From: tibbar <tib...@gm...> - 2008-03-08 09:45:27
|
If you could send the code that would be fantastic - I can do some testing to
verify the results.
I think ideally as you say, the convertible class should also provide this
functionality, as it is only showing part of the option value.
Thanks
Allen Kuo wrote:
>
> Tibbar: the QL convertible bond doesn't consider stochastic interest
> rates, just stochastic stock prices. I think the volatility you
> entered below is for the latter, not the former. So I don't think it
> will reduce to a callable bond (where the optionality is a function of
> interest rate volatility). Nice project would be to integrate this
> feature into the convertible bond class- best way, I suppose, is to go
> back to the 2-D Black Scholes. Bloomberg also has a 2-D model. I don't
> think the TF or Ayache models naturally extend to stochastic interest
> rates. Was working on the generic 2-D PDE solver, but I got
> sidetracked with work.
>
> Callable bonds should come out in the next release- I can send you the
> pre-release code if you want.
>
> Luigi: Can I get this email address added to
> qua...@li... ?
>
> GZH
>
>
>
>
>
> On 3/8/08, tibbar <tib...@gm...> wrote:
>>
>> Here's where I've got to.
>>
>> I started with the convertible bond example and:
>>
>> - set conversion ratio to 0.0000001
>> - removed dividends
>> - removed the puttable bit
>> - set my callable terms
>>
>> But, it seems the market value of the callable bond is unaffected by the
>> choice of strike prices... (I tried high and low values).
>>
>> My program is below, I also have some specific questions on syntax:
>>
>> - what is the 1.20 for in:
>> SoftCallability(Callability::Price(
>> callPrices[i],
>>
>> Callability::Price::Clean),
>> schedule.date(callLength[i]),
>> 1.20)));
>>
>> - why do I get time to maturity as 4.00822 in the output, when i set it
>> to
>> 4? If I set it to 3, then the output says 3 exactly...
>>
>> - what is the 1 for in the coupon definition: std::vector<Real>
>> coupons(1,
>> 0.065)? Is this frequency of coupons per annum?
>>
>> I'll be grateful for any feedback.
>>
>> //// CODE SNIPPET/////
>> boost::timer timer;
>> std::cout << std::endl;
>>
>> Option::Type type(Option::Call);
>> Real underlying = 36.0;
>> Real spreadRate = 0.;//0.005;
>>
>> Spread dividendYield = 0.; //0.02;
>> Rate riskFreeRate = 0.05;
>> Volatility volatility = 0.10;
>>
>> Integer settlementDays = 0;
>> Integer length = 4;
>> Real redemption = 100.0;
>> Real conversionRatio = 0.0000001; //redemption/underlying; // at
>> the
>> money
>>
>> // set up dates/schedules
>> Calendar calendar = TARGET();
>> Date today = calendar.adjust(Date::todaysDate());
>>
>> Settings::instance().evaluationDate() = today;
>> Date settlementDate = calendar.advance(today, settlementDays,
>> Days);
>> Date exerciseDate = calendar.advance(settlementDate, length,
>> Years);
>> Date issueDate = calendar.advance(exerciseDate, -length, Years);
>>
>> BusinessDayConvention convention = ModifiedFollowing;
>>
>> Frequency frequency = Annual;
>>
>> Schedule schedule(issueDate, exerciseDate,
>> Period(frequency), calendar,
>> convention, convention,
>> DateGeneration::Backward, false);
>>
>> DividendSchedule dividends;
>> CallabilitySchedule callability;
>>
>> std::vector<Real> coupons(1, 0.065);
>>
>> DayCounter bondDayCount =Actual365Fixed(); // Thirty360();
>>
>> Integer callLength[] = { 1, 2, 3 }; // Call dates, years 2, 4.
>> // Integer putLength[] = { 3 }; // Put dates year 3
>>
>> // these need to be less than npv of redemption and future
>> coupons at 5%
>> to bite!
>> Real callPrices[] = { 140.0, 190.0, 102.0 };
>> // Real putPrices[]= { 105.0 };
>>
>> // Load call schedules
>> for (Size i=0; i<LENGTH(callLength); i++) {
>> callability.push_back(
>> boost::shared_ptr<Callability>(
>> new SoftCallability(Callability::Price(
>> callPrices[i],
>>
>> Callability::Price::Clean),
>> schedule.date(callLength[i]),
>> 1.20)));
>> }
>>
>> /* for (Size j=0; j<LENGTH(putLength); j++) {
>> callability.push_back(
>> boost::shared_ptr<Callability>(
>> new Callability(Callability::Price(
>> putPrices[j],
>>
>> Callability::Price::Clean),
>> Callability::Put,
>> schedule.date(putLength[j]))));
>> }
>> */
>>
>> DayCounter dayCounter = Actual365Fixed();
>> Time maturity = dayCounter.yearFraction(settlementDate,
>> exerciseDate);
>>
>> std::cout << "option type = " << type << std::endl;
>> std::cout << "Time to maturity = " << maturity
>> << std::endl;
>> std::cout << "Underlying price = " << underlying
>> << std::endl;
>> std::cout << "Risk-free interest rate = " <<
>> io::rate(riskFreeRate)
>> << std::endl;
>> std::cout << "Dividend yield = " << io::rate(dividendYield)
>> << std::endl;
>> std::cout << "Volatility = " << io::volatility(volatility)
>> << std::endl;
>> std::cout << std::endl;
>>
>> std::string method;
>> std::cout << std::endl ;
>>
>> // write column headings
>> Size widths[] = { 35, 14, 14 };
>> Size totalWidth = widths[0] + widths[1] + widths[2];
>> std::string rule(totalWidth, '-'), dblrule(totalWidth, '=');
>>
>> std::cout << dblrule << std::endl;
>> std::cout << "Tsiveriotis-Fernandes method" << std::endl;
>> std::cout << dblrule << std::endl;
>> std::cout << std::setw(widths[0]) << std::left << "Tree type"
>> << std::setw(widths[1]) << std::left << "European"
>> << std::setw(widths[1]) << std::left << "American"
>> << std::endl;
>> std::cout << rule << std::endl;
>>
>> boost::shared_ptr<Exercise> exercise(
>> new
>> EuropeanExercise(exerciseDate));
>> boost::shared_ptr<Exercise> amExercise(
>> new
>> AmericanExercise(settlementDate,
>>
>> exerciseDate));
>>
>> Handle underlyingH(
>> boost::shared_ptr(new SimpleQuote(underlying)));
>>
>> Handle<YieldTermStructure> flatTermStructure(
>> boost::shared_ptr<YieldTermStructure>(
>> new FlatForward(settlementDate, riskFreeRate,
>> dayCounter)));
>>
>> Handle<YieldTermStructure> flatDividendTS(
>> boost::shared_ptr<YieldTermStructure>(
>> new FlatForward(settlementDate, dividendYield,
>> dayCounter)));
>>
>> Handle<BlackVolTermStructure> flatVolTS(
>> boost::shared_ptr<BlackVolTermStructure>(
>> new BlackConstantVol(settlementDate, calendar,
>> volatility, dayCounter)));
>>
>>
>> boost::shared_ptr<BlackScholesMertonProcess> stochasticProcess(
>> new BlackScholesMertonProcess(underlyingH,
>>
>> flatDividendTS,
>>
>> flatTermStructure,
>> flatVolTS));
>>
>> Size timeSteps = 801;
>>
>> Handle creditSpread(
>> boost::shared_ptr(new SimpleQuote(spreadRate)));
>>
>> boost::shared_ptr rate(new SimpleQuote(riskFreeRate));
>>
>> Handle<YieldTermStructure> discountCurve(
>> boost::shared_ptr<YieldTermStructure>(
>> new FlatForward(today, Handle(rate), dayCounter)));
>>
>> boost::shared_ptr<PricingEngine> engine(
>> new
>> BinomialConvertibleEngine<JarrowRudd>(stochasticProcess,
>> timeSteps));
>>
>> ConvertibleFixedCouponBond europeanBond(
>> exercise, conversionRatio, dividends,
>> callability,
>> creditSpread, issueDate, settlementDays,
>> coupons, bondDayCount, schedule, redemption);
>> europeanBond.setPricingEngine(engine);
>>
>> ConvertibleFixedCouponBond americanBond(
>> amExercise, conversionRatio, dividends,
>> callability,
>> creditSpread, issueDate, settlementDays,
>> coupons, bondDayCount, schedule, redemption);
>> americanBond.setPricingEngine(engine);
>>
>> method = "Jarrow-Rudd";
>> europeanBond.setPricingEngine(boost::shared_ptr<PricingEngine>(
>> new
>> BinomialConvertibleEngine<JarrowRudd>(stochasticProcess,
>> timeSteps)));
>> americanBond.setPricingEngine(boost::shared_ptr<PricingEngine>(
>> new
>> BinomialConvertibleEngine<JarrowRudd>(stochasticProcess,
>> timeSteps)));
>> std::cout << std::setw(widths[0]) << std::left << method
>> << std::fixed
>> << std::setw(widths[1]) << std::left <<
>> europeanBond.NPV()
>> << std::setw(widths[2]) << std::left <<
>> americanBond.NPV()
>> << std::endl;
>>
>>
>>
>>
>> tibbar wrote:
>> >
>> > Could anyone give me some ideas of how to price callable bonds in
>> > quantlib?
>> >
>> > Bond features are:
>> >
>> > - initial deferred period where the bond is not callable
>> > - seperate strike price for exercise in each remaining year of the
>> bond's
>> > life.
>> >
>> > I've seen some discussions that the convertible bond class should be
>> used,
>> > but as a newbee I'm a little intimidated by the quantlib terminology.
>> >
>> > What I'd really need to know is what changes to make to the standard
>> > convertible sample code:
>> >
>> > http://quantlib.org/reference/_convertible_bonds_8cpp-example.html
>> >
>> > Many thanks.
>> >
>>
>> --
>> View this message in context:
>> http://www.nabble.com/callable-bonds-tp15903645p15910210.html
>> Sent from the quantlib-dev mailing list archive at Nabble.com.
>>
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by: Microsoft
>> Defy all challenges. Microsoft(R) Visual Studio 2008.
>> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
>> _______________________________________________
>> QuantLib-dev mailing list
>> Qua...@li...
>> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
>>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> QuantLib-dev mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
>
>
--
View this message in context: http://www.nabble.com/callable-bonds-tp15903645p15912808.html
Sent from the quantlib-dev mailing list archive at Nabble.com.
|
|
From: Zhonghua G. <zho...@gm...> - 2008-03-08 02:12:21
|
Tibbar: the QL convertible bond doesn't consider stochastic interest
rates, just stochastic stock prices. I think the volatility you
entered below is for the latter, not the former. So I don't think it
will reduce to a callable bond (where the optionality is a function of
interest rate volatility). Nice project would be to integrate this
feature into the convertible bond class- best way, I suppose, is to go
back to the 2-D Black Scholes. Bloomberg also has a 2-D model. I don't
think the TF or Ayache models naturally extend to stochastic interest
rates. Was working on the generic 2-D PDE solver, but I got
sidetracked with work.
Callable bonds should come out in the next release- I can send you the
pre-release code if you want.
Luigi: Can I get this email address added to
qua...@li... ?
GZH
On 3/8/08, tibbar <tib...@gm...> wrote:
>
> Here's where I've got to.
>
> I started with the convertible bond example and:
>
> - set conversion ratio to 0.0000001
> - removed dividends
> - removed the puttable bit
> - set my callable terms
>
> But, it seems the market value of the callable bond is unaffected by the
> choice of strike prices... (I tried high and low values).
>
> My program is below, I also have some specific questions on syntax:
>
> - what is the 1.20 for in:
> SoftCallability(Callability::Price(
> callPrices[i],
>
> Callability::Price::Clean),
> schedule.date(callLength[i]),
> 1.20)));
>
> - why do I get time to maturity as 4.00822 in the output, when i set it to
> 4? If I set it to 3, then the output says 3 exactly...
>
> - what is the 1 for in the coupon definition: std::vector<Real> coupons(1,
> 0.065)? Is this frequency of coupons per annum?
>
> I'll be grateful for any feedback.
>
> //// CODE SNIPPET/////
> boost::timer timer;
> std::cout << std::endl;
>
> Option::Type type(Option::Call);
> Real underlying = 36.0;
> Real spreadRate = 0.;//0.005;
>
> Spread dividendYield = 0.; //0.02;
> Rate riskFreeRate = 0.05;
> Volatility volatility = 0.10;
>
> Integer settlementDays = 0;
> Integer length = 4;
> Real redemption = 100.0;
> Real conversionRatio = 0.0000001; //redemption/underlying; // at the
> money
>
> // set up dates/schedules
> Calendar calendar = TARGET();
> Date today = calendar.adjust(Date::todaysDate());
>
> Settings::instance().evaluationDate() = today;
> Date settlementDate = calendar.advance(today, settlementDays, Days);
> Date exerciseDate = calendar.advance(settlementDate, length, Years);
> Date issueDate = calendar.advance(exerciseDate, -length, Years);
>
> BusinessDayConvention convention = ModifiedFollowing;
>
> Frequency frequency = Annual;
>
> Schedule schedule(issueDate, exerciseDate,
> Period(frequency), calendar,
> convention, convention,
> DateGeneration::Backward, false);
>
> DividendSchedule dividends;
> CallabilitySchedule callability;
>
> std::vector<Real> coupons(1, 0.065);
>
> DayCounter bondDayCount =Actual365Fixed(); // Thirty360();
>
> Integer callLength[] = { 1, 2, 3 }; // Call dates, years 2, 4.
> // Integer putLength[] = { 3 }; // Put dates year 3
>
> // these need to be less than npv of redemption and future coupons at 5%
> to bite!
> Real callPrices[] = { 140.0, 190.0, 102.0 };
> // Real putPrices[]= { 105.0 };
>
> // Load call schedules
> for (Size i=0; i<LENGTH(callLength); i++) {
> callability.push_back(
> boost::shared_ptr<Callability>(
> new SoftCallability(Callability::Price(
> callPrices[i],
>
> Callability::Price::Clean),
> schedule.date(callLength[i]),
> 1.20)));
> }
>
> /* for (Size j=0; j<LENGTH(putLength); j++) {
> callability.push_back(
> boost::shared_ptr<Callability>(
> new Callability(Callability::Price(
> putPrices[j],
>
> Callability::Price::Clean),
> Callability::Put,
> schedule.date(putLength[j]))));
> }
> */
>
> DayCounter dayCounter = Actual365Fixed();
> Time maturity = dayCounter.yearFraction(settlementDate,
> exerciseDate);
>
> std::cout << "option type = " << type << std::endl;
> std::cout << "Time to maturity = " << maturity
> << std::endl;
> std::cout << "Underlying price = " << underlying
> << std::endl;
> std::cout << "Risk-free interest rate = " << io::rate(riskFreeRate)
> << std::endl;
> std::cout << "Dividend yield = " << io::rate(dividendYield)
> << std::endl;
> std::cout << "Volatility = " << io::volatility(volatility)
> << std::endl;
> std::cout << std::endl;
>
> std::string method;
> std::cout << std::endl ;
>
> // write column headings
> Size widths[] = { 35, 14, 14 };
> Size totalWidth = widths[0] + widths[1] + widths[2];
> std::string rule(totalWidth, '-'), dblrule(totalWidth, '=');
>
> std::cout << dblrule << std::endl;
> std::cout << "Tsiveriotis-Fernandes method" << std::endl;
> std::cout << dblrule << std::endl;
> std::cout << std::setw(widths[0]) << std::left << "Tree type"
> << std::setw(widths[1]) << std::left << "European"
> << std::setw(widths[1]) << std::left << "American"
> << std::endl;
> std::cout << rule << std::endl;
>
> boost::shared_ptr<Exercise> exercise(
> new
> EuropeanExercise(exerciseDate));
> boost::shared_ptr<Exercise> amExercise(
> new
> AmericanExercise(settlementDate,
>
> exerciseDate));
>
> Handle underlyingH(
> boost::shared_ptr(new SimpleQuote(underlying)));
>
> Handle<YieldTermStructure> flatTermStructure(
> boost::shared_ptr<YieldTermStructure>(
> new FlatForward(settlementDate, riskFreeRate, dayCounter)));
>
> Handle<YieldTermStructure> flatDividendTS(
> boost::shared_ptr<YieldTermStructure>(
> new FlatForward(settlementDate, dividendYield,
> dayCounter)));
>
> Handle<BlackVolTermStructure> flatVolTS(
> boost::shared_ptr<BlackVolTermStructure>(
> new BlackConstantVol(settlementDate, calendar,
> volatility, dayCounter)));
>
>
> boost::shared_ptr<BlackScholesMertonProcess> stochasticProcess(
> new BlackScholesMertonProcess(underlyingH,
> flatDividendTS,
>
> flatTermStructure,
> flatVolTS));
>
> Size timeSteps = 801;
>
> Handle creditSpread(
> boost::shared_ptr(new SimpleQuote(spreadRate)));
>
> boost::shared_ptr rate(new SimpleQuote(riskFreeRate));
>
> Handle<YieldTermStructure> discountCurve(
> boost::shared_ptr<YieldTermStructure>(
> new FlatForward(today, Handle(rate), dayCounter)));
>
> boost::shared_ptr<PricingEngine> engine(
> new
> BinomialConvertibleEngine<JarrowRudd>(stochasticProcess,
> timeSteps));
>
> ConvertibleFixedCouponBond europeanBond(
> exercise, conversionRatio, dividends,
> callability,
> creditSpread, issueDate, settlementDays,
> coupons, bondDayCount, schedule, redemption);
> europeanBond.setPricingEngine(engine);
>
> ConvertibleFixedCouponBond americanBond(
> amExercise, conversionRatio, dividends,
> callability,
> creditSpread, issueDate, settlementDays,
> coupons, bondDayCount, schedule, redemption);
> americanBond.setPricingEngine(engine);
>
> method = "Jarrow-Rudd";
> europeanBond.setPricingEngine(boost::shared_ptr<PricingEngine>(
> new
> BinomialConvertibleEngine<JarrowRudd>(stochasticProcess,
> timeSteps)));
> americanBond.setPricingEngine(boost::shared_ptr<PricingEngine>(
> new
> BinomialConvertibleEngine<JarrowRudd>(stochasticProcess,
> timeSteps)));
> std::cout << std::setw(widths[0]) << std::left << method
> << std::fixed
> << std::setw(widths[1]) << std::left << europeanBond.NPV()
> << std::setw(widths[2]) << std::left << americanBond.NPV()
> << std::endl;
>
>
>
>
> tibbar wrote:
> >
> > Could anyone give me some ideas of how to price callable bonds in
> > quantlib?
> >
> > Bond features are:
> >
> > - initial deferred period where the bond is not callable
> > - seperate strike price for exercise in each remaining year of the bond's
> > life.
> >
> > I've seen some discussions that the convertible bond class should be used,
> > but as a newbee I'm a little intimidated by the quantlib terminology.
> >
> > What I'd really need to know is what changes to make to the standard
> > convertible sample code:
> >
> > http://quantlib.org/reference/_convertible_bonds_8cpp-example.html
> >
> > Many thanks.
> >
>
> --
> View this message in context: http://www.nabble.com/callable-bonds-tp15903645p15910210.html
> Sent from the quantlib-dev mailing list archive at Nabble.com.
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> QuantLib-dev mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
>
|
|
From: tibbar <tib...@gm...> - 2008-03-08 01:54:42
|
Here's where I've got to.
I started with the convertible bond example and:
- set conversion ratio to 0.0000001
- removed dividends
- removed the puttable bit
- set my callable terms
But, it seems the market value of the callable bond is unaffected by the
choice of strike prices... (I tried high and low values).
My program is below, I also have some specific questions on syntax:
- what is the 1.20 for in:
SoftCallability(Callability::Price(
callPrices[i],
Callability::Price::Clean),
schedule.date(callLength[i]),
1.20)));
- why do I get time to maturity as 4.00822 in the output, when i set it to
4? If I set it to 3, then the output says 3 exactly...
- what is the 1 for in the coupon definition: std::vector<Real> coupons(1,
0.065)? Is this frequency of coupons per annum?
I'll be grateful for any feedback.
//// CODE SNIPPET/////
boost::timer timer;
std::cout << std::endl;
Option::Type type(Option::Call);
Real underlying = 36.0;
Real spreadRate = 0.;//0.005;
Spread dividendYield = 0.; //0.02;
Rate riskFreeRate = 0.05;
Volatility volatility = 0.10;
Integer settlementDays = 0;
Integer length = 4;
Real redemption = 100.0;
Real conversionRatio = 0.0000001; //redemption/underlying; // at the
money
// set up dates/schedules
Calendar calendar = TARGET();
Date today = calendar.adjust(Date::todaysDate());
Settings::instance().evaluationDate() = today;
Date settlementDate = calendar.advance(today, settlementDays, Days);
Date exerciseDate = calendar.advance(settlementDate, length, Years);
Date issueDate = calendar.advance(exerciseDate, -length, Years);
BusinessDayConvention convention = ModifiedFollowing;
Frequency frequency = Annual;
Schedule schedule(issueDate, exerciseDate,
Period(frequency), calendar,
convention, convention,
DateGeneration::Backward, false);
DividendSchedule dividends;
CallabilitySchedule callability;
std::vector<Real> coupons(1, 0.065);
DayCounter bondDayCount =Actual365Fixed(); // Thirty360();
Integer callLength[] = { 1, 2, 3 }; // Call dates, years 2, 4.
// Integer putLength[] = { 3 }; // Put dates year 3
// these need to be less than npv of redemption and future coupons at 5%
to bite!
Real callPrices[] = { 140.0, 190.0, 102.0 };
// Real putPrices[]= { 105.0 };
// Load call schedules
for (Size i=0; i<LENGTH(callLength); i++) {
callability.push_back(
boost::shared_ptr<Callability>(
new SoftCallability(Callability::Price(
callPrices[i],
Callability::Price::Clean),
schedule.date(callLength[i]),
1.20)));
}
/* for (Size j=0; j<LENGTH(putLength); j++) {
callability.push_back(
boost::shared_ptr<Callability>(
new Callability(Callability::Price(
putPrices[j],
Callability::Price::Clean),
Callability::Put,
schedule.date(putLength[j]))));
}
*/
DayCounter dayCounter = Actual365Fixed();
Time maturity = dayCounter.yearFraction(settlementDate,
exerciseDate);
std::cout << "option type = " << type << std::endl;
std::cout << "Time to maturity = " << maturity
<< std::endl;
std::cout << "Underlying price = " << underlying
<< std::endl;
std::cout << "Risk-free interest rate = " << io::rate(riskFreeRate)
<< std::endl;
std::cout << "Dividend yield = " << io::rate(dividendYield)
<< std::endl;
std::cout << "Volatility = " << io::volatility(volatility)
<< std::endl;
std::cout << std::endl;
std::string method;
std::cout << std::endl ;
// write column headings
Size widths[] = { 35, 14, 14 };
Size totalWidth = widths[0] + widths[1] + widths[2];
std::string rule(totalWidth, '-'), dblrule(totalWidth, '=');
std::cout << dblrule << std::endl;
std::cout << "Tsiveriotis-Fernandes method" << std::endl;
std::cout << dblrule << std::endl;
std::cout << std::setw(widths[0]) << std::left << "Tree type"
<< std::setw(widths[1]) << std::left << "European"
<< std::setw(widths[1]) << std::left << "American"
<< std::endl;
std::cout << rule << std::endl;
boost::shared_ptr<Exercise> exercise(
new
EuropeanExercise(exerciseDate));
boost::shared_ptr<Exercise> amExercise(
new
AmericanExercise(settlementDate,
exerciseDate));
Handle underlyingH(
boost::shared_ptr(new SimpleQuote(underlying)));
Handle<YieldTermStructure> flatTermStructure(
boost::shared_ptr<YieldTermStructure>(
new FlatForward(settlementDate, riskFreeRate, dayCounter)));
Handle<YieldTermStructure> flatDividendTS(
boost::shared_ptr<YieldTermStructure>(
new FlatForward(settlementDate, dividendYield,
dayCounter)));
Handle<BlackVolTermStructure> flatVolTS(
boost::shared_ptr<BlackVolTermStructure>(
new BlackConstantVol(settlementDate, calendar,
volatility, dayCounter)));
boost::shared_ptr<BlackScholesMertonProcess> stochasticProcess(
new BlackScholesMertonProcess(underlyingH,
flatDividendTS,
flatTermStructure,
flatVolTS));
Size timeSteps = 801;
Handle creditSpread(
boost::shared_ptr(new SimpleQuote(spreadRate)));
boost::shared_ptr rate(new SimpleQuote(riskFreeRate));
Handle<YieldTermStructure> discountCurve(
boost::shared_ptr<YieldTermStructure>(
new FlatForward(today, Handle(rate), dayCounter)));
boost::shared_ptr<PricingEngine> engine(
new
BinomialConvertibleEngine<JarrowRudd>(stochasticProcess,
timeSteps));
ConvertibleFixedCouponBond europeanBond(
exercise, conversionRatio, dividends,
callability,
creditSpread, issueDate, settlementDays,
coupons, bondDayCount, schedule, redemption);
europeanBond.setPricingEngine(engine);
ConvertibleFixedCouponBond americanBond(
amExercise, conversionRatio, dividends,
callability,
creditSpread, issueDate, settlementDays,
coupons, bondDayCount, schedule, redemption);
americanBond.setPricingEngine(engine);
method = "Jarrow-Rudd";
europeanBond.setPricingEngine(boost::shared_ptr<PricingEngine>(
new
BinomialConvertibleEngine<JarrowRudd>(stochasticProcess,
timeSteps)));
americanBond.setPricingEngine(boost::shared_ptr<PricingEngine>(
new
BinomialConvertibleEngine<JarrowRudd>(stochasticProcess,
timeSteps)));
std::cout << std::setw(widths[0]) << std::left << method
<< std::fixed
<< std::setw(widths[1]) << std::left << europeanBond.NPV()
<< std::setw(widths[2]) << std::left << americanBond.NPV()
<< std::endl;
tibbar wrote:
>
> Could anyone give me some ideas of how to price callable bonds in
> quantlib?
>
> Bond features are:
>
> - initial deferred period where the bond is not callable
> - seperate strike price for exercise in each remaining year of the bond's
> life.
>
> I've seen some discussions that the convertible bond class should be used,
> but as a newbee I'm a little intimidated by the quantlib terminology.
>
> What I'd really need to know is what changes to make to the standard
> convertible sample code:
>
> http://quantlib.org/reference/_convertible_bonds_8cpp-example.html
>
> Many thanks.
>
--
View this message in context: http://www.nabble.com/callable-bonds-tp15903645p15910210.html
Sent from the quantlib-dev mailing list archive at Nabble.com.
|
|
From: SourceForge.net <no...@so...> - 2008-03-07 20:44:25
|
Bugs item #1909433, was opened at 2008-03-07 11:27 Message generated for change (Comment added) made by lballabio You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112740&aid=1909433&group_id=12740 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None >Status: Closed >Resolution: Fixed Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) >Assigned to: Ferdinando Ametrano (nando) Summary: blackcapfloorengine.cpp Initial Comment: Hi, in blackcapfloorengine.cpp when the type is Collar the optionletsPrice is not updated correctly (at all in fact). Since the collar is long a cap and short a floor the optionletsPrice should have the floor subtracted as the value does. I.e. a line needs adding after 131 as: optionletsPrice.back() -= temp; Best regards, Chris Kenyon chr...@ya... ---------------------------------------------------------------------- Comment By: Luigi Ballabio (lballabio) Date: 2008-03-07 21:44 Message: Logged In: YES user_id=75450 Originator: NO The bug is now fixed in CVS. Thank you for the report. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112740&aid=1909433&group_id=12740 |
|
From: tibbar <tib...@gm...> - 2008-03-07 19:56:34
|
Could anyone give me some ideas of how to price callable bonds in quantlib? Bond features are: - initial deferred period where the bond is not callable - seperate strike price for exercise in each remaining year of the bond's life. I've seen some discussions that the convertible bond class should be used, but as a newbee I'm a little intimidated by the quantlib terminology. What I'd really need to know is what changes to make to the standard convertible sample code: http://quantlib.org/reference/_convertible_bonds_8cpp-example.html Many thanks. -- View this message in context: http://www.nabble.com/callable-bonds-tp15903645p15903645.html Sent from the quantlib-dev mailing list archive at Nabble.com. |
|
From: Eric E. <eri...@na...> - 2008-03-07 17:49:55
|
Hello, Please do an svn update and try again. Thanks, Eric On Fri, March 7, 2008 5:40 pm, \"\" wrote: > Hi all, > I am trying to build QuantLibXLStatic based SVN revision 14548. I would > really appreciate your help in resolving this problem. > Thanks a lot in advance! My environment is WinXP VC7. The following are > the > error messages: > > > > ------ Build started: Project: QuantLibXLStatic, Configuration: Release > Win32 ------ > > Compiling... > addin.cpp > register\addin.cpp(102) : error C3861: 'registerOhFunctions': identifier > not > found, even with argument-dependent lookup > register\addin.cpp(140) : error C3861: 'unregisterOhFunctions': identifier > not found, even with argument-dependent lookup > > Build log was saved at > "file://f:\QuantStudioSVN\QuantLibXL\qlxl\buildStatic\vc71\Release\BuildLog.htm" > QuantLibXLStatic - 2 error(s), 0 warning(s) > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/_______________________________________________ > QuantLib-dev mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-dev > |
|
From: \\ <lao...@gm...> - 2008-03-07 17:40:51
|
Hi all, I am trying to build QuantLibXLStatic based SVN revision 14548. I would really appreciate your help in resolving this problem. Thanks a lot in advance! My environment is WinXP VC7. The following are the error messages: ------ Build started: Project: QuantLibXLStatic, Configuration: Release Win32 ------ Compiling... addin.cpp register\addin.cpp(102) : error C3861: 'registerOhFunctions': identifier not found, even with argument-dependent lookup register\addin.cpp(140) : error C3861: 'unregisterOhFunctions': identifier not found, even with argument-dependent lookup Build log was saved at "file://f:\QuantStudioSVN\QuantLibXL\qlxl\buildStatic\vc71\Release\BuildLog.htm" QuantLibXLStatic - 2 error(s), 0 warning(s) |
|
From: Ferdinando A. <na...@am...> - 2008-03-07 11:55:05
|
Hi Chris > I like your second suggestion [..] I can put a patch together or would > you like to? go ahead! I couldn't think of something more flattering than having someone who love my idea and also does the actual implied work. :-) ciao -- Nando |
|
From: Ferdinando A. <na...@am...> - 2008-03-07 11:45:28
|
On Fri, Mar 7, 2008 at 11:39 AM, Chris Kenyon <chr...@ya...> wrote: > in blackcapfloorengine.cpp when the type is Collar the optionletsPrice does > not appear to be updated correctly. Since the collar is long a cap and > short a floor should the optionletsPrice also have the floor subtracted as the > value does? yes, I agree with you. You are referring to the 0.9.0 code base: this error has been fixed in the current trunk code which has been also refactored: would you mind taking a look at it and see if you could spot any new mistake that might have been introduced by the refactoring? I exploit your observation to ask: could we remove the Collar enumeration and force the user to instantiate the Cap and Floor independently? I've never liked the duplication of strikes in the CapFloor contructor. The reason I ask is that long time ago we tried to support Straddle together with Call and Put, but we gave up in favor of code readability and to avoid the kind of mistake you are pointing out about Collar. For the same reason I would remove Collar. The only valuable feature we would lose is the ability to calculate implied vol for a Collar. Anyway after dealing few years with these issues I'm inclined to think that the only real beneficial addition would be to have an easy way to calculate implied vol for straddles, or more generically, implied vol for a collection of cap/floor instruments, not just collar whose usage has been null in my experience. ciao -- Nando |
|
From: Chris K. <chr...@ya...> - 2008-03-07 11:37:51
|
Hi Nando,
I like your second suggestion - simple and addresses an equivalent issue directly (getting the n-th caplet), avoids market convention issues, and avoids doing something awkward (forward starts). The output should still be a capfloor, but with just one cashflow. I can put a patch together or would you like to?
Regards,
Chris
----- Original Message ----
From: Ferdinando Ametrano <na...@am...>
To: Chris Kenyon <chr...@ya...>
Cc: qua...@li...
Sent: Friday, March 7, 2008 11:15:12 AM
Subject: Re: [Quantlib-dev] add .asOptionlet() to MakeCapFloor ?
Hi Chris,
not sure I get your point.
Couldn't you obtain the same result just using the standard constructor:
MakeCapFloor(CapFloor::Type capFloorType,
const Period& capFloorTenor,
const boost::shared_ptr<IborIndex>& iborIndex,
Rate strike = Null<Rate>(),
const Period& forwardStart = 0*Days);
E.g. let's assume you want the last caplet in a 3Y cap on 6M ibor rate:
MakeCapFloor(Cap, 6*Months, my6mIborIndex, myStrike, 30*Months);
If this is not equivalent because of market conventions used in the 30M fwd start swap calculation, then I still have another point.
To obtain the sequence of distinct caplets contained in a standard cap, we could have something like CapFloor::optionlet(Size i) instead: this would allow to create just one single cap and to extract all caplets from it, avoiding multiple redundant cap creations
I look forward to your feedback
ciao -- Nando
On Fri, Mar 7, 2008 at 11:35 AM, Chris Kenyon <chr...@ya...> wrote:
>
> Hi,
>
> this would make life easier. Effect: only the last cashflow is returned.
> The extra code could be something like:
>
> In .hpp after line 66
>
> //! Only get last coupon, i.e. get caplet version of cap
> //! or floorlet version of floor, etc.
> MakeCapFloor& asOptionlet();
>
> Also before closing };
>
> bool asOptionlet_;
>
> In .cpp after line 38 in constructor (and before {}):
>
> asOptionlet_(false)
>
> after new line 53
>
> //! only leaves the last coupon
> if (asOptionlet_ && leg.size()>1)
> leg.erase(leg.begin(), --leg.end());
>
> Best regards,
> Chris
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> QuantLib-dev mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
>
>
|
|
From: Ferdinando A. <na...@am...> - 2008-03-07 11:15:16
|
Hi Chris,
not sure I get your point.
Couldn't you obtain the same result just using the standard constructor:
MakeCapFloor(CapFloor::Type capFloorType,
const Period& capFloorTenor,
const boost::shared_ptr<IborIndex>& iborIndex,
Rate strike = Null<Rate>(),
const Period& forwardStart = 0*Days);
E.g. let's assume you want the last caplet in a 3Y cap on 6M ibor rate:
MakeCapFloor(Cap, 6*Months, my6mIborIndex, myStrike, 30*Months);
If this is not equivalent because of market conventions used in the 30M fwd
start swap calculation, then I still have another point.
To obtain the sequence of distinct caplets contained in a standard cap, we
could have something like CapFloor::optionlet(Size i) instead: this would
allow to create just one single cap and to extract all caplets from it,
avoiding multiple redundant cap creations
I look forward to your feedback
ciao -- Nando
On Fri, Mar 7, 2008 at 11:35 AM, Chris Kenyon <chr...@ya...>
wrote:
>
> Hi,
>
> this would make life easier. Effect: only the last cashflow is returned.
> The extra code could be something like:
>
> In .hpp after line 66
>
> //! Only get last coupon, i.e. get caplet version of cap
> //! or floorlet version of floor, etc.
> MakeCapFloor& asOptionlet();
>
> Also before closing };
>
> bool asOptionlet_;
>
> In .cpp after line 38 in constructor (and before {}):
>
> asOptionlet_(false)
>
> after new line 53
>
> //! only leaves the last coupon
> if (asOptionlet_ && leg.size()>1)
> leg.erase(leg.begin(), --leg.end());
>
> Best regards,
> Chris
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> QuantLib-dev mailing list
> Qua...@li...
> https://lists.sourceforge.net/lists/listinfo/quantlib-dev
>
>
|
|
From: Chris K. <chr...@ya...> - 2008-03-07 10:39:46
|
(Also in bug tracker.)
Hi,
in blackcapfloorengine.cpp when the type is Collar the optionletsPrice does
not appear to be updated correctly. Since the collar is long a cap and
short a floor should the optionletsPrice also have the floor subtracted as the
value does?
I.e. does a line need adding after 131 as:
optionletsPrice.back() -= temp;
Best regards,
Chris
|
|
From: Chris K. <chr...@ya...> - 2008-03-07 10:35:37
|
Hi,
this would make life easier. Effect: only the last cashflow is returned. The extra code could be something like:
In .hpp after line 66
//! Only get last coupon, i.e. get caplet version of cap
//! or floorlet version of floor, etc.
MakeCapFloor& asOptionlet();
Also before closing };
bool asOptionlet_;
In .cpp after line 38 in constructor (and before {}):
asOptionlet_(false)
after new line 53
//! only leaves the last coupon
if (asOptionlet_ && leg.size()>1)
leg.erase(leg.begin(), --leg.end());
Best regards,
Chris
|
|
From: SourceForge.net <no...@so...> - 2008-03-07 10:27:40
|
Bugs item #1909433, was opened at 2008-03-07 02:27 Message generated for change (Tracker Item Submitted) made by Item Submitter You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112740&aid=1909433&group_id=12740 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: blackcapfloorengine.cpp Initial Comment: Hi, in blackcapfloorengine.cpp when the type is Collar the optionletsPrice is not updated correctly (at all in fact). Since the collar is long a cap and short a floor the optionletsPrice should have the floor subtracted as the value does. I.e. a line needs adding after 131 as: optionletsPrice.back() -= temp; Best regards, Chris Kenyon chr...@ya... ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112740&aid=1909433&group_id=12740 |
|
From: Ferdinando A. <na...@am...> - 2008-03-07 10:14:24
|
Hi Tasos it might help to know in more details what kind of problems you had, otherwise it is harder to provide feedback about your suggestions. Anyway I anticipate my guess/suggestion. You might write your own CADSwapHelper deriving from RateHelper or SwapHelper and and wrap in that RateHelper your custom Swap. The VanillaSwap is just an helper class, for fully customized swap you should use the Swap class. Finally: if you can contribute your modifications they could go in the code base and you would not have to apply them to each release ;-) ciao -- Nando On Thu, Mar 6, 2008 at 7:10 PM, a akpitidis <a_a...@ya...> wrote: > Hi , > > I tried to add to 8.0 the CAD vanilla swaps for the curve building and i > came across with some design issues, mainlly because i don't want to change > existing modules of the library. However, i want to reuse most of the core > code. > > It turn out that i have no option but i need to either change existing > modules or replicate existing code to new modules. > > In my mind someone who wants to extend a library shouldn't have to change > existing files, but the library needs to provide the appropriate hooks (i.e. > interfaces, template classes/functions and so on). At the same time, as we > all know, that takes time and effort, and in the main time the DIY solution > fits most clients :). > > Here are some sugestions for the future: > > 1. Create a template class VanillaSwapG ( G for generic), the coupontype > should be the template parameters and they should be propagated down to the > construction of the floating leg. > > 2. A typedef will define the existing VanillaSwap class. > > 3. Those template arguments should be propagated upwards to MakeVanillaSwap > and SwapRateHelper. > > 4. Finally, i need to be able to hook my own code into the > SwapRateHelper::initializeDates as i need to set the custom floating leg > tenor, which is different from the index tenor. Then again that extra > information needs to come from somewhere, but then i need to have my new > SwapRateHelper class, but i don't want to copy existing code. > > Any thoughts? > Who decides what changes go into repository? > I really like the library, but i need to be able to enhance it, so it does > what i want to do and at the same time i don't want to redo the changes > everytime a new release comes up. > > Regards > Tasos > > > > > > ________________________________ > Sent from Yahoo! Mail. > The World 's Favourite Email. > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > _______________________________________________ > QuantLib-dev mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-dev > > |
|
From: Klaus S. <kl...@sp...> - 2008-03-07 09:15:19
|
Hi I've added a new class "BatesProcess" a few days ago. I'm developing under linux and unfortunately I don't have access to VC. Therefore the VC project file might be not up-to-date. Please add these files ql/processes/batesprocess.hpp ql/processes/batesprocess.cpp to your solution. Then the svn head should work again sorry and cheers Klaus ----- original message -------- Subject: [Quantlib-dev] Build failed at revision 14548. Sent: Fri, 07 Mar 2008 From: lao...@gm... Hi all, I am trying to build based SVN revision 14548. I would really appreciate your help in resolving this problem. Thanks a lot in advance! My environment is WinXP VC7. The following are the error messages: ------ Build started: Project: testsuite, Configuration: Release Win32 ------ Linking... batesmodel.obj : error LNK2019: unresolved external symbol "public: double __thiscall QuantLib::BatesProcess::lambda(void)const " (?lambda@BatesProcess@QuantLib@@QBENXZ) referenced in function "public: static void __cdecl BatesModelTest::testAnalyticAndMcVsJumpDiffusion(void)" (?testAnalyticAndMcVsJumpDiffusion@BatesModelTest@@SAXXZ) batesmodel.obj : error LNK2019: unresolved external symbol "public: double __thiscall QuantLib::BatesProcess::nu(void)const " (?nu@BatesProcess@QuantLib@@QBENXZ) referenced in function "public: static void __cdecl BatesModelTest::testAnalyticAndMcVsJumpDiffusion(void)" (?testAnalyticAndMcVsJumpDiffusion@BatesModelTest@@SAXXZ) batesmodel.obj : error LNK2019: unresolved external symbol "public: double __thiscall QuantLib::BatesProcess::delta(void)const " (?delta@BatesProcess@QuantLib@@QBENXZ) referenced in function "public: static void __cdecl BatesModelTest::testAnalyticAndMcVsJumpDiffusion(void)" (?testAnalyticAndMcVsJumpDiffusion@BatesModelTest@@SAXXZ) batesmodel.obj : error LNK2019: unresolved external symbol "public: __thiscall QuantLib::BatesProcess::BatesProcess(class QuantLib::Handle<class QuantLib::YieldTermStructure> const &,class QuantLib::Handle<class QuantLib::YieldTermStructure> const &,class QuantLib::Handle<class QuantLib::Quote> const &,double,double,double,double,double,double,double,double,enum QuantLib::HestonProcess::Discretization)" (??0BatesProcess@QuantLib@@QAE@ABV?$Handle@VYieldTermStructure@QuantLib@@@1@0ABV?$Handle@VQuote@QuantLib@@@1@NNNNNNNNW4Discretization@HestonProcess@1@@Z) referenced in function "public: static void __cdecl BatesModelTest::testAnalyticAndMcVsJumpDiffusion(void)" (?testAnalyticAndMcVsJumpDiffusion@BatesModelTest@@SAXXZ) .bin/QuantLib-test-suite-vc71-mt-s-0_9_5.exe : fatal error LNK1120: 4 unresolved externals --- original message end ---- |
|
From: \\ <lao...@gm...> - 2008-03-07 03:14:29
|
Hi all, I am trying to build based SVN revision 14548. I would really appreciate your help in resolving this problem. Thanks a lot in advance! My environment is WinXP VC7. The following are the error messages: ------ Build started: Project: testsuite, Configuration: Release Win32 ------ Linking... batesmodel.obj : error LNK2019: unresolved external symbol "public: double __thiscall QuantLib::BatesProcess::lambda(void)const " (?lambda@ BatesProcess@QuantLib@@QBENXZ) referenced in function "public: static void __cdecl BatesModelTest::testAnalyticAndMcVsJumpDiffusion(void)" (?testAnalyticAndMcVsJumpDiffusion@BatesModelTest@@SAXXZ) batesmodel.obj : error LNK2019: unresolved external symbol "public: double __thiscall QuantLib::BatesProcess::nu(void)const " (?nu@ BatesProcess@QuantLib@@QBENXZ) referenced in function "public: static void __cdecl BatesModelTest::testAnalyticAndMcVsJumpDiffusion(void)" (?testAnalyticAndMcVsJumpDiffusion@BatesModelTest@@SAXXZ) batesmodel.obj : error LNK2019: unresolved external symbol "public: double __thiscall QuantLib::BatesProcess::delta(void)const " (?delta@ BatesProcess@QuantLib@@QBENXZ) referenced in function "public: static void __cdecl BatesModelTest::testAnalyticAndMcVsJumpDiffusion(void)" (?testAnalyticAndMcVsJumpDiffusion@BatesModelTest@@SAXXZ) batesmodel.obj : error LNK2019: unresolved external symbol "public: __thiscall QuantLib::BatesProcess::BatesProcess(class QuantLib::Handle<class QuantLib::YieldTermStructure> const &,class QuantLib::Handle<class QuantLib::YieldTermStructure> const &,class QuantLib::Handle<class QuantLib::Quote> const &,double,double,double,double,double,double,double,double,enum QuantLib::HestonProcess::Discretization)" (??0BatesProcess@QuantLib@@QAE@ABV ?$Handle@VYieldTermStructure@QuantLib@@@1@0ABV?$Handle@VQuote@QuantLib@@@ 1@NNNNNNNNW4Discretization@HestonProcess@1@@Z) referenced in function "public: static void __cdecl BatesModelTest::testAnalyticAndMcVsJumpDiffusion(void)" (?testAnalyticAndMcVsJumpDiffusion@BatesModelTest@@SAXXZ) .\bin/QuantLib-test-suite-vc71-mt-s-0_9_5.exe : fatal error LNK1120: 4 unresolved externals |
|
From: Yee M. C. <ym...@ya...> - 2008-03-07 01:20:57
|
Hi
I recently finished my implementation of
GJR-GARCH(1,1) option pricing model for European
options using QMC with Brownian Bridge.
I find that you guys don't have this pricing model.
Do you mind if I implement this for Quantlib? If so,
how should I proceed?
Have a great day!
Yee Man
____________________________________________________________________________________
Never miss a thing. Make Yahoo your home page.
http://www.yahoo.com/r/hs
|
|
From: a a. <a_a...@ya...> - 2008-03-06 18:11:08
|
Hi ,
I tried to add to 8.0 the CAD vanilla swaps for the curve building and i came across with some design issues, mainlly because i don't want to change existing modules of the library. However, i want to reuse most of the core code.
It turn out that i have no option but i need to either change existing modules or replicate existing code to new modules.
In my mind someone who wants to extend a library shouldn't have to change existing files, but the library needs to provide the appropriate hooks (i.e. interfaces, template classes/functions and so on). At the same time, as we all know, that takes time and effort, and in the main time the DIY solution fits most clients :).
Here are some sugestions for the future:
1. Create a template class VanillaSwapG ( G for generic), the coupontype should be the template parameters and they should be propagated down to the construction of the floating leg.
2. A typedef will define the existing VanillaSwap class.
3. Those template arguments should be propagated upwards to MakeVanillaSwap and SwapRateHelper.
4. Finally, i need to be able to hook my own code into the
SwapRateHelper::initializeDates as i need to set the custom floating leg tenor, which is different from the index tenor. Then again that extra information needs to come from somewhere, but then i need to have my new SwapRateHelper class, but i don't want to copy existing code.
Any thoughts?
Who decides what changes go into repository?
I really like the library, but i need to be able to enhance it, so it does what i want to do and at the same time i don't want to redo the changes everytime a new release comes up.
Regards
Tasos
---------------------------------
Sent from Yahoo! Mail.
The World 's Favourite Email. |
|
From: Jean-Yves S. <jy...@re...> - 2008-03-05 03:04:06
|
Dear Quantlib developers, I would like to introduce our company Betonmarkets.com. Our website specialises in fixed-odds financial bets (aka digital options). We have offices in the Isle of Man, Malta, and Malaysia, and were founded in 1999 as an affiliate of Regent Pacific Group, a Hong Kong-listed company. Our website is currently the largest fixed-odds financial betting website, transacting in over 20,000 bets per day. Currently our bet pricing is performed in-house using our own algorithms. We are considering the feasibility of migrating to Quantlib, and the purpose of this email is to request feedback as regards the feasibility of such a move. Due to the nature of our website - i.e. the ability to price digital options and get an instant response - our bet pricing model needs to be fast (response time under 1 second), which rules out computationally intensive numerical methods, unless they could be accelerated by using approximations or assumptions such as a simplified model for the vol surface. Our website offers a wide range of digital options, including digital call, put, one-touch, no-touch, range (all of these in both European and American flavours), as well as more exotic digitals such as 'up or down', 'expiry miss' and others. We'd be most grateful for your thoughts on the feasibility of adopting Quantlib, which pricing models might best suit our purposes, and what optimisations/approximations we may think about implementing in order to decrease computational intensity. Kind regards Jean-Yves Sireau -- Jean-Yves Sireau CEO, Regent Markets Group Ltd. Genseq Ltd. |
|
From: Ferdinando A. <na...@am...> - 2008-03-04 16:10:17
|
On Tue, Mar 4, 2008 at 1:57 PM, Eric Ehlers <eri...@na...> wrote: > >> At present, non-ASCII characters (>128, aka extended ASCII) > >> appear in various comments and literal strings in the source code > >> > >> Some possible courses of action: > >> 1) Restrict ourselves to the ASCII character set > >> 2) Convert all source code files to Unicode format > >> 3) Disable C4819 > >> 4) Do nothing and as today leave affected parties to work around the > >> problem by implementing one of the above as a local hack > > > > Hmm. (3) seems strangely appealing... > > > > Luigi > > It turns out, (3) doesn't work what is so hard about 2 ? ciao -- Nando |
|
From: Eric E. <eri...@na...> - 2008-03-04 11:25:01
|
Hi All, On Mon, February 25, 2008 4:53 pm, Luigi Ballabio wrote: > On Sun, 2008-02-24 at 23:38 +0000, Eric Ehlers wrote: >> At present, non-ASCII characters (>128, aka extended ASCII) >> appear in various comments and literal strings in the source code >> >> Some possible courses of action: >> 1) Restrict ourselves to the ASCII character set >> 2) Convert all source code files to Unicode format >> 3) Disable C4819 >> 4) Do nothing and as today leave affected parties to work around the >> problem by implementing one of the above as a local hack > > Hmm. (3) seems strangely appealing... > > Luigi It turns out, (3) doesn't work, at least not with "pragma warning disable". When you load a cpp file containing a non-ASCII character, the compiler hits the problem character before it sees the pragma directive, so C4819 still appears everywhere. The only way to disable the warning is to add /wd4819 to the compiler settings - any objection if I make that change? Regards, Eric |
|
From: Andrea <mar...@go...> - 2008-03-02 20:48:44
|
Luigi Ballabio wrote: >> 2) the mc engine should generate a matrix of that many underlyings on >> those dates (removing the extra timesteps simulated only for a >> discretization schemes) and pass it to the product. > > Yes. For this, you can use the MultiPathGenerator class. Given the > dates and the dynamics of the underlyings, it will generate a MultiPath > instance containing the underlying values. However, you shouldn't pass > it to the product, but rather to an instance of a class derived from > PathPricer (which the product will instantiate.) > >> 3) the product should then return how much it pays on some final date. > > True, with 'product' replaced by 'path pricer'. Hi, I've just seen only now this email you sent a while ago. I am not sure what you mean. The PathPricer receives the MultiPath, extract the values of the assets on the times requested by the product (the time grind having potentially more dates than the product needs) into some sort of matrix and passes it to the product. The product return (for the time being) one single number, and the PathPricer takes care of discounting it. I want to write only one instance of the PathPricer and many Products/Payoffs. Is it correct? Andrea |
|
From: SourceForge.net <no...@so...> - 2008-02-29 09:36:14
|
Bugs item #1904433, was opened at 2008-02-29 05:44 Message generated for change (Comment added) made by lballabio You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112740&aid=1904433&group_id=12740 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: None Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Nobody/Anonymous (nobody) Assigned to: Nobody/Anonymous (nobody) Summary: complie bug or misunderstood? Initial Comment: everytime I compile the example in the quontlib, the following message I've seen. Is this misunderstood or complie bug or something different? ---------------------------------------------------- cannot find -lQuoantlib-mgw-0_9_0 Id returned 1 exit status [Build Error] [bin/FRA-mwg.exe] Error 1 ---------------------------------------------------------------------- >Comment By: Luigi Ballabio (lballabio) Date: 2008-02-29 10:36 Message: Logged In: YES user_id=75450 Originator: NO Did you succesfully compile the library first? (The corresponding project is QuantLib.dev) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=112740&aid=1904433&group_id=12740 |