Function calculate_rsi

Source
pub fn calculate_rsi(
    df: &DataFrame,
    window: usize,
    column: &str,
) -> PolarsResult<Series>
Expand description

Calculates Relative Strength Index (RSI) Formula: RSI = 100 - (100 / (1 + RS)) where RS = Average Gain / Average Loss

§Arguments

  • df - DataFrame containing the price data
  • window - Window size for RSI (typically 14)
  • column - Column name to use for calculations (default “close”)

§Returns

Returns a PolarsResult containing the RSI Series