Alejandro Legarda

Systematic trading research

Built a multi-strategy trading system with a shared signal engine for backtesting and paper execution. The current configuration achieved a 1.67 backtest Sharpe over January 2018–June 2026, with historical replay checks and an auditable execution ledger.

Private repository. Running a forward test with paper execution.

How the system runs, stage by stage Market data: Daily and minute bars, adjusted for splits and dividends, cached so offline research runs without broker credentials. Evaluation split: Walk-forward research tools default to the pre-2025 sandbox. The later segment is reported separately, but repeated design research means it is not an untouched holdout for the current system. Walk-forward: Rolling folds. Parameters are picked on two years of history and scored on the six months after, which they never saw. Strategy sleeves: Trend, mean-reversion, and overnight strategies operate on different time scales and contribute to one portfolio. Backtest engine: Signals are evaluated with defined fill timing and costs on turnover. Tests mutate future data and check that earlier results stay unchanged. Portfolio sizing: Combined exposures are sized against per-symbol maintenance requirements. The close book targets at most 80% of equity in maintenance margin, with portfolio leverage capped at 2×. Shared signals: Research and paper execution call the same signal functions. Frozen parameters define the strategy the execution harness runs. Replay checks: Historical replay must reproduce committed reference series within defined tolerances before paper trading can start. A failed check blocks execution. Execution ledger: An append-only daily journal records weights, orders, fills, equity, and benchmarks. Broker positions are checked against the account’s fill ledger before trading; duplicate session records are refused. MARKET DATA EVALUATION SPLIT WALK-FORWARD STRATEGY SLEEVES BACKTEST ENGINE PORTFOLIO SIZING SHARED SIGNALS REPLAY CHECKS EXECUTION LEDGER
RUN 0001T+0.00 sREADY Market data Daily and minute bars, adjusted for splits and dividends, cached so offline research runs without broker credentials.

What it does

Combines trend, mean-reversion, and overnight strategies into one portfolio. The system covers the path from market data and strategy evaluation to scheduled paper execution, position reconciliation, and a daily record of what actually happened.

How it works

The strategies operate on different time scales, from intraday signals to overnight holds. Walk-forward evaluation selects parameters on earlier data and scores them on later folds. Their exposures feed a common portfolio, with sizing constrained by the broker’s per-symbol margin requirements and a leverage ceiling.

Research and execution share the same signal functions. Before paper orders can be placed, historical replay checks must reproduce the committed reference series within defined tolerances. This checks that the execution path implements the strategy that was evaluated.

The runner coordinates intraday events and the close rebalance, then reconciles orders, fills, positions, and equity. An append-only journal records each session. Before trading, broker positions are checked against the account’s own fill ledger so an inconsistent API response cannot silently become a new portfolio target.

What I measured

The current configuration achieved a 1.67 backtest Sharpe over January 2018–June 2026, with a 26.8% maximum drawdown. Its Sharpe was 1.40 excluding 2020 and 1.73 on the January 2025–June 2026 segment.

These figures use daily portfolio returns after modeled trading costs, financing, and regulatory fees. Sharpe is annualized using 252 trading days and a zero risk-free rate. The backtest uses the current margin-aware leverage rule, capped at 2× portfolio leverage.

Limits

The full backtest spans about eight and a half years, with substantial technology-sector exposure. The design evolved through repeated research, so the later segment is not an untouched holdout for the current system. Longer-history tests use reconstructed stand-ins and show much weaker performance through a sustained technology bear market.

Forward paper execution tests whether the system follows its modeled behavior under real operating conditions. Its record is separate from the backtest; the historical Sharpe is not a live performance claim.

Back to the start