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

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.

By Raheel Zubairy, Rob Seidman, Riyaz Nakhooda


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.


Investment Portfolio

Maintain a record of your investment portfolios over time.

Bluemix Predictive Market Scenarios

Generate what-if financial market scenarios for use in the valuation of financial securities.

Bluemix Simulated Instrument Analytics

Compute theoretical or market calibrated valuation and associated analytics for investment securities such as equities, fixed income, and derivatives over alternative market conditions.

Cloud Foundry

Build, deploy, and run applications on an open source cloud platform.



Finding patterns in data to derive information.


Accessing computer and information technology resources through the Internet.

Platform as a Service

A platform for Cloud services making it easy to develop, deploy, and manage applications by abstracting the complexity of maintaining the infrastructure required to carry out these activities.

Related Blogs

Related Links