Stochastic

Category: Indicators

The Stochastic oscillator is a momentum indicator that compares a particular closing price of a security to a range of its prices over a certain period of time. The sensitivity of the oscillator to market movements is reducible by adjusting that time period or by taking a moving average of the result.

Syntax:

Stochastic[N,K](price1, price2, price3)
  • N – The number of periods used to calculate the %K line.
  • K – The smoothing period for the %K line. Typically, K=1 for a Fast Stochastic and K=3 or 5 for a Slow Stochastic.
  • price1, price2, price3 – Optional parameters to specify different price series for calculation. By default, these are set to the close price for %K calculation and high/low for %D calculation.

Example Usage:

sto = Stochastic[10,3](close)
signal = average[5](sto)
if(sto > 80 AND sto[1] > signal[1] AND sto < signal) THEN
    overboughtSignal = 1
ELSE
    overboughtSignal = 0
ENDIF
RETURN overboughtSignal

This example calculates the Stochastic oscillator for the close prices over 10 periods with a 3-period moving average. It then compares the current Stochastic value to a 5-period average of itself to determine if the security is overbought.

Additional Information:

  • The Stochastic oscillator is typically used to identify overbought and oversold conditions in a market.
  • Values above 80 indicate an overbought condition, and values below 20 indicate an oversold condition.
  • Divergences between the Stochastic oscillator and the price action of the security can signal potential reversal points in the market.

Understanding and utilizing the Stochastic oscillator can help in making informed trading decisions by indicating potential entry and exit points based on momentum and price extremes.

Logo Logo
Loading...