Work / Systematic trading research

Market structure research

The research side of a systematic futures strategy. The tooling used to develop, validate and see a market structure model, kept strictly apart from anything live.

InternalTrading researchPublic repository
Chart viewer drawing structural reads on gold futures
The chart viewer drawing the engine’s structural reads on gold futures, bar for bar.
Language
Python 3.11
Data
pandas, pyarrow, Parquet cache
Validation
Walk-forward, in sample to out of sample
Regression
Locked case harness
Viewer
A plain web page, no build step

The constraint

A strategy is only as trustworthy as the backtest that validated it, and a backtest can lie in a hundred quiet ways. The worst one is look-ahead: the simulator sees a bar the strategy could not have seen, the equity curve looks wonderful, and the first live week takes it all back.

What most people would have built

A notebook that loops over a dataframe. It runs in an afternoon, it is impossible to audit, and every parameter change is a new chance for the same bug to come back.

Walk-forward, across instruments in parallel

Parameters are tuned on an in-sample window and scored on the window after it, then the pair slides forward. The whole thing runs across many instruments at once, so a result that holds on one contract and collapses on the next is visible before anyone believes it.

Viewer on S&P futures at fifteen minutes
The viewer on the S&P futures contract at a fifteen minute frame.

A locked case harness

A set of cases with known answers is committed alongside the engine. Any change to the engine that moves those answers fails the build, so a refactor cannot quietly change what the strategy sees.

Seeing what the engine saw

The viewer renders the engine’s structural reads on top of the bars, zone by zone, so a person can check the model’s eye against their own. Most research tooling shows you a curve. This shows you the reasons.

Out of sample equity curve, S&P futures
Equity curve, S&P futures, out of sample.

Honest curves

Every equity curve is labelled with what produced it. In-sample and out-of-sample are never on the same axis without saying so, and a curve from a run with a known gap in the data carries the gap.

What broke, and what we would change

An earlier batch backtester had a subtle look-ahead bias that inflated results. Finding it is why the live system’s simulator was rebuilt so strategies receive only a read-only buffer of past bars. The lesson: being able to see what the engine saw is worth more than another statistic about it.

Research tooling, not a trading product. The curves shown are research output, not a record of live trading, and Naxfront Ltd does not give investment advice.

This project sits under Trading systems. See all the work.

WhatsApp