VALYNOXSTRATEGY RESEARCH TECHNOLOGY
AlphaPrimeAlphaPrime
ACADEMY / Strategy generation

What is quantitative trading? Meaning, workflow and a first strategy

Quantitative trading is making trading decisions from rules that are written down, tested on historical data and kept only if the test supports them. The method is a workflow (hypothesis, data, backtest, validation, live running), and a retail trader can follow it alone with clean data, backtesting software, a validation method and a trading platform.

By · Published · updated · Editorial policy

Contents
  1. What is quantitative trading?
  2. How is quantitative trading different from algo trading and discretionary trading?
  3. What does the quant workflow look like, from idea to live trading?
  4. What should a retail trader copy from a quant trader's day?
  5. What first strategy can a retail trader build and test?
  6. What tools and data do you need to start?
  7. How do you know the first result is not just luck?
  8. Frequently asked questions
  9. References

What is quantitative trading?

Quantitative trading is making trading decisions from rules that are written down, tested on historical data and kept only if the test supports them. The data decides what gets traded, not the trader's feeling on the day. It is a way of working, not one kind of strategy: hypothesis, data, backtest, validation, then live running.

The Chinese term 量化交易 is used in the same sense: "quantified" trading, where every decision can be counted and checked. A quant treats a trading idea the way a scientist treats a claim. Write the idea so that it can turn out wrong. Test it on the data. If the data does not back it, drop it. A trend-following rule, a mean-reversion rule and a breakout rule can all be quantitative. The test is what makes them quantitative.

In practice, a quant does not ask "do I believe in this setup?" but "how many times did this setup occur in the last ten years, what happened after it, and what did it cost to trade?" One person at one computer can answer that question; the steps are below.

How is quantitative trading different from algo trading and discretionary trading?

The three differ in who makes the decision and what justifies it: discretionary trading relies on judgment, algorithmic trading automates the execution of any rule, and quantitative trading requires the rule itself to be chosen by measurement. They overlap in practice, but they answer different questions.

Discretionary trading is trading where a person reads the market and decides each trade from experience and judgment. Algorithmic trading (in Chinese 程式交易, "program trading") is trading where a computer program places the orders according to a rule, whatever the source of that rule. A trader can write a program for a rule they never tested. That is algorithmic, but not quantitative. The reverse also exists: a trader can research a rule carefully with data and then place the orders by hand. That is quantitative research with manual execution.

A two by two grid. Rows show where the rule comes from: judgment or a data test. Columns show who places the orders: the trader or a program. Discretionary and algo-only trading use untested rules. Quant trading can use manual orders, and quant trading with a program placing the orders is the most common case. Quant means a tested rule Rule source vs. who places orders Trader orders Program orders Judgment Data test Discretionary Trader decides Algo only Untested rule Quant Manual orders Quant Most common
Two separate questions: who chose the rule, and who places the orders. Quantitative trading as most people practise it sits in the bottom-right cell, but the term describes the research, not the automation.
Discretionary tradingAlgorithmic (program) tradingQuantitative trading
Who chooses the ruleThe trader, trade by tradeThe trader, once, from any sourceA test on historical data
What justifies the ruleExperience and contextWhatever the author believedMeasured results after costs
Who places the ordersThe traderA programUsually a program
Common failureDecisions change with moodAn untested rule runs fast and loses fastA rule fitted to the past that does not repeat

Most retail quants end up in the last column with a program placing the orders, because a rule tested on ten years of bars is easiest to follow exactly when a machine follows it. This article covers the research side: how the rule in that last column is chosen.

What does the quant workflow look like, from idea to live trading?

Every quant process runs the same five steps in a fixed order: form a hypothesis, prepare data, backtest with costs, validate on data the test did not use, then run and monitor. The order matters because a failed validation sends the work back to the hypothesis, and skipping that return is where most retail attempts go wrong.

  1. Hypothesis. A hypothesis is one plain sentence that says what you expect to happen and why, written so that the data can prove it wrong.
  2. Data. Historical bars for the exact market, resolution and session you will trade, with no missing sessions, one time zone and clean handling of contract rolls.
  3. Backtest. A backtest is a run of the rule over historical bars that reports every trade the rule would have taken. It includes commission, slippage (the difference between the price the rule assumed and the price a real order would fill at) and next-bar execution, which means the order fills on the bar after the signal bar, never on the signal bar's own close.
  4. Validate. Validation is testing the rule on data the search never saw, either a held-back later period or walk-forward analysis, which repeats the tune-then-test cycle across the history.
  5. Run and monitor. Trade the rule exactly as tested and compare live trade count, fills and drawdown with the backtest.

The step that decides whether the process works is what you do when validation fails.

The quant workflow: hypothesis, data, backtest, validate, then run. If validation passes, the rule goes to live running. If it fails, the work goes back to the hypothesis, not back to tuning the backtest. Five steps, one way back From idea to live trading Hypothesis Data Backtest Validate Run pass fail If validation fails, start at step 1. So: never tune until it passes.
The five steps run in one direction. When validation fails, the work goes back to the hypothesis. Going back to the backtest to adjust parameters until the validation passes turns the validation into another backtest.

