Thanks to visit codestin.com
Credit goes to github.com

Skip to content

tyhobbs/finrl-dashboard

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FinRL Live Trading Dashboard

A real-time web dashboard for monitoring three parallel paper trading accounts running the FinRL Deep Reinforcement Learning stock trading system. Built with Flask and Chart.js, deployed on Render.

Live Dashboard → finrl-dashboard.onrender.com


Overview

This dashboard provides live monitoring of three Alpaca paper trading accounts running in parallel as part of the FinRL DRL Trading research project. Each account runs the same VGG + PPO model trained on the 30-stock universe with different deployment conditions to isolate the effect of capital constraints on live performance.

Model Capital Description
Model 1 $100k Constrained — experienced short selling bug in Week 1, carries margin debt
Model 2 $100k Clean — full buying power, deployed after bug fix
Model 3 $10k Scaled — same $100k model weights deployed at reduced capital (HMAX=5)

Features

  • Live portfolio metrics — equity, total return, buying power, and day P&L per account
  • Portfolio return chart — line chart per model with six timeframe options: 1Min, 5Min, 1D, 1W, 1M, ALL
  • Scrollable positions table — top positions per account with P&L bars
  • View all modal — full position drill-down with day P&L, total P&L, avg entry price
  • Orders feed — last 30 orders per account with fill price, status, and time elapsed
  • Combined summary bar — total portfolio value, combined P&L, active positions, and orders placed today across all three accounts
  • Auto-refresh — data updates every 60 seconds automatically
  • No credentials in browser — all Alpaca API keys stored server-side as environment variables

Architecture

Browser → Flask (Render) → Alpaca Paper Trading API

The Flask backend proxies all Alpaca API calls so credentials never touch the client. The frontend is a single HTML file served as a static asset.

finrl-dashboard/
├── app.py            ← Flask backend — proxies Alpaca API calls
├── index.html        ← Frontend — Chart.js dashboard
├── requirements.txt  ← Python dependencies
└── render.yaml       ← Render deployment configuration

API Endpoints

Endpoint Description
GET / Serves the dashboard frontend
GET /api/all Fetches account, positions, and orders for all three models in one call
GET /api/<model>/account Account details for a specific model
GET /api/<model>/positions Open positions for a specific model
GET /api/<model>/orders Recent orders for a specific model
GET /api/<model>/history?tf=1D Portfolio equity history for chart rendering
GET /api/health Health check — returns configured status for each model

Model IDs: model1, model2, model3

Timeframe options: 1Min, 5Min, 1D, 1W, 1M, ALL


Deployment

The dashboard is deployed on Render's free tier. Credentials are stored as environment variables and never hardcoded.

Environment Variables

Set these in the Render dashboard under Environment:

MODEL1_KEY      Alpaca paper account API key — Model 1
MODEL1_SECRET   Alpaca paper account secret  — Model 1
MODEL2_KEY      Alpaca paper account API key — Model 2
MODEL2_SECRET   Alpaca paper account secret  — Model 2
MODEL3_KEY      Alpaca paper account API key — Model 3
MODEL3_SECRET   Alpaca paper account secret  — Model 3

Local Development

# Clone the repo
git clone https://github.com/tyhobbs/finrl-dashboard.git
cd finrl-dashboard

# Install dependencies
pip install -r requirements.txt

# Set environment variables
export MODEL1_KEY=your_key
export MODEL1_SECRET=your_secret
# ... repeat for model2 and model3

# Run locally
python app.py

# Visit http://localhost:5000

Dependencies

Package Version Purpose
Flask 3.0.0 Web framework
flask-cors 4.0.0 CORS handling
requests 2.31.0 Alpaca API calls
gunicorn 21.2.0 Production WSGI server

Frontend uses Chart.js 4.4.1 via CDN — no build step required.


Related


University of Virginia — School of Data Science — DS6050 — 2026

About

Dashboard for FinRL Deep Reinforcement Learning Project

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors