HEDGEFUNDIE's excellent adventure Part II: The next journey

Discuss all general (i.e. non-personal) investing questions and issues, investing news, and theory.
Marseille07
Posts: 16054
Joined: Fri Nov 06, 2020 12:41 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by Marseille07 »

This is turning into a pretty-backtest contest. MA duration should not be tweaked much. We can only look at the famous ones (say, 50MA, 200MA) that's it.

If you plug in numbers from 1~220 and find that 137MA worked the best...that's just curve-fitting.
Hydromod
Posts: 1052
Joined: Tue Mar 26, 2019 10:21 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by Hydromod »

Presumably you should have a spectrum of responses that are more-or-less similar as you vary the duration.

Although there may be an argument that there may be a slight bias towards lookbacks that are approximately integer months or integer quarters, given the hints that there may be minor monthly/quarterly cycles (based on apparently somewhat favorable rebalancing towards the end of the month/quarter).

Just spitballing for the fun of it here.
Marseille07
Posts: 16054
Joined: Fri Nov 06, 2020 12:41 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by Marseille07 »

MA itself isn't a very good indicator. The good news is, the damage of curve-fitting isn't terrible as you simply hold SPY or TLT. But if you lever it up, all bets are off.
millennialblues
Posts: 37
Joined: Sat Mar 06, 2021 4:07 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by millennialblues »

Marseille07 wrote: Tue Mar 23, 2021 10:20 am This is turning into a pretty-backtest contest. MA duration should not be tweaked much. We can only look at the famous ones (say, 50MA, 200MA) that's it.

If you plug in numbers from 1~220 and find that 137MA worked the best...that's just curve-fitting.
I’m still new to this, I only know these things in the abstract having not studied economics for 15 years, not having thought remotely about finance, math, or programming for about that amount of time.

But my guess is that backtests live and die based on this basic principle: financial markets are chaotic enough that while they express various repeating patterns of behavior, those patterns are never expressed in precisely the same way when repeated.

The future, as defined in modeling, is a much larger set than the past because it both includes as much of the past as possible but also all possible future expressions, most of them will never even occur! This is what make the future such a graveyard for backtesting, as the more narrow the model, the greater the likelihood of ‘black swan’ events where a low-probability + high-risk scenario makes the whole model go bust.

Back testing can help us see if a specific strategy can survive/thrive through a historical pattern. But if it’s dialed in too closely to a historical expression of that problem, it will not work as well through the future one (which will be faster or slower, deeper or shallower, etc).

In the case of leveraged funds, it seems like the highest-priority pattern is a crash. So we might ask: what are all of the species of a crash, not only historical but also future? What are the qualities to the S&L crisis, y2k dot.com bubble burst, GFC of ‘08, March’s COVID crash (and near-immediate recovery), and others?

But the upside also needs to be considered if we want sustained growth: how does evolutions in Fed and government policy shape what a recovery looks? Volcker’s war on inflation was followed by the long reign of Greenspan’s “even hand,” and we’re all expansionists now. Will bond rates then be low forever? The space between .25 and 0 is small, but any good mathematician would say that the space between them is still infinite even if it’s a smaller infinity than between 0 and 1.

Moreover, the underlying techniques and technologies of trading also haunt these questions: high-frequency trading has introduced the possibility of a flash-crash, though regulation+computation has also introduced automatic circuit breakers in periods. Older species of crash may have disappeared with the passing of older techniques, theories, and behavior. But those older patterns are more determinable than the future, as they have already happened.

I guess this is just a long way of saying back-testing succeeds somewhere between accounting for “everything” and “nothing.”
Last edited by millennialblues on Tue Mar 23, 2021 2:09 pm, edited 1 time in total.
Marseille07
Posts: 16054
Joined: Fri Nov 06, 2020 12:41 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by Marseille07 »

millennialblues wrote: Tue Mar 23, 2021 1:52 pm
Marseille07 wrote: Tue Mar 23, 2021 10:20 am This is turning into a pretty-backtest contest. MA duration should not be tweaked much. We can only look at the famous ones (say, 50MA, 200MA) that's it.

If you plug in numbers from 1~220 and find that 137MA worked the best...that's just curve-fitting.
I’m still new to this, I only know these things in the abstract having not studied economics for 15 years, not having thought remotely about finance, math, or programming for about that amount of time.

But my guess is that backtests live and die based on this basic principle: financial market are chaotic enough that while they express various repeating patterns of behavior, those patterns are never expressed in precisely the same way when repeated.

The future, as defined in modeling, is a much larger set than the past because it both includes as much of the past as possible but also all possible future expressions, most of them will never even occur! This is what make the future such a graveyard for backtesting, as the more narrow the model, the greater the likelihood of ‘black swan’ events where a low-probability + high-risk scenario makes the whole model go bust.

Back testing can help us see if a specific strategy can survive/thrive through a historical pattern. But if it’s dialed in too closely to a historical expression of that problem, it will not work as well through the future one (which will be faster or slower, deeper or shallower, etc).

In the case of leveraged funds, it seems like the highest-priority pattern is a crash. So we might ask: what are all of the species of a crash, not only historical but also future? What are the qualities to the S&L crisis, y2k dot.com bubble burst, GFC of ‘08, March’s COVID crash (and near-immediate recovery), and others?

But the upside also needs to be considered if we want sustained growth: how does evolutions in Fed and government policy shape what a recovery looks? Volcker’s war on inflation was followed by the long reign of Greenspan’s “even hand,” and we’re all expansionists now. Will bond rates then be low forever? The space between .25 and 0 is small, but any good mathematician would say that the space between them is still infinite even if it’s a smaller infinity than between 0 and 1.

Moreover, the underlying techniques and technologies of trading also haunt these questions: high-frequency trading has introduced the possibility of a flash-crash, though regulation+computation has also introduced automatic circuit breakers in periods.

I guess this is just a long way of saying back-testing succeeds somewhere between accounting for “everything” and “nothing.”
No worries, backtesting properly (in the sense of finding models that *make money*) is very difficult and very few people can do this.

In order to combat the issue you're describing above, one very well-known approach is to divide your dataset into in-sample and out-of-sample periods. You train your model using in-sample, and test against out-of-sample.
millennialblues
Posts: 37
Joined: Sat Mar 06, 2021 4:07 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by millennialblues »

Marseille07 wrote: Tue Mar 23, 2021 2:09 pm No worries, backtesting properly (in the sense of finding models that *make money*) is very difficult and very few people can do this.

In order to combat the issue you're describing above, one very well-known approach is to divide your dataset into in-sample and out-of-sample periods. You train your model using in-sample, and test against out-of-sample.
Oh! That makes sense. So train in time-window 1, test in time-windows 2. Brilliant.

