Schaff Trend Cycle (STC) combines Slow Stochastic (%D) and Moving Average Convergence Divergence (MACD) indicators. This creates a signal line that can be used to identify market trend as well as buy and sell signals.

Hierarchy

Constructors

  • Parameters

    • priceChart: TradingChart
    • chart: ChartXY<UIBackground>
    • openValues: number[]
    • highValues: number[]
    • lowValues: number[]
    • closeValues: number[]
    • lineColor: Color
    • lineWidth: number
    • rowIndex: number

    Returns SchaffTrendCycle

Methods

  • Gets the indicator name.

    Returns string

    The indicator name.

  • Sets the moving average types used to calculate the first Stochastic.

    Parameters

    Returns void

  • Sets the time period counts used to calculate the first Stochastic.

    Parameters

    • stochasticPeriods: number

      Time periods used to calculate the oscillator (%K) values.

    • smoothingPeriods: number

      Time periods used to smooth the oscillator (%K) line.

    • movingAveragePeriods: number

      Time periods used to calculate the moving average (%D) values.

    Returns void

  • Sets the line color of the indicator.

    Parameters

    • newColor: string

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

    Returns void

  • Sets the line width of the indicator.

    Parameters

    • newWidth: number

      New line width.

    Returns void

  • Sets the moving average types used to calculate the MACD.

    Parameters

    • shortMovingAverage: MovingAverageType

      Moving average type to calculate the short average.

    • longMovingAverage: MovingAverageType

      Moving average type to calculate the long average.

    Returns void

  • Sets the short and long time period counts used to calculate the MACD.

    Parameters

    • shortPeriodCount: number

      Short time period count.

    • longPeriodCount: number

      Long time period count.

    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 moving average types used to calculate the second Stochastic.

    Parameters

    Returns void

  • Sets the time period counts used to calculate the second Stochastic.

    Parameters

    • stochasticPeriods: number

      Time periods used to calculate the oscillator (%K) values.

    • smoothingPeriods: number

      Time periods used to smooth the oscillator (%K) line.

    • movingAveragePeriods: number

      Time periods used to calculate the moving average (%D) values.

    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