Equities Lab Operators
Below, you will find a list of all of our operators. To find out how operators work read our Operators Overview*
x * y The multiply operator enables you multiply any number of values.
Net Income 1Q * 4 
returns a number
**
x ** y The power operator allows you to take x to the power of y. For example 2 ** 3 equals 8.
returns a number
+
x + y The Plus operator adds together multiple properties or terms together.
Net_Inc_1Q + Net_Inc_2Q > 0.0 returns a number 
–
x – y The Subtract operator subtracts a term or field from another.
Close – (Close as of 3.0 days ago) > 0.0 returns a number 
/
x / y The divide operator enables you to divide one term by another.
Net Income 1Y / Total Employee Number> 1.02 
returns a number
<
x < y The less than operator allows you to test whether one term is less than another term.
Close < (Close as of 3.0 days ago) 
returns a true/false
<=
x ≤ y The less than or equal to operator allows you to test whether one term is less than or equal to another term.
Close <= (Close as of 3.0 days ago) 
returns a true/false
>>
x > y The greater than operator allows you to test whether one term is greater than another term.
Close > (Close as of 3.0 days ago) 
returns a true/false
=>>=
x ≥ y The greater than or equal to operator allows you to test whether one term is greater than or equal to another term.
Close >= (Close as of 3.0 days ago) 
returns a true/false
abs
abs x The absolute value operator returns the absolute value of its argument.
abs (change of Open over 1.0 days) 
returns a number
absratio
absrat x The Absolute Ratio Operator returns the absolute ratio of the term you enter into it. Since it is giving a ratio the value will always be over 1. For instance, if a stock lost 5% in a day than the Absolute Ratio of the Close/(Close as of 1 day ago) would be 1.05.
abs ratio (Close ÷ Open) > 1.02 
returns a number
alwayssince
always X since mm/dd/yyyy The always since operator tests if a condition is always true since a date in the past. For instance one could check if a company’s sales growth was always positive since 2004.
always (EPS_1Q > 0.0) since Thu Jan 01 2004 
returns a true/false
alwayswithin
always X within last n days The always within operator tests if a condition is always true within X trading days. For instance, one could check if a company’s sales growth was always positive within 251 trading days.
always (Close > Open) within 3.0 days 
returns a true/false
and
a and b The and operator requires all conditions to be true. You can also click the green + symbol to add another clause.
Net_Inc_T12M > Net_Inc_1Y and Close > (Close as of 5.0 days ago) 
returns a true/false
as_of
X as_of n days ago The as of operator allows you retrieve a value as of X trading days ago. So Net Income as of 251 trading days ago(1 year) would give you the previous year’s net income.
Close as of 8.0 days ago < Close 
at
X at mm/dd/yyyy The at Operator returns the term’s value on a desired date in the past.

