Factors Directory

Quantitative Trading Factors

Stochastic Oscillator

Overbought and OversoldTechnical FactorsMomentum Factor

factor.formula

Immature Random Value (RSV):

Fast random value (K):

Slow Random Values ​​(D):

Divergence (J):

Weighted Moving Average (SMA):

Parameter explanation:

  • :

    The number of lookback periods is used to calculate the highest and lowest prices in the past N periods. The default value is 9.

  • :

    The number of smoothing periods of the fast random value K. The default value is 3, which is generally used to control the sensitivity of the K value to RSV.

  • :

    The number of smoothing cycles of the slow random value D. The default value is 3. It is generally used to control the sensitivity of the D value to the K value.

  • :

    Indicates the current time.

  • :

    Indicates the closing price of the current period.

  • :

    Indicates the lowest price within N periods back from the current period.

  • :

    Indicates the highest price within N periods looking back from the current period.

  • :

    Represents the immature random value of the current period.

  • :

    Represents a fast random value for the current period.

  • :

    Represents the slow random value of the current period.

  • :

    Indicates the divergence value of the current period.

  • :

    Represents the weighted moving average of the previous period.

factor.explanation

The stochastic oscillator calculates the immature random value (RSV) and smoothes it to obtain the fast random value K and the slow random value D, which are used to measure market momentum and overbought and oversold conditions. RSV reflects the relative position of the current closing price in the price fluctuation range over the past period of time; the K value is a smoothing of the RSV, which is more stable; the D value is a smoothing of the K value, which further reduces the noise and provides a smoother signal. The J value provides a more sensitive short-term momentum signal by amplifying the difference between the K value and the D value, which is used to assist in judging potential reversal points. This indicator is often used in short-term trading strategies to assist traders in identifying the short-term tops and bottoms of the market, but it should be combined with other technical analysis tools for comprehensive judgment to improve the accuracy of the signal.

Related Factors