Count

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.
Pine Bibliothek
Ganz im Sinne von TradingView hat dieser Autor seinen/ihren Pine Code als Open-Source-Bibliothek veröffentlicht. Auf diese Weise können nun auch andere Pine-Programmierer aus unserer Community den Code verwenden. Vielen Dank an den Autor! Sie können diese Bibliothek privat oder in anderen Open-Source-Veröffentlichungen verwenden. Die Nutzung dieses Codes in einer Veröffentlichung wird in unseren Hausregeln reguliert.
Haftungsausschluss
Pine Bibliothek
Ganz im Sinne von TradingView hat dieser Autor seinen/ihren Pine Code als Open-Source-Bibliothek veröffentlicht. Auf diese Weise können nun auch andere Pine-Programmierer aus unserer Community den Code verwenden. Vielen Dank an den Autor! Sie können diese Bibliothek privat oder in anderen Open-Source-Veröffentlichungen verwenden. Die Nutzung dieses Codes in einer Veröffentlichung wird in unseren Hausregeln reguliert.