Learn more >
Get the code
Try the app
by Kevin Hoyt, Raheel Zubairy | Published February 14, 2018
CloudFinanceNode.jsPlatform as a Service
Archived date: 2019-05-01
In these volatile economic times, investors need to better understand the effects of different market conditions on their portfolios. This code pattern shows you how to build a stress-testing app for investment portfolios that has the added benefit of integration with natural language generation (NLG) so you can produce detailed, well-written portfolio analyses.
The financial markets are always on the move. Anyone with an investment portfolio knows how stressful it can be to watch the markets move and not know what the effects will be on their investment portfolio.
For developers, the challenge comes in providing insight and accurate predictions about how a portfolio might perform under a wide variety of conditions. In addition, we need to provide results that can be easily understood by financial advisors and the wider public. It doesn’t make sense to create a complex application if it can’t produce data and reports that are easily interpreted by the people who need the information.
This code pattern shows you how to compute a stress test using multiple services. You apply the Predictive Market Scenario service and Simulated Instrument Analytics service to a set of investments maintained in the Investment Portfolio service. Then, you narrate the results in the form of a textual report using the Arria NLG service.
The Investment Portfolio service manages and stores portfolios and financial security information, such as the set of eligible investments, benchmarks, and user portfolios. The Predictive Market Scenarios service generates a scenario representing an alternative, potential state of the market, which can then be applied to the assets in the Investment Portfolio service using the Simulated Instrument Analytics service.
The results that you generate include observed correlations and co-variances of market risk factors (for example, interest rates, equity indexes, and foreign exchange rates), expected possible movements based on a user-defined market shock, and profits and losses for each asset in the investment portfolio. And because results from this kind of stress-testing can be difficult to interpret and parse for meaning, you implement natural language generation. Instead of poring over complex data, you pipe the results to the Arria NLG service, which generates a human-readable interpretation of the results.
This pattern walks you through the steps required to build a web app that integrates sophisticated analysis with innovative new NLG technology. You’ll create a simplified user interface that demonstrates how to collect information on any type of stress that the user wants to observe, and then formulates a narrative to be displayed alongside the charts and graphical representation of the results. For anyone looking to build in-demand, innovative, and practical skills in a financial development environment, this is the place to start.
Find detailed technical steps for this code pattern in the README.md file in the GitHub repository.
Get the Code »
January 31, 2019
April 8, 2019
Back to top