Skip to content
Algo Trade Analytics Docs

matrix.is_diagonal() - Pine Script Function

The function determines if the matrix is diagonal (all elements outside the main diagonal are zero).

matrix.is_diagonal(id) → series bool
NameTypeDescription
idmatrix<int/float>Matrix object to test.

Returns true if the id matrix is diagonal, false otherwise.

  • Returns false with non-square matrices.