The problem this poses for HFEA strategies is this: the most important behavior to test it against are crashes (especially large ones), but over the life of the funds, there haven’t been many. Moreover, future crashes will almost certainly exhibit some novel behavior.

I wonder how one might go about simulating possible market scenarios that have not yet happened? (Is that what Monte Carlo does, and how useful has it been for testing financial strategies?)
Marseille07
Posts: 16054
Joined: Fri Nov 06, 2020 12:41 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by Marseille07 »

millennialblues wrote: Tue Mar 23, 2021 2:26 pm
Marseille07 wrote: Tue Mar 23, 2021 2:09 pm No worries, backtesting properly (in the sense of finding models that *make money*) is very difficult and very few people can do this.

In order to combat the issue you're describing above, one very well-known approach is to divide your dataset into in-sample and out-of-sample periods. You train your model using in-sample, and test against out-of-sample.
Oh! That makes sense. So train in time-window 1, test in time-windows 2. Brilliant.

The problem this poses for HFEA strategies is this: the most important behavior to test it against are crashes (especially large ones), but over the life of the funds, there haven’t been many. Moreover, future crashes will almost certainly exhibit some novel behavior.

I wonder how one might go about simulating possible market scenarios that have not yet happened? (Is that what Monte Carlo does, and how useful has it been for testing financial strategies?)
Maybe I missed the memo, but if one really tested HFEA against the 70s then I thought it's a non-starter for anyone to use.

And hoping to never see the 70s again isn't a very good strategy, because it happened.
Hydromod
Posts: 1052
Joined: Tue Mar 26, 2019 10:21 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by Hydromod »

Marseille07 wrote: Tue Mar 23, 2021 2:28 pm
millennialblues wrote: Tue Mar 23, 2021 2:26 pm
Marseille07 wrote: Tue Mar 23, 2021 2:09 pm No worries, backtesting properly (in the sense of finding models that *make money*) is very difficult and very few people can do this.

In order to combat the issue you're describing above, one very well-known approach is to divide your dataset into in-sample and out-of-sample periods. You train your model using in-sample, and test against out-of-sample.
Oh! That makes sense. So train in time-window 1, test in time-windows 2. Brilliant.

The problem this poses for HFEA strategies is this: the most important behavior to test it against are crashes (especially large ones), but over the life of the funds, there haven’t been many. Moreover, future crashes will almost certainly exhibit some novel behavior.

I wonder how one might go about simulating possible market scenarios that have not yet happened? (Is that what Monte Carlo does, and how useful has it been for testing financial strategies?)

I find it useful to test the strategies against funds with different behavior, like EDC, DRN, UTSL, etc. Monte Carlo also can be used, but then there are issues with generating time series with realistic patterns.
Maybe I missed the memo, but if one really tested HFEA against the 70s then I thought it's a non-starter for anyone to use.

And hoping to never see the 70s again isn't a very good strategy, because it happened.
The original author thought about this, and concluded that monetary policy fundamentally changed in the early 80s. He was willing to take the chance that he could do well enough in the next decade or two that he could subsequently drop it.

With that said, it only makes sense to be prepared to abandon or modify the strategy if and when conditions revert to the 70s.
Marseille07
Posts: 16054
Joined: Fri Nov 06, 2020 12:41 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by Marseille07 »

Hydromod wrote: Tue Mar 23, 2021 3:01 pm
Marseille07 wrote: Tue Mar 23, 2021 2:28 pm
millennialblues wrote: Tue Mar 23, 2021 2:26 pm
Marseille07 wrote: Tue Mar 23, 2021 2:09 pm No worries, backtesting properly (in the sense of finding models that *make money*) is very difficult and very few people can do this.

In order to combat the issue you're describing above, one very well-known approach is to divide your dataset into in-sample and out-of-sample periods. You train your model using in-sample, and test against out-of-sample.
Oh! That makes sense. So train in time-window 1, test in time-windows 2. Brilliant.

The problem this poses for HFEA strategies is this: the most important behavior to test it against are crashes (especially large ones), but over the life of the funds, there haven’t been many. Moreover, future crashes will almost certainly exhibit some novel behavior.

I wonder how one might go about simulating possible market scenarios that have not yet happened? (Is that what Monte Carlo does, and how useful has it been for testing financial strategies?)

I find it useful to test the strategies against funds with different behavior, like EDC, DRN, UTSL, etc. Monte Carlo also can be used, but then there are issues with generating time series with realistic patterns.
Maybe I missed the memo, but if one really tested HFEA against the 70s then I thought it's a non-starter for anyone to use.

And hoping to never see the 70s again isn't a very good strategy, because it happened.
The original author thought about this, and concluded that monetary policy fundamentally changed in the early 80s. He was willing to take the chance that he could do well enough in the next decade or two that he could subsequently drop it.

With that said, it only makes sense to be prepared to abandon or modify the strategy if and when conditions revert to the 70s.
I see. If this is the case then no amount of backtests help, because this strategy has a big gaping hole and the traders are hopping onto it anyway, hoping that the hole won't manifest while they're trading.
DMoogle
Posts: 549
Joined: Sat Oct 31, 2020 10:24 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by DMoogle »

Marseille07 wrote: Tue Mar 23, 2021 2:28 pmMaybe I missed the memo, but if one really tested HFEA against the 70s then I thought it's a non-starter for anyone to use.

And hoping to never see the 70s again isn't a very good strategy, because it happened.
You did. Full backtests back to 1955 are linked to in the first post, here: viewtopic.php?f=10&t=272007&start=1050#p4426310 (it's several posts down).

The strategy was breakeven between 1955-1981. From 1955-2019, HFEA outperformed SPY by a little over 1% CAGR, resulting in a 2x total return. Hedgefundie's (and others') position is that the LTT performance of the 70s shouldn't ever happen again, because of fundamental shifts in the Fed's policy and mindset.
Marseille07
Posts: 16054
Joined: Fri Nov 06, 2020 12:41 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by Marseille07 »

DMoogle wrote: Tue Mar 23, 2021 3:26 pm
Marseille07 wrote: Tue Mar 23, 2021 2:28 pmMaybe I missed the memo, but if one really tested HFEA against the 70s then I thought it's a non-starter for anyone to use.

And hoping to never see the 70s again isn't a very good strategy, because it happened.
You did. Full backtests back to 1955 are linked to in the first post, here: viewtopic.php?f=10&t=272007&start=1050#p4426310 (it's several posts down).

The strategy was breakeven between 1955-1981. From 1955-2019, HFEA outperformed SPY by a little over 1% CAGR, resulting in a 2x total return. Hedgefundie's (and others') position is that the LTT performance of the 70s shouldn't ever happen again, because of fundamental shifts in the Fed's policy and mindset.
Thank you. I guess the jury is still out on whether they were right or wrong. And breaking even between 1955-1981 is a massive underperformance...
DMoogle
Posts: 549
Joined: Sat Oct 31, 2020 10:24 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by DMoogle »

Marseille07 wrote: Tue Mar 23, 2021 3:38 pmThank you. I guess the jury is still out on whether they were right or wrong. And breaking even between 1955-1981 is a massive underperformance...
Oh yeah, it totally is and that risk can't be understated. For what it's worth, the crash of 1929 (holding S&P 500) didn't fully recover until 1946. Note that doesn't include dividends, but it doesn't include inflation either. *EDIT: I was mistaken on this - it actually does include dividends. The values were based on S&P 500 total return.

But for an individual, there's a massive difference between a 17 year recovery and a 26 year recovery.
Last edited by DMoogle on Tue Mar 23, 2021 8:11 pm, edited 1 time in total.
Marseille07
Posts: 16054
Joined: Fri Nov 06, 2020 12:41 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by Marseille07 »

DMoogle wrote: Tue Mar 23, 2021 3:46 pm
Marseille07 wrote: Tue Mar 23, 2021 3:38 pmThank you. I guess the jury is still out on whether they were right or wrong. And breaking even between 1955-1981 is a massive underperformance...
Oh yeah, it totally is and that risk can't be understated. For what it's worth, the crash of 1929 (holding S&P 500) didn't fully recover until 1946. Note that doesn't include dividends, but it doesn't include inflation either.

But for an individual, there's a massive difference between a 17 year recovery and a 26 year recovery.
Indeed. And I don't think the chance of the 70s repeating is as remote as people like to think. Not necessarily the crash, but the rising yields / rates.
millennialblues
Posts: 37
Joined: Sat Mar 06, 2021 4:07 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by millennialblues »

these questions about previous times provoked me to update my band study program to account for a larger time window. still, i haven't been able to work out how to get Yahoo Finance to give me numbers before 1980. but if you leverage up 3x VFINX and PINCX, the Moving Average portions of the study are interesting re: what you can do to get the timing right.

would be curious what other numbers people will find performing better. this is what it is with just the new defaults I plugged in.

