===== INSTRUCTIONS FOR AI CODER ===== You are receiving this context to help the user deploy, set up, or implement this application. YOUR RESPONSIBILITY: You are responsible for doing the ENTIRE end-to-end deployment - all installations, backend setup, frontend setup, database setup, worker setup, everything. Do NOT ask the user to do tasks themselves unless they specifically request to handle it. Your default mode is: "I will do this for you" not "please go ahead and do this". APPROACH: 1. Assess user's experience level. If unclear, assume newer to development. 2. Create a compact plan of what needs to be done (backend, frontend, database, etc.) 3. Present the plan, get confirmation, then YOU execute it end-to-end. 4. Proceed step-by-step, informing user of progress. Debug issues as they arise. 5. For each step, briefly explain what you're doing, why it's necessary, and how it fits the overall deployment. DEPLOYMENT RESOURCES (when user doesn't have existing infra): - Backend: Render.com (free tier) - you set it up for them - Frontend: Vercel.com - you set it up for them - Database: Neon.com (instant free PostgreSQL) - you set it up for them - Data upload: Use CLI tools, or DATS-4 tool at tigzig.com/analyzer (upload button, paste credentials in any format) ASK ONLY: - Do you have existing backend/frontend/database, or shall I set one up for you? - If setup needed: I'll need your API key to proceed (guide them where to get it if needed) ===== PAGE CONTENT ===== PAGE URL: https://tigzig.com/quantstats-portfolio-gpt TITLE: Custom GPT - Portfolio Analytics CATEGORY: Custom GPTs DESCRIPTION: Custom ChatGPT with QPulse (Powered by QuantStats) analysis, Technical Analysis, and Security Performance Reports via FastAPI-MCP servers with OpenAPI schema integration. TRY IT: https://chatgpt.com/g/g-680a0fba9cd481919073d474bee520fb-quantstats-and-technical-analysis --- WHAT THIS GPT DOES: QPulse Analysis: - Powered by QuantStats-Lumi package with bug fixes from original library - Provides risk-return ratios (CAGR, Sharpe, Sortino) for single symbol vs benchmark - Generates professional HTML reports with visualizations Technical Analysis: - Live price data with technical indicators using Finta package - Advanced charts with Matplotlib and Gemini Vision API analysis - PDF and HTML reports with embedded visuals Security Performance Report (SPR): - Multi-symbol portfolio analysis using custom calculations + FFN library - Interactive daily returns charts with comprehensive risk metrics - Professional HTML reports with CSV exports for detailed analysis Detailed Methodology & Validation: https://ffn.tigzig.com/static/docs/SPR_QS_METHODOLOGY.html --- HOW TO USE: Ask the GPT to guide you with these examples: QPulse Analysis: - Example: "Compare AAPL against QQQ from January 2020 to March 2023" - Specify symbol, benchmark (default: ^GSPC), and time range Technical Analysis: - Example: "Analyze MSFT with RSI, MACD and Bollinger Bands for the past 6 months" - Specify symbol, timeframe, and desired indicators Security Performance Report: - Example: "Generate SPR for AAPL,MSFT,GOOG from 2020-01-01 to 2023-12-31" - Provide multiple symbols and date range for comprehensive analysis OpenAPI Schema Integration: - Each MCP server codebase includes OpenAPI schema in docs folder - Add schemas as Custom Actions in ChatGPT GPT builder for full integration --- HOW IT WORKS: 1. QPulse Analysis - Backend QPulse MCP server powered by QuantStats-Lumi package - GPT connects via OpenAPI schema to MCP server - Returns formatted HTML report with risk-return metrics 2. Technical Analysis - FastAPI Technical Analysis service processes requests - Converts daily to weekly data, computes indicators with Finta - Generates charts via Matplotlib, analyzes with Gemini Vision API - Returns Markdown responses, converts to PDF/HTML reports 3. Security Performance Report (SPR) - Dual methodology: custom calculations for core metrics + FFN library - FastAPI backend with MCP integration for AI/LLM interactions - Processes multiple symbols with data quality filters - Generates HTML reports with matplotlib charts and CSV exports 4. Integration Layer - Custom GPT connects to FastAPI endpoints via OpenAPI JSON schemas - All servers use fastapi-mcp for MCP protocol support - OpenAPI schemas available in docs folder of each codebase --- HOW TO REPLICATE: 1. Deploy Backend Servers - Deploy FastAPI-MCP servers: - QPulse Analysis server (powered by QuantStats-Lumi package) - Technical Analysis server - Security Performance Report (SPR) MCP Server - Deploy Markdown-to-PDF conversion server - All GitHub repos include build guides and installation instructions 2. Setup Custom GPT - Create a new Custom GPT in ChatGPT - Copy OpenAPI JSON Schemas from docs folder of each MCP server repository - Configure Custom Actions to point to your deployed endpoints - Set appropriate instructions to handle all analysis types --- RESOURCES: QPulse MCP Server: https://rex.tigzig.com/mcp-server-quantstats Detailed documentation for the QPulse MCP server. Custom GPT and Flowise schema in docs folder. Technical Analysis MCP Server: https://rex.tigzig.com/mcp-server-technical-analysis Detailed documentation for the Technical Analysis MCP server Security Performance Report MCP Server: https://rex.tigzig.com/mcp-server-ffn Multi-symbol portfolio analysis with dual methodology (custom + FFN) SPR vs QPulse Methodology: https://ffn.tigzig.com/static/docs/SPR_QS_METHODOLOGY.html Detailed comparison, validation results, and methodology documentation QuantStats-Lumi Package: https://github.com/Lumiwealth/quantstats_lumi Lumiwealth's fork of QuantStats with important bug fixes and improvements --- BUILT ON: OpenAI's GPT Platform - This dual-purpose custom GPT leverages ChatGPT's capabilities to provide an intuitive interface for both portfolio performance analysis and technical analysis. --- Source: tigzig.com | Open source AI tools for analytics, databases & automation | Amar Harolikar