What should a retail trader copy from a quant trader's day?

The habit worth copying most carefully is the written record: each hypothesis written down before the test, each result written down after it, including the variants you dropped. How a quant desk splits the day between a researcher, a data engineer, a risk manager and a trader, and which of those roles software and a checklist can take at home, is covered in what quantitative trading firms do and what retail can copy.

Testing variants by hand means one backtest at a time, and the count of what you tried is easy to lose; write each variant and its result down before running the next one.

The record is what lets you answer the question in the last section: how many things did I try before this one worked? Ten variants is a different situation from ten thousand, and only the record tells you which situation you are in.

What first strategy can a retail trader build and test?

A good first strategy has one clear hypothesis, two or three parameters, a defined session and a stop, for example a session-range breakout on an index future. A simple rule is easy to test honestly, and its failure teaches more than a complex rule's success.

The hypothesis in one sentence: "when the index future breaks out of its early-session range, it tends to continue in that direction until the session close". That sentence turns into a rule with four parts:

  1. Range. Record the highest high and lowest low of the first N minutes of the session you trade. N is the first parameter; 15, 30 and 60 minutes are common starting values.
  2. Entry. After the range period ends, if a bar closes above the range high, buy at the open of the next bar. If a bar closes below the range low, sell short at the open of the next bar. Take at most one long and one short entry per day; the maximum number of entries is the second parameter.
  3. Stop. Place the stop at the opposite side of the range. A third, optional parameter is a minimum range size, so that very narrow ranges that produce stops a few ticks away are skipped.
  4. Time exit. Close every position at the end of the session. No overnight exposure, so the test is not affected by weekend gaps or roll days.
One session of a range breakout rule: the early-session range is marked, price closes above it, the entry is on the next bar, the stop sits at the other side of the range, and the position is closed at the session close. A sentence becomes a rule Session-range breakout, one day Range Entry Stop Exit at close The day's own prices set every level. So: start with a rule this simple.
One plain sentence becomes a testable rule: a range, an entry on the next bar after the break, a stop at the other side of the range, and an exit at the session close.

Hypothetical example

An index future with a point value of $50 per contract (made-up value). The first 30 minutes of the session set a high of 5,020 and a low of 5,000, a 20-point range. A bar closes at 5,022, so the rule buys at the open of the next bar, 5,023. The stop sits at 5,000, so the risk is 23 points, or $1,150 per contract before costs. Commission and one tick of slippage on each side add up to 1.5 points per round trip. Every trade therefore starts 1.5 points behind, and across the whole test the average trade must be comfortably larger than 1.5 points for the rule to be worth anything after costs. On this day the session closes at 5,035 and the time exit sells there: 12 points gross, 10.5 points after costs. On a day where price turns back into the range, the stop takes 23 points plus costs.

Why this rule and not a moving-average cross or an RSI level? Because its entry, stop and exit are defined by the day's own prices, so there are few numbers to tune, and because the time exit removes a whole class of data problems. When the test is done, the trade list tells you directly which days the hypothesis held and which it did not. The detailed rules and settings are in the guide to the opening range breakout strategy and how to backtest it.

What tools and data do you need to start?

A retail quant setup needs four things: clean historical bar data for the market you trade, backtesting software that models fees, slippage and next-bar execution, a validation method such as walk-forward analysis, and a trading platform to run the exported rules. Each block hands its result to the next in a fixed order.

Four stacked building blocks of a retail quant setup, from the bottom: historical data with no gaps, backtest software with costs and next-bar execution, validation on unseen data, and a trading platform that runs the same rule live. Build from the data up Each block feeds the one above Trading platform Same rule live Validation Unseen data Backtest software Costs, next bar Historical data No gaps Bad data breaks every block above. So: start with the data.
Four building blocks. A weakness in a lower block passes upward unchanged: bad data makes every backtest above it wrong, and an untested rule on a good platform is still untested.
BlockWhat it must doCheck before moving up
Historical bar dataCover the market, resolution and session you will trade, as a continuous contract (a series that joins one futures contract to the next so you can test across years)No missing sessions, one time zone, roll days handled, no price spikes the market never traded
Backtesting softwareApply the rule bar by bar with commission, slippage and next-bar execution; test many variants with the same settingsCosts set before the first run; the trade list opens and can be read trade by trade
ValidationHold back unseen data, run walk-forward analysis, keep every result on recordIn-sample and out-of-sample results shown separately; dropped variants still recorded
Trading platformRun the exact rule that was tested, from exported source codeLive trades match the tested logic: same session, same stop, same time exit

For the search step, software that generates and tests rule variants from your parameter ranges and constraints replaces hand-written variants; AlphaPrime (Valynox) does this with strategy generation, which works from rules and indicators, parameter ranges, entry and exit conditions and search constraints you set. For the last block, the research software should export the strategy as source code for the platform you trade on; AlphaPrime exports strategy source code to MultiCharts (PowerLanguage), TradingView (Pine Script v6), TradeStation (EasyLanguage), NinjaTrader (NinjaScript), MetaTrader 4 (MQL4) and MetaTrader 5 (MQL5), and the full list is on the platform export page. Data is the block most often skipped by beginners and the one that is hardest to fix later, so start there.

How do you know the first result is not just luck?

A backtest result is only evidence after it survives data the search never used and after you account for how many variants you tried. Compare in-sample with out-of-sample behaviour, and treat a big gap between them as the signal to go back to the hypothesis. The out-of-sample and walk-forward checks in AlphaPrime strategy validation run against thresholds you choose, so a big in-sample versus out-of-sample gap is judged by the same rule for each variant.

In-sample data is the part of the history you used to choose the rule and its parameters. Out-of-sample data is the part you held back and looked at only once, after the rule was fixed. Think of a student who has seen the exam questions in advance: a high score tells you little. The out-of-sample period is the exam the student did not see. A rule that only fitted the past shows a steep in-sample equity curve and a flat or falling out-of-sample curve. That gap is what sends the work back to the hypothesis.

Two illustrative equity curves split into in-sample and out-of-sample periods. Curve A rises at the same pace before and after the split and holds. Curve B rises steeply in-sample and goes flat and down out-of-sample, so it was fitted to the past. Same curve after the split? Illustration, not a result A: holds B: fitted IS OOS IS OOS B fitted the past; A held up. So: a gap sends you back to step 1.
Illustrative curves, not a result. Curve A behaves the same before and after the split and is kept for further testing. Curve B was fitted to the in-sample period; the gap sends the work back to the hypothesis.

Hypothetical example

The range breakout is tested on eight years of data: six years in-sample, two years out-of-sample. In-sample it takes 600 trades with an average trade of +6 points after costs. Out-of-sample it takes 200 trades with an average trade of +5 points. The trade count per year is similar and the average trade is similar, so the behaviour carried over. A second variant with a tuned minimum-range filter shows +11 points in-sample but +0.5 points out-of-sample, below the 1.5-point cost. The second variant fitted the past; it goes back to the hypothesis stage, not back for more tuning.

The second check is the number of variants you tried. Bailey and co-authors (2014) showed that when enough parameter combinations are tested on the same data, some of them will show an excellent in-sample record by chance alone, and the best in-sample result is then expected to do worse out-of-sample. Harvey and Liu (2015) argue that the bar a backtest must clear should rise with the number of strategies tested to find it. Your written record from the earlier section is what makes this count possible. The practical steps are covered in overfitting in strategy generation.

What this means if you use AlphaPrime: the workflow in this article is the order AlphaPrime is built around. AlphaPrime evaluates each generated candidate with fees, slippage and next-bar execution, runs walk-forward analysis and other validation checks with thresholds you set, and keeps every result in the strategy databank, so the written record of what was tried exists without extra effort.

Frequently asked questions

Is quantitative trading the same as algo trading?

No. Algorithmic trading (程式交易) means a program places the orders according to a rule, whatever the source of the rule. Quantitative trading (量化交易) means the rule itself was chosen by testing it on historical data. Most quantitative traders also automate execution, so the two overlap in practice, but an automated rule that was never tested is not quantitative.

Do I need to know programming to do quantitative trading?

You need to be able to state a rule exactly and read a trade list, but you do not have to write code by hand. Strategy-research software can generate and test rule variants from the ranges you set and export the result as source code for a trading platform. Programming helps when you want to test something the software does not offer.

What is a quantitative trading strategy?

A quantitative trading strategy is a fully specified rule: what data it reads, when it enters, where the stop is, when it exits, and what it costs to trade, with each part chosen because a test on historical data supported it. A session-range breakout with a stop at the other side of the range and an exit at the session close is one example. The strategy type (trend, breakout, mean reversion) does not make it quantitative; the testing does.

What does a quantitative trader do all day?

Most of the day goes to checking data, running and reviewing tests of rule variants, and writing down what was tried and why. Watching live prices is a small part. In a firm these tasks are split among a researcher, a data engineer, compute staff, a risk manager and a trader; a retail trader does the same tasks alone with software and a checklist.

Can a retail trader do quantitative trading alone?

Yes, with four building blocks: clean historical bar data for the market you trade, backtesting software that includes costs and next-bar execution, a validation method such as walk-forward analysis, and a trading platform that runs the tested rule. Start with a simple strategy with two or three parameters and a time exit, and keep a written record of every variant you test.

References

  • Bailey, D. H., Borwein, J., López de Prado, M., & Zhu, Q. J. (2014). Pseudo-Mathematics and Financial Charlatanism: The Effects of Backtest Overfitting on Out-of-Sample Performance. Notices of the American Mathematical Society, 61(5), 458–471.
  • Harvey, C. R., & Liu, Y. (2015). Backtesting. The Journal of Portfolio Management, 42(1), 13–28.