Image
for those of you who don't want to zoom in:
Black = MA w/ Bands
Red = MA
Green = 55/45 constant ("stock.cash.mix", rebalanced daily, but the program can be set to months easily to see those #s)
blue = "stock" buy-and-hold 100% triple-leveraged VFINX.
Marseille07
Posts: 16054
Joined: Fri Nov 06, 2020 12:41 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by Marseille07 »

millennialblues wrote: Tue Mar 23, 2021 6:10 pm these questions about previous times provoked me to update my band study program to account for a larger time window. still, i haven't been able to work out how to get Yahoo Finance to give me numbers before 1980. but if you leverage up 3x VFINX and PINCX, the Moving Average portions of the study are interesting re: what you can do to get the timing right.

would be curious what other numbers people will find performing better. this is what it is with just the new defaults I plugged in.

Image
for those of you who don't want to zoom in:
Black = MA w/ Bands
Red = MA
Green = 55/45 constant ("stock.cash.mix", rebalanced daily, but the program can be set to months easily to see those #s)
blue = "stock" buy-and-hold 100% triple-leveraged VFINX.
Not to take anything away from your work, but I don't like any of the numbers shown. My conclusion so far is 3x isn't viable because it's too volatile.
DMoogle
Posts: 549
Joined: Sat Oct 31, 2020 10:24 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by DMoogle »

What's driving such a vast difference between your model and Gayed's? His theoretical 3x S&P 500 using 200dMA strategy shows a max drawdown of 49.6% since 1929. 44.7% in the crash last year. His actual UPRO using 200dMA shows max drawdown of 51.2%.

Any idea why yours is so much higher?
jarjarM
Posts: 2511
Joined: Mon Jul 16, 2018 1:21 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by jarjarM »

DMoogle wrote: Tue Mar 23, 2021 7:55 pm What's driving such a vast difference between your model and Gayed's? His theoretical 3x S&P 500 using 200dMA strategy shows a max drawdown of 49.6% since 1929. 44.7% in the crash last year. His actual UPRO using 200dMA shows max drawdown of 51.2%.

Any idea why yours is so much higher?
Could it be he's looking at monthly data? From 1929 'til mid 70s, there's no public daily data available, only monthly data. May have to read some of the fine prints on his paper. Just think 1987, single day crash of 22% should lead to 66% in 3x LETF.
DMoogle
Posts: 549
Joined: Sat Oct 31, 2020 10:24 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by DMoogle »

jarjarM wrote: Tue Mar 23, 2021 8:02 pm
DMoogle wrote: Tue Mar 23, 2021 7:55 pm What's driving such a vast difference between your model and Gayed's? His theoretical 3x S&P 500 using 200dMA strategy shows a max drawdown of 49.6% since 1929. 44.7% in the crash last year. His actual UPRO using 200dMA shows max drawdown of 51.2%.

Any idea why yours is so much higher?
Could it be he's looking at monthly data? From 1929 'til mid 70s, there's no public daily data available, only monthly data. May have to read some of the fine prints on his paper. Just think 1987, single day crash of 22% should lead to 66% in 3x LETF.
I don't think so. He has precise dates (not month-beginning or month-end) quoted in several of the tables. The footnote on page 3 states that his source is S&P 500 Total Return Index (Gross Dividends) data from Bloomberg. I'm pretty sure Bloomberg would have the best data available.

EDIT: Also, daily data is more likely to smooth out the drawdowns, right? So millenialblues' should look better, not worse if anything.
jarjarM
Posts: 2511
Joined: Mon Jul 16, 2018 1:21 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by jarjarM »

DMoogle wrote: Tue Mar 23, 2021 3:46 pm
Marseille07 wrote: Tue Mar 23, 2021 3:38 pmThank you. I guess the jury is still out on whether they were right or wrong. And breaking even between 1955-1981 is a massive underperformance...
Oh yeah, it totally is and that risk can't be understated. For what it's worth, the crash of 1929 (holding S&P 500) didn't fully recover until 1946. Note that doesn't include dividends, but it doesn't include inflation either. *EDIT: I was mistaken on this - it actually does include dividends. The values were based on S&P 500 total return.

But for an individual, there's a massive difference between a 17 year recovery and a 26 year recovery.
That's one of the big reason why no one should put all their marbles into this and beware of the bond headwind coming our way.
jarjarM
Posts: 2511
Joined: Mon Jul 16, 2018 1:21 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by jarjarM »

DMoogle wrote: Tue Mar 23, 2021 8:08 pm
jarjarM wrote: Tue Mar 23, 2021 8:02 pm
DMoogle wrote: Tue Mar 23, 2021 7:55 pm What's driving such a vast difference between your model and Gayed's? His theoretical 3x S&P 500 using 200dMA strategy shows a max drawdown of 49.6% since 1929. 44.7% in the crash last year. His actual UPRO using 200dMA shows max drawdown of 51.2%.

Any idea why yours is so much higher?
Could it be he's looking at monthly data? From 1929 'til mid 70s, there's no public daily data available, only monthly data. May have to read some of the fine prints on his paper. Just think 1987, single day crash of 22% should lead to 66% in 3x LETF.
I don't think so. He has precise dates (not month-beginning or month-end) quoted in several of the tables. The footnote on page 3 states that his source is S&P 500 Total Return Index (Gross Dividends) data from Bloomberg. I'm pretty sure Bloomberg would have the best data available.

EDIT: Also, daily data is more likely to smooth out the drawdowns, right? So millenialblues' should look better, not worse if anything.
Hmm, then we need to look at the paper more careful. Although if this simply due to some data issue, then that's another knock on MA since it's another point on being luck/data mining rather than real inefficiency in price movement.
Last edited by jarjarM on Tue Mar 23, 2021 8:36 pm, edited 1 time in total.
millennialblues
Posts: 37
Joined: Sat Mar 06, 2021 4:07 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by millennialblues »

jarjarM wrote: Tue Mar 23, 2021 8:02 pm
DMoogle wrote: Tue Mar 23, 2021 7:55 pm What's driving such a vast difference between your model and Gayed's? His theoretical 3x S&P 500 using 200dMA strategy shows a max drawdown of 49.6% since 1929. 44.7% in the crash last year. His actual UPRO using 200dMA shows max drawdown of 51.2%.

Any idea why yours is so much higher?
Could it be he's looking at monthly data? From 1929 'til mid 70s, there's no public daily data available, only monthly data. May have to read some of the fine prints on his paper. Just think 1987, single day crash of 22% should lead to 66% in 3x LETF.
yes - i'm pulling daily data, which is going to be much more useful here.

the worst DD for a 200ma run from 1980-2021 (still in my default settings) is actually 2008-2009. look at the third graph down, for the dipping line -- it happens in 08.

Image

so i re-ran it w/ 3x SPY / TLT, which is about as close to UPRO / TMF. looking at the tradetable, the drawdown happens when you've rotated in 3xTLT (and out of 3xSPY). you get a quick jump inverse to the crash, but then it rides down 70% through the first half of 2009. would like to know more of how someone else's model would have avoided that...

here's a window specific to 2008/2009 to further demonstrate it.
Image


if you look just as the monthly data, e.g. this table, you wouldn't see a major drawdown.
Image

that's why using monthly data is so dangerous. and really, daily -- i'm sure there were much worse drawdowns in hours/minutes/seconds that we're missing.

[edit: put the wrong chart first, fixed it]
Marseille07
Posts: 16054
Joined: Fri Nov 06, 2020 12:41 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by Marseille07 »

DMoogle wrote: Tue Mar 23, 2021 7:55 pm What's driving such a vast difference between your model and Gayed's? His theoretical 3x S&P 500 using 200dMA strategy shows a max drawdown of 49.6% since 1929. 44.7% in the crash last year. His actual UPRO using 200dMA shows max drawdown of 51.2%.

Any idea why yours is so much higher?
I thought Gayed just played with levered SPY & MA, whereas this poster is doing 3x SPY and 3x TLT.
millennialblues
Posts: 37
Joined: Sat Mar 06, 2021 4:07 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by millennialblues »

feel free to try it all out yourself with the app. i can post the code of you’re curious, but it’s nothing fancy. all it does for the MA is make trades between a stock or cash (that you set yourself) when the signal asset crosses its own SMA.

the reports it prints out are for my band strategy, but if you set the band to 0, then it’s the same as MA.

https://millennialblues.shinyapps.io/Mo ... BandStudy/
DMoogle
Posts: 549
Joined: Sat Oct 31, 2020 10:24 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by DMoogle »

Clearly the devil's in the details here. I have played with your app a bit trying to replicate Gayed's results using nothing but 200 MA and SPY and a "risk-off" measure. I was using TLT, but Gayed specifies the risk-off measure he used was Treasury bill data from http://mba.tuck.dartmouth.edu/pages/fac ... brary.html. Maybe that's causing the gap? Seems unlikely to make that big of a difference...

Just to be sure, your leverage is reset daily?
Hydromod
Posts: 1052
Joined: Tue Mar 26, 2019 10:21 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by Hydromod »

millennialblues wrote: Tue Mar 23, 2021 8:56 pm feel free to try it all out yourself with the app. i can post the code of you’re curious, but it’s nothing fancy. all it does for the MA is make trades between a stock or cash (that you set yourself) when the signal asset crosses its own SMA.

the reports it prints out are for my band strategy, but if you set the band to 0, then it’s the same as MA.

https://millennialblues.shinyapps.io/Mo ... BandStudy/
Are you delaying the trade until the day after the signal? You have to be careful not to incorporate information that wouldn't already be known at the time of the trade.
millennialblues
Posts: 37
Joined: Sat Mar 06, 2021 4:07 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by millennialblues »

DMoogle wrote: Tue Mar 23, 2021 9:04 pm Clearly the devil's in the details here. I have played with your app a bit trying to replicate Gayed's results using nothing but 200 MA and SPY and a "risk-off" measure. I was using TLT, but Gayed specifies the risk-off measure he used was Treasury bill data from http://mba.tuck.dartmouth.edu/pages/fac ... brary.html. Maybe that's causing the gap? Seems unlikely to make that big of a difference...

Just to be sure, your leverage is reset daily?
i’m using the create.leverage function from the SIT package by The Systematic Investor. the data is already adjusted before i run the function, and it’s daily data.

here's a blog post in which he explains how it works, with examples: http://systematicinvestor.github.io/Ext ... ged-Series

the specific function is from https://github.com/systematicinvestor/S ... g/R/data.r

###############################################################################
# Leveraged series
###############################################################################
# Create Leveraged series with data from the unlevereged.
#
# Please use only with Adjusted time series. For example create.leveraged(data$QQQ, leverage=2)
# will produce erroneous values because QQQ had 2: 1 Stock Split on Mar 20, 2000
# Hence at 2x leverage the value goes to zero.
#
# @example create.leveraged(tlt, 2)
# @example extend.data(data$UBT, create.leveraged(data$TLT, leverage=2), scale=T)
# @example extend.data(data$TMF, create.leveraged(data$TLT, leverage=3), scale=T)
#' @export
create.leveraged = function(hist, leverage=2) {
rets = 1 + leverage * (hist / mlag(hist) - 1)
rets[1,] = 1
bt.apply.matrix(rets, cumprod)
}


create.leveraged.test = function() {
tickers = spl('TMF,UBT,TLT')
data = new.env()

getSymbols(tickers, src = 'yahoo', from = '1970-01-01', env = data, auto.assign = T)


test2 = extend.data(data$UBT, create.leveraged(data$TLT, leverage=2), scale=T)
test3 = extend.data(data$TMF, create.leveraged(data$TLT, leverage=3), scale=T)
proxy.test(list(TLT=data$TLT, UBT=test2, TMF=test3),price.fn=Ad)

test0 = create.leveraged(data$TLT, leverage=2)
proxy.test(list(UBT=data$UBT, EXTEND=test0),price.fn=Ad)

test0 = create.leveraged(data$TLT, leverage=3)
proxy.test(list(TMF=data$TMF, EXTEND=test0),price.fn=Ad)

# please note the difference in the above extension is due to difference in the
# underlying benchmarks. I.e.
#
# http://www.proshares.com/funds/ubt.html
# ProShares Ultra 20+ Year Treasury (UBT) seeks daily investment results
# that correspond to two times (2x) the daily performance of the Barclays U.S. 20+ Year Treasury Bond Index.
#
# http://www.direxioninvestments.com/prod ... ull-3x-etf
# Direxion Daily 20+ Yr Trsy Bull 3X ETF (TMF) seeks daily investment results
# that correspond to three times (3x) the daily performance of the NYSE 20 Year Plus Treasury Bond Index (AXTWEN).
}
Last edited by millennialblues on Tue Mar 23, 2021 9:40 pm, edited 1 time in total.
millennialblues
Posts: 37
Joined: Sat Mar 06, 2021 4:07 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by millennialblues »

Hydromod wrote: Tue Mar 23, 2021 9:14 pm
millennialblues wrote: Tue Mar 23, 2021 8:56 pm feel free to try it all out yourself with the app. i can post the code of you’re curious, but it’s nothing fancy. all it does for the MA is make trades between a stock or cash (that you set yourself) when the signal asset crosses its own SMA.

the reports it prints out are for my band strategy, but if you set the band to 0, then it’s the same as MA.

https://millennialblues.shinyapps.io/Mo ... BandStudy/
Are you delaying the trade until the day after the signal? You have to be careful not to incorporate information that wouldn't already be known at the time of the trade.
yes, the trade is currently set to happen after the signal. you can change the trade frequency with the drop down menu to occur the day, month, quarter, or year after it happens - i could also add in things like weeks, 4 months, or whatever if you’d find it useful. but because the data is daily, i can’t set it for hours, minutes, seconds etc.

if you’re actually setting up the strategy to function algorithmically like using a tradingview algo that talks to a python server that sends trades to alpaca, then you’d actually have it happen at the same speeds as HFTs (with candle speeds that are seconds or less) unless you set a delay
Marseille07
Posts: 16054
Joined: Fri Nov 06, 2020 12:41 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by Marseille07 »

millennialblues wrote: Tue Mar 23, 2021 9:32 pm
Hydromod wrote: Tue Mar 23, 2021 9:14 pm
millennialblues wrote: Tue Mar 23, 2021 8:56 pm feel free to try it all out yourself with the app. i can post the code of you’re curious, but it’s nothing fancy. all it does for the MA is make trades between a stock or cash (that you set yourself) when the signal asset crosses its own SMA.

the reports it prints out are for my band strategy, but if you set the band to 0, then it’s the same as MA.

https://millennialblues.shinyapps.io/Mo ... BandStudy/
Are you delaying the trade until the day after the signal? You have to be careful not to incorporate information that wouldn't already be known at the time of the trade.
yes, the trade is currently set to happen after the signal. you can change the trade frequency with the drop down menu to occur the day, month, quarter, or year after it happens - i could also add in things like weeks, 4 months, or whatever if you’d find it useful. but because the data is daily, i can’t set it for hours, minutes, seconds etc.

if you’re actually setting up the strategy to function algorithmically like using a tradingview algo that talks to a python server that sends trades to alpaca, then you’d actually have it happen at the same speeds as HFTs (with candle speeds that are seconds or less) unless you set a delay
Seems like you've been modeling for quite some time. How come you're still looking at MA on the SPY? Better models lie elsewhere in my opinion.
millennialblues
Posts: 37
Joined: Sat Mar 06, 2021 4:07 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by millennialblues »

Marseille07 wrote: Tue Mar 23, 2021 9:57 pm Seems like you've been modeling for quite some time. How come you're still looking at MA on the SPY? Better models lie elsewhere in my opinion.
Actually very new to it all - I spend most of my day talking about books. Only achieved financial stability within the last year or two, which is partially what spurred my interest a couple months ago that led me here. Would love to hear where else I should be looking! Or is that a conversation we should take elsewhere, so not to spam the board?
Marseille07
Posts: 16054
Joined: Fri Nov 06, 2020 12:41 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by Marseille07 »

millennialblues wrote: Tue Mar 23, 2021 10:11 pm
Marseille07 wrote: Tue Mar 23, 2021 9:57 pm Seems like you've been modeling for quite some time. How come you're still looking at MA on the SPY? Better models lie elsewhere in my opinion.
Actually very new to it all - I spend most of my day talking about books. Only achieved financial stability within the last year or two, which is partially what spurred my interest a couple months ago that led me here. Would love to hear where else I should be looking! Or is that a conversation we should take elsewhere, so not to spam the board?
It's kind of a lonely planet. Whatever deemed to work won't be shared much outside of inner circles for obvious reasons. I'm kind of lucky to hear great backtesting ideas and incorporate them into my trading, while the person who told me those ideas struggles to trade well for disciplinary reasons.

This is not to say people here don't know what they're talking about. I recently saw a poster talking about Philosophical Economics's backtesting idea, which is absolutely the right approach.
Last edited by Marseille07 on Wed Mar 24, 2021 12:53 am, edited 1 time in total.
DMoogle
Posts: 549
Joined: Sat Oct 31, 2020 10:24 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by DMoogle »

Just had a thought... if Gayed's model is based on total return, maybe that's what's causing the deviation? Tried using ^TR and SPTR in your app, but that broke it. :)
millennialblues
Posts: 37
Joined: Sat Mar 06, 2021 4:07 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by millennialblues »

DMoogle wrote: Wed Mar 24, 2021 12:27 am Just had a thought... if Gayed's model is based on total return, maybe that's what's causing the deviation? Tried using ^TR and SPTR in your app, but that broke it. :)
oops! it takes symbols from yahoo finance, so you can check to see if they call right by trying them there first, eg ^gspc works https://finance.yahoo.com/quote/%5Egspc but ^tr doesn’t https://finance.yahoo.com/quote/%5Etr
User avatar
coingaroo
Posts: 126
Joined: Fri Apr 26, 2019 11:31 am

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by coingaroo »

millennialblues wrote: Tue Mar 23, 2021 6:10 pm these questions about previous times provoked me to update my band study program to account for a larger time window. still, i haven't been able to work out how to get Yahoo Finance to give me numbers before 1980. but if you leverage up 3x VFINX and PINCX, the Moving Average portions of the study are interesting re: what you can do to get the timing right.

would be curious what other numbers people will find performing better. this is what it is with just the new defaults I plugged in.

Image
for those of you who don't want to zoom in:
Black = MA w/ Bands
Red = MA
Green = 55/45 constant ("stock.cash.mix", rebalanced daily, but the program can be set to months easily to see those #s)
blue = "stock" buy-and-hold 100% triple-leveraged VFINX.
Thanks for building a web app for this! Quite cool. If you want to open source the code, I would love to contribute and share back, specifically four things I want to explore and happy to code:

1. Dr Wouter Keller has found that US Aggregate Bonds, and Emerging Market Stocks act better as a canary through walk-forward testing. So I would love to explore whether a combination of these signals provide better predictive power.

2. I want to model in tax effects for those doing this in taxed accounts (like me).

3. I want to explore conditional VIX hedging, using CBOE's VXTH methodology.

4. Testing parameters will easily cause you to overfit, and get worse performing results. The dashboard you have is prone to SEVERE overfitting bias and I STRONGLY caution members against finding the "best" (overfitted) parameters and executing such strategy

Thus, I would like to either split this into testing and validation stages, or alternatively try to build a walk-forward auto-optimiser for the parameters which I think will have more robustness.
User avatar
coingaroo
Posts: 126
Joined: Fri Apr 26, 2019 11:31 am

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by coingaroo »

Marseille07 wrote: Tue Mar 23, 2021 10:52 pm It's kind of a lonely planet. Whatever deemed to work won't be shared much outside of inner circles for obvious reasons. I'm kind of lucky to hear great backtesting ideas and incorporate them into my trading, while the person who told me those ideas struggles to trade well for disciplinary reasons.

This is not to say people here don't know what they're talking about. I recently saw a poster talking about Philosophical Economics's backtesting idea, which is absolutely the right approach.
The sort of strategies we are talking about here tend to have virtually infinite capacity, and hence it makes every sense for us to discuss openly and contribute together.

Of course, should I find some specific, limited-capacity strategy, such a long/short factor, then it's going to be proprietary, but that's not this class of strategies.

There's also a lot of resources on Tactical Asset Allocation (what we're discussing is TAA), and AllocateSmartly maintains a list of nearly all public strategies. I also like CSSAnalytics's contributions, particularly varying the lookback length depending on volatility or current drawdowns.
LeverageWBeverage
Posts: 59
Joined: Fri Jan 01, 2021 4:25 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by LeverageWBeverage »

I've read a lot of compelling reasons on here to not rebalance into TMF this quarter end or even this year given what is going on in yields. This article may provide a good reason TO rebalance into TMF this quarter due to what has been going on in Japan leading into their March 31st year end.

https://www.zerohedge.com/markets/2021s ... st-decades

Thoughts?
User avatar
RovenSkyfall
Posts: 267
Joined: Wed Apr 01, 2020 11:40 am

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by RovenSkyfall »

coingaroo wrote: Wed Mar 24, 2021 3:21 am
Marseille07 wrote: Tue Mar 23, 2021 10:52 pm It's kind of a lonely planet. Whatever deemed to work won't be shared much outside of inner circles for obvious reasons. I'm kind of lucky to hear great backtesting ideas and incorporate them into my trading, while the person who told me those ideas struggles to trade well for disciplinary reasons.

This is not to say people here don't know what they're talking about. I recently saw a poster talking about Philosophical Economics's backtesting idea, which is absolutely the right approach.
The sort of strategies we are talking about here tend to have virtually infinite capacity, and hence it makes every sense for us to discuss openly and contribute together.

Of course, should I find some specific, limited-capacity strategy, such a long/short factor, then it's going to be proprietary, but that's not this class of strategies.

There's also a lot of resources on Tactical Asset Allocation (what we're discussing is TAA), and AllocateSmartly maintains a list of nearly all public strategies. I also like CSSAnalytics's contributions, particularly varying the lookback length depending on volatility or current drawdowns.
It will be interesting to see what you all come up with. The algo trading is appealing, until I think of the work needed, or added complexity. 200dMA (+/- bands) and HFEA with quarterly rebalancing are relatively easy to implement. Hopefully you can find something with better upside and downside which is also easy to implement. I look forward to watching your process, please keep posting!
I saved my money, but it can't save me | The Chariot
User avatar
OohLaLa
Posts: 459
Joined: Tue Mar 09, 2021 7:26 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by OohLaLa »

LeverageWBeverage wrote: Wed Mar 24, 2021 6:54 am I've read a lot of compelling reasons on here to not rebalance into TMF this quarter end or even this year given what is going on in yields. This article may provide a good reason TO rebalance into TMF this quarter due to what has been going on in Japan leading into their March 31st year end.

https://www.zerohedge.com/markets/2021s ... st-decades

Thoughts?
Thanks for the post. Interesting to read. As a side comment, I never knew doomsday preppers were so over-represented in ZeroHedge's reader base. :?
millennialblues
Posts: 37
Joined: Sat Mar 06, 2021 4:07 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by millennialblues »

coingaroo wrote: Wed Mar 24, 2021 3:03 am
Thanks for building a web app for this! Quite cool. If you want to open source the code, I would love to contribute and share back, specifically four things I want to explore and happy to code:

1. Dr Wouter Keller has found that US Aggregate Bonds, and Emerging Market Stocks act better as a canary through walk-forward testing. So I would love to explore whether a combination of these signals provide better predictive power.

2. I want to model in tax effects for those doing this in taxed accounts (like me).

3. I want to explore conditional VIX hedging, using CBOE's VXTH methodology.

4. Testing parameters will easily cause you to overfit, and get worse performing results. The dashboard you have is prone to SEVERE overfitting bias and I STRONGLY caution members against finding the "best" (overfitted) parameters and executing such strategy

Thus, I would like to either split this into testing and validation stages, or alternatively try to build a walk-forward auto-optimiser for the parameters which I think will have more robustness.
amazing! i’m all for it. will throw it up on github later today. will be a little embarrassed to have people see my frankencode, as i taught myself R through these projects and was never taught programming. but it’s been an amazing education to work through the systematic investors backlog, discuss strategies here on the forum, and set myself the goal of making working shiny webapps :D
Marseille07
Posts: 16054
Joined: Fri Nov 06, 2020 12:41 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by Marseille07 »

coingaroo wrote: Wed Mar 24, 2021 3:21 am
Marseille07 wrote: Tue Mar 23, 2021 10:52 pm It's kind of a lonely planet. Whatever deemed to work won't be shared much outside of inner circles for obvious reasons. I'm kind of lucky to hear great backtesting ideas and incorporate them into my trading, while the person who told me those ideas struggles to trade well for disciplinary reasons.

This is not to say people here don't know what they're talking about. I recently saw a poster talking about Philosophical Economics's backtesting idea, which is absolutely the right approach.
The sort of strategies we are talking about here tend to have virtually infinite capacity, and hence it makes every sense for us to discuss openly and contribute together.

Of course, should I find some specific, limited-capacity strategy, such a long/short factor, then it's going to be proprietary, but that's not this class of strategies.

There's also a lot of resources on Tactical Asset Allocation (what we're discussing is TAA), and AllocateSmartly maintains a list of nearly all public strategies. I also like CSSAnalytics's contributions, particularly varying the lookback length depending on volatility or current drawdowns.
Sure, the inner circles example was more about stock picking trading, which HFEA is not (well, maintaining 55/45 is not).
There are lots of strategies public but the hard part is figuring out which ones are actually effective. It's incredibly easy to craft great-looking backtests that don't work.
Marseille07
Posts: 16054
Joined: Fri Nov 06, 2020 12:41 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by Marseille07 »

