The Upbias' Tactical Switch is an easy-to-understand long-term strategy that can beat the stock market.

Nothing in this article constitutes or is intended to constitute investment advice. I am sharing this strategy on an educational and informational basis only. Please read the disclaimer at the end of this article.

We are continuously working on new articles... and will create additional email series from time to time. So... if you don't want to miss anything...

Tactical Switch Strategy

The Tactical Switch is a long-term strategy.

Nothing is guaranteed. The market will fluctuate, and nobody knows what will happen in the future.

Having said that, this strategy might beat the stock market over the long term

If we look in the short term, there are periods when it underperforms the market (notably the bull-run just before the dot-com crisis and the end-2018-begin-2019 turbulent market conditions).

Again... past performance does not guarantee future performance. In other words, this strategy might stop working at some point in time. 

How Can It Beat the Stock Market?

Better question yet... What makes it work?

Or maybe... Is this another moving-average-market-timing thing?

Well, it is a market-timing strategy... and yes, it uses a moving average... 

that is part of it... but that is not what makes it work.

The main factor that makes this strategy work is asset selection.

Historically, bonds tend to outperform stocks during crisis. That is the key insight.

The logic is simple but sound: aim to stay invested in stocks (better long-term returns), but switch to bonds (safety) during market crisis.

Thus, the Tactical Switch strategy aims to stay invested in stocks, but switches from stocks to bonds during larger market downturns (measured by a moving average).

The method presented here is not the only way to explore that key insight.

It is probably not the most effective method...

but hey... this post is about a simple strategy that can beat the stock market...

and, although not guaranteed, it can...

Having said that, you can always take the main idea behind this simple strategy and adapt it for your own preferences.

Quantitative Market Timing

Market timing has a somewhat “bad reputation.” It is common to find articles arguing against it. Most of the time, these articles are just saying it is hard to do and, because of that, you should not try it.

In my opinion, this is a weak argument.

If you have a sound methodology, market timing can not only improve your portfolio’s long-term performance but also reduce its drawdowns.

But what is market timing and how to implement it?

Well, a market timing strategy aims to be invested in a particular asset only when this asset is trending up. If the asset is trending down, then the strategy will hold cash or invest in another asset.

To do this in a discretionary way is very hard ... and better left for the investment professionals.

On the other hand, there are several quantitative strategies that can achieve excellent market timing results. Anyone can use them. All you need to do is to follow the rules.

Some strategies can be very complex, but it does not need to be like that.

A Practical Example

As an example of what is possible, I have backtested this quite simple market timing strategy.

A backtest is a computer simulation that uses past market data to test a given investing or trading strategy.

You can find the simulation at:

Did you notice how the Tactical Switch strategy was able to generate a much smaller maximum drawdown.

Let's Get into the Details...

The Market

In this post, the S&P 500 index is our benchmark (the “market” we are trying to beat).

How It Works

We are trying to beat the S&P 500 (the stock market) by outperforming during large downturns. Thus, when it is trending up, all we have to do is to stay fully invested in stocks.

On the other hand, we switch our allocation from stocks to bonds when the stock market starts trending down.

In short, if the stock market is trending up, we stay invested in stocks. If it is trending down, we switch from stocks to bonds. We only switch back to stocks when they start trending up again.

How Do We Measure the Market Trend?

We use a moving average to determine if the market is trending up or not.

To get a “visual idea,” see the following chart:

The Tactical Switch strategy is invested in the S&P 500 when the red line (S&P 500 weekly closing prices) is above the blue line (moving average).

If the red line crosses under the blue line, then the strategy sells the S&P 500 position and invests the proceeds in bonds.

When the red line crosses back above the blue line, then the strategy sells the bonds and invests in stocks again.

You can see from the chart how this simple strategy can avoid the longer down-trending periods.

You can also see from the chart that the strategy does not work all the time.

What Can Go Wrong

This is a long-term strategy. It cannot protect the portfolio during a fast downturn (flash crash or something similar). If the drop is sudden, the portfolio would suffer.

The strategy will probably continue to beat the stock market during large downturns but it normally lags the market during the whipsaws.

Note that the whipsaws are expected to be more frequent than the large downturns.

A whipsaw is when the S&P 500 drops briefly below the moving average, just to quickly resume the up trend.

During these times, the strategy switches out of stocks and then switches back into stocks a short time after (called a whipsaw or a false signal).

These whipsaws can cost a lot of money. Historically, these occurrences were not too frequent, and the losses were relatively small if compared with the “gains made” when the trend actually changed.

Having said that, the future might be very different, with costlier whipsaws.

During these whipsaws periods, it can be very challenging (and expensive) to keep following the strategy.

This strategy assumes that bonds will provide safety during market crisis, which is a reasonable assumption... but... both stocks and bonds can fall at the same time.

A "traditional" tactical strategy would switch from stocks to cash when stocks are falling. This strategy switches to bonds to take advantage from a historical observation that bonds tend to go up when stocks are going down. But that is not always the case.

There are periods where stocks and bonds fall at the same time. You can mitigate these "high correlation" periods by switching to cash if bonds are also trending down.

In short, for this strategy work, you need larger downturns from time to time (a very reasonable expectation) and not too many whipsaws (a big unknown).

You also need that stocks continue to provide better long-term returns and bonds continue to provide safety during market crisis.

There is also the "small sample" issue ... in other words, there are not many of those moving average crosses and definitely not many large downturnsI will come back to this issue later.


The market fluctuations at the end of 2018 and the beginning of 2019 presented the type of conditions that are the worst for this kind of strategy.

If followed, this strategy would suffer from the large whipsaws and would lose quite a lot of money.

Please read the disclaimer at the end of this article.

Moving Average Calculation

If you need a more detailed explanation, check the moving average calculation explanation at Wikipedia or leave me a message with your questions.

If the most recent Stock Index closing price is above the moving average, then the trend is up and the strategy should stay invested in the Stock Index. Otherwise, the strategy should be invested in the Bond Index.

How Often to Check for Allocation Changes

This is a low-frequency strategy made for busy people, with jobs and families.

Any strategy that requires frequent monitoring and readiness to act is probably not feasible for most individual investors because it might conflict with their families, regular jobs, and other responsibilities.

Another important point is that frequent allocation adjustments are not advisable because the transaction costs would overwhelm the benefits.

Thus, this strategy may change its allocation only once a month (on the first Sunday of every month to make it even more convenient).

Low-Frequency Strategy

Given the long-term nature of this strategy, the allocations might not change every month. If there are changes, the adjustments will be made on the following trading day.

Also, the simulation is made including broker fees and slippage (taking the worst possible price).

Community Coding

I have implemented and tested this simple strategy using my own simulation engine. It is how I test my ideas and develop all my strategies. It is not a product and I don't plan to make it a product... it is just for me.

But... I implemented this strategy at the QuantConnect platform (although a slightly different code) to make the code available and maybe get improvement suggestions from other strategy developers. You can clone the code at this discussion.

PS: I am not affiliated with QuantConnect (besides being just another user there).

Coming Back to the Small Sample Issue...

In this case, the sample issue is quite tricky. We are talking about statistics here. But hold on, I will try to make it understandable.

Generally speaking, the theory says that one should try to get lots of data because that would lead to better conclusions.

But is it only a matter of getting more market data? There is stock market data since 1900 or so. Is that better? Does it make sense?

In statistics, the key is to get data that is representative of the "population."

Here is the thing. The further back we go (past data), the less it is representative of current market conditions.

So ... what to do?

The way to handle this issue is to go back (past market data) as far as it makes sense (regarding market conditions), rely on sound logic to build the investment strategy, and monitor your strategy on an ongoing basis to make sure the whole thing is still valid.

One Last Thing

Please make sure to check our Financial Education Articles. They contain a lot of useful information about how to create an investment portfolio that works.

Short Disclaimer

Note that we are not financial advisors, and all content is presented here “as is” and on an educational and informational basis only. Nothing in this article constitutes or is intended to constitute investment advice. We do not accept any liability for any loss or damage resulting from, or related to, the contents of this article. Your use of the information in this article is entirely at your own risk, and it is your sole responsibility to evaluate the accuracy, completeness and usefulness of the information. Any person, institution, or other entity is advised to first consult their own financial advisor before using the information presented here in any way whatsoever.

Click to read the long disclaimer

These disclaimer excerpts were provided for your convenience. They may add to but they do not substitute the full disclaimer.


About the author

Ricardo Ribeiro, PRM

Investment management professional with a career spanning more than 20 years in the financial sector. Adept at integrating market risk analyses into investment strategies. Committed to helping aspiring investors get to the next level, and to shaping the next generation of investment tools and models. Mr. Ricardo Ribeiro holds a Professional Risk Manager (PRM) designation from the Professional Risk Managers' International Association (PRMIA).

Don't miss anything...

We respect your privacy. We only send an email when we believe our subscribers might benefit from it.