average
average x, y, … The average operator returns the average of its arguments.
To add another value simply press Control + Shift + A.
average of Sales_Gwth_5Q_to_1Q, Sales_Gwth_6Q_to_2Q, Sales_Gwth_7Q_to_3Q, Sales_Gwth_8Q_to_4Q 
returns a number
averageacross
average X across The average across operator returns the average of a value across any set of stocks such as industry, sector, or the entire market.
After across specify which set of stocks to have the average calculated on.
After where define constraints that a stock must pass in order to be included in the average.
(average of Market Cap across Industry where (Market_Cap > 10b)) 
returns a number
averagesince
average X since mm/dd/yyyy The average since operator takes the average of a value pertaining to a stock since a date in the past such as yield. (Average yield since 01/01/2010)
Close > (average Close since Tue Jan 01 2008) 
returns a number
averagewithin
average X within n days The average within operator returns the average of a value within X number of trading days such as the average closing price within 10 trading days.
average Close within 4.0 days > (average Close within 9.0 days) 
returns a number
averageyearly
average X yearly The average yearly operator takes the average of a given property over the past X number of years. For instance, averageyearly of market cap over 2 years will net the average value for market cap over the past 2 years.
returns a number
backtest
backtest The Backtest Operator will return a multiple that represents the backtest return since 2003 of whatever term you put in the operator. So Backtest of (Market Cap > 100,000) = 2 means that since 2003, the starting backtest value had doubled which represents a 100% back test return.
backtest of classify as Technology > (backtest of classify as Technology as of 5.0 days ago) returns a number 
changeover
change The change over operator returns the % change of a value within X trading days
change of Close over 10.0 days > (change of SPY:Close over 10.0 days) 
returns a number
chooserange
choose from x to y step z The Choose Range operator enables you test a range of values in a trading model and use the value that gives the best return. For instance you could test what the best month of the year is to hold the S&P 500.
Buy When Month_of_Year = choose from 1.0 to 12.0 returns a number 
chooseset
choose one of x,y,z The Choose Set operator enables you test a set of values in a trading model and use the value that gives the best return.
Close > (Close as of chooseSet days ago) chooseset of 10.0 20.0 28.0 
classifyas
classify as The classify as operator allows you to indicate the industry, sector, exchange, etc. of the stock.
To add another field within the operator press control + Shift + A. Multiple fields act as or terms. In the example below classify as would return true if the stock was either classified as Technology or Airlines.
classify as Technology, Airlines 
returns a true/false
correlationsince
correlation of X with Y since mm/dd/yyyy The correlationsince operator gives the correlation of two properties since a given date.
Correlation is a dimensionless value that ranges between 1 and 1, which indicates how closely a change of one property is related to a change in another. 1 is the strongest possible positive correlation, 1 is the strongest possible negative correlation. 0 implies no relationship at all.
Because correlation is dimensionless, different correlation values derived from different variables may be compared to one another. For the same reason, one can use different values of correlation to gauge relative strength of correlation.
returns a number
correlationwithin
correlation of x with Y within last n days The correlationwithin operator gives the correlation of two properties within X trading days.
Correlation is a dimensionless value that ranges between 1 and 1, which indicates how closely a change of one property is related to a change in another. 1 is the strongest possible positive correlation, 1 is the strongest possible negative correlation. 0 implies no relationship at all. Because correlation is dimensionless, different correlation values derived from different variables may be compared to one another. For the same reason, one can use different values of correlation to gauge relative strength of correlation.
returns a number
count
count of x,y,z… The count operator counts the number of conditions that are true.
For example, if we had count A,B,C:
If B and C are true, count would return 2.
If only B was true, count would return 1.
count of (Close > average Close within 20.0 days ) (Net_Inc_1Q > Net_Inc_2Q) (Sales_1Q > Sales_5Q) 
returns a number
countacross
countacross The count across operator returns the number of times the condition was true across any set of stocks, such as industry, sector, or the entire market.
After across in the operator you will specify which set of stocks are included.
After where in the operator you will define constraints that a stock must pass in order to be included.
count of (Close > (Close as of 1.0 days ago)) across (Market_Cap > 500m) where (Market_Cap > 500m) 
returns a number
countsince
count of X since mm/dd/yyyy The count since operator returns the number of times the condition has been true since a date in the past.
For instance, the operator could tell you how many times a stock has increased over 4% in a day since the start of 2014.
count ( RawClose > RawClose as of 1.0 days ago) since Jan 01 2014 
returns a number
countwithin
count of X within last n days The Count Within operator returns the number of terms that pass the conditions you entered into the operator within X number of days. For instance, the operator could tell you how many times a stock has increased over 4% in a day within 50 trading days.
count (Close > (Close as of 2.0 days ago)) within 10.0 days 
returns a number
covariancesince
covariance of X with Y since mm/dd/yyyy The covariance since operator takes the covariance of two properties since a given date. Covariance of x and y is a value with units of x*y, which measures the degree to which y changes when x changes.
A positive covariance indicates positive change of x with a positive change of y, and a negative covariance indicates a negative change of x with a positive change of y. Unlike correlation, one covariance value cannot be compared to another due to the different units of each covariance value. As a result, covariance values cannot be used to show relative strength of covariance.
returns a number
covariancewithin
covariance of x with Y within last n days The covariancewith operator takes the covariance of 2 variables within X number of days.
Covariance of x and y is a value with units of x*y, which measures the degree to which y changes when x changes. A positive covariance indicates positive change of x with a positive change of y, and a negative covariance indicates a negative change of x with a positive change of y. Unlike correlation, one covariance value cannot be compared to another due to the different units of each covariance value. As a result, covariance values cannot be used to show relative strength of covariance.
returns a number
decreasingover
decreasing x over n days The decreasing over operator looks for companies where the given term is decreasing over the specified time period..
decreasing Market Cap over 252 days 
returns a true/false
ema
ema of X over n days The Exponential Moving Averages operator reduces the lag of a simple Moving Average by applying more weight to recent prices. The weighting applied to the most recent price depends on the number of periods in the moving average.
ema of Close over 4.0 days 
returns a number
equals
x equals y The equals operator determines whether two conditions are equal to one another.
PE = (PE as of 5.0 days ago) 
returns a true/false
eversince
ever X since mm/dd/yyyy The ever since operator tests if the condition you enter has ever been true since a date in the past.
For instance, has a stock ever had a day with 3 times its normal volume since 2010.
ever ^{1} > 3.0) since Fri Jan 01 2010 
returns a true/false
everwithin
ever X within last n days The Ever Within operator tests if the condition you enter into the operator has ever been true within X number of trading days. For instance, has a stock ever had a quarterly surprise greater than 20% within 251 trading days.
ever ^{2} > 1.15) within 10.0 days 
returns a true/false
future
X in the future n days The future operator allows you retrieve a value that is X trading days in the future. THIS ONLY WORKS IN THE PAST! Equities Lab CANNOT predict the future! Net Income future 251 trading days(1 year) would give you the next year’s net income. If this were asked in 2010, it would give you 2011’s income. Asked 6 months ago, it gives you Undefined.
growthyearly
growth of X yearly The growthyearly operator measures how much a property has increased from one year to the next, over X number of years.
growth of Market Cap over 2 years > 0 
returns a number
hasvalue
has x, y, …if
if cond then A else B The if operator returns one of two values depending on if it’s condition evaluates to true or false.
 if true then Close else Open > Close
 if false then Close else Open > Open
