Category: Indicator > Oscillators
The Price Oscillator indicator calculates a fast, or short, moving average and a long, or slow, moving average. The difference between these two values is then plotted. The moving averages are not plotted.
One approach to analyzing moving averages is to note the relative position of the 2 averages: the short moving average above the long moving average would yield a positive Price Oscillator value and be bullish; the short moving average below the long moving average would yield a negative Price Oscillator value and be bearish.
Calculating the difference between the two averages and plotting this as an oscillator makes extreme positive and negative values stand out as possible overbought and oversold conditions.
Price - Price used to calculate the moving averages
Fast - Number of bars of data to be included in calculation of the fast (shorter) moving average
Slow - Number of bars of data to be included in calculation of the slow (longer) moving average
INPUTS: PRICE(CLOSE), FAST(14), SLOW(21);
PLOT1(PRICEOSCILLATOR(PRICE, FAST, SLOW), "PRICEOSC");
IF PLOT1 CROSSES OVER 0 THEN
ALERT("PRICE OSCILLATOR HAS CROSSED OVER ZERO")
IF PLOT1 CROSSES UNDER 0 THEN
ALERT("PRICE OSCILLATOR HAS CROSSED UNDER ZERO");