Systematic trading is the decision to write your rule down before the money is on the line — and then to let the rule, not your mood at 3 p.m., place the order. That single commitment is what makes a trading idea testable, repeatable and, eventually, wrong in a way you can measure.
A financial market is a mechanism that lets capital meet risk. Somebody has money and no use for it today; somebody else has a use for money and no money. A market lets the first hand the second some capital in exchange for a claim — on future profits, on interest payments, on the value of something else entirely — and, crucially, lets them change their mind later by selling that claim to a third party. Almost everything else in finance is a detail of how that exchange is organised.
Four broad categories cover nearly everything traded, and they differ in what drives the price much more than in how you trade them. Pick one:
The distinction people find easiest to nod at and hardest to apply. In the primary market a security is created and the proceeds go to the issuer. In the secondary market the same security changes hands between investors and the issuer receives nothing at all — not one cent, not ever. Step through a company’s life and watch the “proceeds to issuer” counter stop moving the instant the stock lists.
A private company, some founders, and no public market.
There are two ways to trade. A discretionary trader looks at the same market you do and decides. A systematic trader writes the decision down as a function of observable data, and then executes whatever that function says — including when it feels wrong, which is most of the interesting times. The difference is not intelligence. It is reproducibility: a rule can be replayed on ten years of history and on the same day twice, and a human cannot.
Below is one seeded price path — the same 260 ticks for everybody. Encode a rule and it produces one answer, and it will produce that same answer every time you press Run. Then run the discretionary trader on the identical path: same data, same instrument, eight runs, eight different outcomes, because their state includes a mood. Note that the gut trader is not bad — sometimes it wins. It is unrepeatable, and an unrepeatable edge cannot be tested, sized, delegated or improved.
Every systematic trading system — a $200 hobby bot or a $60bn fund — is assembled from the same five parts. They are not equally glamorous and they are not equally likely to kill you. Click a pillar, read what it does, then switch it off and read the specific, boring, entirely survivable failure that follows.
If you are going to build a trading system, three questions decide whether it is worth building: what family of edge are you claiming, how much of that edge is an artefact of how you tested it, and what number will you use to argue that the thing works? The three widgets below are the three questions.
Signal research is the hardest and most valuable part of the job, but the raw material is not unlimited: nearly every published edge belongs to one of a handful of families, each with a story about why somebody would pay you. Toggle families on and watch where each would have traded on the same path, then change the regime and watch the ranking invert. A family is not right or wrong — it is a bet on a regime.
| Family | Trades | P&L (bps) | Hold | What it believes |
|---|
Here is a strategy with a naive backtest Sharpe of 2.41 — the kind of number that gets a slide deck funded. Every toggle below removes one specific lie from the test. None of them changes the strategy; all of them change the answer. The order matters less than the destination, and the destination is usually near zero. This is the single most common reason a good-looking research result loses money in production.
Raw return is almost meaningless on its own: 40% a year on 90% volatility is a coin flip with a good story. These four numbers are what a practitioner actually reads, and they are all computable from one equity curve. Move the sliders and watch which metric notices. Pay attention to how little vol it takes to destroy a Sharpe, and how brutally turnover interacts with cost.
Not exotic failures. These are the ones that show up in a first systematic project, every single time. Open them.
The bot places orders, but you restart it when the drawdown gets uncomfortable, you widen the stop “just for today”, and you skip the trade that looks obviously wrong. That is a discretionary strategy with extra steps, and it inherits the worst property of both: it cannot be backtested, and it is not actually being run by a human who can reason.
The tell is that your live P&L and your backtest P&L diverge in ways you cannot attribute. If you cannot reconcile them trade by trade, there is an undocumented decision in the loop.
Fix: every intervention becomes a rule with a parameter, in the code, in version control, and in the backtest. “Halt if trailing 20-day drawdown exceeds 12%” is a fine rule. Halting because Tuesday felt bad is not a rule, it is a free variable, and free variables are how a Sharpe of 2 becomes a Sharpe of 0.2.
You compute a signal from the day’s close and then trade at that same close. Or you z-score the whole series at once, so every early observation is normalised using data from the future. Or your “point-in-time” fundamentals are actually restated figures published three months later.
Look-ahead is not usually a big architectural mistake — it is one shift(1) you did not
write, and it can be worth several units of Sharpe on its own. It is the highest return-on-effort bug
to hunt in any research codebase.
Fix: make the time discipline structural, not a habit. Build the backtest as an event loop that hands the strategy one bar at a time and physically cannot pass a future bar — the same shape as the live system. If your research code and your live code share the strategy function, look-ahead becomes hard to express.
You download “the S&P 500“ as it is constituted today and run ten years of history on it. Every company that went bankrupt, got delisted or was acquired at a discount has been quietly deleted from your universe. Your test only contains firms that made it, so of course buying dips worked.
The effect is largest in exactly the strategies that look most attractive: deep value, distressed, small-cap mean reversion. Estimates of the bias in equity backtests commonly run 1–4 percentage points of annual return.
Fix: point-in-time universes with delisting returns included. If you cannot get them, say so explicitly in the write-up and haircut the result — an honest “Sharpe 1.1, likely survivorship-inflated by 0.3” is worth more than a confident 1.4.
The backtest fills at the mid, or at the close, or at the price the signal was computed from, and pays no fee. A real fill crosses a spread, pays a taker fee — 15 bps of notional in the arena’s default schedule — moves the market against itself, and sometimes does not happen at all.
The damage scales with turnover, which is why cost is the constraint that decides your holding period. A 3 bps edge per trade is a business at 0.5 bps of cost and a charity at 8 bps. Run the metrics widget above with 1,200 round trips a year and 8 bps of cost, and watch a 14% gross return become a loss.
Fix: model cost as spread + fee + impact from the first line of research, not at the end. Then measure realised slippage in production and feed it back. If measured cost is consistently above modelled cost, the strategy is smaller than you think — or does not exist.
You tried 400 parameter combinations, kept the best, and reported its Sharpe. With 400 tries, a Sharpe of 2 on 500 observations is roughly what pure noise produces — the maximum of 400 random draws is not an estimate of anything. Report it and you have reported the width of your search, not the quality of your edge.
The subtle version is worse: the search happens across sessions, in your head, over months, and is never logged. You “just know” 20 and 60 are the right windows because you have been staring at this data for a year.
Fix: hold out data you have never plotted, and touch it once. Prefer parameters that work on a plateau rather than a spike — if 18/55 and 22/65 both work, 20/60 is a finding; if only 20/60 works, it is a coincidence. Count and report your trials, and deflate the Sharpe accordingly.
Three questions, instant feedback, nothing recorded.
Q1A company listed at $20 and the stock now trades at $58. When an investor buys 1,000 shares at $58 today, how much of that $58,000 reaches the company?
Q2Of the five pillars, which one is most often the actual cause of a systematic strategy blowing up?
Q3A backtest shows 22% annual return with 900 round trips a year and assumes fills at the mid with no fees. Which correction will most likely destroy the result?
make install.