DEV Community

Jagadeesh
Jagadeesh

Posted on

2 2 2 2 2

A Smarter Stock Predictor

This is a submission for the Agent.ai Challenge: Full-Stack Agent (See Details)

What I Built

I developed a Stock Prediction Agent designed to empower traders with AI-driven insights. My agent, Stock Price Predictor, analyzes historical stock data, leverages technical indicators (Bollinger Bands, MACD, RSI), and predicts actionable trading signals (Buy/Sell/Hold) alongside next day price targets (Open, Close, Buy/Sell levels). Built with Flask and machine learning, it transforms complex market data into digestible, confidence-scored recommendations.

Demo

https://agent.ai/agent/stock-price-predictor

Image description

How It Works

Step 1: Enter a stock symbol (e.g., IRFC.NS).
Step 2: The Agent fetches historical data, calculates technical indicators, and runs ML models.
Output:

  • Action: Buy/Sell/Hold recommendation with confidence score.
  • Price Forecasts: Predicted Buy (Low), Sell (High), Open, and Close prices for the next trading session.

Challenge Experience

Building this agent with Flask, XGBoost, and Random Forest was a rewarding deep dive into Stock Price Prediction. Key learnings:

  • Balancing imbalanced classes with SMOTE drastically improved prediction accuracy.
  • Integrating Yahoo Finance data via yfinance streamlined real-time analysis.
  • Deploying the model as an API with error handling ensured scalability.
  • While hyperparameter tuning with GridSearchCV was computationally intense, the performance gains justified the effort.

Next step? Adding real-time news for sentiment analysis!
Disclaimer: Predictions are educational and not financial advice. Trade responsibly!

Agent.ai Experience

Agent.ai simplified building and deploying Stock Price Predictor, letting me focus on refining ML models instead of infrastructure. Its intuitive tools made API integration and scaling effortless.

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (1)

Collapse
 
jagadee23246290 profile image
Jagadeesh

I made one ML model to predict the prices of a stock for next trading session as explained above. This still requires some enhancements, Any suggestions for improving this model are greatly appreciated. Thank You

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more