The Oscillator study plots the difference between two moving averages of different lengths or types. The difference of two moving averages with different sensitivities to market action provides an indication of the development of a change in the market environment, such as the emergence of a new trend or a trend reversal.
Calculation for Oscillator
OSC = MA1 - MA2
An Oscillator (OSC) is the difference between two moving averages. The Oscillator is calculated by subtracting the value of the Oscillator's 2nd Moving Average from the value of the Oscillator's 1st Moving Average.
Characteristics & Usage
The Oscillator is a primary trend following tool.
When the Oscillator crosses 0 it indicates a change in trend as the shorter, more sensitive, moving average is crossing over the longer, slower, moving average.
Movement away from 0 indicates the shorter/faster average is accelerating away from the longer/slower average. This is associated with a strengthening trend.
When the two averages are converging, the Oscillator is moving toward 0, this is generally associated with the termination of a trend.
Many trading strategies employ an Oscillator to indicate a buy signal on a cross above zero and a sell signal on a cross below zero.
Users will often place an average on the Oscillator to detect significant changes in its behavior. This is the basis of the Oscillator Less MA study. MACD is a specific type of Oscillator and plots this trailing moving average.
One of the benefits of using an Oscillator to measure the distance between the two averages rather than simply watching their behavior, is that OB/OS levels may be identified.
By identifying extreme points the Oscillator indicates when a short-term trend is over extended relative to its longer-term trend.
The Oscillator is an unbounded study (in contrast to a Stochastic). Accordingly, it will follow the market higher or lower, but this makes defining specific OB/OS levels difficult. Given this characteristic an Oscillator should not be traded against simply because it is OB or OS rather one should wait to see deterioration in its behavior. This may be done by watching studies such as the Oscillator Less MA of Oscillator.
CQG's Conditional Coloring attribute is available with the Oscillator study allowing the color of the study to change when a user-defined condition is true (see Define Formulas - Conditions).
Oscillator Parameters
Parameter |
Description |
Display |
Opens sub-window to set parameters • Color = Line color. • Weight = Line thickness. • Display = Line style: line or histogram. • ShareScale = Determines whether sharing of the vertical scales between studies is accepted. Auto = System determine whether sharing is feasible. On = Scale is shared regardless of the functions and studies displayed. Off = Scale is not shared. ShareScale must be On if study is overlaid on a study with multiple outputs. |
MarkIt |
Opens Specify Conditions window. |
Offset |
Distance in bars between the current bar and the bar to use in the calculation. A positive offset uses future bars. A negative offset uses past bars. For example: 1 = next bar -2 = two bars back from current bar |
Type |
Moving average calculation. Values: • Simple • Smoothed • Exponential • Weighted • Centered • Median • Trix • Exponential Hull |
Period |
Number of bars in the lookback range. |
Price |
Price used to calculate study values. |
OB/OS |
Opens sub-window with overbought and oversold parameters: • Color = Select a color for the line. • Weight = Choose a thickness for the indicator. • Type = Choose fixed or dynamic. Fixed = uses Level as a fixed OB/OS value. Dynamic = uses Standard Deviation and Lookback for a dynamic OB/OS value:. OB: MA(@,Sim,lookback) + factor * STDDEV(@,lookback) OS: MA(@,Sim,lookback) - factor * STDDEV(@,lookback) where @ is the study • Std Dev = Multiplier used to calculate high and low. • Lookback = Number of bars to compare to the current bar. • Level = Percentage of average OB/OS used to calculate predictor Ob/OS levels. • Display = Click this check box to display the component. • Style = Choose a line style. |