> proprietary algorithmic trading

Automated trading systems, built and operated in-house.

mktlab is a private trading laboratory. We design, build and operate proprietary algorithmic systems across futures, crypto and equities. This site documents the work; nothing here is for sale.

doc /00·indexrev 0.7utc+4
systems contact
mktlab · core session
fig. 01 · system topologyrev 0.3
market data event bus strategy runtime risk gate execution adapters venues telemetry · trade journal · alerts ticks events orders cleared fills
> § 01 · engineered for live markets

Same code in replay and in production

The same event-driven core runs every mode. A strategy that survives replay runs the identical code path in production; nothing is reinterpreted on the way to the market.

Event stream

Every tick, order and fill is an event on one bus. State is derived, never assumed.

NQ · simulated feed

Risk-gated execution

No order reaches a market without clearing the risk layer first. The gate cannot be bypassed.

execution log · simulated

Backtest-live parity

Same code, same hash, both sides. If replay and live disagree, that is a bug, not a market condition.

replaystrategy a3f2c9
core v2.6.0
livestrategy a3f2c9
core v2.6.0
parity check: identical

Deterministic replay

Sessions are reconstructed event by event from recorded data; only validated systems proceed to live.

events 0 · speed 64x · 09:30:00 · replay
> § 02 · market surface

Microstructure view

Two of the surfaces the systems read and write: order book depth and account equity. All figures on this page are simulated for display.

DOM · NQ · simulated feed
bidpriceask
time & sales
pnl · session · simulated
+0.00
open pnl · usd · simulated
realized+0.00
session high+0.00
session low+0.00
positionflat
equity · replay set · illustrative
sharpe 1.84 max dd -8.2% win 54% pf 1.62 sma(20)
> § 03 · methodology

Validation procedure

A strategy is treated as a hypothesis until tested. Four procedures determine whether it trades or gets archived.

m/01

Event-sourced replay

Recorded market data is replayed event by event through the same engine that trades live. Determinism makes every run reproducible: same inputs, same state, same orders.

replay(events) == live(events)
m/02

Walk-forward validation

Parameters are fit on one segment of history and judged on the next, rolling across regimes. In-sample performance is treated as noise until it survives out-of-sample.

fit[t0,t1) -> test[t1,t2)
m/03

Monte Carlo resampling

Trade sequences are resampled to map the distribution of outcomes, not a single equity curve. Sizing decisions are derived from the tails, not the average.

N >= 10^4 resamples
m/04

Capped fractional sizing

Position size follows a capped fraction of the Kelly optimum under drawdown constraints. The cap is structural; no signal overrides it.

f = min(k·f_kelly, f_max)
m/05

Risk-adjusted measurement

Performance is scored out-of-sample on Sharpe, Sortino, profit factor, drawdown depth and duration. The Sharpe ratio is deflated for the number of trials: an inflated backtest is treated as what it is.

sharpe · sortino · deflated for N trials
m/06

Portfolio assembly

Capital runs across strategies with low pairwise correlation; futures, crypto and equity legs are balanced so no single system dominates portfolio variance. Weights follow risk budgets with hard drawdown caps.

target corr(i,j) < 0.3 · risk budgets
> § 04 · portfolio construction

Uncorrelated by design

Single strategies fail; portfolios of weakly correlated strategies persist. Allocation across strategy classes and instruments is a design decision, made before the first line of strategy code.

corr · pairwise, stress windows · illustrative
< 0.25 0.25–0.5 > 0.5 · flagged self
risk budgets · by class and instrument · illustrative
by strategy class
momentum mean-rev mkt-mkg stat-arb
by instrument
futures crypto equities
cap per system: no strategy above 25% of portfolio variance

The theory is Markowitz applied to strategies instead of assets: portfolio variance is dominated by covariance, so a marginal strategy is valued for its correlation profile more than for its standalone Sharpe. A mediocre system that is genuinely orthogonal to the book beats a brilliant clone of what already runs.

Correlations are measured on stress windows rather than calm averages, because correlations converge exactly when diversification is needed most. Instruments diversify the plumbing as well as the returns: futures, crypto and equities differ in venue risk, session hours and microstructure, so a failure in one leg does not propagate to the others.

