Navi Trade is an experimental AI trading platform that uses Reinforcement Learning (RL) to learn profitable trading strategies. It features a real-time paper trading simulation where you can watch the AI agent analyze market data and execute trades.
- ** AI Trader**: Uses a PPO (Proximal Policy Optimization) agent trained via
stable-baselines3. The AI is rewarded for profit ("Points System") and penalized for losses. - ** Interactive Dashboard**: A premium dark-mode UI built with Next.js and Recharts, visualizing live market data with gradient-filled area charts.
- ** Paper Trading Simulation**: Watch the AI play out historical data candle-by-candle. Tracks:
- Cash Balance
- Holdings
- Net Worth
- P/L (Profit/Loss)
- ** Mock Data Fallback**: Automatically generates realistic stock data (Random Walk + Volatility) if the live API limit is reached.
- Framework: Next.js 14 (React/TypeScript)
- Styling: Tailwind CSS
- Charts: Recharts
- Icons: Lucide React
- API: FastAPI (Python)
- Reinforcement Learning: Stable-Baselines3
- Environment: Gymnasium (Custom Trading Environment)
- Data Source: Finnhub API
- Node.js & npm
- Python 3.9+
git clone https://github.com/yourusername/navi-trade.git
cd navi-tradeThe backend runs the AI model and API.
cd backend
# Create virtual environment
python -m venv venv
# Activate venv
# Windows:
.\venv\Scripts\Activate.ps1
# Mac/Linux:
source venv/bin/activate
# Install dependencies
pip install -r requirements.txt
# Run the server
python -m uvicorn main:app --reload --port 8000The frontend runs the dashboard.
Open a new terminal:
cd frontend
# Install dependencies
npm install
# Start development server
npm run devVisit http://localhost:3000 to launch the app!
- Select a Ticker: Choose a stock (e.g., AAPL, TSLA) from the dropdown.
- Train AI System: Click the button to let the agent study historical price action.
- Note: This runs a training loop in the background.
- Run Simulation: Click "Run Sim" to watch the AI trade on the data step-by-step.
- Monitor Portfolio: Watch your Net Worth grow (or shrink!) based on the AI's decisions.
This project is for educational and research purposes only. The trading algorithms are experimental and should NOT be used for real financial trading. There is a significant risk of loss in financial trading.