Download MetaTrader 5

No Errors No Warnings but...

To add comments, please log in or register
They are making profit already using Freelance service. You can join them!
Konstantinos Maleas
159
Konstantinos Maleas 2014.02.16 16:24 

After the auto update of MT4 my EAs doesn’t play at all.

No Errors No Warnings, it just doesn’t start.

What should I do and were should i look for further instructions about the language?

Ubzen
5394
Ubzen 2014.02.16 16:27  
maleas_k:

After the auto update of MT4 my EAs doesn’t play at all.

No Errors No Warnings, it just doesn’t start.

What should I do and were should i look for further instructions about the language?

Which command or condition within your code does-not get executed?

Konstantinos Maleas
159
Konstantinos Maleas 2014.02.16 16:29  

2014.02.16 18:27:24.240 2011.01.02 23:00 Testing pass stopped due to a critical error in the EA

2014.02.16 18:27:24.240 2011.01.02 23:00 array out of range in 'Dvrg Exploitation v4_4.mq4' (542,36)

whroeder1
14532
whroeder1 2014.02.16 16:39  
So don't access outside of your array. If you don't know how, post the code using (using SRC.
Konstantinos Maleas
159
Konstantinos Maleas 2014.02.16 16:41  
int init()
{  //--- Dvrg Exploitation ---------------------------------------
   int i,z;
  
   for (i=0; i<=9; i++)
   {  
      pos_divergence[i] = 0;            neg_divergence[i] = 0; 
      long_scalp_order_again[i] = 1;    short_scalp_order_again[i] = 1;
   }
 
   close_long_dvrg = 0;              close_short_dvrg = 0;
   long_order_again_1D= 1;           short_order_again_1D = 1;
   long_HS_order_again_1D = 1;       short_HS_order_again_1D = 1;
   long_FHS_order_again_1D = 1;      short_FHS_order_again_1D = 1;
   cross_long_order_again_1D = 1;    cross_short_order_again_1D = 1;
   
   //--- Swinger v2_2-11 -----------------------------------------  
   label_4H = 1;
   blind_long_4H = 0;             blind_short_4H = 0;
   long_non_failure_4H  = 0;      short_non_failure_4H = 0;
   order_again_long_4H = 1;       order_again_short_4H = 1;
   long_safe_enviroment = 0;      short_safe_enviroment = 0;
   no_other_long_orders_4H = 1;   no_other_short_orders_4H = 1;
   
   for (i=0; i<=99; i++) for (z=0;z<=9; z++)
 { long_orders_array_ATF[i][z]=0; short_orders_array_ATF[i][z]=0; }// This is the array
   read_variables();
   return(0);
}
whroeder1
14532
whroeder1 2014.02.16 16:45  

And how is that supposed to help?

  1. Don't show us the declaration and we can't see how big the arrays are.
  2. Don't show us the definition of read_variables() (I assume it fills in your arrays.)
  3. Don't show us where you use the arrays.
Konstantinos Maleas
159
Konstantinos Maleas 2014.02.16 16:49  
int  long_orders_array_ATF[100][10], short_orders_array_ATF[100][10] 
Konstantinos Maleas
159
Konstantinos Maleas 2014.02.16 16:51  

I am confused.

The Debug tab takes me to line 120.

But the terminal’s journal take’s me to 553,36.

Alain Verleyen
Moderator
30752
Alain Verleyen 2014.02.16 16:51  
maleas_k:

2014.02.16 18:27:24.240 2011.01.02 23:00 Testing pass stopped due to a critical error in the EA

2014.02.16 18:27:24.240 2011.01.02 23:00 array out of range in 'Dvrg Exploitation v4_4.mq4' (542,36)


Show line 542 of your code now.
Konstantinos Maleas
159
Konstantinos Maleas 2014.02.16 16:53  
int  long_orders_array_ATF[100][10], short_orders_array_ATF[100][10] 

int init()
{  //--- Dvrg Exploitation ---------------------------------------
   int i,z;
  
   for (i=0; i<=9; i++)
   {  
      pos_divergence[i] = 0;            neg_divergence[i] = 0; 
      long_scalp_order_again[i] = 1;    short_scalp_order_again[i] = 1;
   }
 
   close_long_dvrg = 0;              close_short_dvrg = 0;
   long_order_again_1D= 1;           short_order_again_1D = 1;
   long_HS_order_again_1D = 1;       short_HS_order_again_1D = 1;
   long_FHS_order_again_1D = 1;      short_FHS_order_again_1D = 1;
   cross_long_order_again_1D = 1;    cross_short_order_again_1D = 1;
   
   //--- Swinger v2_2-11 -----------------------------------------  
   label_4H = 1;
   blind_long_4H = 0;             blind_short_4H = 0;
   long_non_failure_4H  = 0;      short_non_failure_4H = 0;
   order_again_long_4H = 1;       order_again_short_4H = 1;
   long_safe_enviroment = 0;      short_safe_enviroment = 0;
   no_other_long_orders_4H = 1;   no_other_short_orders_4H = 1;
   
   for (i=0; i<=99; i++) for (z=0;z<=9; z++)
 { long_orders_array_ATF[i][z]=0; short_orders_array_ATF[i][z]=0; }
   read_variables();
   return(0);
}
void read_variables()
{
   file_name = "Dvrg_Exploitation_v4_4_Trade_Data.csv";
   file_handle = FileOpen(file_name,FILE_CSV|FILE_READ,'/');
        
        if( file_handle > 0 )
        {       
      long_safe_enviroment = FileReadNumber(file_handle);            short_safe_enviroment = FileReadNumber(file_handle);
                close_long_dvrg = FileReadNumber(file_handle);                 close_short_dvrg = FileReadNumber(file_handle);
      long_order_again_1D = FileReadNumber(file_handle);             short_order_again_1D = FileReadNumber(file_handle);
      long_HS_order_again_1D = FileReadNumber(file_handle);          short_HS_order_again_1D = FileReadNumber(file_handle);
      long_FHS_order_again_1D = FileReadNumber(file_handle);         short_FHS_order_again_1D = FileReadNumber(file_handle);
      cross_long_order_again_1D = FileReadNumber(file_handle);       cross_short_order_again_1D = FileReadNumber(file_handle);
           long_non_failure_4H = FileReadNumber(file_handle);             short_non_failure_4H = FileReadNumber(file_handle);  
      order_again_long_4H = FileReadNumber(file_handle);             order_again_short_4H = FileReadNumber(file_handle);
      no_other_long_orders_4H = FileReadNumber(file_handle);         no_other_short_orders_4H = FileReadNumber(file_handle);
      long_safe_non_failure_4H = FileReadNumber(file_handle);        short_safe_non_failure_4H = FileReadNumber(file_handle);  
      order_again_long_safe_4H = FileReadNumber(file_handle);        order_again_short_safe_4H = FileReadNumber(file_handle);
      no_other_long_safe_orders_4H = FileReadNumber(file_handle);    no_other_short_safe_orders_4H = FileReadNumber(file_handle);
      FileClose(file_handle);
        }
   file_handle_array=FileOpen("pos_divergence.dat", FILE_BIN|FILE_WRITE);
   if ( file_handle_array > 0 )   {FileReadArray(file_handle_array, pos_divergence, 0, 10);             FileClose(file_handle_array);}
        file_handle_array=FileOpen("neg_divergence.dat", FILE_BIN|FILE_WRITE);
   if ( file_handle_array > 0 )   {FileReadArray(file_handle_array, neg_divergence, 0, 10);             FileClose(file_handle_array);}
        file_handle_array=FileOpen("long_orders_array_ATF.dat", FILE_BIN|FILE_WRITE);
   if ( file_handle_array > 0 )   {FileReadArray(file_handle_array, long_orders_array_ATF, 0, 10000);   FileClose(file_handle_array);}
        file_handle_array=FileOpen("short_orders_array_ATF.dat", FILE_BIN|FILE_WRITE);
   if ( file_handle_array > 0 )   {FileReadArray(file_handle_array, short_orders_array_ATF, 0, 10000);  FileClose(file_handle_array);}
   file_handle_array=FileOpen("ds_array_ATF.dat", FILE_BIN|FILE_WRITE);
   if ( file_handle_array > 0 )   {FileReadArray(file_handle_array, ds_array_ATF, 0, 80);               FileClose(file_handle_array);}
}
void check_orders_sl_tp()
{
   int i, z;
   for( i=0; i<=orders_total(); i++ ) for( z=0; z<=9; z++ )
   {
      if ( long_orders_array_ATF[i][z] > 0 )
      if ( Order_Select(long_orders_array_ATF[i][z],"History") == long_orders_array_ATF[i][z] )
      {
         if( OrderSymbol()==Symbol() && OrderClosePrice()==OrderStopLoss() )
         {
            if( long_orders_array_ATF[i][0] == OrderTicket()) { long_orders_array_ATF[i][0] = 0; no_other_long_orders_4H = 1;   order_again_long_4H = 1;}
            if( long_orders_array_ATF[i][1] == OrderTicket()) { long_orders_array_ATF[i][1] = 0;                                order_again_long_4H = 1;}
            if( long_orders_array_ATF[i][2] == OrderTicket()) { long_orders_array_ATF[i][2] = 0; long_order_again_1D= 1;        set_enviroment(0,"long",3);}
            if( long_orders_array_ATF[i][3] == OrderTicket()) { long_orders_array_ATF[i][3] = 0; cross_long_order_again_1D = 1; set_enviroment(0,"long",4);}
            if( long_orders_array_ATF[i][4] == OrderTicket()) { long_orders_array_ATF[i][4] = 0; long_HS_order_again_1D = 1;    set_enviroment(0,"long",2);}
            if( long_orders_array_ATF[i][5] == OrderTicket()) { long_orders_array_ATF[i][5] = 0; long_FHS_order_again_1D = 1;   set_enviroment(0,"long",1);}
            if( long_orders_array_ATF[i][6] == OrderTicket()) { long_orders_array_ATF[i][6] = 0; order_again_long_4H = 0; no_other_long_orders_4H = 0; long_non_failure_4H = 0;}
            if( long_orders_array_ATF[i][7] == OrderTicket()) { long_orders_array_ATF[i][7] = 0; order_again_long_4H = 0; no_other_long_orders_4H = 0;}
            if( long_orders_array_ATF[i][8] == OrderTicket()) { long_orders_array_ATF[i][8] = 0; order_again_long_4H = 0; no_other_long_orders_4H = 0; long_non_failure_4H = 0;}
         }.........
Konstantinos Maleas
159
Konstantinos Maleas 2014.02.16 16:54  
Line 553
if ( long_orders_array_ATF[i][z] > 0 )
12
To add comments, please log in or register