millennialblues wrote: Wed Mar 24, 2021 9:41 am
coingaroo wrote: Wed Mar 24, 2021 3:03 am
Thanks for building a web app for this! Quite cool. If you want to open source the code, I would love to contribute and share back, specifically four things I want to explore and happy to code:

1. Dr Wouter Keller has found that US Aggregate Bonds, and Emerging Market Stocks act better as a canary through walk-forward testing. So I would love to explore whether a combination of these signals provide better predictive power.

2. I want to model in tax effects for those doing this in taxed accounts (like me).

3. I want to explore conditional VIX hedging, using CBOE's VXTH methodology.

4. Testing parameters will easily cause you to overfit, and get worse performing results. The dashboard you have is prone to SEVERE overfitting bias and I STRONGLY caution members against finding the "best" (overfitted) parameters and executing such strategy

Thus, I would like to either split this into testing and validation stages, or alternatively try to build a walk-forward auto-optimiser for the parameters which I think will have more robustness.
amazing! i’m all for it. will throw it up on github later today. will be a little embarrassed to have people see my frankencode, as i taught myself R through these projects and was never taught programming. but it’s been an amazing education to work through the systematic investors backlog, discuss strategies here on the forum, and set myself the goal of making working shiny webapps :D
The above poster has some knowledge on algotrading, but you'll soon learn that walk-forward isn't really that great. I think I mentioned elsewhere but really good stuff usually don't get published.
User avatar
coingaroo
Posts: 126
Joined: Fri Apr 26, 2019 11:31 am

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by coingaroo »

