# Detrended oscillator: calculation of overbought/oversold levels

Bestrend oscillator or Detrended Oscillator The indicator of the famous trader Joe DiNapoli is another tool for calculating the overbought/oversold (OBOR) zones of the market. This indicator, as well as several others, has one advantage - its p/n levels will always be dynamic, i.e. they will depend on volatility market. You will learn about the peculiarities of this dynamism in our article.

About using Detrended Oscillator The book "Trading with DiNapoli Levels" says enough, but there is no mention of how to use it to enter the market. But we do not need it yet for the simple reason that first we will consider how to manually calculate the n/a zones. Secondly, it can be used for entry in the same way as for exit, i.e. when the indicator is in the p/o zone.

### Detrended Oscillator

Detrended Oscillator, or the oscillator of bestreliability, is calculated by a simple formula:

MA(close) - close

In other words, in the indicator window, the distance of the closing price to its own moving average is plotted. DiNapoli proposes to use a 7-period simple moving average in this formula. You can see a general view of the indicator in Figure 1.

Fig. 1. The oscillator of the bestreliability.

### Calculation of overbought/oversold levels

By means of of the oscillator of the bestreliability DiNapoli calculates overbought/oversold zones. For this purpose, several significant peaks above and below the zero level are taken, and their average value is taken as 100%. Additional p/n zones that can be used are 60%, 80%, etc. at your choice. Their calculation and plotting is done manually.

In our example, we take three significant peaks on each side for clarity. 100% for overbought areas – это (108+91+69)/3 = 89. Для зоны перепроданности – (51+73+85)/3 = 70.

You can represent these levels on the indicator and quickly calculate the corresponding 60% and 80% using a regular Fibonacci grid (see Fig. 2).

Fig. 2. Calculation of oversold and overbought zones.

As a result, when the price of uptrendfor example, approaching a logical target point (Fibonacci extensions), winds up its indicator (Detrended Oscillator) into the oversold zone, we just get an ideal point for profit taking. Even if in some cases the price continues to move further, there is no need to worry about lost profits. After all, in the long run, such exits from the market help to increase the deposit much more confidently, as the exit is carried out at the moment of market stretching. And seeing off the price and exiting by a reversal signal does not always justify itself.