Overview
This documentation covers the Trading Analysis Dashboard - a Flask-based web application for tracking stock trading performance with real-time portfolio management and comprehensive reporting capabilities.Application Overview
Learn about the application’s purpose and architecture
Portfolio Management
Track holdings with real-time price updates from Finnhub
Trading Analysis
Analyze monthly trading performance and track P&L
API Reference
Explore the RESTful API endpoints
Core Features
Portfolio Tracking
Portfolio Tracking
Track stock, ETF, and mutual fund holdings with real-time price updates from Finnhub. View allocation charts, performance metrics, and gain/loss analysis with automatic price refresh capabilities.
Trading Analysis
Trading Analysis
Analyze monthly trading performance with detailed P&L breakdowns, win/loss ratios, and trade-by-trade analysis. Includes comprehensive reports with dividend tracking and hybrid matching algorithm for broker-level accuracy.
Authentication & Authorization
Authentication & Authorization
CSV Data Import
CSV Data Import
Import transaction history and holdings via CSV with drag-and-drop support. Real-time processing feedback and upload history tracking for portfolio and trading data.
Timeframe Analysis
Timeframe Analysis
Analyze trading performance across custom date ranges. Compare periods, track trends, and generate reports for specific timeframes.
Trading Calendar
Trading Calendar
View trading activity calendar with monthly heat maps showing P&L by day. Quickly identify patterns and peak trading periods.
Application Architecture
Flask
Python web framework for backend API and page rendering
PostgreSQL
Relational database for user data, trades, and holdings
Bootstrap
Frontend UI framework with custom styling
Finnhub API
Real-time market data integration
OAuth 2.0
Secure Google authentication
Chart.js
Interactive data visualizations
Key Concepts
Hybrid Matching Algorithm
The trading analysis uses a hybrid matching system that combines broker-provided realized gains/losses with transaction history to achieve broker-level accuracy for closed positions. See Hybrid Matching for details.Multi-User Support
The application supports multiple users with isolated data. Each user can have separate brokerage accounts and portfolios, with data access controlled by OAuth authentication.Real-Time Price Updates
Portfolio holdings are updated with real-time prices from Finnhub API, with intelligent rate limiting and caching to stay within API quotas while providing fresh data.Explore the Application
Read the application overview to understand how everything works together