Luigi Ballabio | 6 Feb 23:22
Picon

QuantLib course

Hi all,
    I'm not sure that this fits the mailing-list charter, so I'll keep
it short.  Thanks to MoneyScience, I'll be teaching a QuantLib course
on May 21-23rd. Details at <http://goo.gl/co0uG>.

Over and out,
    Luigi

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
sergvil | 7 Feb 06:03
Picon
Favicon

.NET Framework 4.0 Application Runtime Exceptions Problem


Hello,

I have been working with QuantLib since Oct'11 and I think it works great. I
used it with .NET Framework 3.5 and it worked perfectly. I use QuantLib and
SWIG for C#.

Now I am developing a .NET Framework 4 WPF application with some Quantlib
Bond Calculations and I am having some problems:

When I make some testing, each time the app tries to create any QuantLib
object or tries to execute any method it throws this exception (click on
name for description):

http://msdn.microsoft.com/es-es/library/0htdy0k3%28v=vs.100%29.aspx
pInvokeStackImbalance 

When I try the application on Visual Studio and I have
PInvolkeStackImbalance activated on MDA exceptions, I use to receive several
PInvoke warnings (green coloured) on each execution, but application works
perfectly. But when I try to execute on Windows, those warnings are
exceptions that cause application to crash.

I tried to fix it making some modifications on QuantLib_vc10 project. I
found at other forum this solution for the exception we are talking about:

On each dll method call defined on NQuantLibcPINVOKE that throws the
exception, like this:

  [DllImport("NQuantLibc", EntryPoint="CSharp_new_TARGET")]
(Continue reading)

Luigi Ballabio | 7 Feb 15:29
Picon

Re: .NET Framework 4.0 Application Runtime Exceptions Problem

On Tue, Feb 7, 2012 at 6:03 AM, sergvil <sergvil <at> hotmail.com> wrote:
> I have been working with QuantLib since Oct'11 and I think it works great. I
> used it with .NET Framework 3.5 and it worked perfectly. I use QuantLib and
> SWIG for C#.
>
> Now I am developing a .NET Framework 4 WPF application with some Quantlib
> Bond Calculations and I am having some problems:
>
> When I make some testing, each time the app tries to create any QuantLib
> object or tries to execute any method it throws [...]  pInvokeStackImbalance

Hi Sergvil,
    it looks like you're not the only one having this issue.  I
haven't tried it myself, as I don't use C#; but it looks like we have
a bug report for this on Sourceforge:
<http://sourceforge.net/tracker/?func=detail&atid=112740&aid=3466468&group_id=12740>.

The good news is, I was sent a patch recently.  I'm quoting it below;
let me know if it works for you, and I'll try to add it to the
repository (in some way I haven't yet found, since it seems to involve
either modifying SWIG or patching the generated code).

Later,
    Luigi

On Tue, Jan 24, 2012 at 4:22 PM, Mark Gillis <...redacted...> wrote:
> Ahmad’s instructions are very good here:
> http://stackoverflow.com/questions/3334011/compiling-quantlib-via-swig-for-c-sharp,
> which gets you most of the way, but there are some issues when you try to do
> this on VS 2010 and on Windows 7.  Thought I would address those.
(Continue reading)

sergvil | 7 Feb 17:08
Picon
Favicon

Re: .NET Framework 4.0 Application Runtime Exceptions Problem


Hello Luigi,

Thanks for your help.

Unfortunately this fix doesn't work properly. I make all changes described
on Ahmad's post but application continues throwing this exception:

"The type initializer for 'QuantLib.NQuantLibcPINVOKE' threw an exception."

when it tries to create the first QuantLib object (Calendar cal = new
TARGET())

And then the application crashes. 

With new dlls I have no exceptions from MDA when I executing on Visual
Studio. (this is good)

Is there any other solution?

Thank you very much.

Sergio.
--

-- 
View this message in context: http://old.nabble.com/.NET-Framework-4.0-Application-Runtime-Exceptions-Problem-tp33276539p33279669.html
Sent from the quantlib-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
(Continue reading)

sergvil | 8 Feb 03:06
Picon
Favicon

Re: .NET Framework 4.0 Application Runtime Exceptions Problem


Thank you very much!!

The fix works!!

I sent you a previous message saying that it didn't work but I forgot to
apply one of the changes described on Ahmad's post.

Now it works perfectly. You can add this fix to QuantLib, it will be very
usefull for Framework 4.0 developers.

Thank you again!!

Best Regards.

Sergio
--

-- 
View this message in context: http://old.nabble.com/.NET-Framework-4.0-Application-Runtime-Exceptions-Problem-tp33276539p33283236.html
Sent from the quantlib-users mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
Paolo Tenconi | 10 Feb 15:53
Picon

Swap rate with cap/floors in qlXL

Hi,
I'm pricing a swap using qlSwap and all is fine.
Now I'd like to introduce a cap/floor on the rates implicit in the input curve so that, each payment at a generic time "t" is equal to

pay_t = Nominal * delta_t * {max[min(L_t, L_cap), L_floor] - K}

