Create a stress-test app for investment portfolios  

Build a web app that performs a stress test on an investment portfolio using financial services

Last updated | By Raheel Zubairy, Rob Seidman, Riyaz Nakhooda


Financial markets can be unpredictable, but investors want to know how their portfolios will perform under different conditions. This developer journey shows you how to build a stress-testing app for portfolios using a set of financial web services.


Financial markets are notoriously unpredictable. Interest rates, political developments, public mood — almost anything can affect an investment portfolio, both positively and negatively. Investors understandably want to know how their portfolio will react to different sets of circumstances, but too often they’re left to simply guess.

A company or organization that provides investment advice or services would see major business value in helping their customers view their portfolio under different sets of conditions. They would be able to show investors how their portfolio would react to market conditions; they could outline beneficial outcomes and prepare them to weather bad times. When it comes to investments, information is power.

Our team got to thinking: wouldn’t it be great if we could come up with an app that lets investors and financial companies see what different market conditions would do to a portfolio. We knew that there were some handy new Bluemix services available — we just needed to put them together to enable us to stress-test our portfolios.

This journey is the result of that work. We show you how to use those Bluemix Finance services to perform predictive market stress testing for an investment portfolio. The services are integrated into a web interface that loads the user’s portfolio using the Bluemix Investment Portfolio service. You can fill in some basic information to create a scenario for stress testing; for example, what would happen to a specific portfolio if there was an overall 5% rise in the value of the S&P 500 Index.

The Predictive Market Stress Testing app that you’ll produce in this journey lets you create different scenarios that are then applied to each holding in the portfolio using the Bluemix Simulated Instrument Analytics service. The journey shows you how to use Bluemix Finance services to generate a robust, enterprise-grade stress test without having to have a PhD in Finance or Economics. It’s ideal for any developer who needs to understand stress-testing, predictive analytics, or multi-service app development.


  1. The user seeds the Investment Portfolio service with portfolio specific information before running the application.
  2. The user uses a web interface to provide inputs such as the content of the portfolio, the risk factors, and the shock magnitude.
  3. The Bluemix Predictive Market Scenario service generates the scenario from the risk factor and shock magnitude inputs.
  4. The Bluemix Simulated Instrument Analytics service calculates the stressed value for each holding in the portfolio using the scenario generated in previous step.
  5. The output is presented as a table in the web interface.

Related Blogs

Newsletters: The Curious Developer’s Best Friend

The great thing about software development is that there is always something new to learn! The terrible thing about software development is that there is always something new to learn! Luckily, there are tons of wonderful people sharing their knowledge every week in helpful and entertaining newsletters … and unfortunately, it can be really easy...

Continue reading Newsletters: The Curious Developer’s Best Friend

Kubernetes Upstream Contribution – 5 Do’s and Don’t

There is a good amount of documentation material out there on the Kubernetes community website which every contributor should read. However, if you are a new or intermediate contributor, or thinking to start contributing to Kubernetes upstream, hopefully, this post will help you understand some of the lessons that I have learned. This post discusses...

Continue reading Kubernetes Upstream Contribution – 5 Do’s and Don’t

Related Links