# How Tactfolio works

> What a strategy and a backtest are, how people use Tactfolio, what you can do today, and what Tactfolio is not.

Most people who invest on their own already follow a rule, even if it only
lives in their head: "buy the index and never sell", "move to bonds when things
look bad", "hold whatever has been doing best". Tactfolio lets you write that
rule down exactly, replay it on decades of real prices, and see what it would
have asked of you along the way.

## What a strategy looks like

Here is a complete strategy. It is Mebane Faber's timing rule from 2007, one of
the [classic strategies](https://tactfolio.com/strategies/classics.md) you can open and copy:

Strategy "Faber S&P 500 Timing", which runs monthly and rebalances every run:

- Weight: Equal
  - If: current price of SPY is above 10-month moving average of month-end closes of SPY
    - Then:
      - Weight: Equal
        - **SPY**
    - Otherwise:
      - Weight: Equal
        - **BIL**

Read it from the top. Money enters at the strategy and flows down. At the end
of every month, the **If** block asks one question: is SPY, a fund that tracks
the S&P 500, trading above its average price over the last ten months? If it
is, the money goes to the first branch and holds SPY. If not, it goes to the
**Else** branch and holds BIL, a fund of short-term Treasury bills that behaves
like cash earning interest.

That's the whole idea of Tactfolio: a strategy is a small tree of blocks that
decides what you hold. Four blocks cover most ideas:

- **Tickers** are what you can hold: US-listed funds and stocks, such as SPY
  or IEF, a fund of US Treasury bonds.
- **Weight** blocks split money between the blocks inside them, equally, by
  percentages you choose, or by risk.
- **If / Else** blocks check a condition and send the money one way or the
  other.
- **Rank** blocks score a list of candidates, such as by their return over the
  last three months, and keep the best few.

The [builder guide](https://tactfolio.com/docs/builder.md) covers every block, and
[common patterns](https://tactfolio.com/docs/patterns.md) shows how the classic ideas are built from
them.

## What a backtest tells you

A backtest replays your rules over past prices as if you had followed them.
Each time a strategy runs, Tactfolio reads the rules at the day's closing price,
trades at that close, and charges a small cost on every trade. You see how $1
would have grown, the deepest fall along the way, what the strategy held and
when, and what it would hold today, all next to a benchmark you choose.

It also shows you where to be suspicious. A second line trades the same rules
at the next morning's open, and a **Reality checks** table repeats the trades
at higher costs and compares you with the benchmark at your level of risk.
[What a backtest simulates](https://tactfolio.com/docs/backtests.md) lists every assumption.

A backtest can't tell you what happens next. Rules that look good on the past
usually do worse afterwards, and it's easy to fool yourself.
[Why past results mislead](https://tactfolio.com/docs/concepts/why-past-results-mislead.md) explains
how, and what to do about it.

## How people use it

1. **Start from something that exists.** Open one of the four starter
   patterns in the [builder](https://tactfolio.com/builder), a classic from the
   [library](https://tactfolio.com/strategies/classics.md), or someone else's published strategy
   from [Discover](https://tactfolio.com/strategies).
2. **Change one thing and watch.** The backtest reruns as you edit, so you
   learn what each rule does by moving it.
3. **Try to break it.** Test a different decade, raise the costs, switch on
   simulated history to reach back before a fund existed, and see whether the
   idea survives.
4. **Save as you go.** Every save is kept as a revision you can go back to,
   so nothing you tried is lost.
5. **Share it, if you like.** Publishing gives your strategy a public page with
   its rules and results, and a place in Discover. It's optional; private
   strategies stay private.

You can also hand the building to an AI assistant: describe a rule in a
sentence, and it builds the tree, runs the backtests, and saves a draft for
you to check. See [Use Tactfolio from your AI assistant](https://tactfolio.com/docs/mcp.md).

## What you can do today

Without an account:

- Explore the four starter patterns and their last ten years in the
  [builder](https://tactfolio.com/builder).
- Read the classic strategies, each with its sources, rules, and daily-updated
  results.
- Browse everyone's published strategies in [Discover](https://tactfolio.com/strategies), and open
  any strategy's page
  to see its rules and backtest.

With a free account:

- Build, backtest, and save your own strategies, and find them in your
  [workspace](https://tactfolio.com/workspace).
- Copy any public strategy and change it, or use it as a building block in
  your own.
- Publish, star strategies you like, and follow authors.
- Connect an AI assistant to your account.
- Trade a strategy in [Trade](https://tactfolio.com/trade), on paper or in your own Alpaca account.

Everything is free while we build.

## What Tactfolio is not

- **Not advice.** Tactfolio doesn't tell you what to buy. Everything it shows
  comes from rules that you, your assistant, or another author wrote.
- **Not a broker.** Trade runs your strategy on paper, with pretend money at
  real market prices, or in your own Alpaca account with your own API keys.
  Your money stays with Alpaca.
- **Long only.** A strategy holds funds, stocks, or cash. It can't sell short
  or borrow. Leveraged and inverse funds can be held like any other fund.

## Where to start

- [Your first strategy](https://tactfolio.com/docs/getting-started.md): open a pattern, change one
  thing, and save your own copy, in about ten minutes.
- [Rules-based allocation](https://tactfolio.com/docs/concepts/rules-based-allocation.md): why people
  write their rules down, if the idea is new to you.
- [Glossary](https://tactfolio.com/docs/glossary.md): every term these docs use, in plain words.

## Learn the ideas behind it

- [Learn](https://tactfolio.com/learn.md): Plain-English guides to investing and trading: S&P 500 funds, ETFs, IRAs and 401(k)s, momentum, options basics and more, with examples and sources.
- [Trading tools](https://tactfolio.com/trading-tools.md): Free trading calculators for pips, margin, leverage, position size, dividends, CAGR, options and Monte Carlo, plus portfolio research on real prices.