> § 05 · cat strategies/momentum_breakout.py

Implementation

mktlab is not a platform and does not operate one. The engines are open source or commercial, Nautilus Trader and the NinjaTrader ecosystem; the strategies, risk logic and tooling on top are proprietary.

momentum_breakout.py · nautilus_trader
from nautilus_trader.trading.strategy import Strategy
class MomentumBreakout(Strategy):
def on_bar(self, bar):
if not self.risk.clear(bar.instrument_id):
return # the risk layer has the last word
if self.signal.breakout(bar):
self.buy(size=self.sizer.capped())
# tested in replay. deployed unchanged.
> § 06 · lab notes

Engineering log

Excerpts from the internal engineering log. Full entries stay internal.

n/0492026-07 Selection metric hardeningSharpe inflation from multiple testing countered with the deflated Sharpe ratio and explicit trial-count tracking per research line.
n/0472026-07 Slippage model recalibrationRefit of the fill model for NQ under high-volatility regimes. Replay-live divergence reduced below tolerance.
n/0442026-06 Parallel replay farm, phase IISession throughput scaled across parallel instances. Determinism checks green across the fleet.
n/0412026-05 Risk layer: kill conditionsHard kill semantics formalized: daily loss, latency ceiling, data staleness. Any trip goes to flat.
NINJATRADERNAUTILUS TRADERTRADOVATEBINANCEOKX
sys
> ls /systems

Modules in operation

doc /01·systemsrev 0.44 modules

Four engineering tracks, one pipeline: ideas become code, code gets tested against market history until it breaks or proves itself, survivors go live.

mod/01 · trading-algorithms

Trading algorithms

Systematic strategies for index futures, digital assets and equities: momentum and breakout, mean reversion, market making, statistical arbitrage. Signal research, position logic and risk envelope designed as one unit, validated in market replay before any live order.

status: activeclasses: momentum · mean-rev · mkt-making · stat-arbmarkets: NQ · ES · crypto · equities
price · entries · exits · simulated
mod/02 · ninjatrader-engineering

NinjaTrader ecosystem engineering

Custom NinjaScript add-ons, control dashboards, strategy managers and market-replay tooling built on and around the NinjaTrader platform. Internal tooling, engineered to production standard.

status: activestack: NinjaScript · C#
NQ-BREAKOUT-V4running
MES-MEANREV-2running
OKX-MM-DELTArunning
flatten allpausereplay
control dashboard · mockup
mod/03 · execution-infrastructure

Execution & monitoring infrastructure

Direct pipelines to Tradovate, Binance and OKX. VPS-deployed, supervised by an alert-driven monitoring layer with hard kill conditions.

status: activeuptime target: 99.9%
tradovate14ms
binance38ms
okx41ms
venue round-trip · illustrative
mod/04 · research-tooling

Research tooling

Backtesting engines, parallel market-replay farms and performance analytics. The machinery that determines which strategies reach deployment.

status: activereplay sessions: parallel
replay farm · sessions completing
> strategy lifecycle

From hypothesis to retirement

Every system moves through the same seven states. No stage is skipped, in either direction.

01idea

Written down as a falsifiable hypothesis before any code exists. If it cannot fail a test, it does not enter the pipeline.

02prototype

Minimal implementation in the research stack. Code quality is secondary at this stage; ambiguity in the rule set is not accepted.

03replay

Event-sourced validation across recorded regimes: trend, chop, shock. Deterministic, reproducible, archived.

04walk-forward

Rolling out-of-sample verification. In-sample results are treated as noise until they survive here.

05paper

Live market data, simulated capital. Parity checks between replay expectations and observed behavior.

06live

Deployed unchanged behind the risk gate, with kill conditions armed and telemetry on every decision.

07retire

A system that drifts outside its replay envelope is pulled and archived with the data that retired it. The archive stays queryable.

> deployment protocol

Deployment gates

Every strategy passes the same gate sequence before it touches a live market. The checklist is code; a red item blocks the deploy.

