mirror of
https://github.com/microsoft/qlib.git
synced 2026-07-13 07:46:53 +08:00
@@ -689,6 +689,9 @@ class If(ExpressionOps):
|
|||||||
|
|
||||||
class Rolling(ExpressionOps):
|
class Rolling(ExpressionOps):
|
||||||
"""Rolling Operator
|
"""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
|
Parameters
|
||||||
----------
|
----------
|
||||||
@@ -1194,6 +1197,14 @@ class Delta(Rolling):
|
|||||||
# support pair-wise rolling like `Slope(A, B, N)`
|
# support pair-wise rolling like `Slope(A, B, N)`
|
||||||
class Slope(Rolling):
|
class Slope(Rolling):
|
||||||
"""Rolling Slope
|
"""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
|
Parameters
|
||||||
----------
|
----------
|
||||||
|
|||||||
Reference in New Issue
Block a user