Honest Quantitative Trading · 1.0

Quantitative Trading · 1.0

Honest
Quantitative Trading

A First Lesson for Beginners

Markets are nearly efficient, and making money is hard. This book sells no get-rich-quick fantasy. It teaches you to think like a scientist: survive first, then think about winning. Across five parts and sixteen chapters, it distills lessons paid for in real money and failed experiments—written for beginners.

English text: Markdown· Chinese editions: EPUB·PDF·License

“The tools of a pessimist, the heart of an optimist.”

Front Matter · Before We Begin

Preface

This Book Is for You, Just Starting Out

If you have opened this book, it is probably because you have heard the phrase “quantitative trading” and found it both mysterious and tempting: people write some code, run some data, and somehow get computers to make money for them. You may know nothing at all about statistics, have never written a line of code, or have never even heard of an “order book”—that is fine. This book was written for you at exactly this point.

I assume only a little everyday common sense: stocks rise and fall, buying and selling incur fees, and there is no such thing as a free lunch. Beyond that, I assume no background knowledge. The first time any technical term appears, I will explain it in plain language and with an everyday analogy before using it. You do not need to study elsewhere first; just read along.

Why This Book Is Needed Among All the “Get Rich Quick” Lessons

Search for “quantitative trading,” and you will probably be flooded by courses promising “$100,000 a month,” “consistent profits,” and “financial freedom.” They all have one thing in common: first they sell you a dream, then they sell you a method.

This book wants to do precisely the opposite. It wants to be the experienced mentor sitting across the coffee table from you, willing to tell you the truth first.

Here is the conclusion up front: this is hard. Markets are nearly efficient: any obvious money-making pattern has already been picked up by people who are smarter, wealthier, and faster—like a hundred-dollar bill on the ground in a busy downtown, gone in less than a second. After fees and all the invisible costs are deducted, trading is more like a “negative-sum game,” in which most people lose money over the long run. This is not meant to scare you away; it is simply the real setting of the game.

So why is it still worth learning? Because markets are only nearly efficient, not perfectly efficient. Constraints, risk, capacity, and execution frictions can still leave clues worth researching—but a clue is not automatically your profit. This book will not teach you how to get rich overnight. It will teach you how to judge honestly whether a clue has evidence behind it, whether it can cover its costs, and how to stay alive when that judgment turns out to be wrong.

The Soul of This Book: Survive First, Then Think About Winning

Behind this book is a real quantitative research lab, whose principles were bought with real money and countless failures. I have condensed them into three sentences. Like three hidden threads, they run through the entire book:

Survive first, then think about winning. A single devastating loss can wipe out years of progress. So this book begins with how to limit losses and preserve continuity before discussing how to find an edge.

A negative result is knowledge, not failure. Most ideas will not pass testing. As long as the question is clear, the test is honest, and the conclusion is recorded, ruling out a wrong direction is progress.

The tools of a pessimist, the heart of an optimist. In method, estimate fills, costs, and risk under adverse conditions; in spirit, do not stop asking the next, better question just because one idea has been rejected. Later chapters will turn each of these three sentences into rules you can follow.

What This Book Is Not

To respect your time, I should also be clear about what this book will not give you:

  • It is not a guide to getting rich quickly. There is no shortcut here to “tenfold returns in three months.” If that is what you want, you have opened the wrong book—and will probably pay tuition far more expensive than its price.
  • It does not give you ready-made trade calls. I will not tell you “which stock to buy, when to enter, or when to exit.” This book teaches methods and discipline: a way of thinking you can use for a lifetime, not one-off answers.
  • It does not guarantee profits. No book or strategy can guarantee that you will make money. What this book can offer is a much better chance that you will not be wiped out early and can keep learning—and in this game, that is already extraordinarily valuable.
  • It is not a programming book or a mathematics textbook either. We will use some statistical intuition, but I promise to explain it plainly before introducing formulas, and never bury you under a pile of symbols.

How to Read This Book

A Map of the Book: Five Parts

This book has sixteen chapters in five parts, built one layer at a time like a house:

Part I | What Game Is This? (Chapters 1–3). First, see clearly what you are about to play: quantitative trading is not a crystal ball, but a discipline of placing bets; why markets are hard to profit from; and how research arrives at credible conclusions.

Part II | The Foundations of Markets and Data (Chapters 4–5). Lay the foundation: how the market machine works (order books and liquidity), and why “data” is the lifeblood of the whole endeavor—a wrong map sends even the most beautiful route straight into the rocks.

Part III | Turning Ideas into Testable Rules (Chapters 6–9). The core craft of research: trim the vague intuition of “I think” into a hypothesis that can be disproved; test it with the time machine of backtesting; use statistical rigor to distinguish real skill from pure luck; and finally turn it into a rule a machine can follow every day.

Part IV | Learn to Survive First (Chapters 10–13). The center of gravity of the book: how much real execution costs; how risk management keeps you alive; what genuine diversification in a portfolio looks like; and how to cross the irreversible threshold from paper research to live trading with real money.

Part V | Mindset and the Long Road (Chapters 14–16). The closing section, and the gentlest one: the traps that live not in code but in the mind (human nature); how to turn negative results into knowledge; and finally, how to find a corner of the field that is your own.

A Suggested Reading Order

I wrote this book as a gradual journey, so my strongest recommendation is to read straight through from Chapter 1 to Chapter 16. Each chapter uses ideas laid down earlier, and skipping around makes it easy to lose your footing.

But I know you may be busy. If you can read only a few chapters first, my personal recommendation is: Chapter 1, Chapter 2, and Chapter 11. The first two show you the nature of this game; Chapter 11 (risk management) is the lifeline behind “survive first, then think about winning.” Even if you set everything else aside for now, take the discipline in that chapter to heart first.

As for the more method-focused chapters in Part III, if they feel demanding on a first read, give yourself permission to grasp the main idea first and return to the details later. This is a book to revisit, not one to read once and put on a shelf forever.

What Each Chapter Looks Like

To make reading easier, every chapter follows the same structure. Make use of it:

  • Opening: A scene or a common misconception draws you in.
  • Main text: The chapter’s core ideas are explained one by one through analogies and small examples.
  • Common Pitfalls: A small boxed note points out the mistakes beginners are most likely to make on this subject. Slow down when you see this marker—these are usually lessons someone else paid dearly to learn.
  • A Lesson from Practice (in some chapters): A real pitfall the lab encountered, retold as a story you can understand. These are often the most expensive passages in the book.
  • Chapter Takeaways: A few sentences that gather the essentials. Come straight here when you want to review what you have read.
  • Try It / Think About It: One or two small exercises or questions for reflection. Please really pause and think—the ideas take root only when you work through them yourself; simply letting your eyes glide over them makes them easy to forget.

Three Mental Preparations for Beginners

Finally, before you set out, there are three things I want to tell you first, so that you do not trip yourself up halfway through:

First, slow is fast. This book will not have you trading tomorrow, nor does it encourage you to do so. The real first step is to think through the ideas and discipline. Those who rush into the market are usually the quickest to leave it.

Second, you will “fail” often—and that is right. You will find that most of your ideas do not hold up. Please learn to understand that as “I have ruled out another wrong direction,” rather than “I am not good enough.” Here, honestly disproving yourself is a skill, not a setback.

Third, make both curiosity and discipline into habits. More than any particular trick, this book hopes to give you a stance you can keep for life: stay curious about the world, and stay demanding of yourself. When both become instinct, you are already walking a path taken by very few people.

Safety and Disclaimer

Finally, a few points that must be made clear:

This book is solely for educational and knowledge-sharing purposes, intended to help complete beginners build sound concepts and research methods. Nothing in it—including any strategies, examples, or figures—constitutes investment, financial, or trading advice, nor is it a recommendation to buy or sell any financial product.

Trading involves real financial risk. Any strategy can lose money, and you may lose some or even all of your principal. Past performance (including any backtest result) does not guarantee future profit. The examples in this book are simplified to illustrate concepts and must not be copied directly into live trading.

Before putting any real money to work, fully understand the risks you are taking, use only spare money you can afford to lose, and consult qualified professionals when needed. This book can help you lay a solid foundation of ideas and discipline, but every final decision—and its consequences—remains your own responsibility.

All right: the caveats are now out in the open. Turn the page, and we will begin with “What exactly is quantitative trading?”

Part I · What Game Is This? · Chapter 1

Quantitative Trading—Seeking a Long-Term Edge in an Uncertain World

What You Think Quant Is, and What It Actually Looks Like

Let me ask you a question first: when you hear “quantitative trading,” what image comes to mind?

My guess is something like this: a genius sitting before six monitors, with green waterfalls of numbers streaming across them; a mysterious program that can calculate which stock will rise tomorrow; or a cold, precise machine that quietly moves money from the market into its own pocket—and never makes a mistake.

If that is what you picture, do not worry. Almost every beginner does. But I need to tell you plainly from the start: that picture is quite far off.

Real quantitative trading is not a crystal ball for predicting the future. It is more like a casino that has been open for a long time—notice that I said a casino, not a gambler. The difference between the two is the first and most important thing this book will teach you.

A gambler cares whether they will win this hand; a casino cares whether, over its next ten thousand hands, it will win on average. The gambler fixates on individual outcomes, with emotions rising and falling hand by hand. The casino cares about only one thing: design the rules so that every hand gives it the tiniest edge, then deal enough hands.

That is what a quantitative trader does. They do not predict the future; they manage probabilities. This may not feel especially meaningful yet, but by the end of this chapter, I hope it will become the backdrop for how you see this craft.

What Is Quantitative Trading? Replacing “Market Feel” with “Rules + Data”

First, let us make the terminology clear.

Quantitative trading and systematic trading overlap heavily, but they are not exact synonyms. The former emphasizes data, models, and computation; the latter emphasizes making decisions according to a prewritten system. To keep things accessible for beginners, this book uses “quantitative trading” as a broad term: using clear rules and data to decide when to buy and sell, rather than relying on in-the-moment “feelings.”

Here is an everyday analogy. There is a fruit seller at the entrance to your alley who has been selling fruit for thirty years. Without any equipment, he can heft a watermelon in one hand and know whether it is sweet. That is “market feel”: intuition developed by a master through decades of experience. It is impressive, but it has three problems. First, if you ask why this one is sweet, he probably cannot explain it clearly. Second, if he is in a bad mood today or slept poorly last night, his feel may be off. Third, the skill cannot be passed on to someone else; when he retires, it is gone with him.

Quantitative trading turns “hefting a watermelon” into a set of written rules: “If it weighs more than 5 kilograms, makes a deep sound when tapped, and has clear rind patterns—then judge it to be sweet.” What are the benefits? The rules are written down, so they can be checked. They do not depend on mood, so they will not change their mind at the last minute. Given the same data, code, and execution conditions, another person or another computer can produce a verifiable result.

In markets, these “rules” do not determine whether a watermelon is sweet; they determine whether “now is the time to buy, sell, or stay put.” The “data” fed into the rules are the traces left by the market: price, volume, time, and so on.

So the core of quant is actually very simple: translate vague intuition into clear rules, then use data to test whether those rules really work.

How Is It Different from Discretionary Trading? Backtestable, Reproducible, and Less Emotional in the Moment

So how exactly is it different from buying and selling by feel, which we call discretionary trading? The difference lies in three very practical areas.

First, it is backtestable. Once the rules are written clearly, you can run them through historical data to simulate what would have happened in the past. A discretionary trader’s “feeling at the time” is hard to replay exactly; quantitative rules can be tested repeatedly. Chapter 7 will fully explain why backtests are both useful and dangerous.

Second, it is reproducible. Given the same data, parameters, code version, and execution assumptions, you today, you tomorrow, and a stranger on the other side of the world should be able to reproduce the same result. That means success and failure can be traced, and the system can be improved step by step.

Third, it can reduce emotions rewriting decisions in the moment. When a stock is falling, it is easy to change a previously agreed stop-loss into “let’s wait a little longer.” After making a profit, it is also easy to get carried away and increase the position until it is out of control. Quant cannot eliminate emotion, but it can put as much of “what to do” as possible into rules in advance, leaving less room for fear and greed to seize control at the last minute.

Many beginners think the value of quant is “calculating more accurately than everyone else.” More often, and more practically, its value is making judgments inspectable, setting risk boundaries in advance, and reducing the chance that an impulse changes your rules for you.

Busting Three Misconceptions First

Before we go further, we need to clear away three landmines that trip up beginners most easily. Remember these three statements: quant does not mean high frequency, does not mean AI-powered perfect prediction, and certainly does not mean guaranteed profits.

Misconception 1: Quantitative trading is high-frequency trading—the kind that places thousands of trades per second. It is not. High-frequency trading is indeed one branch of quant, and it often requires expensive infrastructure, extremely low latency, and detailed market microstructure models. But quant also includes low-frequency strategies that adjust positions only once a day, every few days, or even every few weeks. Speed is a feature of a strategy, not the definition of quant. You do not need a supercomputer; an ordinary laptop is enough to begin research—just do not use it to enter an arms race over latency.

Misconception 2: Quant means using the most advanced AI to make uncannily accurate predictions. Also not true. Artificial intelligence is only one of many tools that quant can use. The real craft is not how flashy the model is, but whether the data fit the problem, the objective is clearly stated, and the testing is honest. Many failures do not happen because the model is “not smart enough,” but because the data contain traps, labels peeked into the future, costs were ignored, or the researcher tried too many things on the same history. However new the tool, it cannot protect you from fooling yourself methodologically.

Misconception 3: Quant is a money-printing machine with guaranteed profits. This is the most dangerous one, so I want to be emphatic: there is no strategy with guaranteed profits, no holy grail, and no automatic button for financial freedom. Any product or method claiming “guaranteed profits” should set off a major alarm: it is either hiding risk or has not understood its own model. Quant does not eliminate risk. It is about “understanding risk, quantifying risk, and managing risk.” An honest quantitative trader will not tell you only how much you might make; they will first explain the risk limits, stress scenarios, and uncertainty in the estimates. Actual tail losses and their probabilities often cannot be known precisely, so risk management is not about pretending to calculate disasters exactly. It is about making sure you can survive even when your estimates are wrong.

Clear these three landmines, and you are already ahead of more than half the beginners in the market.

A Concrete Example: What Rules Look Like

After all that, this may still feel a little abstract. Let us look at one of the most classic and simplest rules, so you can see firsthand what “turning intuition into rules” looks like.

This example is called a moving-average crossover. Do not let the name intimidate you; it is extremely simple.

First, what is a moving average? A “20-day moving average” adds up the closing prices from the most recent 20 days and divides by 20, producing an average price. It is calculated each day and connected into a line. Think of it as the stock price’s “recent temperature”: it smooths out day-to-day noise so that you can see the general direction. Similarly, a “60-day moving average” is the average over the most recent 60 days, reflecting a longer-term, slower trend.

All right, here are the rules—just two sentences:

  • When the 20-day moving average crosses above the 60-day moving average—buy.
  • When the 20-day moving average crosses below the 60-day moving average—sell.

The intuition is this: when the short-term moving average crosses above the long-term one, recent momentum has begun to exceed longer-term inertia, perhaps marking the start of an uptrend. When it crosses below, the trend may be weakening.

You see? That is a complete quantitative trading rule. It does not say “I think,” “I guess,” or “my market feel tells me.” Instead, it gives an entry and exit direction that a computer can execute and that you can verify with a backtest. (Strictly speaking, it still lacks details such as execution timing, position size, costs, and how to handle unusual situations; we will add those pieces one by one later.) Under the same price data and calculation conventions, anyone should arrive at the same crossover points.

I need to add one honest warning: do not treat these two sentences as a ready-to-trade answer. A moving-average crossover can produce completely different results across markets, periods, parameters, and cost assumptions. Sometimes it captures trends; sometimes it gets repeatedly whipsawed in a range-bound market. I am not presenting it for you to copy, but to show you what “rule-based” itself looks like. Your first step is to take any vague thought in your mind—“I think it will rise”—and translate it into a precise, testable sentence like this. Chapter 6 will teach you how to refine such a sentence into a “hypothesis that data can disprove.”

So What Do Quantitative Traders Actually Earn?

If they are not making money by guessing correctly, then what are they relying on?

The answer lies in the casino analogy at the beginning. Quantitative traders do not earn money from “guessing this hand right.” They earn money from “holding even a tiny probabilistic edge over the long run and across many bets, while managing risk with discipline.”

Let me make the numbers as small as possible so you can see it at once. Suppose you discover a very slight edge: buying under certain conditions earns an average of 0.5% per trade. But it is only an “average”—any individual trade might make a big profit or a small loss, moving up and down with no certainty at all. The edge is so small that you could never reliably see it with your eyes or catch it through market feel.

If that average 0.5% edge still exists after costs, the sample is not crowded entirely into one type of market environment, and the mechanism producing the edge does not quickly disappear, then repeated execution may gradually reveal that edge in the average result. The law of large numbers will not create profits from a bad model, nor does it guarantee that tomorrow will follow yesterday’s distribution. It only reminds you that a small edge must be evaluated over enough relatively comparable trials; you cannot draw conclusions from one or two wins or losses. You do not need to win every hand, but you must be able to withstand the losses when bad luck comes in a row.

Do you see it? There are two essentials here, and neither can be missing:

First, the edge must be real. This is the hardest part. Markets are full of mirages that look like edges but are really just luck. From Chapter 7 through Chapter 10, this book is almost entirely about one question: how to use the strictest, most skeptical methods to tell whether the edge in your hands is real gold or noise. Because most beginners’ “holy grails,” once taken apart, are merely noise that happened to arrange itself attractively.

Second, you must stay alive until the edge pays off. Even if the edge is real, it does you no good if you are wiped out before it has a chance to work—by one greedy oversized position or one stubborn refusal to exit a losing trade. That is why the second half of this book, beginning with Chapter 11, will keep hammering home the same lesson: survive first, then think about winning.

You Are a Scientist, Not a Gambler

By now, the outline of quantitative trading should be clear: it is not a crystal ball for predicting the future, but a set of rules repeatedly executed under uncertainty. It does not ask, “Can I guess this trade right?” It asks, “Can the rules be tested? Can the results be verified? Can losses be contained?”

This also explains why quantitative trading resembles scientific work more than gambling. A gambler treats one win or loss as an answer; a researcher treats one result as evidence. If a rule performs well, they ask whether the data, costs, or luck caused it. If it performs poorly, they do not immediately invent excuses to save it.

Chapter 3 will develop this stance into a complete research cycle. For now, remember the one dividing line you need to take away from this chapter: gamblers rely on feelings in the moment; quantitative researchers rely on rules written clearly in advance and auditable afterward.

Part I · What Game Is This? · Chapter 2

Markets Are Nearly Efficient—Why Making Money Is So Hard

The Hundred-Dollar Bill on the Ground

There is an old economist joke. Two professors are walking down the street when the younger one suddenly looks down and shouts, “There is a hundred-dollar bill on the ground!” The older professor does not even look and says calmly, “Impossible. If it were really a hundred-dollar bill, someone would have picked it up already.”

This joke is often used to tease economists for being rigid, but it contains an intuition that is vital for beginners. At the end of the previous chapter, I mentioned the classic moving-average crossover rule. It once worked; now it can barely make money because so many people use it that its small edge has been “worn away.” This chapter will answer directly: who wears that edge away, and by what force?

Let me ask you a question: if there were an obvious, easy, and reliable way to take money from the market—so obvious that you and I could casually discover it—why would it still be lying there on the ground?

A Group of Tireless Street Sweepers in the Market

First, let us give that force a name.

When a profitable pattern becomes obvious enough for everyone to see, a large crowd will rush in to do the same thing. They race to buy, pushing prices up; they race to sell, pushing prices down. The more people do it, the thinner the original price gap or predictability usually becomes, until it may be too thin even to cover costs. That is how competition picks up the “hundred-dollar bill.”

These faster-reacting, lower-cost, or better-resourced participants are often collectively called smart money: professional funds, market makers, high-frequency trading firms, and the like. The label does not mean they are always right. It only means they are better able to discover, execute, and scale a public opportunity. The market’s street sweepers make mistakes too, but obvious money usually will not wait for you alone to notice it.

The academic framework behind this idea is the Efficient Market Hypothesis (EMH). For now, hold on to the shared intuition: public information is quickly processed by many participants and reflected in prices, so it is very hard to earn persistent risk-adjusted excess returns using only material that everyone can see. In everyday terms, it is like a busy supermarket: an item that is clearly mispriced and absurdly cheap will not sit on the shelf all day; someone will grab it first.

Let me also introduce a keyword that will run throughout this book: alpha, or excess return. It means “the part of your return that beats the market average and genuinely comes from your own skill.” If you buy the broad market and rise along with it, that is not alpha; you simply caught a favorable tailwind. Alpha is what you earn beyond what the market would have given you anyway, through real skill. And the harsh truth of the Efficient Market Hypothesis is this: alpha is scarce, and once it appears, smart money can easily pick it up.

But Watch Those Two Words: “Nearly Efficient”

If the story ended here, this book could close right now—if nobody can make money, go home and sleep.

But the truth is that markets are only nearly efficient, not perfectly efficient. And the gap between those two words is the entire space in which quantitative traders operate.

Why only “nearly”? Because participants face capital, institutional, risk, and attention constraints. A hundred-dollar bill in the middle of a busy street is unlikely to remain there long. But a small coin that rolls into a drain crack may be left alone for a while because it is hard to retrieve, cannot accommodate much capital, or requires taking a particular risk. Note: there may not actually be money in the mud. For now, this is only a clue—if opportunities exist, they often come with capacity, data, or execution conditions. Chapter 16 will discuss how to judge whether one suits you.

After Costs, Active Trading Is More Like a Negative-Sum Game

