What the Lab's chart supports
Which Pine features the Lab's chart preview runs, which it doesn't, and why TradingView is the final check.
The Lab writes Pine Script v6. Its chart isn't TradingView, though: it runs your script on the Lab's own Pine simulator, which covers a large part of Pine v5 and v6 but not all of it. Treat the Lab's chart as a preview and TradingView as the final check.
What runs
- Plots and marks:
plot,plotshape,plotchar,plotcandle,plotbar,hline,fill,bgcolor,barcolor. - Drawings: lines, boxes, labels, tables, linefills and polylines (
polyline.newwithchart.point). - Inputs of the usual types, including session, timeframe and symbol, with a settings panel.
- The common
ta.*functions, arrays, maps, user-defined types and methods,varandvarip, loops andswitch. request.securityfor higher timeframes, and across markets (like NQ and ES for SMT) when the Lab has that market's data.
Not supported, or accepted but inactive
| Feature | In the Lab |
|---|---|
plotarrow() | Compiles, then fails on the first bar. Use plotshape(). |
matrix.* | Not supported. |
request.security_lower_tf | Works only when the Lab has finer data for that market; otherwise it returns an empty array. |
alert() and log.* | Accepted, but they do nothing in the Lab. Set your alerts up in TradingView. |
Things that behave differently
- Drawing caps. Lines, boxes, labels and polylines are capped by
max_lines_count,max_boxes_count,max_labels_countandmax_polylines_count, 50 each by default. The oldest is removed first. A polyline takes at most 10,000 points, and can only be deleted, not changed. - VWAP.
ta.vwapis anchored to the session, and futures sessions roll at the 17:00 Chicago Globex open. The anchor and standard-deviation versions aren't supported. - Tuples.
ta.macd,ta.bb,ta.dmiandta.supertrendmust be unpacked, as in[m, s, h] = ta.macd(...). - Linefills fill between the two line segments, not their extensions.
- EMA warm-up. The first bars of a
ta.emacan differ from TradingView's, because the Lab starts from the first value and TradingView from an average. - Time zones. An explicit timezone is honored. Without one, the Lab's chart reads times in UTC, while TradingView uses the exchange's timezone. For session or time-of-day logic, pass one, such as
"America/New_York".
Checks aren't guarantees
“Sample checks passed” on a result card means the script passed its checks on a sample of bars. When they pass, the downloaded file's header puts it plainly: “Not a guarantee for all data or realtime behavior.” Before you trade with an indicator, load it in TradingView and compare it with the Lab's chart. See Using your indicator in TradingView.
[TP1]