Skip to main content
The bar being evaluated is available through built-in series; nothing is imported or requested. These names cannot be redeclared. For time, year and the rest see Sessions and intervals. close[1] is the previous close and close[0] the current one; the index may be a series expression. History reaches back 500 bars, and a larger index stops the script when it runs (see Limits). input.source lets the chart user pick the price. Its default must be one of open, high, low, close, hl2, hlc3, ohlc4, hlcc4; volume is refused: volume is not a valid source variable. Expected: open/high/low/close/hl2/hlc3/ohlc4/hlcc4.
chart.is_standard is true on candles, bars, line and area charts; chart.is_heikinashi, is_renko, is_kagi, is_linebreak, is_pnf, is_range flag the other types.