Pine Script array.push() — How to Add Elements to Arrays
I remember my first attempt at tracking price highs across bars in a TradingView script. I used a regular variable and lost every value except the last one. Pine Script array.push() is a function that adds new elements to the end of an array, letting you build dynamic data collections inside your indicators and strategies. Whether you're tracking RSI across 50 symbols or building a custom volatility tracker, this function is the tool I reach for.