We need to be precise here: holding companies, bonds, or other assets does not make aggregate returns a zero-sum game. But among active traders competing to “beat everyone else” in the same market, relative returns before costs are roughly offsetting. Fees, taxes, bid-ask spreads, and slippage then continually take a cut, pushing the combined relative results below zero.

For now, simply recognize the names of these costs. Chapter 4 will explain how spreads, depth, and market impact emerge from the order book; Chapter 10 will put them into a full cost ledger for a trade. For now, remember one thing: an edge must first cover transaction costs before it deserves to be called a tradable edge.

The more often you trade, the more often costs are charged. So an idea that appears profitable can still lose more and more money if its margin is too thin and its turnover is too high.

How Do Those “Triple Your Money in Three Months” Masters Appear?

You have surely seen this online: someone posts a brokerage statement showing that they tripled their capital in three months, then starts teaching courses, selling signals, and recruiting students.

Here I want to teach you a concept that will serve you for life: survivorship bias. You see only those who “survived” and succeeded. You do not see those who failed, blew up their accounts, quietly deleted their accounts, and left the market. As a result, you seriously overestimate the probability of success.

Here is an analogy. I gather ten thousand people and give each one a coin to flip ten times in a row. By luck alone, around ten people will flip “heads ten times in a row.” Those ten people have no skill at all; it is pure luck. But if one of them starts teaching and says, “I invented a method for reliably making coins land heads,” then displays that beautiful record—would you believe them?

Some market “masters” may simply be the lucky survivors among those ten thousand people. This does not mean there are no truly skilled traders in the world. It means that from one attractive brokerage statement alone, you cannot tell whether someone is genuinely skilled or simply happens to be at the lucky tail of the distribution. You cannot see the full denominator, and platforms and sharing mechanisms are more likely to put the winning trades and winning months in front of you.

This also explains why frequent active trading is especially unfriendly to individual investors. Costs take one layer first; chasing rallies, selling in panic, and doubling down in anger take another; survivorship bias then causes people to underestimate the first two. Even without assuming that every individual investor must lose money, this structure is enough to show that persistently beating an appropriate benchmark after costs is difficult, and one attractive brokerage statement is nowhere near enough to represent the whole distribution.

So Is This Chapter Trying to Talk You Out of It?

No. Quite the opposite.

I have spent so much effort explaining that “making money is hard” to set your expectations correctly—because people who set out with the wrong expectations die the fastest. If you think alpha is everywhere, you will take oversized positions, trade frequently, and believe you are chosen after your first winning streak. Then costs and the return of luck to normal will slowly grind you down.

A more reliable expectation is this: tradable edges are often thin. After finding one, it must still pass many tests involving data, statistics, costs, and live execution. Even for full-time teams, research often consists largely of ideas that fail to pass. Rejecting an idea is not unusual; what is unusual is an idea that still leaves behind something clear enough, stable enough, and sufficient to cover costs after a series of attempts to disprove it. The online promise of “three simple steps and guaranteed monthly profits” leaves out every difficult gate.

Difficulty itself is not protection, and obscurity does not mean there is money to be made. It only means that competition, fixed costs, and capacity may differ among opportunities. Chapter 16 will discuss how to judge whether an opportunity fits your resources. For now, keep the simpler conclusion: public, obvious money is hard to leave lying around, and every corner must still pass the tests of evidence and cost.

The market is nearly efficient, but not equally efficient in every place and at every moment. That “nearly” is not a promise of riches; it is only a narrow gap that makes research possible.

Part I · What Game Is This? · Chapter 3

What Quantitative Traders Actually Do: The Research Cycle and Credible Conclusions

The Research Cycle: A Map You Will Follow Again and Again

Start with the most important idea: the core job in quantitative trading is not “trading,” but “research.”

Actually placing orders, buying and selling, making or losing money—those are a small step at the very end of the process. Before that is a long research process that you repeat in cycles. Think of it as six stages:

Stage 1: Form a hypothesis. You have an idea. For example: “Whenever Bitcoin suddenly drops late at night, it often rebounds in the next hour.” This is a hypothesis—in plain language, a statement that says, “I think the market follows this pattern.” For now, though, it is only a feeling; it has not been tested. The work at this stage is to refine a vague intuition into a precise, testable statement.

Stage 2: Find data. Once you have a hypothesis, you need historical data to test it. You may need price and trade records from the past several months or even years. This may sound like the least exciting stage, but it is one of the easiest places to go wrong: exchange data is often dirty, incomplete, or even stamped with incorrect times. Data is your lifeline. Chapter 5 is entirely about avoiding being misled by dirty data.

Stage 3: Backtest. Put the clearly written rules into a simulation using historical data and see whether they can even survive the past. A backtest is a screening tool, not a guarantee of the future; Chapter 7 will focus on its limits.

Stage 4: Try to disprove it. When a backtest produces a beautiful curve, beginners may excitedly shout, “I found the holy grail!” A mature researcher asks first: “What kind of mistake is most likely to create this curve? What evidence would force me to abandon it?” They actively attack their own result.

Stage 5: The risk-management gate. Even if a strategy passes the earlier tests, a wall still stands between it and real money. This stage no longer asks, “How much does it make on average?” It asks about position size, drawdown, tail scenarios, and stop conditions: even if the estimate is wrong, can the system still keep losses within an acceptable range? Chapter 11 focuses on risk boundaries.

Stage 6: Iterate. Then—and this is the key to the cycle—whether the previous round succeeded or failed, return to Stage 1 with what you learned and form the next, better hypothesis. Often, you return to the beginning carrying the conclusion, “This direction has been rejected.” That is not failure. It is progress. Why? That is the next point.

These six stages are the loop a quantitative trader follows day after day, week after week, year after year. Notice that there is almost no place here for “watching the market,” “placing orders by feel,” or “going with your gut.” It is a dull but rigorous path, much like an assembly line in a laboratory.

Why Most Ideas Are Eliminated

Markets are nearly efficient, so the research process is naturally a filtering machine: most ideas that seem reasonable turn out to be coincidences, or too thin to cover costs. When a mature researcher sees a beautiful curve, their first reaction is not to celebrate it, but to ask: “Which test is most likely to overturn it?”

For now, remember the rhythm of research: forming an idea is quick; reaching a credible conclusion is slow; and a credible conclusion is often negative. Chapter 6 will fully explain how to turn intuition into a falsifiable hypothesis, and Chapter 15 will explain how to preserve negative results as knowledge.

So rejecting ideas is not an accidental loss in research. It is the most common output when the research cycle is working normally.

Why Dull, Repetitive, Rigorous Work Is Good

You can probably now see why real quantitative work is so “boring.”

It is boring because it is rigorous. Every idea must complete all six stages; every backtest must be carefully guarded against traps of every kind (look-ahead bias, survivorship bias, overfitting—terms you do not need to understand yet; later chapters will unpack them one by one); every conclusion must be asked three times, “Did I get something wrong?”

This kind of boredom is the same as calibrating instruments in a laboratory again and again. It is not glamorous, but it is the foundation of every reliable result.

This kind of boredom does not guarantee you an edge. Its benefit is more modest: it makes the process repeatable, the conclusions auditable, and a beautiful curve less dependent on memory, luck, and improvised explanations. What is worth maintaining is not dullness itself, but the reliability it buys.

So if you eventually enter this field and one day discover that you spent the entire day reading reports, debugging, and rejecting your own hypotheses—without a single decent experiment having “made money”—do not panic. You may not be doing it wrong. That is probably exactly what the work should look like.

Discipline Is Not Courage; It Is Recording Every Step

The value of a research process is not only that it lets a computer execute for you. More importantly, it makes every key decision traceable: what the original idea was, which version of the data was used, which parameters changed, which check failed, and why the final decision was to continue or stop.

Without these records, emotion does not need to cheat openly. It only has to quietly move a threshold, ignore an ugly sample, or present an exploratory finding as a prediction made in advance, and the whole conclusion becomes distorted. The point of the process is to make such changes impossible to make silently.

So the real discipline of a quantitative researcher is not “I have strong willpower,” but: important decisions must leave an auditable trail. Chapter 6 explains how to write hypotheses clearly; Chapter 8 explains how to lock down a test specification; Chapters 11 and 13 bring the same discipline to risk and live trading.

Part II · The Foundations of Markets and Data · Chapter 4

How Markets Work: Order Books and Liquidity

Late at night, you stare at your phone screen. A large number in an app says that something has a “current price” of 100 yuan. You decide to buy a little and press the green “Buy” button. A fraction of a second later, the screen says “Filled.”

Congratulations. But have you ever wondered: who exactly did your order execute against? And who set that “current price of 100 yuan”? Is there a boss sitting at the exchange, matching buyers and sellers and setting the price with a hammer?

No. Behind that button is a quiet, precise machine that never closes, twenty-four hours a day. In this chapter, we will take it apart. You will discover two things that overturn beginner intuition: first, the “market price” is not one number, but a stack of intentions waiting in line; second, the price you “see” and the price at which you actually execute are often two different things.

Understanding this machine is the foundation of all your future research. If you do not even understand how your money gets executed, the beautiful profits in your backtest may be nothing more than a beautiful misunderstanding.

A Market Is Not One Price; It Is a Stack of Queued Orders

Start with an everyday example. You are selling an old camera at a second-hand market and think, “At least 100 yuan,” so you list it at 100. The stall next to yours has people selling the same model: one lists it at 101, another at 102. What about buyers? One is willing to pay 99, one will only pay 98, and another calls out 97.

Arrange all those intentions to sell and buy in price order, and you have an order book. It is the heart of the market, and it looks like this:

Order side Price (yuan) Quantity (shares) Notes
Ask 100.3 5
Ask 100.2 3
Ask 100.1 2 ← Current lowest ask
↕ The gap in between = spread of 0.1 yuan
Bid 100.0 4 ← Current highest bid
Bid 99.9 6
Bid 99.8 8

The top half of the table contains asks—the prices sellers want and how much they want to sell. The bottom half contains bids—the prices buyers offer and how much they want to buy. The number of shares available at each price is the depth at that price: it tells you how much the market can collectively absorb or supply there.

Now look at the gap in the middle: the cheapest willing seller asks 100.1, while the highest willing buyer bids 100.0. Between them is nothing—no trade. Why is there a gap? That is the subject of the next section.

That Gap Is the Spread: The Price of Liquidity

The highest bid is 100.0, the lowest ask is 100.1, and neither side is willing to give up the 0.1 yuan in between. That gap is the bid-ask spread.

The spread is not a line the exchange draws at random. It is the result of buyers and sellers not yet meeting. People who keep bids and asks posted in the order book over time bear the risk of price changes and accumulated inventory; anyone who wants to trade immediately must accept the prices they offer. The spread therefore becomes the cost of being able to trade right away.

The ability to find a counterparty at any time and complete a trade at a not-too-bad price is called liquidity. The busier the market, the denser the orders, and the more intense the competition, the narrower the spread usually is. The quieter the market, the wider the spread.

Remember this intuition: the wider the spread and the thinner the executable depth, the higher your hidden cost of getting in and out. A neglected stock may show a “current price of 100” on screen, but the nearest seller may ask 105 when you want to buy, and the nearest buyer may offer only 95 when you want to sell. Before you have done anything at all, one purchase and one sale have already cost you 10 yuan.

Maker vs. Taker: Are You Providing Convenience or Using It?

Next are two roles. This is easy for beginners to miss, but it quietly determines a great deal of your trading cost.

Maker (also understood as a liquidity provider): If an order does not immediately trade against an existing order and instead remains in the order book waiting in line, it adds liquidity at that moment. For example, if the current highest bid is 100.0 and you place a buy order at 99.9, it will not execute immediately; it will patiently join the queue. You have “added” liquidity to the market, like setting up one more stall and giving people one more choice.

Taker (also understood as a liquidity consumer): If an order trades against an existing order as soon as it arrives, it removes liquidity at that moment. For example, if you buy the 2 shares offered at 100.1 using an executable price, you take the goods someone else has already put on display.

Here is a detail many beginners do not know: many exchanges charge these two roles different fees. Makers are often charged lower fees, and some platforms even give them a small rebate (because they help make the venue more active); takers are charged more (because they enjoy the convenience of immediate execution). Exchanges design fees this way to encourage more posted orders and deeper liquidity.

For quantitative traders, this is far from trivial. For a strategy that trades frequently, whether each trade makes or takes liquidity can accumulate over time into the difference between profit and loss. Chapter 10, “Execution Isn't Cheap,” will calculate this carefully. For now, plant one idea in your mind: how an order executes is itself a cost.

Market Order vs. Limit Order: Do You Want Execution or Price?

Where do makers and takers come from? From the two choices you make when placing an order.

Limit order: You set a price boundary—“I will pay no more than 99.9; if I cannot buy at that price, forget it.” Its principle is price boundary first, execution second. A buy limit order will not execute above its limit price, but it may fill only partially or not at all. If the market keeps rising, your 99.9 order will sit there alone, watching the train leave. A limit order usually makes you a maker.

Market order: You do not specify an execution price; instead, you tell the system to complete the order as quickly as possible at the quotes available at that time. Its principle is execution first, price second. The benefit is that it will almost certainly execute; the downside is that you do not know in advance how bad the execution price may be. A market order usually makes you a taker.

Neither is inherently better. The real question is: at this moment, which do you fear more—failing to buy, or paying too much? That choice leads directly to this chapter’s most important idea.

The More You “Take,” the More the Price Moves Against You

Return to the order book. Suppose you submit a market order to buy 5 shares. How will the market fill it?

It starts with the cheapest asks and takes them level by level:

  • First, take all 2 shares at 100.1 yuan → spend 200.2 yuan
  • That level is gone, so take the next 3 shares at 100.2 yuan → spend another 300.6 yuan
  • You now have 5 shares and have paid 500.8 yuan in total

Your average execution price = 500.8 ÷ 5 = 100.16 yuan.

Do you see it? The “best ask” you saw was 100.1, but your actual average purchase price was 100.16. No one stole the extra 0.06, and it is not a fee—you caused it yourself by “taking too much at once.” This effect, where your own order pushes the price in a direction unfavorable to you, is called market impact.

The unfavorable gap between the benchmark price you chose and the actual execution price is often summarized as slippage. Market impact is one source of slippage; price movement while the order is transmitted, orders passing through multiple depth levels, and partial fills can also create a gap.

This intuition is worth a fortune: liquidity is limited. The inventory at every level of an order book is limited. The more urgently and heavily you buy, the deeper you must take and the more you pay. In an instrument with ocean-deep liquidity, a small order may barely move the price; in one with puddle-shallow liquidity, the same order can make a splash everywhere. Smaller orders therefore face lower market impact.

Therefore, the Price You “See” Is Never the Price You Execute At

Now we can answer the opening question.

What does the large “current price of 100” in an app actually represent? It depends on the platform: it may be the last trade, the midpoint of the best bid/ask, or a mark price. Whatever it is, it is not a promise of execution for you. What you actually face are the current best bid/ask, the quantity at every level, and the people queued ahead of you.

This has a direct implication for research: if historical prices contain only one closing-price series, they do not tell you how much could have been executed at that time, whether you could have obtained a place in the queue, or how many depth levels a market order would consume. Chapter 10 will turn these mechanisms into cost and execution assumptions; for this chapter, hold on to the underlying fact:

Price must always be considered together with quantity, direction, and timing. The market does not owe you a good price, and it does not guarantee that your limit order will execute.

Part II · The Foundations of Markets and Data · Chapter 5

Data Is Your Lifeline: Clean Data and Look-Ahead Bias

A ship is preparing to cross unfamiliar waters. Its navigator is experienced, its hull is sound, and its route has been planned almost perfectly: avoid the reefs, follow the currents, calculate every turn. Yet one day after setting sail, it strikes a reef and sinks.

Neither the navigator nor the ship is at fault. The map is: the reefs are marked in the wrong places, and the currents point the wrong way. Once the map cannot be trusted, a carefully planned route only carries the ship faster toward disaster.

In quantitative trading, data is that map. No matter how clever your strategy, elegant your code, or rigorous your statistics, if the data you feed it are wrong, dirty, or contaminated with information you could not possibly have known at the time, then the beautiful returns you worked so hard to calculate are nothing but a mirage.

This chapter introduces this quiet, number-one killer. It will not throw a loud error or flash red text. It will simply sit there quietly and let you believe you have found a gold mine.

Garbage In, Garbage Out

Engineers have an old saying: “garbage in, garbage out.” It means that no matter how precise a machine is, if you put garbage in, it can only produce garbage.

Recall what we said earlier: at heart, a strategy is a set of betting rules for “when you see this, do that.” It is like a vending machine—you insert the coin called “data,” and it returns a decision to “buy” or “sell.” The machine itself can be exquisitely designed, but it has one fatal innocence: it completely trusts that the coin you inserted is genuine.

Give it a mislabelled price and it will not question it. It will use that false price to calculate a false entry point, then report a false profit. Nowhere in the entire chain of calculation will anything raise a hand and say, “Wait, this number looks strange.” Each part simply passes the error along faithfully, amplifies it, and finally wraps it in a beautiful report card for you.

So there is an order you should remember for life in this craft: doubt your data before you doubt your strategy. Beginners are always eager to ask, “Is my strategy right?” Experienced people first spend a great deal of time asking, “Are my data clean?” A wrong strategy merely means this particular idea does not hold up; wrong data mean the foundations of every idea you have are built on quicksand.

The Number-One Killer: Look-Ahead Bias

Among all dirty-data problems, one is the most insidious, hardest to prevent, and most likely to fool smart people. It is called look-ahead bias, sometimes also called using a “future function.”

Here it is in plain language: look-ahead bias means that, at the moment you make a decision, you quietly use future information that you could not possibly have known then.

Consider a student who claims to be able to “predict” exam scores with astonishing accuracy. You investigate and discover that they only make their “prediction” after the exam is over, the teacher has graded the papers, and the scores have been posted. Of course they are accurate—the answers are already in front of them. Such a prediction is worthless, because at the moment you place a bet in real life, the future has not happened yet.

That sounds foolish—who would make that mistake? But when writing code for backtesting (using historical data to simulate a strategy’s performance; we will cover this in detail in Chapter 7), this error is more common than intuition suggests, and it often does not announce itself. Here is a classic small example:

You want to test this rule: “If a stock rises especially sharply on a given day, it will fall back the next day, so short it before today’s close.” But in your code, you use the day’s “high price,” which is only finalized after the close, to decide whether it rose especially sharply that day.

Do you see the problem? You intend to place the order before the close, but the day’s high is not settled until after the close. At 2 p.m., you used information that would only be known at 4 p.m. In a backtest, your strategy seems to have second sight and naturally makes a fortune; in live trading, at 2 p.m. you do not know where today’s high will be. Once that second sight disappears, the strategy immediately reveals its true form.

Look-ahead bias is frightening because it often pushes a backtest toward a more attractive-looking result, especially when future information directly determines selection, ranking, or execution. Of course, an error can also make results worse; the key is not that the direction is always fixed, but that the result has lost any executable meaning. When a strategy’s backtest looks too good to believe, an experienced person’s first reaction is not celebration, but: “Did I peek into the future somewhere?”

The Point-in-Time View: Put On the Glasses of That Moment

How do you prevent it? The answer is a principle that sounds simple but takes considerable work to apply: the point-in-time view.

It means: when simulating a decision at a past moment, you may use only the data that were genuinely available to you at that moment; anything that appeared or was corrected later is off limits.

It is like judging a historical figure’s choices fairly: you must put on the glasses of that era and judge using only the information they could obtain at the time, rather than demanding that they act on today’s hindsight.

It sounds obvious, but the data world contains a commonly overlooked truth: many data are revised after the fact.

  • A company’s financial report may be corrected months later, changing the original figures.
  • Government economic data are often quietly revised the following month.
  • The constituent lists of some indexes are adjusted retrospectively.

If your database stores only “what these numbers look like now,” rather than “what they looked like at that moment in the past,” then your backtest will unknowingly use versions that were only corrected later—another form of look-ahead bias. A truly rigorous database does not store the “final version of the truth,” but rather what we knew at every point in time. It is troublesome, space-consuming, and unglamorous, but it is necessary work if you want to draw the map correctly.

Survivorship Bias: You See Only the Samples That Survived

The second major trap is survivorship bias. It hides in data in a particularly subtle way.

Start with a classic image. During a war, batches of aircraft go out on missions, and only some return. Someone proposes reinforcing the parts of the returning aircraft with the most bullet holes. But a clever statistician asks: you can see only the aircraft that returned. The ones hit in vital areas never made it back for inspection—so the places with the fewest bullet holes are the most lethal and most deserving of reinforcement.

Survivorship bias in data follows exactly the same logic. Suppose you want to test a stock-selection strategy, so you obtain historical data for “all stocks still in the market today” and backtest it. That sounds reasonable, right? But you have missed an entire group: companies that have delisted, gone bankrupt, been removed, or disappeared over the years.

The list in your hands is a list of winners that survived until today. Backtesting with it is like surveying whether startups can succeed while interviewing only founders whose companies went public successfully—of course everyone says success is possible, because the failures are no longer on your interview list.

In fast-changing markets such as cryptocurrencies, this problem is especially clear. Assets still listed on exchanges today are only part of the historical set of projects; complete data are often harder to obtain for assets that went to zero, were delisted, or lost liquidity for long periods. If you backtest using only those that are “alive,” the results will systematically omit the paths of failure.

Clean data must define the sample according to the investable universe at the time and preserve delisted, removed, and failed members whenever possible. The point is not to indiscriminately throw in everything that died, but to avoid passing today’s survivor list off as the opportunity set of the past.

Alignment, Timestamps, and the Traps That Do Not Throw Errors

The issues above concern the “content” of data. The next group concerns its “shape”—more technical and mundane, but frequent causes of late-night panic in a lab.

