Last Updated on June 19, 2022 by Quantified Trading
Which oscillating indicator is the best for trading strategies? When you start out in trading it might be a daunting task to understand all the bells and whistles provided by your trading software. There are plenty of indicators, moving averages, and oscillators to use. How can you use the indicators to make money? In this article, we test six different indicators to find a winner.
We rank Williams %R as the best oscillating indicator for trading strategies. It’s certainly not the most known nor the most used, but in our humble opinion, our backtests proved Williams %R to be the most stable indicator for almost all of our parameters. It’s not the indicator with the highest return, but it has on average the lowest max drawdown, perhaps the most important criteria for a short-term trader.
What is an oscillating indicator?
First, we need to define what an oscillating indicator is.
An oscillating indicator is an indicator that goes up and down within a band. When the readings are high, the security in question is overbought, and when the readings are low the security is oversold. An oscillating indicator is a mean-reverting indicator.
There are many ways to interpret an oscillating indicator, but in this article, we only look at overbought and oversold conditions.
An example of an oscillating indicator is provided below which shows how the 7-day RSI (the lower pane):
The price of the security, in the upper pane, goes up and down, while the indicator in the lower pane reacts to the velocity of the movements of the security. Even though the price in the upper pane sets a new high or low, the indicator doesn’t necessarily set a corresponding high or low. It all depends on the speed of the rise or decline of the price.
Which oscillating indicators do we test?
There is almost an unlimited number of oscillating indicators, but we concentrate on the most popular ones – the one you find below. If you click on the link you can read more about the specific indicator (we will not go into details about each indicator in this article):
- The Williams %R indicator
- The relative strength indicator (RSI)
- The internal bar strength (IBS) indicator
- The stochastic indicator
- Bollinger Bands
There are, of course, plenty of other indicators to choose from. However, we have written about these six specific indicators in separate articles because they are the ones we found to be the best ones. It’s beyond the scope of this article to cover all oscillating indicators, but we believe six indicators are a pretty good sample to choose from!
What is the best time frame for oscillating indicators?
It’s impossible to define the best time frame in trading. There are no absolute answers, but in general, the best time frame is relatively short. By short time frame, we mean between 2-10 days. Anything longer than that we have found to be less efficient and involves substantially bigger max drawdowns.
As a trader, you want to be efficient. By that, we mean a high return on capital in the least amount of time. It’s possible to find inefficiencies in the market but they are normally of short duration. Thus, the time frame has to be relatively short.
How do we measure the best oscillating indicator for trading strategies?
Let’s do some backtests to find the best oscillating indicator for trading strategies:
To find the best oscillating indicator for trading strategies we use Amibroker and the optimize function. To use optimization in trading is a useful tool to check for durability, profitability, and negative skewness, just to name a few examples of optimization’s practical use.
We use the relevant indicator for both the entries and the exits with symmetry. By that we mean the following: if we enter at RSI readings below 30, we exit at readings above 70.
We do the following in our backtests:
- The time frame is 2-10 days
- We enter and exit on the close
- We use symmetry in entries and exits, ie. the opposite signals
In which market do we look for the best oscillating indicator?
The most traded market is the stock market. Hence, we test by using daily bars on the S&P 500. We use the ETF with the ticker code SPY as a proxy and we test from its inception in 1993 until today.
Oscillating indicators are primarily mean-reverting indicators
Keep in mind that over this time span the S&P 500 has shown mean-reverting properties. Oscillating indicators are primarily mean-reverting and thus we are dependent on this to continue for oscillating indicators to work.
Prior to the 1990s, this was much less the case. Please read our previous articles about mean reversion strategies and trend-following strategies. There are no guarantees that mean reversion will continue working in the future!
We start by testing the Williams %R indicator.
Williams %R fluctuates between 0 to -100 and is somewhat similar to its cousin, the stochastic indicator.
What does the Williams %R measure? It’s an oscillating indicator that reflects the current close relative to the highest high for the lookback period. A high reading is considered overbought, and low readings are considered oversold.
Here is how a 5-day lookback period looks in the S&P 500:
Let’s run an optimization of Williams %R:
The first column is the lookback period, the second column is the entry level, and the third column is the exit level. The results in the table are primarily ranked on profit factor and secondly on the number of trades. We want a high number of trades to ignore most of the noise and randomness.
Clearly, the best result involves a pretty “high” number of days (above 6 at least) and a low entry level but also a low exit level. The latter means that the exit criteria are an easy bar to pass and result in a short holding period (not shown in the table). The average holding period is around three days for all the highest-ranking numbers.
If we pick the second-best strategy with a holding period of 10 days and entry at -90 and exit -80 we get the following equity chart:
Relative Strength Index (RSI)
Let’s switch to perhaps the most popular indicator there is: the Relative Strength Index (RSI).
The RSI is a little bit different than the Williams %R: it measures the magnitude of both gains and losses over a period of n days. It measures the relative strength of the asset compared to the price movement over the determined period. The value of RSI can be a maximum of 100, and the minimum can be zero.
An example of the indicator is shown in the lower pane:
The 7-day RSI goes up and down, but notice that high and low differs between the price and the indicator.
Let’s make an optimization of the indicator and see how it performs:
The first column is the number of days in the lookback period and the second and third are the entry and exit levels. The rank is primarily on the profit factor and secondly on the number of trades.
Compared to the Williams %R we can see that the patterns seem a bit more random and we don’t see any particular “clusters”.
The equity chart below is a two-day RSI and entry at 10 and exit at 60:
The strategy performed reasonably well until 2015 but has since then performed poorly. As we can see, the blue line shows that the drawdown was 30% when the Covid-19 hit the markets in 2020. The max system drawdown is higher than for Williams %R.
The Internal Bar Strength Indicator
Let’s go to the next indicator: the Internal Bar Strength Indicator (IBS). This is a “simple” indicator that measures the (close – low) / (high – low) and oscillates between 0 and 1. A value of 0 means the close is equal to today’s low, and opposite, a value of 1 means the close is today’s high.
We optimized the indicator by using a moving average of the IBS:
The first column shows the number of days in the moving average, and the two next columns show the entry and exit criteria. The profit factor is high but the drawdown varies a lot. Also, the number of days (the first column) shows that there are no clusters.
If we use a two-day average and enter when the value closes below 0.3 and sells when it reaches 0.8, we get the following equity chart:
The stochastic indicator is an indicator that has two lines: a fast line that is called %K and a slow line which is called %D.
The %K is pretty similar to Williams %R. The %K reads like this if we are using a five-day lookback period:
( close – low(5) ) /( High(5) – low(5) ) * 100.
The %D is a smoothed average of the %K. In this article, we don’t test crossovers of %K and %D but only look at values of %K.
The chart below has both the five-day %K and a five-day RSI in the two lower panes:
Let’s optimize the stochastic %K:
Again, it’s difficult to see a particular pattern in both the number of days and the level of entry and exit. All in all, the stochastic indicator performs well and has captured most of the important movements of the S&P 500 all the way back to 1993.
The best CAGR was 4 days and 40 and 75 for entry and exit, but the drawdown was pretty big. A two-day lookback period and 10 as entry threshold and 70 as exit showed small drawdowns and great returns. Here is the equity curve:
Bollinger Bands were named after its inventor, John Bollinger. The indicator consists of three bands:
- The middle band is a moving average based on x days (usually an exponential or simple moving average).
- An upper band x number of standard deviations added to the moving average.
- A lower band x standard deviations subtracted from the moving average.
Normally, a buy signal happens when the lower band is penetrated, and a sell signal is when the price crosses the middle or the upper bands. For trend-followers, the signal could be the opposite, but that doesn’t work in the stock market.
Below is our optimization of the Bollinger Bands:
The best combinations of the Bollinger Bands are from 6 days up to ten days, but the max drawdown is for all combinations pretty high.
The equity chart below shows 8 days, one standard deviation for entry, and 1.8 standard deviations for exit:
WilliamsVixFix was developed by the famous trader and tax rebellion Larry Williams.
The indicator is a proxy for the real VIX (please read our article about what is the VIX?) and can be used on any ETF, stock, or any financial asset you like or trade.
What does the WilliamsVixFix measure? In plain English it looks back at the highest and lowest quotes over the last n bars:
- The high over the last n days and subtract the low of today (or the current bar).
- Divide by the highest close of the past n days.
- The result is multiplied by 100 to “normalize” the indicator.
The result is a volatility indicator that resembles (visually) the real VIX. An example is provided below showing the similarities between the two:
Let’s make an optimization by using a 10-day lookback period to better understand if this is a good trading indicator or not (the indicator has quite a few “overlapping” trades). We use the “percentrank” function in Amibroker (also read more about this in the linked article about the indicator):
Like in all our other backtests we sorted the results based on the profit factor and the number of trades. A ten-day lookback period seems best for entry and exits :
The CAGR is about 8.5% and the strategy is invested about 50% of the time. However, the drawdown is pretty high.
Amibroker code for the best oscillating indicator
Amibroker is a very powerful tool despite its cheap price. It works both for backtesting and live trading, especially with Interactive Brokers. How you can learn to code, do backtests, and live trading is described in our Amibroker course.
Conclusion: Which oscillating indicator is the best for trading strategies?
Based on the backtests we did in this article, we would rank the backtested oscillating indicators in the following order:
- Williams %R
- Internal Bar Strength Indicator
- Relative Strength Index
- Bollinger Bands
Williams %R is the best oscillating indicator! But we regard the three on the top as pretty equal.
What do we base this rank on?
We put Williams %R on top because it showed the most stable and solid results around all the different variables. Furthermore, Williams %R is the indicator that had the lowest average max drawdown, one of the most important parameters for a short-term trader.