Skip to content
Menu
Finabase Learn

Build and test a strategy Lesson 1 of 14

Strategies · Building and testing a strategy

What is a trading strategy? Rules, parts and a first test

What separates a trading strategy from an idea: the five parts every strategy needs, and how four exact readings of one sentence gave four different results on SPY.

On this page
  1. A strategy against an idea
  2. The five parts of a strategy
  3. One sentence, four strategies
  4. Why write the rules down at all
  5. What a strategy is not
  6. Kinds of strategy
  7. How Finabase does it
  8. Frequently asked questions
  9. Summary
  10. Check your understanding
  11. Exercise

A trading strategy is a set of rules that says what to buy or sell, when, and how much, written down exactly enough that two people following it would make the same trades. That last part is the whole difference between a strategy and an idea. "Buy strong stocks" is an idea. "At each month-end, hold SPY if its close is above the average of its last ten month-end closes" is a strategy.

The distinction matters because only a strategy can be tested. An idea bends to fit whatever happened; a rule either made money on past prices or it did not. This lesson lists the parts a strategy needs, then takes one ordinary sentence, "own the market while it is above its 50-day average", and shows that it hides at least four different strategies with four different results.

A strategy against an idea

Most trading talk is made of ideas: "the trend is your friend", "buy the dip", "cut losses short". Each one sounds like guidance and each one leaves the real decisions open. Which trend, measured how? How deep a dip? How short is short?

A strategy closes those gaps. A useful check is the stranger test: hand the rules to someone who has never met you, give them the same price data, and ask for the list of trades. If their list matches yours, you have a strategy. If they come back with questions, each question marks a rule that is missing.

An idea The same thing as a rule
"Follow the trend" Hold the fund when its close is above its 50-day simple average
"Buy the dip" Buy at the close when the 2-day RSI is below 10
"Take profits" Sell at the first close above the 5-day average
"Don't bet too much" Put no more than 10% of the account in one position
"Check in now and then" Look once a day, after the close, and at no other time

The rules in the right column are not better ideas than the ones on the left. They are the same ideas, made exact. Being exact is what lets a rule be tested, repeated and blamed.

The five parts of a strategy

Every strategy, from a 30-year index plan to a day-trading system, answers the same five questions.

  1. What it trades (the universe). One fund, a list of stocks, every stock above a certain size. A rule that works on a broad index fund may fail on single stocks, which gap, halt and go bankrupt.
  2. When it gets in (the entry). The condition that opens a position, and the price the trade is assumed to happen at. "Above the average" must say which price, which average and what "above" means.
  3. When it gets out (the exit). The condition that closes the position. A strategy with an entry and no exit is half a strategy. Exits include a reversed signal, a stop-loss, a profit target and a time limit.
  4. How much it holds (the size). All of the account, a fixed dollar amount, or an amount set by risk, as in Position sizing: how many shares to buy for a set risk. Size decides how much a losing streak costs.
  5. When it is checked (the schedule). Every day at the close, once a week, once a month. The schedule is a rule like any other, and it changes the result more than most people expect.

Two more things sit around the rules and are part of an honest description: the costs assumed for each trade, and the yardstick the result is compared with. A strategy that returns 10% a year sounds good until you learn that holding the same fund returned 12%.

One sentence, four strategies

Take the sentence "own SPY while it is above its 50-day average". SPY is the oldest exchange-traded fund that tracks the S&P 500, launched in January 1993. The sentence sounds complete. It is not, and the gaps can be filled in several reasonable ways:

  • Checked every day. At each close, hold SPY if the close is above the 50-day average, otherwise hold cash.
  • Checked weekly. Ask the same question only on the last trading day of each week, and hold the answer until the next one.
  • A 1% band. Buy only when the close is more than 1% above the average, and sell only when it is more than 1% below. In between, keep whatever you have.
  • Two closes in a row. Buy after two closes in a row above the average, and sell after two in a row at or below it.

All four are faithful to the sentence. Here is each one on the same data.

SPY daily close and its 50-day average, 2025-01 to 2026-11; shaded = in cash $500 $600 $700 SPY close 50-day average Feb Apr Jun Aug Oct Dec Feb Apr Jun Aug Oct
SPY daily close and its 50-day average, January 2025 to November 2026. Shaded days are the ones the daily-check rule spent in cash.

The test, stated in full:

  • Data. SPY daily closes from November 18, 2024 to November 17, 2026. The first 49 days build the first average, so the rules run from January 31, 2025: 452 trading days, a little under 22 months.
  • Trading. The signal and the trade both use the day's closing price. The account is fully in SPY or fully in cash.
  • Costs. 0.10% of the amount on every buy and every sell.
  • Left out. Dividends, interest on cash and taxes.
