Explore more topics
All of them together

How to build a trading strategy that combines several kinds of data

Build a strategy that combines several kinds of data step by step, worked through a real backtest against SPY: Cash generators in uptrends, gated by unemployment.

Jump to a section

Cash generators in uptrends, gated by unemployment

Value (%)

Cash generators in uptrends, gated by unemployment against SPY, percent from the first day, Oct 2021 – Sep 202690.5%-16.9%2021-10-012026-09-30
Strategy 2026-09-30
41.23%
SPY 2026-09-30
88.51%
StrategySPYHistorical simulation
Test window
Oct 2021 – Sep 2026
Starting balance
$100,000
Fee per trade
0.1%
Benchmark
SPY

This is the result. The four steps below show how the strategy was built and tested.

1. Describe the idea to Aurora

A prompt like this one describes the strategy in plain English.

“Build a portfolio that follows these rules. Universe: the S&P 500. Keep stocks with positive free cash flow that trade above their 200-day average. Buy the 20 with the best six-month return, equally weighted, on the first trading day of each month. Move to SHY (1-3 year Treasuries) while the unemployment rate is above its one-year average. Backtest it between Oct 1, 2021 and Sep 30, 2026 with $100,000 to start, a 0.1% fee on each trade, SPY as the benchmark.”

2. Check the rules Aurora writes

These are the exact rules the backtest ran.

  1. Rule 1

    Universe: the S&P 500.

  2. Rule 2

    Keep stocks with positive free cash flow that trade above their 200-day average.

  3. Rule 3

    Buy the 20 with the best six-month return, equally weighted, on the first trading day of each month.

  4. Rule 4

    Move to SHY (1-3 year Treasuries) while the unemployment rate is above its one-year average.

3. Backtest it against SPY after fees

It held 224 different stocks and moved to Treasuries whenever unemployment rose above its one-year average.

Strategy return
+41.2%
SPY return
+88.5%
Largest fall
−22.7%
Sharpe ratio
0.45
Closed trades
901
Fees paid
$5,908

4. Test it on dates it never saw

Next, run a walk-forward test, which freezes the rules and checks them on later dates they never saw. See a walk-forward test on unseen dates

The results describe historical observations. They do not establish live trading performance.

Continue exploring