Marseille07 wrote: Wed Mar 24, 2021 10:05 am amazing! i’m all for it. will throw it up on github later today. will be a little embarrassed to have people see my frankencode, as i taught myself R through these projects and was never taught programming. but it’s been an amazing education to work through the systematic investors backlog, discuss strategies here on the forum, and set myself the goal of making working shiny webapps :D
The above poster has some knowledge on algotrading, but you'll soon learn that walk-forward isn't really that great. I think I mentioned elsewhere but really good stuff usually don't get published.
Do you have any proposals on mitigating backtesting bias, as it might be applied here? :)

No point talking or spending time thinking about what you can't have. Do the best with what you can have.

EDIT: I kindly request the below poster to offer some valuable and actionable contributions, otherwise I will begin ignoring their posts as it only contributes to the noise, not signal.
Last edited by coingaroo on Wed Mar 24, 2021 11:18 am, edited 3 times in total.
Marseille07
Posts: 16054
Joined: Fri Nov 06, 2020 12:41 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by Marseille07 »

coingaroo wrote: Wed Mar 24, 2021 11:12 am
Marseille07 wrote: Wed Mar 24, 2021 10:05 am amazing! i’m all for it. will throw it up on github later today. will be a little embarrassed to have people see my frankencode, as i taught myself R through these projects and was never taught programming. but it’s been an amazing education to work through the systematic investors backlog, discuss strategies here on the forum, and set myself the goal of making working shiny webapps :D
The above poster has some knowledge on algotrading, but you'll soon learn that walk-forward isn't really that great. I think I mentioned elsewhere but really good stuff usually don't get published.
Do you have any proposals on mitigating backtesting bias, as it might be applied here? :)
Well, the first thing is to backtest properly and I'm afraid that's not even being done.
Marseille07
Posts: 16054
Joined: Fri Nov 06, 2020 12:41 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by Marseille07 »

coingaroo wrote: Wed Mar 24, 2021 11:12 am
Marseille07 wrote: Wed Mar 24, 2021 10:05 am amazing! i’m all for it. will throw it up on github later today. will be a little embarrassed to have people see my frankencode, as i taught myself R through these projects and was never taught programming. but it’s been an amazing education to work through the systematic investors backlog, discuss strategies here on the forum, and set myself the goal of making working shiny webapps :D
The above poster has some knowledge on algotrading, but you'll soon learn that walk-forward isn't really that great. I think I mentioned elsewhere but really good stuff usually don't get published.
Do you have any proposals on mitigating backtesting bias, as it might be applied here? :)

No point talking or spending time thinking about what you can't have. Do the best with what you can have.

EDIT: I kindly request the below poster to offer some valuable and actionable contributions, otherwise I will begin ignoring their posts as it only contributes to the noise, not signal.
Please ignore me. I already made 42% in 2019 and 75% in 2020 algotrading. I'm not begging you to take my advice.
Last edited by Marseille07 on Sun Mar 28, 2021 12:30 pm, edited 1 time in total.
LeverageWBeverage
Posts: 59
Joined: Fri Jan 01, 2021 4:25 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by LeverageWBeverage »

OohLaLa wrote: Wed Mar 24, 2021 8:51 am
LeverageWBeverage wrote: Wed Mar 24, 2021 6:54 am I've read a lot of compelling reasons on here to not rebalance into TMF this quarter end or even this year given what is going on in yields. This article may provide a good reason TO rebalance into TMF this quarter due to what has been going on in Japan leading into their March 31st year end.

https://www.zerohedge.com/markets/2021s ... st-decades

Thoughts?
Thanks for the post. Interesting to read. As a side comment, I never knew doomsday preppers were so over-represented in ZeroHedge's reader base. :?
That made me laugh. Most people who are just going to rebalance as usual are probably not as vocal.
millennialblues
Posts: 37
Joined: Sat Mar 06, 2021 4:07 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by millennialblues »

Marseille07 wrote: Wed Mar 24, 2021 11:20 am
coingaroo wrote: Wed Mar 24, 2021 11:12 am
Marseille07 wrote: Wed Mar 24, 2021 10:05 am amazing! i’m all for it. will throw it up on github later today. will be a little embarrassed to have people see my frankencode, as i taught myself R through these projects and was never taught programming. but it’s been an amazing education to work through the systematic investors backlog, discuss strategies here on the forum, and set myself the goal of making working shiny webapps :D
The above poster has some knowledge on algotrading, but you'll soon learn that walk-forward isn't really that great. I think I mentioned elsewhere but really good stuff usually don't get published.
Do you have any proposals on mitigating backtesting bias, as it might be applied here? :)

No point talking or spending time thinking about what you can't have. Do the best with what you can have.

EDIT: I kindly request the below poster to offer some valuable and actionable contributions, otherwise I will begin ignoring their posts as it only contributes to the noise, not signal.
You can ignore. HFEA and algotrading don't work very well anyway. And those who can't tell who might know the stuff don't deserve to receive advice.
there’s a unique algo problem for something like low-frequency MA— it might only need rebalancing once in 2-3 years. how will you know? email alert? will the API degrade in that time, etc etc etc. so not high frequency algo, but making it “set and forget.”
Marseille07
Posts: 16054
Joined: Fri Nov 06, 2020 12:41 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by Marseille07 »

millennialblues wrote: Wed Mar 24, 2021 12:29 pm there’s a unique algo problem for something like low-frequency MA— it might only need rebalancing once in 2-3 years. how will you know? email alert? will the API degrade in that time, etc etc etc. so not high frequency algo, but making it “set and forget.”
You can set up indicators on TradingView or somewhere like that. I do this for my bond tent approach.
GoodInvestor
Posts: 1
Joined: Wed Mar 24, 2021 1:46 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by GoodInvestor »

I was a big believer in this strategy and started investing since July 2020. :beer My TMF is now in red by 36%. UPRO did not help much to offset that, and the entire thing is now in DD and net loss. I'm now skeptical that if TMF won't kill it, UPRO will eventually go into correction (as expected), and this will be it. :oops:

First half of 2020 was very successful, but whoever joined later are now paying for that. I ran a simple simulation in Excel with random returns and a total loss for SPY of 55% over a 2-year period. My simulated portfolio (3xSPY/3xTLT as proxy for UPRO/TMF) went down by 80%! :confused Same would happen with TQQQ/TMF. Given we're at the lowest interest rates already and the market is already very expensive, this scenario is not only possible but very likely.

This strategy needs a better solution for low interest rates (VIX, BTC, FAS, etc. won't work as they just add volatility and deplete the portfolio at each rebalancing). There is too much leverage in this strategy and it only worked in the past due to the longest bull bond market in history which had just ended.
Last edited by GoodInvestor on Wed Mar 24, 2021 4:14 pm, edited 4 times in total.
millennialblues
Posts: 37
Joined: Sat Mar 06, 2021 4:07 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by millennialblues »

coingaroo wrote: Wed Mar 24, 2021 3:03 am Thanks for building a web app for this! Quite cool. If you want to open source the code, I would love to contribute and share back, specifically four things I want to explore and happy to code:

1. Dr Wouter Keller has found that US Aggregate Bonds, and Emerging Market Stocks act better as a canary through walk-forward testing. So I would love to explore whether a combination of these signals provide better predictive power.

2. I want to model in tax effects for those doing this in taxed accounts (like me).

3. I want to explore conditional VIX hedging, using CBOE's VXTH methodology.

4. Testing parameters will easily cause you to overfit, and get worse performing results. The dashboard you have is prone to SEVERE overfitting bias and I STRONGLY caution members against finding the "best" (overfitted) parameters and executing such strategy

Thus, I would like to either split this into testing and validation stages, or alternatively try to build a walk-forward auto-optimiser for the parameters which I think will have more robustness.
thanks again for willingness to help! if enough people want in, perhaps we should create a discord, IRC channel, slack, or something to troubleshoot/iron out bugs.

here's all of the R files I have made in the last couple weeks when working the The Systematic Investor's blog. the two subfolders are the two apps I made, one for AAA and the other for MA. https://github.com/millennialblues/MB.S ... n/MB%20SIT

R Studio should be freely available for all major OSs, which is what I've been using. then follow instructions in my readme (ignore SIT's installation notions, as they won't give you an install that can be used to automatically deploy webapps).

:sharebeer
User avatar
OohLaLa
Posts: 459
Joined: Tue Mar 09, 2021 7:26 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by OohLaLa »

millennialblues wrote: Wed Mar 24, 2021 2:43 pm [...] IRC channel [...]
Woah boy, you're reaching back in time there, aren't you? A/S/L? :P
Marseille07
Posts: 16054
Joined: Fri Nov 06, 2020 12:41 pm

Re: HEDGEFUNDIE's excellent adventure Part II: The next journey

Post by Marseille07 »

millennialblues wrote: Wed Mar 24, 2021 2:43 pm
coingaroo wrote: Wed Mar 24, 2021 3:03 am Thanks for building a web app for this! Quite cool. If you want to open source the code, I would love to contribute and share back, specifically four things I want to explore and happy to code:

1. Dr Wouter Keller has found that US Aggregate Bonds, and Emerging Market Stocks act better as a canary through walk-forward testing. So I would love to explore whether a combination of these signals provide better predictive power.

2. I want to model in tax effects for those doing this in taxed accounts (like me).

3. I want to explore conditional VIX hedging, using CBOE's VXTH methodology.

4. Testing parameters will easily cause you to overfit, and get worse performing results. The dashboard you have is prone to SEVERE overfitting bias and I STRONGLY caution members against finding the "best" (overfitted) parameters and executing such strategy

Thus, I would like to either split this into testing and validation stages, or alternatively try to build a walk-forward auto-optimiser for the parameters which I think will have more robustness.
thanks again for willingness to help! if enough people want in, perhaps we should create a discord, IRC channel, slack, or something to troubleshoot/iron out bugs.

here's all of the R files I have made in the last couple weeks when working the The Systematic Investor's blog. the two subfolders are the two apps I made, one for AAA and the other for MA. https://github.com/millennialblues/MB.S ... n/MB%20SIT

R Studio should be freely available for all major OSs, which is what I've been using. then follow instructions in my readme (ignore SIT's installation notions, as they won't give you an install that can be used to automatically deploy webapps).

:sharebeer
Not to take anything away from R, but imo Python's set of libraries are extremely powerful for something like this. I'm talking about pandas, numpy, Jupyter Notebook etc etc.
Post Reply