Skip to main content

STOCH

Type: stoch • Category: indicators

Description

Stochastic Oscillator

Parameters

NameTypeDescriptionRequiredDefault
dataExpstringdata with pricesno
highstringselect the column with highest pricesno
lowstringselect the column with lowest pricesno
closestringselect the column with closing pricesno
fastk_periodnumberFast %K periodno5
slowk_periodnumberSlow %K periodno3
slowk_matypenumberSlow %K MA typeno0
slowd_periodnumberSlow %D periodno3
slowd_matypenumberSlow %D MA typeno0

Help

STOCH: Stochastic Oscillator

Description

The Stochastic Oscillator (STOCH) is a popular technical indicator used in financial analysis to measure the momentum of a security's price. It compares the closing price of a security to its price range over a given period of time.

What does this worker do?

This worker calculates the Stochastic Oscillator values for a given dataset. It takes in a dataset with prices and calculates the following:

  • %K (Fast Stochastic): a measure of the current price level relative to the high-low range over a given period
  • %D (Slow Stochastic): a moving average of %K

How to interpret the results?

The Stochastic Oscillator generates buy and sell signals based on the following conditions:

  • Buy signal: When %K crosses above %D and is below 20, it indicates a potential buy opportunity.
  • Sell signal: When %K crosses below %D and is above 80, it indicates a potential sell opportunity.

Usage

To use this worker, simply provide a dataset with prices and configure the parameters:

Parameters

  • dataExp: dataset with prices
  • high: column with highest prices
  • low: column with lowest prices
  • close: column with closing prices
  • fastk_period: Fast %K period
  • slowk_period: Slow %K period
  • slowk_matype: Slow %K MA type
  • slowd_period: Slow %D period
  • slowd_matype: Slow %D MA type

Example

For a better understanding of how to use this worker, you can watch the following videos:

Full example

[![Full example](https://pub-6c7cc7f707d94ca98153d59a039b9a3d.r2.dev/indicator_full.gif)](https://pub-6c7cc7f707d94ca98153d59a039b9a3d.r2.dev/indicator_full.gif)

Short example

[![Short example](https://pub-6c7cc7f707d94ca98153d59a039b9a3d.r2.dev/indicator_short.gif)](https://pub-6c7cc7f707d94ca98153d59a039b9a3d.r2.dev/indicator_short.gif)

Additional Information

The Stochastic Oscillator was developed by George C. Lane in the 1950s. It is a momentum indicator that compares the closing price of a security to its price range over a given period. The indicator is based on the idea that as prices rise, the closing price tends to be closer to the highs of the range, and as prices fall, the closing price tends to be closer to the lows of the range.

The Stochastic Oscillator is often used in combination with other technical indicators to confirm trading signals. It can be used to identify overbought and oversold conditions, as well as to generate buy and sell signals.