stoch
Stochastic %K
Reference/Oscillators/Function
stoch(length)
Close in the high–low range over length bars, 0–100. Default 14. Uses high/low/close — not a custom series.
Parameters
| Name | Type | Description |
|---|---|---|
length | int default 14 | Lookback in bars. Default 14. |
Return value
series
Example
oscillator k = stoch(14) plot k as "%K" level 80 as "OB" red level 20 as "OS" green when k is below 20 then buy