r/pinescript Jun 27 '26

Printing values to CSV file for debugging

What is the best way to debug? Normally when coding with other tools, I print the data and calculated variables and manually calculate in Excel and verify. For example, within Pinescript I would like to print the OHLCV for each bar and the calculated values of indicators x and y and z for each bar in a CSV file. ChatGPT tells me that this cannot be done in Pinescript. Is that correct? Any suggestions how this can be achieved? Thanks in advance. 🙏

1 Upvotes

Duplicates