Function calculate_rocr

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

Calculates Rate of Change Ratio (ROCR) Formula: price / prev_price

§Arguments

  • df - DataFrame containing the price data
  • window - Window size for the rate of change ratio calculation
  • column - Column name to use for calculations (default “close”)

§Returns

Returns a PolarsResult containing the ROCR Series