Lipi Reference Lipi

Functions

talib.stoch()

Stochastic reading that places `source` inside the span set by `high` and `low` over `length` bars. The high and low series are arguments rather than assumptions, so you can drive the calculation from series of your own.

Syntax

                talib.stoch(series float source, series float high, series float low, series int length) → series float
              

Arguments

source required series float The series being placed within the span.
high required series float The series supplying the top of the span.
low required series float The series supplying the bottom of the span.
length required series int How many bars the span covers.

Return Type

series float

Example


          indicator("Stochastic Oscillator", overlay=false)
length = input(14, "Stochastic Length")
stochValue = talib.stoch(close, high, low, length)
plot(stochValue, color=color.blue, title="%K Line")
hline(80, "Overbought", color=color.red)
hline(20, "Oversold", color=color.green)