π PaperProfit
A comprehensive paper-trading platform that lets you learn by doingβteaching you about investing, trading, risk management, markets, portfolio management, and a wide range of investment strategies using real market data, all without risking real money. PaperProfit allows you to simulate trading across multiple strategies, from long-term investing to day trading, with real market data.
π Features
Core Functionality
- Paper Trading: Simulate buy/sell orders without real money
- Portfolio Management: Track multiple accounts and positions
- Real Market Data: Integration with Yahoo Finance, Alpha Vantage, and Financial Modeling Prep
- Automated Trading Bot: Background jobs for order processing and strategy execution
- Performance Analytics: Tracβ¦
π PaperProfit
A comprehensive paper-trading platform that lets you learn by doingβteaching you about investing, trading, risk management, markets, portfolio management, and a wide range of investment strategies using real market data, all without risking real money. PaperProfit allows you to simulate trading across multiple strategies, from long-term investing to day trading, with real market data.
π Features
Core Functionality
- Paper Trading: Simulate buy/sell orders without real money
- Portfolio Management: Track multiple accounts and positions
- Real Market Data: Integration with Yahoo Finance, Alpha Vantage, and Financial Modeling Prep
- Automated Trading Bot: Background jobs for order processing and strategy execution
- Performance Analytics: Track your gains/losses and portfolio performance
30+ Investment Strategies
PaperProfit includes implementation templates for various trading strategies across multiple categories:
Long Term Strategies
- Buy & Hold
- Index Fund Investing
- Dollar-Cost Averaging (DCA)
- Dividend Growth Investing
- Value Investing
- Growth Investing
- Sector Rotation
- Asset Allocation & Rebalancing
Swing Trading
- Trend Following
- Breakout Trading
- Momentum Trading
- Mean Reversion
- RSI Overbought/Oversold
Day Trading
- Scalping
- VWAP Strategy
- Opening Range Breakout
- News-Based Trading
Options Trading
- Covered Calls
- Cash-Secured Puts
- Iron Condor
Famous Investor Strategies
- Warren Buffett (Value Investing)
- Ben Graham (Deep Value)
- Peter Lynch (GARP)
- Ray Dalio (All Weather Portfolio)
- Jesse Livermore (Trend & Breakout)
- John Bogle (Passive Index)
- Stanley Druckenmiller (Macro Trend)
- Jim Simons (Quantitative Statistical Arbitrage)
AI-Powered Analysis
- Stock analysis using AI
- Trading strategy generation
- Market insights and sector analysis
- Multi-stock comparison
π οΈ Tech Stack
Backend
- Framework: FastAPI
- Database: SQLite with SQLAlchemy ORM
- Task Scheduling: APScheduler
- Market Data: yfinance, alpha_vantage
- Python: 3.x
Frontend
- Framework: Vue 3
- Build Tool: Vite
- UI: Custom components
π Prerequisites
- Python 3.8 or higher
π§ Installation
1. Clone or download the code
git clone <repository-url>
cd paper_profit
2. Run the Application
./start.sh
This will:
- Create and activate a virtual environment
- Install dependencies
- Run database migrations (if needed)
- Start the FastAPI server on port 5000
- Start background jobs for order processing and market data updates
3. Open your browser
Go to http://localhost:5000
Manual Start
Backend API
cd backend/app
python api.py
API will be available at http://localhost:5000
API documentation at http://localhost:5000/docs
Background Jobs
cd backend/app
python background.py
Frontend Development Server
cd frontend
npm run dev
Frontend will be available at http://localhost:5173
π Project Structure
paper_profit/
βββ backend/
β βββ app/
β β βββ api.py # FastAPI application
β β βββ main.py # CLI entry point
β β βββ background.py # Background job scheduler
β β βββ analysis/ # Technical & fundamental analysis
β β βββ config/ # YAML configuration files
β β βββ jobs/ # Scheduled jobs
β β β βββ trading_bot.py # Main trading bot logic
β β β βββ process_orders.py # Order execution
β β β βββ update_market_data.py # Market data updates
β β β βββ update_positions.py # Position updates
β β βββ octopus/ # External service integrations
β β β βββ ai_platforms/ # AI service providers
β β β βββ brokers/ # Broker integrations
β β β βββ data_providers/ # Market data providers
β β βββ services/ # Business logic
β β βββ storage/ # Database models & repositories
β β βββ tests/ # Unit tests
β β βββ utils/ # Utility functions
β βββ requirements.txt # Python dependencies
β βββ PaperProfit.db # SQLite database
βββ frontend/
β βββ src/
β β βββ components/ # Vue components
β β βββ App.vue # Root component
β β βββ main.js # Entry point
β βββ package.json # Node dependencies
β βββ vite.config.js # Vite configuration
βββ start.sh # Quick start script
βββ README.md # This file
π API Endpoints
Accounts
GET /api/accounts- List all accountsPOST /api/accounts- Create new accountGET /api/accounts/{id}- Get account detailsPUT /api/accounts/{id}- Update accountGET /api/accounts/{id}/summary- Account summary with positionsGET /api/accounts/{id}/portfolio- Portfolio holdingsGET /api/accounts/{id}/performance- Performance metricsPOST /api/accounts/{id}/buy- Create buy orderPOST /api/accounts/{id}/sell- Create sell order
Strategies
GET /api/strategies- List all strategiesPOST /api/strategies- Create new strategyGET /api/strategies/{id}- Get strategy detailsPUT /api/strategies/{id}- Update strategy
Instruments
GET /api/instruments/search?query={q}- Search for stocksGET /api/instruments/get/{symbol}- Get instrument detailsGET /api/instruments/{symbol}/market-data?period={p}- Historical data
AI Analysis
POST /api/ai/analyze-stock- AI-powered stock analysisPOST /api/ai/generate-strategy- Generate trading strategyGET /api/ai/market-insights- Market insightsPOST /api/ai/compare-stocks- Compare multiple stocks
Configuration
GET /api/settings- Get settingsGET /api/service-list- Get service listGET /api/strategy-list- Get strategy templatesGET /api/guide- Investment guide
βοΈ Configuration
Strategy Configuration
Edit strategy templates in:
backend/app/config/strategy-list.yamlbackend/app/config/strategy-parameters.yaml
Service Settings
Configure data providers and services in:
backend/app/config/service-list-settings.yaml
π Background Jobs
The application runs several scheduled jobs:
- Trading Bot - Executes strategies and generates signals
- Process Orders - Processes pending orders
- Update Market Data - Fetches latest market prices
- Update Positions - Updates position valuations
π Database
PaperProfit uses SQLite for simplicity. The database is automatically created and migrated on first run.
Manual Migration
cd backend/app
python main.py migrate
π License
This project is for educational purposes. Use at your own risk. Past performance does not guarantee future results.
β οΈ Disclaimer
PaperProfit is a simulation platform for educational purposes only. It does not execute real trades. Always do your own research and consult with financial advisors before making real investment decisions.
π Known Issues
- Market data is delayed (not real-time)
- Some advanced options strategies are templates only
- AI features require API key
πΊοΈ Roadmap
- More broker integrations
- Advanced charting and technical indicators
- Risk management tools
π Support
For issues, questions, or contributions, please open an issue on GitHub.
Made with β€οΈ for traders and investors learning the markets.