The first is data alignment. Your strategy often needs to examine several datasets at once: prices from one exchange, prices from another, volume, and other indicators. They are like several parallel timelines. If even one timeline is misaligned—even by a single interval—your strategy sees a displaced version of the world. And the easiest place for such displacement to cause trouble is with timestamps and time zones.

At the same moment, some data are recorded in the time of your city, some in Greenwich Mean Time, and some simply as seconds counted from 1970. They may refer to the very same second while looking entirely different. Once you stitch together data from different time zones as if they shared one timeline, your “now” no longer matches its “now,” and a quiet form of look-ahead bias slips in—you may inadvertently use data from “eight hours in the future” to make a decision “now.”

What makes these errors so frightening is this: they usually do not throw an error. The program does not crash, flash red text, or complain. The data are read in, the numbers are calculated, and everything looks calm. In the lab, this has a name: silent failure—the most dangerous failures are often the ones that say nothing. An error that throws an exception at least stops you; one that does not will smile and let you proceed, all the way until you invest your money.

Another, deeper trap comes from data APIs themselves. Historical APIs from exchanges or data providers commonly impose limits on pagination, records per request, request frequency, and how far back data can be retrieved. Without page-by-page validation, your download may stop midway while still returning a normal-looking file. You think you have captured two complete years of data, when in fact you have only an incomplete three months—and it never tells you what is missing. You then plan a route with confidence using a base map you believe is complete but that actually has a huge hole in it. The resulting backtest is built on missing data.

So when you receive any dataset, do not rush to use it. Ask it a few questions first: Which time zone does its time use? How long does it really cover, and are there gaps? Where did the “missing samples” go? These seemingly simple questions matter far more than whatever flashy algorithm your strategy uses.

Part III · Turning Ideas into Testable Rules · Chapter 6

From Intuition to Hypothesis: Turning “I Think” into a Falsifiable Statement

An Afternoon Intuition

One weekend afternoon, you are watching prices on your phone. A coin falls 15% in a single day, and a thought pops into your mind:

“After falling that much, it should bounce, right?”

This thought is natural; almost everyone has had it. It may even be right. The problem is not whether it is right, but that—as it stands, you cannot test this sentence at all.

How much is “falling that much”? Does a 5% drop in a day count, or must it be 15%? How much must it rise for “it should bounce” to count? Does a 0.1% rise count as a bounce? Does 3%? Which is it? And how soon must this “bounce” happen? An hour? A day? A week?

Do you see? The same sentence, “I think a big drop will bounce,” can be interpreted in hundreds of different ways. And once an idea can be interpreted in hundreds of ways, it has a dangerous property: regardless of where the market eventually goes, you can say, “See, I wasn’t wrong.” If it rises, you say it bounced; if it falls, you say, “It has not fallen enough yet”; if it goes nowhere, you say, “It is building up.”

An idea that can never be wrong sounds impressive, but is actually worthless. This chapter will teach you how to carve this vague, comfortable, always-right “I think” into a clear statement that the market might prove wrong. In quantitative trading, whether an idea can be proven wrong determines whether it deserves your time to research.

A hypothesis is the testable statement you write after narrowing down a vague intuition. It is the starting point for all research. Without it, the backtesting, statistics, and cost estimates you will learn later have nothing to act on. So we must first learn how to produce one—and produce it correctly.

(For now, you can think of the word “hypothesis” as “a guess waiting to be examined.” It is not a conclusion; it is an ungraded exam paper.)

“Falsifiable”: An Idea’s Admission Ticket

First, a concept that may initially sound counterintuitive: the important thing about a good idea is not how likely it is to be right, but whether it can be wrong.

This concept is called falsifiability, and it comes from the philosopher of science Karl Popper. In plain language: a claim is worth researching only if there is some outcome for which you would have to admit, “If I see this result, I am wrong.”

An everyday example makes this clear.

“Tomorrow the sun will rise in the east”—this statement is falsifiable. If an observation contradicting its definition occurs, the statement is challenged. Falsifiability qualifies a statement to be tested; not being overturned by one test does not mean it has been permanently proven.

“There is a mysterious force in the universe that we can never detect and that interacts with nothing”—this statement is not falsifiable. You have no way to design an experiment proving it does not exist. It may sound profound, but because it refuses every test, it is useless for your trading.

Back to markets. “This coin has great potential” is not falsifiable—what is potential? How long may it take to materialize and still count? You can always say, “Its potential has not emerged yet.” But “This coin’s average return in the first hour after the U.S. stock market opens is higher than in the other 23 hours”—that statement is falsifiable, because I can define the sample, metric, and threshold in advance; if it does not meet them, this version of the claim fails the test.

In the world of quantitative research, “it might be wrong” is not a flaw; it is the admission ticket. An idea that can never be wrong is an idea from which you can never learn anything.

You will gradually come to like this feeling: the more an idea sticks its neck out and dares to say, “I am betting on this, and if it is not so, I concede,” the more valuable it is. Only when an idea willing to be overturned survives round after round of testing do you have reason to gradually raise your confidence in it—rather than treat it as an eternal truth.

The Four Parts of a Good Hypothesis

What, then, must a statement contain to deserve the name “good hypothesis”? I break it into four parts that you can check one by one like a checklist:

Part one: a direction. You must state clearly whether something rises or falls, increases or decreases. “These two things are related” is not enough; say, “When A is high, B tends to rise,” or “fall.” Without a direction, you cannot even judge right from wrong.

Part two: measurability. Every word in the sentence must be translatable into a number you can look up in the data. “Falls a lot” will not do; “falls more than 3% within one hour” will. “Afterward” will not do; “within the next 30 minutes” will. This is the dullest step, yet the most important—you are forcing yourself to compress the fuzzy feelings in your mind into a ruler with markings.

Part three: a mechanism. This is the part beginners most easily skip, yet it is the most important. You must not only say “this will happen”; you must also answer “why will this happen?” What force is driving it? Who does what, for what reason, to create the phenomenon you expect? We will devote a whole section to this part shortly, because it is the dividing line between real research and luck.

Part four: it can be overturned. Bringing the first three together, your statement must ultimately yield a clear result: “If I see X, it means I was wrong.” If you rack your brains and cannot think of an outcome that would prove you wrong, it is not because the idea is too strong; it is because it is still too vague. Go back and keep carving.

Let us run the opening sentence, “I think a big drop will bounce,” through this narrowing process:

  • Original intuition: A big drop will bounce. (It has none of the four parts.)
  • Add measurement: A coin falls more than 3% in one hour. (Now there is a measurable “trigger condition.”)
  • Add direction and measurement: …over the following 30 minutes, the average return is positive. (Now it has direction and measurement.)
  • Add a mechanism: …because sharp short-term drops are often panic selling pressure, and once that pressure is exhausted, prices repair modestly. (Now it has a why.)

It finally narrows to this statement:

When a coin falls more than 3% in one hour (trigger), its average return over the next 30 minutes, after costs, will exceed a pre-specified minimum threshold (direction + measurement); my mechanism hypothesis is that some sharp drops arise from temporary liquidity shortages and panic selling rather than a durable information shock.

See? The same thought is much “uglier” now—it has boxed itself in, and an insufficient rise means it loses. But it is precisely this ugliness that turns it, for the first time, into something you can genuinely research, bet on, and lose on.

The Falsification Contract: Write Down What Would Prove Me Wrong First

Now we arrive at the most important habit in this chapter. Copy it onto the first page of your notebook:

Write down “what result would prove me wrong” before you look at the data.

Be bold when generating ideas; once you are ready to test, however, the conditions for conceding defeat must be tightened. We call this agreement written in advance a “falsification contract.” At a minimum, it must state four things: the trigger condition, observation period, decision metric, and failure threshold.

For the sharp-drop bounce hypothesis above, the contract might read:

I bet that after a decline of more than 3% in one hour, the average net return over the next 30 minutes will exceed a pre-specified minimum economic threshold. If the primary metric does not meet the threshold, or the estimation interval is so wide that it cannot distinguish “useful” from “not useful,” then this hypothesis does not pass this test. The latter should be recorded as “insufficient evidence,” not quietly substituted with “proven completely ineffective.”

Notice the words “does not pass this test.” They prevent you from exaggerating one specific verdict into a permanent judgment on every market, period, and parameter; Chapter 15 will deal specifically with this boundary of knowledge.

Why write it first? Because once you see the data, your success criteria begin to drift. If it rises 0.3%, you will think, “That still counts as a bounce”; if it takes 60 minutes to rise, you will think, “Afterward included an hour anyway.” This may not be deliberate lying, but it is enough to make any outcome look like success.

Chapter 8 will formalize this practice as preregistration and explain how a record of registration can prevent selective reporting when you test many variants. For now, build the most basic discipline: before examining the data, write down the conditions under which you concede defeat in full.

Mechanism Hypothesis vs. Curve Fitting: There Must Be a “Why” Behind Profit

Now return to the most important part we temporarily skipped: mechanism.

First, consider a common false-correlation game. Throw enough time series into a computer and you can always find that food production somewhere and a stock index moved in close sync over some period. Should you trade based on that chart?

Of course not based on this chart alone. Two curves moving together may result from a common trend, sample selection, or pure coincidence; if you cannot explain who affects whom through what channel, it lacks support for extrapolation. Looking alike numerically does not mean they are related economically.

This brings us to a crucial contrast in quantitative research: mechanism hypothesis versus curve fitting.

  • Curve fitting means taking a pile of historical data and repeatedly trying different rules and numbers until you assemble a line that looks spectacularly profitable in the past. You do not know why it made money; you know only that “this set of numbers happened to be very profitable in the past.”
  • A mechanism hypothesis means you can first explain a rationale—that a group of market participants, for some reason, will do something at some time, and that action will predictably move prices—then verify in the data whether the traces of that rationale are present.

What is the difference? The future.

There is only one set of historical data. If you try enough times on it, you can always assemble a beautiful line, just as you can always find one garment that “happens” to fit everyone when looking at a group only from behind—but it will not fit new people. A curve-fitted strategy is that garment: it fits the past but not the future. Once exposed to the real market and tomorrow’s new data, it often reveals its true form.

A hypothesis with a mechanism does not merely bet that “this set of numbers was accurate in the past”; it also includes the possibility that the constraints, motives, or institutions driving the phenomenon may persist in the future. A mechanism cannot guarantee the future, and a complete causal story is not necessary for every predictive model; but it can tell you why extrapolation may be warranted, under which conditions it may fail, and how to design more targeted attempts at falsification. It is an important defense against pure curve fitting.

So whenever you have an idea, force yourself to answer one question:

“If this really can make money, what mechanism pays for the return? Does it come from bearing some risk, providing liquidity, meeting someone else’s hedging need, or taking advantage of trades that constrained participants must make?”

If you can answer—for example, “I provide liquidity to people who urgently need to exit, so I bear short-term inventory risk and receive compensation”—then you at least have a testable mechanism. The counterparty here need not be foolish; they may be meeting hedging, regulatory, funding, or time constraints. If you hesitate and can say only, “The data show it makes money,” then you need stronger out-of-sample evidence and stress testing. Chapter 9 will turn this into executable rules; Chapter 8 will address directly why overfitting can disguise historical coincidence as a pattern.

Where Hypotheses Come From: Four Wells

After all this about “how to carve a hypothesis cleanly,” you may ask: where do you find that initial idea? The good news is that inspiration is everywhere. I group it into four wells you can return to for water again and again:

The first well: your own observations. The thoughts that arise when you watch markets, read the news, or even wait in line for coffee: “Huh, it seems that every time …, … happens.” The opening idea, “a big drop will bounce,” came from this well. These ideas are the rawest and fuzziest, but also the most personal; others may not have noticed them.

The second well: market anomalies. These are phenomena repeatedly documented by academia and industry that appear not to fit the simplest efficient-market intuition. (Why markets are hard to profit from is the subject of Chapter 2; we only borrow the term here.) These anomalies are clues already filtered once by predecessors—a starting point from the shoulders of giants—but after becoming public, they may be crowded, decay, or hold only in the market and period of the original study. Treat a paper as a clue, not a warranty.

The third well: market microstructure. This refers to the market’s lowest-level operating mechanisms—what an order book looks like, how bid-ask spreads form, and how large orders move prices. Many of the most solid mechanism hypotheses are hidden here, because this is “the physical trace that human behavior leaves in the market’s plumbing.” The foundations of order books and liquidity were laid for you in Chapter 4, so we will leave them aside for now.

The fourth well: other people’s research. Papers, blogs, and public discussions of strategies. Reading others is not about copying their conclusions word for word, but about borrowing their skeleton and giving it your own flesh: first reproduce whether A holds under the original conditions, then ask whether A′ still has independent justification after changing the market, data, or mechanism.

These four wells also lead you to different battlefields. Obvious topics usually face fiercer competition; niche topics may be limited by capacity, data, or execution conditions, or may genuinely contain nothing at all. This chapter has only one job: wherever the inspiration comes from, first carve it into a falsifiable hypothesis, then let the data decide. Rigor does not create opportunities, but it can keep you from mistaking empty ground for a gold mine.

Part III · Turning Ideas into Testable Rules · Chapter 7

Backtesting: Your Time Machine and Your Mirror

Backtesting is much like a time machine. It lets you take today’s trading idea into the past and check how much you would have made or lost by following those rules from then on.

Sounds like cheating, right? All the past prices are laid out in front of you. As long as you choose the right entry and exit points, aren't profits guaranteed?

In quantitative finance, this time machine is called backtesting—replaying a clearly specified set of trading rules on historical data to estimate what would have happened if you had acted then under the information and execution constraints available at the time. It is one of the core tools of quantitative research.

But the main thing I want to tell you in this chapter is not how powerful it is. It is this: the time machine has a fatal flaw. It is too obedient. If you expect a particular answer, it will give you that answer if you are not careful. Used well, it is a time machine that helps you see toward the future; used badly, it is a mirror that exposes monsters—not the truth of the market, but the reflection of your wishful thinking.

We will first discuss what it can give you, then spend serious effort on how it can deceive you.

What Backtesting Can and Cannot Give You

Let us start with what it can give you.

Backtesting's greatest value is that it compresses years of history into a repeatable check. A real human trader who wants to observe what would happen across different years by “selling when price falls below the monthly moving average and buying when it rises above it” cannot literally live through time again. A computer, however, can quickly list the number of trades, the distribution of returns, and drawdowns. It does not give you years of live trading experience; it gives you a structured record of historical counterfactuals.

That is what backtesting gives you: a quick sieve for discarding bad ideas. Many intuitions that seem promising will quickly reveal their problems in even the most basic historical replay. That function alone—using paper evidence to eliminate ideas that plainly do not hold up—is already valuable.

But please engrave this sentence in your mind:

A backtest tells you how a rule performed in the “past”; it never promises that it will perform the same way in the “future.”

This is not wordplay. Between the past and the future lies a river no one can cross. Participants, institutions, liquidity, and competition all change. The same relationship may weaken, reverse, or hold only in a particular market regime. A beautiful curve from a backtest means only that the result occurred in this history under these assumptions; it does not mean tomorrow will replay it.

So what backtesting cannot give you is a guarantee about the future, a guarantee of actual execution, or—and this is the most insidious part—a guarantee that the attractive numbers it produces are real. Often, the return curve that makes your heart race is something you accidentally created by cheating.

How did you cheat? You may not even notice. That brings us to the number-one killer in the world of backtesting.

Look-Ahead Bias: Align Four Times First

Chapter 5 already covered look-ahead bias in full. At the backtesting stage, do not merely ask whether your data contains future values. Break every trade into four times:

  1. Information time: When did the raw data occur, and when was it made public?
  2. Signal time: When could the rule first finish calculating from that information?
  3. Decision time: When did the system decide to place an order?
  4. Execution time: When could the order first enter the market, and at what price might it execute?

If the sequence of these four times is reversed at even one point, the backtest may gain an advantage unavailable in live trading. For example, generating a signal from the day's final closing price while assuming execution at that same closing price—unless you have a clearly defined closing-auction process, information cutoff, and execution model—crams “knowing the answer” and “trading on the answer” into the same instant.

For earnings reports, index constituents, and macroeconomic data, also examine the release time or version time. A quarter's reference date is not its publication date, and a revised value available today was not necessarily visible at the time. When auditing a backtest, answer this question for every trade: “Before this order was sent, could the strategy really have obtained this information?”

In-Sample and Out-of-Sample: Do Not Write and Grade the Same Exam

Strategy development and strategy evaluation cannot use the same stretch of data forever. Every time you inspect a result or adjust a parameter, that data participates in the design. If you then use it to grade the strategy, the score will naturally be too optimistic.

Quantitative research typically divides data into two categories:

  • In-sample: the practice exam used to explore, debug, and form the rules.
  • Out-of-sample: the final exam that does not take part in this round of adjustments and is used to estimate how the rule performs in a new period.

Financial data has a time order, so you cannot randomly shuffle it and let future observations leak into the past. Common approaches split it by time, or repeatedly simulate “train only on data available up to that point, then test forward” with rolling or walk-forward methods.

Out-of-sample data is not a magic seal. If a strategy looks good only in-sample and fails in a period that did not participate in its design, overfitting is a prime suspect. But one out-of-sample failure may also result from a changing market regime, too short a sample, or execution differences. Conversely, passing once does not mean it will work forever.

Out-of-sample data can be used up, too. Once you see its results and go back to modify the strategy, it has participated in the design. Using the same period again as a “brand-new final exam” does not restore its original role just because you keep the name.

Costs Must Enter from the First Backtest

Chapter 4 already discussed spreads, market depth, market impact, and slippage; Chapter 10 will build a full cost model. This chapter leaves you with only one audit principle: do not first test a world of free trading and then treat costs as a final seasoning.

From the first version of the results, use executable buy and sell directions, estimated fees, and slippage, and check how sensitive performance is to the cost assumptions. If a slight increase in costs immediately turns net returns negative, the strategy's edge is not robust.

Also avoid a common shortcut: applying the same fixed cost to every trade. Real costs vary with the instrument, time of day, order size, maker/taker status, and market volatility. The model may start simple, but it must state clearly what it omits and stress-test worse scenarios.

A Backtest Is Only a Coarse Filter, Not a Decree

All right: suppose you avoided look-ahead bias, split in-sample and out-of-sample data, included costs in the model, and the backtest produced a reasonably robust curve. Can you go live now?

Not yet. A backtest is best suited to answering, “Is this idea worth advancing to the next stage?” It is not suited to answering, “Will it definitely make money in the future?” No matter how complete the historical data, it is difficult to reconstruct queue position, network latency, rejected orders, system failures, sudden liquidity drops, and market impact at real scale.

So a green light from a backtest means only that the idea has not been rejected on paper. It must still go through paper trading, very small live trading, and gradual scaling, aligning model assumptions with reality one by one. Chapter 13 will cover this deployment ladder in full.

Treat a backtest as a coarse screening sieve, not as the final judge, and you will be on the right track.

Part III · Turning Ideas into Testable Rules · Chapter 8

Statistical Rigor: Why Your “Holy Grail” Is Probably Noise

A Fraud Who Can Call Ten Tosses in a Row

Ten thousand people are sitting in a room, each holding a coin. The host says, “Toss together. If you correctly call heads, remain standing; if you are wrong, sit down.”

After the first round, about half remain standing; after the second, half of those are eliminated again. After ten rounds, there will usually still be several people who correctly called ten tosses in a row.

If the camera focuses on just one of them, you will see a genius who “called ten in a row.” You will be tempted to think: he must have a trick, right? Should I pay him to teach me?

But you and I both know he has no trick at all. When there are enough participants, it is unsurprising for a few extremely lucky people to appear. The real deception is not the coin, but the camera that lets you see only the winners while hiding all the participants.

This chapter is the heart of the book. In quantitative trading, the most dangerous enemy is not the market or your opponents, but this room—the room you built with your own hands, which lets you see only attractive results. You will test many strategies, then point at the one that “called ten in a row” and declare that you have found the Holy Grail.

I will spend a whole chapter teaching you to see through this illusion. And I will first tell you a discouraging but necessary truth: the attractive upward equity curve you see on the screen (an equity curve is a line charting the strategy's net asset value day by day through history) is quite likely a flower grown from noise.

Randomness Can Grow Attractive Curves Too

When beginners first do backtesting—using historical data to simulate “what would have happened if I had traded this way then?”—and see a lovely curve climbing from the lower left to the upper right, their hearts race. That line is so persuasive: it looks like “money growing.”

But I want you to do something: open any tool that can generate random numbers, have it toss a virtual coin 1,000 times, assign +1 to heads and −1 to tails, cumulatively add the results, and plot them as a line.

You may be startled. This “purely random” line will often have a beautiful upward stretch, and sometimes even rise all the way through, looking exactly like a “profitable strategy”: it has drawdowns, rebounds, and new highs, with all the same drama. Yet there is not a penny's worth of reasoning behind it—only coins.

This is the first warning you must internalize: an upward curve by itself proves almost nothing. A rule with no real edge can look good through sampling luck; a valuable strategy can look bad because the sample is short, because it is used for hedging, or because it encountered an unfavorable environment. The shape of a curve must be interpreted together with the hypothesis, sample, costs, and benchmark.

So the real question is never “Does this curve look good?” but: Does it look good because there is something real behind it, or because I got lucky—or cheated? Everything that follows addresses this question.

Overfitting: Memorizing the Answers Is Not Learning

Let us start with a situation you and I have both experienced. Before an exam, you discover that the teacher will use questions from an old problem set. So you memorize every answer perfectly, score 98 on the practice test, and are ecstatic, thinking you have mastered the subject. Then the real exam uses new questions, and you score only 40.

That is overfitting: you did not learn “how to solve the problems”; you merely memorized “the answers to this particular test.”

In quantitative work, overfitting looks like this: you have a strategy with a parameter, say the number of days in a moving average. You do not know how many days to use, so you test 5 days, 6 days, 7 days ... all the way to 200 days, and see which produces the most profit on historical data. In the end, you find that the 43-day curve looks best, so you say: that is it—43 days.

Do you see the problem? You are not “designing a strategy”; you are “tuning parameters against historical answers.” The number 43 is best precisely because it fits this particular stretch of history most closely—including every coincidence and every bit of noise in it. It memorized the noise too. When tomorrow's market gets a new exam paper, those 43 days will probably be exposed.

A rough but useful intuition: the more knobs you can freely adjust, the greater the model's ability to cling to historical noise. This does not mean complex models are necessarily bad. It means complexity must be paid for with more data, regularization, stable out-of-sample performance, and clear incremental value. Simple is not automatically correct; it merely makes the choice space smaller and auditing easier.

That is why our lab's confirmatory specifications have an old-fashioned rule: for every registered experiment, parameters must be specified as fixed values; you cannot hide a string of candidate values. During exploration, you may certainly compare 5 through 200 days, but every attempt must enter the ledger and be confirmed on new data that did not participate in selection. You cannot run 196 versions, submit only the best one, and pretend you knew from the beginning that 43 was the answer.

Multiple Testing: Try a Hundred Times and Some Results Will Be “Significant”

Return to the room of coin tossers at the beginning. Now you understand: the more participants there are, the less surprising extremely lucky ones become.

In quantitative research, the “people” are the “strategies you tested.”

Suppose you work hard today and write 100 different strategies to backtest. Statistical testing commonly uses a “5% significance level”: when the null hypothesis is true and the test conditions are met, a single test has about a 5% long-run chance of crossing the threshold by mistake. Roughly speaking, this means “if this thing is actually useless, the chance it achieves a result this good through pure luck is only 5%.” That sounds strict, right? Five percent is small.

But you tested 100. Even if all 100 strategies are worthless and none work, luck alone will produce, on average, 100 × 5% = 5 strategies that beautifully cross that “significant” line and smile at you like angels.

You look at those five “significant” strategies with delight and completely forget the 95 failures lying beside them. Once again, you aim the camera at the winners.

This trap is called multiple testing; the broader and more dangerous behavior behind it is called data snooping—repeatedly and greedily inspecting the same data until it happens to say what you want to hear.

What makes data snooping frightening is that it is often unintentional. You do not tell yourself, “I am going to cheat.” You merely think, “Let me try one more variant,” “It might work better if I add this condition,” or “Let me rerun it over a different period.” Every “let me try again” puts another coin tosser into the room. Try enough times, and a beautiful face will always emerge from the noise. And you will sincerely believe you found alpha.

The market did not deceive you; you deceived yourself. This is one of the deepest and hardest-to-admit ways beginners lose money.

Conditional Returns Are Also Tests

There is a particularly subtle variation here, easily mistaken for “just taking one more look,” that deserves to be singled out.

You run a strategy and its overall results are unremarkable. But you cannot let it go, so you begin “slicing the data”:

“What if I trade only on Mondays?”—it seems a little better.

“What if I trade only when volume expands?”—hey, a little better again.

“What if I trade only before 10 a.m., and only when the previous day closed down?”—wow, the curve becomes gorgeous!

Excitedly, you announce: I found it! This strategy is unbeatable on “Mondays + rising volume + before 10 a.m. + yesterday closed down”!

Stop. Every “only when...” adds another researcher degree of freedom and another opportunity to select an accidental winner. These slices are often highly correlated, so you cannot simply treat them as independent; but correlation does not make them free. If you tried dozens of conditions on the same data and report only the best one, the statistical evidence is still contaminated by the selection process.

So remember this hard rule: conditional returns must enter the attempt record for the same research family. Record which slices you tried, in what order, and under what selection rule. The finer the slicing and the brighter the result, the more you need new data and evidence of a mechanism—not more excitement.

Write Down What Would Prove You Wrong First: Preregistration

At this point, you may feel a little despair: what am I supposed to do? Am I not allowed to try things?

Of course you are. Trying things is the essence of research. The issue is not “trying”; it is “how you remain honest with yourself after trying.”

Our lab's central weapon against cheating by your future self is called preregistration.

The concept is almost plain in its simplicity: before beginning a round of confirmatory testing, write down and register the hypothesis to be tested, strategy specification, primary metrics, and decision rules. You may of course have explored old data already; the key is to label new ideas honestly as exploration, then confirm them using data that did not participate in selection. You cannot disguise exploratory results as predictions made in advance.

Why does such a small action have so much power?

Because it locks up the person most inclined to cheat—your future self.

The human brain has an almost instinctive capacity for self-deception. When you see that “Mondays + rising volume” curve looking especially beautiful, your brain will immediately and sincerely invent a story that sounds convincing, then make you believe “that was what I had in mind all along.”

That is hindsight bias, and preregistration is its antidote. If your preregistered hypothesis says “this strategy should work on all trading days,” you cannot quietly change your story afterward to “it works only on Mondays” while pretending that was your original prediction. The written record is there; you cannot deny it.

Chapter 6's falsification contract answers “What am I betting on, and what counts as losing?” Preregistration goes one step further: it leaves a time-stamped record of the specification that can be checked, and explicitly labels variants created later as new experiments. Exploration remains free, but reporting cannot selectively forget.

Discounting Performance by “How Many Times You Tried”: The Intuition Behind DSR

All right, preregistration can stop you from “pretending you never tried.” But another question remains: even if I honestly record that “I tried 100 times,” how should I view the performance of the best strategy I ultimately selected? That brings us to the final tool in this chapter, and the one that best embodies statistical rigor.

Let us first discuss a common scorecard: the Sharpe ratio. In simplified terms, it divides average excess return by return volatility, measuring how much average return corresponds to each unit of volatility. The higher it is, the more favorable historical returns have been relative to volatility. But serial correlation, non-normal tails, short samples, and ex post selection can inflate it, so it cannot decide a strategy on its own.

Here is the problem: a strategy with a Sharpe ratio of 2.0 sounds excellent. But what if I tell you it was the best one I selected from 1,000 strategies?

You should immediately be alert: it is that room of coin tossers again! Of the 1,000 strategies, how much of the highest one's Sharpe ratio comes from genuine skill, and how much from the fact that “among 1,000, one is bound to get extraordinarily lucky”?

So clever statisticians did something very much in the spirit of this book: they created a correction called the Deflated Sharpe Ratio (DSR).

We will not expand its formula here, but you must understand the intuition:

For the same Sharpe ratio, the evidence is weaker if it was selected from more attempts.

DSR does not simply divide the Sharpe ratio by the “number of trials.” It also considers sample length, skewness and kurtosis of the return distribution, and the effective number of independent trials implied by correlations among a group of attempts. It then asks: does this Sharpe ratio still exceed the best result that data mining itself could reasonably produce?

Therefore, conditional returns, parameter variants, and filters added later must all be recorded in the ledger for the same research family. If attempts are omitted, any correction will be too optimistic. We would rather let an attractive number slim down early than let it carry selection bias into live trading.

Why This Discipline Is Worth Keeping

By now, you may feel that quantitative work is too restrictive: preregistration, recording attempts, cooling down the best result. You finally find a beautiful curve, and I make you dismantle it first.

The value of this discipline is not to make you look smarter than anyone else. It does one more fundamental thing: it exposes the degrees of freedom created by exploration, so that the same evidence cannot be repackaged repeatedly as multiple discoveries.

Preregistration, research families, and DSR will not create a signal for you. What they reduce are false positives, while helping you distinguish advance predictions, post hoc exploration, and independent confirmation.

This book does not cover the formula or software implementation of DSR. For beginners, what matters more is recording every attempt in the same research ledger and not letting selective reporting put makeup on noise. If you remember only one thing from this chapter, remember this:

Before you celebrate “finding the Holy Grail,” ask coldly—could this just be noise?

Part III · Turning Ideas into Testable Rules · Chapter 9

Signals and Factors—How an Idea Becomes a Tradable Rule

In Chapter 6, we learned how to refine a vague intuition such as “I think something that has fallen a lot will rebound” into a statement that can be falsified. That is major progress—but it is still only a sentence. A sentence cannot place orders by itself.

If you leave for a month and put an assistant in charge of your account, saying only “Buy when it looks cheap” is useless. How cheap is cheap? How much should they buy? When should they sell? When should they stop? The rules must be specific enough for the assistant to follow step by step without guessing.

This chapter is about translating “a hypothesis in one sentence” into “a rule a machine follows every day.” That translation is the core of this craft—and the part most likely to go wrong. We will see that the devil is almost entirely in the details, especially in the knobs you casually decide to turn one more time.

Signals: A Light That Shows Only Three Colors

Let us begin with the most important term: a signal.

The simplest signal can call for one of three actions: go long (bet it will rise), go short (bet it will fall), or do nothing. But a signal can also be a continuous score—for example, directional strength from −1 to +1, or relative rankings across a basket of stocks—which a position-sizing rule then translates into action.

A traffic light is a useful analogy: green means go, red means stop, and yellow means wait—except that some lights also have a brightness level. A signal compresses a large amount of price, volume, or fundamental data into a judgment a machine can use; the strategy then combines it with position, risk, and execution rules to decide which button to press.

Factors: The Numbers That Feed the Light

So what does this light look at? Broadly speaking, it looks at features, sometimes also called factors: any input that is observable and computable at the decision point, such as returns over the past five days, relative trading volume, or the bid-ask spread.

In finance, a factor often has a more specific meaning: it may be a systematic driver that explains common returns and risks across a group of assets, or a style measure used to rank stocks. In everyday discussion, the two terms are often used interchangeably. For readability, this book will continue to use “factor” as its main term, but remember: not every model input automatically qualifies as a validated financial factor.

Think of a doctor seeing a patient: temperature, blood pressure, and heartbeat are all inputs; the doctor combines them into a judgment. Factors or features provide evidence, while the signal compresses that evidence into a direction or score.

From One Hypothesis to a Rule with Knobs

Let us walk through a concrete hypothesis from start to finish: “If something has fallen sharply recently, it will rebound a little in the short term.”

To turn this into a machine-executable rule, we need to answer each of these questions:

  • How recent is “recent”?—Say, the past 5 days.
  • How sharp is “fallen sharply”?—Say, more than 10%.
  • How long is “short term”?—Say, hold for 3 days after buying.

That gives us an initial rule: If, after the close, an asset is confirmed to have fallen more than 10% cumulatively over the previous 5 trading days, enter at the next tradable opportunity using a predetermined order method, then exit after holding for 3 trading days.

Now count the knobs hidden in this seemingly simple rule: 5 days, 10%, 3 days, plus the trading time and order method. These preset numbers and choices are called parameters. A genuinely live-tradable strategy must also specify the asset universe, position size, costs, signal conflicts, and exception handling; for now, we will focus on parameter selection.

Every Extra Knob Adds a Degree of Freedom

Chapter 8 already covered overfitting. At the rule-design stage, we will focus on its most concrete source: degrees of freedom.

Five days, 10%, and a 3-day holding period: every parameter gives the researcher one more choice. Parameters are not inherently bad; the problem is whether, after seeing the results, you select the prettiest outcome from many candidate values and report only that final number. The more degrees of freedom you have, the faster the number of combinations grows—and the larger the statistical bill becomes.

So before adding a new parameter, ask two questions: What mechanism does it correspond to? Without it, what necessary capability would the strategy lose? If you cannot answer, do not install that knob yet.

Robustness Checks: Do the Neighbors of a Good Parameter Hold Up Too?

How can you tell whether a knob setting makes real sense or merely happened to get lucky? There is a very useful test: see whether its “neighbors” hold up.

A good recipe works like this: add a pinch more or less salt, and the dish still tastes good. Only then does it deserve to be called a recipe. If a “recipe” requires exactly 3.7 grams of salt, and 3.6 or 3.8 grams makes the dish terrible, then what you have is not a recipe at all—it is a coincidence that happened to work once.

Parameters are the same. If your rule works for “the past 5 days” but performs terribly at 4 days and 6 days, that is a strong warning sign: you may have landed precisely on historical noise. Smoothness in the neighborhood is not a law of nature—some regulatory thresholds or expiration dates genuinely create sharp boundaries—but if the mechanism does not explain such a discontinuity, an isolated spike is especially suspicious. We call a parameter that collapses when moved slightly fragile. In research, we would rather have a blunt rule that remains acceptable when it is slightly off than a miraculous rule that must be exact to the last decimal. This test is called a robustness check: do not look only at the instant when the light turns on; see whether the neighbors on either side can stand too.

Ablation and Controls: Is the Mechanism Making Money, or Is It Luck?

There is another, tougher form of self-questioning: an ablation.

The name sounds intimidating, but the idea is simple: remove one component of the strategy and see whether it falls apart. It is exactly like a chef asking, “Is that secret seasoning really what makes this soup taste better?” The most direct way to find out is to cook a pot without it and compare.

Suppose a strategy has three conditions: the size of the price decline, trading volume, and time period. An ablation can remove each one in turn and rerun the strategy using comparable risk, number of trades, and sample. If removing volume barely changes the performance or behavior, it may merely be decoration. But check interactions too—some components contribute little alone yet become useful in combination. Ablation is diagnosis, not a mechanical rule to delete a component whenever a number gets smaller.

Paired with ablation is a control or benchmark. A benchmark should not be an arbitrarily weak opponent; it should match market exposure, risk, turnover, or holding period as closely as possible. For example, a trend strategy can be compared with risk-matched buy-and-hold and a simple trend rule; a stock-selection factor can be compared with portfolios adjusted for market, industry, and style exposures. Together, ablation and controls ask: What did the added complexity actually contribute, and did it merely repackage a favorable market tailwind as intelligence?

Why “Simple First” Is a Virtue

By now, you can probably see why experienced practitioners always emphasize “simple first.”

Simplicity is not about laziness; it is usually easier to audit, explain, and maintain. Fewer knobs mean a smaller choice space; shorter rules make it easier to locate the cause when they fail. But simple does not automatically beat complex: a complex model may deserve to exist if it consistently provides incremental value under rigorous out-of-sample testing, cost testing, and stress testing. The right principle is not “never use black boxes,” but rather: every bit of complexity must explain what it buys you and come with matching monitoring and failure boundaries.

Part IV · Survive First · Chapter 10

Execution Isn't Cheap—Transaction Costs and Conservative Fill Assumptions

A researcher turned their screen toward me. The curve climbed steadily from the lower left to the upper right, tripling over five years with only modest drawdowns. They were ready to start a small live-money trial.

I asked only one question: “How many round trips does this strategy make in a day?”

The answer was five or six. Once we added the commission, spread, and slippage that each trip should pay, the once-beautiful equity curve did not merely fail to double—it fell below the initial capital.

The signal may not have had zero predictive power. More likely, its gross edge was so thin that it could not pay for execution. Chapter 4 explained how these frictions arise from the order book; this chapter turns them into a bill you cannot avoid.

The Three Cost Brothers: What You See and What You Do Not

Many beginners think transaction costs mean only commission. The real bill has at least three parts.

The eldest: commission. Brokers, exchanges, or clearing services charge a fixed amount, a percentage of trade value, or a tiered rate. Some markets also distinguish between liquidity providers (makers) and liquidity takers (takers), with different fees. This is usually the easiest cost to identify, but that does not make it the whole cost.

The middle brother: the bid-ask spread. You understand this if you have exchanged foreign currency at a bank: at the same counter, the price you pay to buy is high, while the price they pay to buy it back from you is low. Markets work the same way. If you demand immediate execution, you usually buy at the ask and sell at the bid; even if the price does not move at all, a buy and a sell may lose a spread right away.

The youngest: slippage, part of which comes from market impact. Slippage is the unfavorable difference between the actual execution price and a benchmark price selected in advance. Network latency, changing quotes, partial fills, and insufficient order-book depth can all cause it. If the order itself consumes multiple price levels and pushes the price, that portion is called market impact. If a limit order fails to get filled at all because it is too far back in the queue, that is more accurately an unfilled order and opportunity cost, which should be recorded separately.

Of the three, commission comes with a receipt; spread and slippage are often hidden in the execution price. Different markets may also involve taxes, stock-borrow fees, funding rates, financing costs, and infrastructure fees. A cost model can be built in layers, but do not mistake the three visible items for the entire world.

Turnover: Costs Accumulate with Trading Size

Now for a key term: turnover. It is not simply the number of orders placed; it measures how large the traded amount is relative to the portfolio size over a period. Ten very small adjustments in a day may have lower turnover than one complete reversal of the portfolio; what really determines cost is how much you trade, in which market, and how you execute.

Costs therefore resemble a charge based on “traded value and liquidity consumed.” The higher the turnover, the more often spreads, commissions, and market impact are paid; the thinner the strategy’s edge, the less it can withstand this friction.

Let us calculate an understandable example. Suppose the strategy uses the same trade value each time, takes the mid-price as a common benchmark, and has a gross edge of about 0.10%. On one round trip, total commission is 0.05%, the cost of crossing the spread is 0.06%, and additional slippage beyond the spread is estimated at 0.04%, for a total cost of 0.15%. The benchmark is stated explicitly here to avoid counting the spread both inside slippage and separately, and deducting it twice.

A 0.10% gross edge against 0.15% costs on the same basis gives a net result of about −0.05%. If the notional amount differs across trades, you cannot simply count the number of “trips”; you must weight by the actual traded amount of each trade. This strategy might look excellent on a backtest chart because that chart depicts a world “before costs.” Once it touches real money, it begins bleeding quietly.

That was the problem with the strategy at the start of the chapter. Its signal may indeed have had a small edge, but it was too thin to support the diligence of five or six round trips a day. Costs do not need to defeat your insight; they only need to be a little thicker than your tiny edge.

This is why a low-turnover strategy that captures large moves and a high-turnover strategy that earns thin price differences have dramatically different sensitivity to costs. The latter must account for costs down to the bone; otherwise, every apparent cent of “profit” on paper may be an illusion.

Gross Return and Net Return: Only One Reaches Your Pocket

Here we need to distinguish two terms. The difference between them is the difference between dreams and reality.

Gross return is what the strategy earns “on paper” before costs—pretending that trading costs nothing.

Net return is what actually remains in your pocket after commissions, spreads, and slippage have all been deducted.

The easiest mistake for beginners is to treat gross return as their achievement and grin at it. Unless carefully configured, the attractive curve produced by backtesting software is often gross return. The gap between gross and net return is where countless “paper holy grails” die.

Remember this: whether you can eat depends only on net return. No matter how high gross return is, it is merely the menu price before you have paid the restaurant bill.

Conservative Fill Assumptions: Plan for Adverse Execution

So in a backtest, what price should you assume you can execute at?

An optimist might say: use the current mid-price (the midpoint between bid and ask), or the closing price. But that is the most dangerous kind of self-deception. A real market will not kindly give you the lowest price when you want to buy and the highest price when you want to sell. It is more like an indifferent opponent: when you are eager to buy, it makes you pay a bit more; when you are eager to sell, it makes you accept a bit less.

So the lab uses a conservative execution model: the baseline scenario estimates costs from the observable spread at the time, order direction, maker or taker status, expected size, and historical execution distributions; it then adds adverse and stress scenarios. A buy cannot assume it receives a favorable price available only to sellers, and a sell cannot assume it always fills at the high.

This does not mean casually inflating a fixed percentage, nor choosing a physically near-impossible “worst price in the universe” to torture the strategy. Excessive pessimism can also produce false conclusions. The key is that every layer of assumptions can be explained and calibrated, then continuously reconciled against real small-scale executions.

Next, perform sensitivity analysis: as costs are raised step by step from the baseline to adverse and then stress scenarios, how does net return change? If it turns negative with only a slight deterioration, the edge is fragile; if it fails only under an extreme, unsupported penalty, you should not dismiss it carelessly on that basis.

Only a strategy that still holds up under pre-specified, realistic, explainable adverse scenarios deserves to move to the next stage.

Part IV · Survive First · Chapter 11

Risk Management—Survive First, Then Think About Winning

From January through June this year, Chen turned $100,000 of capital into $200,000, a full doubling. Over dinner, he animatedly tells you how he did it.

Then July arrives. Chen places a large trade he feels “very sure” about, but gets the direction wrong. Unwilling to accept it, he adds to the position to average down, but the market does not turn around. By the time he finally admits defeat and exits, the $200,000 is down to $40,000.

Now do the brutal math with Chen: to climb from $40,000 back to $200,000, he does not need to earn back the 80% he just lost; he needs a 400% return. The gains from getting every trade right over the first six months were reset, principal and all, in one night in July.

This chapter is not about how to win. It is about something more fundamental: how to reduce the chance that one mistake ends the entire game. No matter how strong your forecasting skill is, it has no time to pay off if your risk limits allow a single tail event to destroy the account.

1. Compounding Is Beautiful; Blowing Up Hurts: A Lesson in Asymmetric Arithmetic

Let’s fully unpack Chen’s numbers, because they are the foundation of this chapter.

You have certainly heard of compound interest: “money making money.” You reinvest what you earn to keep earning, like a snowball that grows the longer it rolls. But few people talk about the other side: compounding only works when it has continuity. Hit a large rock along the way, and the snowball shatters; you must rebuild from a small clump of snow. One wipeout voids every gain compounding produced before it.

Gains and losses are mathematically asymmetric. Lose half your money, and earning half back will not make you whole. If $100,000 falls to $50,000, you must double the $50,000 to return to $100,000: a 100% gain, not 50%. Why? Percentages are calculated on the money you have now. Once losses shrink your capital, the same percentage gain produces a smaller dollar amount. The deeper the loss, the more punishing the trap becomes:

If you lose To break even, you must gain
10% 11.1%
20% 25%
50% 100%
80% 400%
90% 900%

As losses deepen, the return needed to recover rises rapidly according to loss rate ÷ (1 − loss rate). The table does not say losses below 20% are “easy”; it reminds you that the path of loss is asymmetric, and the later you control it, the steeper the required recovery becomes.

Risk management therefore protects against both a single crippling loss and many small, correlated losses accumulating in the same environment. Earning less reduces your ending value; a deep drawdown simultaneously shrinks your capital, makes recovery harder, and may force you to exit at the worst possible time.

2. Position Sizing: Do Not Let Any One Bullet Kill You

Since large losses are so deadly, the first line of defense is to limit them at the source. That defense is called position sizing.

In plain language, a “position” is how much money you put into a particular trade. Position sizing should answer not “How attractive does this trade look?” but the calmer question: if I am wrong, how badly can this trade hurt me at most?

Beginners often reverse the order. They first think, “I’m highly confident in this trade—how much should I bet to make more?” Experienced traders first decide how much risk budget a trade may use, then work backward from the exit condition to determine the position size. That reversal of perspective separates amateurs from professionals.

Here is an example solely to illustrate the calculation. Suppose an account has $100,000, and you allocate a $1,000 risk budget to a trade in advance. The distance from entry to the price that proves you wrong is 5%. Ignoring fees, gaps, and slippage, the position amount is approximately:

Risk budget ÷ stop-loss distance = $1,000 ÷ 5% = $20,000

If the price can be exited near the planned level, the book loss is about $1,000. Two qualifications matter here. First, $1,000 is exactly 1% of a $100,000 account; that percentage is only an illustration of a single-trade risk budget, not a universal standard for everyone. The real limit depends on strategy volatility, leverage, liquidity, holding period, portfolio correlation, and the risk you can bear. Second, a stop-loss price does not guarantee execution. Gaps, evaporating liquidity, or system failures can make the actual loss exceed the budget, so position sizing must leave room for such errors.

The greatest value of this method is that it separates “how much you like the trade” from “how much you should bet.” Confidence may affect whether you continue researching, but it should not cross an approved risk boundary. Remember the core of this defense: do not let any single trade have the power to cripple the entire account.

3. Stop-Losses and Circuit Breakers: Two Gates to Automate as Much as Possible

The previous section mentioned exiting when you are wrong. It sounds simple, but it is hard to do because it requires confronting human nature directly. We need two gates written in advance, executed by the system where possible and confirmed through monitoring, rather than leaving the final decision entirely to a panicked version of yourself.

The first gate: a stop-loss. This is an exit condition written in advance. It need not be only a fixed price level; it may also be the end of a holding period, excessive volatility, or the disappearance of the condition supporting the original thesis. What they share is that, before entering, you specify what change means the trade is no longer worth keeping.

Writing the stop-loss into the rules in advance prevents moving the goalposts in the moment. But remember one further reality: a stop-loss can constrain your decision; it cannot guarantee your execution price. Once triggered, an order may still face gaps, rejection, wider spreads, or insufficient liquidity. A stop-loss must therefore be paired with conservative position sizing and anomaly monitoring; it is not a wall that can never leak.

The second gate: an intraday loss circuit breaker. A stop-loss governs one trade; a circuit breaker governs a trading session or the entire account. Once cumulative losses, the number of anomalous orders, or other risk metrics hit a pre-approved boundary, the system stops taking on new risk, cancels cancellable open orders, and alerts the responsible person to review.

Our lab once set a 5% daily loss limit for a certain class of accounts. That number was an internal choice for a particular capital base, strategy, and risk tolerance. The non-negotiable point is not “it must be 5%,” but that the boundary must be set while calm and must not be loosened in production because “this time is different.”

4. Never Hold On and Add Ad Hoc: A Loss Cannot Rewrite Your Risk Budget

Here, “holding on” does not mean every instance of continuing to buy after a price falls. Scaling into a position that is written into the strategy in advance and does not increase total risk, or rebalancing under fixed rules, can be normal design. The truly dangerous action is different: a position is already losing, the original rules do not call for adding, yet you temporarily enlarge it to lower the average cost while pushing the original exit condition farther away.

This kind of ad hoc adding can sound reasonable. “The price is cheaper now.” “A small bounce will get me out.” Every line sounds like analysis, but often it is merely an excuse for refusing to admit you were wrong. It does two harmful things at once: it increases risk as the evidence worsens and makes the prewritten stop-loss ineffective.

It is especially deceptive because many small drawdowns really do rebound. You may escape several times in a row by holding on and adding, and learn a dangerous lesson: as long as you never admit defeat, the market will eventually come back. But when a sustained trend, a gap, or evaporating liquidity arrives, the accumulated oversized position can let one loss swallow many prior small wins.

So what the lab truly prohibits is unregistered risk that is increased ad hoc because of a loss. If you want to scale in, state before entry the conditions for every tranche, the maximum total position, and the final exit line. Do not wait until a loss occurs and then dress up an impulse as a strategy.

5. Martingale: Hiding a Rare Catastrophic Loss Behind a String of Small Wins

Holding on and adding has a more extreme, systematic cousin: the Martingale. It is often packaged as a high-win-rate robot: every time it loses, it doubles the next bet; as long as a later bet wins, it covers the preceding losses and earns the original small gain on top.

The numbers do grow that way: 1, 2, 4, 8, 16... After ten consecutive losses, you have already lost 1,023, and must bet 1,024 next merely to net the original 1. In any one round, ten straight losses may be uncommon; but if you run many rounds repeatedly, you will get ever closer to the losing streak that your capital, margin, or exchange limits can no longer absorb.

More importantly, doubling down does not turn a negative-expectancy game into a positive-expectancy one. In an environment with fees, spreads, or a house edge, the disadvantage of every bet remains. Martingale merely reshapes the profit-and-loss profile: it exchanges many small wins for a few very large losses. It makes the curve look smooth and the win rate look astonishing for a long time, while pushing the real risk into the tail, waiting to settle it all on one ordinary bad day.

With finite capital, finite credit, and finite execution capacity, persistent use of Martingale accumulates an unacceptable risk of ruin; trading costs make it worse. That alone is enough to exclude it from a responsible risk-management system.

6. Think Differently: Treat Risk as a Budget You Spend First

Finally, I would like to invite you to reverse your thinking. This is the main idea I want to leave you with from this chapter.

Most beginners think like this: first find a great opportunity and consider how much it could make them; then—if they remember—add, “Oh right, set a stop-loss.” In that sequence, risk is an afterthought. The professional approach reverses the order: allocate risk first, then look for opportunities.

Think of it this way. You receive a fixed salary each month. Someone who understands personal finance sets a budget first—how much for rent, food, and entertainment—then lives within it. They do not shop wildly and panic at month-end, asking, “How much did I spend?” Risk is that budget in the trading world. Based on what the strategy and account can bear, you first decide how much risk may be used per trade, per day, and at the portfolio level. Those boundaries are approved before emotion appears and before a single dollar is put at risk; every subsequent trade must remain within them.

This reversal is powerful. When risk is “added afterward,” it always loses to greed: faced with an enticing opportunity, “bet a little more” will always speak louder than “be a little more careful.” But when risk is a budget allocated in advance, it becomes a boundary every action must obey. No matter how attractive the opportunity, it cannot exceed the budget—just as you cannot buy something you love if it exceeds this month’s budget.

This is where the subtitle of this book becomes most concrete. The pessimist’s tools ask first: “How could this lose?” “Could the actual fill be worse?” “What happens if several defenses fail at once?” Then they design position sizes and limits for the bad case. The optimist’s heart is not the belief that every trade will win. It is the belief that, as long as one mistake has not thrown you out of the game, you will have another chance to learn, adjust, and wait for your edge to pay off.

Risk management does not make a bad strategy good. It does something more fundamental: it tries not to let any single judgment easily end the entire game for you.

Part IV · Survive First · Chapter 12

Portfolios—Don't Put All Your Eggs in One Correlation Basket

1. “I Bought Ten Coins, So I’m Diversified, Right?”

Let’s start with a scenario.

Lin is a diligent beginner. He has read the old saying, “Don’t put all your eggs in one basket.” So he obediently divides his capital into ten parts and buys ten different cryptocurrencies. He thinks, “This is diversified enough, right? If one coin has trouble, I have the other nine to support me.”

Then, late one weekend night, the market runs into trouble.

He opens his phone and sees not one coin falling while nine hold up, but all ten falling together—by roughly the same amount. At the very moment he needed his ten “baskets” to be independent, they were like ten balloons tied to the same string, all deflating together.

Lin has made the mistake nearly every beginner makes: he thinks diversification is a counting game. Buy enough names, and you are diversified.

But the truth is this: if his ten coins usually rise and fall hand in hand, he has not really bought ten eggs. He has simply photographed the same egg ten times and put one photo in each of ten baskets. It is still the same egg. When it breaks, all ten baskets are covered in yolk.

This chapter brings diversification back from “quantity” to its true core: correlation.

2. What Diversification Really Means: Correlation, Not Quantity

First, let’s explain a term we will use repeatedly in this chapter: correlation.

Correlation describes the degree to which two sets of returns move linearly in the same or opposite direction over a sample period. Put simply: how often do two things move together? It measures co-movement, not merely how many days they move in the same direction; and its value changes with the frequency, window, and market regime.

  • When B almost always rises when A rises, and falls when A falls, they have high positive correlation. They are like two people walking tied together: when you walk, I walk.
  • When B often falls when A rises, they have negative correlation. They are like a seesaw: one side goes up while the other goes down.
  • When A’s linear changes are hard to explain with B’s changes, their correlation is close to 0. That does not mean they have no relationship at all, nor that they cannot fall together in extreme conditions.

Quantitative traders commonly use a number from -1 to +1, called the correlation coefficient, to describe this. You do not need to know how to calculate it; just remember three anchors:

+1 = perfectly synchronized, hand in hand (moving together identically) 0 = no obvious linear synchronization (but not complete independence) -1 = perfectly opposite movement (when one rises, the other must fall)

Now we can state the true meaning of diversification in one sentence:

The power of diversification comes not from how many things you buy, but from how little they move together.

Let’s use Lin’s example to make this clear. Suppose each asset has some standalone volatility risk—the amount it can swing around on its own.

  • Case A (Lin’s case): ten coins with correlations close to +1. They move almost in sync. Put all ten together and the portfolio’s overall swings will barely become smaller. Because they swing in the same direction at the same time, their force adds up rather than offsets. You think you are diversified, but portfolio risk is not much different from owning one coin.
  • Case B (more effective diversification): ten holdings with lower correlations, and with weights that do not let one holding dominate the risk. In this case, some gains and losses offset each other, and portfolio volatility will usually be lower than concentrating capital in one representative high-risk holding.

Diversification is therefore often called the closest thing to a “free lunch”: it does not guarantee unchanged returns, but it can reduce a portfolio’s dependence on a single source of risk. Its true benefit is not earning more out of thin air, but making one surprise less likely to determine the entire outcome.

Notice the crucial words: not highly correlated with one another. The strength of diversification lies in “not correlated,” not in the number “ten.”

Here is an everyday analogy. You want to build a team that can handle all kinds of situations. You would not recruit ten identical people—ten people who all excel at sprinting and all fear the same difficulty. When that difficulty appears, all ten will collapse together. You would look for complementary strengths: someone good at offense, someone good at defense, someone especially calm when others panic. Complementarity is diversification; duplication is not.

So the next time someone says, “I’m very diversified; I own twenty names,” the first question in your mind should not be “Wow, that’s a lot,” but: “Do these twenty usually rise and fall together?” If they do, that person may have bought one holding twenty times.

3. Why Does Diversification Weaken in a Crisis?

At this point, you may have a reasonable question:

“Fine, then if I pick a group of assets that are usually uncorrelated, won’t I be safe?”

The problem is that correlation is not a fixed constant. It changes with market regime, estimation window, and participant behavior. Assets that appear to go their separate ways in calm periods may all be sold when liquidity tightens or the whole market deleverages, causing their correlations to rise sharply. Some pairs of assets may even temporarily move almost perfectly together.

Why? In a crisis, many people are not selling one particular story; they are selling “risk” on their balance sheets. They need cash for margin, funds need to liquidate to meet redemptions, and traders simply want to get back to cash first. The same funding pressure then pushes different assets in the same direction.

To be precise, not every correlation automatically becomes +1 in every crisis, and not all diversification fails completely. A more reliable conclusion is: protection based on historically low correlation often shrinks during stress. If your portfolio appears diversified only in calm samples, that sense of safety is too thin.

So portfolio construction cannot rely on one full-period average correlation coefficient. You must also examine rolling correlations, stress periods, shared sources of liquidity, and whether several assets are actually bets on the same hidden risk. Diversification reduces everyday concentration; the position sizing and loss limits from the previous chapter control the damage when diversification weakens. They complement each other; neither can replace the other.

4. How Can Multiple Strategies and Holdings Complement One Another?

So far, we have mostly discussed “buying more instruments” (different assets). But truly seasoned practice adds a deeper layer of diversification: multiple strategies.

First, a quick explanation. In earlier chapters, we described a “strategy” as a fixed trading rule: under what conditions to buy and under what conditions to sell. Different strategies earn different kinds of money from markets:

  • Some strategies earn from trend following: they enter as prices rise, betting the rise will continue.
  • Some strategies earn from mean reversion: they buy after a sharp decline, betting the price will bounce back.
  • Some strategies earn from spreads: they repeatedly capture small price differences between two places.

Here is a useful possibility: strategies based on different mechanisms may perform in different kinds of market weather.

Trend-following strategies thrive in markets with clear major trends, but in directionless, whipsawing markets they get slapped repeatedly and keep losing small amounts. Mean-reversion strategies are the opposite: they flourish in choppy markets, yet get crushed by a powerful one-way trend.

Do you see it? The painful moments for these two strategies may occur at different times. But this cannot be judged from a story alone; it must be verified using return series from the same period and under the same cost assumptions. Only if they are genuinely low-correlated does the portfolio receive real complementarity. Put them together and they can support each other: trend following carries the portfolio in trending markets, and mean reversion carries it in choppy markets. The portfolio equity curve can be smoother than that of either strategy alone.

I want you to remember a sentence our lab learned over many years:

Do not view every strategy as an orphan. View them together as a family.

What does that mean? When you have several strategies, what you should really watch is not how much each one earns alone, but what the combined curve of all of them looks like.

One family member may perform only modestly this month. As long as another member steps up during its slump and supports the whole family, it is a good member. Conversely, if every member prospers at the same time and suffers at the same time, you do not have a family. You have one person split into several copies. Back to our core idea: it is the same egg again; this time the duplicated item is the strategy, not the asset.

So when evaluating a new strategy, a seasoned question is not only “Can it make money on its own?” It also asks:

“If I add it to my existing family, will the whole family become steadier, or will I merely add another copy that rises and falls with everyone else?”

A strategy with positive net expectancy, or a clear hedging purpose, may not look impressive on its own. But if it fills in during other members’ slumps, its contribution to the portfolio may exceed that of a star strategy that only adds more of the same at the same time.

5. How Should You Allocate the Money? From Equal Weighting to Risk Parity

All right. Suppose you have chosen several members that are not highly correlated, whether assets or strategies. The next practical question is:

How should I divide my money among them?

Let’s start with the most intuitive and honest approach.

Method 1: Equal Weighting (An Even Split)

The simplest approach is to give every member the same amount of money. With five members, each receives 20%. This is called equal weighting.

Do not underestimate this plain method. It has one major advantage: it does not require you to predict who will perform better. You do not have to guess or play fortune-teller; you simply split the money evenly. As a research benchmark, equal weighting is valuable: it requires no forecast of the winner and gives more complex allocation methods a simple baseline they must beat. It is not an investment prescription for every account; especially when members differ greatly in volatility and liquidity, equal weighting can still concentrate risk heavily.

The Blind Spot of Equal Weighting: Equal Money Does Not Mean Equal Risk

Suppose you have two members and split the money evenly, 50% each:

  • Member A is a calm asset that moves at most 1% a day.
  • Member B is a wild asset that can move 10% a day.

The money is indeed split evenly—half for each. But what about risk? The daily heartbeat of your portfolio is governed almost entirely by B. It moves 10% while A moves only 1%; B’s swings completely drown out A’s. You think you have split the portfolio fifty-fifty, but most of its volatility risk actually comes from the wild B.

You divided the money, but risk is what determines whether you can sleep at night. And you did not divide the risk evenly at all.

That leads to the second approach.

Method 2: Risk Parity (Balancing Risk Contributions)

Risk parity sounds sophisticated, but its core idea is simple enough to grasp immediately:

Do not merely give every member the same amount of money. Try instead to make their contributions to portfolio risk more balanced.

How? Intuitively: put less money into members that swing wildly, and more into members that move gently. After that adjustment, the volatility each member creates for the portfolio can become more similar, reducing the chance that one member alone hijacks the entire equity curve.

Return to the example: wild B moves 10% a day, while calm A moves 1%. If we temporarily ignore their correlation, the inverse-volatility intuition says B should receive roughly one-tenth as much capital as A for their volatility contributions to be similar. This is only a beginner’s intuition, not complete risk parity. A formal calculation puts correlation into the covariance matrix and estimates each member’s marginal contribution to portfolio volatility. Allocating more capital to low-volatility assets may also require leverage to reach a target return or volatility, bringing financing, margin, and tail risk into the equation.

A small boat has several passengers to seat. You would not seat everyone at random; you would balance the boat from side to side. You would ask a large passenger (a high-volatility asset) to sit closer to the middle, not at the edge; several small passengers (low-volatility assets) can sit a little farther out. What matters is not that “everyone takes up the same amount of seat space” (equal weighting), but that “the boat does not capsize because of any one person” (risk parity).

In one sentence, the difference is:

  • Equal weighting: everyone gets an equally large seat. Simple, honest, and less prone to false cleverness.
  • Risk parity: try to make everyone’s risk contribution to “whether the boat capsizes” more balanced. It is closer to the nature of risk, but requires estimating volatility and correlation.

A practical research sequence is: use equal weighting as the benchmark first, then test more complex allocations. If you adopt risk parity, you must also check whether covariance estimates are stable, whether rebalancing costs consume the benefit, and whether leverage on low-volatility assets introduces new tail risk. Any complex allocation method should prove more useful than a simple benchmark out of sample and after costs.

6. Portfolio-Level Risk: Looking at One Piece Is Never Enough

To close this chapter, I want to reinforce an idea that runs through the book in the setting of a portfolio.

The easiest thinking error for beginners is to view their system as a set of separate parts: one strategy at a time, one instrument at a time. Each looks fine on its own, so they feel reassured.

But risk is a portfolio-level phenomenon. It does not live inside any one component; it lives in the whole formed by all the components together.

Let me repeat the fatal scenario from earlier, because it is worth saying twice. You have ten strategies. Each one has a beautiful backtest and an attractive Sharpe ratio (a score of how much return is earned per dollar of risk, discussed in detail in Chapter 8). You are pleased. But if those ten strategies make money together in the same kind of market weather and lose together in the same kind of market weather, then when that bad weather arrives, you are not facing “a few injured strategies out of ten.” You are facing “all ten strategies down at once.” You think you have ten lines of defense; in fact, you have one line, copied ten times.

So you cannot judge the health of a portfolio by reading ten attractive individual report cards. You must stack them together and look at the combined overall curve:

  • How violently does it swing overall?
  • How deeply has it fallen at most from a historical high in this sample? (This is called maximum drawdown. It is a path-dependent historical statistic, not the worst future loss, but it often comes closer to the real stress of holding a portfolio than average return does.)
  • Are all of these members betting on the same kind of “market weather”?

A portfolio audit cannot be satisfied with “every component looks fine on its own.” It must also stress-test common shocks, evaporating liquidity, and rising correlations, asking: when several seemingly independent risks occur at once, could the loss exceed the account’s boundaries?

Diversification does not promise riches, nor does it block every systemic shock. What it does is reduce dependence on a single member and a single mechanism, making one local surprise less likely to determine the whole outcome.

And “staying alive long enough” is the starting point of the previous chapter on risk management. In the next chapter, we will take these boundaries into a real production-launch process.

Part IV · Survive First · Chapter 13

From Research to Live Trading: Governance, Discipline, and the Irreversible Gate

On your screen, a backtested equity curve climbs from the lower left to the upper right, as beautiful as a textbook illustration. You spent weeks cleaning the data, writing the signals, calculating costs, and running out-of-sample tests. Even the Sharpe ratio passes the conscience test. Now your cursor is hovering over a button.

It looks almost identical to the “Run Backtest” button you have clicked hundreds of times. But this time, it says “Start Live Trading.”

Every backtest you have run can be redone. Bad run? Change a parameter and run it again; history remains history, and yesterday’s prices will not change because you lost money. But the “Start Live Trading” button is different. The instant you click it, your program will send a real order to a real exchange using your real money. Whatever price it fills at is the price you get. There is no Ctrl+Z.

That is the gate this chapter is about: between paper plans and real money lies an irreversible gate. This part of the book is called “Staying Alive.” The previous two chapters covered risk management and diversification. This chapter asks: when you finally push your research through that gate and into real money, what discipline will keep you from getting yourself killed on the other side?

1. Passing on Paper Does Not Mean It Can Run in Reality

Chapter 7 explained that backtesting can eliminate ideas that clearly do not hold up, but it cannot guarantee real-world execution. At this point, we will not repeat what a backtest is. We will focus on the gap between it and live trading—the gap people most often overlook.

In a paper model, market data is tidy. In a real market, orders wait in queues, networks lag, exchanges reject orders, and liquidity can suddenly thin out exactly when you need it most. Your program may also contain a bug that appears only in real-time operation. More importantly, once positions get larger, your own orders start changing the prices at which you trade.

So passing on paper earns only the right to enter controlled validation. Your execution assumptions, system stability, and capacity at scale must each be measured under strict limits. The purpose is not to prove as quickly as possible that the strategy makes money. It is to learn, at the lowest possible cost, how far the paper world is from reality.

This brings us to the backbone of the chapter: staged rollout.

2. Staged Rollout: Enter the Water One Step at a Time

No one learning to swim jumps straight into the ocean. First, you put your face in the shallow water and blow bubbles. Then you practice kicking where the water reaches your waist. Only after you know you will not sink do you gradually move into deeper water. Bringing a strategy into live trading works exactly the same way: release it in stages, one step at a time.

Stage one: paper trading. Connect real-time or near-real-time data using pretend money, and first validate the wiring and state machine. Do order placement, modification, and cancellation work correctly? Do timestamps and positions reconcile? Does the program crash when prices jump sharply? But simulated fills are often unrealistic—they may ignore queue position, partial fills, and the process of consuming the order book yourself. So this stage shows only that “the engineering workflow basically runs,” not that “live orders will fill at the same prices.”

Stage two: live trading at the minimum executable size. Only once paper trading runs smoothly should you use real money—and then only at the smallest reasonable size the exchange allows that is still large enough to experience real execution friction. The amount should be small enough that a failed validation will not seriously hurt you. Here, for the first time, you measure real queues, partial fills, slippage, fees, and rejected orders. Every live fill should be compared with the backtest assumptions, and you must not look only at averages: the worst tail observations, the unfilled-order rate, and abnormal retries often reveal more than the mean.

Stage three: gradual scaling. Only after small-scale live trading holds up should you start increasing size. Note the word “gradual”—like climbing stairs one step at a time, not taking an elevator to the top. Why not scale all at once? Because what works with small money may not work with large money. As your orders grow, you begin to move the price yourself: when you buy, you push the price up; when you sell, you press it down. This effect—your own orders making your execution price worse—is called market impact (discussed in Chapter 10). Many strategies look wonderful at small size but reveal their true nature when scaled, because their small edge cannot pay for the extra costs of larger trading. So at every increase in size, confirm again: is it still alive at this scale? Once it is stable, move up one more step.

Have you noticed that each transition between these three stages has a “graduation criterion”? Paper trading must pass a predefined set of engineering tests; it does not mean the system is now bug-free. Small-scale live trading must measure real-world deviations and keep them within acceptable bounds. Every increase in size must reconfirm that scale has not materially destroyed the edge. These checkpoints—where you do not proceed unless the standard is met—are what we will discuss next: gates.

3. The Governance Chain: A Series of Gates That Do Not Let You Through Easily

Link those checkpoints together, and you have a governance chain (governance).

“Governance” sounds stiff, but its everyday meaning is simple: who gets to decide what, under which rules, and at which stage? A governance chain is a series of gates along the path from research to live trading. Every gate needs a “sign-off” before your strategy can move forward. Are the backtest results honest? Sign off. Are the risk-management parameters set? Sign off. Is monitoring in place? Sign off. Without any one of those approvals, the gate stays closed.

One crucial default is fail-closed—plainly, “when something goes wrong, shut it down.” It applies mainly to risk-critical states: when data is stale, positions do not reconcile, permissions are unclear, or a key check fails, the system should by default stop adding risk and refuse to scale up or switch to live trading, rather than “run first and sort it out later.” Non-critical alerts may be handled at a lower severity, but what counts as critical must be written down in advance.

This runs against many people’s instincts. In everyday work, we usually want things not to get stuck: if it can move, let it move. But with real money, the direction must reverse. The gate’s default state is “closed.” Someone must open it with evidence and authorization; whenever there is doubt, it closes itself again. Better to miss an opportunity than make a mistake—missing an opportunity may sting, but a bad live order loses real money.

This whole system is not bureaucracy or needless self-trouble. It is a guardrail that you set, while your mind is clearest, for the future version of yourself who may get overheated and want to take a shortcut.

4. The Irreversible Boundary: People Approve the Boundary; Machines Execute Within It

“Human-in-the-loop” is often misunderstood to mean a person must manually click every live order. That would turn systematic trading back into manual trading, and it does not suit strategies that need timely execution.

A more sensible division of labor is: people approve risk boundaries; machines execute within those boundaries. Switching to live trading, placing the first real order, adding capital, raising leverage or position limits, expanding the instruments traded, changing the core strategy, or granting new API permissions—actions that change the maximum possible loss or the system’s behavior—must be reviewed by a person and leave an accountability record. Once approved, routine orders may run automatically within the predefined instruments, size, frequency, and loss boundaries.

Why deliberately keep friction around boundary-changing actions? Because they change how deeply the system can hurt you. A machine can execute approved rules at high speed, but it cannot decide on behalf of the account owner how much risk to bear. Putting human checks at the boundary preserves the discipline of automation while preventing a program from expanding its authority unnoticed.

A mature governance chain should therefore answer three questions: who is authorized to open which gate? What evidence did they review when approving it? If something goes wrong, can the decision be traced back to that approval? Without these records, “someone is accountable” is only a slogan.

5. Do Not Leave the Keys Lying Around: Credentials and Security

To let a program trade automatically for you, you must give it a key so it can log in to the exchange and place orders on your behalf. This key is an API key—think of it as your home’s access card. Whoever has it can use your account.

Because it truly is a key, a few rules cannot be emphasized enough:

  • Never paste a key into a chat window or hard-code it in source code. Never upload it to a public repository. Put it in a dedicated secrets-management tool or protected environment variables, limit who can read it, and keep a way to rotate and revoke it. Exposed credentials can be quickly exploited by automated scanners; do not assume that deleting them means nobody saw them.
  • Keep live-trading and paper-trading keys separate. Stage-one paper trading (demo) uses a toy key; stage-two-and-beyond live trading (live) uses a real key. Never put these two keys in the same drawer or give them the same name. One day you will be rushing, and rushing is when you are most likely to grab the wrong key—you think you are testing in paper trading, but you are actually placing orders with real money. Keeping live and demo fully separate from the credential level onward safeguards a future, panicked version of you.
  • Give the program as little permission as possible. Enable only the trading permissions the strategy genuinely needs, and disable withdrawals. Where the platform supports them, also add IP allowlists, subaccounts, and spending limits. Disabling withdrawals reduces one form of harm, but it does not make a leaked credential safe—an attacker may still cause severe losses through malicious trades.

These may sound basic, but each was learned through someone’s real financial loss. Security measures may show no visible benefit in normal times, but they can contain a credential mistake to a smaller area. They are not the only wall; they are one layer in a defense-in-depth system.

6. Install the Dashboard and Red Button Before Going Live

Before real money starts running, two more things must be in place first—notice: first, not “install them after something goes wrong.”

The first is monitoring: your dashboard and alerting system. At a pace appropriate to the strategy’s risk clock, it should at least show your current positions, realized and unrealized P&L, open and rejected orders, whether data is fresh, and how close you are to risk limits. A low-frequency strategy may not need someone watching the screen all day, but every anomaly must be detected and escalated to an owner while there is still time to act.

There is a particularly nasty trap here, worth calling out: the scariest errors are not the ones that spray red error messages, but the ones that stay silent. The program reports no error and the screen looks normal, yet it has been doing the wrong thing all along—perhaps a number was calculated incorrectly, or perhaps it has not sent a single order even though you believe everything is operating normally. These “errors without errors” are often harder to detect than an obvious crash, because they let the system keep drifting from expectations while appearing normal. Good monitoring actively confirms, “Is it really doing what I want it to do right now?” Beyond checking that the program is alive, regularly reconcile internal positions, orders, and fills against broker or exchange records. When retrying an order, use a unique order identifier so a network glitch does not turn one intended order into two real ones.

The second is a circuit breaker: your emergency brake, or kill switch. When triggered, it first stops adding risk, cancels unfilled orders, then attempts to reduce or close positions according to the plan and notifies the owner. We must be honest here: a kill switch does not guarantee that every position can be closed instantly in every market. If the exchange is down, the order book is empty, or prices gap, the commands may also fail. So both automatic circuit breakers and manual switches must be rehearsed regularly, while position limits remain the earlier, first line of defense.

These two things must be installed before real money. If you start looking for logs or writing a liquidation script only after trouble begins, it is usually already too late. Monitoring finds trouble early; the kill switch stops the risk from continuing to grow. Neither can replace limits set in advance.

Part V · Mindset and the Long Road · Chapter 14

Common Traps and Human Nature: Confirmation Bias, Revenge Trading, and Sunk Costs

You Can Fix Programs—but Can You Fix Yourself?

In the previous chapters, we put a great deal of effort into tools: how to backtest, how to calculate the Sharpe ratio, and how to include trading costs. By now, you may have the faint impression that the hard part of quantitative trading is “technical”: writing the program correctly, finding the right data, and calculating the statistics correctly.

I need to tell you something a little discouraging: the hardest bug to fix in this craft is not in your program. It is in your mind.

At least program errors may be exposed by tests, logs, or reconciliation. Psychological biases are trickier: they do not necessarily make the system throw an error. Instead, they generate a pleasant-sounding explanation for your decisions—calling a strategy that should be cut “only temporarily broken,” calling luck skill, and calling the moment to stop a rare opportunity.

This chapter is not about programs; it is about people. It is about the traps that even the smartest quantitative traders fall into—not because they lack knowledge, but because they are human. And human nature does not spare you just because you are good at math.

We will take them apart one by one: why you fall in love with your strategy (confirmation bias), why you want to win it back immediately after a loss (revenge trading), why you cannot bear to cut a bad strategy (the sunk-cost fallacy), and why a losing streak makes you think the next trade “should” win while one lucky outcome gets dressed up as skill (the gambler’s fallacy and self-serving attribution bias). Finally, we will turn these vulnerabilities into paths that systems and peers can block.

Confirmation Bias: We Are Born Biased Toward Our Own Children

Let us start with the first, and most deeply rooted, one: confirmation bias.

Put simply, confirmation bias is our unconscious tendency to seek evidence that supports what we already believe, while automatically ignoring evidence against it.

Here is an everyday example. You decide that a certain brand is especially reliable. Afterward, you actively save positive reviews about it; when you encounter a negative review, you quickly explain it away as “that person does not know how to use it” or “it is just one unusual case.” The evidence is not being measured by the same ruler—supporting evidence is kept, while opposing evidence is relabeled.

In quantitative trading, this favoritism becomes very dangerous. You stay up for three weekends and finally build a strategy whose backtest curve rises beautifully toward the upper right. By then, your brain has quietly begun treating it as “your child.” What happens next?

  • You will screenshot and revisit the months when it performs well, thinking, “See? I told you so.”
  • You will find excuses for the months when it performs badly: “The market was too abnormal then,” or “That was a black swan; it does not count.”
  • When someone points out its problems, you rush to defend it instead of rushing to verify them.

You see? You are no longer “testing” the strategy; you are “maintaining” it. You have quietly changed roles from scientist to lawyer—a lawyer’s job is to defend a client, while a scientist’s job is to find the truth. Those are worlds apart.

How do labs fight confirmation bias? With a habit that sounds counterintuitive: write down what result would prove you wrong before looking at the data.

The falsification contract in Chapter 6 and the preregistration in Chapter 8 already provide technical defenses. Here we are looking at the psychological layer: once you fall in love with your strategy, you will instinctively find excuses for exceptions and reinterpret the threshold for failure. A written contract cannot eliminate bias, but it can leave a trace of it. Add a review by someone who did not participate in building the model, and you are less likely to be trader, referee, and defense lawyer all at once.

Revenge Trading: The Urge to “Win It Back Right Away”

The next trap catches almost everyone who has traded with real money: revenge trading.

You lose money on a trade in the morning, and the loss sticks in your mind like a thorn. A voice says, “No, I have to make it back right now.” So you increase the next position size or take a trade your rules never called for. The goal is no longer to execute an edge, but to restore the account balance to a number that makes you feel comfortable.

The market does not know that you lost money this morning, and it owes you nothing. The last loss and the next opportunity must be connected by a new mechanism and new evidence; “I cannot accept it” is not a mechanism. The most dangerous part of revenge trading is that it gives you the most freedom precisely when your emotions are most disordered.

Chapter 11 covered intraday loss limits, and Chapter 13 covered how to have systems enforce them. Here is the psychological reason to add: after a limit is triggered, people instinctively interpret stopping as “admitting defeat” and continuing to trade as “a chance to come back.” A truly effective kill switch must therefore do more than stop new orders; it must create enough friction—revoking permissions, locking the interface, notifying a peer—that an overheated version of you cannot disable the rule with a single click.

Sunk Costs: What You Cannot Let Go Of Is Really Those Three Weekends

The third trap is related to confirmation bias but more subtle: the sunk-cost fallacy.

Put simply, sunk costs are time, money, and effort you have already spent and can never recover. The “fallacy” is that, because we cannot bear to let go of what we have spent, we keep investing more into a bad choice.

The classic everyday example: you buy a movie ticket, then discover ten minutes in that the film is terrible. The rational choice is to leave and use the remaining hour and a half on something else. But many people think, “I already paid for the ticket; what a waste,” and force themselves to stay seated through two miserable hours. The ticket money cannot be recovered whether you stay or leave—it has “sunk.” Yet because of it, you also waste another hour and a half.

In research, this trap looks like this: you spend three entire weekends tuning a strategy, making dozens of versions, and it is just not very good. The rational move is to admit, “This path does not work; cut it.” But you think, “I put three weekends into this. If I quit now, were those three weekends not wasted?” So you spend a fourth and fifth weekend trying to rescue something that should have been let go.

There is a fatal thinking trap hidden here: you think you are protecting those three weekends, but you are actually losing the fourth one. The first three weekends are already spent; cutting the strategy or not cannot bring them back. But the fourth weekend is still in your hands, and you are personally throwing it into the same pit.

This brings us to a lab principle I love: “Rejecting an idea is not failure.”

Beginners often feel that cutting a strategy and admitting it does not work means all three weekends were wasted. A more accurate approach separates past investment from future decisions: whether those three weekends become knowledge depends on whether you leave behind conclusions others can review; whether to spend the fourth weekend depends only on the expected information value of the next step, not on how much you have already spent.

The Gambler’s Fallacy and Self-Serving Attribution: Do Not Dress Luck in the Clothes of Skill

Now for two related traps, both about how poorly we distinguish luck from skill.

The first is the gambler’s fallacy.

Put simply, the gambler’s fallacy is assuming that a string of outcomes “must be made up for” when there is no evidence of a mechanism—for example, after five reds in a row, believing the next spin should be black.

In a roulette wheel where each round is independent and probabilities do not change, the first five spins do not change the sixth. Markets, of course, may not be independently and identically distributed; trends and regime changes can exist. But a losing streak by itself does not prove that the next trade has a higher chance of winning. To increase position size, you need a new mechanism and new data—not “it has to be my turn by now.”

The second is subtler: self-serving attribution bias—using two different explanations for good and bad outcomes. When we profit, it is because we are skilled; when we lose, it is because of bad luck or an abnormal market.

This double standard makes you systematically overestimate yourself. A beginner who, through luck, makes a heavily concentrated bet just before a sharp surge and doubles their account can easily attribute it to their own “insight” and “courage,” rather than seriously estimate how much luck contributed to the outcome. They then learn a completely wrong lesson: concentrated bets, directional gambling, and gut feeling make money. They repeat this “successful experience” with ever-larger stakes, until the market collects its luck back with interest.

To handle this, do not investigate only after losses and pop champagne after profits. Both wins and losses must go through the same attribution audit: write expectations in advance, then break down market exposure, costs, execution deviations, exceptional events, and sampling uncertainty afterward. Also ask a counterfactual: if you used a similar period or a benchmark with the same risk, how much of this “skill” would remain?

A profitable outcome may certainly contain genuine skill, while also containing favorable conditions, leverage, and luck. A consistent audit standard is not meant to call every success accidental; it is meant to stop you from remembering uncertainty only when the result looks bad.

Discipline: Do Not Ask Your Overheated Self to Become Smarter on the Spot

What these biases share is not that people do not understand the right principles. It is that emotions change how you interpret the same rules. Confirmation bias wants to move the success criteria; revenge trading wants to bypass loss limits; sunk costs want to grant an old project an endless extension; the gambler’s fallacy wants to rewrite a string of bad results as a reason to increase the next bet.

So psychological discipline should not be written merely as “stay calm.” It must become observable controls:

  • Have someone who did not participate in building the model conduct an opposing review of the research results, so you are not both player and referee.
  • Once a loss limit is triggered, have the system revoke permission to add risk instead of merely displaying a reminder that can be dismissed.
  • Review whether a project continues using pre-agreed evidence and the next step’s information value, not by letting already-invested work hours vote.
  • Any move to increase position size because of a winning or losing streak must have new evidence independent of that streak.

Chapter 11 provides the risk rules, and Chapter 13 provides their system and governance implementation. This chapter provides the attack model—knowing in advance where people will try to undermine them. The real sign of mature discipline is not that you never feel an impulse again, but that when the impulse appears, it does not have permission to change the rules.

Part V · Mindset and the Long Road · Chapter 15

Negative Results Are Knowledge: Keep Improving Like a Scientist

What Is a Crossed-Out Patch of Ocean Worth?

The previous chapters have made this point repeatedly: an idea that fails the test does not mean the research produced nothing. In this chapter, we will unpack that statement fully.

A navigator carries an unfinished chart and sails southwest for three weeks, expecting to find a legendary island. They see only open water. They could crumple up the chart and curse the wasted time. Or they could write, in the appropriate place: “On this route, in this season, and within this observation range, no island was found.”

The second wording may feel less satisfying, but it is much closer to reliable research. It does not inflate “we did not see it this time” into “it never exists,” nor does it pretend the three weeks had no value. It precisely records what was ruled out and which boundaries remain.

Quantitative research works the same way. You spend two weeks cleaning data, writing rules, and running tests, only to find that the idea does not hold up. What determines whether those two weeks were wasted is not whether the result was positive or negative. It is whether you can leave behind a verdict that others—and your future self—can understand without misunderstanding.

A “No” You Can Trust Beats a “Yes” You Cannot

In Chapter 8, we discussed an uncomfortable fact: the more strategies you try, the more likely some will look highly profitable purely by luck. A beautiful positive-return curve is often just noise wearing an alpha costume—alpha being excess performance that remains relative to an appropriate benchmark after accounting for the relevant risks.

That is why experienced researchers reserve some skepticism for attractive positive results: they may come from selection bias, omitted costs, or random fluctuation. A well-executed negative result must not be exaggerated either, but it can at least clearly tell you which set of specifications and conditions was not supported.

This is the precise meaning of “negative results are knowledge, not failure.” It does not mean negative results are inherently nobler than positive ones. It means that, when a test has adequate power, reliable instruments, and clearly written decision boundaries, a finding of “does not hold under these conditions” is reusable knowledge. Many such boundaries, layered together, gradually map the research space.

This is not empty self-consolation. It has real cash value: the time you have for research in your life is limited, and continuing to pour time into a direction already known not to work is the real, painful loss. Negative results save you precisely that loss.

Labeling It “Failure” Does Not Complete the Job

There is a trap here that beginners fall into especially easily: treating “rejecting an idea” as “finishing a piece of work.”

For example, you have a hypothesis: “After Bitcoin falls sharply overnight, it usually rebounds over the next hour.” You run a backtest and find that it is unprofitable. So you write three words in your notebook: “Doesn’t work.” Then you turn the page and move on.

In doing so, you have learned almost nothing.

Here is another sentence for resisting that shortcut: rejection is not a shortcut to completing the task; precisely locating the boundary of knowledge is what completes the task. When you kill an idea, you should at least be able to answer three questions:

  • What exact statement was falsified? Was the whole claim, “sharp drops are followed by rebounds,” unsupported? Or only the “overnight” time window, while you have not tested daytime at all?
  • What statement is still alive? Perhaps “rebounds after sharp drops” is thoroughly dead for coin A, but you have not even looked at coin B.
  • What is the cheapest next step? Now that this path is blocked, where is the least costly branch to explore?

You see, both people conclude “this strategy is unprofitable.” The careless person turns the page and leaves. The rigorous person extracts a map: which door is closed, which doors have not yet been tried, and which one should be opened next. The first person gets “doesn’t work” for two weeks of effort; the second gets three well-directed new questions. The difference is not intelligence. It is discipline.

Four Cases Where You Have Not Actually Falsified Anything

Before you boldly write down the word “falsified,” stop for a moment. Often, you think you have shown an idea to be wrong when you have really just... tested it poorly. Here are four of the most common forms of false falsification. Learn them by heart.

Untested ≠ falsified. If you discard an idea merely because “I glanced at it and it seemed wrong,” that is not a negative result; it is no result. It is like standing by a lake and declaring, “There definitely are no fish here,” without ever lowering a fishing line. If you have not cast a net, you are not entitled to say there are no fish in the sea.

Insufficient statistical power ≠ ineffective. Here is a new term: statistical power. In plain language, it is the ability of a test to detect an effect under a given true effect size, noise level, and test design. It is not a fixed score detached from the problem: the smaller the effect you seek, the fewer the observations, and the greater the noise, the dimmer your flashlight becomes. Failing to illuminate something does not mean the room is empty. Declaring “it is ineffective” loudly from a tiny sample is a common beginner’s error.

Instrument failure ≠ mechanism failure. A bug may be hiding in your data; your program may accidentally be looking into the future—known as a lookahead bias; see Chapter 5—or the exchange’s historical data may have been quietly truncated. These are all cases of “the instrument is broken,” not “the idea is wrong.” An astronomer whose telescope lens is dirty and cannot see the stars does not conclude that “there are no stars in the universe.” They clean the lens first. Your first response should be the same: question the tools before questioning the idea.

Execution infeasibility ≠ the absence of a statistical effect. This is the subtlest case. A repeatable price effect may exist in the data, yet net returns remain negative after accounting for spreads, slippage, and capacity. The accurate conclusion is: “It is not tradable under the current market, scale, and execution method.” It cannot be packaged as a profitable signal, but neither does it mean the statistical effect never appeared. If market structure or execution conditions change in the future, it can be retested under new specifications.

These four statements share one spirit: untested does not mean falsified; insufficient statistical power does not mean ineffective; instrument failure does not mean mechanism failure; execution infeasibility does not mean a statistical effect does not exist. Distinguish them clearly, and you will not accidentally draw a sea that may hold treasure as a dead sea.

The Counter-Hypothesis Is Material for the Next Round

When you thoroughly falsify an idea, something wonderful happens: the reason it failed often points directly to the next, better idea. This is the principle I most want to give you: the counter-hypothesis is material for the next round.

Return to the earlier example of “a rebound after a sharp drop.” Suppose you test it carefully and find that it is indeed unprofitable overall. But you look one step further and notice that losses seem concentrated in moments when the sharp drop coincides with unusually high volume. That observation can become material for the next round: perhaps you should investigate whether sharp drops without a volume spike are more likely to recover.

But label it immediately as an exploratory finding. This condition emerged only after you saw the results; you cannot pretend afterward that the original hypothesis predicted it. It must be entered in the experiment ledger, with its mechanism and decision conditions written again, and then tested using data that did not participate in this observation. Otherwise, “finding a new direction through failure” can easily degenerate into the data snooping described in Chapter 8.

The value of a negative result is not that it automatically produces the true answer. Its value is that it narrows the next question more precisely. A researcher who registers the counter-hypothesis as a new hypothesis gradually accumulates testable questions. One who only stamps “doesn’t work,” or recasts an after-the-fact slice as foresight, has not truly moved forward.

Turn It All into a Log

How can you make sure negative results really leave behind knowledge? The answer is so plain it may be disappointing: keep a log.

Create a research log for yourself. It can be just a plain-text file. If this round is a confirmatory test, lock in the hypothesis, preregistered version, data range, and a complete set of specifications before you begin. If it is exploratory, first state the permitted scope of the search, and account for every variant you try. After the test is complete, add four things: the actual results, the proposition that did not receive support, the boundaries that remain untested, and the cheapest next experiment.

Preregistration locks in prior commitments; the research log preserves the later verdict. They are not duplicate descriptions in the same document: the first answers, “What did I originally bet on?” and the second answers, “What did the evidence ultimately change?”

Over time, this log becomes your personal nautical chart. When you look back six months later, you will know which waters were carefully explored and why you stopped, and you will not burn the same stretch of time again simply because you forgot.

Real research life consists of a vast field of negative results, with the occasional positive result that holds up. Focus on “what part of the map became clearer today,” rather than “did I find the Holy Grail today,” and you will be able to go far.

Part V · Mindset and the Long Road · Chapter 16

Find Your Corner: Scale Matching, Capacity, and a Real Moat

By now, you may feel a little discouraged.

In Chapter 2, we said that markets are nearly efficient; obvious money rarely sits still for long. Along the way, I have kept pouring cold water on your hopes: backtests can deceive, a beautiful Sharpe ratio may be only noise, trading is not that cheap, and many ideas will be eliminated during validation. You may be wondering: with institutions managing enormous sums, backed by professional teams and faster systems, what place is there for a beginner with one laptop and limited capital?

Let me say honestly first: if you plan to fish in the same waters, in the same way, for the same fish, then you truly have little chance.

But you do not have to do that. This final chapter is not about finding a mysterious corner that institutions will never enter. It is about choosing problems that match your scale, time, data, and execution conditions.

Do Not Cast Your Net in the Big Ships’ Hunting Grounds

In the richest deep-sea fishing grounds, a whole line of industrial trawlers is anchored. They have sonar, nets several kilometers long, and freezer holds that let them remain at sea for three months. This is smart money’s hunting ground. If you row in on a tiny skiff to compete for the same tuna, there is only one outcome: you get run over without even making a splash.

But this ocean is not made up only of deep-sea fishing grounds.

Along the shore are countless little tide pools, gaps between rocks, and hollows revealed only at low tide. There are fish, shrimp, and crabs there too—but only in small quantities. How small? Small enough that the trawlers do not care: the diesel to get there would not pay for itself, the large nets cannot reach into the rock crevices, and even if they emptied a whole pool, it would not fill one corner of a freezer hold. It is not worth the captain’s attention.

These corners do not belong exclusively to you, nor do they guarantee any fish. They may simply be unsuitable for large pools of capital because of capacity, fixed operating costs, or organizational processes. For a small-scale researcher, that is a clue worth examining.

Here is a key term we need to understand well: capacity.

Capacity: How Much Money an Opportunity Can Hold

Capacity, in plain language, is “how much capital a strategy can absorb before its expected net return materially deteriorates because of market impact, liquidity, and crowding.” It is not a permanent ceiling; capacity changes as markets, counterparties, and execution methods change.

Here is an analogy. The little noodle shop at the mouth of an alley serves excellent, profitable signature beef noodles. But it has only twenty tables, and the owner does all the cooking herself. If you invest ten million today and ask her to serve ten thousand customers tomorrow, can she do it? No. Force the volume, and the broth collapses and quality is destroyed—the advantage of being “delicious and profitable” is blown up by the money you poured into it.

Market opportunities work the same way. Some signals can cover their costs at small scale, but as capital grows, your own orders push up purchase prices and depress sale prices. The market impact discussed in Chapter 10 eats away the marginal edge.

For a large fund, an opportunity whose capacity is only a tiny fraction of its assets may not cover the fixed costs of research, compliance, connectivity, and operations, even if its return rate is attractive. For a small account, the same capacity may be meaningful. This is simply a question of scale matching; it does not mean institutions cannot see it.

Therefore, small scale can sometimes be a structural advantage. Your orders are less likely to disturb the market, and you can study questions whose absolute profits are too small. But small scale also means weaker data, infrastructure, bargaining power, and diversification. It is a condition you can use, not a superpower.

Obscurity and Difficulty: Possible Mismatches, Not Talismans

Beyond capacity, some subjects may be set aside because the data are messy, access is troublesome, the holding period does not fit organizational evaluation, or fixed costs are too high relative to profit.

What may genuinely create a mismatch is the combination of difficulty and capacity: spending three weeks cleaning data for an opportunity that cannot accommodate much capital may not be worthwhile for a large team, but it may be worthwhile for a small team willing to do detailed work. Conversely, popular markets do not necessarily lack opportunities, and obscure markets do not necessarily have tradable value.

That is why a lab prioritizes questions that fit its own resources: the mechanism makes sense, the data can be obtained, capacity is small but sufficient, and execution costs may be coverable. Not because rock crevices naturally contain treasure, but because your constraints may be less disadvantageous there.

Rigor: The Foundation of a Moat

All right: even if you find an obscure little corner, what lets you defend it? This brings us to the word this chapter—and this whole book—most wants to leave with you: moat.

A moat, borrowed from the water surrounding a castle, is something “others cannot easily copy and that helps your advantage last a little longer.” A real advantage cannot be merely “I was luckier today.” It must be “even if others see it, they cannot easily replicate it.”

The mistake beginners make most easily is thinking a moat must come from “a smarter idea,” “a faster machine,” or “a more magical formula.” In these areas, you really cannot beat large institutions.

But there is another layer of foundation you can build yourself: rigor.

Recall the practices this book has taught throughout: lock specifications before confirmatory tests; honestly account for every variant explored; subject attractive Sharpe ratios to audits for selection bias and distribution shape; use calibrated adverse scenarios in execution models; do not upgrade conclusions before out-of-sample evidence appears.

These practices are not glamorous. They are slow and boring, and they often downgrade beautiful results with your own hands. Many people skip them, allowing the same false positives to repeatedly consume time and principal.

The value of rigor is to reduce false positives, preserve reusable knowledge, and prevent execution and risk from betraying the research. A real moat often combines data or access, understanding of mechanisms, capacity mismatches, execution details, and discipline.

Capability Before Opportunity: Build Your Skills First, Then Be Ready for Opportunity

You may ask: do I need to find that profitable corner right away?

No. I want to offer an order that may sound counterintuitive but is important: build your capabilities first, then wait for opportunity to arrive.

What do firefighters do when there is no fire alarm? They clean their trucks, maintain their hoses, and drill repeatedly. What do fishers do during the closed season? They mend their nets. Neither is idle. Before opportunity appears, they prepare their ability to execute, so that when a real fire breaks out or the fish run arrives, they are ready for it.

Research is the same. Signals truly worth further validation do not appear often, and some decay as competition and market conditions change. If you wait until one appears to hurriedly build a backtesting environment, patch in risk-management rules, and learn how to clean data, the opportunity will be gone by the time you are ready. Or you will rush in and lose principal instead.

So before you deploy important capital, build those skills: an honest backtesting process, a set of approved risk boundaries that cannot be loosened on the fly, and habits for handling clean data and reconciliation. These will not be wasted simply because there is no return this week—they are your nets and hoses, essential conditions for validating opportunities safely when they arise.

Capability comes before opportunity. Practice the process until it is trustworthy, so that when opportunity arrives, you do not manufacture risk through haste.

Make Both Curiosity and Discipline Habits

By this point, you have held two engines all along.

Curiosity generates questions and leads you to corners that others dismiss as too small, too messy, or too troublesome. Discipline determines which questions deserve to continue, which results can only be judged noise, and which risks must never enter a real-money account. With curiosity alone, you will chase every bright spot. With discipline alone, you may become so rigorous that you dare not try anything.

Neither can depend only on how you feel that day. Discipline must become the risk boundaries, approvals, and monitoring of Chapters 11 and 13. Curiosity needs a regular research rhythm: collect questions at set intervals, advance only one decidable experiment at a time, and write the result in the log. In this way, negative results will not drive you out of research, and attractive results cannot make you skip the gates.

A truly sustainable state is not permanent excitement. It is knowing what to do next regardless of whether this round goes well, while also knowing which steps must never be taken.

A Farewell Roadmap: The Next Three Steps

This is the final chapter. I do not want to end with pretty words; I want to give you a map you can genuinely follow. Just three steps. Do not rush—take them slowly.

Step One: Survive first.

Do not rush to make money. First practice connectivity, monitoring, and circuit breakers in a simulated environment. Then enter at the minimum executable scale through the governance chain in Chapter 13. Position size, loss boundaries, and conditions for scaling up should all follow the rules already approved in Chapter 11. The goal of this step is not to prove the system is forever safe. It is to use fault injection and reconciliation to confirm that in anticipated bad scenarios, it stops, alerts, and does not expand risk on its own.

Step Two: Choose a problem that fits you, and honestly complete one research project.

Choose one small question you are genuinely curious about, whose mechanism makes sense, and whose data, time horizon, capacity, and execution conditions all match your resources. Choose only one, and complete the full cycle in the order of Chapters 6 through 10: write down the hypothesis and decision conditions, lock the confirmatory specifications, backtest, perform statistical checks, and then account for costs. The point is not to win on the first try, but to obtain a verdict that can withstand review.

Step Three: Turn it into a habit, and slowly draw your own map.

Then do it again. Write each verdict in the research log: what was rejected, what remains untested, and what the cheapest next experiment is. What you accumulate is not a résumé that says “tried many things,” but a record of judgment that will not repeatedly step into the same pit.

None of these three steps requires you to become smarter, faster, or richer than institutions first. They require a different, more controllable advantage: choose problems that fit, test honestly, and hold the risk boundaries.

You do not need to prove that you can conquer the entire market. First find one small question worth answering seriously, complete it, and preserve the conclusion. Then do the next one.

Back Matter

Conclusion: The Tools of a Pessimist, the Heart of an Optimist

Do you remember what you hoped for when you opened the first page?

My guess is that there was, at least a little, a thought like: “Perhaps this book contains a path that can make me money.” If so, I should probably apologize first—because by now you have discovered that this book has not given you a single strategy to copy, a single indicator guaranteed to work, or any plainly marked “buy here, sell there” instructions.

What this book truly hopes to leave you with is an attitude: the tools of a pessimist, the heart of an optimist.

Apply pessimism to your method. Data may be wrong; a backtest may peek into the future; attractive results may simply mean that you tried enough things; execution may be worse than the model. Build these doubts into the process. Make conclusions able to withstand attacks from the opposing side, and allow real money to move only within pre-approved boundaries.

Reserve optimism for continuing the research. Having an idea rejected does not mean you are unsuited to research; it only means this specification was not supported. Record the boundaries clearly, ask the next cheaper, more precise question, and you are not standing still.

But do not rely only on “I have thought it through.” Risk boundaries must be written into the system, and research decisions into the log. The former keeps you from skipping stages when excited; the latter keeps you from deleting your knowledge along with your disappointment.

After closing this book, do one small thing today: find a notebook and write down the date, a hypothesis you are genuinely curious about, and one sentence: “What result would make me admit that this time was not supported?” Do not look at the data yet. This action will not make money, but it will change how you judge whether you have been fooling yourself.

Our coffee ends here. Ahead there is no crystal ball and no holy grail; only a map that you will gradually make more accurate with evidence.

May you reserve pessimism for your methods and optimism for the heart that keeps moving forward.

Back Matter

Appendix A: A Short Glossary of Quantitative Terms

This glossary collects the core terms used in the main text, organized into seven groups by topic. Each entry first gives a plain-language definition suitable for beginners, then adds the boundary most often misstated. It is the book's terminology authority: where the main text uses an abbreviation or metaphor, the preferred term and meaning here govern.

Definitions have been compressed for introductory purposes; they are not complete legal, exchange, or statistical standards. In a specific market, the relevant contracts, fees, and rules still control.

I. Markets and Trading

Trading Approaches and Risk Exposure

  • Quantitative trading — Trading that uses data, statistics, or mathematical models to support research and decisions. It is often systematic, but the two are not exact synonyms: a quantitative process may retain human judgment.
  • Systematic trading — Trading that expresses entries, exits, positions, and execution as repeatable rules. The rules can be simple and need not use complex models.
  • Discretionary trading — Judgment by a trader based on experience and current information. It does not mean arbitrary trading, but when rules are not fully specified, it is harder to backtest, reproduce, and audit.
  • Strategy — A complete executable design that includes at least the instruments traded, signals, positions, exits, cost assumptions, and risk boundaries. A signal is only one component.
  • Long — Risk exposure that benefits when price rises. In spot markets it usually means buying before selling; derivatives can also create a long position.
  • Short — Risk exposure that benefits when price falls. It can be created by borrowing and selling, or through derivatives such as futures and options; costs and risks differ by instrument.
  • Leverage — Economic risk exposure greater than the capital actually committed. It may arise from borrowing or derivatives and amplifies gains, losses, and forced-liquidation risk alike.
  • Margin — Funds or assets pledged to maintain a leveraged position. Adverse markets may require additional margin; if it is insufficient, the platform may reduce or liquidate positions under its rules.
  • Liquidation / forced liquidation — A position being forcibly closed because margin is insufficient or platform risk rules are triggered. The execution price may be poor, and remaining principal is not guaranteed to be intact.

Market Data and Common Measures

  • Candlestick / OHLC — A summary of a period's market activity using open, high, low, and close prices. It is a compressed summary and does not contain the full sequence of trades within that period.
  • Volume — The quantity or value actually traded during a period. High volume does not automatically mean good liquidity; spread, depth, and executable size still require separate checks.
  • Volatility — The magnitude of changes in returns. It is one measure of risk, not all risk; gaps, liquidity, and tail losses may not be adequately reflected.
  • Return / annualized return — Profit or loss as a proportion of capital or price; annualization converts it to one year according to an agreed method. Frequency, compounding convention, and sample length affect comparability.
  • Moving average — A moving average of prices over recent periods, used to smooth short-term fluctuation. It is a descriptive tool, not an inherent predictor.
  • Moving average crossover — A class of rules that produces signals from crossings of short- and long-term moving averages. The text uses it to illustrate rule formalization, not to recommend any particular number of days as an effective strategy.

Order Books and Microstructure

  • Order book — Visible limit buy and sell orders arranged by price. Hidden orders, off-book intent, and resting orders that may be cancelled at any time may not appear in it.
  • Depth — The visible quantity resting at each price level. Visible depth changes and can be cancelled; it cannot be treated as inventory guaranteed to be executable.
  • Bid-ask spread / spread — The difference between the best ask and best bid. When immediate execution is required, crossing the spread is usually a cost.
  • Liquidity — The ability to trade a given size within a limited time without imposing excessive cost. It involves spread, depth, execution speed, resilience, and market state.
  • Limit order — An order that specifies the worst acceptable price. It guarantees a price boundary, not execution; if the price crosses the book, a limit order may execute immediately and become a taker order.
  • Market order — An order that prioritizes prompt execution without a price ceiling or floor. It may be partially filled, rejected, or receive a very poor price in extreme conditions, so it is not an unconditional guarantee of execution.
  • Maker — Under exchange classification rules, the party whose order first enters the order book and adds liquidity. Maker is a fee and matching identity, not a synonym for a professional market maker.
  • Taker — The party whose order immediately trades with existing resting orders and removes liquidity. Market orders are usually takers; immediately executable limit orders can also be takers.
  • Market impact — The way your own order changes executable prices or subsequent quotes. It varies with size, speed, depth, and market state, and is one source of slippage.
  • Slippage — The difference between the actual execution price and a benchmark price selected in advance. The benchmark must be specified; network delay, market movement, partial fills, and market impact can all cause slippage. A complete non-fill should instead be recorded as a non-fill and opportunity cost.
  • Market microstructure — The field studying how orders enter, queue, match, cancel, and form prices. It explains why a “screen price” is not the same as your actual execution.

Transaction Costs

  • Transaction cost — All friction paid to establish, adjust, and exit positions, including fees, spread, and slippage, plus market-dependent taxes, stock-borrow fees, funding rates, financing, and infrastructure costs.
  • Commission / fee — A charge levied by a broker, exchange, clearing firm, or platform. It may be calculated as a fixed amount, a percentage of trade value, by tier, or by maker/taker identity.
  • Turnover — Trading value over a period relative to portfolio size. It measures how much risk exposure was traded, not merely the number of orders.
  • Gross return — Strategy return before trading, financing, and related costs are deducted.
  • Net return — Return after relevant costs are deducted on the same basis. Whether a strategy can be traded should be assessed primarily from net, not gross, results.
  • Negative-sum game — In a closed trading comparison where gains and losses mainly transfer among participants, costs make aggregate results lower than before costs. It does not mean that all long-term investment, corporate value creation, or overall market returns must be negative.

Market Efficiency and Opportunity

  • Efficient Market Hypothesis (EMH) — A family of hypotheses about the degree to which prices reflect available information. It does not claim prices are always correct; it reminds you that public, obvious, low-cost excess returns are difficult to retain for long.
  • Alpha / excess return — Return remaining relative to a defined benchmark after controlling for relevant risk exposure. Observing positive alpha does not automatically prove skill; estimation error, selection bias, and costs still require audit.
  • Smart money — A colloquial label for professional, well-informed, or execution-capable participants. The label does not guarantee that they are always right and cannot replace analysis of a specific mechanism.
  • Arbitrage — Locking in, or nearly locking in, a price difference with offsetting positions; under the ideal definition it is nearly risk-free after costs. Many uses of “arbitrage” in market speech are actually relative-value trades and still have basis, financing, execution, and tail risks.
  • Market anomaly — A phenomenon that conflicts with a benchmark model or simple efficiency explanation and repeatedly appears in data. It may arise from risk compensation, behavior, institutions, data problems, or decay after competition; it is not automatically tradable alpha.

II. Data

  • Garbage in, garbage out — If input data are wrong, even a precise model will process the error into something that looks more like an answer.
  • Timestamp — A label recording when an event occurred, was published, was received, or was stored. Different time meanings cannot be mixed; time zones must also be unified.
  • Point-in-time — Returning to a historical decision time and using only versions and membership lists that were available then. Data revised later cannot be fed back into the past.
  • Look-ahead bias — A decision uses information that was unknowable at the time, or reverses the ordering of signal, order, and fill. It often makes a backtest falsely attractive.
  • Survivorship bias — A sample retains only instruments, funds, or accounts that still existed later, omitting delisted, closed, and failed cases and thereby systematically flattering historical results.
  • Silent failure — A system does not explicitly error but has stopped updating, become misaligned, dropped data, or otherwise departed from expectation. It requires reconciliation, coverage, and freshness checks to find proactively.

III. Research Methods

  • Hypothesis — A proposition that data or observations can test, such as “when condition A appears, how does the distribution of future returns change?”
  • Assumption — A premise on which a model, mechanism, or calculation depends, such as “execution costs are approximately stable at this size.” An assumption is not the primary proposition being tested, but a wrong assumption changes the conclusion.
  • Falsifiability — A proposition has, in principle, observations that conflict with it. A claim that can be explained as right no matter what happens cannot produce a clear research decision.
  • Falsification — Finding, using pre-specified evidentiary standards, that a precise proposition is not supported. It does not automatically prove the opposite proposition, nor can it condemn untested variants with it.
  • Falsification contract — Decision conditions written before viewing results: what to measure, what counts as not supported, and which boundaries are outside this round's scope. It prevents moving the goalposts after the fact.
  • Mechanism hypothesis — An economic, behavioral, or institutional explanation for why a phenomenon exists. A mechanism can improve extrapolation credibility and help design disconfirming tests, but a plausible story is not proof.
  • Research loop — The process of posing a question, preparing data, defining a specification, backtesting, performing statistical audit, checking costs and risks, reaching a decision, and registering the next question for the next round.
  • Backtest / backtesting — Simulating a strategy on historical data in executable time order. It is useful for rough screening and comparison, but does not guarantee future performance or real execution.
  • Pessimistic or conservative fill model — First establish an explainable baseline fill model, then test results under adverse and stress scenarios supported by data. It is not arbitrarily setting costs to an extreme, and it must not double-count spread and slippage.
  • In-sample — Data used for exploration, modeling, and selecting specifications. Trial and error are permitted here, but every attempt must be accounted for.
  • Out-of-sample — Data not involved in current model selection and used to test extrapolation. Repeatedly changing rules in response to it gradually strips it of out-of-sample status; it is not a magic exam that remains valid forever.
  • Signal — A strategy's numerical expression of future direction or relative strength. It may mean long, short, or no action; it may also be a continuous score, probability, or ranking.
  • Factor — A systematic variable or exposure used to explain or predict common return differences across assets. Factors can often form portfolios and be tested across instruments.
  • Feature — An observable variable input to a model. A feature may be only an engineering input and need not have a factor's economic meaning, cross-sectional structure, or tradable exposure.
  • Parameter — A number that must be set or estimated in a rule or model. Confirmatory tests should freeze the complete specification; exploring multiple parameters is allowed, but every variant must enter the experiment ledger.
  • Robustness check — Whether a conclusion broadly holds after changing reasonable neighborhoods, samples, definitions, or implementations. Robustness is not proof, and a single-point optimum is not automatic fraud.
  • Ablation — Removing or replacing one component to observe its incremental contribution. Components can interact, so “no difference when removed” must also be interpreted alongside joint tests.
  • Control / benchmark — The reference against which a strategy is compared. A good benchmark matches the primary risk, holding period, and cost rather than deliberately choosing a weak opponent that must lose.
  • Curve fitting — Continually adding degrees of freedom to fit data already seen. Fitting itself is a modeling tool; the problem is treating sample noise as an extrapolatable pattern.
  • Research log — A record preserving the prior specification, all exploratory variants, data versions, code versions, results, decision boundaries, and next questions. It makes negative results reusable and leaves evidence of later changes of story.

IV. Statistical Rigor

  • Overfitting — A model learns accidental details in its sample too thoroughly, producing attractive in-sample results that fail on new data. Degrees of freedom, number of selections, and sample information jointly determine the risk; it is not that “complex models are inherently guilty.”
  • Multiple testing — When many tests are conducted in the same research family, the chance of at least one accidental good result rises. Correlated tests are not independent, but they still need unified accounting and adjustment.
  • Data snooping — Repeatedly examining the same data, changing conditions based on results, and finally reporting only the most attractive version. Exploration itself is not wrong; presenting exploratory results as prior confirmation is.
  • Conditional return / subgroup analysis — A result calculated only for a particular period, state, or subsample. Every data-driven slice increases selection freedom and should enter the same research family; such slices are usually not independent trials.
  • Statistical power — A test's ability to identify an effect, given the true effect size, noise, sample, and test method. When power is low, “not significant” cannot simply be translated as “no effect.”
  • Significance level — The long-run proportion of false positives permitted for a single test when the null hypothesis and testing conditions hold. Five percent does not mean “there is a 95% chance the result is true,” nor does it mean it is profitable.
  • Equity curve — The path of account or strategy equity over time. An attractive curve is a description, not independent evidence; random processes can also produce smooth upward paths.
  • False green — Tests report that everything passes, while critical behavior was not covered or the program did nothing at all. Validation must include negative tests that deliberately trigger failure.
  • Preregistration — Locking the hypothesis, specification, primary metrics, and decision rules before a confirmatory test. It does not prohibit exploration; it requires a clear separation between exploration and confirmation.
  • Sharpe ratio — Generally, average excess return divided by return volatility, often annualized. It does not fully describe skewness, tails, liquidity, or maximum drawdown, and is affected by sample length and serial correlation.
  • Deflated Sharpe Ratio (DSR) — A statistical adjustment that considers strategy selection, multiple trials, and factors such as skewness and kurtosis of the return distribution when interpreting an observed Sharpe ratio. It is not simply dividing Sharpe by the number of trials, and it cannot replace independent validation.

V. Risk, Capital, and Portfolios

  • Position — Directional risk exposure to an instrument or strategy, expressible in units, notional value, or risk units; it is not merely “how much money was spent.”
  • Position sizing — The process of translating a risk budget, exit distance, volatility, liquidity, leverage, and portfolio exposure into an actual position.
  • Risk budget — Risk that is allocated in advance and acceptable for a trade, strategy, asset, or entire portfolio. It is a boundary, not a profit target.
  • Stop loss — A pre-defined exit or risk-reduction condition, which may be based on price, time, volatility, or hypothesis failure. It constrains decisions but does not guarantee execution at the trigger price.
  • Maximum drawdown — The largest decline from a historical peak to a subsequent trough in a given equity path. It depends on the sample and path; it is not an upper bound on future worst loss.
  • Circuit breaker — A rule that stops adding risk and enters review when loss, anomaly, or another risk metric reaches an approved boundary. Specific thresholds should be set for the strategy and account; percentages in this book are examples only.
  • Ad hoc averaging down / adding after losses — Temporarily increasing risk or moving exit conditions after a loss and reluctance to accept it, when the original specification did not require this. It differs from pre-registered staged entry or rebalancing with a total risk cap.
  • Martingale betting — Increasing bets in an escalating sequence after losses in an attempt to cover prior losses with the next gain. It cannot turn negative expectancy positive; it concentrates risk into a few enormous tail losses, and limited capital and trading constraints make it unsustainable.
  • Compounding — Returns participating in subsequent investment, causing capital to change along a multiplicative path. Deep losses shrink the base, so recovering requires a return greater than the original loss percentage.
  • Correlation — The degree to which two return series move together in a linear sense, usually between -1 and +1. Zero does not mean independence, and correlation changes with frequency, window, and market state.
  • Covariance — A quantity combining the direction of co-movement of two returns with their respective scales. Portfolio risk and risk-contribution calculations usually rely on a covariance matrix.
  • Diversification — Combining different sources of risk to reduce dependence on a single member or mechanism. It cannot guarantee no loss, and protection can weaken in stressed periods.
  • Equal weight — Allocation giving each member the same capital weight. It is a valuable simple benchmark, but does not guarantee balanced risk or suitability for every account.
  • Risk parity — Seeking to make members' contributions to portfolio risk more balanced. Full calculation must consider covariance and check rebalancing costs, leverage, financing, and tail risk.
  • Portfolio-level — Looking at risk, cost, and constraints across all positions together. Individual strategies being safe does not mean that several correlated strategies remain safe when combined.
  • Capacity — The amount of capital a strategy can deploy before expected net returns are materially eroded by market impact, liquidity, and crowding. Capacity changes with markets and execution.

VI. Mindset and Research Behavior

  • Confirmation bias — Being more permissive toward evidence supporting one's view and more demanding toward opposing evidence, allowing the same proposition to escape decision indefinitely.
  • Revenge trading — Departing from original rules or expanding discretion or position size in order to “make back” losses quickly. Past account losses are not a new mechanism for the next trade.
  • Sunk cost fallacy — Continuing to put future resources into a low-value project because one cannot bear to abandon unrecoverable past investment. Whether to continue should depend on future expected value.
  • Gambler's fallacy — Believing, without new evidence of a mechanism, that a streak of wins or losses must be offset by the next outcome. Markets may have dependent structures, but one's own loss sequence does not raise the win probability of the next trade.
  • Self-serving attribution bias — Attributing good results to ability and bad results to environment or luck. Wins and losses should receive the same pre-specified standards and attribution audit.
  • Moat — A combination of conditions that makes an advantage hard to copy or erode, possibly including data, access, mechanism, capacity, execution, and organizational discipline. Rigor is a foundation; it does not create alpha by itself.

VII. Governance and Live Execution

  • Governance chain / governance — A set of responsibilities and controls from research to live trading specifying who can approve what, what evidence is required, and when activity must stop or escalate to review.
  • Gate — A strategy may enter the next stage only after reaching pre-written graduation conditions. A gate should retain version, evidence, and approval records.
  • Paper trading — Simulating orders with live market data without taking real profit and loss. It is suitable for validating plumbing and process, but cannot fully reproduce queue position, market impact, or psychological pressure.
  • Fail-closed (default to closed in risk-critical states) — When critical conditions such as stale data, unreconciled positions, or unclear permissions are abnormal, the system by default stops adding risk or rejects expansion. Non-critical alerts may be downgraded; critical states must be defined in advance.
  • Human-in-the-loop — Humans approve transitions to live trading, capital, risk limits, permissions, and core strategy changes; machines may automatically execute routine orders within approved boundaries. It does not mean every automated order must be clicked manually.
  • Monitoring and reconciliation — Checking data, positions, orders, fills, and profit and loss on the strategy's risk clock, and reconciling internal records with broker or exchange records. Merely seeing that the program is “alive” is insufficient.
  • Kill switch — Once triggered, stops adding risk, cancels cancellable orders, and attempts to reduce or close positions according to the plan. It does not guarantee instant full liquidation during outages, gaps, or liquidity droughts.
  • API key — A credential allowing a program to access a trading account. Use secret management, least privilege, live/demo separation, rotation, and revocation; trading programs normally should not have withdrawal permission.

Back Matter

Appendix B: Beginner Checklists and Further Reading

This appendix deliberately retains intentional repetition. The main text explains why; the checklists simply place the actions easiest to miss back in front of you when you are excited, tired, or rushed.

No item is a guarantee that checking it makes you safe. It is more like a pre-flight checklist: it cannot judge the weather for you, but it can keep you from having an accident because you forgot to close the cabin door. If any item has no answer, the default action is not to force a “yes,” but to stop and gather evidence.

Checklist 1: Before Starting Research (Chapters 5, 6, and 8)

A. State what this round is actually doing

  • [ ] I have labeled this round exploratory or confirmatory. Exploration may find directions; confirmation tests a proposition already locked down.
  • [ ] The hypothesis can be stated in one sentence: what information is visible when, what condition does it trigger, which future interval does it predict, and what are the direction and metric?
  • [ ] I have written at least one plausible mechanism and two alternative explanations that could produce the same phenomenon.
  • [ ] Decision conditions were written before viewing results: what counts as not supported, and which boundaries does this round not test at all?
  • [ ] If this is a confirmatory test, the complete specification, primary metrics, and decision rules have been preregistered; if exploratory, the permitted search range and every variant will enter the log.
  • [ ] I distinguish “statistically detectable” from “economically worth trading”: even if the effect exists, is it large enough to cover costs and risks?

B. Then interrogate the data

  • [ ] For every field, I distinguish event time, publication time, and the time I could actually obtain it, and have not inserted numbers published later into the past.
  • [ ] The instrument universe, index constituents, financial-statement revisions, and delisted samples are all retained point-in-time, rather than keeping only members that survived later.
  • [ ] Time zones, trading days, daylight saving time, timestamp meanings, and data frequencies have been standardized.
  • [ ] Gaps, duplicates, outliers, pagination limits, lookback limits, and API truncation have been actively checked, rather than merely checking whether the program errored.
  • [ ] After writing data, I have read it back and verified coverage, confirming that downstream processes can actually retrieve it at the right time.
  • [ ] I can state what this data does not cover. Without knowing the boundary of missingness, I cannot call it a complete sample.

Checklist 2: During Backtesting and Statistical Audit (Chapters 7, 8, 9, and 10)

A. Time order and research specification

  • [ ] I have reviewed observation, signal, order, and fill times one by one; I did not first see the full result within the same candlestick and then pretend I had already traded.
  • [ ] All explored parameters, filters, time windows, and instrument subsets enter one research ledger; I did not retain only the winners.
  • [ ] The confirmatory specification is frozen; any modification after seeing results is marked as a new version rather than rewritten as the original plan.
  • [ ] In-sample and out-of-sample data are split in chronological order, and I record whether out-of-sample data have been repeatedly viewed. Data used to change rules no longer pretend to be purely out-of-sample.
  • [ ] Results do not survive only at a sharp single point across parameter neighborhoods, different market states, and reasonable definition changes.
  • [ ] Ablations and controls use matched risk, holding-period, and cost conventions; the complex strategy genuinely adds auditable value beyond a simple benchmark.

B. Statistical honesty

  • [ ] I have defined the research family in advance: which strategies, parameters, and conditional slices belong to the same batch of attempts?
  • [ ] Conditional returns and after-the-fact groupings are not treated as free discoveries; correlated slices are not independent, but still count in the selection process.
  • [ ] I report not only “significant/not significant,” but also effect size, sample uncertainty, and the size of effect that current power can exclude.
  • [ ] I disclose the Sharpe ratio's sample length, serial correlation, skewness, and tail risk, rather than treating one number as a complete risk profile.
  • [ ] If I selected the best result from many candidates, I have used appropriate multiple-testing adjustment, DSR, or fresh data confirmation to reduce selection bias.
  • [ ] I treat a beautiful curve only as a description, not as independent evidence.

C. Costs, execution, and capacity

  • [ ] The fill benchmark is clear: mid-price, arrival price, opening/closing auction, or another benchmark; the strategy truly had a route to obtain it then.
  • [ ] Fees, spread, slippage, financing, stock borrow, funding rates, and taxes are included as required by the market, and I have checked that none are double-counted.
  • [ ] Turnover is calculated as traded value relative to portfolio size, rather than merely counting orders or “round trips.”
  • [ ] Baseline, adverse, and stress cost scenarios all have support from historical fills or market structure; I have neither made optimistic wishes nor substituted impossible extreme penalties for modeling.
  • [ ] Non-fills, partial fills, and opportunity costs are recorded separately rather than all stuffed into one vague slippage number.
  • [ ] After scaling size, I have re-estimated market impact and capacity rather than assuming small-size results can be copied linearly to large size.

D. Prevent “false green”

  • [ ] I have deliberately supplied bad timestamps, missing fields, duplicate orders, and out-of-bound positions, confirming that the system fails where it should fail.
  • [ ] Tests check not only “no error,” but also whether trade count, positions, profit and loss, rejected orders, and risk state match expectations.
  • [ ] Critical calculations have an independent implementation, hand-worked example, or invariant for cross-checking; I do not trust an entire chain to the same possibly wrong code.
  • [ ] A green backtest earns only eligibility for controlled validation, not a license for live trading.

Checklist 3: Before Touching Real Money and Scaling (Chapters 11, 12, 13, and 14)

A. Risk boundaries before opportunity

  • [ ] Risk limits per trade, strategy, asset, day, and portfolio derive from account capacity and strategy distributions, rather than copying the book's 1% or 5% examples.
  • [ ] Position calculations leave room for gaps, widening spreads, rejected orders, leverage, and correlated positions being hurt together.
  • [ ] Exit conditions are clear, including what to do if execution cannot occur at the planned price after a trigger. I do not treat a stop loss as an execution guarantee.
  • [ ] Any staged entry is registered before entry and total risk is capped; after losses I may not temporarily increase size to average down or move the exit line.
  • [ ] Martingale-style escalating positions are explicitly prohibited; a string of high win rates will not conceal tail bankruptcy risk.
  • [ ] The portfolio has been stress-tested for common shocks, rising correlations, and liquidity droughts, rather than only checking each strategy in isolation.

B. Phased deployment

  • [ ] Paper trading first validates market data, clocks, order state, rejected orders, reconnection, monitoring, and risk rules; it does not use fake fills to prove profitability.
  • [ ] Real money begins at the smallest executable size: large enough to produce real friction, yet small enough that validation failure does not cause material harm.
  • [ ] Small live trading is reconciled trade by trade against the backtest: fill deviations, partial fills, non-fills, fees, and exceptional retries are all recorded.
  • [ ] Every scale-up has quantitative graduation conditions; after changing size, instruments, leverage, or frequency, I re-estimate costs, capacity, and risk.

C. Governance and change control

  • [ ] Risk-critical states are specified; when data are stale, positions do not reconcile, or permissions are unclear, the default is to stop adding risk or reject expansion.
  • [ ] Humans approve transitions to live trading, capital, risk limits, permissions, core strategies, and scale-ups; routine orders execute automatically only within approved boundaries.
  • [ ] Every deployment has a version, approver, evidence package, and rollback plan; no parameters are changed ad hoc in production without a trace.
  • [ ] Once a boundary is triggered, resuming trading requires independent review; the same impulse that just triggered the circuit breaker cannot decide to lift it with one click.

D. Monitoring, security, and emergency stop

  • [ ] Monitoring displays data freshness, positions, orders, fills, profit and loss, and distance from risk boundaries on the strategy's risk clock; exceptions can be escalated promptly to an owner.
  • [ ] Internal positions, orders, and fills are reconciled regularly with the broker or exchange; retried orders use unique identifiers to avoid executing the same intent twice.
  • [ ] The kill switch has been rehearsed: it stops adding risk, cancels cancellable orders, and reduces risk according to the plan; I also understand that it does not guarantee instant full liquidation in every market.
  • [ ] API keys are in a secret-management system, live and demo are separated, and least privilege, rotation, and revocation are used; the trading program has no unnecessary withdrawal permission.
  • [ ] The runbook specifies separate degradation and human-takeover steps for exchange outages, network interruption, market-data-source failure, and local-system disconnection.

The Ten Mistakes Beginners Make Most Often (Quick Reference)

  1. Looking at data before writing the hypothesis. Deciding what you meant to test only after seeing the results disguises exploration as prediction. (Chapters 6 and 8)
  2. Time travel. Reversing the order of signal, order, and fill, or using data that were unpublished then or only revised later. (Chapters 5 and 7)
  3. Keeping only survivors. Looking back using today's still-trading list while removing delisted, closed, and failed samples from the denominator. (Chapters 2 and 5)
  4. Failing to account for exploration. Trying many parameters and conditions, submitting only the best report card, and then calling it the “original strategy.” (Chapters 8 and 9)
  5. Treating significance as truth and tradability. Ignoring multiple testing, statistical power, effect size, and net returns. (Chapters 8, 10, and 15)
  6. Confusing cost conventions. Omitting financing and slippage, or putting spread into slippage and deducting it again; counting trades instead of turnover value. (Chapters 4 and 10)
  7. Believing false green. All tests pass, but no failure was deliberately triggered and no one checked that the system placed the orders it should and rejected the risks it should. (Chapters 7 and 13)
  8. Treating stops as guarantees and exceptions as courage. Ignoring gaps and liquidity, then loosening boundaries after a trigger because “this time is different.” (Chapters 11 and 14)
  9. Temporarily expanding risk after losses. Unregistered averaging down, moving exit lines, and martingale practices hide tail losses behind a string of small wins. (Chapter 11)
  10. Jumping straight from backtest to large automated trading. Skipping minimum-size live runs, reconciliation, permission separation, and kill-switch drills leaves capital to discover engineering problems. (Chapter 13)

There is one more error, unnumbered but most invisible: treating “being busy” as “making progress.” The story of 115 code commits and zero real experiments reminds you that volume of activity is not an increment of knowledge. The daily question should be “How many reviewable conclusions did I add?” not “How much did I do?” (Chapter 3)

Further Reading: Follow the Problem

The following are entry points by topic, not a reading list that makes you profitable upon completion. Read one or two most directly relevant to your current problem first, and verify the edition and translation you actually have.

I. Randomness, judgment, and tail risk

  • Nassim Nicholas Taleb, Fooled by Randomness and The Black Swan.
  • Daniel Kahneman, Thinking, Fast and Slow.

Why read: to help distinguish luck, sample selection, overconfidence, and tail events; relevant to Chapters 2, 8, and 14.

II. The complete process of systematic trading

  • Ernest P. Chan, Quantitative Trading, Algorithmic Trading.
  • Robert Carver, Systematic Trading.
  • Andreas F. Clenow, Following the Trend.
  • Perry J. Kaufman, Trading Systems and Methods.

Why read: to see how a system is fully specified, from rules and positions to costs and execution; relevant to Chapters 1, 3, 9, 11, and 13.

III. Backtest overfitting and statistical testing

  • David Aronson, Evidence-Based Technical Analysis.
  • Papers by David H. Bailey, Jonathan Borwein, Marcos López de Prado, and others on the probability of backtest overfitting and the Deflated Sharpe Ratio.
  • Marcos López de Prado, Advances in Financial Machine Learning.

Why read: to deepen understanding of multiple testing, strategy-selection bias, DSR, and the distinctive statistical problems of financial data; relevant to Chapters 7, 8, and 15.

IV. Market microstructure and transaction costs

  • Larry Harris, Trading and Exchanges: Market Microstructure for Practitioners.

Why read: to connect order books, liquidity, spread, market impact, and execution benchmarks into one complete vocabulary; relevant to Chapters 4 and 10.

V. Position sizing, leverage, and risk budgets

  • The Kelly criterion and works and papers by Edward O. Thorp on its investment applications.
  • The sections on position sizing in Van K. Tharp, Trade Your Way to Financial Freedom.
  • Robert Carver's works on risk targeting, leverage, and portfolio allocation.

Why read: to turn “survive first” into calculable position and portfolio boundaries. Kelly is extremely sensitive to error in estimating an edge; practical research commonly considers fractional Kelly rather than treating the formula as an instruction to go all-in.

VI. Scientific method and research honesty

  • Karl Popper, The Logic of Scientific Discovery.
  • Richard Feynman, Cargo Cult Science.

Why read: to understand falsifiability, auxiliary assumptions, and research that is formally correct but lacks honest testing; relevant to Chapters 6 and 15.

VII. Portfolios and expected returns

  • Antti Ilmanen, Expected Returns.
  • Richard Grinold and Ronald Kahn, Active Portfolio Management.

Why read: to learn more about risk exposure, correlation, portfolio construction, and expected returns; relevant to Chapter 12. You will get more from this group after first practicing the data and statistical discipline above.

This appendix ends here. Return to the main text when you need theory, and check each item when you need action. The moment a checklist is most useful is often not when you are at your clearest and calmest, but when you most want to skip it.