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.

If it exists, has been agreed on, and F# programmers have used it extensively, I would like to know what is the industry standard Quant Finance library for F#.

What typical finance scenario(s) have you had success with for this library?

share|improve this question
    
Theres quantlib in C++ but even that is far from an industry standard.... –  pyCthon Jan 23 '13 at 20:30
1  
"Quant finance" is a broad field. Are you referring to derivatives pricing? High-frequency trading? Risk management? This is like asking, "What's the industry standard library for science?" –  chrisaycock Jan 23 '13 at 21:15
    
Anything that needs to express complex Quant equations efficiently in f# –  Nikos Jan 24 '13 at 0:25
    
What do you currently use at your employer? –  chrisaycock Jan 24 '13 at 3:30
2  
It's hard to get easier in quant finance than BS. Even VBA can handle that easily. –  Matt Wolf Jan 24 '13 at 19:11

4 Answers 4

up vote 4 down vote accepted

I'm not aware of an industry-standard Quant Finance library in the F# space, but there are plenty of high-quality commercial and open source alternatives. See the F# Software Foundation's Math Stacks page.

F# is used in a wide range of finance scenarios.You can read some experience reports from the F# Software Foundation home page.

share|improve this answer
    
Excellent link. –  SRKX Jan 24 '13 at 16:04
    
@SRKX I agree!! –  Nikos Feb 1 '13 at 2:00

Unfortunately, the most there is seems to be the C++ QuantLib. I am not overly familiar with F#, but i assume there is a way to access C++ libraries.

Its documentation is pretty much nonexistent, however Mark Joshi has published a very good book on Design Patterns with C++, which will help you get started. You may be able to utilize the methods from QL in your system, but implement your own code in F#, but that heavily depends on your usage scenario (maybe you could elaborate on that a bit more?). Another way would be to write most of your system in C++ (or anything else, Java or Python offer decent implementations of QL) and only write only some modules in F#, depending on your needs. This, however, can quickly become a huge mess, and needs to be planned carefully. Weight the advantages of using an at least commonly used library.

On a different note, Microsoft has a case study on F# in banking, but unfortunately they do not answer your question, however it may serve you as a resource for further research: http://www.microsoft.com/casestudies/Case_Study_Detail.aspx?casestudyid=4000006794

share|improve this answer
    
that's a cool paper!, makes me feel like I'm investing in the right thing –  Nikos Jan 24 '13 at 0:28
    
interesting link but it contains a lot of misleading statements. "F# interoperates with .Net products such as WPF"? Simply not true. Everything behind the scenes you need to do to get going in WPF can only be done in non-functional languages. " When you’re editing F# code in Visual Studio, you instantly see if something is wrong because errors are highlighted with a red line.” -> Wow, now tell me where that is not the case in C#, for example. "Static typing"? Want strong-typing? Chose C#, want dynamic typing? Chose C#. Whats really the advantage of F#? I never got it. –  Matt Wolf Jan 24 '13 at 1:35
    
@Freddy For me F# helps with implementing complex equations. –  Nikos Jan 24 '13 at 12:59
1  
@Nikos, care to share an example that can be solved more easily in F# than C#? Honestly curious. Thanks. –  Matt Wolf Jan 24 '13 at 15:19
1  
@Freddy see how easier it is to express the Block Scholes using f# fssnip.net/3I –  Nikos Jan 24 '13 at 18:29

F# is a relatively recent programming language: it was only included with Visual Studio since the 2010 version. Therefore, there is little chance that programmers had the time to agree on a common library, especially given the fact that Quantitative Finance is a broad field and hence different libraries might be better in specific areas.

I still think the question deserves an answer because F# is being more and more used in Quantitative Finance and I guess programmers in the field will start wondering about a reference library in the future.

First of all, it is important to remember that F# is part of the .Net framework. Hence, you have to keep in my that any library being used nowadays in another language of the framework (I'm especially thinking about C#) can be used from F#. For example, as mentioned by phi, you will be able to use Quantlib. The thing is, to be able to leverage the advantage of the functional programming paradigm which is the main advantage of F#, you would have to create a wrapper around a library that hasn't been done especially for that language. Some of the existing libraries, such as NAG, are starting to make F# wrappers so there is a good chance that more wrappers will be available in the future.

