- **Similar:** [ROC](../roc/Roc.md), [Bias](../bias/Bias.md) | **Complementary:** Relative strength vs benchmark | **Trading note:** Price Relative Strength; ratio or spread between two series. Sector rotation tool.
Price Relative Strength (RS) measures the performance of one asset relative to another by calculating the ratio between their prices. This indicator helps identify which asset is outperforming and is fundamental for sector rotation, pairs trading, and relative performance analysis.
Unlike the Relative Strength Index (RSI) which measures momentum within a single asset, RS compares two different price series. A rising RS indicates the base asset is outperforming the comparison asset; a falling RS indicates underperformance.
| **smoothPeriod** | 1 | EMA smoothing period (1 = no smoothing) | Increase for trend analysis, decrease for signal sensitivity |
**Pro Tip:** Use smoothPeriod=1 for raw ratio analysis, smoothPeriod=10-20 for trend identification, and smoothPeriod=50+ for longer-term relative strength trends.
RS with smoothing is three scalar operations: one division for the raw ratio, one FMA for the EMA update, and one divide for the bias compensation factor. Without smoothing (smoothPeriod = 1), the bias step is skipped entirely.
O(1) per bar. The dominant cost is the two floating-point divisions (ratio + bias correction). With smoothPeriod = 1, reduces to ~10 cycles (just the ratio division). WarmupPeriod = smoothPeriod.
### Batch Mode (SIMD Analysis)
| Operation | Vectorizable? | Notes |
| :--- | :---: | :--- |
| Raw ratio (base / comp element-wise) | Yes | `VDIVPD` across full span |
| EMA smoothing pass | No | Recursive IIR dependency; each EMA value depends on previous |
| Bias compensation | Partial | Bias factor is a scalar per-bar sequence; precomputable for batch |
| NaN guard (division by zero) | Yes | `VCMPPD` mask + `VBLENDVPD` for zero-denominator replacement |
The SIMD bottleneck is the recursive EMA. A batch-mode implementation can precompute the raw ratio span via vectorized division (`VDIVPD` at 4 doubles/cycle on AVX2), then apply a scalar EMA sweep for the smoothing pass. This hybrid approach achieves roughly 2× throughput versus fully scalar for large series.