MQL4 Reference Array Functions ArrayBsearch
ArrayBsearchSearches for a specified value in a multidimensional numeric array sorted in the ascending order. The search is performed in the first dimension taking into account the AS_SERIES flag. For searching in an array of double type
For searching in an array of float type
For searching in an array of long type
For searching in an array of int type
For searching in an array of short type
For searching in an array of char type
Parameters array[] [in] Numeric array for search. value [in] Value for search. count=WHOLE_ARRAY [in] Count of elements to search for. By default, it searches in the whole array. start=0 [in] Starting index to search for. By default, the search starts at the first element. direction=MODE_ASCEND [in] Search direction. It can be any of the following values: MODE_ASCEND searching in forward direction, Return Value The function returns index of a found element. If the wanted value isn't found, the function returns the index of an element nearest in value. Note Binary search processes only sorted arrays. To sort numeric arrays use the ArraySort() function. Example:
|