Take the 2-minute tour ×
Quantitative Finance Stack Exchange is a question and answer site for finance professionals and academics. It's 100% free, no registration required.

I am looking for an all-java implementation of black scholes, preferably open source. I found jquantlib and quantlib (C++). Any other recommendations?

The jquantlib site seems to be down.

I'd prefer to stay away from a C++ implementation that runs on a jvm like quantlib seems to be. My team would like to look at the code if open source and none of us are C++ capable.

share|improve this question
    
Odd, the site is down for me too. –  Ellie Kesselman Sep 13 '11 at 21:31
    
Yes - i wonder why. It seems to have a sufficiently active following –  colin Sep 14 '11 at 19:05
    
Try Maygard, it's all Java. –  El Prezidenté May 1 '13 at 13:51

3 Answers 3

Black Scholes in java?

This guy, Christian Fries http://www.christian-fries.de/, has some impressive codes and a book on these topics.

You can find http://www.christian-fries.de/finmath/book/index.html the contents as well as the library itself http://www.finmath.net/java/.

As well as your request, you'll see LIBOR model, HJM model, binomial model, etc. Of course there are numerical algorithms to solve these problems like Box Muller transform, etc.. He also has a straight forward approach to theoretical stuff on the topics(probably much straight forward than others)

Hope it helps!

share|improve this answer
    
Ok - finmath appears useful. Thx. Tho the test applets appear to require java 1.5 only. But I'll keep looking. –  colin Sep 14 '11 at 18:52
    
The code uses enums and generics, so it'll require at least Java 5 (which, to be fair, had been out for almost seven years when @colin's comment was posted!) –  Martin McNulty Jan 29 '13 at 16:44
    
It is now at Java 6 and we are developing a branch which will use Java 8. Intention is to support Java 6 and Java 8 by two different releases. –  Christian Fries Aug 31 '13 at 19:15

QuantLib itself also provides Swig interfaces which can be used to create bindings for dozens of languages, Java included. Quoting:

SWIG is a software development tool that connects programs written in C and C++ with a variety of high-level programming languages. SWIG is used with different types of target languages including common scripting languages such as Perl, PHP, Python, Tcl and Ruby. The list of supported languages also includes non-scripting languages such as C#, Common Lisp (CLISP, Allegro CL, CFFI, UFFI), D, Go language, Java, Lua, Modula-3, OCAML, Octave and R.

See the QuantLib site for more on support for other languages and extensions.

On the other hand, JQuantLib is an independent project that was last reported to have a good sized portion of a prior release ported to Java.

share|improve this answer

Yep, there is one and it's leagues better than jquantlib.

https://code.google.com/p/maygard/

share|improve this answer
1  
Why is it better? Your answer would be significantly improved if you add a few points along these lines. –  Louis Marascio Apr 29 '13 at 13:44
1  
I wonder too why it's 'leagues better', from quickly looking at the source I'd say it's 'leagues' worse. The payoff for futures contracts is simply wrong, and (unless the java compiler does miracles) the numerical routines look rather slow. –  hroptatyr Apr 30 '13 at 10:54
    
It's leagues better because unlike jquantlib it's actually an object-oriented "Java API" and not a C++ procedural convert. I've used the API for fast, accurate and precise pricing of bonds and exotic options. The numerical routines are only as slow as your computer; if you want real-time performance you need to get a 'Real-Time JVM' such as Oracle's JRockIt. –  El Prezidenté May 1 '13 at 13:01
    
Can you update your answer to state this? Also, JRockit isn't a real-time java. Did you mean a JIT? –  chrisaycock May 10 '13 at 1:51
    
Oracle JRockit Real Time offers response time capabilities in microseconds! It guarantees a maximum response time of single digit milliseconds with Deterministic-GC and contains Latency Analysis Tools for monitoring and tuning the application. oracle.com/technetwork/middleware/jrockit/overview/… –  El Prezidenté May 10 '13 at 21:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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