De-Bugging EA's

 

Greetings

I have started developing some simple EA's and use them on demo accounts. I noticed my biggest challenge is actually testing EA's. I understand this question is going to be broad, but I need some advice.

Whats the best testing methods.

I am used to working with tools like Microsoft Visual Studio, and that has excellent de-buggin tools.

 
o, i'm sorry there is no debugging tools in mql like you familiar with programming software
 
Blackberry:

Greetings

I have started developing some simple EA's and use them on demo accounts. I noticed my biggest challenge is actually testing EA's. I understand this question is going to be broad, but I need some advice.

Whats the best testing methods.

Learn how to use Print().
 
Print() or OutputDebugStringA and dbgView. Also PauseTest()
 
WHRoeder:
Print() or OutputDebugStringA and dbgView. Also PauseTest()

I tend to use write to file for the values I anticipate wanting to check. IT can be long - winded but catches all I want. I have my 'include file' write_to_log with lots of different cases which are called from other include files (or routines). The decision to write to file is invoked by setting the 'Local Test Flag' in each routine (in this example Check_Criteria_Flag - first write to file is case 27100.

. My Test Flag is and external string variable which can be changed

void write_to_log(int location,string check4error)
{  
   string WTL=location+" "+TimeToStr(TimeCurrent(),TIME_DATE|TIME_SECONDS)+" "+B_or_S;   // WTL - Write To Log
   int i1;
   if ( check4error  == "YES" )
   {  error = GetLastError();
      if ( error > 1 )
      {  Print("Location "+location+" Unanticipated error: ", ErrorDescription(error));
         FileWrite(My_Handle,"Location "+location+" Unanticipated error: "+error+" "+ErrorDescription(error));
      }
   }
   if ( My_Test_Flag != "YES" && error == 0 ) return(0);
   error = 0;
   switch (location)
   {  case 10005: WTL=WTL+" FTL - Enters Find_Total_Lots ~ Lot_Count = "+DoubleToStr(Lot_Count,2); break;

=====================================================================

void Check_Criteria_Flag()
{  string Local_Test_Flag = "YES";
   int i1;
   Criteria_Flag  = "Blank";
   My_Flag        = "Blank";
   if ( Local_Test_Flag == "YES" ) write_to_log(27100,"YES");
 
Blackberry:

Greetings

I have started developing some simple EA's and use them on demo accounts. I noticed my biggest challenge is actually testing EA's. I understand this question is going to be broad, but I need some advice.

Whats the best testing methods.

I am used to working with tools like Microsoft Visual Studio, and that has excellent de-buggin tools.

Working without a debugger really sucks. Sure I use a debug printout file but that is not nearly as good as having a proper step by step debugger. Sometimes I cut the relevant piece of the code out and paste it into an old Visual C++ compiler so I can step through the code and spot the stupid error. (I did this recently when trying to debug an insertion sort routine on ticket numbers.)
 

Thanks for the replies, I think I will write to file.

They should really develop a proper debugger for this software.

Thanks :)