Zing Forum

Reading

Stock_Analysis_Project: An Open-Source Portfolio Smart Dashboard Integrating Quantitative and Fundamental Analysis

A self-hosted quantitative fundamental portfolio dashboard integrating Ghostfolio, XGBoost/Random Forest prediction, risk management, and sentiment analysis

量化投资基本面分析GhostfolioXGBoost随机森林风险管理VaR情绪分析FastAPIPlotly
Published 2026-05-16 03:26Recent activity 2026-05-16 03:30Estimated read 5 min
Stock_Analysis_Project: An Open-Source Portfolio Smart Dashboard Integrating Quantitative and Fundamental Analysis
1

Section 01

[Main Floor] Stock_Analysis_Project: Introduction to the Open-Source Portfolio Smart Dashboard Integrating Quantitative and Fundamental Analysis

Stock_Analysis_Project is a self-hosted quantitative fundamental portfolio analysis dashboard for individual investors. Its core features include deep integration with Ghostfolio, integration of quantitative and fundamental analysis, a machine learning prediction engine (XGBoost/Random Forest), institutional-level risk management (VaR/CVaR), lightweight sentiment analysis (VADER), and an interactive web interface based on FastAPI and Plotly. The project supports self-hosting to protect data privacy and is suitable for investors with technical backgrounds.

2

Section 02

Project Background and Core Philosophy

Traditional investment analysis is divided into the quantitative school (relying on algorithms to capture market momentum) and the fundamental school (focusing on the intrinsic value of enterprises). This project innovatively integrates the two to form a "quantitative fundamental" methodology: synchronizing position data from Ghostfolio, obtaining market data via Yahoo Finance, performing quantitative indicator calculations and fundamental health assessments simultaneously, and balancing short-term trends with long-term value investing.

3

Section 03

Detailed Explanation of Core Function Modules

  1. Machine Learning Prediction Engine: Uses a soft voting classifier combining XGBoost and Random Forest, trained on 2 years of historical data to predict the probability of a return exceeding 3% in the next 5 days;
  2. Institutional-Level Risk Management: Dynamically calculates Parametric VaR and CVaR at a 95% confidence interval, monitors VIX-classified market states and adjusts strategies;
  3. Sentiment Analysis: Uses the VADER model to analyze news headline sentiment (ranging from -1 to +1), integrates the CNN Fear & Greed Index, and visualizes comparisons with the S&P 500 trend.
4

Section 04

Technical Architecture and Deployment Methods

Tech Stack: Backend FastAPI (asynchronous API), frontend Plotly (interactive charts), data storage Parquet (time series) + SQLite3 (metadata), APScheduler (automatic data update). Deployment Steps: Clone the repository → Create a virtual environment → Install dependencies → Run main.py; supports systemd service template (production environment), embedded mode (add ?embed=true to the URL), and Nextcloud Talk integration for event push.

5

Section 05

Applicable Scenarios and Notes

Suitable for individual investors with technical backgrounds who use Ghostfolio. Notes: This is an amateur hobby project, not a professional platform; users must bear risks on their own. It is mainly optimized for the US and UK stock markets; other markets may have currency conversion or data format issues, so testing before use is recommended.

6

Section 06

Project Summary and Value

Stock_Analysis_Project promotes the development of personal investment tools towards professionalism and intelligence, enabling individual investors to have analysis capabilities close to institutional levels. Through open-source community collaboration, it provides a self-hosted, highly customizable analysis experience and protects data privacy. For investors who want to deeply understand their portfolios and improve decision-making quality, it is an open-source project worth paying attention to.