Commodity trend experiment

Discuss all general (i.e. non-personal) investing questions and issues, investing news, and theory.
Post Reply
Topic Author
treecat
Posts: 16
Joined: Sun Jan 09, 2022 6:44 pm

Commodity trend experiment

Post by treecat »

There's an argument that commodities are nice at times like now, but too expensive to hold as inflation insurance at other times. This paper (from Artemis in 2020: https://artemiscm.docsend.com/view/taygkbn) has backtests of a complicated alternatives-heavy portfolio from 1928-2019, but most relevantly is the piece of it called "Commodity Trend", which they implement with buy/sell of commodities based on a fifty day moving average. They note the trend following component was important to make it work, compared to rebalancing buy-and-hold of commodities, then recommend weird complex variants.

I was wondering whether the simpler moving average thing could work with a commodity futures ETF (the paper's results seem to be from commodity prices, which are too optimistic for retail investors). Portfolio Visualizer has DBC since May 2006. I selected a 2 month moving average window period (42 trading days) to be similar to the paper, with trades once per week. At least over this time period it does nicely avoid some of the big falls in DBC price:

https://www.portfoliovisualizer.com/tes ... odWeight=0

Image

It gets 7.69% annualized return versus 0.70% for buy and hold. Some years it does a bit worse than holding, but it avoids the really huge drops in 2008, 2014, 2015.

Comparing it to the Vanguard Balanced fund (60/40), it often helps on years where stocks/bonds do poorly, like 2008 and 2022. I was honestly surprised its overall performance is similar to the 60/40 fund.

Doing weekly trades seems annoying to actually do, and the results include what seems to me like a lot of trading, averaging 8 trades per year (could lose plenty to bid-ask spreads?). But using trades only once per month drops CAGR from 7.69% to 3.21%, unfortunately.

I don't know if this means this is actually a good idea to include in a portfolio and there are plenty of recent threads on this (viewtopic.php?t=344156), trend following (viewtopic.php?p=6805132 viewtopic.php?t=382918)
and commodities (e.g. viewtopic.php?t=375070 viewtopic.php?t=369976) but I was curious if anyone still has other thoughts on this sort of thing.
Logan Roy
Posts: 264
Joined: Sun May 29, 2022 10:15 am

Re: Commodity trend experiment

Post by Logan Roy »

treecat wrote: Tue Aug 02, 2022 11:24 pm Doing weekly trades seems annoying to actually do, and the results include what seems to me like a lot of trading, averaging 8 trades per year (could lose plenty to bid-ask spreads?). But using trades only once per month drops CAGR from 7.69% to 3.21%, unfortunately.
With this bit here – just personally – I find when you get a radically different result changing one relatively inconsequential parameter (weekly to monthly rebalance), it's a strong indicator the good result is largely down to (accidental) back-fitting.

If the principle's robust, you should be able to knock the implementation around quite a bit. Here's one just for fun. Relative strength, switching between: GSG VUSTX VIGRX CASH. My idea is that commodities rising means rising inflation = rising rates -> bad for long treasuries and growth stocks. Cash when there's too much volatility. Would I use this? No – it doesn't seem very robust. But 21.88% average returns with 3.24% the worst annual result. Not a bad result.

Image

EDIT: Actually the timing switches have been pretty good. It says commodity index at the moment – since February. And just realised the blunder: CASH isn't cash. It's a stock. Monkeys beat fund managers.

Image
Topic Author
treecat
Posts: 16
Joined: Sun Jan 09, 2022 6:44 pm

Re: Commodity trend experiment

Post by treecat »

The backfitting fear is a good one. Here's a robustness test: instead of checking the rule and potentially trading weekly, for each day, do it with probability 20%, which is on average every 5 days (one week of open markets, approximately). I'm seeing annualized returns ranging from 3.0% to 7.9% (the 95% confidence interval over simulations), with median 5.6%. So it's doing better than buy-and-hold at 0.1%, but the 7.69% return from PV weekly checks/trades looks like a positive outlier. (Albeit this is a different implementation, with I'm sure plenty of other differences.) The range of returns are similarly wide for different check-and-trade probabilities.
Logan Roy
Posts: 264
Joined: Sun May 29, 2022 10:15 am

Re: Commodity trend experiment

Post by Logan Roy »

treecat wrote: Thu Aug 04, 2022 10:47 pm The backfitting fear is a good one. Here's a robustness test: instead of checking the rule and potentially trading weekly, for each day, do it with probability 20%, which is on average every 5 days (one week of open markets, approximately). I'm seeing annualized returns ranging from 3.0% to 7.9% (the 95% confidence interval over simulations), with median 5.6%. So it's doing better than buy-and-hold at 0.1%, but the 7.69% return from PV weekly checks/trades looks like a positive outlier. (Albeit this is a different implementation, with I'm sure plenty of other differences.) The range of returns are similarly wide for different check-and-trade probabilities.
My instinct with this would be to try trading in 20-25% blocks, instead. So if you had four consecutive periods of Buy signal, in a month, you'd have 80-100% of the trade in, trading weekly. But if the signal wavered, you'd just be in and out, only getting whipsawed on small positions. But you'd probably need Python to test that. (doable in Excel, but not fun, for me anyway.)

Or if you could set PV to start on a particular week, you could run the monthly strategy at 4 different weekly offsets, and see what the average looks like. Then, in effect, run it with 4 mini portfolios. Random ideas. My experience, trend following anything too tied to inflation can be a problem, because inflation concerns seem a bit too chaotic, and don't really trend cleanly.
Topic Author
treecat
Posts: 16
Joined: Sun Jan 09, 2022 6:44 pm

Re: Commodity trend experiment

Post by treecat »

Cool, thanks for the suggestions.
User avatar
happyisland
Posts: 766
Joined: Thu Oct 03, 2013 1:36 pm
Location: nos baranca tan stima

Re: Commodity trend experiment

Post by happyisland »

Interesting study of past performance! I wonder if future results are guaranteed... :D
Logan Roy
Posts: 264
Joined: Sun May 29, 2022 10:15 am

Re: Commodity trend experiment

Post by Logan Roy »

happyisland wrote: Tue Aug 09, 2022 7:41 am Interesting study of past performance! I wonder if future results are guaranteed... :D
If only. The standard advice could then be: "Sign up to Portfolio123, and just mess around with the backtests until you get something that generates over 20% a year, with very low volatility.."

"Why not 30% a year?"

"Actually 30% would be even better. If you can be bothered to keep trying things out, then my advice would be to find something that generates 30% a year, then start calculating when you'll be able to retire."

So obviously we have to understand why that doesn't work in practice. At the same time, the old joke about an economist walking past a $20 bill on the sidewalk because, if it were a *real* $20 bill, someone else would've picked it up – we can get stuck to an idea. If we test things once in a while, we might find we're wrong, or that there are specific things we're more right or more wrong about.

Most so-called research I find around finance is nowhere near cynical enough. I'd say a good starting point is if you find something that seems to work – like a 200 SMA trend strategy, then take exactly the same rule to a different market, and see if it still works. If it does, maybe that's a checkbox ticked. If it doesn't: is there a principle you can add to the strategy that makes it translate? (e.g. can we assign the test market a volatility rating, and adjust the SMA?). Then try it on a third market. Much like maths: it's can you find universal principles? Are the tests you're conducting really independent enough? Can you explain the anomaly well enough to estimate how well it's going to perform on a third or forth dataset? Machine learning routinely uses validation sets (data that's not used to fit a rule, that we can test a model against). But we're also working with very limited data. Even going back 100 years, there's a whole lot of noises, one or two interesting things/cycles happening.
Post Reply