Skip to content
ChartDeck ChartScript docs Account Open the terminal

Script screens

Rank the markets of a watchlist by what one of your scripts computes - how a script screen runs, which outputs become columns, and its limits.

A script screen runs one of your scripts on every market of one of your watchlists and shows the result as a table: one row per market, one column per output of the script. Click a column to rank the markets by it. Click a row to open that market on your chart.

It is different from the Market Screener, which shows a fixed set of columns for every market. A script screen shows what your script computes, on your list.

#Running a screen

  1. Open Script screen from the widget bar on the right (on a phone: the Panels menu, under Views).
  2. Pick a Script, a Watchlist and a Timeframe.
  3. Press Run.

Nothing runs until you press Run. While the screen runs, the head of the view counts the markets done, and each row fills in as its market finishes.

The screen runs in your browser. ChartDeck's servers send the bars; your script runs on your own device, the same way it runs on a chart. Leaving the view stops the screen.

#Which outputs become columns

In the scriptIn the screen
plot(...)A value column: the plot's value on the bar the screen reads.
alert.on(condition, ...)A true / false column: Yes when the condition is true on that bar, otherwise how many bars ago it was last true.
plotshape(...), plotchar(...)A true / false column, the same way.
hline, fills, background colors, drawings, tablesNot shown. They are still computed.

A screen shows up to 8 columns. Choose them under Columns; all of them are computed on every run, so showing another column does not need a new run.

A plot that you want in screens but not on the chart can be hidden from the chart:

ChartScriptFragmentOpen in editor
const strength = ta.rsi(close, 14) - 50
plot(strength, "Strength", { display: display.none })
alert.on(ta.crossover(strength, 0), "Strength turned positive", "{{ticker}} strength turned positive")

Ranking by a true / false column puts the markets where it is true now first, then the ones where it was true most recently.

#Which bar a screen reads

Every market is read on its last closed bar. The bar that is still forming is not given to the script, so every market is compared at the same finished moment and a value does not change after you have seen it.

Turn on Forming bar to include the bar that is still open. Values then move until that bar closes.

The screen loads a fixed number of bars per market (500 or 1,000, by plan; the head of the view says which). A script that needs a longer history than that to warm up shows – for the value. A chart, which loads more bars, can show a value where a screen does not.

#Other timeframes and markets

A script that reads other timeframes or markets with request.* works in a screen. For each market the screen loads what the script asks for, then runs it again with that data. Such a screen is slower, because every market needs its own extra loads: allow about a second per market, and longer on a long watchlist.

The extra loads count toward the same data allowance as the bars. If a row says Data allowance used up, wait a minute and refresh.

#Inputs

Under Inputs you set the script's inputs once for the whole screen: numbers, switches and choices. Other kinds of input use the script's default. Back to the script's defaults clears what you set.

#Refreshing

Refresh runs the screen again. With Refresh on bar close on, the screen runs again by itself when a bar of its timeframe closes, while the view is open and the tab is visible. How often it may do that depends on your plan (below). Values do not tick live: a screen is a ranking of closed bars, and the chart is the place for live values.

#Saving a screen

Saved screens keeps a screen in your account: the script, its inputs, the watchlist, the timeframe, the columns and the ranking. Opening a saved screen runs it.

#Limits

BeginnerPlusProElite
Markets per screen1050200500
Bars per market5005001,0001,000
Saved screens131025
Refresh on bar closeNo (Run only)At most every 5 minutesAt most every 2 minutesAt most every minute (every 5 minutes above 200 markets)

A watchlist longer than your plan's number of markets is cut to its first markets, and the view says so.

What a script screen cannot run yet:

  • ChartDeck data series such as oi.* or funding.*, and record data such as flow.prints. The script runs, and those values are empty. flow.buy_vol, flow.sell_vol, flow.delta and flow.buy_share come from the bars and work.
  • Protected Community scripts and scripts you have not saved. A screen runs your own saved scripts. To screen an open-source Community script or an official script, make a copy of it first.
  • Seconds, tick and range timeframes.

#When a row has no values

The row saysWhy
No bars on this timeframeThe market has no history on that timeframe.
Bars could not be loadedThe venue did not answer. Refresh to try again.
Data allowance used upYou asked for more bars in a minute than your plan allows. A screen uses at most half of that allowance so your charts keep theirs; wait a minute.
A code such as CS5101 and a messageThe script stopped with a runtime error on that market. The other markets still run.

A market gets a quarter of a second to run. If the script takes longer than that on five markets, the screen stops and says so: see Profiling to find the slow part.

The ChartScript documentation is in English for now; translations will follow.