A library of functions for counting the number of times (frequency) that elements occur in an array or matrix.
█ USAGE
Import the Count library.
Create an array or matrix that is a `float`, `int`, `string`, or `bool` type to count elements from, then call the count function on the array or matrix.
The "count map" will return a map with keys for each unique element in the array or matrix, and with respective values representing the number of times the unique element was counted. The keys will be the same type as the array or matrix counted. The values will always be an `int` type.
If an array is in ascending or descending order, then the keys of the map will also generate in the same order.
Include a value to get the count of only that value in an array or matrix.
The string method of count() can use strings or regular expressions like "bull*" to count all matching occurrences in a string array.
To count multiple values, use an array of values instead of a single value. Returning a count map only of elements in the array.
Multiple regex patterns or strings can be counted as well.
An optional comparison operator can be specified to count the number of times an equality was satisfied for `float`, `int`, and `bool` methods of `count()`.
When passing an array of values to count and a comparison operator, the operator will apply to each value.
Multiple comparison operators can be applied when counting multiple values.
Biblioteca Pine
Fiel al espíritu de TradingView, el autor ha publicado este código de Pine como biblioteca de código abierto, para que otros programadores Pine de nuestra comunidad puedan reutilizarlo. ¡Enhorabuena al autor! Puede usar esta biblioteca de forma privada o en otras publicaciones de código abierto, pero la reutilización de este código en publicaciones está sujeta a nuestras Normas internas.
Exención de responsabilidad
Biblioteca Pine
Fiel al espíritu de TradingView, el autor ha publicado este código de Pine como biblioteca de código abierto, para que otros programadores Pine de nuestra comunidad puedan reutilizarlo. ¡Enhorabuena al autor! Puede usar esta biblioteca de forma privada o en otras publicaciones de código abierto, pero la reutilización de este código en publicaciones está sujeta a nuestras Normas internas.
