Automated Market Analysis with DAG and XGBoost

This title was summarized by AI from the post below.

👻 I finished automating my market analysis process to optimize the time spent on quantitative research and systematize the search for alphas when restructuring my portfolio. My main objective was to abandon pure linear prediction. Instead, I built an asynchronous Directed Acyclic Graph (DAG) that prioritizes topological risk management and actively mitigates execution friction in the market. 1️⃣ Microservices and Data Architecture: To ensure mathematical inference does not block the analytical interface, the system operates completely decoupled: 🏗️ UI & Orchestration: Reactive frontend in Streamlit, communicating with an API Gateway in FastAPI. 🏗️ Asynchronous Processing: Celery workers handling heavy computation in the background. 🏗️ Analytical Data Warehouse: DuckDB injected for columnar persistence. The system ingests OHLCV data via the Alpaca API, automatically adjusting splits and dividends before tensors reach the model. 2️⃣ The Quantitative Engine (4-Phase DAG): The entire pipeline is evaluated through rigorous Walk-Forward (Out-of-Sample) analysis to prevent information leakage (Lookahead bias). 📑Phase A (Feature Engineering): Fractional Differentiation to achieve stationarity while preserving series memory, followed by PCA to isolate orthogonal risk factors. 📑Phase B (Directional Alpha): XGBoost models trained with a custom loss function (BCE + L2 Turnover Penalty). The algorithm mathematically penalizes excessive rotation, protecting capital from the bid-ask spread and commissions. 📑Phase C (Defense and Regimes): Hierarchical Risk Parity (HRP) to structure a topological risk mitigation base, operating in parallel with a Hidden Markov Model (HMM) that classifies macroeconomic volatility regimes. 📑Phase D (Bayesian Fusion): Mathematical integration via Black-Litterman. The model takes HRP as the conservative prior and XGBoost predictions (filtered by a Sigmoid function) as directional views, generating the optimal weights to execute in the Order Management System (OMS). I will be sharing more technical details about the design of this ecosystem. Open to feedback, debate, and connections with colleagues in financial engineering and quantitative development. #QuantitativeFinance #MachineLearning #Python #XGBoost #AlgorithmicTrading #SoftwareEngineering #DataEngineering

  • graphical user interface

Impressive and very interesting work you’ve got here! I’m currently building an autonomous algorithmic trading agent (MVP stage currently with a full loop from data ingestion, analysis and decisioning to execution and feedback). Have you experimented with incorporating qualitarive data such as news or sentiment signals?

To view or add a comment, sign in

Explore content categories