Stochastic oscillator
Where the close sits in the recent high to low range, with a signal line.
Inputs
| Name | Type | Default | Range |
|---|---|---|---|
| k_period | int | 5 | 1 to 5000 |
| d_period | int | 3 | 1 to 5000 |
| slowing | int | 3 | 1 to 5000 |
| basis | choice | high_low |
Outputs
| Name | Type | Required | Description |
|---|---|---|---|
| k | value | Optional | color theme.series_a, style line, width 1 |
| d | value | Optional | color theme.series_b, dash dash, style line, width 1 |
- Warm-up
- k_period + slowing + d_period - 3 bars (8 at the defaults)
- Repaints
- No
- Parity
- MetaTrader 5, within 1e-12
Formula
The highest high and lowest low over K period (the highest and lowest close with close_close)
%K = 100 * sum(close - lowest, slowing) / sum(highest - lowest, slowing)
%D = the simple average of %K over D period
A window with no range reads 50.