Stochastic Oscillator (SO) indicator compares a closing price to a range of prices over a time period. It is used to identify overbought and oversold levels.

Hierarchy

Constructors

  • Parameters

    • priceChart: TradingChart
    • chart: ChartXY<UIBackground>
    • closeValues: number[]
    • highValues: number[]
    • lowValues: number[]
    • periodCount: number
    • soLineColor: Color
    • maLineColor: Color
    • oversoldColor: Color
    • overboughtColor: Color
    • lineWidth: number
    • rowIndex: number

    Returns StochasticOscillator

Methods

  • Gets the indicator name.

    Returns string

    The indicator name.

  • Sets the width of the Oscillator and Moving Average lines.

    Parameters

    • newWidth: number

      New line width.

    Returns void

  • Sets the color of the Moving Average line.

    Parameters

    • newColor: string

      New line color as string, should be in HEX format e.g. #FFFFFF.

    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 color of the overbought range line.

    Parameters

    • newColor: string

      New line color as string, should be in HEX format e.g. #FFFFFF.

    Returns void

  • Sets the values for oversold and overbought ranges.

    Parameters

    • oversoldRange: number

      Oversold range.

    • overboughtRange: number

      Overbought range.

    Returns void

  • Sets the color of the oversold range line.

    Parameters

    • newColor: string

      New line color as string, should be in HEX format e.g. #FFFFFF.

    Returns void

  • Sets the time period counts used to calculate the indicator.

    Parameters

    • soPeriodCount: number

      The number of time periods used to calculate the oscillator line (%K).

    • maPeriodCount: number

      The number of time periods used to calculate the moving average oscillator line (%D).

    Returns void

  • Sets the color of the Stochastic Oscillator line.

    Parameters

    • newColor: string

      New line color as string, should be in HEX format e.g. #FFFFFF.

    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