Skip to content
Algo Trade Analytics Docs

matrix.is_identity() - Pine Script Function

The function determines if a matrix is an identity matrix (elements with ones on the main diagonal and zeros elsewhere).

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

Returns true if id is an identity matrix, false otherwise.

  • Returns false with non-square matrices.