Friday, 27 November 2026

Introducing True Backtesting

How should you backtest a new trading strategy idea?

Yeah, yeah. I hear you say. I know how to do this. I've read all your books mate. Twice. And everything on the blog. I need to use data that doesn't look forward. I need to avoid survivorship bias. I should use a backward looking expanding or rolling window. I need to use robust fitting methods, like those you have elucidated in recent blogposts. Then I need to be sure that the improvement is statistically significant. If all that works out, I'll add the idea to my portfolio. Otherwise I'll kill the idea.

Not bad. It's certainly better than what most people do.

But in fact that backtesting process will still lead you open to two kinds of in sample fitting. I discussed the three kinds here but briefly:

  • Explicit: Optimising parameters using in sample data
  • Implicit: Making decisions based on in sample results, but not formal optimisation
  • Tacit: Only trying ideas you already know will work
We're not doing explicit fitting here, but we're still doing the other two kinds:
  • The original idea may have been developed using forward looking information; books, academic research, market folkore, or in the current climate an LLM trained on data up until quite recently. This is tacit fitting.
  • We kill poorly performing ideas or select the best idea from multiple options. We do this once we've seen the backtest results. This is implicit fitting.

How do we get round this? The two big ideas I propose in this blog are:

  • Backtests should be symmetric. We consider both the positive and the negative version of a trading strategy when optimising. That way we avoid tacit fitting as much as possible. As a handy side-effect, we also remove an arbitrary restriction on the degrees of freedom when fitting that may result in better out of sample performance.
  • Backtests should be write only. You can add new ideas, but once they are in the backtest they stay there. There is no killing of bad ideas. There are no bad ideas! A really bad idea would be negative-d and become a great idea (assuming it wasn't bad purely because of trading costs). A weak idea would end up with a low allocation, but because of robust fitting it's unlikely to be zero. An idea that does get a zero allocation by the end of the backtest would have a positive allocation earlier, thus ensuring performance results are honest.

Backtesting that is both write only and symmetric combined with robust out of sample fitting, can be considered to be True Backtesting. The true backtesting protocol substantially reduces tacit fitting and ensures there is no implicit or explicit fitting. It ensures we get realistic ideas of historic performance.  

I will incorporate these ideas into a python library I call Autofitter. 

This blogpost won't reveal all the various details of the true backtesting protocol. That would fill a book - and it will indeed fill my next book, once I start writing it. I'll also be keeping the source code of Autofitter private to future buyers of the book, although implementing these concepts isn't exactly hard (in any case the code is still in a fairly sketchy form!).


Programming notes: 

1 - The original subtitle I was going to use was "A Backtesting Protocol in the Era of Artifical Intelligence" a reference to this paper, which is probably one of the best finance papers ever written. Of course True Backtesting is relevant even if you don't use AI at all like me, but I think it's even more relevant in a world with AI.

2 - This is a standalone blogpost; but I will link to previous posts if you wish to explore the ideas further.

3 - This may well be the most important blogpost I write. I feel like I've cracked a problem I've been thinking about for 20 years. I know, I know. It probably won't live up to the hype, but read on anyway. 


Prior Art

I am pretty sure that True Backtesting is an original idea, although of course it builds on earlier work. I'm certainly not claiming to have invented robust out of sample portfolio optimisation!

The idea of recording every backtest done has been advocated before by, most famously by Lopez de Prado*. However this is done to ensure you can properly do a correction for the number of tests, and is quite different from the idea of maintaining a single backtest to which you only ever add ideas. The closest that comes to this idea is a relatively obscure masters thesis by Mads Hofstedt Jæger**. His work on pairs trading suggests tracking every pair of stocks ever considered: "The framework suggest to never remove a pair from the pool of pairs, inducing data to increase in time". Again this is pretty different from having a single backtest with all the strategies you've ever thought of; arguably it's just an extension of the idea of ensuring there is no survivorship bias.

The idea of testing both the long and short versions of a strategy isn't novel, and I believe was first developed by David Aronson***. However, David did this in a standard test-accept or kill framework which is then subject to multiple testing corrections.

In summary then I'm pretty sure this is an original idea.

* Frank Fabozzi and Marcos López de Prado (2018) Being Honest in Backtest Reporting: A Template for Disclosing Multiple Tests. JPM

*** David Aronson (2006) — Evidence-Based Technical Analysis


Backtesting done (relatively) badly

I'm going to start off running through an example of backtesting done in an old school way - not true backtesting; but also avoiding most of the common mistakes. I'll note where it's problematic in this font but not yet explain how to deal with those problems by using True Backtesting. That's the next bit.

Let's start with a simple model. We want to predict the price of the S&P 500 future, for which I have price data back to 1982. We'll assume the data is accurately timestamped and not subject to revisions, clearly the S&P 500 future is still around and it's the only instrument we have so survivorship bias isn't relevant. 

We could argue that selecting the very well performing S&P 500 is itself an in sample decision - but that discussion is for another blog post or possibly book chapter.

We'll do this in a normal Rob Carver way: by using a trading rule which calculates a forecast proportional to expected Sharpe Ratio, with an average absolute value of 10. Positions in the future can be long/short, can be leveraged, and will be inverse volatility scaled to hit an average absolute risk target (though our actual expected risk will vary depending on the forecast). 

How should we predict this price? 

Well Rob, I know how much you love trend following, how about an exponentially weighted moving average crossover with spans N and 4N? From 2,8 up to 64,256...?

Here is our first big mistake. We are tacit fitting. We are using information that would not have been available in 1982 to make a decision: the choice of EWMACN,4N. Choosing EWMAC to find trends is fine; pure theory or fake data can justify this. But you know trend following works with real data because you've seen my own backtests of trend following SP500; and also that I prefer the N,4N ratio although you probably can't articulate exactly why; again it's probably because it's empirically profitable.

Formally we are using prior knowledge to decide the universe of trading rule variations we are going to consider:

  • The bounds of the universe: we only consider trend following rules in the space of N between 4 and 64
  • The granularity of the parameter set (N=2,4,8... 64 rather than N=2,3,4.5...)
  • We've also imposed a constraint by using N,4N rather than generally X,Y

Note this would still be a problem if rather than me your source was the journal of finance, chatgpt or something your broker mate told you in the pub. 

Our next job is to work out what pairs of spans to use for our EWMAC (my name for these are variations). There are a few competing ways to do this. We can eithier:

  1. select the best unique variation
  2. select a combination of variation with some linear weighting (I call these weightings forecast weights)
  3. select a combination with non linear weightings 

We know from theory that ensembles outperform single variations out of sample, especially if you're concerned with the variation of possible outcomes, so that knocks out 1. 3 will involve an outrageous explosion in parameters and complexity, and in any case it's always possible to create non linear forecasting rules that can be combined linearly and get the same outcome (not that we are doing this here in this simple example!). So we stick with 2. There are two broadly competing technologies for fitting linear weights in quant finance:

  1. Linear regression
  2. Mean variance optimisation (MVO)

I'm going to use 2, entirely because I'm more familiar with it (1 is used mainly by equity neutral types and I don't get invited to the same parties as them). Of course there isn't a massive difference between these two techniques (see here) and it's just as possible to do robust regression (using eg ridge regression, lasso) as it is to do robust MVO (using eg bootstrapping, shrinkage).

Anyway, these are the candidates we have:

Of course we'd never do explicit in sample fitting and just pick the best of these (which is the slowest - there happens to be a perfect monotonic relationship between speed and performance here - not down to costs!). Nor would we do non robust fitting that would probably pick a sparse portfolio that will do badly out of sample (and with higher variance of expected outcomes). I'm also not a fan of single in sample / out of sample fits. I prefer a (long) rolling window where we re-estimate parameters each year based purely on past data, and test with those parameters for the following 12 months. This does the best job of simulating what we could actually have done in the past where we starting from scratch.

Let's do a robust 20 year rolling out of sample MVO that uses some shrinkage parameters: SR shrinkage 0.5, correlation 0.75 that I derived in my recent series on fitting (in fact, I use more conservative shrinkage if there is less data).

[Note: If you've been following my optimisation series you will know I usually advocate pooling (only one instrument here, so not relevant) and clustering (portfolio not big enough to justify it here so let's keep it simple)]

There is a debate to be had about where those parameters and the 20 year window come from and whether they are forward looking, but that will come later in the post.

OK let's look at the time varying forecast weights, fitted annually:

After an initial 'learning process' we do indeed stick to trading the three slowest and most profitable rules. Here is the gross and net p&l for the S&P 500 using those time varying forecast weights:

OK. We have a not bad at all strategy. We sit around and trade it for a while, and then think - let's add something else.

It's carry isn't it Rob. Trend and Carry. You love them, don't you. You really really love that combo.

We'll add.... carry. Unlike trend it's possible to specify a futures carry trading rule without almost no reference to empirical evidence. The only parameter in my carry rule we need is a smoothing parameter; which I'm going to set to 10 days (normally the fastest parameter I use). In my own actual strategy I use multiple parameters, but they are highly correlated. For simplicity let's pick just one. The details of my carry strategy can be found in my 4th book, and on the blog, so I won't go into detail.

Again, the choice of parameter smoothing 10 is arguably tacit in sample fitting. However it's less egregerious than the choice of N, 4N given the high correlation of different smoothed carry variations. 

Again I would never normally look at this before evaluating it, but here is the carry p&l:

[The 'hazy' early p&l is because there are gaps in the forecasts due to periods when contracts aren't priced at the same time - this is preliminary code and I need to add a forward fill somewhere to remove this effect. But it won't affect the results.]

Now there are many ways of evaluating the performance of this rule, but in the framework we're using here we're just going to add it to the existing machinery of forecast weight optimisation:

Carry in pink ends up with quite a big weight most of the time, due to it's diversification. However the astonishing post COVID drop in performance then reduces it's weight somewhat.
The above plot again shows the backtested performance with time varying forecast weights. Adding carry has made things worse. At this point the traditional backtesting decision would be to kill this new fangled 'carry' idea, and move on to the next one. Of course there are different ways this story can be told, with for example old school in sample/out of sample testing, sensitivity analysis, Whites Reality Check to correct for multiple tests.... however all these have the same ending. This is still a test-keep/kill process. 

Here is our second big mistake. We have implicit fitting. We are using information that would not have been available in 1982 to make a decision: to kill carry. That decision has been made using performance not available until 44 years after 1982. The fact the performance is derived using nice out of sample rolling fitting is irrelevant.

There is a more subtle, third mistake, that is evident in this particular test. The final weight for carry in the backtest is positive (and would be for almost any optimisation except one with inappropriately low SR shrinkage, or an inappropriately short rolling window). So we are ignoring the information given to us by the carefully calibrated robust fitting process and setting the weight of carry to an arbitrary value of zero. 

That won't always be true - sometimes the final weight to the new variation(s) will be zero anyway. In this case your final trading strategy will end up being the same with no carry actually surviving into your production system, but your past backtest results will still be inflated by future information.

There is one more criticism I need to make about one specific methodology in the classic test-keep/kill process, and that's the correction for multiple testing. As a slower trader many of the ideas I test will barely qualify for statistical significance. Raising that hurdle further will mean many perfectly good ideas get ignored. That isn't because multiple testing correction is a bad thing; it's definitely a good thing. But a cycle of trying many things and then throwing away the ones you don't like is inherently flawed.

True Backtesting

Now let's repeat the above cycle, but this time we're going to use True Backtesting. In an ideal world, we wouldn't have any pre concieved trading rules at all. Instead we'd have highly general rules that could exhibit almost any behaviour given a set of parameters. There are possible ways of this happening with e.g. genetic algorithims, but personally I find the loss of intuition and control of fitting process to be too scary. Thus we're going to have to start with a simple trading rule like EWMAC with a couple of parameters. This does require tacit knowledge, but as I will shortly explain the use of symmetrical backtesting will alleviate the effect of this knowledge on backtest performance.

However this time we won't specify the ratio N, 4N; instead we'll just use EWMAC X, Y. This still leaves us to set the bounds for X and Y, and the granularity within those bounds. We want to set these without using real data, or that would be implicit fitting. The information we require to set these bounds is:

  • Correlation - we want to reject highly correlated pairs like EWMAC22,44 and EWMAC23,44
  • Turnover - we want to reject pairs that trade too quickly for our instrument, and those with very slow turnover since (i) under the law of active management they will have very low profitability, (ii) it's unlikely we'll able to evaluate their performance with any statistical confidence.

We do not need, and should not use, performance statistics for these decisions. We can do this in three ways:

  • Using theory (not always possible, but if you assume a random walk you can certainly do this with EWMAC)
  • Using 'fake data' as discussed here
  • Using a small amount of real data from the start of the backtest. Since we use the first year of data to calculate the initial forecast weights, this period could also be used to calibrate rules. I call this the burn in period. When evaluating performance it should be excluded from the backtest.

Other approaches I have used in the past include using a longer sample of a single instrument for calibration. Again, this is not in the spirit of True Backtesting where we try and avoid using any forward looking information at all costs.

Using a combination of theory and fake data, I set the possible values for both X and Y as follows: 2, 4, 8, 16, 32, 64, 128, 256. That's a series of doubling values, since that gives approximately constantly spaced correlations between adjacent values (we can show this with theory, but fake or burn in data will give similar results). SP500 is cheap, so we can use small values of X and Y. Anything above 64 leads to turnover that is too slow (I used fake data to find this result; again burn in data will also do, whilst theory requires too many  price structure parameters to be calibrated).

I'm also going to constraint Y>X. This means we only consider trend following rules. If I took away this constraint I could also test the opposite: mean reversion (If you take EWMACX,Y and reverse it, you have EWMACY,X. So reversing is equivalent to swapping the parameters round which is possible without the Y>X constraint). However I'm going to use the more general method of symmetric backtesting to test out mean reversion strategies, since this option of using the parameters to generate a negative variation isn't always possible (not with carry for example).

This gives us 28 possible pairs of X and Y. I won't plot their performance, since it's a mess - a graph that's mostly legend. But here's the SR for each variation over the full sample:

Slower variations do seem better. Again we're looking for a linear combination of these, and again I do a robust N year rolling out of sample MVO that uses some shrinkage parameters. We have to make a slight compromise here. We both know that the values I use for N and shrinkage were based on looking at future data in my blogpost series. Arguably, an extremely pure true backtesting would simultaenously consider different optimisation parameters (and possibly even optimisation methods!) and select amongst those on a pure out of sample basis, using the current optimal parameter set for each annual fit (which to be fair, is what Pedersen et all did in the EPO paper). 

I already know however that there isn't much to choose between vaguely sensible levels of shrinkage. It is also possible with a combination of crude heuristics and theory, to come up with some idea for how to get the correct value of N (which will depend on the expected SR and the turnover of the signal), and the correct shrinkage (which will depend on the predictability of the statistical distribution).

Anyway, with all that in mind, for consistency and simplicity let's do a robust 20 year rolling out of sample MVO that uses SR shrinkage 0.5, correlation 0.75 with more conservative shrinkage if there is less than five years of data.

Importantly however, this is going to be a symmetric backtest. For each optimisation we follow the following procedure:

  • If a given trading rule variation has negative p&l in the rolling period before costs, then we reverse the sign of it's forecasts and thus it's pre cost p&l will become positive. 
  • Costs are then deducted. There may be some expensive variations that have a negative p&l after costs, but most will be positive p&l.
  • We then do the optimisation. In the optimisation as usual we don't allow negative weights; this would be highly problematic here since even after shrinkage the reversed forecasts are probably highly negatively correlated with other variations, resulting in potentially extreme positive and negative weights were they allowed.
  • Any rule we had to reverse then has it's forecast weight reversed. 
Note that expensive rules won't get any kind of allocation at all, unless their net p&l is very high; or their reversed gross p&l net of costs is very high. For example, if ewmac2,8 does badly before costs, we would reverse it's sign. If after costs it ends up losing money again it would have a forecast weight of 0%, which reversed is still 0%. Suppose however it ends up with a 20% weight in the optimisation even after costs. Then we would give it a forecast weight of -20%.

(This also means that weights don't add up to 1. This isn't a problem, as we can access leverage it's actually irrelevant what our weights add up to)

An important point here is that this goes against what I, and many others, have preached before. Which is that you should use ideas first testing where ideas have an economic hypothesis behind them. A hypothesis can then be proven, or disproved. If disproved, we don't go off and use the exact opposite rule, which would go against our original idea! But with symmetric fitting we allow ourselves to do this. This doesn't mean that we shouldn't start with an idea or hypothesis with theory behind it. But that hypothesis will inevitably be contaminated with future information. Therefore we should test the opposite idea as well, at least initially, to ensure the backtest is done fairly without knowing about the future.

Anyway, to show the time series of all these forecast weights would be tiresome; so here are the final values:

8 of the 28 weights are negative - mean reversion. These are mostly quicker pairings. How does the total performance shake out?

Overall this isn't as profitable over the entire time series as the backtest above. There is a longer 'learning' period when it loses money as it's still allocating to unprofitable variations. But after 1995 it's performance is far more consistent. This is because the symettric True Backtest allows EWMAC to trade mean reversion at some faster frequencies, which for SP500 turns out to be profitable. That won't always be the case; if for example we examined an instrument that consistently made money in all the original six EWMAC pairings (but did badly in everything else) then the symettric backtest with 28 pairs will look worse for longer, and may never 'learn' that the six pairings are the best. 

But the important point here is that the original test was tainted by tacit information. Here we've made that significantly less of an influence. Yes we need to know that eithier trends or mean reversion work, and yes we need to know that EWMAC can detect trends. But that doesn't require any forward looking information. 

Now as before, let's add carry. As I already noted it's possible to specify a futures carry model just from theory, with just one parameter to select, and the choice of a smooth parameter of 10 could easily be made with a short burn in period. I could of course do things properly and have multiple smooths, as I do in my current trading system, but because the smoothed carry variations are so correlated it will hardly change the results. So let's keep things simple, even though in a super strict True Backtest we'd certainly include a number of carry variations.

I won't show the forecast weights, but again carry ends up with a weight of around 6% at the end of the backtest. Since it had a positive weight before (around 10%), symmetry doesn't effect the sign of the weight (though obviously it will change the magnitude a little due to the inclusion of more positive, reversed, forecasts).

Now, as it happens, on this occasion the overall performance is almost unchanged whether carry is included or not. In a previous incarnation I'd probably say 'go with the simpler option unless performance is significantly better - kill carry'. But we are now True Backtesting. So, irrespective of the performance after including carry:
  • We will not 'kill' carry
  • Going forward the trading strategy we use will have the final forecast weights, which include carry as a strategy (with a 6% weight).
  • This will remain the case until a future re-fit ends up giving carry a zero weight (if it's performance continues to be poor - of course it's likely at that point we'll give it a negative weight).
  • Carry will stay in our backtest forever even if it ends up with a zero weight in the future. Our backtest is now write only. 

Hopefully you can now see that we're avoiding the second mistake - killing carry is implicit fitting; and the third mistake - we're not setting the weight of carry in our live model to an arbitrary level of zero. 

Note that whenever we run another backtest adding another rule with another set of variations we're not making it more likely we'll find a winning strategy which we trade to the exclusion of everything else, thus obviating the need for multiple testing. Instead of multiple backtests, we have multiple vintages of a single backtest. Earlier vintages have an incomplete set of the possible universe of trading rules. Later vintages include more of the trading rules in the possible universe. As long as those rules were concievable at the start of the backtest, with parameters yet to to be discovered, that's absolutely fine. Whilst that's unrealistic in practice, the use of symettry means the use of tacit information will be much less dangerous.  

One final important point to make is this: a backtest has several purposes, which partially contradict each other, and which a single type of back test cannot give you:

  • It shows you how well you could have done trading a strategy in the past
  • It tells you the (expected) best strategy to trade from this point onwards 
  • It advises you of the behaviour of your strategy in the future
The True Backtest is great for giving you a realistic idea of past performance. If we take the final forecast weights, then it's also good for telling you the best (in expectation) strategy to trade in the future. It does not however give you an indication of the likely behaviour of that best strategy. For example, heres is the turnover of the combined linearly weighted forecast over rolling 6 month periods:
We can see the strategy slowing down as we deallocate from the quicker markets after 1995. To get an idea of likely turnover and other characteristics like return skew, we'd have to run a backtest with the final forecast weights held right from the start. But the performance of that backtest will be inflated by in sample fitting, and shouldn't be used to make any evalulation or assumptions about performance. In particular, optimal leverage, p&l available to pay trading costs, and expected drawdown should not be derived from the in sample test - use the True Backtest for those.


What next?

Anyone smart can now implement a basic True Backtesting protocol themselves. But my plan is to write a book on backtesting that will, amongst other things, explain in great detail how to use True Backtesting in the usual framework of forecast and instrument weight optimisation (the latter of course, I haven't talked about at all). As I said above it's my intention that the book will also allow you access to the 'Autofitter' code in python, and who knows I might even get round to creating a website that runs it for you for a small fee. From time to time I may well also blog some nuggets from the book as I research and write it.

So watch this space!

Monday, 23 November 2026

Fitting blunt instrument weights

 This is ... pauses to check... post #12 in my 2026 series on portfolio optimisation. And it will be the last! But don't be sad, I'll be following it up with some posts on my new 'autofitter' project which I've briefly hinted at a few times. The autofitter code will implement the 'best practice' of my work on optimisation.

Since it's the last post, let's summarise the previous 11 posts:

7 Structural breaks (failure)

And in the last post I put together my 'gold standard' for fitting forecasting weights. Feel free to (re)read that but since it's germane to this post here's a very brief summary:

We do rolling pure out of sample optimisation, rerunning each year on a 30 year expanding then rolling window. For each year we take an average of three optimisations for each instrument with different sets of gross returns, but using the costs of the actual instrument: the gross returns of the instrument, pooled returns across the asset class, and finally pooled across all instruments. Each of those optimisations uses a remove high trading cost rules (SR costs>0.13) and reverse weights wrapper. The reverse weights wrapper finds assets with negative gross p&l and reverses the sign on them. Once the weights are found, it puts a minus sign in front of the weights. Inside the wrapper is a clustering algo. Finally within each cluster we use shrinkage of gross returns for SR and correlation, deducting costs from the shrunk SR.

... and breath. 

With that in mind we now move on to optimising instrument weights. Mostly we'll be following on from the work above, but there are some wrinkles and differences. This will be a longish post, since it's compressing everything I currently think about instrument fitting into one place. Apologies but otherwise I'd have to keep erecting mental scaffolding for each sub-post - a pain for you to read, and even more of a pain for me to write.

Finally, you may be wondering what is 'blunt' about these instrument weights. Not very much. I just liked the pun. I also think James Blunt is bloody hilarious, which isn't relevant eithier.


Prior art

In terms of prior art on optimising instrument weights, there are surprisingly few posts of mine:

  • A very old post on the basics of optimising
  • Here's a random post on clustering, albeit of underlying instrument returns not subsystem returns
  • This post on costs also looked at how we'd handle instrument costs
  • The handcrafting series (my heuristic cluster based method) final post is here with links to previous posts

What I actually do now for my current weights is a fully heuristic handcrafting which ignores SR and costs, and just requires manually putting instruments into a hierarchy of groupings. But what I would recommend for someone who actually wants to do an optimisation, well check out relevant part of the default config file for pysystemtrade. You can see that it uses proper handcrafting with equalised SR (so don't use gross returns SR or costs at all), and shrinking correlation by 0.5. That will end up producing very similar results to my fully manual handcrafted, unless correlations are radically different from my subjective labelling.

In terms of what we need to consider; it's not dissimilar to what we have with forecast returns:

  • We're using past returns of trading different instruments using the combined forecast that comes from our fitted forecast weights; so it's not the underlying returns that are important here
  • We know that the key moments of those returns (correlation, SR) are going to be hard to predict, and their predictability is worse than we'd expect with a stable distribution.
  • We know that small differences in moment estimators can cause havoc in the form of sparse weights when used with classical optimisation, so we need to get robust - clustering, shrinkage, pooling...
  • We have the classic trade off between using more data (robust!) and using less data (adapts to distributional changes, eventually)
  • We need to think about how we handle costs, that are more predictable than gross returns.

Considering all my previous work in forecast weights, my prior for instruments is going to be to do exactly the same, unless there is a really obvious reason why this wouldn't make sense.


A novel gotcha

Before we begin, there is a bit of a 'gotcha'. Something I should have noticed before, but despite doing this sort of thing for 20 years it has never occured to me before.

Let's start from scratch; suppose we have two forecasting rules X and Y, and two instruments A and B.  After we get a year of returns, we fit forecast weights w_ to both instruments, calculate an FDM, and then calculate the combined forecast C:

C_A = FDM*(w_a_x * a_x + w_a_y * a_y)

... and the same for instrument B:

C_B = FDM*(w_b_x * b_x + w_b_y * b_y)

(there will be forecast clipping at 20, but we can ignore that)

We then calculate the p&l for instrument A and B, which will be a function of the combined forecast (and their price):

P(A) = f(C_A)

P(B) = f(C_B)

... and from that we calculate the instrument weights, w_a and w_b. We can then use those weights for the following year to calculate the p&l we'd get from trading this little system.

Now let's suppose after that year we then refit the trading system again. We'll get four new forecast weights w_*_* that are unlikely to be . Up until now what I've done is use those forecast weights to calcuate the following . That means the year 1 combined forecasts are using the year 1 forecast weights, and the year 2 combined combined forecasts are using the year 2 forecast weights. Those combined forecasts are then used to calculate instrument p&l for both years, and that's used to estimate instrument weights. 

But this is incorrect - and it's taken me 20 years to notice it. When it comes to calculating the combined forecasts for p&l calculation, and then year 2 instrument weight fitting, we should be using the year 2 instrument weights for the entire history. Whilst this may be a small problem when we only had positive forecast weights, now with the appearance of the reverse weights wrapper we can have negative forecast weights, it's a big problem. 

Let's make this concrete. Suppose that X is trend, and Y is carry. To keep it simple suppose we always have a zero weight to carry in both assets for both years. But in year one trend does really well in A, and really badly in B. The forecast weights will be X_A>0 and Y_A<0. Then in year two things are the same for A but switch around for B, such that over the two years trend is now also positive for B; we get year two weights X_A>0 and X_B>0.

If we use the forecast weights for each year to calculate the combined forecast and then p&l for each year, then we'll think that the subsystem B starts off as a mean reversion then becomes trend, with obvious weird results for estimating SR and correlations. When in fact what we're actually trying to optimise over at the end of year two is two trend subsystems, A and B. We need to use the final forecast weights to calculate the combined forecast for both years, and then to use that for p&l calculations and instrument weight fitting.

This makes the calculation of rolling instrument weights a little trickier (and slower), since we're not just multiplying out data frames. It also means we have to be careful about interpreting the two different account curves we'd get for a given instrument:

- the 'true out of sample' curve which would use the forecast weights available at the start of each year to calculate the following years p&l

- the current 'point in time forecast weights' curves used at each stage of the optimisation for fitting ('fitting p&l'), which will be much better performing since it's effectively all in sample.


A reverse wrapper probably doesn't make sense

Remember, the reverse wrapper means that we put negative weights on poorly performing assets. This is done by switching the sign from negative to positive before the optimisation, hence avoiding the nasty hedging like behaviour we'd expect in an optimisation with assets that have negative returns especially if positively correlated with other assets, and then multiply the resulting weights by -1.

The logic of this is that if we only include the 'positive' version of a forecasting rule, then (a) we're committing in sample tacit fitting and (b) we're not opening ourselves up to the option of the best option being the negative version of a rule (eg mean reversion working at a given time scale for certain instruments). 

One implication of the use of reverse wrapper on forecast weight optimisation, and then using 'point in time' calculated forecast weights to calculate instrument p&l for fiting purposes, is that it's very unlikely that you'll end up with instruments that have a negative fitting p&l before costs. 

That makes a reverse wrapper redundant; and means we'd never allocate a negative weight to an instrument. In fact, given the upwardly biased SR of fitting p&l, it's unlikely we'll allocate a zero weight to an instrument if we were only using pre-cost returns.

This makes sense; when we construct a subsystem for an instrument we're trying to come up with a way to do the best job we can to forecast a given instrument. It makes no sense to short the resulting subsystem by giving it negative weights.


Pooling doesn't make sense

Now, what about pooling? Remember for forecast weights, we pooled the gross returns together before optimising, eithier within an asset class, or across the whole universe. This was in the name of getting more data. But it makes no sense here.

If we pooled all subsystem returns together, that would be equivalent to full shrinkage on correlations and SR. Which is eithier silly, or a very complicated way of achieving the result of allocating equal weights (at least pre-costs - after costs we'd give more to cheaper instruments). 

If we pooled all subsystem returns together within an asset class, that would be like shrinking within assset classes. That's slightly less weird, but still not worth doing.

No pooling for instrument weights.


Clustering makes a lot of sense

Clustering is designed to work with large portfolios. I have ~50 trading rules in my portfolio right now. 50 is pretty large. But I also have 200+ instruments I've allocated instrument weights to. So clustering makes even more sense here.

In the post on clustering before, I opted for an optimal cluster size of 6. That's roughly the number of asset classes I trade (stocks, bonds&rates, energies, agri, metals, fx, vol - that's 7; but vol is small and similar to equities with a minus sign in front). For 200 instruments I would have about 3 levels (6*6*6=216) of heirarchy. That all feels about right.


Shrinkage makes sense

After a lot of playing round with shrinkage calibration, I decided that if you have at least five years of daily returns data then SR shrinkage of 0.5 and correlation shrinkage of 0.75 made sense (with stronger shrinkage with less data) for forecast weights, but also that the surface was quite flat and generally as long as you did some kind of shrinkage the results would be ok. 

In fact we're likely to end up with quite similar instrument p&l SR, which could support a less severe shrinkage on SR. However I'm biased towards equal (ignoring correlation) instrument weights anyway, and I also don't want to risk doing meta in sample fitting of optimal shrinkage on instrument weights when I've already arguably done it on forecast weights. Also, I can't be bothered.

So in conclusion I'm going to stick to the same shrinkage policy as used for forecast weights.

Costs

We need to think about how we handle costs, as discussed here, given the use of a dynamic optimiser that drops positions in instruments which currently have costs greater than SR=0.01:

  • Should we apply trading costs to instrument performance, so we end up allocating less to (expensive) Cheese and more to (cheap) S&P?
  • How does that work with (very expensive) Sugar, where we would probably end up negative SR after costs even if the forecast weights were just 100% in the slowest system?
  • Given I am going to apply cost penalties to (expensive) Milk anyway, does it matter if we apply trading costs?
  • Given we won't actually trade (very expensive) Sugar because of it's trading costs, it's instrument weight will just determine how it influences the positions we do actually trade. So what implications does that have for applying costs?

In the end I decided to repeat the method used for forecast weight optimisation:

  • If using dynamic optimisation, I cap SR cost estimates at 0.01
  • I subtract costs from gross SR after shrinkage has happened, reflecting as with forecast weights that I have more certainty about costs than gross SR.
  • I will end up with lower instrument weights for expensive instruments, although this will be ameliorated by the fact that expensive instruments will trade slower due to lower allocations to faster forecasts.
  • If using DO, instruments that currently have SR cost>0.01 will be excluded from the final portfolio.

As I noted in the previous post, this makes the "cliff edge" effect of excluding expensive instruments less problematic. I change my instrument overrides based on current costs much more frequently than my forecast or instrument weights. Consider something (instrument A) which has SR cost of 0.02 when I do the forecast weight optimisation, and instrument B with SR 0.005 at that time. We will end up trading the former as if it has a SR cost of 0.01 - so a little too quickly. Instrument A will also get a lower instrument weight, although higher than if it's true SR cost was used. However since we're using dynamic optimisation, we won't actually hold positions in A; instead it's optimal positions will influence our position in B.

Then suppose A and B swap, so B has SR 0.02 costs and A has 0.005. At this point we're going to be trading A a little too slowly, but fine; and B too quickly. Once I update my overrides though B will be excluded from the dynamic optimisation. I'm still 'trading' it too quickly, but I'm not actually trading it so I can relax. B will now be overweight in the instrument weight optimisation and A underweight, but again this isn't such a big deal.


Duplicates and high correlations

Before allocating forecast weights, there is a unspecified step we don't talk about which is deciding that e.g. the pool of trading rule variations for EWMAC should be EWMAC2,8; EWMAC4,16 ... EWMAC64,256. Basically what is the granularity and boundaries of the parameter space. Boundaries are important, because trading really slowly is boring; trading too quickly is expensive. Granularity is important because there is no point trying to trade both EWMAC 2,8 and EWMAC 2,9 as they are 99% correlated, and more to the point portfolio optimisation with very highly correlated things is hard, even if we shrink the correlations.

To choose those we need (i) the correlation between forecasts of different parameters (to weed out parameters that are too close to each other), and (ii) the trading costs (to determine the boundary limits). We do not use pre-cost returns. That decision can be made in a number of ways, using fake data, maths where possible, or using a limited amount of real 'burn in' data - normally a year (since we need a year to get estimates of forecast and instrument weights). 

In instrument weight fitting space we don't need to select the assets we're optimising, they are given. However that doesn't mean we can't worry about highly correlated assets. The US 5 year and 10 year bond future are pretty correlated; although their subsystem correlations will be lower than those of the underlying instruments. And in fact in the instrument space I trade there are instruments that are likely to be 100% correlated. That's because there are often multiple instruments trading the same price: different contract sizes, or on different exchanges.

My open source trading system, pysystemtrade, deals with this by dropping duplicate instruments in favour of just one for each underlying price. This means we'd need to do that substitution before we did instrument weight optimisation. It makes most sense to pick the instrument in a given group with the longest history; even if we end up substituting a different instrument again before we trade.

(Another 'gotcha' is that we'd need to keep a record of substitutions that happened in the past, even if we're not currently trading the relevant instrument, since under the rules of 'no out of sample fitting, ever' we have to retain old instruments in our backtest).


A summary of the proposed instrument weights method

OK, so for instrument weights we:

  • Remove highly correlated subsystems, by picking the one with the longest history from a series of duplicated instruments.
  • If using dynamic optimisation, cap instrument cost estimates at SR=0.01
  • Do rolling pure out of sample optimisations, rerunning the optimisation each year and using the last 30 years of rolling returns (as for forecast weights).
  • We don't remove 'dead' or 'stale' instruments as that would be in-sample fitting, instead they get a zero weight for a given year if in the last 6 months they have no price or forecast data (I do a similar thing for forecasts).
  • For each annual optimisation we use the last (current) set of forecast weights to calculate 'point in time' combined forecasts, and instrument p&l for fitting.
  • Each optimisation is a clustering algo, with a desired cluster size of 6.
  • Within each cluster we use shrinkage of SR and correlations according to the boilerplate numbers for forecast weights; with more extreme shrinkage with less data.
  • We deduct the instrument costs from the shrunk SR estimate
As intended this is very similar to forecasts, except of course there is no pooling and no reverse weights wrapper, nor do we remove assets that are too expensive to trade (there won't be any, due to rules with a SR cost of 0.13 being dropped).


The test data

To do some testing for this blog post, I used the following set of instruments:

SP500, US10, US5, VIX, DAX, NASDAQ, GOLD, CORN, BUND, BOBL, BITCOIN, ETHEREUM, CRUDE_W, GAS_US, WHEAT, MILK, SILVER, EUR, JPY, GBP, GBPEUR, V2X, BRENT_W, SHATZ, BUXL, KR10, CAD10, EDOLLAR

Obviously they have been selected to give a reasonable cross section across asset classes. I've also deliberately chosen one dead instrument - Eurodollar. This has no price after June 2023.

The trading rules I've chosen are:
  • EWMAC2,8; 4,16; 8,32; 16,64; 32,128; 64,256
  • Carry with smooth of 10,20,40,80
  • Breakout with lookbacks 10, 20,40,80,160,320 
To ensure I can test corner cases I also manually borked the data as follows:
  • Broke the carry rule for bunds and bobls; and for Shatz before the year 2020, and for Buxl for after the year 2020 (as I explain in AFTS, carry is a bit weird on German bonds so why not)
  • Deliberately broke Bitcoin so it has no price
  • Removed the price from Ethereum from 2023 onwards, making it look like a stale instrument. Remember Eurodollar is already stale.



The instrument weights

Let's skip to the weights first. Here are the final weights:


They are the final weights, so we have nothing for the stale and artifically stale instruments EDOLLAR and (E)THEREUM. Bitcoin doesn't even appear here since it never gets a weight it never makes it to the dataframe. Note we have a genuine zero weight for V2X, more of that in a second:

They are reasonably spread over asset classes:




Note there are more bonds (7) than say equities (3) or metals (1); so we'd expect more but clearly less than equal weighting would suggest.

How do weights vary over time:



Early markets get more weight initially as you'd expect. How stable are weights? Let's zoom in on the last 10 years or so:



That's kind of OK. And here is an uncapped IDM:



Account curves

Now, how about some account curves? First of all let's see the 'true out of sample' instrument account curves. Here we're using the forecast weights available at the start of each year to calculate combined forecasts:

Here are the net SR over the whole period for each instrument:


=

Bearing in mind how strict we are being here (nothing forward looking, allowing both negative and positive weights on everything so no implicit fitting except in the choice of trading rules) I'm quite pleased with that. V2X remember is the only instrument that gets a zero weight. 

How does this shape up for an overall account curve?

So that looks pretty good (SR gross in blue is 0.99, net is 0.93); but shouldn't we compare it against a benchmark?

Note those costs are underestimates due to the application of SR caps of 0.01; but anything with a SR over that won't be traded after dynamic optimisation.

A benchmark that is pretty close to what I do now is:
  • Forecasting weights: remove expensive rules (SR>0.13), cluster with equal weights within clusters, no reverse rules. Note this means we ignore SR, only using correlation for clustering.
  • Instrument weights: cluster with equal weights within cluster. Note this means we ignore SR, only using correlation for clustering.
Note that using no reverse rules means we've got tacit fitting information (we know trend, breakout and carry work) so let's also consider a benchmark where we do allow reverse rules. That might be worse (as it hasn't got the advanced knowledge) or better (as it has the option to go short certain forecasts in certain instruments where they lose money).

First let's consider the two benchmark results. If we don't allow the use of reverse weights, and hence incorporate tacit fitting information, we get the blue line with the best performance; a net SR of 1.02. If on the other hand we permit reverse weights, we get the green line with SR 0.91. Finally, if we bring to bear all our fitting technology we do slightly better, the orange line with SR 0.93. 

Tacit fitting then adds 11 units of SR that we can't actually get without a time machine. Without tacit fitting- using reverse weights- the full machinery of robust fitting adds about 2 SR units compared to a very simple alternative. 

None of this is proof of anything, as we'd need to look at more than one combination of instruments to get. Remember that the robust fitting results are based on extensive . However, allowing tacit fitting will on average add to performance, assuming our rules have been chosen to be profitable. 

It's also worth noting that the results are a little different if we exclude the pre 1990 period, when trend following did exceptionally well:
In fact, focusing just on the last 30 years the benchmark is 9 SR units worse than the robust fit, with bench_negative falling between the two stools. We get a 3bp improvement from reverse weights - tacit fitting actually harms us here- and a 6 SR bump from fancier fitting.


Summary

That's it, I've now fully defined the 'gold standard' of fitting.

Subsequent posts around this topic will be how this fits into an 'autofitter' concept, which will prevent all the kinds of overfitting: implicit, tacit and explicit.



Monday, 16 November 2026

AI for systematic traders - this is the least stupid way to do it.

 Anyone who has spent more than 5 nano seconds following me on social media or listening to me waffle on during podcasts will know there are a few things that I am not a fan of. One is crypto. The other is AI. 

These two things have at least one thing in common. They are terrible for the environment, increasing the usage of energy at a time when we aren't using 100% renewable energy, and using other resources as well. 

Both Donald Trump and Elon Musk also like them, and they also sit firmly inside my personal 'not a fan of' box.

And yet, in my fifth book that is being released very shortly, that word 'crypto' is on the cover. Why? Let me explain myself in my own words from the book:

"I should state my own prejudices up front: I am not a fan of cryptocurrencies, which are used primarily for gambling and criminal activities such as money laundering, and which consume a great deal of electrical power, with obvious implications for the climate crisis. In an ideal world I would ignore them completely. Although I am retained as a research advisor for a crypto hedge fund, and I trade Bitcoin and Ethereum futures, I do not hold any crypto in my personal portfolio.

But the point of this book is to guide traders into using certain scientific rules to reduce their chances of losing money, and nobody needs those rules more than those trading crypto. The message of this book as it pertains to crypto can be summarised as “I would not do this stupid thing if I were you, but if you insist, this is the least stupid way to do it.”


In a similar vein, I am not a fan of AI, although unlike crypto I will admit to using it in a very limited way. Mostly for LOLs and making silly pictures, but yes ocassionally for more serious purposes. But I do appreciate that there are a lot of other people out there who are using AI; and perhaps more to the point unlike crypto I do believe AI is useful although it is clearly IMHO massively overhyped in terms of what it can achieve in the quant finance space specifically. But there are an awful lot of people using it in very stupid ways. Hence the subtitle of this post.


A silly picture - thanks chatgpt. See Appendix for prompts and transcript.


The 1st past of this post will be a brief and breezey criticism of the current use cases of AI by people who do similar things to me (develop trading strategies that can then be automated). Then I'll briefly explain the limited set of things I would trust AI to do. Finally I will outline a framework for using AI in a systematic trading strategy reserach process. 


Some bad ways to use AI 

Let's begin with the dumbest way to use AI for trading purposes, with a prompt like "Tell me what stocks to buy" on a generic public model. I hope I don't need to elucidate to the wise and educated people on this blog why that would be a bad idea. 

One level about that would be using the same prompt on a model that has been locally trained on some financial data. Generic machine learning classification tends to do very badly on financial data, mainly due to non stationarity. It's not clear to me why LLMs should do any better. 

Going up another level, would be a prompt like "Tell me what trading strategy to use, and why". Congratulations, you have just invented in sample fitting but in a completely opaque way! Plus you can't trust the code that's been used to produce the back test you have just been shown. Interestingly, AIs don't seem to be as good at the insample research loop (develop model -> test-> change model -> retest) that humans do so well.

That brings me to the writing of code. Any code that you use to handle your money and/or other people's money should be 100% trustworthy and fully understood by you, whether it be backtesting or production code. You can never say that is true of AI code.

Agentic AI? Well..





(The second image is a real screen shot from someone I know, who - for obvious reasons - will remain anonymous)

I am expecting this part of the post to get a lot of replies, mostly critical and starting with "Ok boomer..." (typical AI mistake, I am gen-X). I will ignore ones that say "Ah but that is because you should be using model XYZ" or "No you should be using a different prompt" or "Ah but you just need to do X, Y and Z". LLMs have inherent flaws that can never be completely fixed by prompting or using different models or using an agentic framework; and will always be opaque - a very bad thing indeed.

Some good ways to use AI 

Idea generation: I am not averse to using AI for idea generation. This could work with eithier a publically trained AI or a local model. 

Summarising research: Next after idea generation, it makes a lot of sense if you are doing a lot of research to have an AI summarise for you all the academic papers in field X (you shouldn't ask it to sumarise book Y, since the contents of that book will have been stolen from it's hard working authors). Of course AI's writing style is bloody irritating so I'm not sure how much of it you could read without screaming. I find that asking it do summarys in bullet points removes a lot of the pain. The other obvious problem is hallucinating, so you need to be prepared to get your metaphorical hands dirty and read the underyling research yourself. Still it's a good starting point, and better than just typing "phrase" into google scholar.


There are another ten pages of this, and in fairness although there were a few minor errors it pointed me to some papers I wasn't aware of

Finding data sources: arguably this is something a search engine could do, but we're pretty much at the point where AI is better at search than a search engine is. But don't just say 'give me the data', find out where the date comes from and get it yourself.

Writing small amounts of code: I've used AI to write small bits of code. Small bits because you can easily verify they are correct. It's particularly useful in a situation where the code is relatively isolated from everything else, and it's not a big deal if it fails. A recent example would be that for the framework described at the end of the post, I wanted a configuration file that could only be added to and not otherwise edited, and decided to implement this using hashes (yeah I know that makes the file like a single node blockchain, the irony isn't lost on me). 


I could have easily written this myself in an hour or so, but I was in a hurry and got AI to write it. It ran perfectly and although the style of the code wasn't something I would have written myself, it's small enough that I can easily check it's correctness in much less than an hour (so net time saved), and if it goes wrong it isn't going to result in me accidentally buying 10,000 contracts of Bund futures.

Checking code: In theory at least, I don't have a big problem with AI checking your code and suggesting changes. I've had other people check my code with AI, and to be fairness it did find some issues. The downsides here is that the language of code checking in AI is bloody awful (as is obvious from the AI contributions to pysystemtrade), and you often need another AI to interpret what it is saying, which seems to be a net waste of time. 

You should absolutely not merge the changes from the AI without checking them. The same code check someone did for me resulted in the AI unintentionally introducing an absolutely massive bug. So what I am suggesting here is definitely not a 'write code with AI', 'check code with AI' doom loop without human intervention; or using AI so extensively that you can't actually properly check all the code written or suggested changes. That would be insane, and it's incredible to me that there are people doing it.

Writing tests: I hate writing tests, as anyone involved in my open source psystemtrade project will know. Tests are small bits of code with a well defined objective that if they go wrong won't affect the rest of your codebase - perfect for AI. Note that I wouldn't extend this to writing documentation, another thing I am really lazy at (although unlike tests, I do actually do it), since AI writing isn't something I am a fan of; and there is a real benefit to writing your own in my opinion.

Stealing code: Like crypto, AI is also good for doing crime and stuff.


A framework for using AI (and also human brains)

With the above in mind, what is a safe framework for using AI in trading research? In fact this is exactly the same framework that should be used in an ideal environment for testing human generated ideas. We still have the same three versions of overfitting we're trying to avoid: explicit, implicit and tacit. It's just that the overfitting is wrapped in an opaque blob so we don't even know if it's happening or not. 

Idea generation, data scoping, initial research: As noted above this could be done by AI, or by a person. It's fine.

The end point of this exercise will be the following:

  • Some trustworthy data. To be trustworthy the data must have come direct from the source not via the AI. You should have checked the specs of the data to make sure there is no in-sample fitting hidden inside it (this is a problem often for sell-side produced 'strength indices', and more recently I've had this issue with certain Glassnode crypto data) and no forward looking data (a problem for eg macro data published with a lag and then revised, and company earnings that certainly don't come on the final day of the quarter they relate to).
  • A piece of parameter-isable code implementing the strategy idea (i.e. producing a forecast) given the data as an input and incorporating parameters that require calibration like the fast_span and slow_span below:


(As an aside, the code produced here was a bit rubbish as it also included some backtesting fluff and didn't just produce the forecast but this is a 'skill issue' that better prompting or a skill.md file can probably solve).

Note that the parameter-isable code is small and therefore it's correctness can be verified. However it may well incorporate tacit fitting.

That is the last time we will touch AI in this process. Everything else that happens will happen in a robust testing framework. Importantly that robust framework must not have been written with AI or be run be agents (with the caveat that small parts of the code may be AI written, AI may have been used to suggest improvements, and the tests may be written with AI).

A good way of explaining this is to think about the harness+AI that produces AI agents, something like this:


From https://www.bankofengland.co.uk/speech/2026/november/jon-hall-speech-at-cf-imperial-workshop which I attended actually

Instead of a model inside a harness (and inside a sandbox here) the model only gets to play with one thing; the parameter-isable python code that ends up getting tested as a forecasting rule. Everything else in the robust framework around it is off limits to the AI.

The list of requirements for the robust tester is again not different from what a proper tester would have for human generated ideas or strategies:

  • Generating the parameter fitting space eithier by using a very limited amount of real "burn in" data, fake data or theory. If real data is used, performance isn't considered, only correlation and turnover.
  • As alluded to above when I discussed the config file hash key thing, an add only system where new forecasting rules once tested can't be removed from the backtest. This avoids implicit fitting in the form of 'research loops' where the results of backtests are used to refine forecasting rules, or remove them entirely. As we're not ever going to remove or drop a rule, we don't need to worry about nonsense like Whites Reality Check and we're not at risk of dropping rules that may work but whose natural profitability is too low to pass an arbitrary statistical hurdle.
  • Backward looking explicit fitting of the combination of optimal parameters and forecasting rules.
  • The fitting is robust - it knows about statistical significance and trading costs (as discussed in my recent series of posts, the last one is here).
  • Both positive and negative versions of a strategy to avoid tacit in sample fitting. This avoids the problem that both smart humans and AI already know what's worked, eg medium speed trend following.

What I haven't done of course is specify exactly how this robust fitting engine will work. That is something I am currently working on; and will be spelt out more in (a) future blog post(s). It will also be the subject of my next (6th) book, title to be confirmed, publication date probably at least 2 years away...


Appendix: chat transcript for image

Me: I want a picture of renowned systematic trading author robert carver sat at his computer swearing because AI has just deleted all his files

Chat:







Me: that doesn't look like him and that book cover is completely wrong

Chat: You're right — the likeness and the book cover both need correcting. The image invented a generic older author rather than capturing Robert Carver. Let's get it right this time. Could you upload: 1. A photograph of Robert Carver that you'd like me to use as the likeness reference. 2. The actual cover of his book, Systematic Trading.

I'll recreate the scene with: - A much closer facial resemblance. - The genuine book cover, not an AI-invented version. - Robert visibly furious, shouting and swearing at his computer. - A screen displaying: "AI HAS DELETED ALL YOUR FILES".

Would you prefer photorealistic comedy or an exaggerated satirical caricature?

Me: <Attached Images> I am robert carver and I have the copyright to these images. photorealistic

Chat:








Me: WTF is going on with my hands, they look like those of an 80 year old man? What OS is that - should be linux? And why is my book so big - should be smaller

Chat:

Much better on the Linux front! This version has: - Ubuntu-style Linux desktop, with Tux visible. - A smaller, more realistic-sized book on the bookshelf. - A ThinkPad rather than a generic desktop monitor. - More natural-looking hands and gestures. - Your actual appearance and clothing as the reference. The AI has still managed to delete everything. At least it hasn't deleted your book. 😄

NOTE: Smiley face was inserted by AI not me. I am not that whimsical