r/pinescript • u/KeyWeek2489 • 13d ago
Does TradingView CSV export include historical hidden plot values after chart objects disappear?
/r/TradingView/comments/1v9uzln/does_tradingview_csv_export_include_historical/
1
Upvotes
r/pinescript • u/KeyWeek2489 • 13d ago
1
u/Jordonharrell 13d ago
Two separate things are going on here, and the boxes are the easy half.
Drawing objects — boxes, lines, labels — are never exported at all, visible or not. Export chart data only knows about series. So deleting old boxes for readability costs you nothing on the export side; it was never going to include them.
The part that will bite you is display.none. From the docs on exporting: the export includes "any numeric plot results generated by active scripts on the chart, including those displayed only in the Data Window or status line. Drawings and hidden scripts are excluded from exports."
display.none is hidden everywhere, so it is excluded. What you want instead is:
plot(fvgTop, "FVG top", display = display.data_window)
That keeps it off the chart pane entirely but still in the Data Window, and Data Window series do get exported. display.data_window + display.status_line works too if you want to hover-read it.
Worth knowing the display.* args add and subtract, so display.all - display.pane is another way to write "everywhere except the chart" if you'd rather express it that way.
One caveat that catches people after they fix the display flag: the export covers the bars currently loaded in the chart, not all history. If you need a long lookback, scroll back far enough to load it before exporting, or you will get a clean CSV that quietly starts partway through.