name: add description: Add all inputs (at least 2 inputs required). If filter = true, filter all input NaN to 0 before adding category:Arithmetic definition:add(x, y, filter = false), x + y name: abs description: Absolute value of x category:Arithmetic definition:abs(x) name: log description: Natural logarithm. For example: Log(high/low) uses natural logarithm of high/low ratio as stock weights. category:Arithmetic definition:log(x) name: subtract description: x-y. If filter = true, filter all input NaN to 0 before subtracting category:Arithmetic definition:subtract(x, y, filter=false), x - y name: signed_power description: x raised to the power of y such that final result preserves sign of x category:Arithmetic definition:signed_power(x, y) name: sign description: if input > 0, return 1; if input < 0, return -1; if input = 0, return 0; if input = NaN, return NaN;Input: Value of 7 instruments at day t: (2, -3, 5, 6, 3, NaN, -10)Output: (1, -1, 1, 1, 1, NaN, -1) category:Arithmetic definition:sign(x) name: reverse description:  - x category:Arithmetic definition:reverse(x) name: power description: x ^ y category:Arithmetic definition:power(x, y) name: multiply description: Multiply all inputs. At least 2 inputs are required. Filter sets the NaN values to 1 category:Arithmetic definition:multiply(x ,y, ... , filter=false), x * y name: min description: Minimum value of all inputs. At least 2 inputs are required category:Arithmetic definition:min(x, y ..) name: max description: Maximum value of all inputs. At least 2 inputs are required category:Arithmetic definition:max(x, y, ..) name: inverse description: 1 / x category:Arithmetic definition:inverse(x) name: sqrt description: Square root of x category:Arithmetic definition:sqrt(x) name: s_log_1p 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 category:Arithmetic definition:s_log_1p(x) name: densify 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 category:Arithmetic definition:densify(x) name: divide description: x / y category:Arithmetic definition:divide(x, y), x / y name: not description: Returns the logical negation of x. If x is true (1), it returns false (0), and if input is false (0), it returns true (1). category:Logical definition:not(x) name: and description: Logical AND operator, returns true if both operands are true and returns false otherwise category:Logical definition:and(input1, input2) name: less description: If input1 < input2 return true, else return false category:Logical definition:input1 < input2 name: equal description: Returns true if both inputs are same and returns false otherwise category:Logical definition:input1 == input2 name: or description: Logical OR operator returns true if either or both inputs are true and returns false otherwise category:Logical definition:or(input1, input2) name: not_equal description: Returns true if both inputs are NOT the same and returns false otherwise category:Logical definition:input1!= input2 name: greater description: Logic comparison operators to compares two inputs category:Logical definition:input1 > input2 name: greater_equal description: Returns true if input1 >= input2, return false otherwise category:Logical definition:input1 >= input2 name: less_equal description: Returns true if input1 <= input2, return false otherwise category:Logical definition:input1 <= input2 name: is_nan description: If (input == NaN) return 1 else return 0 category:Logical definition:is_nan(input) name: if_else description: If input1 is true then return input2 else return input3. category:Logical definition:if_else(input1, input2, input 3) name: ts_sum description: Sum values of x for the past d days. category:Time Series definition:ts_sum(x, d) name: ts_scale 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 category:Time Series definition:ts_scale(x, d, constant = 0) name: ts_mean description: Returns average value of x for the past d days. category:Time Series definition:ts_mean(x, d) name: ts_zscore description: Z-score is a numerical measurement that describes a value's relationship to the mean of a group of values. Z-score is measured in terms of standard deviations from the mean: (x - tsmean(x,d)) / tsstddev(x,d). This operator may help reduce outliers and drawdown.Input: Value of 1 instrument in past 5 days where first element is the latest: (100, 0, 50, 60, 25), d: 5Output: (100-47)/33.7 = 1.57 from SD: 33.7, mean = 47 category:Time Series definition:ts_zscore(x, d) name: ts_std_dev description: Returns standard deviation of x for the past d days category:Time Series definition:ts_std_dev(x, d) name: kth_element description: Returns K-th valid value of input by looking through lookback days. This operator can be used to backfill missing data if k=1 category:Time Series definition:kth_element(x, d, k) name: inst_tvr description: Total trading value / Total holding value in the past d daysInput: Value of 1 instrument in past 5 days where first element is the latest: (105, 102, 99, 101,100)Output: 0.022 from (1+2+3+3)/(105+102+99+101) category:Time Series definition:inst_tvr(x, d) name: ts_corr description: Returns correlation of x and y for the past d days category:Time Series definition:ts_corr(x, y, d) name: ts_count_nans description: Returns the number of NaN values in x for the past d daysInput: Value of 1 instrument in past 4 days where first element is the latest: (100, NaN, NaN, 200), d: 4Output: Number of NaN in 4 days = 2 category:Time Series definition:ts_count_nans(x ,d) name: ts_target_tvr_decay description: Tune "ts_decay" to have a turnover equal to a certain target, with optimization weight range between lambda_min, lambda_max category:Time Series definition:ts_target_tvr_decay(x, lambda_min=0, lambda_max=1, target_tvr=0.1) name: ts_median description: Returns median value of x for the past d days category:Time Series definition:ts_median(x, d) name: ts_covariance description: Returns covariance of y and x for the past d days category:Time Series definition:ts_covariance(y, x, d) name: ts_decay_linear description: Returns the linear decay on x for the past d days. Dense parameter=false means operator works in sparse mode and we treat NaN as 0. In dense mode we do not. category:Time Series definition:ts_decay_linear(x, d, dense = false) name: ts_product description: Returns product of x for the past d days category:Time Series definition:ts_product(x, d) name: ts_regression description: Returns various parameters related to regression function category:Time Series definition:ts_regression(y, x, d, lag = 0, rettype = 0) name: ts_delta_limit description: Limit the change in the Alpha position x between dates to a specified fraction of y. The "limit_volume" can be in the range of 0 to 1. Also, please be aware of the scaling for x and y. Besides setting y as adv20 or volume related data, you can also set y as a constant. category:Time Series definition:ts_delta_limit(x, y, limit_volume=0.1) name: ts_step description: Returns days' counter category:Time Series definition:ts_step(1) name: ts_decay_exp_window description: Returns exponential decay of x with smoothing factor for the past d days category:Time Series definition:ts_decay_exp_window(x, d, factor = f) name: ts_quantile description: It calculates ts_rank and apply to its value an inverse cumulative density function from driver distribution. Possible values of driver (optional ) are "gaussian", "uniform", "cauchy" distribution where "gaussian" is the default.Input: Value of 1 instrument in past 7 days where first element is the latest: (8, 10, 4, 6, 5, 3, 2), d: 7, driver: ’gaussian’Output: quantile = 0.82 from SD = 2.82, mean = 5.43, zscore = 0.911 category:Time Series definition:ts_quantile(x,d, driver="gaussian" ) name: days_from_last_change description: Amount of days since last change of xInput: Value of 1 instrument in past 7 days where first element is the latest: (2, 2, 2, 7, 5, 16, 1)Output: 3 category:Time Series definition:days_from_last_change(x) name: hump description: Limits amount and magnitude of changes in input (thus reducing turnover) category:Time Series definition:hump(x, hump = 0.01) name: last_diff_value description: Returns last x value not equal to current x value from last d days category:Time Series definition:last_diff_value(x, d) name: ts_arg_max 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 category:Time Series definition:ts_arg_max(x, d) name: ts_arg_min description: Returns the relative index of the min value in the time series for the past d days; If the current day has the min value for the past d days, it returns 0; If previous day has the min value for the past d days, it returns 1. category:Time Series definition:ts_arg_min(x, d) name: ts_av_diff description: Returns x - tsmean(x, d), but deals with NaNs carefully. That is NaNs are ignored during mean computation category:Time Series definition:ts_av_diff(x, d) name: ts_backfill description: Returns the first valid value of the input x by looking through lookback days (d). This operator can be used to backfill missing data. category:Time Series definition:ts_backfill(x, d) name: ts_rank description: Rank the values of x for each instrument over the past d days, then return the rank of the current value + constant. If not specified, by default, constant = 0.Input: Value of 1 instrument in past 3 days where first element is the latest: (100, 0, 200), d: 3Output: 0.5 category:Time Series definition:ts_rank(x, d, constant = 0) name: ts_delay description: Returns x value d days agoInput: Value of 1 instrument in past 7 days where first element is the latest: (2, 3, 5, 6, 3, 8, 10), d: 6Output: Value 6 days ago = 10 category:Time Series definition:ts_delay(x, d) name: ts_delta description: Returns x - ts_delay(x, d)Input: Value of 1 instrument in past 7 days where first element is the latest: (2, 3, 5, 6, 3, 8, 10), d: 6Output: Value today – value 6 days ago = 2 - 10 = -8 category:Time Series definition:ts_delta(x, d) name: winsorize description: Winsorizes x to make sure that all values in x are between the lower and upper limits, which are specified as multiple of std.Input: Value of 7 instruments at day t: (2, 4, 5, 6, 3, 8, 10), std: 1Output: (2.81, 4, 5, 6, 3, 8, 8.03) from SD. = 2.61, mean = 5.42 category:Cross Sectional definition:winsorize(x, std=4) name: truncate description: Operator truncates all values of x to maxPercent. Here, maxPercent is in decimal notation category:Cross Sectional definition:truncate(x,maxPercent=0.01) name: regression_neut description: Conducts the cross-sectional regression on the stocks with Y as target and X as the independent variable category:Cross Sectional definition:regression_neut(y, x) name: scale description: Scales input to booksize. We can also scale the long positions and short positions to separate scales by mentioning additional parameters to the operator category:Cross Sectional definition:scale(x, scale=1, longscale=1, shortscale=1) name: rank description: Ranks the input among all the instruments and returns an equally distributed number between 0.0 and 1.0. For precise sort, use the rate as 0 category:Cross Sectional definition:rank(x, rate=2) name: quantile description: Rank the raw vector, shift the ranked Alpha vector, apply distribution (gaussian, cauchy, uniform). If driver is uniform, it simply subtract each Alpha value with the mean of all Alpha values in the Alpha vector category:Cross Sectional definition:quantile(x, driver = gaussian, sigma = 1.0) name: normalize description: Calculates the mean value of all valid alpha values for a certain date, then subtracts that mean from each element category:Cross Sectional definition:normalize(x, useStd = false, limit = 0.0) name: zscore description: Z-score is a numerical measurement that describes a value's relationship to the mean of a group of values. Z-score is measured in terms of standard deviations from the mean category:Cross Sectional definition:zscore(x) name: vec_min description: Minimum value form vector field x category:Vector definition:vec_min(x) name: vec_count description: Number of elements in vector field x category:Vector definition:vec_count(x) name: vec_stddev description: Standard Deviation of vector field x category:Vector definition:vec_stddev(x) name: vec_range description: Difference between maximum and minimum element in vector field x category:Vector definition:vec_range(x) name: vec_avg description: Taking mean of the vector field xInput: Vector of value of 1 instrument in a day: (2, 3, 5, 6, 3, 8, 10)Output: 37 / 7 = 5.29 category:Vector definition:vec_avg(x) name: vec_sum description: Sum of vector field xInput: Vector of value of 1 instrument in a day: (2, 3, 5, 6, 3, 8, 10)Output: 2 + 3 + 5 + 6 + 3 + 8 + 10 = 37 category:Vector definition:vec_sum(x) name: vec_max description: Maximum value form vector field x category:Vector definition:vec_max(x) name: left_tail description: NaN everything greater than maximum, maximum should be constant category:Transformational definition:left_tail(x, maximum = 0) name: trade_when 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 category:Transformational definition:trade_when(x, y, z) name: right_tail description: NaN everything less than minimum, minimum should be constant category:Transformational definition:right_tail(x, minimum = 0) name: bucket description: Convert float values into indexes for user-specified buckets. Bucket is useful for creating group values, which can be passed to GROUP as input category:Transformational definition:bucket(rank(x), range="0, 1, 0.1" or buckets = "2,5,6,7,10") name: group_rank description: Each elements in a group is assigned the corresponding rank in this group category:Group definition:group_rank(x, group) name: group_cartesian_product description: Merge two groups into one group. If originally there are len_1 and len_2 group indices in g1 and g2, there will be len_1 * len_2 indices in the new group. category:Group definition:group_cartesian_product(g1, g2) name: group_backfill 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 category:Group definition:group_backfill(x, group, d, std = 4.0) name: group_mean description: All elements in group equals to the mean category:Group definition:group_mean(x, weight, group) name: group_neutralize description: Neutralizes Alpha against groups. These groups can be subindustry, industry, sector, country or a constant category:Group definition:group_neutralize(x, group) name: group_normalize description: Normalizes input such that each group's absolute sum is 1 category:Group definition:group_normalize(x, group, constantCheck=False, tolerance=0.01, scale=1) name: group_median description: All elements in group equals to the median value of the group. category:Group definition:group_median(x, group) name: group_scale description: Normalizes the values in a group to be between 0 and 1. (x - groupmin) / (groupmax - groupmin) category:Group definition:group_scale(x, group) name: group_zscore description: Calculates group Z-score - numerical measurement that describes a value's relationship to the mean of a group of values. Z-score is measured in terms of standard deviations from the mean. zscore = (data - mean) / stddev of x for each instrument within its group.Input: Value of 5 instruments of Group A: (100, 0, 50, 60, 25)Output: (1.57, -1.39, 0.09, 0.39, -0.65) category:Group definition:group_zscore(x, group)