Indicator Description
STOCH (Stochastic Oscillator) is a momentum indicator that measures the strength of price momentum by comparing the current price to the highest and lowest prices over a specified period.
Function Information
- Function Name:
STOCH - Input Parameters:
High: Highest priceLow: Lowest priceClose: Closing price
- Parameter Settings:
fastk_period: Fast K period (default: 5)slowk_period: Slow K period (default: 3)slowk_matype: Slow K moving average type (default: 0)slowd_period: Signal period (default: 3)slowd_matype: Signal moving average type (default: 0)
- Output:
slowk: Slow K lineslowd: Slow D line
Calculation Principle
STOCH is calculated using the following formula:
%K = 100 * (Close - Lowest Low) / (Highest High - Lowest Low)
%D = SMA(%K, slowk_period)Where:
- Close is the current closing price
- Lowest Low is the lowest price in the period
- Highest High is the highest price in the period
- SMA is Simple Moving Average
Usage Scenarios
- Overbought/Oversold Analysis
- Trend Confirmation
- Trading Signal Generation
- Divergence Analysis
Usage Recommendations
- %K > 80 indicates overbought conditions
- %K < 20 indicates oversold conditions
- Watch for %K and %D crossovers
- Pay attention to divergence patterns