stoch

forge.tafunctionSince Forge API 1
Signaturepython
forge.ta.stoch(high: ArrayLike,low: ArrayLike,close: ArrayLike,k_period: int = 5,d_period: int = 3,slowing: int = 3,basis: str = 'high_low') -> dict[str, np.ndarray]

Stochastic oscillator: k is the slowed %K and d its simple average.

Parameters

NameTypeDefault
highArrayLike
lowArrayLike
closeArrayLike
k_periodint5
d_periodint3
slowingint3
basisstr'high_low'

Indicator: Stochastic oscillator

slowing sums the close's distance from the lowest low and the high to low range over that many bars before dividing once (MetaTrader 5's smoothing). basis takes the highest high and lowest low (high_low) or the highest and lowest close (close_close). A window with no range reads 50.