Matrix trace

Category: momentum

Calculates the trace (sum of diagonal elements) of various matrices populated with price-derived values to demonstrate Pine Script matrix operations.

Formula

\text{trace}(M) = \sum_{i=0}^{\min(m,n)-1} M_{i,i} \text{ where } m, n \text{ are dimensions of } M

See signal primitives and every published strategy that uses Matrix trace on WOBR StrategyVerse.


Open the interactive page on WOBR AI → · WOBR.AI home