Refinements to Hedgefundie's excellent approach

Discuss all general (i.e. non-personal) investing questions and issues, investing news, and theory.
laurenthu
Posts: 10
Joined: Tue Aug 17, 2021 9:58 am

Re: Refinements to Hedgefundie's excellent approach

Post by laurenthu »

Thank you so much for the update @Hydromod !
I can't wait to get more details, I can then do some coding in Google Colab to automate all this and get reliable results on a weekly basis. I am quite intrigued by hoz you managed to get the right basket of ETFs and some balance between risk on and risk off. So far all strategies that I followed based on some mix of momentum and risk parity (or minimum variance) either had some big drops because of considering TMF as the only right risk off asset or some big drops because of the choppiness of the market this year. Most ignored commodities / energy / inverse bonds as potential assets, which probably were the only way to stay afloat.
Your approach seems to make great sense, and maybe indeed being agnostic on what "risk on" and "risk off" assets are before applying the RP / MV layer is the best way to go, and I like the weekly rebalance that may make a difference in choppy markets.
Topic Author
Hydromod
Posts: 1051
Joined: Tue Mar 26, 2019 10:21 pm

Re: Refinements to Hedgefundie's excellent approach

Post by Hydromod »

laurenthu wrote: Fri May 20, 2022 3:30 am Thank you so much for the update @Hydromod !
I can't wait to get more details, I can then do some coding in Google Colab to automate all this and get reliable results on a weekly basis. I am quite intrigued by hoz you managed to get the right basket of ETFs and some balance between risk on and risk off. So far all strategies that I followed based on some mix of momentum and risk parity (or minimum variance) either had some big drops because of considering TMF as the only right risk off asset or some big drops because of the choppiness of the market this year. Most ignored commodities / energy / inverse bonds as potential assets, which probably were the only way to stay afloat.
Your approach seems to make great sense, and maybe indeed being agnostic on what "risk on" and "risk off" assets are before applying the RP / MV layer is the best way to go, and I like the weekly rebalance that may make a difference in choppy markets.
I certainly didn't consider commodities before this year, except as a loser. I recently saw a video with some risk parity dude saying that you don't have a risk parity portfolio without commodities, which seems pretty strong, but it did get me thinking. Pain is a powerful stimulus...

If you want to test, I can tell you that I'm playing with a basket of UPRO, TQQQ, SOXL, FAS, CURE, RETL, NAIL, UTSL, WANT, EDC, DRN, DBC, UGL, TMF, and TMV.

Sometimes I flip in SPXU to test, sometimes with SQQQ, DRV, SOXX, and FAZ. If all of these are enabled, the algorithm picks out 45% DBC plus inverse LETFs at the moment. Without inverse equities, it picks out DBC, UGL, TMV, CURE, UTSL, and DRN.

I don't consider LETFs with very small AUM. I thought of adding the mid and small caps too, but they are fairly highly correlated to UPRO relative to the sectors, so I'm not sure that I'd get the same diversification.

I just calculate the 3- and 9-month returns for all of them (risk and safety assets all at once), average them, sort from high to low, and pick the top set. Or even just the 3-month returns, which may do a little better during high volatility periods and a little worse during trending periods. Rinse and repeat weekly or biweekly.

My rule of thumb is ~40% of the basket, although I've been stopping at 6 when adding the inverse LEFTS. I don't toss out assets with negative returns (so just relative momentum).

Once I have the reduced basket, I do the risk-budget minimum variance approach I described above for risk management. I've settled on about 3/1 relative risk for equities/treasuries. UGL gets a much lower relative risk than treasuries, DBC about the same or a little more.

That's really all there is to it.
Topic Author
Hydromod
Posts: 1051
Joined: Tue Mar 26, 2019 10:21 pm

Re: Refinements to Hedgefundie's excellent approach

Post by Hydromod »

Summary entry

At this point, I think that I’m pretty close to an investing approach almost wholly based on 3x LETFs (plus a few assets that don’t have a 3x equivalent). I think that the approach is in many ways the distillation of the boglehead philosophy, even though it is an active approach that is most emphatically not a buy and hold approach. I think that it would be rare to hold any asset for more than a couple of years. Therefore, it is much better suited to a tax-deferred account. I think that the best results would be obtained using a bot to automatically rebalance daily.

The objective of the approach is to maintain a target risk profile as closely as possible, drawing from a well-diversified basket of assets. Over time, all assets should be used, but only a fraction are used at any one time. It is intended to be a fully automated approach that remains robust to changing market conditions.

Some would call the approach market timing. I do not. I call market timing an attempt to time buying and selling based on predicted crashes or recoveries. This approach makes no attempt to predict crashes or recoveries. On the other hand, it does not attempt to predict which sectors will perform far into the future, which is intrinsic to the buy and hold approach. All that the approach does is try to continually maintain a constant risk profile with lowest available volatility using a statistically favorable collection of assets.

There are three key components to the approach, each using a well-known aspect of markets to improve the statistical performance of the portfolio: (i) deriving asset allocations that minimize portfolio volatility given a basket of assets, (ii) selecting a basket of assets that are a bit more likely to do well based on recent momentum, and (iii) taking advantage of the rebalancing bonus afforded by a basket of volatile assets.

Minimizing portfolio volatility

The bedrock component is portfolio volatility management given a basket of assets, which I think is critical with 3x LETFs. Volatility management is intended to reduce the impact of volatility decay, which interferes with compounding. Part of the management is simply from using several assets in the portfolio at any given moment, which naturally tends to reduce portfolio volatility when the assets are not perfectly correlated. More importantly, markets tend to exhibit volatility clustering, which allows some predictive capability for future volatility based on recent volatility.
I use a risk-budget minimum variance approach (described in previous entries) to calculate the allocations that would have minimized the portfolio variance for the historical period (e.g., two to three months), subject to constraints on the fraction of portfolio variance stemming from each asset. As a rule of thumb, I define categories (e.g., equities, bonds, commodities), and each category is allotted a fraction of the portfolio risk. In general, each of the N assets in a category is allotted 1/N of the category risk, although this is imperfect when two assets have very different volatility (e.g., intermediate versus long-term treasuries).

Portfolio volatility management has the effect of reducing the allocation to an asset during highly volatile periods and increasing the allocation during low-volatility periods. Insofar as returns are very poorly predicted by volatility, over long periods this adjustment has little effect on returns. However, the weighted-average asset volatility experienced by the portfolio is less than the average asset volatility over the same period of time. This type of volatility-based adjustment is a simple way to improve the Sharpe ratio.

Selecting a basket of assets

The last forty years has been in a regime with falling bond interest rates, which has provided reliable safety assets to pair with equities. Over this period, the volatility management approach would have negotiated the biggest crashes with relative equanimity. The opposite was true from the 1950s through the early 1980s, which would have taken a big toll on an equity/treasury portfolio. One of my big concerns is that the assumptions valid for the last forty years are not likely to hold nearly as well in the next decade, which means that it would be very useful to be able to avoid making long-term predictions of which assets are likely to do well.

Asset momentum is used to describe the tendency for assets to trend for an extended period of time. During such trends, there is a certain amount of predictability regarding the future behavior, but it’s not really possible to know when the predictable trend will end. The famous dual momentum approach is an example of how one might try to exploit momentum using monthly tests of signals.

I allow that many monthly approaches may have been effective in the days when trading had large friction costs. However, I am a bit of a skeptic for many momentum approaches going forward, because I think that the long-term trends exploited by monthly testing in the past are likely to be rare going forward, given the prevalence of algorithmic trading and cheap trading. From this perspective, simply swapping one asset for another based on a monthly signal may have a rather small statistical edge.

