Real-Time Market Analysis with AI
- Marco Antônio de Andrade
- 3 days ago
- 5 min read
Real-time information and quotes of publicly traded companies in the stock market.
Introduction
Access to fast, accurate, and contextualized information is essential in any field, but it becomes critical in the financial market, where decisions need to be made quickly and based on solid foundations. In this dynamic environment, professionals constantly deal with large volumes of data, unstable economic variables, and unpredictable market movements. Therefore, tools that provide a clear, real-time view with intelligent analytical support are essential to assist in decision-making.
With this in mind, I developed this application that allows investors, analysts, and market enthusiasts to monitor the performance of listed stocks in real-time, with quick access to quotes, interactive charts, and analyses generated by artificial intelligence. The interface was designed to make it easy to consult both historical and current data, making it quicker to identify trends, opportunities, and relevant movements in the financial market.
Features and Benefits
Based on the provided ticker, the application returns the latest news related to the company and displays the historical stock prices. In this version, I configured the system to present data from the last six months, allowing for a recent and contextualized analysis of the asset's behavior. See it in practice:
The first results presented by the application include a summary of analyst recommendations and the latest news related to the company, along with the references used by the AI during the research. This initial step aims to provide the user with a clear and up-to-date overview of the company's context, facilitating a better understanding of the current situation.
This is one of the key differentiators of the project, as it not only allows for the analysis of historical data through the charts presented in the following sections, but also provides a current view of the major events that could impact the price and trading volume. This combination of recent context and past data makes the analysis more comprehensive and valuable for decision-making.

After this overview, the application returns four charts:
1st) Visualization of the closing price evolution of the stock over the past six months.

In this example, Microsoft closed at $436.54 on 12/04/2024. This data was extracted from the Yahoo Finance and can be verified directly on the official website, as highlighted in red in the image below.

This analysis provides several insights, such as the overall trend of the asset, volatility, reactions to events, support and resistance zones, seasonal or behavioral patterns, and potential entry and exit points.
2nd) Candlestick chart to represent the price variation of the last six months.
The candlestick chart is a powerful tool because it condenses a large amount of information in a visual and intuitive way, allowing for quick identification of behavior patterns and trends. Each candle displays the opening, closing, high, and low prices of a period.

In this example, we can see that the candle for February 27, 2025, represents the opening price, closing price, highest price, and lowest price recorded during that period. Yahoo Finance:

By analyzing the chart, we can understand the strength and direction of price movements, identify reversal or continuation patterns, gauge market sentiment, determine the optimal timing for entry and exit, and perform a clear comparative analysis across different periods.
3rd) Moving Average Chart for the Last Six Months.
In this chart, we can observe three lines:
Close: closing price of the day.
SMA_20: simple moving average. For this application, we used a 20-period window.
EMA_20: exponential moving average. For this application, we also used a 20-period window.

With these three data points, we can analyze trends and determine under which conditions the moving averages are better or worse reflecting the closing price.
4th) Chart with the trading volume of the last six months.
In addition to understanding price behavior through the previous charts, we can analyze the evolution of trading volume over time.

In this example, the chart shows the trading volume on March 24, 2025, as highlighted in red in the image below of Yahoo Finance.

Trading volume is related to the intensity of trading and market confidence, which are crucial aspects for those who follow the stock market.
Development
This project was developed with the goal of monitoring the stock market in real-time, combining artificial intelligence, financial APIs, and interactive data visualization. A set of tools and knowledge had to be gathered to complete the project. Among the tools used are:
Python: Served as the base language to develop the entire application, including back-end logic, orchestration of AI agents, data collection from financial sources, interactive chart generation, and the construction of the web interface with Streamlit.
Yahoo! Finance API (yfinance): A library that allows access to public financial data from the Yahoo! Finance platform. It was used to collect historical prices, volume, news, and recommendations for listed stocks. The data is consumed both directly in the back-end (via custom functions) and through the AI agents of Phidata.
Groq: A technology that runs advanced artificial intelligence models very quickly. It is used as the foundation to execute models like DeepSeek and Llama-3, which are responsible for the responses of the AI agents. In the project, Groq ensures that the analyses done by the agents happen in real-time with high performance. It works as the "engine" behind the agents created with the Phidata library, processing everything efficiently.
Phidata: A Python library for building intelligent agents with support for multiple tools and models. In this project, it played the role of structuring the agents to perform web searches and data analysis. It acts as the orchestrator of the agents that consume data from the API (Yahoo, DuckDuckGo) and are processed by models in Groq.
DuckDuckGo (via Phidata): An integrable search tool used by agents to gather updated information from the web. It allows the web agent to search for the latest relevant news about the company being analyzed, with included sources. It also works together with Groq and Phidata to complement the Yahoo! API data with up-to-date web context.
Plotly: A Python visualization library responsible for creating the line, candlestick, volume, and moving average charts in an interactive way. It uses the historical data extracted via yfinance and displays it on the front-end built with Streamlit.
Streamlit: A framework for building data apps with a web interface quickly using Python. It is responsible for the graphical interface of the application, where the user inputs the ticker, triggers the AI, and views the charts and analyses.
These skills were mainly acquired through my postgraduate studies in Data Analysis at DSA - Data Science Academy.
Conclusion
This project was crucial for deepening my understanding of the financial market's needs, as well as strengthening my skills in data analysis, storytelling, and validating information generated by artificial intelligence.
The main benefit for users of the application is the speed and quality of decision-making, with a single hub of reliable information and automated analyses. The combination of real-time data and AI-generated insights offers a strategic advantage for both short-term traders and those who want to follow the market with more intelligence. All of this is provided without the need for complex or expensive platforms, as the solution delivers simplicity, performance, and analytical depth in one place.
In this project, the application runs locally, but it is possible to deploy it to the cloud, allowing access via the web. This also enables the creation of checkout pages to transform the solution into a SaaS service.
Want to learn more about the project? Get in touch by clicking the button below:
Comments