-
Notifications
You must be signed in to change notification settings - Fork 51
Home
Create a web app to give stock information, prices, and sentiment
Learn how to use Watson Discovery and Watson news to get stock information and sentiment, monitor prices, and store trends.
Cognitive
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.
By Charles Reitz, Grishma Jena, Shruti Mahale, Jayakrishna Duvvuri, and Allie Sanzi
N/A
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
- The user adds and remove stocks they are interested in using the Web UI.
- User input is processed and routed to the backend server.
- The backend server stores stock information in a Cloudant NoSQL database for easy retrieval.
- The backend server uses Watson Discovery to find information about a specific company.
- The Watson Discovery Service queries the Watson News Collection for articles related to the company.
- The Alpha Vantage APIs are queried to find market price for a given company.
- News, sentiment, and stock price are all returned and rendered in the web app to the user.
- 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.
- 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.
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:
- Artificial Intelligence Code Patterns: Enjoyed this Code Pattern? Check out our other AI Code Patterns.
- AI and Data Code Pattern Playlist: Bookmark our playlist with all of our Code Pattern videos
- With Watson: Want to take your Watson app to the next level? Looking to utilize Watson Brand assets? Join the With Watson program to leverage exclusive brand, marketing, and tech resources to amplify and accelerate your Watson embedded commercial solution.
- Watson pics stocks on an ETF
- Watson Analytics’ Intelligent Application on Financial Markets
- The Motley Fool [IBM Watson: Everything You Ever Wanted to Know] (https://www.fool.com/investing/2017/08/30/ibm-watson-everything-you-ever-wanted-to-know.aspx)