geekyroshan
Back to Projects
RL Portfolio Optimizer
Reinforcement Learning

RL Portfolio Optimizer

Deep reinforcement learning for stock portfolio allocation. PPO agent with custom Gymnasium environment.

About the Project

An end-to-end reinforcement learning system for portfolio allocation across Indian stocks. A PPO agent learns daily portfolio weights in a custom Gymnasium environment that penalizes transaction costs and balances return against risk. Includes an interactive Streamlit dashboard for backtesting with comprehensive metrics.

Key Features

  • Proximal Policy Optimization (PPO) agent for portfolio weight allocation
  • Custom Gymnasium environment with transaction cost penalties
  • Balances return vs risk with multiple metrics: CAGR, Volatility, Sharpe, Max Drawdown
  • Interactive Streamlit backtesting dashboard
  • Trained on Indian NSE stock data via yfinance

Impact

Demonstrates real ML engineering -- custom RL environments, reward shaping, and production-ready backtesting infrastructure.

Tech Stack

PythonStable-Baselines3PPOGymnasiumyfinanceStreamlit

Metrics

Custom RL environment
PPO agent
Interactive backtesting
CAGR, Sharpe, Max Drawdown

Interested in this project?

Let's discuss how I can build something similar for you.