Nevertheless, I am attracted to momentum approaches to provide a statistical edge in basket selection. My backtesting suggests that it may be reasonable to use relative momentum to discard poor assets; discarding something like 60 percent of candidate assets seems to work relatively well for generating a reasonably diversified basket for the portfolio volatility minimization to chew on. Selecting much fewer assets seems to give more random selections (maybe very good, maybe not very good), while selecting more assets starts to be overly inclusive. I have not quantified the effect rigorously, however.

Determining the momentum period is art, not science. With a single momentum period, I find that one month is too short and a year is too long. Limited testing suggests that using returns from the previous two or three months may be reasonable during a crash and the start of recovery, but will tend to swap assets in and out fairly frequently. Including a longer-term component (e.g., nine months) helps with identifying consistent trends when volatility is low. As a first approach, I am likely to use the average of the 2- and 9-month returns as my momentum value.

Rebalancing

There are three aspects of rebalancing that seem to be important: (i) adapting the asset allocation to account for changes in the risk profile, (ii) updating the basket of assets to account for changes in trends, and (iii) taking advantage of asset fluctuations around the desired asset allocation.
There’s a case to be made that quarterly rebalancing (around the turn of the quarter) has some advantages with HFEA. I don’t think this is the case with the approach I am describing. In my backtesting, it seems that you can get away with fairly infrequent rebalancing (e.g., monthly) during trending periods, but during high-volatility periods the portfolio is forced to rely on timing luck without frequent rebalancing. Timing luck that can really help or really kill performance.

I ran the same backtest with identical parameters except for rebalancing frequency (21, 10, 5, and 1 days, respectively), using 6 assets selected from a basket of 16 candidate assets each rebalance date. The candidate basket included 10 3x sector equity LETFs, 2x gold, 3x and -3x long-term treasuries, -3x S&P 500, and 1x commodities (DBC). The basket was selected using the average of 2- and 9-month returns. The period was from DBC inception late in 2006 to last Friday. The equity category was allowed 3.75x the risk contribution of the treasury category, 3x the contribution of the commodity category, and 30x the contribution of the gold category. The gold risk illustrates adjustments needed with low-volatility assets (relative to other assets); without such a low risk contribution given to gold, it would always dominate the portfolio. The results are not all that sensitive to the allocations, within reason. For comparison, a 3/1 equity/treasury weight with UPRO/TMF would average out at about 55/45 UPRO/TMF over time.

Calculated CAGR was about 33, 37, 42, and 48 percent for 21, 10, 5, and 1 days between rebalancing. Of course, these values are likely optimistic.
Roughly 4.5 percent increase in CAGR each time. Interestingly, the 21-day rebalance and the 1-day rebalance were roughly equivalent until 2020, with the 10- and 5-day rebalances lagging. The 21-day case is a beautiful example of timing luck, hitting the lottery in 2008/2009 and missing big-time in 2020; it's still down >50 percent from its pre-covid high.

I think that decreasing rebalance duration from 21 to 5 days largely improved the volatility management and to some extent improved the selection of the asset basket. The last increment from 5 to 1 days provided improvement because of the rebalancing bonus from fluctuations about the desired allocation. Of course, it’s entirely possible that I screwed up the coding and put some invalid lookahead. That’s still to be double-checked, but I got exactly the same type of improvement in CAGR going from 5 to 1 days with just UPRO and TMF using entirely separate code.

I used the 1x equivalents of all 16 candidate assets. SPY alone had a CAGR of ~9.6 percent, while the 5- and 1-day rebalance had ~10.5 and ~11.5 percent, respectively.

The following plots give an idea of the performance with 1-, 5-, 10-, and 21-day rebalancing. In each one, the top plot shows the allocation for each asset over time, the middle plot shows the adjusted returns (including dividends and splits), and the bottom shows asset variance (red is large). The rows in the top and bottom plots are identical; the color code in the top and middle is identical. The red curve is the portfolio returns, neglecting slippage.

1-day rebalancing
Image

5-day rebalancing
Image

10-day rebalancing
Image

21-day rebalancing
Image

I'd be happy to answer questions, but I think I'm pretty close to a stopping point with development of the ideas. I'll likely be playing with how to implement a simple bot for this next. I imagine folks will either already know how to do that or have no interest, so updates are likely to be sparse going forward.

I hope this is interesting for folks.
DarkMatter731
Posts: 224
Joined: Sat Apr 25, 2020 8:28 am

Re: Refinements to Hedgefundie's excellent approach

Post by DarkMatter731 »

HEDGEFUNDIE wrote: Sat Jul 06, 2019 5:48 pm For a risk to be understated or overstated, there needs to be some notion of ordinary likelihood or probability that the risk would come to pass.

I am still waiting for someone to explain to me how we could return to a world where stocks are dropping year over year while long term Treasury rates are rising year over year.
Quoting for posterity.

Looks at the past year.
bigblue1ca
Posts: 28
Joined: Sat Jul 17, 2021 8:09 am
Location: Canada

Re: Refinements to Hedgefundie's excellent approach

Post by bigblue1ca »

Hydromod wrote: Sat May 21, 2022 10:18 pm I hope this is interesting for folks.
Fascinating thanks for the update!
laurenthu
Posts: 10
Joined: Tue Aug 17, 2021 9:58 am

Re: Refinements to Hedgefundie's excellent approach

Post by laurenthu »

Hello Hydromod, thanks for sharing this with us, this is very generous of you!

I would like to help with the coding to make sure that everyone can follow the system if they wish, and would do so via Google Colab (easy to use online python notebooks) but I would firt like to make sure I understand everything correctly. The starting basket is clear - you have shared it above. We take 6 out of 15 based on the average of 2months and 9month momentum - clear, so I take the 2 month return, the 9 month return, add them and take the top 6.
Now the issue comes after that... You are describing doing some minimum variance with risk budgetting, did you mean risk parity with budgetting? In that case, can you describe which ETF you put in which category, and how much you give per category? Also, what do you do if a category is totally absent - like commodity or gold or treasury might be totally absent from the top6 right?

