pftui: Paper Trading My Way to a System I Can't Beat

pftui: Paper Trading My Way to a System I Can't Beat

A few months back I wrote about pftui, the terminal analytics suite I have been building, and I made a point in that post of saying that the mechanical layer describes and never prescribes. I have since changed my mind on that. A very good description of the market is not much use if I still have to work out what to do about it on a bad morning, and that last step is the one where people (me included) tend to come unstuck.

So over the last week or so I took advantage of the backtesting suite inside pftui and fleshed it out into a full paper trading simulator, with the aim of ending up with one mechanical portfolio system that I would adopt and follow. I am now on the fourth version of it, which I have been calling v4, and after 25 rounds of testing I can’t beat it.

In this post I will walk through what I was trying to build, the tooling, and what came out of it, including the parts that did not go the way I expected.


The Goal

The portfolio is built from four assets: Bitcoin, the S&P 500, the Nasdaq 100 and Gold, with the rest in Dollars. What I wanted was a set of rules for those four that answered two separate questions.

The first is a per asset one: should I be holding this right now, yes or no? I think of that as the Trading System. The second is about the whole portfolio: how much of each, and where does the money go when something gets sold? That is the Rebalancing System. Keeping those two apart turned out to matter a great deal, because a lot of things that look like clever portfolio management are one of them leaking into the other.

I also set one hard constraint before looking at any results, which was that the whole portfolio should never fall more than 25% from a previous high. Within that, I wanted the most return per unit of drawdown, which the quants call the Calmar ratio.


The Tooling

pftui already had most of the raw ingredients in Rust: years of daily prices for every asset I track, a signal engine that sweeps indicators across timeframes, and a native port of my own TradingView indicator, which among other things computes CyberBands. CyberBands is a Gaussian smoothed price channel, and it flips bullish when price closes above the upper band and bearish when it closes below the lower one.

For the experiments themselves I built a separate lab in Python that sits outside the Rust codebase on purpose. It reads prices and indicator states out of pftui read only, and it paper trades a whole portfolio through history one day at a time. The idea was that I could try twenty bad ideas in an afternoon without touching the real thing, and then only port a system into pftui once it had earned its place.

The rules of the simulator are about as boring as I could make them:

  • A decision made at one daily close gets filled at the next close, so no rule ever trades on a price it could not have seen.
  • Every trade in Bitcoin and equities costs 0.15%.
  • Idle Dollars earn the T-bill rate.
  • Every indicator only uses data up to the day it is computed on, and there is a unit test that fails if one ever peeks ahead.

The other thing I got wrong at first and then fixed was the sampling. Running a system from 2015 to today and admiring the line tells you very little, so every test ended up being run across several start dates, then across separate non-overlapping blocks of years, and then across hundreds of random windows between one and ten years long. For the equity rules I also went back to 1973, which is 53 years that had no say in choosing them.

Once v4 was adopted it got ported back into pftui properly, so pftui portfolio system status now prints a label against each holding (hold, sell all, buy to target, watch) along with the price level that would change it, so the machine does prescribe now, and I have made my peace with that.


Bitcoin

This is the asset where timing earns its keep. I tested nine rules on Bitcoin alone first, and then swept 581 of them for the Bitcoin position inside the portfolio: simple and exponential moving averages from 10 to 300 days, crossovers, Bollinger Bands in four flavours and CyberBands on slower bars, each with and without a filter on the way back in. Separate rounds covered monthly RSI rules, trailing stops and CyberBands on everything from 1 hour to weekly candles.

The winner was daily CyberBands for the exit, paired with a 200 day SMA filter on the way back in. You sell everything when daily CyberBands flips bearish, and you only buy back when it is bullish and Bitcoin has put in two daily closes above its 200 day.

On Bitcoin alone since 2015 that rule compounded at 71.6% a year with a worst drawdown of 48%, against 55.3% and 83% for buying and holding. It does not win every year though! Holding beat it in six of the twelve years, and they were all the big up years, where the rule captured roughly half the move. Where it makes its money is in 2018, 2022 and this year, when it sat roughly flat while holding lost between a third and three quarters. Compounded over the whole period that is 716x against 184x.

The interesting discovery was that the entry filter does most of the work. Daily CyberBands on its own scores 1.30 on Calmar inside the portfolio, and adding “only buy back above the 200 day” takes it to 2.19, because it stops you buying every bear market rally on the way down.

I should be straight about how strong this result is. Out of 581 rules, five others score about the same as mine once you test them on separate periods, and they are all the same shape, a fast exit with a slow moving average guarding the re-entry. Bitcoin has one twelve year history, so I can’t tell those five apart from v4 and I am not going to pretend I can. What I can say is that nothing came out ahead, and that faster is worse: CyberBands on 4 hour candles trades thirty times a year and scores less than half what the daily does.


Equities and Gold

This is the part that surprised me, and I went back and checked it several times because I did not believe it.