if (EPS_1Q > 0.0) then (average Close within 25.0 days) else (average Close within 80.0 days) > (average Close within 100.0 days) 
returns a number
increasingover
increasing x over n days The increasing over operator when applied to X returns those companies whose X has been increasing over so many days.
increasing Market Cap over 252 days 
returns a true/false
logarithm
logarithm of x The logarithm operator takes the natural logarithm of a number. Like all logarithms, it will return an undefined value if the input is less than or equal to zero.
returns a number
marketrank
marketrank The market rank operator ranks stocks according to the percentile value of the given property. For instance, the example below shows all stocks in the 90th percentile of market cap.
market rank of Market Cap > 90 returns a number
max
max x, y, … The max operator returns the maximum of a set of terms you enter into it. To add another box you simply press control + Shift + A, or input a comma into the previous box.
returns a number
maxacross
maxacross The max across Operator returns the maximum of X across a set of stocks such as the entire market or an industry.
 After across in the operator you will specify which set of stocks are include
 After where in the operator you will define constraints that a stock must pass in order to be included.
max of Rel_Strength_MR_T1M across Industry where (Market_Cap > 1000.0) 
returns a number
maxsince
max X since mm/dd/yyyy The max since operator takes the maximum of the value since a date in the past, such as the maximum closing price since 01/01/2014
Close ÷ (max Close since Tue Jan 01 EST 2008) 
returns a number
maxwithin
max X within n days The max within operator takes the maximum of the value within X trading days such as the maximum closing price within 180 trading days.
max Close within 180.0 days 
returns a number
medianacross
median x across The median across operator returns the median value across a range of stocks.
 After across in the operator you will specify which set of stocks are included in the calculation
 After where in the operator you will define constraints that a stock must pass in order to be included.
median of Market Cap across Industry where (Market Cap > 1m) 
returns a number
min
min x, y, … The min operator returns the minimum of a set of terms you enter into it.
To add another box you simply press control + Shift + A, or input a comma into the previous box.
returns a number
minacross
minacross The min across operator takes the minimum value across any set of stocks including industry or sector.
 After across in the operator you will specify which set of stocks are included
 After where in the operator you will define constraints that a stock must pass in order to be included.