Here is the first version of the code - I took the top6, lookback of 3 months for the risk parity and so far an equal budgetting (= risk parity between the top 6 assets, which means equal risk given to the equity assets (3 assets), the treasury (1 asset = TMV this week), 2x Gold and commodity. Happy to find a better way to tackle this budget part once I understand all scenarios better...
For now this is what the algo gives me:

CURE DBC SPXU TMV UGL UTSL
weights 22.5% 15.1% 21.4% 13.9% 16.3% 10.8%

https://colab.research.google.com/drive ... sp=sharing
Last edited by laurenthu on Mon May 23, 2022 8:30 am, edited 2 times in total.
User avatar
privatefarmer
Posts: 779
Joined: Mon Sep 08, 2014 2:45 pm

Re: Refinements to Hedgefundie's excellent approach

Post by privatefarmer »

This is incredible work, Hydromod. Thank you for posting.

I’ve been paying PV the annual fee for calculating the allocations / minimum variance each month. It sounds like you’re doing this yourself? Have you setup an excel sheet to do this for you or do you just do the min variance calculations by hand each rebalance? Would love to pick your brain on this bc I fear one day PV may shut down and I haven’t been able to figure out how to do the calculations myself. Thanks!
laurenthu
Posts: 10
Joined: Tue Aug 17, 2021 9:58 am

Re: Refinements to Hedgefundie's excellent approach

Post by laurenthu »

privatefarmer wrote: Mon May 23, 2022 8:14 am
Easily done with Google Colab for example, see my first attempt with my understanding up here...
Topic Author
Hydromod
Posts: 1051
Joined: Tue Mar 26, 2019 10:21 pm

Re: Refinements to Hedgefundie's excellent approach

Post by Hydromod »

laurenthu wrote: Mon May 23, 2022 8:28 am
privatefarmer wrote: Mon May 23, 2022 8:14 am
Easily done with Google Colab for example, see my first attempt with my understanding up here...
I do this with Matlab. I think that the Colab approach should be an excellent option as well. Hopefully a few eyes on this would make sure that it is more robust than I can do alone.

I think that the Colab approach would be a better solution than PV, because you will be able to tune the risk budget for each asset a bit better, and work with more frequent rebalancing during periods with high volatility. Another advantage is that you should be able to set it to do automatic daily rebalancing trades for you, which would be a tremendous blessing.

If we get this going, I'd like to have it simple enough for my english major wife and powerful enough for me...
Kbg
Posts: 355
Joined: Thu Mar 23, 2017 11:33 am

Re: Refinements to Hedgefundie's excellent approach

Post by Kbg »

Hydromod,

How are you accounting for trading costs/trade slippage?

Unless you are a market maker/HFT outfit, weekly or more frequent trading period performance is significantly impacted by slippage and any stated results are suspect at best beyond quarterly trading if not explicitly captured.
User avatar
LadyGeek
Site Admin
Posts: 95686
Joined: Sat Dec 20, 2008 4:34 pm
Location: Philadelphia
Contact:

Re: Refinements to Hedgefundie's excellent approach

Post by LadyGeek »

Here's an open-source version of MATLAB: GNU Octave

If this project follows through, I'll be more than happy to put it in the wiki: Using open source software for portfolio analysis

FYI - There's already a version of this portfolio in R. See the section "Risk parity strategy using 3x leveraged ETFs".

Feel free to start a dedicated thread for the project. Link to the thread from here so everyone will see it.
Wiki To some, the glass is half full. To others, the glass is half empty. To an engineer, it's twice the size it needs to be.
Topic Author
Hydromod
Posts: 1051
Joined: Tue Mar 26, 2019 10:21 pm

Re: Refinements to Hedgefundie's excellent approach

Post by Hydromod »

laurenthu wrote: Mon May 23, 2022 7:15 am Hello Hydromod, thanks for sharing this with us, this is very generous of you!

I would like to help with the coding to make sure that everyone can follow the system if they wish, and would do so via Google Colab (easy to use online python notebooks) but I would firt like to make sure I understand everything correctly. The starting basket is clear - you have shared it above. We take 6 out of 15 based on the average of 2months and 9month momentum - clear, so I take the 2 month return, the 9 month return, add them and take the top 6.
Now the issue comes after that... You are describing doing some minimum variance with risk budgetting, did you mean risk parity with budgetting? In that case, can you describe which ETF you put in which category, and how much you give per category? Also, what do you do if a category is totally absent - like commodity or gold or treasury might be totally absent from the top6 right?

Here is the first version of the code - I took the top6, lookback of 3 months for the risk parity and so far an equal budgetting (= risk parity between the top 6 assets, which means equal risk given to the equity assets (3 assets), the treasury (1 asset = TMV this week), 2x Gold and commodity. Happy to find a better way to tackle this budget part once I understand all scenarios better...
For now this is what the algo gives me:

CURE DBC SPXU TMV UGL UTSL
weights 22.5% 15.1% 21.4% 13.9% 16.3% 10.8%

https://colab.research.google.com/drive ... sp=sharing
Those numbers look reasonable off the top of my head.

I tend to set the risk budget for the stocks class at about 3 to 4 times the risk budget for bonds. The 3/1 weight applied with UPRO/TMF gives an average allocation like HFEA's 55/45.

I tend to set the risk budget for gold as a fraction of the risk budget for bonds. Maybe a third? I don't have a great basis for that, but I don't want it to get a high allocation.

Commodities also get a risk budget around 1/3 of stocks. So far just DBC and ERX (I don't have that in the example) would fall into that. Maybe SLV could be added to the "gold" or commodity categories, or the categories could be merged. ERX would be selected currently (it's trending well), but have a small weight (it's volatile).

I'm also planning on using GLDC as an example of a crypto class, but I don't have a strong basis for a class weight. Maybe halfway between equities and bonds?

These are just rules of thumb, not rigorously calibrated, but they seem to give reasonable allocations.

There's a bit of renormalization involved with the weights. I first normalize the class weights to sum to 1, and spread those to the assets (each asset usually gets 1/N of the class weight, where there are N assets in the class). Then the weights are set to zero for the assets that aren't in the basket, and everything is renormalized again. I set this up as a way to test different risk allocations in a broad brush way with relatively little bias, but there are other ways to skin the cat.

I find that sometimes there is reason to monkey with the weights inside a class when their volatilities are too different. My big example is TMF vs. TYD. I tend to prefer cutting down the risk for TYD to roughly 40 percent of TMF, just to cancel out durations. If TYD is used, it's a store of value more than anything, so I downgrade the volatility balance. Again, this is not finely tested, just a rule of thumb.

Hope that helps.
Topic Author
Hydromod
Posts: 1051
Joined: Tue Mar 26, 2019 10:21 pm

Re: Refinements to Hedgefundie's excellent approach

Post by Hydromod »

Kbg wrote: Mon May 23, 2022 9:25 am Hydromod,

How are you accounting for trading costs/trade slippage?

Unless you are a market maker/HFT outfit, weekly or more frequent trading period performance is significantly impacted by slippage and any stated results are suspect at best beyond quarterly trading if not explicitly captured.
The results in the recent figures don't account for slippage and there's no question that they are optimistic. An obvious next step is to try out some paper testing with live stocks, which I hope to do now that I have a promising algorithm.

I've done a bunch of testing with the minimum variance algorithm, holding the asset basket fixed but allowing the allocations to vary. For this testing, I assumed that I lost the bid-ask spread on each trade (just approximating with relatively recent values and not adjusting for volatility) and assumed that the assets were somewhere between their high and low for the day. That did cut down on returns significantly. That's one reason I point out that slippage is something to consider.

With that said, typically most trades will be pretty small. I haven't calculated turnover, though, that's another next step.

I do think that the method will rely on fairly frequent updating (weekly or biweekly), and even daily may be useful during high volatility periods. I speculate that the slippage would probably be worth it in this case.

I thoroughly agree that slippage is something to nail down pretty quickly.
laurenthu
Posts: 10
Joined: Tue Aug 17, 2021 9:58 am

Re: Refinements to Hedgefundie's excellent approach

Post by laurenthu »

Hydromod wrote: Mon May 23, 2022 9:52 am I tend to set the risk budget for gold as a fraction of the risk budget for bonds. Maybe a third? I don't have a great basis for that, but I don't want it to get a high allocation.

Commodities also get a risk budget around 1/3 of stocks. So far just DBC and ERX (I don't have that in the example) would fall into that. Maybe SLV could be added to the "gold" or commodity categories, or the categories could be merged. ERX would be selected currently (it's trending well), but have a small weight (it's volatile).

I'm also planning on using GLDC as an example of a crypto class, but I don't have a strong basis for a class weight. Maybe halfway between equities and bonds?

These are just rules of thumb, not rigorously calibrated, but they seem to give reasonable allocations.

There's a bit of renormalization involved with the weights. I first normalize the class weights to sum to 1, and spread those to the assets (each asset usually gets 1/N of the class weight, where there are N assets in the class). Then the weights are set to zero for the assets that aren't in the basket, and everything is renormalized again. I set this up as a way to test different risk allocations in a broad brush way with relatively little bias, but there are other ways to skin the cat.

I find that sometimes there is reason to monkey with the weights inside a class when their volatilities are too different. My big example is TMF vs. TYD. I tend to prefer cutting down the risk for TYD to roughly 40 percent of TMF, just to cancel out durations. If TYD is used, it's a store of value more than anything, so I downgrade the volatility balance. Again, this is not finely tested, just a rule of thumb.

Hope that helps.
That does help. What I coded is equal fraction to all selected ETFs, which ends up being 1/2 for equities, 1/6 for treasuries, 1/6 for commodities and 1/6 for gold this month - but could end up having significantly more on equities if we have more equities selected. If you are able to describe a simple rule set for setting up those weights I can (maybe not easily but we'll manage) implement them...
What I am understanding is the following with the ETFs you gave:
* Equities get X unit of risk
* Treasuries get X/3 unit of risk
* Commodities (=DBC here) get X/3 unit of risk
* Gold (=UGL) get X/3 unit of risk
It would be good to have the final list of ETFs as well as their status (I understand you can take ERX as commodity as well?) and then I can attempt to do this budgetting automatically...
User avatar
cos
Posts: 506
Joined: Fri Aug 23, 2019 7:34 pm
Location: Boston
Contact:

Re: Refinements to Hedgefundie's excellent approach

Post by cos »

Hydromod wrote: Mon May 23, 2022 9:52 am Those numbers look reasonable off the top of my head.
Maybe I missed it further up in the thread, but with the many empirically determined and arbitrarily set parameters driving your approach, aren't you a little worried about overfitting?
Topic Author
Hydromod
Posts: 1051
Joined: Tue Mar 26, 2019 10:21 pm

Re: Refinements to Hedgefundie's excellent approach

Post by Hydromod »

cos wrote: Mon May 23, 2022 11:10 am
Hydromod wrote: Mon May 23, 2022 9:52 am Those numbers look reasonable off the top of my head.
Maybe I missed it further up in the thread, but with the many empirically determined and arbitrarily set parameters driving your approach, aren't you a little worried about overfitting?
I agree, that's always a concern.

The whole point of the exercise, in my mind, is to keep the portfolio more-or-less stable rather than trying to shoot for the moon. I'm intentionally trying to not bias or optimize things too much, just stay near or a bit above the central tendency in a cloud of assets. Some of the knobs I put in to get a feel for behavior may even come off.

I think of this as a fairly minimalist approach, actually.
Topic Author
Hydromod
Posts: 1051
Joined: Tue Mar 26, 2019 10:21 pm

Re: Refinements to Hedgefundie's excellent approach

Post by Hydromod »

laurenthu wrote: Mon May 23, 2022 10:52 am That does help. What I coded is equal fraction to all selected ETFs, which ends up being 1/2 for equities, 1/6 for treasuries, 1/6 for commodities and 1/6 for gold this month - but could end up having significantly more on equities if we have more equities selected. If you are able to describe a simple rule set for setting up those weights I can (maybe not easily but we'll manage) implement them...
What I am understanding is the following with the ETFs you gave:
* Equities get X unit of risk
* Treasuries get X/3 unit of risk
* Commodities (=DBC here) get X/3 unit of risk
* Gold (=UGL) get X/3 unit of risk
It would be good to have the final list of ETFs as well as their status (I understand you can take ERX as commodity as well?) and then I can attempt to do this budgetting automatically...
I don't have a final list, really. And this should ultimately probably allow the flexibility of running a 2x and 1x version as well, with folks free to try their own pet assets.

Say I have 19 assets: 13 equities, 2 treasuries (TMF/TMV), 2 commodities (DBC/ERX), 1 gold, and 1 crypto.
Starting class weights are 1, 1/3, 1/3, 1/9, 2/3.

A pure vanilla approach would have all classes equal, perhaps. These class risk allocations are a personal choice for the user.

I am intentionally biasing equities higher, that's where I want to take my risk. I'm biasing gold lower, because it doesn't have expected returns.

I'm uncertain about crypto, it's equity-like in some ways but has no expected returns, so I'm downgrading it from the equities. Crypto is a highly personal choice, IMO; one might lump it with gold or leave it out entirely.

With these selections, the asset weights are

each equity: 1 * (1/13)
each treasury: (1/3) * (1/2)
each commodity: (1/3) * (1/2)
gold: (1/9) * (1)
crypto: (2/3) * (1)

Zero out the assets outside of the selected basket.

Renormalize the remaining. That's the weight set.
User avatar
randyharris
Posts: 175
Joined: Wed Mar 18, 2020 7:45 pm

Re: Refinements to Hedgefundie's excellent approach

Post by randyharris »

Your take is more broad in scope, but somewhat reminiscent of my Triad, Triad+, Triad++ strategies which go into:

2/6 IWB, or SSO, or UPRO after large drawdowns, Treasuries/Bonds if momentum is negative
2/6 into the best performer of IWS or VXUS, Treasuries/Bonds if momentum is negative
1/6 into the best performer of SGOL or DBC, Treasuries/Bonds if momentum is negative
minimum 1/6 into the best performer of VCSH, VGSH, VGIT, and any amounts above not invested.
Topic Author
Hydromod
Posts: 1051
Joined: Tue Mar 26, 2019 10:21 pm

Re: Refinements to Hedgefundie's excellent approach

Post by Hydromod »

randyharris wrote: Mon May 23, 2022 12:37 pm Your take is more broad in scope, but somewhat reminiscent of my Triad, Triad+, Triad++ strategies which go into:

2/6 IWB, or SSO, or UPRO after large drawdowns, Treasuries/Bonds if momentum is negative
2/6 into the best performer of IWS or VXUS, Treasuries/Bonds if momentum is negative
1/6 into the best performer of SGOL or DBC, Treasuries/Bonds if momentum is negative
minimum 1/6 into the best performer of VCSH, VGSH, VGIT, and any amounts above not invested.
Yes. From my limited comparisons, I think that your strategies often do quite a bit better on returns, when I use the same set of assets over the same period. My feel is that there's more concentration risk with your strategies (which can be quite advantageous) at the cost of larger drawdowns. More risk and more reward.
User avatar
randyharris
Posts: 175
Joined: Wed Mar 18, 2020 7:45 pm

Re: Refinements to Hedgefundie's excellent approach

Post by randyharris »

FWIW - in my models with the dataset I have put together to get results back to 1980, the Triad strategies have a max drawdown of 15%. Certainly better than most conventional portfolios. I should add, that I think it quite possible to have a 20% to 25% drawdown with Triad++ given it's occasional 33% allocation to UPRO.

Also - I have adopted JW Keuning aka TrendXplorer, and Wouter Keller's strategy: Generalized Protective Momentum, GPM. I have what I call GPMv (v for variant.) I will personally be using an allocation of Triad++ and GPMv for my retirement portfolio. TrendXplorer gave me the go ahead to do a write up on my variant version of GPM, It has the highest risk adjusted metrics I've ever seen, and max drawdown of only around 8% back to 1980. The combination of those two strategies is just what the Dr ordered for me. Happy to share the data if interested.
Topic Author
Hydromod
Posts: 1051
Joined: Tue Mar 26, 2019 10:21 pm

Re: Refinements to Hedgefundie's excellent approach

Post by Hydromod »

randyharris wrote: Mon May 23, 2022 3:45 pm Also - I have adopted JW Keuning aka TrendXplorer, and Wouter Keller's strategy: Generalized Protective Momentum, GPM. I have what I call GPMv (v for variant.) I will personally be using an allocation of Triad++ and GPMv for my retirement portfolio. TrendXplorer gave me the go ahead to do a write up on my variant version of GPM, It has the highest risk adjusted metrics I've ever seen, and max drawdown of only around 8% back to 1980. The combination of those two strategies is just what the Dr ordered for me. Happy to share the data if interested.
I'm interested, nay, intrigued!
User avatar
randyharris
Posts: 175
Joined: Wed Mar 18, 2020 7:45 pm

Re: Refinements to Hedgefundie's excellent approach

Post by randyharris »

Hydromod wrote: Mon May 23, 2022 4:29 pm
randyharris wrote: Mon May 23, 2022 3:45 pm Also - I have adopted JW Keuning aka TrendXplorer, and Wouter Keller's strategy: Generalized Protective Momentum, GPM. I have what I call GPMv (v for variant.) I will personally be using an allocation of Triad++ and GPMv for my retirement portfolio. TrendXplorer gave me the go ahead to do a write up on my variant version of GPM, It has the highest risk adjusted metrics I've ever seen, and max drawdown of only around 8% back to 1980. The combination of those two strategies is just what the Dr ordered for me. Happy to share the data if interested.
I'm interested, nay, intrigued!
Here is an Excel file with two worksheets, one is 1980+ and the other 2000+, with data through today's close.

fwiw - I'll do a write up on GPMv soon, I try really hard to avoid data mining and not fit the strategy to prior events.

update: that write up on GPMv is now posted: https://dualmomentumsystems.com/?post=gpmv-is-born
Last edited by randyharris on Wed May 25, 2022 1:52 pm, edited 2 times in total.
Kbg
Posts: 355
Joined: Thu Mar 23, 2017 11:33 am

Re: Refinements to Hedgefundie's excellent approach

Post by Kbg »

If one is going to go down this road of more diversification...highly suggest heading over to the blog of allocatesmartly.com

LOTS of strategy write-ups and associated backtests.
Topic Author
Hydromod
Posts: 1051
Joined: Tue Mar 26, 2019 10:21 pm

Re: Refinements to Hedgefundie's excellent approach

Post by Hydromod »

Kbg wrote: Tue May 24, 2022 10:01 am If one is going to go down this road of more diversification...highly suggest heading over to the blog of allocatesmartly.com

LOTS of strategy write-ups and associated backtests.
I thoroughly agree. One of my faves.
User avatar
randyharris
Posts: 175
Joined: Wed Mar 18, 2020 7:45 pm

Re: Refinements to Hedgefundie's excellent approach

Post by randyharris »

Kbg wrote: Tue May 24, 2022 10:01 am If one is going to go down this road of more diversification...highly suggest heading over to the blog of allocatesmartly.com

LOTS of strategy write-ups and associated backtests.
I enjoy their blog, but most of the content is behind a paywall which I don't pay, very limited info if you don't have a subscription.
Topic Author
Hydromod
Posts: 1051
Joined: Tue Mar 26, 2019 10:21 pm

Re: Refinements to Hedgefundie's excellent approach

Post by Hydromod »

randyharris wrote: Mon May 23, 2022 4:51 pm Here is an Excel file with two worksheets, one is 1980+ and the other 2000+, with data through today's close.

fwiw - I'll do a write up on GPMv soon, I try really hard to avoid data mining and not fit the strategy to prior events.

update: that write up on GPMv is now posted: https://dualmomentumsystems.com/?post=gpmv-is-born
[ quoted link fixed by admin LadyGeek]

I tried downloading the file, I got a complaint about it. Apparently it wasn't happy about the extension.

I read the post though, it looks pretty good. I tried some head to head. Generally pretty similar results, not surprisingly. It looks like I pretty much fall between GPMv and Triad++, cross comparing plots For some reason I had the biggest drawdown in 2015, roughly 20% by eye. GPMv and Triad++ showed a little drop but nothing near as severe.
User avatar
randyharris
Posts: 175
Joined: Wed Mar 18, 2020 7:45 pm

Re: Refinements to Hedgefundie's excellent approach

Post by randyharris »

Hydromod wrote: Tue May 24, 2022 9:30 pm
randyharris wrote: Mon May 23, 2022 4:51 pm Here is an Excel file with two worksheets, one is 1980+ and the other 2000+, with data through today's close.

fwiw - I'll do a write up on GPMv soon, I try really hard to avoid data mining and not fit the strategy to prior events.

update: that write up on GPMv is now posted: https://dualmomentumsystems.com/?post=gpmv-is-born
[ quoted link fixed by admin LadyGeek]

I tried downloading the file, I got a complaint about it. Apparently it wasn't happy about the extension.

I read the post though, it looks pretty good. I tried some head to head. Generally pretty similar results, not surprisingly. It looks like I pretty much fall between GPMv and Triad++, cross comparing plots For some reason I had the biggest drawdown in 2015, roughly 20% by eye. GPMv and Triad++ showed a little drop but nothing near as severe.
I zipped the spreadsheet for you, maybe that will download.

https://dualmomentumsystems.com/resourc ... +.xlsm.zip

btw - my recommendation is to not eyeball it but calculate the metrics and compare the numbers not the chart. I do like the visual of charts, but always compare the metrics.

With how many components you have, I'm a bit surprised by the 2015 drawdown - are they highly correlated?
Last edited by randyharris on Wed May 25, 2022 1:52 pm, edited 1 time in total.
Topic Author
Hydromod
Posts: 1051
Joined: Tue Mar 26, 2019 10:21 pm

Re: Refinements to Hedgefundie's excellent approach

Post by Hydromod »

randyharris wrote: Tue May 24, 2022 10:09 pm
I zipped the spreadsheet for you, maybe that will download.

https://dualmomentumsystems.com/resourc ... +.xlsm.zip

[link fixed by admin LadyGeek]

btw - my recommendation is to not eyeball it but calculate the metrics and compare the numbers not the chart. I do like the visual of charts, but always compare the metrics.

With how many components you have, I'm a bit surprised by the 2015 drawdown - are they highly correlated?
Still nothing. Maybe the xlsm extension is raising some flag.

Usually I work with the metrics, the asset switching is so new that I haven't ported it to the part of my code that does the more realistic trading and calculates stats.

The 2015 thing looks like it got stuck in a general downdraft for six months or so. I guess that's the drawback of lots of assets, sometimes you have so many assets you can't completely duck a general downdraft.
User avatar
randyharris
Posts: 175
Joined: Wed Mar 18, 2020 7:45 pm

Re: Refinements to Hedgefundie's excellent approach

Post by randyharris »

Hydromod wrote: Tue May 24, 2022 10:48 pm
randyharris wrote: Tue May 24, 2022 10:09 pm
I zipped the spreadsheet for you, maybe that will download.

https://dualmomentumsystems.com/resourc ... +.xlsm.zip

[link fixed by admin LadyGeek]

btw - my recommendation is to not eyeball it but calculate the metrics and compare the numbers not the chart. I do like the visual of charts, but always compare the metrics.

With how many components you have, I'm a bit surprised by the 2015 drawdown - are they highly correlated?
Still nothing. Maybe the xlsm extension is raising some flag.

I guess that's the drawback of lots of assets, sometimes you have so many assets you can't completely duck a general downdraft.
Try a different browser, I downloaded on three different browsers successfully testing the links.

With regard to the comment:

I guess that's the drawback of lots of assets, sometimes you have so many assets you can't completely duck a general downdraft.

I don’t much agree with that as I read it, I would offer that it more depends on the details regarding switching to risk off from risk on, whether it be scaling, wholesale moves, min vol, etc. Ideally the the more assets, the more options presented to avoid that downdraft. Too many moving parts and you are relegated to mostly short term gains. Triad shines in this regard with mostly long term gains - some need the tax effficiency others are in tax deferred.
Gecko10x
Posts: 390
Joined: Thu Jun 06, 2013 8:10 pm

Re: Refinements to Hedgefundie's excellent approach

Post by Gecko10x »

I wonder if it's possible to build this (maybe simplified) with composer.trade?
bigblue1ca
Posts: 28
Joined: Sat Jul 17, 2021 8:09 am
Location: Canada

Re: Refinements to Hedgefundie's excellent approach

Post by bigblue1ca »

randyharris wrote: Tue May 24, 2022 10:09 pm
I zipped the spreadsheet for you, maybe that will download.

https://dualmomentumsystems.com/resourc ... +.xlsm.zip
[quoted link fixed by admin LadyGeek]

Works for me FYI.
Topic Author
Hydromod
Posts: 1051
Joined: Tue Mar 26, 2019 10:21 pm

Re: Refinements to Hedgefundie's excellent approach

Post by Hydromod »

Gecko10x wrote: Wed May 25, 2022 6:04 am I wonder if it's possible to build this (maybe simplified) with composer.trade?
Not as the interface currently works. However, apparently they've expressed some interest in talking with me, and I let them know I'd be interested in talking with them. So we'll see how it goes.
laurenthu
Posts: 10
Joined: Tue Aug 17, 2021 9:58 am

Re: Refinements to Hedgefundie's excellent approach

Post by laurenthu »

Hydromod would you mind posting your Excel files and / or some metrics of your system please - CAGR, maxDD, sharpe and Sortino?

I will adapt my Colab with the weigths you gave earlier here, but before that I would like to make sure I have the final basket (so everything you indicated up here + ERX) and understand what happens if, for example, we have no ETF for one of the category - my understanding is the weight is then redistributed across other categories right?
So if I have 3 equity ETF, 2 treasury and 1 gold:
The gold gets 1/9th of weight
The treasuries are getting 1/6th of weight each
The equity will get 1/2nd of weight each

then renormalized and distributed based on risk... Right?
Topic Author
Hydromod
Posts: 1051
Joined: Tue Mar 26, 2019 10:21 pm

Re: Refinements to Hedgefundie's excellent approach

Post by Hydromod »

randyharris wrote: Tue May 24, 2022 11:19 pm Try a different browser, I downloaded on three different browsers successfully testing the links.

It's not the browser, I can download the file, it's the download manager that is particular. I'm forced into being extra careful with the computer I'm using.

With regard to the comment:

I guess that's the drawback of lots of assets, sometimes you have so many assets you can't completely duck a general downdraft.

I don’t much agree with that as I read it, I would offer that it more depends on the details regarding switching to risk off from risk on, whether it be scaling, wholesale moves, min vol, etc. Ideally the the more assets, the more options presented to avoid that downdraft. Too many moving parts and you are relegated to mostly short term gains. Triad shines in this regard with mostly long term gains - some need the tax effficiency others are in tax deferred.

We're saying the same thing, it's in the implementation. Basically this philosophy to gently nudge towards the top of a cloud of assets, while yours is to concentrate into a few high-performing assets. I always run the top ~40 percent of the available assets, no switching between risk on and risk off, somewhere between 35 and 45 percent seems to give overall highest returns in the cases I tested.

So when only one or two assets in the cloud offer protection, the portfolio gets downdrafted. In the long run it seems to work out ok, but probably there should be some backstopping.

You have a better chance of ducking such events, because your algorithm concentrates into just one or two assets. No right or wrong, just different concentrations.

However, I am looking into possible ways of nudging risk allocations towards favoring higher-trending assets, which may help a bit.
User avatar
randyharris
Posts: 175
Joined: Wed Mar 18, 2020 7:45 pm

Re: Refinements to Hedgefundie's excellent approach

Post by randyharris »

Hydromod wrote: Wed May 25, 2022 8:34 am
randyharris wrote: Tue May 24, 2022 11:19 pm Try a different browser, I downloaded on three different browsers successfully testing the links.

It's not the browser, I can download the file, it's the download manager that is particular. I'm forced into being extra careful with the computer I'm using.

With regard to the comment:

I guess that's the drawback of lots of assets, sometimes you have so many assets you can't completely duck a general downdraft.

I don’t much agree with that as I read it, I would offer that it more depends on the details regarding switching to risk off from risk on, whether it be scaling, wholesale moves, min vol, etc. Ideally the the more assets, the more options presented to avoid that downdraft. Too many moving parts and you are relegated to mostly short term gains. Triad shines in this regard with mostly long term gains - some need the tax effficiency others are in tax deferred.

We're saying the same thing, it's in the implementation. Basically this philosophy to gently nudge towards the top of a cloud of assets, while yours is to concentrate into a few high-performing assets. I always run the top ~40 percent of the available assets, no switching between risk on and risk off, somewhere between 35 and 45 percent seems to give overall highest returns in the cases I tested.

So when only one or two assets in the cloud offer protection, the portfolio gets downdrafted. In the long run it seems to work out ok, but probably there should be some backstopping.

You have a better chance of ducking such events, because your algorithm concentrates into just one or two assets. No right or wrong, just different concentrations.

However, I am looking into possible ways of nudging risk allocations towards favoring higher-trending assets, which may help a bit.
Appreciate that explanation thanks, I get it now. Would that type of strategy not have a tough time in prior periods like 1999 - 2002, and Late 2007 - March 2009?
User avatar
randyharris
Posts: 175
Joined: Wed Mar 18, 2020 7:45 pm

Re: Refinements to Hedgefundie's excellent approach

Post by randyharris »

Hydromod wrote: Tue May 24, 2022 10:48 pm
randyharris wrote: Tue May 24, 2022 10:09 pm
I zipped the spreadsheet for you, maybe that will download.

https://dualmomentumsystems.com/resourc ... +.xlsm.zip

[link fixed by admin LadyGeek]

btw - my recommendation is to not eyeball it but calculate the metrics and compare the numbers not the chart. I do like the visual of charts, but always compare the metrics.

With how many components you have, I'm a bit surprised by the 2015 drawdown - are they highly correlated?
Still nothing. Maybe the xlsm extension is raising some flag.
I think I know what is going on now - you mentioned your computer is really locked down, my Excel file has VBA code to calculate the drawdowns, Sortino ratio, and UlcerIndex. I pasted those all as values, and here is a copy without the VBA code - guessing it will work for you on that locked down machine.

https://dualmomentumsystems.com/resourc ... iad++.xlsx
Topic Author
Hydromod
Posts: 1051
Joined: Tue Mar 26, 2019 10:21 pm

Re: Refinements to Hedgefundie's excellent approach

Post by Hydromod »

randyharris wrote: Wed May 25, 2022 8:43 am Appreciate that explanation thanks, I get it now. Would that type of strategy not have a tough time in prior periods like 1999 - 2002, and Late 2007 - March 2009?
It actually does pretty well at avoiding drawdowns in those periods. It seems to find enough assets to at least hold its own. 2000 to 2003 is basically a plateau, you can see from 2007 on in the last series of plots above.

The xlsx file downloaded just fine. The VBA was the problem. Thanks.
Topic Author
Hydromod
Posts: 1051
Joined: Tue Mar 26, 2019 10:21 pm

Re: Refinements to Hedgefundie's excellent approach

Post by Hydromod »

laurenthu wrote: Wed May 25, 2022 8:25 am Hydromod would you mind posting your Excel files and / or some metrics of your system please - CAGR, maxDD, sharpe and Sortino?

I will adapt my Colab with the weigths you gave earlier here, but before that I would like to make sure I have the final basket (so everything you indicated up here + ERX) and understand what happens if, for example, we have no ETF for one of the category - my understanding is the weight is then redistributed across other categories right?
So if I have 3 equity ETF, 2 treasury and 1 gold:
The gold gets 1/9th of weight
The treasuries are getting 1/6th of weight each
The equity will get 1/2nd of weight each

then renormalized and distributed based on risk... Right?
I don't really have a "final" basket, that should really be up to the user.

In the example, I have 19 assets: 13 equities, 2 treasuries (TMF/TMV), 2 commodities (DBC/ERX), 1 gold, and 1 crypto.
Starting class weights are 1, 1/3, 1/3, 1/9, 2/3.

We want sum w_eq = 1, sum w_tr = 1/3, sum w_go = 1/9

So the weights will be [1/3 1/3 1/3 1/6 1/6 1/9].

Another way, spread weights uniformly by category

% [eq eq eq tr tr go]
w = [1 1 1 1/3 1/3 1/9]

Assign weight fraction by number of active assets in the category

f = [1/3 1/3 1/3 1/2 1/2 1]

Multiply the two

w* = w * f = [1/3 1/3 1/3 1/6 1/6 1/9]

Renormalize

sum(w*) = 13/9
r = w* / sum(w*) = [1/3 1/3 1/3 1/6 1/6 1/9] / (13/9) = [3/13 3/13 3/13 3/26 3/26 1/13]

w is the category weight
f is the fraction of the category weight to the asset

I would add a special case for weighting low-volatility assets, because they can be given too much weight.

For example, the approach will tend to overweight TYD relative to TMF in my opinion. There should be a way to scale the risk by individual asset.

Say the two treasuries are TMF and TYD. Duration for TYD is about 0.4 duration for TMF, and I want each to have approximately equal allocations. So in this case, I'd have the additional vector

d = [1 1 1 1 0.4 1] for [eq eq eq TMF TYD go]

and w* = w * f * d. The renormalization is the same.

There are other tweaks that can be tried down the line, once this is working. Maybe to try assigning a bit higher risk to better-trending assets. I haven't tested this idea, so I have no idea how well it would work.

Another idea would be to gradually add and subtract assets, to reduce whipsaws in allocations.

Hope this helps.

Edit:

The original weighting idea was developed with a set of fixed assets.

After a little more thought, it might be more consistent to just have a full set of vectors determined up front

% eq bond comm metal
w = [we we ... we wb wb ... wc wc ... wm wm ...]
f = [1/Ne 1/Ne ... 1/Ne 1/Nb 1/Nb ... 1/Nc 1/Nc ... 1/Nm 1/Nm ...]
d = [1 1 ... 1 d1 d2 ... 1 1 ... 1 1 ...]
ws = w * f * d

zero out entries based on trends

renormalize.

The w values are based on the user's desired allocation of risk among categories.
User avatar
LadyGeek
Site Admin
Posts: 95686
Joined: Sat Dec 20, 2008 4:34 pm
Location: Philadelphia
Contact:

Re: Refinements to Hedgefundie's excellent approach

Post by LadyGeek »

FYI - The links to randharris's files were using http:// protocol, which is insecure. Firefox and Chrome both complained about that. I have revised those links to reflect the https:// secure protocol.

(The details were worked out via PM with randyharris.)
Wiki To some, the glass is half full. To others, the glass is half empty. To an engineer, it's twice the size it needs to be.
JBTX
Posts: 11227
Joined: Wed Jul 26, 2017 12:46 pm

Re: Refinements to Hedgefundie's excellent approach

Post by JBTX »

DarkMatter731 wrote: Sun May 22, 2022 11:00 am
HEDGEFUNDIE wrote: Sat Jul 06, 2019 5:48 pm For a risk to be understated or overstated, there needs to be some notion of ordinary likelihood or probability that the risk would come to pass.

I am still waiting for someone to explain to me how we could return to a world where stocks are dropping year over year while long term Treasury rates are rising year over year.
Quoting for posterity.

Looks at the past year.
From mid 2019:
HEDGEFUNDIE wrote: Sat Jul 06, 2019 7:38 am
MoneyMarathon wrote: Sat Jul 06, 2019 2:52 am Suppose someone starts this right now, and over the next year, the Fed decides that employment looks good and raises rates to 3.5% from their current levels. Around the same time, stock market investors get nervous,t then full-out panic after a war breaks out somewhere, and stocks dip 40% in a few months. These things happen in the same year.

What happens when both duration risk and equity risk get pummeled at the same time? How bad is the outcome?
As soon as the Fed begins to get an inkling of “stock market investors getting nervous”, do you think they would continue their rate raising? Witness what happened in December when stocks dropped 20%.
laurenthu
Posts: 10
Joined: Tue Aug 17, 2021 9:58 am

Re: Refinements to Hedgefundie's excellent approach

Post by laurenthu »

OK I changed my code to take your allocations into account, and actually made it something changeable in the code.
https://colab.research.google.com/drive ... sp=sharing
The allocation seems ballpark OK to me with currently the following:
DBC ERX SPXU TMV UGL UTSL
weights 18.0% 9.5% 22.0% 18.0% 6.6% 25.8%
The gold weight will always be quite small with the 1/9th risk weight but I suppose that is OK.

I would still be interested to have your full backtest to better gauge risk and understand the exact parameters you used when testing for your post above, as this is very hard to test in PV or anything else... Please PM to me if you do not desire to post it here?
Also please do tell me if you want any modification of the code, any questions / suggestions you have etc.
Topic Author
Hydromod
Posts: 1051
Joined: Tue Mar 26, 2019 10:21 pm

Re: Refinements to Hedgefundie's excellent approach

Post by Hydromod »

laurenthu wrote: Thu May 26, 2022 7:14 am OK I changed my code to take your allocations into account, and actually made it something changeable in the code.
https://colab.research.google.com/drive ... sp=sharing
The allocation seems ballpark OK to me with currently the following:
DBC ERX SPXU TMV UGL UTSL
weights 18.0% 9.5% 22.0% 18.0% 6.6% 25.8%
The gold weight will always be quite small with the 1/9th risk weight but I suppose that is OK.

I would still be interested to have your full backtest to better gauge risk and understand the exact parameters you used when testing for your post above, as this is very hard to test in PV or anything else... Please PM to me if you do not desire to post it here?
Also please do tell me if you want any modification of the code, any questions / suggestions you have etc.
I'll try to take a look at the code tonight, but I'm preparing to be on vacation through next week and I likely won't be very responsive for a while. Hopefully I can quickly get a spreadsheet together with an example, but I'm dubious that it will be in the next day or two.

Your numbers are right in the ballpark of what I'm getting.

The gold weight will tend to be higher than one might think, because 2x gold has lower volatility than the 3x LETFs. That means the minimum variance algorithm wants to give UGL high allocations to minimize overall portfolio volatility. The same thing applies when using TYD instead of TMF; TYD gets much higher allocations than TMF.

Note that the risk weights are intended to bias towards the assets that you want to emphasize. I don't expect returns from gold. I'd rather bias towards assets that produce returns over time. Others may want to bias higher or lower, according to their own situation.
Topic Author
Hydromod
Posts: 1051
Joined: Tue Mar 26, 2019 10:21 pm

Re: Refinements to Hedgefundie's excellent approach

Post by Hydromod »

laurenthu wrote: Thu May 26, 2022 7:14 am OK I changed my code to take your allocations into account, and actually made it something changeable in the code.
https://colab.research.google.com/drive ... sp=sharing
The allocation seems ballpark OK to me with currently the following:
DBC ERX SPXU TMV UGL UTSL
weights 18.0% 9.5% 22.0% 18.0% 6.6% 25.8%
The gold weight will always be quite small with the 1/9th risk weight but I suppose that is OK.

I would still be interested to have your full backtest to better gauge risk and understand the exact parameters you used when testing for your post above, as this is very hard to test in PV or anything else... Please PM to me if you do not desire to post it here?
Also please do tell me if you want any modification of the code, any questions / suggestions you have etc.
I made up a Google Sheet file to demonstrate the selection of assets and calculation of risk weights. I don't do the minimization, because it's too awkward in Sheets, but I think that the colab file does the minimization adequately.

The file is here.

This file is more for testing and demonstrating than for actual production. There are 19 possible assets. I don't have any glitzy way to add or subtract assets, but the calculations are intended to be extensible by adding columns.

Each sheet has a separate calculation. The Info sheet gives a little information on each one.

The Control sheet sets parameters. The momentum used for selecting assets is the average of a fast and slow momentum; these durations can be changed.

The risk budget is set by class, then subdivided by the number of assets active in each class and normalized.

The one little twist is that the number of assets can be variable within a range. The idea is to select assets with positive momentum, up to a limit of nmax. It is required that a minimum number of assets is selected regardless of whether the momentum is positive or not. Inverse LETFs with momentum within the top nmax are always selected, even if their momentum is negative.

The result is sometimes a mix of bull and inverse LETFs.

The minimization software tends to hedge with the inverse LETFs during periods of volatility, like the last few months. Currently the selection is an inverse 3x HFEA (a little more than 1/3 of the allocation) and the rest is 1x, 2x, and 3x LETFs (UTSL/DBC/ERX/UGL).

Hopefully this spreadsheet should be fairly self explanatory.
bigblue1ca
Posts: 28
Joined: Sat Jul 17, 2021 8:09 am
Location: Canada

Re: Refinements to Hedgefundie's excellent approach

Post by bigblue1ca »

Hydromod wrote: Sat Jun 11, 2022 8:57 pm Hopefully this spreadsheet should be fairly self explanatory.
Thank you for putting that together and sharing it. Made sense.
User avatar
burritoLover
Posts: 4097
Joined: Sun Jul 05, 2020 12:13 pm

Re: Refinements to Hedgefundie's excellent approach

Post by burritoLover »

UPRO/TMF portfolio has probably had a really awesome year so far. :twisted:
laurenthu
Posts: 10
Joined: Tue Aug 17, 2021 9:58 am

Re: Refinements to Hedgefundie's excellent approach

Post by laurenthu »

Thanks for posting hydromod! I will have some work to do to adapt the colab to this but it should be doable. I will let you all know when it's done!
User avatar
randyharris
Posts: 175
Joined: Wed Mar 18, 2020 7:45 pm

Re: Refinements to Hedgefundie's excellent approach

Post by randyharris »

Curious to hear the CAGR and metrics, intriguing.
Topic Author
Hydromod
Posts: 1051
Joined: Tue Mar 26, 2019 10:21 pm

Re: Refinements to Hedgefundie's excellent approach

Post by Hydromod »

randyharris wrote: Mon Jun 13, 2022 8:14 pm Curious to hear the CAGR and metrics, intriguing.
I'm still working to add this strategy to my trading module, which assumes the same assets throughout. I'll post as soon as I have it added.

I converted my Roth portfolio three weeks ago. After Monday, the portfolio is up about 1.7 percent with about 36 percent of the volatility of SPY over this period, even with a fair amount of slippage during the swap. That's just the behavior I'm aiming for, smooth and steady. Obviously a very limited period during a trending market, but definitely encouraging.

Now I have to figure out a good way around wash sales in taxable. A weekly rebalance strategy may be useful in volatile markets but will inevitably result in selling and buying the same asset within 30 days. I'm considering the possibilities of using 2x assets as a trading partner with the 3x assets to handle the buyback amounts.

Maybe use the 2x to accumulate the buybacks until the 3x has gone 30 days without a sale, then convert the 2x back to 3x.

This might need a fallback if rebalancing wants to accumulate to 2x within 30 days. Maybe a chain from 1x to 2x to 3x will work within the weekly trading schedule.

These are details that matter with a trading bot.
Topic Author
Hydromod
Posts: 1051
Joined: Tue Mar 26, 2019 10:21 pm

Re: Refinements to Hedgefundie's excellent approach

Post by Hydromod »

randyharris wrote: Mon Jun 13, 2022 8:14 pm Curious to hear the CAGR and metrics, intriguing.
I ported the trend-following part into my trading algorithm today, at least enough to do some quick checks.

Using 19 assets and trading every 5 days seems to give comparable performance to the Profit Farmer. Over the last ten years, CAGR above risk-free is 31%, standard deviation of 32%, Sharpe of 1.2, max drawdown ~35% (2020), 2022 max drawdown ~22%.

Over the last five years, CAGR above risk-free is 24%, standard deviation of 33%, Sharpe of 0.98.

I use all of the Profit Farmer assets, plus 7 3x equity, some 2x equity/gold/commodity, some 1x commodity, and 3x inverse (SPXU and TMV). No periods going to cash.

I don't get nearly as good behavior during these periods as Profit Farmer by trend following with the top Profit Farmer assets, or even just running my version of the risk-budget minimum variance. Dunno why.

The period since 2014 has been the challenging period for trend following. The strategy has better statistics 2000-2014 and much better prior to 2000.
User avatar
randyharris
Posts: 175
Joined: Wed Mar 18, 2020 7:45 pm

Re: Refinements to Hedgefundie's excellent approach

Post by randyharris »

Hydromod wrote: Sat Jun 18, 2022 6:36 pm
randyharris wrote: Mon Jun 13, 2022 8:14 pm Curious to hear the CAGR and metrics, intriguing.
I ported the trend-following part into my trading algorithm today, at least enough to do some quick checks.

Using 19 assets and trading every 5 days seems to give comparable performance to the Profit Farmer. Over the last ten years, CAGR above risk-free is 31%, standard deviation of 32%, Sharpe of 1.2, max drawdown ~35% (2020), 2022 max drawdown ~22%.

Over the last five years, CAGR above risk-free is 24%, standard deviation of 33%, Sharpe of 0.98.

I use all of the Profit Farmer assets, plus 7 3x equity, some 2x equity/gold/commodity, some 1x commodity, and 3x inverse (SPXU and TMV). No periods going to cash.

I don't get nearly as good behavior during these periods as Profit Farmer by trend following with the top Profit Farmer assets, or even just running my version of the risk-budget minimum variance. Dunno why.

The period since 2014 has been the challenging period for trend following. The strategy has better statistics 2000-2014 and much better prior to 2000.
Sounds pretty awesome. How has it done specifically from December 2021 through current?
Post Reply