Choose a matrix, an array or a table
For a calculation with three inputs per observation, a rectangular matrix gives every row the same contract. A single series or array is simpler for one value per bar. A TradingView table displays text and values; it does not supply matrix arithmetic. Name what each axis means before writing an indexing loop.
- Pine collections cannot directly contain another collection type. A literal array<array<float>> is not the route to nested storage; use UDT fields for that design.
- For this page, rows and columns are mathematical positions. Neither axis automatically represents chart bars, timestamps or symbols.
| Representation | Example task | Constraint |
|---|---|---|
| matrix<float> | Two observations, three numeric features each | Every row has three cells |
| array<float> | One ordered list of six values | You define any row/column mapping yourself |
| Array of UDT row objects | Rows containing different numbers of events | Each UDT can hold an array; validate each row separately |
| table | Show the final calculation on a chart | Display object, not a numeric matrix |