ta.stoch
Stochastic: 100 * (source - lowest(low, length)) / (highest(high, length) - lowest(low, length)).
ta.stoch(source: float, high: float, low: float, length: simple int) -> series float
Parameters
sourcefloat: The value placed in the range, usually close.highfloat: The highs the range is taken from, usually high.lowfloat: The lows the range is taken from, usually low.lengthsimple int: Number of bars, a whole number from 1 to 5000 (a fraction is cut off). Known before the first bar: a literal or an input, never a series. Outside 1 to 5000 the script stops with a runtime error. The highest high and lowest low of this many bars make the range.
Example
k = ta.sma(ta.stoch(close, high, low, 14), 3)