Function calculate_rocp

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

Calculates Rate of Change Percentage (ROCP) Formula: (price - prev_price) / prev_price

§Arguments

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

§Returns

Returns a PolarsResult containing the ROCP Series