Concepts
Bars and time, other timeframes and markets, plots, drawings, inputs and the settings dialog, alerts and ChartDeck's own data.
- Bars and timeHow a script walks the chart's bars, what bar_index, time and the OHLCV values mean, how barstate works, and why every time is UTC.
- SessionsSession strings, time() with a session, the session.* values, and what a trading session means on 24/7 crypto markets.
- TimeframesChartDeck's resolutions from seconds to months, tick and range bars, how bars line up in UTC, and the timeframe.* values a script reads.
- Other timeframes and marketsrequest.tf, request.market, request.lower_tf and request.market_lower_tf in detail - the at modes, repainting, data contexts, plan caps and market ids.
- RepaintingWhat repainting is, which ChartScript features can repaint (the live bar, developing requests, live state, timenow, drawings), and how to avoid it.
- InputsEvery input.* function, how inputs appear in the script settings dialog, and how to organize them with sections, rows, conditions, checks and presets.
- The settings dialogEvery tab of an indicator's settings dialog - Inputs, Colors, Style, Labels & text, Visibility - with color presets, label sizes and search.
- AlertsAlert conditions with alert.on, messages with alert.send, script alerts checked on ChartDeck's servers, triggers, placeholders and limits.
- StrategiesStrategies (simulated orders and backtests) are not available in ChartScript yet. Here is what you can build today instead.
- Non-standard chartsWhat OHLC a script sees on Heikin Ashi, line, area and other chart types, on tick, range and seconds bars, and how to get Heikin Ashi values yourself.
- ChartDeck dataOpen interest, funding, basis, long/short ratios, liquidations, CVD, all-exchange flow and ETF flows as series in a script: units, markets and plans.
- Trade printsThe large trades (prints) of each bar from the trade tape with flow.prints, their price, size, side and time, the Auto threshold and history.
- Order-book dataThe order book ChartDeck records, the biggest size per price bucket in each bar, as heatmap columns (book.heat) or levels (book.depth).
- Liquidation dataThe liquidation model in a script, with the levels now (liq.levels, observed positions included), the hourly heat field and the legend facts.
- Volume at priceThe recorded volume traded at each price of a day, a week or a month in a script, with the point of control, the value area and the profile itself.
- Economic calendarEconomic events in a script with cal.*: the next and previous release, minutes to it, event windows, FOMC weeks and released figures.
- FootprintsThe buy and sell volume at each price row inside a bar, the data the Footprint chart draws, with its busiest rows, delta extremes and Extremes readings.
- PlotsDraw values on the chart with plot(): styles, line widths and dashes, per-bar colors, offsets, where values show, named styles and the 128-plot cap.
- FillsShade the space between two plots or two levels with fill(), with one color, a color per bar, or a vertical gradient.
- LevelsDraw fixed horizontal levels with hline(), style them solid, dashed or dotted, let users move them, and shade the band between two levels.
- ColorsTheme colors that follow the chart's look, named colors, hex literals, color.new and transparency, rgb, gradients, palettes and per-theme colors.
- Text and shapesMark signal bars with plotshape and plotchar: shapes, characters, locations, sizes, text under or over the mark, and arrows sized by value.
- DrawingsLabels, lines, boxes, polylines and line fills drawn from code: creating, updating with setters, deleting, coordinates, extend, caps and keeping them fast.
- HeatmapsThe heatmap drawing, columns of colored cells over time and price, painted as one image, with palettes, scales, the automatic reference and budgets.
- TablesShow a grid of text in a corner of the pane with table.new and table.cell: positions, styling, merged cells, updating on the last bar and the caps.
- Legend itemsShowing status text, color keys and badges in the script's legend row with legend.info, legend.key and legend.badge.
- Background colorTint chosen bars with bgcolor(): conditional backgrounds, transparency, offsets, and how it behaves on the price pane and in a script's own pane.
- Bar coloringRecolor the chart's own candles with barcolor(): color by trend or signal, leave bars alone with na, and when to draw your own candles instead.