NEED help regarding Error in a code and advice

 

Hello everyone,

I am new in programming. Recently I coded the following program.

//+------------------------------------------------------------------+
//|                                                 TODAYtrendEA.mq4 |
//|                                                            tanim |
//|                                        http://www.metaquotes.net |
//+------------------------------------------------------------------+
#property copyright "tanim"
#property link      "http://www.metaquotes.net"

#include <stderror.mqh>

//--- input parameters
extern int       TP=30;
extern int       SL=30;
extern double    Lots=0.1;
extern int    MagicNum=10001;
extern int    begin=8;
extern int   finish=20;


int CalculateCurrentOrders()
 {
   int orderT = OrdersTotal(), buys = 0, sells = 0;
   //----
   for(int i = 0; i < orderT; i++)
    {
      if(OrderSelect(i, SELECT_BY_POS, MODE_TRADES) == false) break;
      if(OrderSymbol() == Symbol() && OrderMagicNumber() == MagicNum)
       {
         if(OrderType() == OP_BUY)  buys++;
         if(OrderType() == OP_SELL) sells++;
       }
    }
   if(buys > 0) return(buys);
   else if(sells > 0) return(-sells);
   else return(0);
 }
//+------------------------------------------------------------------+ 
int Get_Broker_Digit()
 {  
   if(Digits == 5 || Digits == 3)
    { 
       return(10);
    } 
   else
    {    
       return(1); 
    }   
 }







//+------------------------------------------------------------------+
//| expert initialization function                                   |
//+------------------------------------------------------------------+
int init()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert deinitialization function                                 |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| expert start function                                            |
//+------------------------------------------------------------------+
int start()
  {
//----
 int cnt, ticket, total;
   int digitKoeff = Get_Broker_Digit();
  
  double gadTVIUp,gadTVIDn,gadCCIUp,gadGHLUp,gadT3Up,gadCCIDn,gadGHLDn,gadT3Dn; 
  
   
   
   
   
   
   
   
   //-----
   if((CalculateCurrentOrders() == 0)&&(Hour()>=begin)&&(Hour()<=finish)) 
    {      
      gadTVIUp=iCustom(NULL,PERIOD_M5,"GenesisMatrix 2.21_1",0,0); 
      gadTVIDn=iCustom(NULL,PERIOD_M5,"GenesisMatrix 2.21_1",1,0); 
      gadCCIUp=iCustom(NULL,PERIOD_M5,"GenesisMatrix 2.21_1",2,0);    
      gadCCIDn=iCustom(NULL,PERIOD_M5,"GenesisMatrix 2.21_1",3,0); 
      gadGHLUp=iCustom(NULL,PERIOD_M5,"GenesisMatrix 2.21_1",4,0);
      gadGHLDn=iCustom(NULL,PERIOD_M5,"GenesisMatrix 2.21_1",5,0);  
      gadT3Up=iCustom(NULL,PERIOD_M5,"GenesisMatrix 2.21_1",6,0);
      gadT3Dn=iCustom(NULL,PERIOD_M5,"GenesisMatrix 2.21_1",7,0); 
       
       
       
       if(gadTVIUp>0 && gadCCIUp>0 && gadGHLUp>0 && gadT3Up>0)
       {      
         ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, 3 * digitKoeff, Ask - SL * Point * digitKoeff, Ask + TP * Point * digitKoeff, "rsi-ma", MagicNum, 0, Green);
         if(ticket > 0)
          {            
             
        
            if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) 
            Print("BUY order opened : ",OrderOpenPrice());
         }
       else Print("Error opening BUY order : ",GetLastError());
                   
          }
       }     
      if(gadTVIDn>0 && gadCCIDn>0 && gadGHLDn>0 && gadT3Dn>0)
       {
         ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, 3 * digitKoeff, Bid + SL * Point * digitKoeff, Bid - TP * Point * digitKoeff, "rsi-ma", MagicNum, 0, Red);
         if(ticket > 0)
          {
              if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) 
            Print("SELL order opened : ",OrderOpenPrice());
         }
       else Print("Error opening SELL order : ",GetLastError());
                       
        
            
       }
                   
    }


   
//----
   return(0);
  
//+------------------------------------------------------------------+

 I tried to test it with strategy tester.It is giving the following Error. 

 

 13:27:47 GENESI~2 EURUSD#,M5: removed

13:30:56 GENESI~2: loaded successfully

13:31:00 TestGenerator: unmatched data error (high value 1.35239 at 2013.02.06 14:25 is not reached from the least timeframe, high price 1.35224 mismatches)

13:26:21 TestGenerator: unmatched data error (low value 1.29935 at 2013.03.22 17:55 is not reached from the least timeframe, low price 1.29952 mismatches)

13:26:21 TestGenerator: unmatched data error (low value 1.28623 at 2013.03.26 15:00 and price 1.28606 mismatched)

13:26:21 TestGenerator: unmatched data error (volume limit 53 at 2013.03.26 15:00 exceeded)

 

13:31:06 GENESI~2 inputs: TP=30; SL=30; Lots=0.1; MagicNum=10001; begin=8; finish=20;

13:31:06 2013.01.11 05:35  GENESI~2 EURUSD#,M5: executable file is corrupted. Please recompile it.

I am attaching the source code 

Would you guys be kind enough to tell me what is wrong.

 

2.can anyone suggest me any easy going reading material/link which can help me understanding MQL4 programing ?


Files:
todaytt2.mq4  4 kb
 
tanim:

Hello everyone,

I am new in programming. Recently I coded the following program.

 I tried to test it with strategy tester.It is giving the following Error. 


13:31:06 2013.01.11 05:35  GENESI~2 EURUSD#,M5: executable file is corrupted. Please recompile it.

I am attaching the source code

1. Would you guys be kind enough to tell me what is wrong.

 

2.  can anyone suggest me any easy going reading material/link which can help me understanding MQL4 programing ?


1.  Make sure the version of MetaEditor you are using is the same Build or earlier than the version of MT4 you are using.

2.  the Book 

 
tanim: Would you guys be kind enough to tell me what is wrong.
13:31:06 2013.01.11 05:35  GENESI~2 EURUSD#,M5: executable file is corrupted. Please recompile it.
 
RaptorUK:

1.  Make sure the version of MetaEditor you are using is the same Build or earlier than the version of MT4 you are using.

2.  the Book 

Thanks for your reply RaptorUK.Where or How can i get the information about which version of  MT4 i am using.I didnt know MT4 have more than one version.thanks for this valuable information.
 
WHRoeder:
13:31:06 2013.01.11 05:35  GENESI~2 EURUSD#,M5: executable file is corrupted. Please recompile it.


WHRoeder,Thanks for your reply.I recompiled it many times.But still its not working .is my code ok?wish you best of luck.
 
tanim:
Thanks for your reply RaptorUK.Where or How can i get the information about which version of  MT4 i am using.I didnt know MT4 have more than one version.thanks for this valuable information.

Here . . .  Help>About

 

and similar for Meta Editor

 

 
tanim: I recompiled it many times.But still its not working .is my code ok?

Then the code is irrelevant.

Did you install in \program files* on Vista/Win7?

Shutdown the terminal, delete the ex4 and restart - It can't run what it can't find. If it's still running, that file is NOT what is running.

Then recompile and attach.

Reason: