diff --git a/qlib/data/ops.py b/qlib/data/ops.py index fa467a54f0..f6b7a1fbe0 100644 --- a/qlib/data/ops.py +++ b/qlib/data/ops.py @@ -689,6 +689,9 @@ def get_extended_window_size(self): class Rolling(ExpressionOps): """Rolling Operator + The meaning of rolling and expanding is the same in pandas. + When the window is set to 0, the behaviour of the operator should follow `expanding` + Otherwise, it follows `rolling` Parameters ---------- @@ -1194,6 +1197,14 @@ def _load_internal(self, instrument, start_index, end_index, freq): # support pair-wise rolling like `Slope(A, B, N)` class Slope(Rolling): """Rolling Slope + This operator calculate the slope between `idx` and `feature`. + (e.g. [, , ] and [1, 2, 3]) + + Usage Example: + - "Slope($close, %d)/$close" + + # TODO: + # Some users may want pair-wise rolling like `Slope(A, B, N)` Parameters ----------