deploy · pre-flight checks
[x] replay · 3 regimes · deterministic · green
[x] walk-forward · out-of-sample · green
[x] monte carlo · tail risk within f_max · green
[x] risk gate · kill conditions armed · green
[x] parity hash · replay == live · green
[ ] deploy · awaiting operator sign-off

Retirement follows the same discipline in reverse. A live system that drifts outside its replay envelope is pulled, archived, and sent back to research. Drift is treated as a defect, never as a reason to wait.

stk
> cat /stack/architecture

Architecture

doc /02·stackrev 0.46 components

Three asset classes, one architecture. The engines are open source or commercial; the assembly, the risk logic and the tooling are ours.

Futures

  • NQ / ES index futures
  • NinjaTrader
  • Tradovate API

Crypto

  • Binance
  • OKX
  • Nautilus Trader

Equities

  • systematic strategies
  • research pipeline
  • selective deployment
fig. 02 · execution stackdata up · orders down
market data ↑ up orders ↓ down strategy layer signals · sizing · portfolio logic proprietary risk gate limits · kill conditions · cannot be bypassed proprietary engines nautilus trader · ninjatrader open source / commercial adapters tradovate api · binance · okx connectivity venues cme group · crypto exchanges external telemetry · trade journal · alerts (observes every layer)
event coreNautilus Trader · Rust core, Python API. Open source engine; we build on it, we don't own it.
futures executionNinjaTrader ecosystem · Tradovate API. Custom NinjaScript add-ons and control dashboards, engineered internally.
crypto executionBinance · OKX, through Nautilus adapters.
replay / validationParallel market-replay farm. Deterministic sessions; same code path as live.
trade journalPostgreSQL. Every order, fill and decision archived and queryable.
telemetryAlert-driven monitoring with hard kill conditions; notifications to operators in real time.

Strategy code is versioned like any serious software: reviewed, tested in replay, deployed unchanged, monitored, and retired when the market moves on. No manual overrides in live sessions.

> latency budget

Time, accounted for

Orders of magnitude, not marketing numbers. The budget exists so that every component knows what it is allowed to cost.

market data ingest → event bussub-millisecond, in-process
signal evaluationsingle-digit milliseconds per event
risk checks< 1 ms · evaluated before every order, no exceptions
venue round-tripnetwork-bound, tens of milliseconds · VPS placed close to the venue
kill switch → flatengine-level, immediate · no human in the loop
> du -h /data

Data is the asset

Recorded market data outlives any single strategy.

Every tick consumed and every order produced is journaled to PostgreSQL, raw and immutable. Sessions can be reconstructed on demand, years later, exactly as they happened, because replay does not read from summaries: it reads from the same event log the live engine wrote.

The archive is also the research corpus. New strategy candidates are validated against the full history of recorded regimes, and rejected candidates are stored next to the data that rejected them. Nothing is deleted: re-testing an idea that already failed costs more than storing the evidence of its failure.

lab
> whoami

The lab

doc /03·labrev 0.4est. 2023

mktlab operates as an engineering group, not a trading desk. Independent and self-funded. Decisions follow tested evidence.

2023
First automated futures system
A single strategy on a single account, executed end to end by code. No discretionary orders placed since.
2024
Market-replay farm online
Parallel replay sessions replace sequential backtests. Validation throughput increases by roughly an order of magnitude.
2025
Multi-market expansion
Crypto venues come online through Nautilus adapters. One event-driven core, three asset classes.
2026
Event-sourced core v2
Full backtest-live parity: identical code paths, deterministic replay, parity checks in the deploy gate.
001risk before conviction
002everything is code
003test until it breaks
004only survivors go live
005no narratives, only data

The lab runs on a simple protocol: hypotheses are written down before they are tested; tests are reproducible or they don't count; results are archived whether they flatter us or not.

We don't manage outside capital, sell signals, or publish performance. The systems trade our own money, which keeps the incentives exactly where they should be: on being right, not on looking right.

> ls /lab/notes

Notes

Short write-ups on how the lab thinks. Longer versions live in the internal wiki. Tap to expand.

