Code Completion

Icon Name Units Code Top List Format Graphics
Click an icon for more details.
Suggestions will appear here as you type.

Filters in Use

All Filters

Icon Name Units Code Top List Format Graphics

Other Symbols in Use

All Symbols

unknown / error
price, last price is the exact price of the most recent print. This is the price that set off the alert. last only updates with “official” prints. For example, it does not count pre and post market trades. [Price] and other predefined formulas automatically choose between these.
most_recent_close Yesterday’s close or today’s close.
expected_open Today’s open, or the most recent print if the stock has not opened yet.
seconds_after_open The time of day, in seconds. This will be negative in the premarket. This only looks at the clock. It does not know about half days, holidays, or special instruments which do not trade on the normal schedule.
day_of_week 1 = Monday, 2 = Tuesday, …, 5 = Friday.
t_high, t_low Today’s high and low.
high_pre, low_pre Today’s premarket high and premarket low
v_up_1, v_up_2, v_up_5, v_up_10, v_up_15, v_up_30 The volume for the last 1, 2, 5, 10, 15 or 30 minutes. This is expressed in shares. The predefined filters show the same data in percent.
sma_2_5, sma_5_5, sma_15_5, sma_2_8, sma_2_20, sma_2_200, sma_5_8, sma_5_20, sma_5_200, sma_15_8, sma_15_20, sma_15_200, sma_60_8, sma_60_20, sma_60_200 The 5, 8, 20, or 200 period SMA for 2, 5, 15, and 60 minute periods. The first number is the number of minutes per candle. The second number is the number of candles.
std_5_20, std_15_20, std_60_20 The 20 period standard deviation for 5, 15 and 60 minute periods.
vwap The VWAP for the day.
sma_200, sma_50, sma_20 The SMA for the last 200, 50, or 20 days.
high_p, low_p, open_p, volume_p The previous day’s high, low, open, and volume.
close_p The close from the day before yesterday. What we called “previous close” yesterday.
high_52w, low_52w The 52 week high and low.
std_20 The 20 day standard deviation.
standard_deviation Yearly (weighted) standard deviation.
consolidation_high, consolidation_low The highest value and the lowest value in the recent daily consolidation pattern.
last_price The official closing price for the previous day.
high_life, low_life Lifetime highs and lows.
high_5d, low_5d, high_10d, low_10d, high_20d, low_20d The high and low for the last 5, 10, and 20 days.
close_5d, close_10d, close_20d The closing price 5, 10, and 20 days ago.
adx_14d, pdi_14d, mdi_14d The ADX, DI+, and DI- measured over the last 14 days.
short_interest Short interest, in shares. The preexisting formula Days to Cover is similar, but that’s a %.
p_up_1 The price change for the last minute. The current price - the price one minute ago, in dollars.
bid, ask The bid and ask price of the stock, in $.
min(a, b [, …]) This returns the smallest of 2 or more values.
max(a, b [, …]) This returns the largest of 2 or more values.
if(predicate, true_value [, false_value]) If the first value is true, this returns the second value. Otherwise it returns the third value.

This function will treat null as false. This and ?? are the two ways to get rid of a null.

The third parameter is optional. It defaults to null.
abs(x) Absolute value of x.
ceil(x) Ceiling of x.
⌈x⌉
floor(x) Floor of x.
⌊x⌋
exp(x) ex
ln(x) Natural log of x.
loge(x)
log(base, x) Log of the given base of x.
sqrt(x) The square root of x.
√x
sin(x), cos(x), tan(x) The standard sine, cosine, and tangent functions. x is measured in radians.
asin(x), acos(x), atan(x) The inverse of the sine, cosine, and tangent functions. The result is in radians.
null
null represents any number of errors. This includes 0/0, not enough data, and a lot more. Most preexisting formulas can be null sometimes. If you use null in a formula, typically the result will be null. For example, 5+null is null.

You can insert “null” directly in your formulas if you wish to report an error. Use the ?? operator for the opposite effect. That allows you to add a value to a formula which otherwise would have been null.

Most comparisons involving a null will fail. For example, if a stock’s current price is $10, but the stock has been trading for less than 50 days, the stock’s 50 day moving average will be null. So if you ask how far this stock is above it’s moving average (50 - null) you will get null. If you ask for all stocks which are above their moving average in one window, and all stocks below their moving average in other window, you will not see this stock in either window. That is to say “null < 0”, “null > 0” and “null = 0” all return false.

null will typically be displayed on the screen as a blank cell.

Alert Data in Use

All Alert Data

Code Alert Types Description
unknown / error
none
[=a] The amount the stock has moved in dollars. Positive numbers mean the stock is going up, negative numbers mean the stock is going down.
[=c] The size of the gap continuation. Null if there was no gap continuation.
[=c] Trade count. If a stock is trading above or below many times quickly, the server will group multiple trades into one alert. Null if this was based on a single trade.
[=count] Touch count. 2 for a double top or double bottom. 3 for a triple top or triple bottom. Etc.
[=d] Duration in seconds.
[=d] Duration in seconds. Null if this was an "instantaneous" alert, i.e. a single print caused the alert.
[=d] Time in seconds since the previous alert. Null if there is no previous alert to report.
[=d] Time in seconds since the previous alert. This will be a negative number.
[=d1] Time in seconds since the pattern started.
[=d2] Time in seconds since the pattern ended.
[=fp] First price. The pattern started when the price when down to this support level and started moving up again. The alert fires when the price gets close enough to this support level again.
[=fp] First price. The pattern started when the price when up to this resistance level and started moving down again. The alert fires when the price gets close enough to this resistance level again.
[=g] The size of the gap in dollars. Today's open - the previous day's close. Positive when the stock gaps up, negative when the stock gaps down.
[=hp] The highest price in the consolidation pattern or channel.
[=lp] The lowest price in the consolidation pattern or channel.
[=lp] Level price. What price did we cross to generate this alert? Depending on the alert this might be today's open, the previous day's close, a VWAP or an SMA.
[=m] The strength of the alert:
  • 1 = "instantaneous", i.e. the strongest.
  • 2 = "very high"
  • 3 = "high", i.e. the weakest.
[=op] Other price. What price did we cross to generate this alert? Depending on the alert this might be today's open, or the previous day's close.
[=p] Price. What price did we cross to generate this alert? Depending on the alert this might be support or resistance.
[=p] Price of the next support or resistance line. Null if there is are no more support or resistance lines.
[=p] Price change in dollars. How much has the stock price changed since the previous alert. Positive if the price went up, negative if the price went down.
[=p] Number of periods that both SMAs were going the same direction.
[=p] How much has the stock price changed in the last [=d] seconds. Positive if the price went up, negative if the price went down.
[=pi] The recent price increase in dollars. Positive if the price went up, negative if the price went down.
[=s] The number of shares.
[=sh] The number of shares.
[=sl] Stop loss.
[=sp] Second price. The stock recently bounced off this resistance level and started moving down again.
[=sp] Second price. The stock recently bounced off this support level and started moving up again.
[=tt] Enter after crossing this price.
[=u] Price change in dollars. How much has the stock price changed since the previous alert. Positive if the price went up, negative if the price went down.
[=v] Volume.