stoch_k
Stochastic %K (Fast Stochastic)
stoch_k(period)
Parameters
| Name | Type | Description |
|---|---|---|
period |
int | Number of periods for the high-low range |
Formula
%K = ((close - lowest(low, period)) / (highest(high, period) - lowest(low, period))) * 100, or 50 when the range is zero
Examples
stoch_k(14); # Standard 14-period %K
stoch_k(5); # Fast 5-period %K
stoch_k(14) > 80; # Overbought condition
stoch_k(14) < 20; # Oversold condition
Returns
float
Range
period must be 2-400
Notes
%K > 80 is overbought, %K < 20 is oversold; returns 50 when the high-low range is zero to avoid dividing by zero
See Also
References
TradingView: ta.stoch() returns [k, d]; developed by George Lane