stoch_k

Stochastic %K (Fast Stochastic)

stoch_k(period)

Parameters

Stochastic %K - stoch_k(period)

The fast stochastic oscillator that measures the current close position

relative to the high-low range over a specified period. Values range from 0 to 100.

  • period (int): Number of periods for high-low range calculation
  • Common values: 14 (standard), 5 (fast), 21 (slow)

Formula


%K = 100 * (Close - Lowest Low) / (Highest High - Lowest Low)

Where:
- Close = Current closing price
- Lowest Low = Lowest low over period
- Highest High = Highest high over period

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

Stochastic %K value ranging from 0 (lowest point in range) to 100 (highest point)