Skip to content

Gregory-mcbit/AI-Stock-Dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI-Stock-Dashboard

Description

AI-Stock-Dashboard is an interactive dashboard that combines financial data visualization with AI-driven analysis. The application fetches real-time stock price data and displays interactive charts with key technical indicators. It leverages a multimodal AI model to analyze stock charts and provide insightful commentary on trends, patterns, and potential signals. By integrating Streamlit for the user interface and an AI vision model for chart analysis, the dashboard helps traders and investors make sense of market movements in an intuitive way.

Installation and Setup

  1. Clone the Repository – Download or clone the AI-Stock-Dashboard project from the repository to your local machine

  2. Install Dependencies – Navigate to the project directory and install required packages:

    pip install -r requirements.txt
  3. Set Up the AI Model – Install Ollama and download the Llama 3.2 Vision model. You can pull the model by running. This step ensures the AI model for image (chart) analysis is available locally:

ollama pull llama3.2-vision
  1. Launch the AI Backend – In a separate terminal, start the Llama 3.2 Vision model service with Ollama:
ollama run llama3.2-vision
  1. Run the Streamlit App – Start the dashboard web application by running the Streamlit app:
streamlit run main.py

How to Use

  • Select a Stock – In the Streamlit interface, enter the ticker symbol of the stock you want to analyze (for example, AAPL for Apple or TSLA for Tesla). You can also adjust the date range or interval.

  • View Interactive Chart – Click the Fetch data button to fetch the stock data. The dashboard will display an interactive chart with the stock’s price history. Key technical indicators – such as the Simple Moving Average (SMA), Exponential Moving Average (EMA), and Bollinger Bands – are overlaid on the price chart for context. You can hover over or zoom into the chart to inspect specific data points.

  • AI-Powered Analysis – Once the chart is displayed, the AI analysis is ready to go. The AI Analysis panel will show a textual commentary generated by the Llama 3.2 Vision model. This analysis might highlight trends (e.g. “the stock is in an uptrend”), recognize chart patterns, or note signals (like “prices touching the upper Bollinger Band, which may indicate overbought conditions”).

  • Interpret the Insights – Read the AI’s commentary in conjunction with the chart. For example, if the AI notes that a short-term EMA has crossed above a long-term SMA, it might be signaling bullish momentum. The combination of visual chart and AI explanation can help you interpret complex indicators more easily.

  • Adjust and Explore – Feel free to change the stock symbol or timeframe and observe how the indicators and AI analysis update. You can toggle technical indicators on or off in the interface if you want to focus on specific ones. The dashboard is meant for exploratory analysis, so you can investigate multiple stocks and time periods in one session.

  • Disclaimer – Use the insights as a guide, not definitive investment advice. The AI and indicators provide analysis based on historical data, which should be complemented with your own research and judgment.

Technical Indicators Explained

Technical indicators are mathematical tools applied to price data that help traders identify trends, momentum, and volatility in the market. Below is an explanation of the indicators used in this dashboard and why they are important in technical analysis:

  • Simple Moving Average (SMA)

    A Simple Moving Average is the average price of a security over a specific time period, calculated on a rolling basis. For example, a 20-day SMA averages the closing prices of the last 20 trading days. As each new day closes, the oldest day in the period is dropped from the calculation. SMAs smooth out short-term fluctuations, making it easier to see the underlying price trend. Traders often use moving averages to determine trend direction; for instance, if the price is consistently above the 50-day SMA, the asset is likely in an uptrend. An SMA can also signal potential trend reversals – for example, if the price falls below a long-term SMA that it was consistently above, it might indicate a bearish shift. Overall, SMAs are important because they filter out “noise” and help identify the general direction of a stock’s movement.

  • Exponential Moving Average (EMA)

    An Exponential Moving Average is a type of moving average that gives more weight to recent prices in its calculation. Like the SMA, it is used to smooth price data, but the EMA’s weighting makes it respond more quickly to recent price changes. This sensitivity is useful for catching trends earlier. For example, a 20-day EMA will react faster to a price spike than a 20-day SMA, highlighting shifts in momentum sooner. Traders often watch for moving average crossovers with EMAs – for instance, when a short-term EMA (like 10-day) crosses above a longer-term EMA (like 50-day), it can be a bullish signal (often called a “golden cross”), indicating upward momentum. Conversely, a short-term EMA crossing below a long-term EMA (a “death cross”) may signal a bearish turn. EMAs are important because they provide timely insight into momentum changes while still smoothing out noise, and they are commonly used in strategies to generate trading signals.

  • Bollinger Bands (BB)

    Bollinger Bands consist of three lines: a middle band which is typically a 20-day SMA, and an upper and lower band which are offset above and below the SMA by a certain number of standard deviations (usually 2 standard deviations). This creates a channel around the price. Bollinger Bands dynamically expand and contract based on the stock’s volatility: the bands widen when price variability increases and narrow when the price is more stable. The position of price relative to the bands provides insight into market conditions. When the price approaches or touches the upper band, the asset may be considered overbought – it’s trading relatively high compared to recent history. When it approaches the lower band, the asset may be oversold – trading relatively low in its recent range. Traders use these signals to spot potential reversal points; for example, an oversold signal might precede a rally as buyers step in, while an overbought signal could foreshadow a pullback as sellers take profits. Bollinger Bands are important because they incorporate both trend (through the moving average) and volatility. They help traders visualize how far prices deviate from an average norm, which is useful for identifying extreme conditions, breakout scenarios, or periods of consolidation.

Roadmap & Future Improvements

The project is in active development. Here are some planned features and enhancements for future releases:

  • Additional Indicators: Include more technical indicators such as Relative Strength Index (RSI), Moving Average Convergence Divergence (MACD), and support/resistance levels to broaden the analytical capabilities of the dashboard.

  • Enhanced AI Explanations: Upgrade the AI model or fine-tune it for finance-specific analysis to provide more nuanced insights (e.g., recognizing candlestick patterns or incorporating news sentiment into the analysis).

  • User Customization: Allow users to customize which indicators to display and set their parameters (for example, choosing a 50-day vs 20-day SMA, or changing Bollinger Band standard deviation).

  • Real-time Data & Alerts: Implement live updating charts with real-time stock data and possibly add alert features (e.g., notify the user if a certain indicator condition is met, like a crossover or band breakout).

  • Performance Optimizations: Improve the efficiency of data fetching and AI inference by caching stock data or using a lighter AI model when appropriate.

  • Deployment: Containerize and deploy the application to a cloud service so that users can access the dashboard via a website without local installation. This might include an authentication system for user-specific settings.

Contributors

  • Gregory – Project Creator and Lead Developer

License

This project is licensed under the MIT License. Feel free to use, modify, and distribute the code as permitted by the license.

About

AI-Stock-Dashboard is an interactive web dashboard that visualizes historical stock data with technical indicators (SMA, EMA, and Bollinger Bands) and provides AI-generated analysis, making technical analysis simple and accessible.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages