# DeMarker Indicator Strategy — What Is It? (Backtest)

Last Updated on January 20, 2023

Many trading indicators are available to traders. One of them is the **DeMarker indicator**, which was named after a prominent technical analyst Thomas DeMark who created it.

**The DeMarker indicator, also known by the abbreviation “DeM”, is a technical indicator that measures the demand for the underlying asset. It** **compares the most recent high and low prices to those of the previous period to determine the direction of the trend and its momentum.**

In this post, we take a look at the indicator and how to use it. We also make a backtest of the indicator.

**What is the DeMarker indicator?**

Also known by the abbreviation “DeM”, the DeMarker indicator is a technical trading indicator that measures the demand for the underlying asset. It compares the most recent high and low prices to those of the previous period to determine the direction of the trend and its momentum.

The DeMarker indicator is a member of the oscillator family of technical indicators and can be used to identify high-risk buying (overbought) or selling (oversold) areas in a given market. Traders can also use it to determine when to enter a market, or when to buy or sell an asset, to capitalize on probable imminent price trends.

The indicator was originally created with daily price bars in mind, but you can apply it to any timeframe since it is based on relative price data. Designed to be a leading indicator, it attempts to signal an imminent change in price trend before it happens. Traders use it in combination with other signals to determine price exhaustion, identify market tops and bottoms, and assess risk levels.

### DeMarker indicator graphic/chart example

Let’s show how the DeMarker indicator looks on a graph. Below is a ten-day DeMarker indicator:

As you can see, it’s an oscillating indicator that goes from overbought to oversold levels.

**DeMarker indicator formula **

The DeMarker indicator works like the RSI indicator oscillator, but unlike the latter, the former does not concern itself with closing levels.

Instead, the DeMarker indicator focuses on intra-period highs and lows. It compares the high and low of the current bar on a chart to those of the previous bar such that, if the current bar has a higher high or a lower low than the previous bar, a value is recorded. On the other hand, if the current has a lower high or a higher low than the previous bar, a value of zero is recorded.

These values are used over a ‘look-back’ period (customarily 14 bars) to get a numerator (DeMax) and denominator (the sum of the moving averages of DeMax and DeMin), which is then used to calculate the DeMarker value by dividing the numerator by the denominator.

**The best strategies can be found in our….**

## Strategy Shop

Backtested trading strategies

Thus, the DeMarker indicator is the moving average of DeMax divided by the sum of the moving averages of DeMax and DeMin. The higher the value of DeMax relative to DeMin, the greater the value of the DeMarker Indicator.

The formula for calculating DeMarker values is given as follows:

DEM = SMA(DeMMAX) [SMA(DeMMAX) + SMA(DeMMIN)]

Where:

- DEM stands for DeMarker
- DeMMAX – records the difference between the current high and previous high over the number of X periods
- DeMMIN – records the difference between the current low and previous low over the number of X periods

The equation yields values bounded between 0 and 100 — values of the indicator above 70 are considered overbought territory, and values of the indicator below 30 are considered oversold territory. However, as always, no asset is the same and you need to backtest to find what is working and what is not working.

For your convenience, we have coded the DeMarker indicator in Amibroker. See the green banner further below in the article.

**DeMarker indicator settings **

Different platforms can set the indicator differently. But the default setting on most platforms is as follows:

- The time span for the calculation of values = 14 periods
- The base value = 0.5
- The overbought and oversold lines = 70 and 30 respectively

However, you can change the settings to what you want. The larger the number of periods you use, the smoother the curve of the DeMarker Indicator, and the smaller the number of periods, the more responsive the curve.

So, if you use a shorter period, which would give sharper oscillations, you might want to consider a higher value than 70 for the overbought line and a lower value than 30 for the oversold line. Similarly, if you use a larger period, you might want to consider a lower boundary for overbought, and a higher one for oversold.

**How do you use the DeMarker indicator?**

Use the DeMarker indicator for a contrarian strategy. That is, you look for a buying opportunity when the indicator is showing oversold levels and a selling opportunity when the indicator is showing overbought levels. The closer the value gets to 0 or 100, the higher the likelihood of a price turn as the market is trading in an extreme environment.

However, you might need to combine DeMarker with a trend-confirming indicator, such as a moving average. In an uptrend, look for only buying setups — oversold DeMarker. In a downtrend, look for only shorting opportunities when the DeMarker is overbought.

## DeMarker indicator trading strategy (backtest and example)

Let’s go on to backtest a DeMarker indicator trading strategy with strict trading rules and settings. To get a good historical performance we backtest S&P 500 by using the ETF with the ticker code SPY, the oldest ETF still trading (since 1993 – please read SPY ETF trading).

We make an optimization to find out how the DeMarker indicator behaves. Read here for an example and definition of strategy optimization. By using an optimization we get a very good “feel” if the indicator (strategy) offers any value.

This is what we do:

- We buy at values below 5 and sell at values above 80.
- We use lookback periods of 3 to 8 days.

This is all there is to it. We get the optimum level at 5 days. If we use a 5-day lookback period the equity curve and drawdowns look like this:

The 141 trades generate an annual return of 4.3% and the profit factor is 2.1.

However, we would not say this is something we would like to trade. If we use the default settings of 30 and 70 the average gain per trade drops to 0.68%, but the annual returns increases to 7.8% because of the large increase in the number of trades and thus more time spent in the market.

If we make two changes the indicator improves:

- We use a 3-day lookback period
- We buy when DeMarker indicator is below 5
- We sell when the close is higher than yesterday’s high

The exit signal plays an important role in trading, something we covered in sell the rip strategy. This looks like a better strategy:

The 458 trades return a CAGR of 6.7%. The profit factor is still a “low” of 1.85, though.

## List of trading strategies

Since we started this blog in 2012 we have written many trading strategies that you can read for free, please see our list of trading strategies. We have compiled the Amibroker code and logic in plain English for all these strategies (plain English is for backtesting in Python) in addition to DeMarker. If you subscribe, you’ll get the code for the DeMarker indicator.

For a list of the strategies we have made please click on the green banner:

These strategies must not be misunderstood for the premium strategies that we charge a fee for:

## DeMarker indicator strategy video

We made a short DeMarker indicator strategy video (we are learning, videos have improved since then).

## DeMarker indicator strategy – conclusion

There are a “zillion” oscillating indicators for traders, and DeMarker is one of them. However, our strategy backtest reveals that the more famous and used indicators are better. We covered those in a separate article called the best indicator for swing trading.