Line Oscillator

This study is a combination of two different studies. The first set of calculations compute an oscillator. The second part computes a moving average of the oscillator.

Study Type: Stand-alone

Description

You can specify a value for a moving average of the oscillator. The study computes the values and displays two lines. Trading signals occur whenever the two lines cross. It is a relatively sensitive indicator and works well for intraday charts and trading, but the study generates valid trading signals for any chart type.

Trading signals for this study use a crossover system. If the oscillator crosses from above the moving average to below the moving average of the oscillator, establish a short position.

Conversely, if the oscillator crosses from below to above the moving average of the oscillator, establish a long position.

Formula

In this study, the oscillator is the difference between the first two moving averages. The formula is:

OSCt = (MA1 - MA2)

OSCt is the value of the oscillator for the current period.

MA1 is the first moving average.

MA2 is the second moving average.

The second part of the study computes a moving average of the oscillator. The formula is:

MAosc = (OSC1 +... + OSCn) / n

MAosc is the moving average of the oscillator.

OSCn is the oscillator value for the nth period.

n is the moving average length for the oscillator.

Since the second value is a moving average, it rises and falls more slowly than the oscillator. Hence, the two lines generate crossover points. These points are the buy/sell signals.

Parameters

  • Period 1 (6) - the number of bars, or interval, used to calculate the first Moving Average.
  • Period 2 (21) - the number of bars, or interval, used to calculate the second Moving Average.
  • Period 3 (6) - the number of bars, or interval, used to calculate an additional Moving Average.