Skip to content
All library documents

A Pivot Detector Oscillator Using RSI and a Long-Term Average

Article Strategy library · Author: HPotter

Summary

This script turns RSI into a directional oscillator by first comparing the close with a simple moving average. It applies one RSI rescaling when price is above that average and another when price is at or below it, then compares the resulting value with a midpoint threshold. Values on either side of the threshold set a long or short position state; an input can reverse those directions. The script also colors chart bars by the current state and plots the scaled oscillator with upper, middle, and lower reference levels.

The published defaults use a 200-period moving average and a 14-period RSI, with reference levels at 100, 50, and zero. The page identifies the script as an educational backtest, but provides no performance statistics, instrument, test interval, or risk controls. It therefore explains a signal construction rather than establishing that it is profitable. Because positions are entered whenever the state is long or short, the excerpt does not specify a separate stop, exit rule, or sizing method.

Key ideas

  • The oscillator rescales RSI differently depending on whether price is above or below a simple moving average.
  • A midpoint threshold converts the scaled oscillator into long or short states.
  • A reverse option flips the directional states.
  • The script displays both the oscillator and state-based bar colors.
  • The page gives no backtest results or explicit risk-management rules.

Tags

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.