where

  • L_t it the libor implicit in the curve
  • L_cap is the cap to be placed on implicit libor
  • L_floor is the floor to be placed on the implicit libor
  • K is the swap rate
After having set a volatility=0 in qlIborCouponPricer, I've set into qlIborLeg function: Floors=L_floor and Caps=L_cap .

However with the equality L_floor = L_cap I didn't find as a result K=L_floor=L_cap as I expected.

Can anyone tell me if is it possibile in qlXL to  price a swap with cap/floors,
and if/how Floors and Caps in qlIborLeg can affect the payoff "pay_t"?

Many thanks in advance for any help...
Paolo


------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
QuantLib-users mailing list
QuantLib-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Luigi Ballabio | 11 Feb 13:04
Picon

Re: Swap rate with cap/floors in qlXL

Hi Paolo,
    it should work as you expect.  Do you have a spreadsheet that
reproduces the problem?  I'm not using qlXL, but I might try doing the
same in C++ and see what happens.

Luigi

On Fri, Feb 10, 2012 at 3:53 PM, Paolo Tenconi <paolo.tenconi <at> gmail.com> wrote:
> I'm pricing a swap using qlSwap and all is fine.
> Now I'd like to introduce a cap/floor on the rates implicit in the input
> curve so that, each payment at a generic time "t" is equal to
>
> pay_t = Nominal * delta_t * {max[min(L_t, L_cap), L_floor] - K}
>
> where
>
> L_t it the libor implicit in the curve
> L_cap is the cap to be placed on implicit libor
> L_floor is the floor to be placed on the implicit libor
> K is the swap rate
>
> After having set a volatility=0 in qlIborCouponPricer, I've set into
> qlIborLeg function: Floors=L_floor and Caps=L_cap .
>
> However with the equality L_floor = L_cap I didn't find as a result
> K=L_floor=L_cap as I expected.
>
> Can anyone tell me if is it possibile in qlXL to  price a swap with
> cap/floors,
> and if/how Floors and Caps in qlIborLeg can affect the payoff "pay_t"?
>
> Many thanks in advance for any help...
> Paolo
>
>
>
> ------------------------------------------------------------------------------
> Virtualization & Cloud Management Using Capacity Planning
> Cloud computing makes use of virtualization - but cloud computing
> also focuses on allowing computing to be delivered as a service.
> http://www.accelacomm.com/jaw/sfnl/114/51521223/
> _______________________________________________
> QuantLib-users mailing list
> QuantLib-users <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
pasparis | 13 Feb 13:47
Picon

Pb in Quantlib compile with -windows-codeblocks-gnu gcc

Hello

I am trying to compile and link quantlib on windows with codeblocks and GNU GCC compiler

the compilation works and during the link I get the following message
Linking static library: libQuantLib.a
ar.exe: creating libQuantLib.a
ar.exe: obj\Debug\ql\termstructures\volatility\swapti: No such file or directory

I don't know why, before I used quantlib on linux ubuntu and KDevelop with no problem but the library was already availaible

Thanks for help or suggestions
pascal



------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
QuantLib-users mailing list
QuantLib-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Dagur Gunnarsson | 13 Feb 15:15
Picon
Favicon

a bug in Bonds.cpp

hello, 

Is it ok, to post bugs in this mailgroup?  I suspect that there is a bug in the following code.

00247 

Real Bond::accruedAmount(Date settlement) const {
  Real currentNotional = notional(settlementDate());
  if (currentNotional == 0.0)
   return 0.0;

  return BondFunctions::accruedAmount(*this, settlement);
}

the code is taken from  http://quantlib.sourcearchive.com/documentation/1.1-1/bond_8cpp_source.html

notional(settlementDate()) should be notional(settlement) instead - my unit tests stopped working for a bond that had a maturity the 8th of February.

regards
Dagur G
------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
QuantLib-users mailing list
QuantLib-users <at> lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Luigi Ballabio | 13 Feb 18:22
Picon

Re: a bug in Bonds.cpp

Yes, it's a bug.  I've fixed it on the 1.2 branch now.

Thanks for the heads-up.

Luigi

On Mon, Feb 13, 2012 at 3:15 PM, Dagur Gunnarsson <dagur <at> kodiak.is> wrote:
> hello,
>
> Is it ok, to post bugs in this mailgroup?  I suspect that there is a bug in
> the following code.
>
> 00247
> Real Bond::accruedAmount(Date settlement) const {
>   Real currentNotional = notional(settlementDate());
>   if (currentNotional == 0.0)
>    return 0.0;
>
>   return BondFunctions::accruedAmount(*this, settlement);
> }
>
> the code is taken from
>  http://quantlib.sourcearchive.com/documentation/1.1-1/bond_8cpp_source.html
>
> notional(settlementDate()) should be notional(settlement) instead - my unit
> tests stopped working for a bond that had a maturity the 8th of February.
>
> regards
> Dagur G
>
> ------------------------------------------------------------------------------
> Try before you buy = See our experts in action!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-dev2
> _______________________________________________
> QuantLib-users mailing list
> QuantLib-users <at> lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/quantlib-users
>

------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2

Gmane