Array out of range in (1962,24)

 

Dear MQL community please help me out 

we build an EA bridge for binary options and it should be working fine but after each first contract it closes down the EA and says array out of range in (1962,24) 

I hope anyone can help me out...

Thank you in advanced 

<ex5 File Deleted>

 
you need to attach the mq5 file as ex5 cannot be viewed or modified.
 
Bogdan, check line 1962 and 24th character. (1962,24) is line number and char index of error. if you don't like to share mql code, copy that line at least.
 
Mohammad Bazrkar:
Bogdan, check line 1962 and 24th character. (1962,24) is line number and char index of error. if you don't like to share mql code, copy that line at least.

That was very usefull thank you sir please have a look   

for(int d=tic;d>=0;d--){

      for(int b=0;b<len-1;b++){

         int len1=StringFind(data[b],"buy_price");  

         string Buy_Price=StringSubstr(data[b],len1+12);  

         len1=StringFind(Buy_Price,",");  

         Buy_Price=StringSubstr(Buy_Price,0,len1-1);

         

         len1=StringFind(data[b],"sell_price");  

         string Sell_price=StringSubstr(data[b],len1+13);  

         len1=StringFind(Sell_price,",");  

         Sell_price=StringSubstr(Sell_price,0,len1-1);

         

         len1=StringFind(data[b],"transaction_id");  

         string Transaction_id=StringSubstr(data[b],len1+17);  

         len1=StringFind(Transaction_id,"\"");  

         Transaction_id=StringSubstr(Transaction_id,0,len1);



         if(TicketArray[d]==StringToInteger(Transaction_id) && TicketArray[d]!=-1){

            ret=true;

            

            tic--;

            long temp[];

            long ticketDel=TicketArray[d];

            

            ArrayCopy(temp,TicketArray);

            ArrayFree(TicketArray);

            for(int i=0; i<ArraySize(temp); i++){

               if(temp[i]==ticketDel)continue;

               int s=ArraySize(TicketArray);

               ArrayResize(TicketArray,s+1);

               TicketArray[s]=temp[i];

            }

 

now we know here is the problem:

for(int d=tic;d>=0;d--){
      for(int b=0;b<len-1;b++){
//...
         if(TicketArray[d]==StringToInteger(Transaction_id) && TicketArray[d]!=-1){

it means d value is out of range. so, check source of tick variable. it seems you have wrong `tick` or empty TicketArray.

 

Hi guys me again, i cant seem te get it running like we should and want to call up on you to help me out. If you got time to fix it please do the value of the strategy is enormous so ill post the whole code so you can try it yourself. Here is the instruction and the dll file from my drive https://drive.google.com/drive/folders/1zCiSO463vP48qYao_9IO8tRom5QTZPyi?usp=sharing    Ill trow in a bonus if you can get it to run like it should. 

Files:
 
      for(int d=0;d<tic;d++){
         for(int b=0;b<len-1;b++){
            int len1=StringFind(data[b],"buy_price");  
            string Buy_Price=StringSubstr(data[b],len1+12);  
            len1=StringFind(Buy_Price,",");  
            Buy_Price=StringSubstr(Buy_Price,0,len1-1);
            
            len1=StringFind(data[b],"sell_price");  
            string Sell_price=StringSubstr(data[b],len1+13);  
            len1=StringFind(Sell_price,",");  
            Sell_price=StringSubstr(Sell_price,0,len1-1);
            
            len1=StringFind(data[b],"transaction_id");  
            string Transaction_id=StringSubstr(data[b],len1+17);  
            len1=StringFind(Transaction_id,"\"");  
            Transaction_id=StringSubstr(Transaction_id,0,len1);
   
            if(TicketArray[d]==StringToInteger(Transaction_id) && TicketArray[d]!=-1){
               TicketArray[d] = -1;
               TicketRet=-1;
            }
         }
         if(TicketArray[d]==StringToInteger(Transaction_id) && TicketArray[d]!=-1){
            ret=true;
            
            tic--;
            long temp[];
            long ticketDel=TicketArray[d];
            
            ArrayCopy(temp,TicketArray);
            ArrayFree(TicketArray);
            for(int i=0; i<ArraySize(temp); i++){
               if(temp[i]==ticketDel)continue;
               int s=ArraySize(TicketArray);
               ArrayResize(TicketArray,s+1);
               TicketArray[s]=temp[i];
            }
for(int d=tic-1;d>=0;d--)
But this will also out of range when tic is actually 0.
 
Marco vd Heijden:
But this will also out of range when tic is actually 0.
No it don't, as if tic is 0, the loop is not executed. (I didn't check the original code, only what you posted).
 
Bogdan Danci:

Hi guys me again, i cant seem te get it running like we should and want to call up on you to help me out. If you got time to fix it please do the value of the strategy is enormous so ill post the whole code so you can try it yourself. Here is the instruction and the dll file from my drive https://drive.google.com/drive/folders/1zCiSO463vP48qYao_9IO8tRom5QTZPyi?usp=sharing    Ill trow in a bonus if you can get it to run like it should. 

Please don't use the forum for business deal. Use the Freelance section.

About your project, maybe you will not care about my opinion, but here it is nonetheless : don't lost your time and money on binary option, it's not trading, it's like a Casino where you can never beat the broker.

 
Alain Verleyen:

Please don't use the forum for business deal. Use the Freelance section.

About your project, maybe you will not care about my opinion, but here it is nonetheless : don't lost your time and money on binary option, it's not trading, it's like a Casino where you can never beat the broker.

<Deleted>

 
Bogdan Danci:

<Deleted>

Believe me or not, but you can't win in the long run. You are playing by the rules of your broker and nothing else, it will never let you win at the end.

Anyway, you will make your own experience, good luck.