Lab Note #02 · All Lab Notes

The deliberately boring system

We're going to build a moving average crossover strategy. Yes, the most clichéd system in existence. And that's entirely intentional.

Why boring?

This series isn't about discovering alpha. It's about learning the complete development lifecycle of an automated trading system — from specification through implementation, backtesting, validation, and robustness analysis.

A simple system lets us focus on the process. If we started with something complex, every debugging session would become "is the logic wrong or is the infrastructure wrong?" With a moving average crossover, the logic is so transparent that any issue we encounter is almost certainly infrastructure, implementation, or methodology — exactly the things we need to learn.

The specification

Following the five-component framework from Lab Note #01, here is our system specification in plain English:

Component Specification
Instrument EURUSD
Timeframe H1 (1-hour bars)
Data observed Close price of each completed bar
Indicators 20-period Simple Moving Average (fast MA)
50-period Simple Moving Average (slow MA)
Entry — Long Fast MA crosses above Slow MA on the most recently completed bar. Submit a market order on the first available tick of the next bar; the fill price is not guaranteed.
Entry — Short Fast MA crosses below Slow MA on the most recently completed bar. Submit a market order on the first available tick of the next bar; the fill price is not guaranteed.
Exit Reverse signal only. When a new entry signal fires in the opposite direction, close the current position and open the new one.
Position sizing Fixed: 0.1 lots per trade
Stop loss None (initial version — we'll address this)
Execution Market orders; evaluate 1 pip of adverse slippage per side as an explicit cost scenario, not a guaranteed tester fill setting
Costs Spread: use live/historical spread from broker. Commission: as per account.

What this specification gives us

Notice what we've done: every decision is explicit. Another developer has a concrete baseline to implement. Matching results also requires matching data, account settings and execution rules; Lab Note #03 makes those implementation details explicit. There's no ambiguity about:

What we're deliberately ignoring (for now)

This specification has obvious weaknesses. No stop loss. No position sizing based on risk. No consideration of trading sessions or news events. Fixed parameters. Single instrument.

Good. We know these are weaknesses. We'll address each one as the series progresses. Trying to build the "complete" system on day one is how projects stall — and how complexity hides bugs.

In the next lab note, we take this specification and translate it into MQL5 implementation excerpts and the execution checks an Expert Advisor needs before testing.

Want help writing a rigorous specification for your own strategy?

A clear spec is the foundation of everything that follows. Let's talk.

← Previous: What is a trading system? Next: Implementing it in MQL5 →