project · Jan 2026 – Jun 2026

ROMULUS

Project developer

Repeatable strategy comparisons with a traceable record of every decision.

Skills & tools

  • Python
  • CUDA
  • Model evaluation
  • NumPy
  • XGBoost
  • pytest
  • Pydantic
  • uv
  • pandas
  • Parquet
  • PyArrow
  • Walk-forward validation
  • Tkinter
  • Backtesting
  • yfinance
  • pandas-market-calendars
Illustrative stock trading chart with candlesticks and volume bars.

Overview

ROMULUS is a Python desktop application for comparing investment strategies, evaluating machine-learning forecasts, and tracing portfolio decisions through historical simulations.

I built it to explore how strategies behave under changing market conditions while keeping their decisions inspectable. Each strategy runs an independent portfolio against the same available price history. A separate portfolio follows a weekly champion, selected using prior risk-adjusted performance and results under similar market conditions.

My contribution

I developed the backtesting engine, forecasting workflow, portfolio accounting, and desktop interface around a shared decision schedule.

The strategy suite includes momentum, moving-average crossover, equal-weight, inverse-volatility, volatility-targeting, fixed-weight ensembles, cash, buy-and-hold, and machine-learning approaches. Running them independently makes it possible to compare their behavior before deciding which strategy the champion-following portfolio should use.

The Tkinter interface brings configuration, data-coverage inspection, run progress, portfolio comparisons, forecast diagnostics, and decision-level audit views into one workflow.

Technical work

Event-driven simulation

Strategies make decisions at Wednesday and Friday closes, with execution simulated at the next available market open. The engine accounts for slippage, commissions, fractional shares, and available cash. Sales execute before purchases, and unaffordable purchases receive partial fills.

Portfolio risk metrics use actual timestamps, avoiding daily annualization assumptions for twice-weekly decisions.

Forecasting and model evaluation

Walk-forward XGBoost models forecast returns and volatility. Features include trailing returns, realized volatility, drawdown, moving-average ratios, and volume measures. Ridge, zero-return, and persistence baselines provide comparisons.

Evaluation reports include MAE, RMSE, directional accuracy, rank correlation, volatility calibration, and top-selection hit rate. Forecast diagnostics remain separate from portfolio returns and transaction costs.

XGBoost uses its CUDA backend when available, with a memory-conscious retry and recorded CPU fallback. The desktop diagnostic performs an actual GPU fit-and-predict check.

Champion selection and audit records

Market conditions are classified using trailing returns, volatility, and drawdown. Champion rankings combine rolling Sharpe with after-cost returns from completed intervals in the current regime. Champion changes occur on Fridays; Wednesday decisions can rebalance the current champion.

Every run retains rankings, selection reasons, target allocations, orders, fills, holdings, and portfolio values. Run manifests record configuration hashes, data checksums, runtime details, and the devices used for training.

Challenges

The main engineering challenge was preventing future information from entering historical decisions while keeping portfolio accounting consistent.

Training uses chronological windows, completed outcomes, and an embargo between eligible labels and the current decision. External features require explicit availability dates. Tests alter future price data and feature revisions to check that earlier calculations remain unchanged.

Accounting checks cover transaction costs, cash-constrained execution, liquidation of omitted positions, and reconciliation between recorded fills and portfolio value.

Results and current state

The archived validation report records 77 passing tests and one skipped hardware-dependent test. A separate CUDA fit-and-predict diagnostic succeeded on an RTX 5070 Ti.

A deterministic synthetic demonstration completed 204 decision dates across 12 strategy portfolios and a separate champion-following portfolio. It recorded 30 champion changes, all on Fridays, with a maximum accounting reconciliation residual of approximately 1.82 × 10⁻¹² dollars.

These results demonstrate the original implementation's simulation mechanics and reproducibility; they do not establish investment profitability. The newer rebuild is separate from these archived results.

Limitations

Historical backtests describe the tested data and assumptions; they do not establish future investment performance.

Links & resources

SiteNaviAI

Chat is currently unavailable. You can still explore the portfolio.