Nothing I tested beats buying and holding the S&P 500, the Nasdaq 100 or Gold on return, and that includes the 200 day, CyberBands, Bollinger Bands, dip buying on RSI and “sell in May”. The only things that did were versions that borrow money to hold more than 100% while the trend is up, and those fall as far as holding does or further.

What the rules do buy you is a smaller drawdown. Selling on two daily closes below the 200 day SMA and buying back on two closes above it looks like this since 1973:

Buy and hold200 day rule
S&P 500, return a year10.8%9.5%
S&P 500, worst drawdown55%33%
Nasdaq 100, return a year12.1%11.6%
Nasdaq 100, worst drawdown83%48%

So over the full 53 years you give up somewhere between half a point and a point and a half a year, and in exchange you sit out most of 2000 to 2002 and 2008. The panels above use random windows since 1997, where the gap is wider at three to four points a year. Whether that is a good trade depends on whether you would have held through an 83% drawdown in the Nasdaq. I know myself well enough to say that I would not have.

Gold was the cleanest result of the lot. Every timing rule I tried made it worse, so v4 holds it and leaves it alone.

I also tried selling below one average and buying back above a faster one (sell on losing the 200 day, buy back on reclaiming the 100 day), across 42 different pairs. Each period of history preferred a different pair, which is a polite way of saying it is noise.


The Portfolio

Put the trading systems together and you get this, for one paper portfolio started in January 2015 with 20% in each of the five.

Buying and holding the mix ends about three times higher than v4, because it drifts into being mostly Bitcoin, and it falls 77% along the way. v4 compounds at 22.5% a year with a worst drawdown of 11%. Rebalancing the same mix every quarter does 24.3% with a worst drawdown of 32%.

Plenty of things on that chart return more than v4, and what v4 has over all of them is the return per unit of drawdown. Over 1973 to 2026 without Bitcoin the same rules returned 9.8% a year with a worst drawdown of 21.5%, against 10.3% and 66% for holding.

The test I trust most is the random windows one, where you start in cash on a random day, follow the rules, and stop between one and four years later.

The median outcome for v4 and for holding is the same, 28% a year. What changes is the spread. The bad case (one window in ten) is 15% a year for v4 against 8% for holding, the good case is 45% against 80%, and v4 lost money in 1% of windows against 6%. You are trading away the best outcomes to get rid of the worst ones.


Rebalancing

With the trading systems fixed, I then ran 432 different Rebalancing Systems over the top of them. DCA schemes, monthly RSI timing, target allocations with quarterly rebalancing, momentum rotation, inverse volatility weighting, volatility targeting, and several ways of moving the money from a sold asset into the ones still standing.

None of them beat the dumbest option, which is that when an asset gets sold the money sits in Dollars until that same asset says buy again. Moving it into the survivors adds about a point a year in the Bitcoin era and loses over the longer history. The momentum and volatility schemes were the worst, because they keep Bitcoin small for being volatile, and Bitcoin is where the return came from.

The one setting that did move things was trimming. Never trimming a winner adds about four and a half points a year with Bitcoin in the portfolio and pushes the worst drawdown from 11% to 16%, which sounds like a fine deal until you run it from 1973 and watch Gold swell to most of the portfolio just in time for 1980.


How Much Bitcoin?

The last thing I looked at is the one I find most interesting, which is what a bigger drawdown buys you.

The cheapest way to take more risk in this portfolio is to hold more Bitcoin under the same exit rules. At 25% the portfolio does 22.5% a year with an 11% worst drawdown. At 40% it is 28.4% and 19.5%, at 50% it is 32.1% and 24.8%, and at 60 to 70% you are up around 40% a year with drawdowns of 30 to 35%. So if you can stomach a 35 to 40% drawdown in the whole portfolio, a Bitcoin heavy version of v4 has paid more than the cautious one.

There is a catch, and it is a big one. Nearly all of that advantage comes from before 2022. Since then, doubling the Bitcoin weight from 25% to 50% has added under five points a year, and in 2025 and 2026 it has added nothing at all, which you can see in the year by year table. The whole case rests on one asset repeating its own past, and there is no earlier history to check it against.

v4 as written uses 25%, and I have not talked myself into changing it yet…


v4

For anybody who wants the rules without the journey:

  • Bitcoin, 25% target. Sell everything when daily CyberBands flips bearish. Buy back when it is bullish and Bitcoin has two daily closes above its 200 day SMA.
  • S&P 500 and Nasdaq 100, split equally. Sell after two daily closes below the 200 day SMA, buy back after two closes above it.
  • Gold. Hold it, don’t time it.
  • Dollars, never less than 20%. Money from a sale waits in Dollars for that same asset to come back.

I have written up the full results in a report, with the method, every table, and the places where v4 loses, which you can read over on pftui.com.

None of this is advice, it is a backtest of my own rules against history, with no taxes in it and an assumption that I do what the system says at the next close. That last assumption is the one I am least sure of…


If you made it this far then thank you for reading!

Skylar