🤖 Priced In [ARCHIVED]
Note: This repository has been archived. It served as an experimental AI-powered autonomous stock trading agent that ran from June to October 2025.
📊 Final Results
Initial Investment: $1,000.00
Final Portfolio Value: $1,389.80
Total Return: +38.98% ($389.80 gain)113 days)
Annualized Return (CAGR): 136.67%
Trading Period: June 24, 2025 - October 15, 2025 (
Total Trades Executed: 60+ trades
Final Holdings
| Asset | Shares | Value |
|---|---|---|
| Cash | - | $0.03 |
| NVDA (Nvidia) | 4.82 | $959.42 |
| GOOGL (Google) | 1 | $290.10 |
| XLI (Industrial Sector ETF) | 0.106 | $16.35 |
| XLP (Consumer Staples ETF) | 0.729 | $55.72 |
| XLU (Utilities Sector ETF) | 0.380 | $34.07 |
| XLV (Health Care Sector ETF) | 0.23 | $33.87 |
| XLY (Consumer Discretionary ETF) | 0.001 | $0.24 |
🎯 The Experiment
This project explored the capabilities and limitations of autonomous AI agents in financial decision-making by creating a fully automated trading bot that:
- Operated independently - Made all trading decisions without human intervention
- Ran on GitHub Actions - Executed trades every 6 hours via scheduled workflows
- Used OpenAI’s Agents framework - Leveraged GPT-4 with function calling for decision-making
- Had full market access - Could research stocks, check prices, and execute trades
- Self-documented - Updated its own README with portfolio performance after each session
How It Worked
The agent followed a systematic approach each trading session:
- Think - Used structured reasoning to plan its approach
- Portfolio Review - Checked current holdings and performance
- Market Research - Searched the web for market trends, news, and opportunities
- Analysis - Evaluated potential trades based on momentum, news, and technical factors
- Execution - Made buy/sell decisions within risk management constraints
- Logging - Recorded all decisions and reasoning in
agent.log
The system prompt instructed the agent to:
- Focus on growth while managing risk
- Never put all capital in a single position
- Maintain some cash reserve for flexibility
- Track performance against the initial $1,000 investment
- Always think before acting using a dedicated “think” tool
🔧 Technical Implementation
Built with:
- Node.js + TypeScript for the core agent logic
- OpenAI Agents Framework (
@openai/agents) for AI orchestration - GPT-4.1-mini for decision-making and web search
- GitHub Actions for scheduled execution (every 6 hours)
- Git automation for portfolio persistence and README updates
Key Features
- Web Search Integration: Agent could research stocks and market conditions in real-time
- Fractional Shares: Supported buying partial shares for precise capital allocation
- Persistent Memory: Maintained conversation history across sessions via
thread.json - Automated Logging: Every decision and trade was logged with timestamps
- Self-Updating Dashboard: Automatically updated README with current portfolio state
Architecture
// Core tools available to the agent
- think: Structured reasoning before actions
- get_portfolio: Check current holdings
- get_net_worth: Calculate total value
- get_stock_price: Fetch current prices
- buy: Execute purchase orders
- sell: Execute sell orders
- web_search: Research markets and news
The agent operated with full autonomy within these constraints:
- Started with $1,000 cash
- Could only trade during market hours (via real-time price APIs)
- Had to manage its own cash balance
- Self-imposed risk management rules (no single-stock concentration)
📈 What We Learned
Successes
- Technical Feasibility: Autonomous AI trading agents can be built and operate reliably
- Positive Returns: The agent achieved ~39% returns over ~4 months
- Consistent Execution: Successfully ran 100+ automated trading sessions without failures
- Risk Management: Generally followed diversification principles
- Momentum Capture: Effectively identified and traded on momentum in tech stocks (especially NVDA)
Limitations & Observations
- Market Timing Dependency: Results heavily influenced by being active during a tech bull market
- Heavy Tech Concentration: Final portfolio was ~69% NVDA, showing concentration risk
- Short-Term Focus: Primarily made short-term momentum trades rather than long-term investments
- Cost Considerations: Real-world trading costs (fees, spreads, taxes) not simulated
- Limited Market Context: No access to fundamental analysis, financial statements, or complex technical indicators
- Reasoning Quality: While “think” tool provided transparency, reasoning was sometimes superficial
- No Backtesting: Performance not validated across different market conditions
Trading Patterns
Analyzing the 60+ trades:
- Initial Phase (June): Aggressive buying of tech stocks (TSLA, NVDA, PLTR, GOOGL)
- Mid Phase (July-Aug): Active rotation between sector ETFs (XLI, XLP, XLU, XLV, XLY)
- Late Phase (Sep-Oct): Consolidation into core positions, mostly holding NVDA
- Average Hold Time: Short-term (often 6-48 hours), typical of momentum trading
- Win Rate: Not explicitly tracked, but frequent small trades suggest active management style
🎓 Key Takeaways
- AI can trade, but context matters: The agent made reasonable decisions within its programmed constraints, but lacked deep market understanding
- Transparency is crucial: The “think” tool requirement provided valuable insight into the agent’s reasoning
- Bull markets help: Results likely wouldn’t replicate in bearish or volatile conditions
- Automation works: GitHub Actions proved to be a reliable platform for scheduled agent execution
- AI is a tool, not magic: The agent followed patterns similar to novice momentum traders
⚠️ Important Disclaimers
- Educational Purpose Only: This was an experiment in AI capabilities, not investment advice
- Past Performance ≠ Future Results: The positive returns occurred during favorable market conditions
- Not Financial Advice: This project does not constitute financial, investment, or trading advice
- Significant Risks: Real trading involves substantial risk of loss. Never invest money you can’t afford to lose
- Simulated Environment: While using real price data, this didn’t execute real trades or account for real-world costs
- No Endorsement: Results should not be interpreted as endorsement of autonomous trading systems
📚 Resources
- Agent Source Code - The complete trading agent implementation
- System Prompt - Instructions given to the AI agent
- Trading Log - Complete log of all decisions and trades
- Portfolio History - Final state of holdings and trade history
- GitHub Actions Workflow - Automation configuration
🔍 For Researchers & Developers
If you’re interested in AI agents or algorithmic trading:
- Study the logs:
agent.logcontains the complete decision-making history - Review the prompt:
system-prompt.mdshows how the agent was instructed - Examine the code:
agent.tsdemonstrates OpenAI Agents framework usage - Analyze trades:
portfolio.jsonhas the complete trade history with timestamps and prices
Running Locally (Historical)
While the live trading is archived, you can still run the code locally to study it:
git clone https://github.com/AnandChowdhary/priced-in.git
cd priced-in
npm install
export OPENAI_API_KEY="your-api-key-here"
npm start
Note: This will make real API calls and modify portfolio.json. Consider working on a fork or branch.
🙏 Acknowledgments
This experiment was made possible by:
- OpenAI for the Agents framework and GPT-4 capabilities
- GitHub Actions for reliable automation infrastructure
- The open-source community for tools and inspiration
💭 Final Thoughts
This project demonstrated that autonomous AI trading agents are technically feasible and can operate successfully in favorable market conditions. However, it also highlighted important limitations:
- AI lacks the nuanced judgment of experienced traders
- Success was heavily dependent on market timing and conditions
- Concentration risk emerged despite risk management instructions
- Real-world complexity (costs, regulations, market microstructure) wasn’t fully captured
The future of AI in trading likely involves human-AI collaboration rather than full autonomy, with AI handling data analysis and pattern recognition while humans provide strategic oversight and risk management.
Thank you for following this experiment! 🚀
📄 License
Repository Status: Archived as of December 2025
