Reference8 min read
Momentum indicators that fluctuate between bounded values to identify overbought and oversold conditions. Oscillators help time entries and exits by measuring market momentum.
Overview
| Function | Range | Overbought | Oversold |
|---|---|---|---|
rsi() | 0-100 | > 70 | < 30 |
cci() | Unbounded | > +100 | < -100 |
stochastic() | 0-100 | > 80 | < 20 |
rsi()
Relative Strength Index - measures momentum by comparing recent gains to losses.Signature
Parameters
| Parameter | Type | Description |
|---|---|---|
source | TimeSeries | Source data for calculation |
period | number | Number of periods (default: 14) |
priceIndex | number | Index of price data (default: 1) |
Returns
number - RSI value between 0-100
Example
cci()
Commodity Channel Index - measures deviation from statistical mean to identify cyclical trends.Signature
Parameters
| Parameter | Type | Description |
|---|---|---|
source | TimeSeries | Source data series |
period | number | Number of periods (default: 20) |
constant | number | Scaling constant (default: 0.015) |
Returns
number - CCI value, typically between -100 and +100
Example
stochastic()
Stochastic Oscillator - compares closing price to price range over time.Signature
Parameters
| Parameter | Type | Description |
|---|---|---|
source | TimeSeries | Source data series |
kPeriod | number | %K periods (default: 14) |
kSmoothing | number | %K smoothing (default: 3) |
dPeriod | number | %D periods (default: 3) |
Returns
[number, number] - [%K, %D] values between 0-100