min of Market Cap across Industry where (Market Cap > 1m) 
returns a number
minsince
min X since mm/dd/yyyy The min since operator takes the minimum of value since a date in the past such as the minimum closing price since 01/01/2014
min Close since Tue Jan 01 EST 2014 
returns a number
minwithin
min X within n days The min within operator takes the minimum of the value within X trading days. For example, the minimum closing price within 30 days.
min Close within 30 days 
returns a number
montecarlorange
monte carlo x to yThe Monte Carlo Range operator enables you enter a range of inputs for a Monte Carlo Simulation.
For Stock Screeners, a random Monte Carlo run will be returned.
For Backtests:
 the backtest will be run up to 50 times
monte_carlo_runs=number of run to override the default.
 the 10%, 50%, and 90% percentiles will be returned.
monte_carlo_percentiles = x + y + z overrides the default.
example: monte_carlo_percentiles = 30 + 40 + 70 return the 30th,40th, and 70th percentile returns.
 Backtests of Monte Carlo simulations can consume a tremendious number of resources, so it can be 30+ minutes to compute your results. Each subsiquent call to the backtest will return the cached result, so change the number of runs if you actually want to rerun the entire simulation
returns a number
montecarloset
monte carlo {x,y,z} The Monte Carlo Range operator enables you enter a range of inputs for a Monte Carlo Simulation. For Stock Screeners, a random Monte Carlo run will be returned. For Backtests:
 the backtest will be run up to 50 times.
 the 10%, 50%, and 90% percentiles will be returned.
example: monte_carlo_percentiles = 30 + 40 + 70 return the 30th,40th, and 70th percentile returns.
 Backtests of Monte Carlo simulations can consume a tremendious number of resources, so it can be 30+ minutes to compute your results. Each subsiquent call to the backtest will return the cached result, so change the number of runs if you actually want to rerun the entire simulation
not
not x The n ot operator enables you to require that a condition is not true.
not classify Transportation 
returns a true/false
not_equals
x not equal to y The not equals operator is used to determine whether two conditions equal or not equal each other.
PE != PE as of 5.0 days ago 
returns a true/false
odds
odds of x,y,z… The odds operator returns the percentage odds between 0% and 100% to which the values that you enter into the operator are true. If 2 out of the 5 values are true then the odds operator would return 40%.
odds of (Piotroski F Score T12M > 6) ^{3} across ^{4} within 28.0 days 
returns a number
or
a or b The or operator enables you to require that a stock passes at least one of X conditions you specify.
match any of the following Close > (Close as of 5.0 days ago) or PE > (PE as of 5.0 days ago) 
returns a true/false
percentileacross
percentile across The percentile across operator gives the value at the Nth percentile across any set of stocks including industry or the entire market.
 After across you will specify which set of stocks are compared against to get the percentile
 After where you will define constraints that a stock must pass in order to be included.
Net Income at 50.0 percentile across Industry where ^{5} < 10 
returns a number
predict
predict x, y, … The predict operator predicts the field named goal_something using the attributes specified. It filters the input set based on the galaxy_something variable, and uses the variable train_something to determine the training set.
returns a number
rank
rank of w in (x,y,z…) The rank operator returns the rank (0100) of the property or term pertaining to a stock compared to other property or term pertaining to a stock. For instance, you could find stocks whose current closing price ranks the highest out of its 12, 24, and 50 day moving average.
rank of Close in (average Close within 5.0 days) (average Close within 12.0 days) =100.0 
returns a number
rankacross
rankacross The rank across operator returns the rank (0100%) of the property or term across any set of stocks such as its industry or sector or mid caps. Take the following example:
rank of PE across Industry where ^{6} 
This will give you the stock’s rank within its own industry, including only stocks with a Market Cap greater than 500m. So if a stock has a P/E in the 33rd percentile it would have a rank of 33.
Try modifying this Stock Screener to give you the top 25% rather than the bottom 25%
returns a number
rankbottom
rank X is in the bottom y% Is the rank of a term in the bottom n%?
For example, the following example would be false for a stock with a P/E of 100 and true for stock with P/E of 1.
rank P/E is in bottom 1%
Keywords: rankbottom quartile
returns a true/false
ranksince
rank of X since mm/dd/yyyy The rank since operator sorts out all values since XX/YY/ZZZZ from least to greatest and puts them in a ranking from 0 to 100. It then allows you to specify where the current value ranks in that order. For instance, you could specify that the stock’s closing price currently ranks in the highest decile since 01/01/2014.
rank Close since Fri Jan 01 2010 > 85.0 
returns a number
ranktop
rank X is in the top y% Ranks stocks from least to greatest according to a given property, then returns all stocks that score in the top X% of that property.
returns a true/false
rankwithin
rank of X within last n days The Rank Within operator sorts out all values within N days from least to greatest and puts them in a ranking from 0 to 100. It then allows you to specify where the current value ranks in that order. For instance, you could specify that the stock’s closing price currently ranks in the highest decile compared to its closing prices within 251 trading days.
returns a number
round
x round to nearest multiple of y The round operator enables you to round terms.
(Market_Cap round to nearest multiple of 100000.0) 
returns a number
roundpower
x round to nearest power of y The round power operator will round any property or term you desire to the nearest power of X. So if you say round Market Cap to the nearest power of 5 it will round the market cap to the value nearest a power of five, such as 5, 25, 125, 625, 3125, 15,625, 78,125, Etc..
(Market_Cap round to nearest power of 2.0) 
returns a number
skewnessacross
skewness X across The skewness across operator returns the skewness of a value across any set of stocks such as industry, sector, or the entire market.
Skewness can be defined as a measure of how positively or negativelybiased a given dataset is from a normal distribution.
 A skewness of >0 implies a median value greater than the mean (positive bias)
 A skewness of 0 implies a median value less than the mean (negative bias).
