2
$\begingroup$

Thanks. Can't seem to find it through google. Worst case, if you can provide me the code in Java or C++ I can convert it to C#.

$\endgroup$
  • $\begingroup$ For your worst case: it's available in QuantLib which you can use from C#. $\endgroup$ – Bob Jansen Sep 15 '14 at 15:24
  • 1
    $\begingroup$ I know my way around C# libraries and I'm better than most. If you provide a link to the formula, I can write one for you. $\endgroup$ – Unknown Coder Sep 15 '14 at 16:13
  • $\begingroup$ Would you like to provide some reference to a documentation of the model? Thanks! $\endgroup$ – Ric Sep 16 '14 at 10:40
  • $\begingroup$ @JimBeam, just a heads up. Writing mathematical code is a job not to be taken lightly. THere are 100s of ways to mess it via loss of precision or not accounting for NaN's. If you don't have experince with working on BLAS, QL or LAPACK then its not soemthing you should write and put into production if you can find a well testing implementation. its not as simple as taking a math equation and writing an iterative solver for it. $\endgroup$ – chollida Sep 16 '14 at 13:54
  • 1
    $\begingroup$ @cholida It's only as difficult as you perceive it to be :) I've been working with C# for 10+ years now, this is not my first rodeo. $\endgroup$ – Unknown Coder Sep 16 '14 at 14:34
1
$\begingroup$

The Quantlib.net C# port has a native C# version. Get the code from here, unzip it and checkout:

path\QuantLib\QLNet-sources-1.0.0.zip\QLNet\Pricingengines\vanilla\Baroneadesiwhaleyengine.cs

To be honest, its proably worth your time to learn the library than to extract the implementation. its very common in the industry and there are a bunch of stubble interactions around date handling that makes it hard to just use a specific implementation without using the entire library.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.