mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-01 18:11:18 +08:00
@@ -689,6 +689,9 @@ class If(ExpressionOps):
|
||||
|
||||
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 @@ class Delta(Rolling):
|
||||
# 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. [<feature_t1>, <feature_t2>, <feature_t3>] and [1, 2, 3])
|
||||
|
||||
Usage Example:
|
||||
- "Slope($close, %d)/$close"
|
||||
|
||||
# TODO:
|
||||
# Some users may want pair-wise rolling like `Slope(A, B, N)`
|
||||
|
||||
Parameters
|
||||
----------
|
||||
|
||||
Reference in New Issue
Block a user