https://github.com/nibalizer/stock-picker-agent
This is an example of the ReAct pattern only. Do not use it. This is not financial advice.
https://github.com/nibalizer/stock-picker-agent
Last synced: 3 months ago
JSON representation
This is an example of the ReAct pattern only. Do not use it. This is not financial advice.
- Host: GitHub
- URL: https://github.com/nibalizer/stock-picker-agent
- Owner: nibalizer
- Created: 2025-09-11T06:28:28.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2025-09-11T06:34:37.000Z (9 months ago)
- Last Synced: 2025-12-19T09:26:57.400Z (6 months ago)
- Language: Python
- Size: 52.7 KB
- Stars: 1
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Yo this is vibe coded and isn't for real use
Just an example agent with tools - ReAct pattern
## Quickstart
```
uv run python main.py
```
## Example conversation:
```
uv run python main.py
Stock Picking Agent - ReAct Pattern
Agent Graph Structure (Mermaid):
========================================
---
config:
flowchart:
curve: linear
---
graph TD;
__start__([
__start__
]):::first
agent(agent)
tools(tools)
__end__([__end__
]):::last
__start__ --> agent;
agent -.-> __end__;
agent -.-> tools;
tools --> agent;
classDef default fill:#f2f0ff,line-height:1.2
classDef first fill-opacity:0
classDef last fill:#bfb6fc
========================================
Ask me about stock prices, company profiles, or investment advice!
Type 'quit' to exit, 'reset' to clear conversation history.
You: I''d like to invest 100K diversely in green energy - what stocks should I buy and how many units of each?
Agent: Here are the current stock prices for the selected green energy companies:
1. **NextEra Energy, Inc. (NEE)**: $71.04
2. **Enphase Energy, Inc. (ENPH)**: $37.12
3. **First Solar, Inc. (FSLR)**: $203.79
4. **Brookfield Renewable Partners L.P. (BEP)**: $25.14
5. **Plug Power Inc. (PLUG)**: $1.44
To diversify your $100,000 investment, we can allocate the funds evenly across these five companies. This means investing $20,000 in each stock.
Now, let's calculate how many units of each stock you can buy with $20,000:
1. **NEE**: $20,000 / $71.04 = approximately 281 shares
2. **ENPH**: $20,000 / $37.12 = approximately 538 shares
3. **FSLR**: $20,000 / $203.79 = approximately 98 shares
4. **BEP**: $20,000 / $25.14 = approximately 794 shares
5. **PLUG**: $20,000 / $1.44 = approximately 13,888 shares
### Summary of Investment:
- **NextEra Energy, Inc. (NEE)**: 281 shares
- **Enphase Energy, Inc. (ENPH)**: 538 shares
- **First Solar, Inc. (FSLR)**: 98 shares
- **Brookfield Renewable Partners L.P. (BEP)**: 794 shares
- **Plug Power Inc. (PLUG)**: 13,888 shares
This diversified approach allows you to spread your investment across different segments of the green energy market. Would you like any further assistance or information on these companies?
You: What if I wanted to buy ETFs for 75% and only 25% individual stocks
Agent: Here are the current stock prices for the selected green energy ETFs:
1. **iShares Global Clean Energy ETF (ICLN)**: $14.55
2. **Invesco Solar ETF (TAN)**: $41.91
3. **First Trust NASDAQ Clean Edge Green Energy Index Fund (QCLN)**: $37.69
4. **SPDR S&P Kensho Clean Power ETF (CNRG)**: $74.75
### Investment Allocation
With $75,000 allocated to ETFs, you can choose to invest in these ETFs. A balanced approach could be to invest equally in three of the ETFs. However, since we have four ETFs, we can allocate the funds as follows:
1. **ICLN**: 25%
2. **TAN**: 25%
3. **QCLN**: 25%
4. **CNRG**: 25%
This means you would invest $18,750 in each ETF.
### Number of Shares to Buy
1. **ICLN**: $18,750 / $14.55 = approximately 1,287 shares
2. **TAN**: $18,750 / $41.91 = approximately 447 shares
3. **QCLN**: $18,750 / $37.69 = approximately 497 shares
4. **CNRG**: $18,750 / $74.75 = approximately 250 shares
### Summary of ETF Investment:
- **iShares Global Clean Energy ETF (ICLN)**: 1,287 shares
- **Invesco Solar ETF (TAN)**: 447 shares
- **First Trust NASDAQ Clean Edge Green Energy Index Fund (QCLN)**: 497 shares
- **SPDR S&P Kensho Clean Power ETF (CNRG)**: 250 shares
### Individual Stocks Investment
With $25,000 allocated to individual stocks, you can invest in the previously mentioned companies. A balanced approach could be to invest equally in the five stocks:
1. **NEE**: $5,000
2. **ENPH**: $5,000
3. **FSLR**: $5,000
4. **BEP**: $5,000
5. **PLUG**: $5,000
### Number of Shares to Buy for Individual Stocks:
1. **NEE**: $5,000 / $71.04 = approximately 70 shares
2. **ENPH**: $5,000 / $37.12 = approximately 134 shares
3. **FSLR**: $5,000 / $203.79 = approximately 24 shares
4. **BEP**: $5,000 / $25.14 = approximately 199 shares
5. **PLUG**: $5,000 / $1.44 = approximately 3,472 shares
### Summary of Individual Stock Investment:
- **NextEra Energy, Inc. (NEE)**: 70 shares
- **Enphase Energy, Inc. (ENPH)**: 134 shares
- **First Solar, Inc. (FSLR)**: 24 shares
- **Brookfield Renewable Partners L.P. (BEP)**: 199 shares
- **Plug Power Inc. (PLUG)**: 3,472 shares
This diversified approach allows you to invest in both ETFs and individual stocks in the green energy sector. Would you like any further assistance or information?
You: no thank you, goodbye
Agent: You're welcome! If you have any more questions in the future, feel free to reach out. Goodbye and happy investing!
You: goodbye
Agent: Goodbye! Take care!
```