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

The difference between Smoothed SO and regular SO is that smoothed study smoothens also the stochastic (%K) line. Different moving averages and time period counts can be used for %K and %D lines.

Hierarchy

Constructors

  • Parameters

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

    Returns StochasticOscillatorSmoothed

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 types of the moving averages used in the indicator's calculations.

    Parameters

    • oscillatorSmoothingAverage: MovingAverageType

      Moving average type for smoothing the oscillator (%K) line.

    • maMovingAverage: number

      Moving average type for calculating the moving average (%D) line.

    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

    • oscillatorPeriodCount: number

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

    • oscillatorSmoothingPeriods: number

      The number of time periods used to smooth the oscillator line.

    • movingAveragePeriodCount: number

      The number of time periods used to calculate the moving average 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