Inspiration

Retail Gold (XAUUSD) traders operate in a highly volatile market. However, 95% of them rely on lagging indicators, emotional bias, or unverified signal groups. They lack the institutional-grade probabilistic tools needed to measure risk correctly, often leading to blown accounts.

We built FINRIX to solve this problem. Our goal was to bridge the massive gap between retail trading and quantitative hedge funds by creating an open-source, zero-setup, hyper-accessible CLI quant terminal (pip install finrix) that puts probabilistic forecasting, sentiment NLP, and risk-managed trade plans in the hands of everyday traders.


What We Learned & How We Built It

Developing a production-grade algorithmic trading suite meant coordinating complex machine learning, remote computing, and market-modeling logic. We organized the architecture into distinct, scalable layers:

  • Deep Learning / Probabilistic Forecasting: We deployed a PyTorch Temporal Fusion Transformer (TFT) using Nixtla NeuralForecast on serverless Modal A10G GPUs to generate non-linear XAUUSD quantile price paths (q_{10}, q_{50}, q_{90}) across multi-horizon forecasts.
  • Macro Sentiment Extraction: We integrated a scraping system to parse real-time macroeconomic news (Treasury yields, inflation, geopolitical developments) and passed the text through Hugging Face FinBERT to compute sentiment velocity and hawkish/dovish sentiment bias scores.
  • Micro-Execution Risk Engine: A custom mathematical trade planner that uses the forecasted quantiles to generate spot-anchored intraday entry zones, dynamic ATR-based Stop-Loss (SL), and multi-tier Take-Profit (TP1/TP2/TP3) levels with strict minimum lot (0.01 lot) account protection safeguards.
  • Visual Terminal Environment: A highly interactive, dark-themed Command Line Interface (CLI) built with Rich and Inquirer, featuring ensemble backtesters and time-machine simulation modules.

Challenges We Overcame

Building FINRIX was an absolute trial in engineering and math:

  1. Quantile Non-Crossing Violation: Early neural forecast iterations sometimes produced mathematically impossible results ($q_{10} > q_{50}$). We resolved this by implementing monotonic sorting guards and anchoring the quantile paths dynamically using trailing daily realized volatility scaled over the forecast steps: $$\text{Dynamic Bound} = \text{Spot}t \times (1 \pm 4.5 \cdot \sigma{\text{daily}} \cdot \sqrt{h})$$
  2. Cold Start Latency: Relying on serverless GPUs on the Cloud (via Modal) occasionally caused CLI menus to freeze during the first execution as environments were dynamically spinning up. We solved this by creating async background warmup cycles that load PyTorch model weights on-demand and verify remote GPU pipelines gracefully.
  3. Packaging Overkill: Trying to distribute a 300MB dependency bundle (PyTorch, Transformers, pandas) to local devices over standard Python setups is a disaster. We packed the logic into a specialized CLI package on PyPI, keeping the local footprints lean and packaging them with strict PEP 639 metadata standardizations to assure 100% platform-independent installs.

What We’re Proud Of

  • Pure Reliability: Built a rigorous validation suite featuring over 207 active pytest unit tests verifying everything from signal logic to neural data parser robustness.
  • Massive Accessibility: Published as a globally accessible package on PyPI. Run a simple pip install finrix and finrix globally, and the entire neural-trading stack launches on any PC.
  • Friction-Aware Backtester: Engineered backtesting environments with a hardcoded 2.0-pip spread and slippage friction penalty to prevent deceptive "perfect backtest" illusions.

The Hackathon Grind: Pre-Existing vs. Fresh Additions

While the core quantitative GPU model and primary CLI menus were created as part of our long-term research, we utilized the current hackathon sprint window to completely transform FINRIX into a production-grade, frictionless toolkit:

  • No More Fixed Limits: Removed outdated and legacy static pricing caps, building a custom volatility-anchored scaling formula to safeguard forecasts in high-intensity market regimes.
  • True Execution Card Mathematics: Completely overhauled the risk metrics. We updated the logic to compute realistic midpoint Risk-to-Reward (R:R) ratios (anchored to TP1 vs. SL distances) and enforced rigorous error-checking to guarantee default bounds never execute as UnboundLocalErrors.
  • Documentation & Open Source Sync: Overhauled the local configurations, repository README.md, and institutional documentation .docx archives to match the exact v1.0.7 production spec.

What's Next for FINRIX?

  • Zero-Latency Leaderboards: Stream live entries and exits from publicly verified copy-trading providers by connecting live cTrader Open API WebSockets and Telethon Telegram scraper engines directly to the FINRIX risk filter.
  • Unified Web Frontend: Integrate our backend forecasting server into an interactive web interface so the terminal cards can be visualized alongside rich interactive trading charts.

Built With

Share this project:

Updates

Submission history