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 datawindow
- Window size for the rate of change calculationcolumn
- Column name to use for calculations (default “close”)
§Returns
Returns a PolarsResult containing the ROCP Series