Lab Note #02 · Alpha Systems Lab

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. Enter at market on the open of the next bar.
Entry — Short Fast MA crosses below Slow MA on the most recently completed bar. Enter at market on the open of the next bar.
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, assume 1 pip slippage per side
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 could implement this system from this table alone and get identical results. 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 turn it into working MQL5 code — a real Expert Advisor that can run in MetaTrader 5's Strategy Tester.

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 →