a/01Replay is not backtesting2026-07

A vectorized backtest aggregates history into bars and applies logic after the fact. It answers "would this rule have correlated with returns", which is not the question. The question is "would this system have traded", and the difference is everything that happens between signal and fill: queue position, partial fills, latency, rejected orders, a risk gate that says no.

Replay reconstructs the session event by event. The strategy consumes the same stream it would consume live, through the same engine, and fills are simulated against the recorded book rather than assumed at the close of a bar. Costs, slippage and microstructure stop being parameters and become consequences.

The output is not an equity curve; it is a trade journal, every decision with its full context, reproducible on demand. When a replay run and a live session disagree, that is a bug with a stack trace, not a market mystery.

a/02The cost of a good-looking backtest2026-06

Search enough parameter combinations and something will look brilliant by construction. Multiple testing guarantees it: the expected maximum Sharpe of N random trials grows with N even when every trial is pure noise. White formalized the problem in 2000; the industry has been rediscovering it ever since.

Our response is bookkeeping. Every research line carries an explicit trial count, and candidate strategies are scored on the deflated Sharpe ratio of Bailey and Lopez de Prado, which corrects for the number of trials and for non-normal returns. A strategy must clear the deflated bar, not the raw one. Most don't; that is the point.

The archive does the rest. Rejected candidates are stored with the evidence that rejected them, so the same idea cannot be re-discovered a year later and re-tested as if for the first time. Selection bias depends on forgotten trials; the archive keeps every one of them visible.

a/03Sizing under drawdown constraints2026-05

The Kelly fraction maximizes long-run growth, and at full size it produces drawdowns that no operator, and no prop account, will survive. Growth-optimal is not risk-acceptable. The gap between the two is where sizing actually lives.

We resample trade sequences, ten thousand paths or more, to map the drawdown distribution of each strategy rather than trust a single realized curve. Size is then set as a capped fraction of Kelly such that the probability of breaching the drawdown limit stays below tolerance on the resampled paths, not on the lucky one that happened.

At the portfolio level the same discipline applies across strategies: risk budgets weighted toward low pairwise correlation, measured on stress windows rather than calm averages, because pairwise correlations rise sharply in stress regimes, precisely where diversification must hold. No single system is allowed to dominate portfolio variance.

> cat /lab/references.bib

Selected references

The methodology stands on published work. Non-exhaustive.

[1]1952Markowitz, H. · Portfolio SelectionThe Journal of Finance. Diversification as the only free lunch; covariance as the first object of study.
[2]1956Kelly, J.L. · A New Interpretation of Information RateBell System Technical Journal. Growth-optimal sizing; we run a capped fraction of it.
[3]1991Sortino, F. & van der Meer, R. · Downside RiskThe Journal of Portfolio Management. Penalize the volatility that hurts, not the volatility that pays.
[4]1994Sharpe, W.F. · The Sharpe RatioThe Journal of Portfolio Management. Risk-adjusted return as the comparable unit of performance.
[5]2000White, H. · A Reality Check for Data SnoopingEconometrica. Multiple testing inflates everything; account for it or be fooled by it.
[6]2014Bailey, D. & Lopez de Prado, M. · The Deflated Sharpe RatioThe Journal of Portfolio Management. Sharpe corrected for trials and non-normal returns; our selection metric.
[7]2015Harvey, C. & Liu, Y. · BacktestingThe Journal of Portfolio Management. Haircuts for backtest overfitting; skepticism, quantified.
[8]2018Lopez de Prado, M. · Advances in Financial Machine LearningWiley. Purged cross-validation, sample weights, meta-labeling.
com
> open channel

Contact

doc /04·contactrev 0.4async by default

Email only.

> hello@mktlab.ai
channel · info
$ contact --channel
email only · no forms, no calendars, no chat widgets
$ contact --entity
MKTLAB AI LLC · 1309 Coffeen Avenue STE 1200, Sheridan, WY 82801, USA
$ contact --timezone
UTC+4 · async by default · days, not minutes
$ contact --filter
unsolicited vendor outreach is discarded
$