calculate_rsi
Pure Python implementation of Wilder's Relative Strength Index using a 14-period window by default. Computes average gain and average loss over the initial period, then applies the standard RS = avg_gain / avg_loss formula to derive the RSI. The function returns the RSI value for the final bar in the input series.
Written without NumPy or pandas dependencies so it runs directly in a Claude Code terminal session without a virtual environment. For production pipelines processing thousands of coins, the function would benefit from Wilder's smoothing method (EMA-based) applied to the gain/loss series rather than simple averaging — the current implementation gives identical results for periods ≥ 14 but diverges slightly for shorter windows.
Ask AI about this skill before installing it.