|
From: Dimitri R. <dim...@go...> - 2008-11-12 19:55:58
|
Hi everyone. I'm new to this list. I'm thinking about adding new functions to the blackcalculator, which are in particular needed in the FX area. In particular, I'd like to add: - premium adjusted black scholes deltas (spot and forward) - functions, which return the strike for a given black scholes delta or ATM quotation This would be a relatively small contribution and a small enough project to get me started with contributing to QuantLib and learn how to contribute code etc. Would that be useful? Best regards, Dima |
|
From: Ferdinando A. <na...@am...> - 2008-11-13 10:46:26
|
Hi Dimitri > I'm new to this list. I'm thinking about adding new functions > to the blackcalculator, which are in particular needed in the > FX area. In particular, I'd like to add: > > - premium adjusted black scholes deltas (spot and forward) > - functions, which return the strike for a given black scholes delta or ATM > quotation this would be very much appreciated! I've been thinking about tackling the last issue it's long time now, but never had the occasion. BTW I've noticed that an algorithm is provided in the last version of Haug Fomulas book, anyway i don't know if it is the most efficient algorithm available As for premium adjusted black scholes deltas I'm not familiar with FX, but just go ahead and document the features. And while there, anyone willing to provide Vanna-Volga interpolation? ciao -- Nando |
|
From: Ferdinando A. <na...@am...> - 2008-11-13 13:57:06
|
On Thu, Nov 13, 2008 at 12:42 PM, Dima <dim...@go...> wrote: > Ok, good. [...] So, how to proceed? It would be better if you work on the current trunk version, so familiarize yourself with svn and check out the trunk snapshot. See http://quantlib.org/svn.shtml Also please read the "Developer introduction" at http://quantlib.org/newdeveloper.shtml > Will I work with someone of the core > developers of the class closely? I am the class main developer, but a) I'm not that proud of its design b) it's not that complex c) Luigi is THE man Just post on the dev list and somebody will step up and help you. > Since I wasn't sure > what to do with the blackcalculator class. Please take a look at the blackformula file, where you can find (hopefully) efficient formula for price and implied vol. You might probably consider to implement strikeForDelta as function instead of BlackCalculator class method. BlackCalculator is just an aggregation of less used formulae with some common calculation factorized at construction time. See also BlackScholesCalculator. ImpliedVol and StrikeForDelta might be wrapped as BlackCalculator methods if needed > It seems, > like Asset or Nothing and Cash or Nothing options > are dealed with in the same class. But that is something > that would be difficult to incorporate for functions such > as strikeForDelta, since it basically applies to vanilla > option deltas only. check for the payoff and throw, or if you go for the function approach use the appropriate vanilla payoff signature > I can do Vanna-Volga and Malz, if needed. It would be appreciated; take a look at Sabr and/or Abcd interpolation > Also, I'd need some guidance how > to start with the contribution... Feel fre to ask here on the public mailing list any further questions ciao -- Nando > 2008/11/13 Ferdinando Ametrano <na...@am...> >> >> Hi Dimitri >> >> > I'm new to this list. I'm thinking about adding new functions >> > to the blackcalculator, which are in particular needed in the >> > FX area. In particular, I'd like to add: >> > >> > - premium adjusted black scholes deltas (spot and forward) >> > - functions, which return the strike for a given black scholes delta or >> > ATM >> > quotation >> >> this would be very much appreciated! I've been thinking about tackling >> the last issue it's long time now, but never had the occasion. >> BTW I've noticed that an algorithm is provided in the last version of >> Haug Fomulas book, anyway i don't know if it is the most efficient >> algorithm available >> >> As for premium adjusted black scholes deltas I'm not familiar with FX, >> but just go ahead and document the features. >> >> And while there, anyone willing to provide Vanna-Volga interpolation? >> >> ciao -- Nando > > |
|
From: Dima <dim...@go...> - 2008-11-13 19:33:17
|
Ok, thanks a lot for your replies! After thinking about it I'd suggest to code the delta calculations in a new class called BlackDeltaCalculator with a similar constructor as the BlackCalculator class. This might look like overkill (an own class for Delta calculation) on first sight, but my reasons are as follows: - we'll have to deal with 4 deltas, which could be conveniently coded in an enumeration which could be passed to the constructor. - we'll need 4 different functions to return a strike for a given delta. 2 of them will include a zero root search algorithm (premium adjusted ones). This could be all handled by one function strike(). - We will need at least two functions, which return the strike for an ATM convention (e.g. atm forward or atm delta neutral straddle). Delta neutral straddle strike depends again on the 4 delta conventions. So, to summarize: if we would try to build that in the current BlackCalculator class, this would mess things up a lot, since many delta specific functions would be needed, which are mostly used in FX. I'm very open to other suggestions. What do you think? Regards, Dima 2008/11/13 Ferdinando Ametrano <na...@am...> > On Thu, Nov 13, 2008 at 12:42 PM, Dima <dim...@go...> > wrote: > > Ok, good. [...] So, how to proceed? > It would be better if you work on the current trunk version, so > familiarize yourself with svn and check out the trunk snapshot. See > http://quantlib.org/svn.shtml > Also please read the "Developer introduction" at > http://quantlib.org/newdeveloper.shtml > > > Will I work with someone of the core > > developers of the class closely? > I am the class main developer, but a) I'm not that proud of its design > b) it's not that complex c) Luigi is THE man > Just post on the dev list and somebody will step up and help you. > > > Since I wasn't sure > > what to do with the blackcalculator class. > Please take a look at the blackformula file, where you can find > (hopefully) efficient formula for price and implied vol. You might > probably consider to implement strikeForDelta as function instead of > BlackCalculator class method. > BlackCalculator is just an aggregation of less used formulae with some > common calculation factorized at construction time. > See also BlackScholesCalculator. ImpliedVol and StrikeForDelta might > be wrapped as BlackCalculator methods if needed > > > It seems, > > like Asset or Nothing and Cash or Nothing options > > are dealed with in the same class. But that is something > > that would be difficult to incorporate for functions such > > as strikeForDelta, since it basically applies to vanilla > > option deltas only. > check for the payoff and throw, or if you go for the function approach > use the appropriate vanilla payoff signature > > > I can do Vanna-Volga and Malz, if needed. > It would be appreciated; take a look at Sabr and/or Abcd interpolation > > > Also, I'd need some guidance how > > to start with the contribution... > Feel fre to ask here on the public mailing list any further questions > > ciao -- Nando > > > 2008/11/13 Ferdinando Ametrano <na...@am...> > >> > >> Hi Dimitri > >> > >> > I'm new to this list. I'm thinking about adding new functions > >> > to the blackcalculator, which are in particular needed in the > >> > FX area. In particular, I'd like to add: > >> > > >> > - premium adjusted black scholes deltas (spot and forward) > >> > - functions, which return the strike for a given black scholes delta > or > >> > ATM > >> > quotation > >> > >> this would be very much appreciated! I've been thinking about tackling > >> the last issue it's long time now, but never had the occasion. > >> BTW I've noticed that an algorithm is provided in the last version of > >> Haug Fomulas book, anyway i don't know if it is the most efficient > >> algorithm available > >> > >> As for premium adjusted black scholes deltas I'm not familiar with FX, > >> but just go ahead and document the features. > >> > >> And while there, anyone willing to provide Vanna-Volga interpolation? > >> > >> ciao -- Nando > > > > > |
|
From: Ferdinando A. <na...@am...> - 2008-11-14 11:26:51
|
On Thu, Nov 13, 2008 at 8:33 PM, Dima <dim...@go...> wrote: > After thinking about it I'd suggest > to code the delta calculations in a new class called BlackDeltaCalculator > with a similar constructor as the BlackCalculator class. This might look > like > overkill (an own class for Delta calculation) on first sight, but my reasons > are > as follows: [...] Not sure I agree, anyway it could be the right way to start: code it the way it best suits you, provide unit tests (!!!!!), we quickly add it to the experimental folder, gather feedback, and then maybe later refactor the code ciao -- Nando |
|
From: Ferdinando A. <na...@am...> - 2009-04-27 10:23:11
|
On Mon, Apr 27, 2009 at 11:03 AM, Dima <dim...@go...> wrote: > While I'm still waiting for feedback I've just committed your fix for the (stdDev<QL_EPSILON, fwd==strike) case > I'd need smilesection.hpp to return the reference date. Is this possible? just done. > I continue coding and have VannaVolga and > Malz ready, testing included. share them as a patch whenever you're comfortable with them ciao -- Nando |
|
From: Dima <dim...@go...> - 2009-04-27 10:44:51
|
Thanks a lot. Did you have the chance to look at the black calculator that I posted? Sorry for annoying, but since I'm using it intensively in all of my current classes I'm just afraid that the discussion will start later and I have to go back and change everything in all of the classes :) 2009/4/27 Ferdinando Ametrano <na...@am...> > On Mon, Apr 27, 2009 at 11:03 AM, Dima <dim...@go...> > wrote: > > While I'm still waiting for feedback > > I've just committed your fix for the (stdDev<QL_EPSILON, fwd==strike) case > > > I'd need smilesection.hpp to return the reference date. Is this possible? > just done. > > > I continue coding and have VannaVolga and > > Malz ready, testing included. > > share them as a patch whenever you're comfortable with them > > ciao -- Nando > |
|
From: Luigi B. <lui...@gm...> - 2010-02-15 10:10:04
|
On Tue, 2009-04-21 at 09:49 +0200, Dima wrote: > I've uploaded > my current working version of the deltacalculator including a > testsuite(your recent change not incl.). > > You can get it here: > > longvega.com/DeltaEngine.zip > Dimitri, I've added your stuff to the Subversion trunk under q;/experimental/fx. May you check it out and see that I haven't broken anything? Thanks, Luigi -- Academic: a term of opprobrium applied to those that do their job well by those who cannot. -- Sir Ernest Gowers |
|
From: Dima <dim...@go...> - 2010-03-03 08:47:49
|
Thanks Luigi and sorry for not having answered earlier. I'm busy. I tried to build QL from the latest trunk but was not sucessfull. And the stuff you added is not in the official 1.0 version, so I couldn't really check. Don't know what happened to the trunk files, they seem to be corrupted. For example, in smilesection.hpp I find <<<<<<<<<<.mine in the code. Its either a problem here or in the trunk. 2010/2/15 Luigi Ballabio <lui...@gm...> > On Tue, 2009-04-21 at 09:49 +0200, Dima wrote: > > I've uploaded > > my current working version of the deltacalculator including a > > testsuite(your recent change not incl.). > > > > You can get it here: > > > > longvega.com/DeltaEngine.zip > > > > Dimitri, > I've added your stuff to the Subversion trunk under > q;/experimental/fx. > May you check it out and see that I haven't broken anything? > > Thanks, > Luigi > > > -- > > Academic: a term of opprobrium applied to those that do their job well > by those who cannot. > -- Sir Ernest Gowers > > > |
|
From: Luigi B. <lui...@gm...> - 2010-03-03 09:28:05
|
On Wed, 2010-03-03 at 09:47 +0100, Dima wrote: > Thanks Luigi and sorry for not having answered earlier. I'm busy. I > tried to build QL from the latest trunk > but was not sucessfull. And the stuff you added is not in the official > 1.0 version, so I couldn't really check. > Don't know what happened to the trunk files, they seem to be > corrupted. For example, in smilesection.hpp > I find > > <<<<<<<<<<.mine > > in the code. Its either a problem here or in the trunk. The trunk is clean. You modified the code on your machine, made a svn update, and got a conflict between your local changes and the changes pulled in by the update. Subversion doesn't know how to merge them and keeps both sets of changes between markers such as the one above. You'll have to resolve the conflict manually. You can see <http://svnbook.red-bean.com/en/1.5/svn.tour.cycle.html#svn.tour.cycle.resolve> for more details. Luigi -- The box said "Use Windows 95 or better," so I got a Macintosh. |
|
From: Dima <dim...@go...> - 2010-03-03 09:03:27
|
I see, thanks. Will get back to you 2010/3/3 Luigi Ballabio <lui...@gm...> > On Wed, 2010-03-03 at 09:47 +0100, Dima wrote: > > Thanks Luigi and sorry for not having answered earlier. I'm busy. I > > tried to build QL from the latest trunk > > but was not sucessfull. And the stuff you added is not in the official > > 1.0 version, so I couldn't really check. > > Don't know what happened to the trunk files, they seem to be > > corrupted. For example, in smilesection.hpp > > I find > > > > <<<<<<<<<<.mine > > > > in the code. Its either a problem here or in the trunk. > > The trunk is clean. You modified the code on your machine, made a svn > update, and got a conflict between your local changes and the changes > pulled in by the update. Subversion doesn't know how to merge them and > keeps both sets of changes between markers such as the one above. You'll > have to resolve the conflict manually. You can see > < > http://svnbook.red-bean.com/en/1.5/svn.tour.cycle.html#svn.tour.cycle.resolve> > for more details. > > Luigi > > > -- > > The box said "Use Windows 95 or better," so I got a Macintosh. > > > |
|
From: Luigi B. <lui...@gm...> - 2010-06-07 16:26:01
|
On Mon, 2010-06-07 at 18:05 +0200, Dima wrote: > I feel kind of bad since I needed so much time to check! After seeing _my_ response times? You're too harsh on yourself :) > Anyways, I checked and everything seems to be ok. I've attached an > example project which uses the contributed class, similar to the other > example projects. You might want to add it to the trunk. Ok, I'll have a look. Thanks, Luigi -- There's no sense in being precise when you don't even know what you're talking about. -- John von Neumann |
|
From: Michael W. <wa...@im...> - 2010-06-22 09:15:17
|
Hi there, I am using Quantlib for a bit, and I started to develop some enhancements to the library. As I am new to Quantlib development, I am not sure about the right procedure to supply source code to QuantLib. How and with whom can/should I discuss my solution? Is there anybody who can help me? These are my topics: 1) I developed a minor enhancement to QL, allowing to use ZeroBonds in class "FittedBondDiscountCurve", furthermore I added the complete "FittedBondDiscountCurve" functionality to QuantlibAddin / XL, to be able to calculate the curve fitting in XL. I would like to provide these enhancement to the project or someone who will review these changes to ensure that they are conform to the coding styles from Quantlib. Can you please let me know how to continue or whom to contact? 2) Currently I am working on simultaneously fitting credit spread curves based on coporate bonds with different ratings as input. In other words: I am simultaneously fitting multiple sets of bonds (Fixedratebonds and Zerobonds) for different ratings. For each set of bonds I am calculating the spread on top of a basis curve (e.g. Swapcurve) which will be simultaneously fitted with a simplified Nelson-Siegel method. The fit is done with constraints, so that the resulting curves have the expected behaviour. This functionality is completely available in XL (and QuantLibAddin) as well. Might this be of interest for the QL-project? Please let me know. Kind regards Michael |
|
From: Luigi B. <lui...@gm...> - 2010-06-23 15:51:03
|
On Tue, 2010-06-22 at 10:06 +0200, Michael Waßmann wrote: > I am using Quantlib for a bit, and I started to develop some enhancements > to the library. > > As I am new to Quantlib development, I am not sure about the right > procedure to supply source code to QuantLib. How and with whom can/should > I discuss my solution? Is there anybody who can help me? You can either post your code here, or submit a patch to the Sourceforge patch manager. If you're contributing modifications to old files (as opposed to entirely new files), a diff would be the best way. Later, Luigi -- Blessed is the man who, having nothing to say, abstains from giving wordy evidence of the fact. -- George Eliot |
|
From: Ferdinando M. A. <fer...@am...> - 2010-06-28 07:56:28
|
Hi Michael > I developed a minor enhancement to QL, allowing to use > ZeroBonds in class "FittedBondDiscountCurve", furthermore I > added the complete "FittedBondDiscountCurve" functionality to > QuantlibAddin / XL, to be able to calculate the curve > fitting in XL. Replacing FixedRateBondHelper with BondHelper does compile successfully (and no problem from the test suite), so the usage of FixedRateBondHelper was probably just a legacy limitation and any kind of Bond can be used now. Am I missing something ? ciao -- Nando |
|
From: Anthony S <ant...@ya...> - 2011-07-19 21:18:46
|
Hi Michael. Did this bit of code ever get added to the trunk? If not, I'd certainly like to see it - I'm trying to imply an inflation index from inflation-linked gilts in QLXL, and the starting point would be a discount curve from normal gilts. And I'm new too :) Anthony Michael Waßmann wrote: > > Hi there, > > I am using Quantlib for a bit, and I started to develop some enhancements > to the library. > > As I am new to Quantlib development, I am not sure about the right > procedure to supply source code to QuantLib. How and with whom can/should > I discuss my solution? Is there anybody who can help me? > > These are my topics: > 1) > I developed a minor enhancement to QL, allowing to use > ZeroBonds in class "FittedBondDiscountCurve", furthermore I > added the complete "FittedBondDiscountCurve" functionality to > QuantlibAddin / XL, to be able to calculate the curve > fitting in XL. > I would like to provide these enhancement to the project or > someone who will review these changes to ensure that they > are conform to the coding styles from Quantlib. > Can you please let me know how to continue or whom to contact? > > 2) > Currently I am working on simultaneously fitting credit > spread curves based on coporate bonds with different ratings > as input. > In other words: I am simultaneously fitting multiple sets of > bonds (Fixedratebonds and Zerobonds) for different ratings. > For each set of bonds I am calculating the spread on top of > a basis curve (e.g. Swapcurve) which will be simultaneously > fitted with a simplified Nelson-Siegel method. The fit is > done with constraints, so that the resulting curves have the expected > behaviour. > This functionality is completely available in XL (and QuantLibAddin) as > well. > Might this be of interest for the QL-project? Please let me > know. > > Kind regards > > Michael > > > > > > > ------------------------------------------------------------------------------ > ThinkGeek and WIRED's GeekDad team up for the Ultimate > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > lucky parental unit. See the prize list and enter to win: > http://p.sf.net/sfu/thinkgeek-promo > _______________________________________________ > QuantLib-dev mailing list > Qua...@li... > https://lists.sourceforge.net/lists/listinfo/quantlib-dev > > -- View this message in context: http://old.nabble.com/Adding-new-functions-to-blackcalculator-tp20468107p32094908.html Sent from the quantlib-dev mailing list archive at Nabble.com. |
|
From: Luigi B. <lui...@gm...> - 2011-07-29 15:38:52
|
Michael, I'm sorry, did I ever answer to this? Luigi On Tue, 2011-07-19 at 14:18 -0700, Anthony S wrote: > Hi Michael. > > Did this bit of code ever get added to the trunk? If not, I'd certainly like > to see it - I'm trying to imply an inflation index from inflation-linked > gilts in QLXL, and the starting point would be a discount curve from normal > gilts. And I'm new too :) > > Anthony > > > Michael Waßmann wrote: > > > > Hi there, > > > > I am using Quantlib for a bit, and I started to develop some enhancements > > to the library. > > > > As I am new to Quantlib development, I am not sure about the right > > procedure to supply source code to QuantLib. How and with whom can/should > > I discuss my solution? Is there anybody who can help me? > > > > These are my topics: > > 1) > > I developed a minor enhancement to QL, allowing to use > > ZeroBonds in class "FittedBondDiscountCurve", furthermore I > > added the complete "FittedBondDiscountCurve" functionality to > > QuantlibAddin / XL, to be able to calculate the curve > > fitting in XL. > > I would like to provide these enhancement to the project or > > someone who will review these changes to ensure that they > > are conform to the coding styles from Quantlib. > > Can you please let me know how to continue or whom to contact? > > > > 2) > > Currently I am working on simultaneously fitting credit > > spread curves based on coporate bonds with different ratings > > as input. > > In other words: I am simultaneously fitting multiple sets of > > bonds (Fixedratebonds and Zerobonds) for different ratings. > > For each set of bonds I am calculating the spread on top of > > a basis curve (e.g. Swapcurve) which will be simultaneously > > fitted with a simplified Nelson-Siegel method. The fit is > > done with constraints, so that the resulting curves have the expected > > behaviour. > > This functionality is completely available in XL (and QuantLibAddin) as > > well. > > Might this be of interest for the QL-project? Please let me > > know. > > > > Kind regards > > > > Michael > > > > > > > > > > > > > > ------------------------------------------------------------------------------ > > ThinkGeek and WIRED's GeekDad team up for the Ultimate > > GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the > > lucky parental unit. See the prize list and enter to win: > > http://p.sf.net/sfu/thinkgeek-promo > > _______________________________________________ > > QuantLib-dev mailing list > > Qua...@li... > > https://lists.sourceforge.net/lists/listinfo/quantlib-dev > > > > > -- The shortest way to do many things is to do only one thing at once. -- Samuel Smiles |