skewness of Relative Strength across Industry where ( Market Cap > 100m) > 0.5 
 After across you will specify which set of stocks to have the skewness calculated on.
 After where you will define constraints that a stock must pass in order to be included in the skewness.
returns a number
stddev
stddev x, y, … The standard deviation operator returns the standard deviation its terms.
Press Control + Shift + A to add another box to add another property or value.
standard deviation of Close, Open, High, & Low > 0.1 
returns a number
stddevacross
stddev X across The standard deviation across operator returns the standard deviation of a value across any set of stocks such as industry, sector, or the entire market.
 After across in the operator you will specify which set of stocks to have the standard deviation calculated on
 After where in the operator you will define constraints that a stock must pass in order to be included in the standard deviation.
returns a number
stddevsince
stddev X since mm/dd/yyyy The standard deviation since operator takes the standard deviation of a value pertaining to a stock since a date in the past, such as yield.
stddev Relative Strength since Jan 1, 2018
returns a number
stddevwithin
stddev X within n days The standard deviation within operator takes the standard deviation of a value pertaining to a stock within a certain number of trading days, such as yield.
stddev Relative Strength within 30 days
returns a number
sumsince
sum of X since mm/dd/yyyy The sum since operator takes the sum of its term since a specified date, meaning it adds the property for each day from the specified date up until the current date.
sum of Net Income since Sun Jan 01 2012 
returns a number
sumwithin
sum of X within last n days The sum within operator takes the sum of a property or term pertaining to a stock within X trading days, meaning it adds its term for each day within X trading days up until today. If the stock’s closing price the past 3 days were 5, 6, and 7 then the sum of the closing price within 3 days = 18.
sum of (Close – Open) within 5.0 days > 0.0 
returns a number
thensince
X then Y until Z since mm/dd/yyyy The Then Since operator enables you to test whether a condition was true after another condition was true until another condition is true since a date in the past.
Close > (Close as of 2.0 days ago) then (Close > (Close as of 2.0 days ago)) until (Close < (Close as of 2.0 days ago)) since Jan 01 2008 returns a true/false 
thenwithin
X then Y until Z within last n days The Then Within operator enables you to test whether a condition was true after another condition was true until another condition is true within X Trading Days.
Close ÷ (Close as of 3.0 days ago) 0.99 then ^{7} > 1.02) until ^{7} < 1.0) within 10.0 days returns a true/false 
tickeris
ticker is The ticker is operator allows you to specify a ticker for use in a stock screener or trading model. For instance, in a stock screener you could create a condition that says ” Ticker Is AAPL”
ticker GE 
returns a true/false
totalacross
totalacross The total across operator calculates and returns the sum a property or term across an entire set of stocks such as industry or market or etc.
total of ( change of Close over 1.0 days ) across Sector where (Market_Cap > 1m) 
 After across in the operator you will specify which set of stocks are include.
 After where in the operator you will define constraints that a stock must pass in order to be included.
