LSTM neural network that makes stock trend predictions based on technical and fundamental analysis Disclaimer The information in this project is not financial advice and should not be used to make any financial decisions. The purpose of the project is to demonstrate the effectiveness of using long short-term memory neural networks to make predictions of trends in the stock market. Any opinions, news, research, analyses, prices, or other information offered is provided as general market commentary, and does not constitute investment advice. I will not accept liability for any loss or damage, including without limitation any loss of profit, which may arise directly or indirectly from use of or reliance on such information.
Data is obtained for this project using Yahoo Finance. Libraries needed for this project are found in the 'Libraries.py' file and can be copied and pasted into a new project. To test to see if all necessary libraries are installed, run the 'Libraaries.py' file. If all libraries needed are installed, there will be a notification "Loaded libraries successfully!" and if there are missing libraries, run 'pip install' then the library name. (ex. pip install keras)
The user will enter a ticker symbol. Once the yahoo finance data ([Open],[High],[Low],[Close], [Adj Close], [Volume]) is downloaded, the new input dataset can be created using the Pandas Technical Analysis package. There is no need to enter a date because the 'datetime' package allows the program to know what day it is as soon as it is run.
The Pandas_TA package uses the data obtained from yahoo finance to compute various indicators. These indicators include momentum, volume, volatility, trend, and returns indicators. For this project, the relative strength index (RSI) to detect overbought or oversold conditions, volume weighted average price (VWAP) for volume, Bollinger bands to detect volatility, and moving averages (EMAF, EMAM, and EMAS) to detect trends and reversals were used in the model. This can be easily customized to different indicators if desired. For more information on Pandas_TA, check out: https://technical-analysis-library-in-python.readthedocs.io/en/latest/ta.html
Fundamental Analysis is used to determine the intrinsic value of a company. In order to perform fundamental analysis, the balance sheet, income, and cash flow statements are analyzed. Using the information from the balance sheet, different ratios such as price to sales (P/S) and price to earnings (P/E) can be used to analyze the true value of a stock. The P/S ratio is used to determine how much value investors place in a company, and the P/E ratio is used to describe how much an investor pays for each dollar earnings.
A pie chart displaying the percentage of positive, negative, and neutral news articles within the most recent Google News articles. A word cloud suggests how often certain words are found in those articles and give the user an idea of the overall sentiment. Strong or weak news sentiment can cause large swings in prices in a short amount of time, even across an entire sector.