StochasticOscillator
class backtide.indicators.StochasticOscillator(k_period=14, d_period=3)
Stochastic Oscillator (STOCH).
Compares the closing price to the high-low range over a period, producing a %K line and a smoothed %D signal line. Both oscillate between 0 and 100. Useful for overbought/oversold signals, %K/%D crossovers for entry/exit timing, and divergence analysis.
Formula:
\[
\begin{aligned}
\%K_t &= 100 \cdot \frac{C_t - L_n}{H_n - L_n} \\\\
\%D_t &= SMA_d(\%K_t)
\end{aligned}
\]
where \(H_n\) and \(L_n\) are the highest high and lowest low over \(n\) periods. Read more on Wikipedia.
| Parameters |
%K look-back period.
d_period : int, default=3
%D smoothing period.
|
| Attributes |
Short ticker-style acronym.
name : str
Human-readable indicator name.
|
See Also
Commodity Channel Index (CCI).
MovingAverageConvergenceDivergence
Moving Average Convergence Divergence (MACD).
Relative Strength Index (RSI).
Methods
| compute | Compute the indicator on a dataset. |
| description | Short explanation of what the indicator measures. |
method backtide.indicatorscompute(data)
Compute the indicator on a dataset.
method backtide.indicatorsdescription()
Short explanation of what the indicator measures.
| Returns |
str
The description.
|