returns a number
valueelse
value x, y, …variance
variance x, y, … The variance operator returns the population variance values you enter into it. Variance measures the spread of values in the dataset; a high variance indicates a great distance between values.
Press Control + Shift + A to add an additional term, or input a comma into the entry box.
returns a number
varianceacross
variance X across The variance across operator returns the variance of a value across any set of stocks such as industry, sector, or the entire market. Variance measures the spread of values in the dataset; a high variance indicates a great distance between values.
 After across you will specify which set of stocks to have the variance calculated on
 After where in the operator you will define constraints that a stock must pass in order to be included in the variance.
returns a number
variancesince
variance X since mm/dd/yyyy Returns the population variance for a given property since a given date. Variance measures the spread of values in the dataset; a high variance indicates a great distance between values.
returns a number
variancewithin
variance X within n days Returns the population variance of the given property within n trading days. Variance measures the spread of values in the dataset; a high variance indicates a great distance between values.
returns a number
weightedaverageacross
weighted average of PROPERTY The weighted average across operator returns an average of a specified value across any set of stocks stock as industry, largecaps, etc. weighted by a specified value.
weighted average of Relative Strength across Industry weighted by Market Cap where ( P/E > 5) 
 After across, specify which set of stocks are included in the average.
 After weighted by, specify what value defies the weight.
 After where, specify the constraints that a stock must pass in order to be included.
returns a number
whensince
X when Y since mm/dd/yyyy The When Since Operator returns the value of a property or formula while another condition is true, since a certain date.
change of Close over 10.0 days when (Net_Income_1Q > 0.0) since Tue Jan 01 2013 
returns a number
whenwithin
X when Y within last n days The When Within Operator returns the value of a property or formula while another condition is true, within X number of days.
returns a number
zscoreacross
zscore X across zscore across returns the zscore of a value across any set of stocks such as industry, sector, or the entire market. The zscore is the number of standard deviations above or below the mean the given value is. After across in the operator you will specify which set of stocks to have the zscore calculated on, and after where in the operator you will define constraints that a stock must pass in order to be included in the zscore.
returns a number
zscoresince
zscore of X since mm/dd/yyyy zscore since returns the zscore of a value since a specific date. The zscore is the number of standard deviations above or below the mean the given value is. After since in the operator you will specify the date.
returns a number
zscorewithin
zscore of X within last n days The zscore within the last n days. The zscore is the number of standard deviations above or below the mean the given value is, using the values within the given span.
returns a number
returns a number
oddsacross
oddsacross The odds across operator returns the percentage odds that a stock passes a condition that you enter into the operator. For example, odds that a stock in the technology sector has greater sales than it did 1Q ago.
 After across in the operator you will specify which set of stocks are included
 After where in the operator you will define constraints that a stock must pass in order to be included.
odds of ((average Close within 10.0 days) > (average Close within 21.0 days[↩] 
returns a number
oddssince
odds of X since mm/dd/yyyy The odds since operator returns the odds (from 0 to 100) that the stock passes the condition that you enter into the operator since a date in the past.
odds (Open > Close) since Fri Jan 01 2010 
returns a number
oddswithin
odds of X within last n days The odds within operator returns the odds (from 0 to 100) that the stock passes the condition that you enter into the operator within X days.
odds (Close > (Close as of 4.0 days ago[↩] 
returns a number
percentilesince
percentile X since mm/dd/yyyy The percentile since operator gives you the median of the percentile values of a property since a date in the past.
If you put 0, it would give you the minimum, and it would give you the maximum if you put 100. It is useful to measure how values are changing over time or to measure where a property value stands in comparison to other property values in the past.
Trading Model Example
Close at the 90 percentile since 01/01/2010 < CloseStock Screener Example
Close at the 50 percentile Since 01/01/2010 > Close at the 50 Percentile Since 01/01/2008 returns a number
percentilewithin
percentile X within n days The percentile within operator gives the value of Xth percentile of whichever property you desire within X number of trading days.
Example
High at the 50 percentile within 100 days
returns a number
positionacross
positionacross The position across operator returns an integer from 1 to infinity that represents what position the stock is in based on your value across a set of stocks such as industry or sector or mid caps.
For instance, If you want the top 10 market cap companies in each Industry: