RMS (Root Mean Square)
The Root Mean Square node computes √(mean(x²)) over the rolling window. RMS measures the "energy" or average magnitude of a signal — it is always non-negative and equals the standard deviation when the mean is exactly zero. RMS is useful for measuring oscillator amplitude, signal strength, and the average absolute magnitude of returns without sign cancellation.
Algorithm
- ▸vals = non-null values in window
- ▸RMS = √(Σ v² / n)
- ▸Returns null when no non-null values exist
Parameters
| Name | Type | Default | Description |
|---|---|---|---|
| period | number | 20 | Rolling window size. |
Inputs & Outputs
| Port | Type | Description |
|---|---|---|
| Inputs | ||
| input | number[] | Source numeric array |
| Outputs | ||
| values | number | null | Computed value at each bar; null before the warmup period completes |
| timestamps | number[] | Bar timestamps (UNIX ms), aligned 1-to-1 with values |
Use Cases
Oscillator Amplitude
Apply RMS to a centered oscillator (e.g., MACD, price − SMA) to measure its average energy. High RMS indicates active oscillation; low RMS indicates quiet, compressing conditions.
Return Magnitude
RMS of returns gives the average absolute magnitude of moves, useful when you want to ignore direction but capture the intensity of market activity.
Signal Strength Thresholding
Only trade when RMS of the entry signal exceeds a minimum threshold — a signal with low RMS suggests weak conviction in the indicator.