Get the latest updates and news from FINCAD. Subscribe and never miss a post! 


HFMWeek Event Wrap-Up: Extending Valuation and Risk Analytics with Python
By Orlando Calvo Arias | November 20, 2018

Earlier this month I had the pleasure of presenting at HFMWeek’s exclusive Python knowledge-sharing and networking event. Held at the National, a New York City landmark, the event brought together CTOs, CROs, and quants from the world’s leading hedge funds, banks, and asset managers. Discussions revolved around how these firms are using Python within their businesses. Plus I gave a presentation on how firms can most effectively extend their valuation and risk systems using the flexibility and versatility of Python. 

At this point, most market participants agree that Python is an excellent programming language for use in the field of Finance. This recent article in, “Python – Is the buzz justified?” goes into detail about why, including the benefits (and risks) of using Python. But for the sake of brevity I will just say that Python is a superior tool for areas such as testing and prototyping. It’s easy even for non-developers to use, offers clean syntax, and provides a fantastic ecosystem of powerful scientific libraries and tools (e.g., SciPy, NumPy, Jupyter, etc.)—use of which can save time and dramatically shorten the development cycle. 

During my presentation at the HFMWeek event, I explained how Python lends itself to enabling financial institutions to extend their risk analytics systems. The amount of work involved in accomplishing this task is typically quite high, however Python can significantly minimize time and workload investment in this area. 

To illustrate, I gave an overview of the benefits of using our new Python Toolkit to customize and extend FINCAD F3. One great thing about using F3 to extend your valuation and risk analytics is that it allows you to abstract away a lot of the work that is typically involved in connectivity between your existing systems and F3. This gives users a seamless experience. When extending a traditional system there are a lot of considerations that come with working with a complex codebase and/or transmitting, marshaling and serializing data. But F3’s extension framework seamlessly handles this complexity and compartmentalizes user code so that it only contains business logic that the user wants to deploy. For instance, if you are working on getting a list of bonds and determining their values, the extension would only write that piece of logic. Using F3 gives you a workflow whereby you would write the extension’s logic and leave to the system all the infrastructure aspects involved with executing your application. 

Interestingly, I received a question from one audience member asking if F3 is limited to using only the API’s provided by the solution. I was glad this question was raised because one of the things that makes F3 so easy to work with, is that is gives users complete flexibility in using any API and Python package, again leaving code dependencies up to the system to manage. 

An additional question came from a hedge fund manager that struggled to trade exotics as their technology did not cover these instruments. This is a common issue and one that F3 is an ideal solution for. To cover new complex instruments like exotics would typically consist of development work done to extend an existing analytics system using complicated code. However, using Python with F3 eliminates arduous development work, enabling users to set up new library functionality quickly and easily.  

Another area I touched on was asynchronous programming using Python with F3. Traditional synchronous programming is when the steps of your program are called line by line, one at a time. This approach implies that each time a function is called you will need to wait until that function returns before processing the next line of code. Unfortunately, this approach inevitably leads to inefficiencies when multiple users are accessing the same user deployed application. One answer to this issue is to use multithreading, but the complexity of such an approach and limitations of Python in this area make this option unsuitable. Python’s asynchronous programming facilities on the other hand are state of the art. Users can write simple, readable code that leverages async functionality to deploy high-performance, parallelizable risk and valuation logic within their extensions. 

Related to this topic, I also went into the concept of lazy programming. This is a ‘call-by-need’ strategy that can significantly simplify code. Say you are writing a piece of code with 20 steps but you don’t want to call the server 20 times. Using F3 with Python, you are able to decrease the number of times your code talks to the server, reducing it from 20 down to just one time the server is called. Working under this paradigm means you are able to use returns from those function calls and pass them as needed to other functions with readable code written just as if server results where on-hand throughout those server calls.

Overall I found this event was a great opportunity for this set of banking, hedge fund and asset manager professionals to come together and share their ideas on Python. I certainly learned lot and hope they did too. 

For more insights on Python, check out some other informative FINCAD resources, summaries and links to which are available in this blog post: 5 of Our Top Python Resources 

About the author
Orlando Calvo Arias
Orlando Calvo Arias
Financial Quantitative Analyst | FINCAD

For the past two years, Orlando has worked closely with FINCAD’s sales team as a technical and quantitative analyst, designing enterprise valuation and risk solutions based on FINCAD’s F3 technology. Prior to joining FINCAD, Orlando was a FINCAD client at KPMG and DerivActiv.

Orlando holds a degree from Babson College, where he concentrated in finance. He has 10 years experience in financial derivatives valuation.