Arrays
Pine scripts can now use a powerful new arrays feature to build custom datasets. Arrays significantly extend the modeling capabilities of Pine by allowing coders to populate, manage and calculate on one-dimensional data structures containing elements of one of the following types: float, int, bool, or color.
Scripts samples
Plenty of available Open-source arrays script samples available
https://www.tradingview.com/blog/en/arrays-are-now-available-in-pine-script-20052/