TAlib v0.3.6 TAlib.Indicators.Stochastic

Stochastic Oscillator Wikipedia

  • %K = (Current Close - Lowest Low)/(Highest High - Lowest Low) * 100

  • %D = 3-day SMA of %K

  • Lowest Low = lowest low for the look-back period

  • Highest High = highest high for the look-back period

  • %K is multiplied by 100 to move the decimal point two places

Link to this section Summary

Functions

%K = (Current Close - Lowest Low)/(Highest High - Lowest Low) * 100

Link to this section Functions

Link to this function

stochastic_d(prices, period \\ 3, k_period \\ 14)

%D = 3-day SMA of %K

Parameters

  • prices: List of prices, lates price is the first one in the list.
  • period: MA period to be calculated. Default value is 14

Example

iex> prices = [1330.95, 1334.65, 1340, 1338.7, ...]
iex> TAlib.Indicators.Stochastic.stochastic_k(prices)
90.51859612362499
Link to this function

stochastic_k(prices, period \\ 14)

%K = (Current Close - Lowest Low)/(Highest High - Lowest Low) * 100

Parameters

  • prices: List of prices, lates price is the first one in the list.
  • period: MA period to be calculated. Default value is 14

Example

iex> prices = [1330.95, 1334.65, 1340, 1338.7, ...]
iex> TAlib.Indicators.Stochastic.stochastic_k(prices)
90.51859612362499