Since you are calling your Search function with the variable "Ticket", don't you need your search to be something like:
//+------------------------------------------------------------------+
//| Array Search |
//+------------------------------------------------------------------+
void Search(int Ticket)
{
return(ArrayBsearch(BuyTable,Ticket,WHOLE_ARRAY, 0, MODE_ASCEND));
}
Presumably somewhere in your code you made the function call "Search(RecentSellTicket())" or you set the variable Ticket equal to RecentSellTicket() at some point prior to calling Search(Ticket).
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi!
I have an array with ticket number in the 1st column, and I've been trying to figure out a way such that my function will return the index of the ticket number I input. When I try to compile the below, the compiler says "Search function returns no result".. Please explain to me how/why. :)
double BuyTable [100][9];
//+------------------------------------------------------------------+
//| Array Search |
//+------------------------------------------------------------------+
void Search(int Ticket)
{
return(ArrayBsearch(BuyTable,RecentSellTicket(),WHOLE_ARRAY, 0, MODE_ASCEND));
}