Alpha Trinity is a quantitative trading framework designed to solve the dynamic portfolio allocation problem across Equities, Cryptocurrencies, and Commodities. The system utilizes a Hybrid Ensemble Learning architecture (
To mitigate tail risk, the engine integrates a Macro-Regime Sensing Module (XGBoost) that dynamically scales portfolio leverage (
The core strategy models the optimal portfolio weight vector
The predictive signal
Where:
-
$X_t$ : Feature matrix at time$t$ (Technical indicators, Macro factors). -
$\phi_k$ : The prediction function of the$k$ -th model. - The ensemble consists of 5 Deep Neural Networks (MLP) and 5 Random Forest Regressors (
$K=10$ ).
Risk exposure is dynamically adjusted using a volatility targeting mechanism controlled by the XGBoost Macro-Classifier (
The allocation engine solves a constrained Mean-Variance Optimization problem:
Subject to:
-
$\sum w_i = 1$ (Fully invested relative to leverage target) -
$0 \leq w_i \leq 0.30$ (Diversification constraint)
The system is built on a modular ETL-Inference-Execution pipeline designed for reproducibility and speed.
graph TD
A[Data Ingestion] -->|Yahoo/FRED API| B(ETL & Cleaning)
B -->|Parquet Storage| C{Feature Engineering}
C --> D[Macro Brain XGBoost]
C --> E[Ensemble Models 5xNN + 5xRF]
D -->|Regime Signal| F[Allocation Engine]
E -->|Return Forecast| F
F -->|Vectorized Logic| G[Backtesting & Risk Check]
G -->|Tearsheet| H[Performance Reporting]