0
NYNA
All work
Software · Personal · Quantitative

Algorithmic Trading System

A full research-to-live algorithmic FX system in Python: a vectorised back-testing engine, a causal validation harness and a live MetaTrader 5 execution bot, all built around price-action market structure on EURUSD. Its defining feature isn’t a magic edge, it’s honesty, the framework is engineered to expose the look-ahead bugs and over-fitting that quietly wreck most retail strategies.

25yrEURUSD history modelled, D1 → M1
M1–D1Multi-timeframe back-test engine
+1pipSpread & slippage on every fill
MT5Live Python execution API
CISDAsia-sweep → London entry model
CausalBar-by-bar parity validation
EURUSD data · 25 yr Vectorised back-test Causal parity gate Strategy library Live MT5 bot
Illustrative · interactive
Equity curve · R (illustrative)

Most retail “edges” are look-ahead bugs in disguise. This system is built to catch them, even its own.

How it works

The engine ingests decades of EURUSD data across timeframes from daily down to one-minute and simulates strategies bar by bar. Every fill is charged a realistic cost, stops are widened by the spread plus a pip and slippage is modelled, so a back-test can’t win on fills it would never get live. Strategies are expressed as pure functions of past price structure: liquidity sweeps (a prior high or low taken and reclaimed), change-in-state-of-delivery (CISD) confirmations, and draw-on-liquidity (DOL) targets, the mechanics behind ICT-style price action.

What I built

  • A vectorised NumPy / pandas back-testing engine over ~25 years of EURUSD, D1 to M1
  • A causal parity harness that re-runs every strategy with past-only data to prove a back-test is reproducible
  • A strategy library: EMA / DOL trend models, quality-filtered Donchian breakouts, RSI-2 mean reversion, opening-range & session-liquidity models
  • A live MetaTrader 5 bot (Python API) with automated entries, structure-based stops and R-multiple targets
  • Fixed-fractional risk sizing and multi-era, out-of-sample testing to reject regime-fit
  • Built AI-assisted with Claude Code for fast iteration on the research loop
The bug that mattered · Look-ahead audit

How a 15-year “edge” turned out to be a mirage.

An early trend model, EMA bias with a DOL filter, looked spectacular: a clean, rising equity curve and a healthy profit factor across fifteen years. It was too good. An audit of the swing-detection logic found the culprit, it was confirming swing highs and lows using bars that hadn’t happened yet. The “edge” was the strategy quietly reading the future. Rebuilt to use only information available at the moment of each decision, the same system’s profit factor collapsed from comfortably profitable to 0.63, a loser. That failure became the most valuable result in the project: every strategy since has to pass a causal parity test before it goes anywhere near a live account.

The edge hunt · Causal & multi-era

Testing honestly, and accepting the answer.

With the validation harness in place, I ran a systematic search across strategy families and distinct market eras. The honest conclusion: no strategy held a durable profit factor above ~1.25 in every era. The strongest, most stubborn lead was a quality-filtered Donchian daily breakout, hovering around 1.15–1.27 depending on the period; classic setups like RSI-2 mean reversion “died honest,” with no survivorship illusion left to hide behind. Documenting negative results like these is the process, not a failure of it, it’s the line between real research and a curve-fit fantasy.

Strategy snapshots · illustrative

The setups, at a glance.

Asia sweep to London CISD strategy chart Donchian channel breakout strategy chart Liquidity sweep and reclaim reversal strategy chart RSI-2 mean reversion strategy chart
Live deployment · MetaTrader 5

From back-test to a live, risk-controlled bot.

The live component runs the strongest structural idea end-to-end on EURUSD: wait for the Asian session’s range to sweep liquidity into the London open, then enter on a one-minute change-in-state-of-delivery, place the stop just beyond the swept swing, and target roughly 2.2R. It executes fully automatically through the MetaTrader 5 Python API, handling live ticks, order placement and position management under a fixed per-trade risk cap. It ran as a genuine live experiment, real spread, real slippage, real fills, to pressure-test the model where a back-test simply can’t.

What it demonstrates

  • Quantitative research & back-testing
  • Causal inference & look-ahead detection
  • Python (NumPy / pandas) at scale
  • MetaTrader 5 automation & live execution
  • Market microstructure (ICT price action)
  • Disciplined, fixed-fractional risk management

Honest takeaways

The deliverable here isn’t a money-printer, it’s a framework that tells the truth. It caught a look-ahead bug that would have blown up a live account, and it rejected every over-fit edge that couldn’t survive out-of-sample. That instinct, trust the process, distrust the result until it’s reproducible, is exactly what I bring to any engineering problem.

PythonNumPypandasMetaTrader 5 APIBack-testingICT price actionRisk managementClaude Code
Get in touch

Let's build something that performs.

Ready when you are.

A brand-new website, a network rebuild, a custom board or a tricky hardware fault, drop us a line and we'll respond within one working day. Quotes are free.

info@nyna.co.uk
Email
info@nyna.co.uk
Phone
020 8087 4237
Office
Office 1.42, Building 2, Croxley Business Park, WD18 8YA