Skip to content
This repository has been archived by the owner on Dec 24, 2021. It is now read-only.
Steve Martinelli edited this page Mar 31, 2018 · 9 revisions

Short Name

Create a web app to give stock information, prices, and sentiment

Short Description

Learn how to use Watson Discovery and Watson news to get stock information and sentiment, monitor prices, and store trends.

Offering Type

Cognitive

Introduction

We'll show how to create a Nodejs web app that uses an opensource bootstrap template from Blackrock Digital. The application will use Watson Discovery and Watson News Service to gather information about the company, and display an analysis of positive or negative sentiment. Price information will come from Alph Vanguard, and all info will be stored in a Cloudant NoSQL database to monitor trends.

Author

By Charles Reitz, Grishma Jena, Shruti Mahale, Jayakrishna Duvvuri, and Allie Sanzi

Code

Demo

N/A

Video

Overview

In the world of investing, there are many metrics. Things like price, P/E, alpha, price-to-book, Free Cash Flow and many others are available to the public. But there is also the qualitative data that comes from news sources. An investor can make choices about a companies future value based on positive or negative news. For this, we can utilize Watson Discovery and the information in the Watson News Service to keep track of various companies. We'll show how to create a web app that allows the user to choose companies to monitor, view sentiment information and links to news stories, and track prices over time.

When the reader has completed this code pattern, they will understand how to:

  • Use the Watson Discovery News service
  • Create a Node JS app for a web interface to stock information
  • Access stock information from free APIs provided by Alpha Vantage
  • Store and retrieve information in a IBM hosted Cloudant NoSQL database

Flow

  1. The user adds and remove stocks they are interested in using the Web UI.
  2. User input is processed and routed to the backend server.
  3. The backend server stores stock information in a Cloudant NoSQL database for easy retrieval.
  4. The backend server uses Watson Discovery to find information about a specific company.
  5. The Watson Discovery Service queries the Watson News Collection for articles related to the company.
  6. The Alpha Vantage APIs are queried to find market price for a given company.
  7. News, sentiment, and stock price are all returned and rendered in the web app to the user.

Included components

  • IBM Watson Discovery: A cognitive search and content analytics engine for applications to identify patterns, trends, and actionable insights.
  • Cloudant NoSQL DB: A fully managed data layer designed for modern web and mobile applications that leverages a flexible JSON schema.

Featured Technologies

  • NodeJS: Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js' package ecosystem, npm, is the largest ecosystem of open source libraries in the world.

Blog

As part of a new hire training program called Developer JumpStart SLAM, we worked with the Developer Advocacy group to create Watson Stock Advisor. This app makes use of Cloudant DB, Watson Discovery and a 3rd party API (Alpha Vantage) to display stock prices, news articles and sentiment about different companies. Our goal was to provide developers with a reproducible example to jump-start their coding projects. The technology stacks used include Node.js and Angular.

The app has the ability to store a portfolio with select companies which mimics buying and selling stocks. The user can choose to add any NYSE or NASDAQ listed company to the portfolio or delete an existing one within the portfolio. The app also shows interactive graphs for sentiment breakdown and the trend over time along with recent news for the portfolio or for a given company. Alpha Vantage provides the historical prices for the stocks while Watson Discovery retrieves the recent news and sentiments for the companies.

We’re happy to announce that this app is now available as an IBM Code pattern. You can learn more about the Stock Advisor app and how it’s built, as well as get instructions for deploying the app to IBM Cloud, in the project’s README on GitHub. We can’t wait to see what exciting and innovative applications you create. Happy coding!

Learn more about:

Links