Tutorial: build and improve a strategy
This tutorial builds one strategy from scratch, in six chat messages, the way you would do it yourself. We start with a simple idea, test it, try a change that turns out worse, give the strategy a crash switch and a defense, ask the builder why it works, and finally add leverage. Every screenshot comes from that real build.
Along the way you will learn the habit that matters most: after every message, look at the result before you send the next one. The builder is fast and confident, so the checking is your job.
You need nothing to follow along: no account and no key. You can sign up when you want to save. Allow about half an hour.
The idea
Momentum investing rests on a simple observation: assets that have risen over the past months tend to keep rising for a while longer. A momentum strategy ranks a list of assets by how much they rose, holds the leaders, and checks again every month.
We give the strategy nine ETFs to choose from, a mix of stocks, gold, commodities and bonds:
| Ticker | What it holds |
|---|---|
| SPY | US stocks (S&P 500) |
| QQQ | US technology stocks (Nasdaq 100) |
| EFA | Stocks in developed markets outside the US |
| VWO | Stocks in emerging markets |
| GLD | Gold |
| DBC | Commodities |
| IEF | US Treasury bonds, 7 to 10 years |
| TLT | US Treasury bonds, 20+ years |
| SHY | US Treasury bonds, 1 to 3 years, close to cash |
When stocks are strong, the leaders are stock funds. When stocks fall, gold, bonds or commodities usually rise to the top, so the strategy moves there on its own.
Step 1: describe the first version
Open Create strategy in the sidebar. On the left is the chat, on the right the result will appear. The connection button beside Send shows Demo with free credits, so you can start right away.
Type the idea in the box and press Send. Be specific: name the tickers, the signal and how many to hold.
Each month, rank SPY, QQQ, EFA, VWO, GLD, DBC, IEF, TLT and SHY by their 12-month momentum and hold the top 3 in equal weight.
After a short wait the builder answers in one or two sentences, and the result appears on the right. The line above the answer (Show 4 steps) is the activity log: what the builder did, such as writing the code and running the backtest. Click it if something went wrong.
Read the result
The result has the same cards as every strategy page. Start with these three.
Current Allocation shows what the strategy holds right now and how each holding has done since it was bought. Switch on Allocation at the top of the card to add one more line: the strategy's own backtest return, monthly rebalances included, so you also see how the strategy itself has done over that period.
Allocation History shows what it held over time. Each bar is a period a ticker was held. Look for a pattern that makes sense: here the strategy rotates between stock funds, gold and commodities, and holds each for months.
Backtest shows how $10,000 would have grown, compared with SPY.
The first version grew about 11.3% a year, the same as SPY, with a worst fall of 25.4% against SPY's 55.2%. That is the promise of momentum: similar growth with much smaller crashes, because the strategy leaves stocks when they fall. The backtest starts in 2002 because one of the funds (EFA) only has data from late 2001, and a 12-month signal needs a year of history.
Save early
Press Save now, even though we will keep improving. A saved version is your safety net: from now on, every change you try is automatically compared with it, so you can see at a glance whether the change helped.
Saving re-runs the strategy on the server and opens its own page. Read the Decision Rules there. They are the builder's own summary of what the code does, and the best place to catch a misunderstanding.
To keep improving, press Refine at the top of the strategy page. The chat reopens where you left off.
Step 2: try a change that turns out worse
A natural question: if the top 3 do well, would the single strongest fund do even better? Let us try.
Try holding only the single strongest fund instead of the top 3.
The Backtest now has a Saved version line: the version you saved in step 1. Compare the two.
The single-fund version earned 10.1% a year against the saved version's 11.3%, and its worst fall more than doubled: 51.3% against 25.4%, almost as deep as SPY's own crash. The rolling edge under the chart shows it trailing the saved version for most of the history, from around 2008 until 2021, and only pulling ahead in recent years. Betting everything on one fund means every wrong pick hits the whole portfolio.
This is the most useful thing the builder does: it lets you find out cheaply that an idea does not work. We do not save this one. Instead we tell the builder to go back and try something else.
Step 3: let several lookbacks vote
Back to three funds, but with a better signal. Twelve months is slow to notice a change, a single short lookback is noisy. Instead of choosing, we let four lookbacks vote: 1, 3, 6 and 12 months each pick their top 3, and we hold the 3 tickers with the most votes.
That earns less and falls much harder, so go back to the top 3. Then let the 1, 3, 6 and 12-month momentum each vote for their top 3 tickers, and hold the 3 tickers with the most votes in equal weight.
This one is better on both counts: 13.5% a year against 11.3%, and a worst fall of 20.6% against 25.4%. Combining fast and slow signals keeps the slow signal's steadiness and still reacts sooner when a trend breaks.
Save it: the new version becomes the one later changes are compared with. Then read the Decision Rules:
The last rule says ties are broken by 12-month momentum. We did not ask for that, but a vote can end in a tie, so the builder decided for us. Here the choice is sensible. It is still worth knowing that the builder fills such gaps on its own, and the rules are where you see it.
Step 4: add a crash switch and a defense
So far the strategy picks from all nine funds, bonds included, and it is always invested in the top 3. It has no notion of "the market is in trouble". Many tactical strategies solve this with a canary: an asset the strategy never buys, but watches. When the canary weakens, the strategy switches from offense to defense.
We use TIP, a fund of inflation-protected US Treasury bonds, as the canary, the same one Keller and Keuning use in Hybrid Asset Allocation. And we separate the roles: stocks, gold and commodities form the offense and vote as before; the three bond funds form the defense. In defense, the strategy holds the single strongest bond fund.
Split the funds into offense and defense, with TIP as a canary. Only SPY, QQQ, EFA, VWO, GLD and DBC take part in the vote. If the average of TIP's 1, 3, 6 and 12-month momentum is positive, hold the 3 offensive funds with the most votes. If it is zero or negative, put everything in whichever of SHY, IEF and TLT has the highest average of its 1, 3, 6 and 12-month momentum.
A clear step up in return: 15.7% a year against 13.5%, with a better ratio of return to risk (Sharpe 1.12 against 1.01). The price is a deeper worst fall: 23.2% against 20.6%. No single signal catches every crash, and a strategy that leans on one canary inherits its misses.
The rolling edge under the chart, set to 3Y against the saved version, shows the same thing over time: the canary version was ahead in most periods, behind around 2014 to 2016 and again in the most recent years. A higher total does not mean ahead every year.
Allocation History now groups the funds into offense and defense. In the last year the canary switched to defense twice, both times briefly and into SHY, the strongest bond fund at the time. Switch on Signal to see TIP itself, which is watched but never held.
We keep it. Save it and read the rules:
Ask the builder
The chat is not only for changes. You can ask about the strategy and get an explanation, without changing anything. A good question before you trust a rule: why should it work?
Why TIP? What does TIP's momentum tell us about stocks?
The answer explains the idea: TIP does not forecast stocks. Its trend tends to turn down early when real interest rates rise and financial conditions tighten, the kind of climate that hurts stocks and commodities too. It is also honest about the limits: the canary is a rule of thumb, not a causal link, and its value is that a calm bond fund flips between offense and defense less often than a stock index would. One detail is wrong, though: it credits the "Vigilant Asset Allocation" family, while the TIP canary comes from Hybrid Asset Allocation, as we said above. The builder can be confidently wrong on facts like this, so read answers like this critically before you put money behind a rule.
Step 5: try leverage
The offense holds stock and gold funds most of the time. What if it held their 2× versions, which move twice as much each day? We swap the five offensive funds that have a 2× version and keep commodities, the canary and the defense as they are. The votes stay on the regular funds: we only buy the 2× version of each winner.
Now hold the 2x leveraged funds in the offense: SSO instead of SPY, QLD instead of QQQ, EFO instead of EFA, EET instead of VWO and UGL instead of GLD. Keep counting the votes on SPY, QQQ, EFA, VWO and GLD, and only buy the 2x version of each winner. Keep DBC, the canary TIP and the defensive funds SHY, IEF and TLT as they are.
The return jumps from 15.2% to 24.6% a year. The worst fall jumps too, from 23.2% to 43.0%. (The saved step-4 version shows 15.2% here, against 15.7% in its preview: saving re-runs the strategy on the server, and the numbers can shift a little.) That is the trade leverage always offers. At its worst moment, this version lost more than 40% of its value, which is a lot to sit through in real life.
Before you trust these numbers, read Synthetic history: most 2× funds launched between 2006 and 2010, so the early years of this backtest are simulated. And read Leveraged funds: a 2× fund doubles each daily move, not the yearly return.
Save it and read the rules once more. Two things to check. First, the canary and the defense from step 4 are still there: a change should never quietly drop an earlier rule. Second, which funds the votes are counted on. Rule 2 shows the builder did what we asked: it measures momentum on the regular funds (SPY, QQQ and so on) and only puts the money into the 2× versions. Without that sentence in the message, the builder measures momentum on the 2× funds themselves, which is a different strategy. So say which one you mean, and check that you got it.
Step 6: check the timing, then follow it
Switch the Backtest from Benchmarks to Timing. It answers a different question: did the switching add anything, compared with holding the same funds without timing?
The verdict: "Timing added +11.6% a year and cut the worst drawdown from 63% to 43%", compared with holding the same funds in fixed proportions (Average holdings). Average holdings is built with hindsight, so it is a yardstick, not a strategy you could have followed.
Because the strategy has an offense and a defense, the Sleeves table shows each part separately. Both earn their keep: the offense's picking added 7.6 points a year over holding its funds without timing, and choosing the strongest bond fund added 3.4 over holding all three. The offense was active 76% of the time, the defense 24%.
If you want to follow the strategy, press Subscribe. You get an email the night after a month-end when the allocation changes, with the funds the strategy holds, here the 2× funds. See Subscribing to emails.
Publish makes it viewable by anyone with the link, and freezes it for good. See Saving, versions and sharing.
You do not have to build it yourself to follow it: the finished strategy is also one of the built-in strategies, Tutorial: Canary Momentum Voting.
What we learned
- One change per message. Then the comparison with the saved version tells you exactly what that change did.
- Save the versions you keep, not every trial. The last saved version is what every new result is compared with.
- A worse result is a result. Holding a single fund took one message to rule out.
- Read the Decision Rules after every save. The builder fills gaps on its own, like the tie-break in step 3. Check the details that matter, like which funds the votes are counted on in step 5.
- Ask why a rule should work, and check the answer. One question explained the canary and changed nothing, but it also got a source wrong.
- Look past the totals. The rolling edge showed the canary version behind in some years despite the higher total.
- Higher returns come with deeper falls. Leverage nearly doubled the worst drawdown here, and part of its history is simulated.
- Check the timing, part by part. The Timing Check shows whether the switching earns its keep, and the sleeves show which part does.
























