MT5 EA fails to open deals for a long time during backtests

 
Good morning.
I have the following problem. By testing my EA, I saw a long period of time during which EA do not perform any deals at market.
I tried to investigate if problem could be in general setup parameters such as every tick or every tick based on real tick, but issue was always the same.
Does anyone of you encountered same problem? Is this an issue fixable or not?
The picture below may help to understand the problem.
Files:
td2_problem.JPG  102 kb
td2_problem2.JPG  103 kb
 
here is another example.
6 months only 3 deals at market
Files:
td2_problem3.JPG  111 kb
 
I tried also to delete and reload history. Results are the same.
Any help?
 
Marco Stacchiotti: I tried to investigate if problem could be in general setup parameters such as every tick or every tick based on real tick, but issue was always the same.
That doesn't investigate anything.

Do you really expect an answer? We can't see your broken code. There are no mind readers here and our crystal balls are cracked.

Use the debugger or print out your variables, including _LastError and find out why.

 
William Roeder:
That doesn't investigate anything.

Do you really expect an answer? We can't see your broken code. There are no mind readers here and our crystal balls are cracked.

Use the debugger or print out your variables, including _LastError and find out why.

first I'd like to know if it is a coding error.
However, thank a lot for support.

Reason: