Experiment 001 · Adaptive Bandit
Explore, Exploit, Invest
Can a simple learning rule beat buy-and-hold? This frozen backtest compares a weekly adaptive strategy with ten single-stock investments and a simple portfolio that starts equally across all ten, then does nothing.
One-year backtest
Can recent winners keep winning?
Each line starts with $1,000. Ten buy one stock, one splits the money equally and never trades, and the adaptive portfolio learns and reallocates every week.
Comparing the adaptive strategy with the equal-weight benchmark…
Explore ↔ exploit
Where the adaptive dollar went
Every vertical slice totals 100%. Wider bands represent larger allocations.
Final snapshot allocation
Where the adaptive model finished
Loading the final weekly decision…
Uses adjusted prices, fractional shares, and weekly close-to-close signals. Assumes rebalancing at the weekly closing price with no fees, taxes, spread, or slippage. This experiment is for education and is not investment advice.
the short version
Findings and Next Steps
A small adaptive edge
The bandit finished at $1,354.06 versus $1,332.09 for the untouched equal-weight portfolio. Reallocating added $21.97, or 2.20 percentage points, in this one-year window.
It did not find the best stocks
Several single-stock holds finished well ahead of the bandit. The strategy reduced concentration risk, but this result is not evidence that it can reliably identify winners.
The benchmark changes the story
Beating an equal ten-stock hold is more informative than beating a few hand-picked stocks, but the edge is small enough that realistic trading costs and timing could erase it.
What I would try next
- Execute at the next tradable price and include spread, taxes, and slippage.
- Repeat the test across many non-overlapping one-year periods.
- Compare weekly adaptation with a periodically rebalanced equal-weight portfolio.
the rule, without the jargon
How the adaptive strategy learns
The model is intentionally small enough to inspect. It never predicts a price; it only changes how much capital each stock receives based on recent evidence.
- 01
Begin equally
The first $1,000 is split ten ways, with 10% in each company across ten different parts of the economy.
- 02
Observe one week
After the final trading session of the week, the model measures each stock’s adjusted close-to-close return.
- 03
Update the score
Each score is 50% its previous value and 50% the newest weekly return. That remembers momentum without letting one week erase the past.
- 04
Exploit, but keep exploring
Higher scores receive more money the following week. Every stock keeps at least 3%, and no stock can exceed 30%.
Decision log
Recent weekly allocations
Weights shown are the allocations selected after that week’s returns.
| Week ending | Portfolio | Largest allocation | Weekly winner | Turnover |
|---|---|---|---|---|
| Loading weekly decisions… | ||||
for those who want the symbols
The Math Zone
Everything the model does can be written in six equations. Let i identify one of the ten stocks, w a trading week, and t a trading day.
Buy-and-hold values
The single-stock lines put all $1,000 into one company. The equal-weight benchmark puts $100 into each company on day zero and never rebalances.
Weekly return
The reward is simply that stock’s adjusted percentage gain or loss during the week.
Learned score
Half of the score comes from accumulated memory and half from the newest observation.
Softmax preference
With temperature τ = 0.04, stronger scores receive exponentially more preference without becoming an automatic all-in bet.
Mixed target weight
We set γ = 0.30. Thirty percent is spread equally, guaranteeing a 3% exploratory position in every stock.
Portfolio update
Any position above 30% is capped and its excess redistributed. Portfolio value is the sum of shares times adjusted prices.
