Operators
Table of Contents
This operator removes the whole number part and returns the remaining fraction part with sign. Detailed description
else if input > 0, return 1
else if input < 0, return -1
else if input = 0, return 0
x raised to the power of y such that final result preserves sign of x. Detailed description
Confine function to a shorter range using logarithm such that higher input remains higher and negative input remains negative as an output of resulting function and -1 or 1 is an asymptotic value. Detailed description
Converts a grouping field of many buckets into lesser number of only available buckets so as to make working with grouping fields computationally efficient. Detailed description
For time series operator with look back days parameter (d) , d must be <512
Instead of replacing today’s value with yesterday’s as in ts_delay(x, 1), it assigns weighted average of today’s and yesterday’s values with weight on today’s value being k and yesterday’s being (1-k). Detailed description
Limits amount and magnitude of changes in input (thus reducing turnover). Detailed description
This operator helps to ignore the values that changed too little corresponding to previous ones. Detailed description
If there is a huge jump in current data compare to previous one Detailed description
Returns the relative index of the max value in the time series for the past d days. If the current day has the max value for the past d days, it returns 0. If previous day has the max value for the past d days, it returns 1. Detailed description
Returns x - tsmean(x, d), but deals with NaNs carefully. That is NaNs are ignored during mean computation. Detailed description
Returns K-th central moment of x for the past d days. Detailed description
Returns various parameters related to regression function. Detailed description
Returns the relative change in the x value .
Detailed description
Returns (x – ts_min(x, d)) / (ts_max(x, d) – ts_min(x, d)) + constant
This operator is similar to scale down operator but acts in time series space. Detailed description
For each instrument, we collect values of input in the past d days and calculate the probability distribution then the information entropy via a histogram as a result. Detailed description
Returns Geometric Mean of ts_rank(input,d) of all input - Arithmetic Mean of ts_rank(input,d) of all input. This is similar to rank_gmean_amean_diff operator but in time-series space. Detailed description
Calculates the mean value of all valid alpha values for a certain date, then subtracts that mean from each element. Detailed description
(if side = short), respectively.
Scales all values in each day proportionately between 0 and 1 such that minimum value maps to 0 and maximum value maps to 1. Constant is the offset by which final result is subtracted. Detailed description
Operator truncates all values of x to maxPercent. Here, maxPercent is in decimal notation. Detailed description
Operator returns difference of geometric mean and arithmetic mean of cross sectional rank of inputs. Detailed description
Only to be used with Vector data fields
This operator does inverse tangent of input. Detailed description
Convert float values into indexes for user-specified buckets. Bucket is useful for creating group values, which can be passed to group operators as input. Detailed description
Limits input value between lower and upper bound in inverse = false mode (which is default). Alternatively, when inverse = true, values between bounds are replaced with mask, while values outside bounds are left as is. Detailed description
Used to filter the value and allows to create filters like linear or exponential decay. Detailed description
This operator outputs value x when f changes and continues to do that for “period” days after f stopped changing. After “period” days since last change of f, NaN is output. Detailed description
Used in order to change Alpha values only under a specified condition and to hold Alpha values in other cases. It also allows to close Alpha positions (assign NaN values) under a specified condition. Detailed description
If a certain value for a certain date and instrument is NaN, from the set of same group instruments, calculate winsorized mean of all non-NaN values over last d days. Detailed description
Regroup remaining stocks based on group2 and so on if originial_group does not cover all stocks in target universe. Detailed description
Neutralizes Alpha against groups. These groups can be subindustry, industry, sector, country or a constant. Detailed description
Normalizes input such that each group's absolute sum is 1. Detailed description
Percentage = 0.5 means value is equal to group_median(x, group)
Notes:
- All operator calls are to be made using the following order of arguments:
- Required amount of data fields
- Group (optional)
- Lookback days (optional)
- Keyword arguments (optional)
- In the “Operator” column, they are shown as key=default_value.
- They are passed in the form key=value.
- Keyword argument may be omitted, in this case its default value will be passed to operator.
- Examples:
- ts_delta(close, 21)
- ts_regression(close, ts_step(1), 21, lag = 63, rettype = 1)
- ts_regression(close, ts_step(1), 21)
- same as ts_regression(close, ts_step(1), 21, lag=0, rettype=0)
- ts_covariance(close, vwap, 20)
- group_rank(close, industry)
- group_backfill(sales / assets, subindustry, 252, std = 3)
2. Variable assignment is possible in the following form:
a = sales / assets; ts_delta(a, 252)
Variable re-assignment is not permitted.
3. Underscores in operator names can be omitted for ease of typing.