Pine Script, using my trading view watchlist as a "list"

Viewed 261

I am trying to create a code that allows me use my watchlist as a "list", I am relatively new to coding, and the first language I "learned" was python. In python I was able to do various things with said list. However in Pine, I am trying to build a script that will pull the close price of the previous day. As far as I know, I can only run that code on specific stocks to get the close price of that stock(if I don't specify which stock), or manually find the stocks and ask Pine to pull the closing price. However my watch list may change and I would not want to update my code every time. Leading me to the question, can I set my watchlist as a list which allows me to run a loop to pull the close price, of course, if there is another method to do so, I am welcome to that as well. Thank you!

0 Answers
Related