Reading of the sentence Total return Deepest fall Round-trip trades Trades with a gain
Checked every day 13.9% −9.1% 17 24%
Checked weekly 23.1% −6.0% 7 43%
1% band around the average 16.1% −6.7% 6 50%
Two closes in a row 17.3% −8.4% 10 40%
Buy and hold 21.7% −19.0% 1 n/a
One idea, four exact rules: total return on SPY over the same 22 months Checked every day 13.9% Checked weekly 23.1% 1% band around the average 16.1% Two closes in a row 17.3% Buy and hold 21.7% SPY daily closes, 0.10% per trade, dividends not included. Computed by Finabase.
Four exact readings of one sentence, and buy and hold, on SPY from January 31, 2025 to November 17, 2026. 0.10% per trade, dividends not included.

The spread between the best and worst reading is more than nine percentage points in under two years, from a difference most people would call a detail. The daily version made 17 round trips and 13 of them lost. Its losses were small, about 1% each, but there were many: in February 2026 alone it bought and sold three times, losing 1.6%, 1.2% and 1.2%. The weekly version skipped most of those and made 7 round trips.

Do not read this as "weekly is the right answer". It is one fund over 22 months, far too short to rank the four. Two years of daily bars shows how a rule behaves, not whether it works. What the table does show is that the sentence was never one strategy. Anyone who "tested" it tested one of these, or something else again, and the choice was made somewhere, by someone, often without noticing.

What the table shows about each part

  • The schedule changed the trade count more than anything else. Looking less often meant fewer false alarms and lower cost. It also means a slower reaction when a real decline starts.
  • Every version fell less than buy and hold. The deepest fall was between 6.0% and 9.1%, against 19.0%. All four were in cash for most of the March and April 2025 decline. That is what this kind of rule is for.
  • Three of four earned less than buy and hold. The protection had a price. In a period that ended higher than it began, time spent in cash usually costs return.
  • Win rate was low everywhere. Between 24% and 50% of trades gained. The rules made their money on one long trade, May to November 2025, worth 16% to 19%. Edge and expectancy explains why a low win rate is not a flaw in itself.

Why write the rules down at all

Three reasons, in order of importance.

It can be tested. With exact rules, past data gives a list of trades, and the list gives numbers: return, deepest fall, number of trades, how long the bad stretches lasted. Without them there is only memory, which keeps the wins. Backtesting basics: biases, costs and an honest SPY test covers how such a test is run and how it misleads.

It can be followed under stress. Decisions made in the middle of a falling market are worse than decisions made on a quiet weekend. A written rule moves the decision to the quiet weekend. This is the same reasoning behind a trading plan.

It can be judged afterwards. When a loss happens, a rule lets you ask a useful question: did I follow the rule and the rule lost, or did I break it? The first is the normal cost of any strategy. The second is a different problem with a different fix.

What a strategy is not

  • Not a forecast. The 50-day rule does not predict anything. It sells after the price has already fallen and buys after it has already risen.
  • Not a way to avoid losses. The daily rule above lost on 13 of 17 trades. A strategy organizes losses; it does not remove them.
  • Not proven by a good backtest. A rule can fit the past by accident, especially when many versions were tried first. See Overfitting and backtest bias: 4,094 rules tested on SPY.
  • Not finished when the entry is chosen. Entries are the most discussed part and often the least important. The four readings above share one entry idea and differ in schedule and confirmation only.
  • Not automatically systematic trading by computer. A person can follow a written rule by hand once a month. What makes it a strategy is that the rule decides.

Kinds of strategy

Strategies are usually grouped by what they expect prices to do.

Kind What it bets on Typical shape of results
Trend following Moves that have started tend to continue Many small losses, a few large gains
Mean reversion Sharp moves tend to partly reverse Many small gains, a few large losses
Long-term investing Owning productive assets pays over many years Few trades, long stretches below an earlier peak
Rotation Some assets lead for months at a time Depends heavily on what is in the list

Moving average trend following: the 10-month rule, tested is a full example of the first kind: one rule, 33 years of monthly data, costs included, and the periods when it lost.

How Finabase does it

No Finabase tool tells you what to buy or sell. Two tools let you put rules against past prices, and both make choices of their own that you should know before comparing numbers.

  • Backtest. The Backtest tool takes one symbol and the indicators or candlestick patterns you choose, and trades every signal they produced over the range you pick. Each signal buys or shorts a fixed $10,000 at that bar's close, and no trading cost is charged. The tests on this page put the whole account in or out and charge 0.10% a trade, so the two will not give the same figures for the same rule.
  • Strategy. The Strategy tool takes if/then rules with weighted branches, such as "if SPY is above its average, hold SPY, otherwise hold cash", and replays them over two years starting from $10,000. Two years is enough to see how a rule trades, not enough to judge one that trades a few times a year.
  • Chart. The chart draws the 50-day SMA on daily bars, so you can see each crossing in the first figure for yourself. The link above opens it on SPY.

In terms of the five parts: the Backtest tool fixes the size (a set dollar amount per signal) and the schedule (every bar of the range), and lets you choose the universe (one symbol), the entries and the exits (the signals). The Strategy tool lets you choose the holdings and their weights and fixes the period.

Frequently asked questions

What is the difference between a trading strategy and a trading plan?

A strategy is the rule set for one way of trading: entry, exit, size and schedule. A trading plan is wider. It covers which strategies you use, how much money each gets, what you do when you break a rule, and how you keep records.

Does a trading strategy have to be automated?

No. A strategy has to be exact, not automatic. A rule checked by hand once a month is a complete strategy. Automation helps when a rule needs many checks a day, and it removes the temptation to skip a trade.

How many rules should a strategy have?

As few as will state it completely. Each extra condition is one more thing that can fit the past by chance. The 10-month rule in Moving average trend following: the 10-month rule, tested has four lines and needs nothing else.

Can a strategy that lost money in a test still be a good strategy?

Sometimes. A short test may simply have covered the kind of market the rule is bad at. The honest answer needs a longer history, costs included, and a look at when the losses came. A strategy that lost over a long test in many kinds of market is a poor one.

Summary

A trading strategy is a rule set exact enough that anyone following it makes the same trades. It names what is traded, the entry, the exit, the size and the schedule, and an honest description adds the costs and the yardstick. Four exact readings of one everyday sentence about SPY and its 50-day average returned between 13.9% and 23.1% over the same 22 months, which shows how much of a strategy lives in details an idea leaves out. Writing the rules down makes a strategy testable, easier to follow under stress and possible to judge afterwards. It does not make it right.

Check your understanding

4 questions on this lesson. Each answer comes with the reason, and nothing is scored.

  1. Which of these is a strategy and not just an idea?

    1. Buy quality companies when they are cheap
    2. At each Friday close, hold SPY if its close is above its 50-day average, otherwise hold cash
    3. Cut losses short and let profits run
    Show the answer

    B. At each Friday close, hold SPY if its close is above its 50-day average, otherwise hold cash Only the second can be handed to a stranger who would then make exactly the same trades. The other two leave "quality", "cheap", "short" and "run" for the trader to decide each time.

  2. Four exact readings of "own SPY above its 50-day average" returned between 13.9% and 23.1% over the same 22 months. What does that show?

    1. The weekly reading is the correct one to use
    2. The sentence was several strategies, and details such as the schedule change the result
    3. Moving average rules do not work
    Show the answer

    B. The sentence was several strategies, and details such as the schedule change the result The sentence left the schedule and the meaning of "above" open, and each way of closing the gap is a different strategy. Twenty-two months on one fund is far too short to say which is best.

  3. A strategy states what to buy and when to buy it. What is the most important thing still missing?

    1. A forecast of where the price will go
    2. When to get out and how much to hold
    3. A reason the entry will work
    Show the answer

    B. When to get out and how much to hold The exit and the position size are parts of every strategy and shape the result as much as the entry. Without them the rule cannot produce a list of trades, so it cannot be tested.

  4. The daily-check rule lost money on 13 of its 17 trades and still gained 13.9%. How?

    1. The losses were about 1% each and one long trade gained 19%
    2. Trading costs were refunded on losing trades
    3. The test left out the losing trades
    Show the answer

    A. The losses were about 1% each and one long trade gained 19% A strategy is judged by the sizes of its gains and losses together with how often each happens. Many small losses and one large gain is the usual shape of a trend rule.

Exercise

One task to do in Finabase. Nothing is graded or saved.

Open the two-year SPY chart with the 50-day SMA. Find every place where the price crossed below the line and came back above it within a day or two, and count them. Then ask: would the "checked every day" reading and the "two closes in a row" reading of "own SPY while it is above its 50-day average" have traded at each of those spots?

Open the SPY chart with the 50-day SMA
What you should find

The daily reading sells and buys back at every one of those short crossings. The two-closes reading skips any dip that lasted a single close, and a weekly check skips most of them. Same sentence, same chart, different trade lists: the sentence stays an idea until the schedule and the confirmation are written down.

Sources and further reading

  1. Robert Pardo, The Evaluation and Optimization of Trading Strategies, 2nd ed. (Wiley, 2008) — what makes a strategy testable
  2. Mebane T. Faber, “A Quantitative Approach to Tactical Asset Allocation,” Journal of Wealth Management (Spring 2007) — an example of a fully stated rule
  3. State Street — SPDR S&P 500 ETF Trust (SPY), fund page: inception January 22, 1993
  4. Finabase chart data — SPY daily bars, November 18, 2024 to November 17, 2026; rules and results computed by Finabase