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 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");
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.
Thanks for the replies, I think I will write to file.
They should really develop a proper debugger for this software.
Thanks :)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
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.