FMP
May 17, 2024 9:39 AM - Sanzhi Kobzhan(Last modified: May 28, 2024 8:12 AM)
Image credit: social sentiment
I have already explained how to calculate a stock's target price and build a basic stock fair value calculator app, even if you don't have programming skills. You can read the article on stock target price calculation to follow step-by-step guidance and build that app. Read it before extracting the social sentiment because you need to understand how to create an HTML and JS file and download VSCode. Now, let's update our app and add more great functionality. We will add social sentiment. This is a great way to know what people think of your selected stock and track trader confidence. Social sentiment tracks social networks and observes positive and negative mentions of your selected stock. By analyzing the sentiment, you can get an idea of your stock's "popularity" among traders.
First, let's update our app and add sentiment functionality, and then I will explain how to read the extracted data. We already have a basic HTML body and JS files. First, let's update the HTML file called demo endpoint.html and add a sentiment field and also a text field where you can input your stock ticker. Copy the code from the picture below.
As you can see, I added social sentiment and a text field where the user can input a stock ticker.
Now let's update our script.js file. I divided the file into several sections so that you can see the changes we made. First screen is stock target price extraction.
The apiKey field is blank because you will have to input it manually. Register on the FMP website to obtain your unique API key. Then input your key in the field within the brackets. I have added the symbol, which will be extracted from our demo endpoint.html file, and put the "symbol" into our link provided by FMP to extract data. Other fields remain unchanged.
The next step is to add new fetch request to get social sentiment. Write the code in the same fie, its just a continuation of the above code.
As you can see, a new request has been added. The link will fetch social sentiment API to extract the sentiment, and when we receive the 'data,' it will extract Twitter and Stock tweets sentiment into our application. In this step, we extract data and connect it with our app.
The next step is to check if the data is not empty. If it is empty, it will display the message 'Social sentiment data not available.' If data exists, it will fill in the data in our HTML file.
Now, save both files, demo endpoint.html and script.js. Open the browser and drag your demo endpoint.html file into the browser's open window. When you complete this step input the stock ticker in the field and press the "get data" button and you will see this:
Sentiment indicates the overall sentiment on the social network. A sentiment of 0.46, as in our example, would also mean 46%. This indicates that it has almost equal positive and negative mentions on social networks. You should generally consider stocks with a sentiment above 0.6 or 60%, as they will have more positive mentions. To learn more about social sentiment, read the article on indicators that can identify stock direction. In this case, we also see the number of comments and posts on your selected stock for a single day.
Now you have two great functionalities in your app and can see the stock target price, calculate its growth potential from the current market price, and see what traders think of your selected stock. Thank you for reading the article.
May 14, 2024 11:41 AM - Sanzhi Kobzhan
A stock's target price, also known as its fair value, is an indication of what a share can cost based on the company’s forecasted financial statements. It is important to know a stock's fair value to find undervalued stocks with great growth potential. Let's consider how investment analysts calculat...
May 24, 2024 9:30 AM - Rajnish Katharotiya
Earnings call transcripts are invaluable resources for investors, analysts, and financial enthusiasts. They provide insights into a company's performance, strategy, and future outlook, making them essential for making informed investment decisions. With Financial Modeling Prep, Earnings Call Transcr...
May 27, 2024 3:30 PM - Rajnish Katharotiya
In the ever-evolving world of technology, certain sectors have consistently demonstrated exceptional growth and innovation. The graphics processing units (GPUs) industry is one such sector, offering investors a golden opportunity for potentially high returns. In this blog, we'll delve into why inves...