Rainbow Oscillator is a trend-following indicator based on several recursive smoothings via moving averages of the price. The indicator finds the highest and lowest values among these averages and creates an oscillator and a bandwidth based on them.

Hierarchy

Constructors

Methods

  • Gets the indicator name.

    Returns string

    The indicator name.

  • Sets whether the area between the high and low lines is colored.

    Parameters

    • fillEnabled: boolean

      Set true to enable fill.

    Returns void

  • Sets the width of the band lines.

    Parameters

    • newWidth: number

      New line width.

    Returns void

  • Sets how many time periods are checked when finding out the highest and lowest prices.

    Parameters

    • lookbackPeriods: number

      The number of lookback periods.

    Returns void

  • Sets the type of moving average used to calculate the smoothings.

    Parameters

    Returns void

  • Sets the name of the indicator.

    Parameters

    • name: string

      New indicator name.

    Returns void

  • Moves the indicator from its calculated position forward or backward.

    Parameters

    • newOffset: number

      New offset value.

    Returns void

  • Sets the colors of the bars.

    Parameters

    • colorUp: string

      The color of the oscillator, when above zero value.

    • colorDown: string

      The color of the oscillator, when below zero value.

    Returns void

  • Sets the number of time periods used to calculate each moving average..

    Parameters

    • newPeriodCount: number

      New period count.

    Returns void

  • Sets the number of times the oscillator is smoothed by calculating a moving average.

    Parameters

    • smoothingLevels: number

      The number of smooths.

    Returns void

  • Sets which values the indicator calculations are based on.

    Parameters

    • source: Source

      Values to base the calculations on.

    Returns void

  • Sets the type of the indicator's value label(s).

    Parameters

    Returns void

  • Sets the visibility of the indicator. Hiding the indicator via setVisible(false) does not remove it. Use dispose() to delete any indicator.

    Parameters

    • visible: boolean

      Visibility of the indicator.

    Returns void

  • Programmatically opens the indicator settings menu.

    Returns void