Finally, let's just say again that in order to make profitable strategies, you will not be able to solely rely on available libraries, you will have to implement extensions in-house.

share|improve this answer
    
Great answer thanks, I hope that f# wrapper comes out soon for Quantlib –  Nikos Jan 24 '13 at 0:22
    
@SRKX, I guess you are aware that as soon as you run C# code through a wrapper within F# you lose pretty much most of the F# advantages that one supposedly wanted to utilize in the first place. So far Microsoft has not convinced me at all that F# is a better place to be rather than Haskell or Erlang. If I want functional language properties I would rather go with those other, much more established languages. So far I have not seen a whole lot that convinces me that F# plays very nice with C# or C++. –  Matt Wolf Jan 24 '13 at 10:38
    
@Freddy I agree that doing the wrapper will not "inject" F# features in the library. You can be willing to use F# because you enjoy functional programming and you plan to build a model in this paradigm but you need at some point to be able to interact with other part of you environment which are written in C# for example. I'm not sure I would chose F# if I was asked to code an independent functional programming project from scratch. But if I have to manage interaction with .net object-oriented code, then I surely would. –  SRKX Jan 24 '13 at 11:12
    
fair points, there is admittedly not much out there for Erlang or Haskell. Some open source projects such as ZeroMQ cater to everything under the sun, so also most functional languages. But other libraries are not that supportive. –  Matt Wolf Jan 24 '13 at 11:52
    
Interesting arguments. There are good jobs here in london using f# in quant roles. –  Nikos Jan 24 '13 at 12:55
  • In my opinion F# will never ever take off in ways C++ or C# has become popular. There are way too many competitive functional languages out there and if you program functionally why would you ever want to lock yourself into a MS product, at least that is an argument I have heard multiple times.

  • There is no comprehensive F# library out there right now that tackles derivatives pricing algorithms or quantitative methods applied to financial modeling, period.

  • I highly recommend you to look at C++ libraries and some C# libraries (which perform more and more closely to their C++ brothers, throughput and latency wise). There is just not enough support for functional language libraries in the broader finance community yet, and to be honest I do not think there will ever be sufficient interest in order to make it worthwhile to run a whole architecture on a functional language. The reason I say that is because I already see lots of effort put in by MS and other vendors to open up C++ and especially C# more and more to handle work loads that were the core domain of functional languages before. Examples that show how C# (.Net) really pushes onto the turf of other competing languages:

    • Actor model (and IPC communication)
    • State machine compile time creation (async, await type concurrent programming)
    • want static typing? check; strong typing? check; dynamic typing? check; object type inference? check
    • tpl dataflow, concurrent data flow processing
    • complex event processing (MS has its own product out there that tightly integrates with .Net and got pretty good reviews)

A lot of that stuff was previously the domain of Haskell or Erlang, not so anymore.

share|improve this answer
1  
care to comment on why you downvoted? Just down voting does not benefit anyone other than your ego. I love to learn and hear from you if you disagree, make a point so that everyone else benefits as well. –  Matt Wolf Jan 24 '13 at 4:06
    
don't get the down vote either, this is true +1 –  pyCthon Jan 24 '13 at 6:16
    
@pyCthon, I do not have an issue with down votes at all as long as a reason is given. I down vote at times but generally always comment on the reason and revise the down vote if an answer is updated and reflects changes that warrant a reconsideration. I am here to learn and to hope to add value, "like/don't like" does not add much value imho. –  Matt Wolf Jan 24 '13 at 6:58
3  
I downvoted you. You and @phi didn't even address the question, which is about libraries for F#. –  chrisaycock Jan 24 '13 at 12:31
    
@chrisaycock, well I stated the fact which is that there are none that could be considered standard. Some believe its because F# is relatively new and I added my own point which is that I do not believe F# will ever catch on much. If you still think that is missing the question (though I precisely answered it and added maybe more content in addition than you wanted to see, though you were not the recipient) then feel free to retain the down vote, I stand by my answer. –  Matt Wolf Jan 24 '13 at 15:23

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.