Scenario: Comparing Tech Stocks
Suppose you want to compare major tech companies and understand the broader technology sector trends.Step 1: Download Historical Data for Multiple Tickers
Prompt to AI:“Get the last 3 months of daily price data for Apple, Microsoft, and Google”The AI assistant will use
yf_download to fetch data for multiple tickers at once:
Step 2: Compare Historical Performance
Prompt to AI:“Show me a side-by-side comparison of these stocks over the past year”The AI will use
yf_tickers_history with column grouping:
Step 3: Get Market Summary
Prompt to AI:“What’s the current US market status?”The AI uses
yf_market to fetch market information:
Step 4: Analyze Technology Sector
Prompt to AI:“Show me the top companies and overview of the technology sector”The AI uses
yf_sector to get sector details:
Step 5: Get Sector Overview
Prompt to AI:“What’s the technology sector overview and trends?”
Saving Your Analysis
You can export any dataset to CSV or JSON for further analysis: Prompt to AI:“Export this comparison to a CSV file called tech_comparison.csv”The AI will add save parameters:
Common Market Analysis Prompts
- “Compare the performance of SPY, QQQ, and DIA over the past month”
- “What are the top ETFs in the technology sector?”
- “Show me the European market status”
- “Get the top 10 companies in the healthcare sector”
- “Download 5 years of weekly data for the S&P 500”
Tips
- Use
periodfor relative timeframes (“1d”, “5d”, “1mo”, “3mo”, “6mo”, “1y”, “2y”, “5y”, “10y”, “ytd”, “max”) - Use
startandenddates for specific date ranges (format: “YYYY-MM-DD”) - The
intervalparameter accepts: “1m”, “2m”, “5m”, “15m”, “30m”, “60m”, “90m”, “1h”, “1d”, “5d”, “1wk”, “1mo”, “3mo” - Set
group_by: "ticker"when comparing multiple stocks to organize data by symbol - Use
response_format: "markdown"to get human-readable table output