# ⚙️ Real Time Stock Market Analysis | Powered by Dappier and Agent.ai
Source: https://docs.dappier.com/cookbook/recipes/agent-ai-real-time-stock-market-analysis



[**Agent.ai**](http://Agent.ai) is a professional network and marketplace
for AI agents—and the people who love them. It allows users to discover,
connect with, and hire a variety of AI agents to perform useful tasks,
serving as a hub for agent-based collaborations and innovations.

[**Dappier**](https://dappier.com/developers/) is a platform that connects
LLMs and Agentic AI agents to real-time, rights-cleared data from trusted
sources, including web search, finance, and news. By providing enriched,
prompt-ready data, Dappier empowers AI with verified and up-to-date
information for a wide range of applications.

## Overview

The **Real Time Stock Analysis** is a custom AI-powered investment assistant built using Dappier's **Real Time Data** model. It is designed to create **data-driven trading strategies** and deliver **real-time financial news updates** for your chosen sector. Whether you're a seasoned investor or just starting out, this assistant ensures informed and optimized investment decisions by providing **customized plans** with stock recommendations, trend analysis, and market insights.

## Watch the Video Guide

If you prefer a visual walkthrough, check out the accompanying video guide below:

<iframe width="560" height="315" src="https://www.youtube.com/embed/hzaZ5Q9irnw?si=ottva3ihj1o5UUV4" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen />

***

## Key Features

* **Data-Driven Strategies:** Get personalized trading strategies tailored to the latest market trends and financial news.
* **Real-Time Financial News:** Stay updated with the latest financial news and insights for your chosen sector.
* **Customized Plans:** Receive detailed stock recommendations, trend analysis, and market insights.
* **Email Delivery:** Get your trading strategy delivered directly to your inbox for easy access and reference.

***

## How to Use the Real Time Stock Analysis

Using the Real Time Stock Analysis is simple and intuitive. Follow the steps below to create your personalized investment plan:

1. **Start the Analysis:**\
   Initiate the Real Time Stock Analysis by providing the sector you're interested in.

2. **Provide Your Email:**

   * Enter your email address to receive the detailed trading strategy.

3. **Receive Your Plan:**\
   The assistant will generate a **customized trading strategy** based on real-time financial news and market trends, and send it directly to your inbox.

***

## **SmartFlow Actions**

This agent is designed to provide users with a comprehensive stock market analysis, including financial news and market trends, to help them make informed investment decisions. Below are the SmartFlow actions configured for this agent:

### **1. Collect Sector Interest**

* **Action Type:** Get user input (text)
* **Prompt:** "Which sector are you interested in investing in?"
* **Variable:** `sector_name`
* **Functionality:** This step collects the user’s preferred investment sector and stores it in the variable `sector_name`.

### **2. Collect User Email Address**

* **Action Type:** Get user input (text)
* **Prompt:** "Please provide your email address to send a detailed analysis."
* **Variable:** `user_email`
* **Functionality:** The agent asks the user to enter their email address, which is stored in `user_email` for sending the final report.

### **3. Fetch Stock Market Trends**

* **Action Type:** Make REST API call
* **Endpoint:** `https://api.dappier.com/app/aimodel/am_01j06ytn18ejftedz6dyhz2b15`
* **Save Response To:** `stock_market_trends`
* **Functionality:** This step queries the Dappier API to retrieve real-time stock market trends, which are stored in `stock_market_trends` for further analysis.

### **4. Fetch Financial News**

* **Action Type:** Make REST API call
* **Endpoint:** `https://api.dappier.com/app/aimodel/am_01j06ytn18ejftedz6dyhz2b15`
* **Save Response To:** `financial_news`
* **Functionality:** This step queries the Dappier API to fetch the latest financial news, which is stored in `financial_news` for detailed stock analysis.

### **5. Generate Stock Analysis and Trading Strategy**

* **Action Type:** Invoke `o3-mini`
* **Prompt:**

```
You are an expert stock trader analyst who creates a detailed trading strategy and provides the top stocks to invest in based on financial news and market trends.

**Financial News:**
`{{financial_news}}`

**Stock Market Trends:**
`{{stock_market_trends}}`

**Output:**
The output should be formatted as HTML for emails.
```

* **Save Response To:** `assistant_response`
* **Functionality:** The AI processes real-time financial news and stock market trends to generate a structured trading strategy, including top stock recommendations. The response is formatted as an HTML email for easy readability.

### **6. Send Email with Stock Analysis**

* **Action Type:** Send Email
* **Recipient:** `user_email`
* **Email Content:** `assistant_response`
* **Functionality:** The formatted HTML stock market analysis is sent to the user’s provided email address.

### **7. Display Confirmation Message**

* **Action Type:** Output result
* **Message:** "Please check your inbox for the detailed trading strategy."
* **Format:** Auto-format under the heading **Email sent to - `user_email`**
* **Functionality:** This step confirms to the user that the stock analysis report has been successfully sent to their email.

## Example Prompts

Here are some example prompts to help you get started with the Real Time Stock Analysis:

* **Sector Prompt:**

  * "Which sector are you interested in investing in?"
  * Example: "Technology"

* **Email Prompt:**
  * "Please provide your email address to send a detailed trading strategy."
  * Example: "[john.doe@example.com](mailto:john.doe@example.com)."

***

## Sample Output

Once you provide the necessary details, the Real Time Stock Analysis will generate a trading strategy similar to the example below and send it to your email:

Email Sent to - [john.doe@example.com](mailto:john.doe@example.com)

**Subject:** Your Customized Trading Strategy for the Technology Sector

***

### **Tech Market Weekly Update**

**Date:** February 27, 2025

***

### **Market Overview & Trading Strategy**

The technology sector continues to outperform with significant momentum driven largely by advancements in artificial intelligence and robust earnings reports. The Morningstar US Technology Index has risen by **30.16%** over the past year, outperforming broader market gains of **23.92%**. This rapid growth, fueled by innovations from industry leaders, supports a continued bullish stance on tech stocks.

Our trading strategy for the coming period is to adopt a **diversified approach** within the tech sector with a focus on companies that are leading in AI, cloud, and other transformative technologies. Here’s a breakdown of the key aspects of our strategy:

* **Long-Term Investment:** Focus on holding core positions in market leaders with sustained growth in innovative technology.
* **Volatility Management:** Allocate a portion of the portfolio towards stocks that may experience short-term volatility (e.g., Tesla and Nvidia) but have strong fundamentals and growth potential.
* **Sector Diversification:** While tech remains a focus, continuously monitor market sentiment and diversify across sub-sectors like AI, cloud computing, and e-commerce within tech.
* **Risk Exposure:** Leverage earnings reports and product launch updates to adjust positions, keeping a keen eye on market trends and potential headwinds associated with high-growth stocks.

***

### **Top Tech Stocks to Watch**

#### **Nvidia (NVDA)**

* **Performance:** Up over **171%** on the year.
* **Strategy:** With its leadership in AI and gaming technology, Nvidia remains a top pick. Despite recent earnings volatility, its future product pipeline offers a strong growth narrative.

#### **Apple (AAPL)**

* **News:** Increasing investments in AI and machine learning alongside sustainability initiatives.
* **Strategy:** Apple’s reinforced commitment to innovation and massive market share (\~22% of the U.S. stock market) makes it ideal for long-term growth.

#### **Microsoft (MSFT)**

* **News:** Expanding AI integration into cloud services and Office products.
* **Strategy:** Consistent performance driven by cloud services and AI investments makes Microsoft a reliable cornerstone of any tech portfolio.

#### **Amazon (AMZN)**

* **News:** Robust growth from AWS and logistics expansion, alongside an enhanced AI-powered Alexa.
* **Strategy:** Amazon’s diversified revenue streams in e-commerce, cloud, and logistics provide a balanced growth opportunity.

#### **Meta Platforms (META)**

* **News:** Revitalizing user engagement and exploring new advertising and metaverse opportunities.
* **Strategy:** As Meta recovers and innovates within social media and digital advertising, it’s positioned for mid-to-long-term gains.

#### **Alphabet (GOOGL)**

* **News:** Dominance in online advertising along with aggressive AI initiatives.
* **Strategy:** Alphabet’s expansive ecosystem and service diversification continue to make it a compelling long-term buy.

#### **Tesla (TSLA)**

* **News:** Ongoing innovation in electric vehicles combined with energy solutions.
* **Strategy:** Tesla’s volatility offers trading opportunities for tactical positions, especially for investors with a higher risk tolerance.

***

### **Implementation & Next Steps**

Moving forward, consider the following action items:

1. **Monitor Earnings Reports:** Regularly review quarterly earnings to adjust exposure to issue-driven volatility.
2. **Stay Updated on Product Developments:** Focus on how tech giants are leveraging AI and innovative technologies to drive growth.
3. **Adjust Risk Management:** Balance high-growth opportunities with stable investments, ensuring a well-diversified portfolio.
4. **Sector & Market Trends:** Keep an eye on overall market sentiment and sector performance indices as indicators of broader economic conditions.

By aligning these strategies with recent financial news and robust stock market trends, investors can capitalize on both short-term opportunities and long-term growth potentials within the tech sector.

***

### **Disclaimer**

This email is for informational purposes only and should not be construed as financial advice. Always consult a professional advisor before making any investment decisions.

***

## Why Choose the Real Time Stock Analysis?

* **Real-Time Data:** Access up-to-date financial news and market trends for your chosen sector.
* **Personalized Plans:** Get trading strategies tailored to your investment goals and market conditions.
* **Seamless Experience:** Simplify your investment planning with an intuitive and interactive assistant.

***

## Get Started Today

Ready to optimize your investment strategy? Use the **Real Time Stock Analysis** to create a personalized, data-driven trading plan and stay informed with real-time financial updates for your chosen sector. Start your journey now and make smarter investment decisions!

For any questions or support, feel free to reach out to our team. Happy investing! 📈💼