r/madeinpython • • 15m ago

I built AlphaEngine: A quantitative portfolio optimization and financial analysis web app in Python

I wanted to share a project I've been developing: AlphaEngine, an interactive web application built with Python and Flask that computes optimal asset allocations using Modern Portfolio Theory (MPT).

Instead of manually guessing asset weights, the app fetches real-time market data, calculates daily and annual returns, and uses mathematical optimization to find the minimum-variance portfolio configuration.

Key features:

  • Real-Time Data Integration: Automatically pulls historical close prices using the Yahoo Finance API (yfinance).
  • Mathematical Optimization: Leverages SciPy's SLSQP algorithm to minimize portfolio variance subject to asset weight constraints.
  • Interactive Dashboard: Features a clean web interface built with Flask, dynamic JavaScript input fields, and pre-filled popular stock tickers.
  • Visual Analytics: Renders a responsive, customized donut chart using Plotly to visualize the ideal asset distribution.

I'll drop the GitHub repository link in the first comment below. I'd love to hear your feedback or thoughts on the implementation!

1 Upvotes

1 comment sorted by