int ArrayBsearch( | ) |

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
Can anyone tell me why this code does not find a record with a 0 value in the first dimension? Thank you
int AddTradeRecord()
{
int tsize=ArraySize(trades);
int r;
r=ArrayBsearch(trades,0,WHOLE_ARRAY,0,MODE_ASCEND); // find an empty row/record
if (trades[r][0]==0)
{
trades[r][0]=ticket;
trades[r][1]=sl;
trades[r][2]=tp;
trades[r][3]=_magic;
trades[r][4]=0;
}
return(0)
}