Assignments of a value to a variable not working on MT4 strategy tester

 

The EA I had written worked properly last weekend, however, rerunning the same test as last week gave me different results.

I isolated the problem to assignment of a value to a variable. The variable had a space in it after assignment.

This problem applies to all the programs I have written in the last 2 weeks.

I have been a Professional Analyst/Programmer for the last 20 years.


Can anyone HELP, or have I to forget what I am trying to do.

 
grahambl: The EA I had written worked properly last weekend, however, rerunning the same test as last week gave me different results. I isolated the problem to assignment of a value to a variable. The variable had a space in it after assignment. This problem applies to all the programs I have written in the last 2 weeks. I have been a Professional Analyst/Programmer for the last 20 years. Can anyone HELP, or have I to forget what I am trying to do.

Tell us, as "a Professional Analyst/Programmer for the last 20 years", how would you reply to such a query with little to no information — no code, no details about the difference in the tests, no log output, no explanation of what you actually debugged and how you came to the conclusion of a possible variable assignment as the cause of the issue?

 

Hi,

Sorry about that, I have included whatever data I can below.

       firstrec=1;
        printf("firstrec 1 = ", firstrec);
        Print("Open[0] 1 = ",Open[0]); 
        Print("Open[1] 1 = ",Open[1]);
        Print("Lot Size 1 = ",Lots);
       }

The log produced from that is below.

This was produced with firstrec=0 and then after Get First Record Section, assigning 1 to it. 

Due to the security surrounding this project, there is not much more info I can give you.

 
grahambl #: Sorry about that, I have included whatever data I can below. This was produced with firstrec=0 and then after Get First Record Section, assigning 1 to it. Due to the security surrounding this project, there is not much more info I can give you.

That is not proper compilable code ...

  firstrec=1;
  printf("firstrec 1 = ", firstrec);
  Print("Open[0] 1 = ",Open[0]); 
  Print("Open[1] 1 = ",Open[1]);
  Print("Lot Size 1 = ",Lots);
}

What is "printf"? There is no such standard function.

What datatype is "firstrec"? How is it declared?

Are you getting any compilation warnings?

Are you using "strict" compilation?

You don't have to provide your full project code, but you should provide a sample that will reproduce the problem.

So, please provide proper, compilable code, that can be run and analysed.

 

Hi,

That was the problem, printf should have been Print. Problem seems to have been solved.

Thanks for your help.

 
grahambl #: Hi, That was the problem, printf should have been Print. Problem seems to have been solved. Thanks for your help.

Actually, it seems the compiler accepts "printf" as a valid alternative to "PrintFormat".

The number, order and type of parameters must exactly match the set of qualifiers, otherwise the print result is undefined. Instead of PrintFormat() you can use printf().