Questions from a "dummy" - page 213

 
lazarev-d-m:

One of the easiest ways to insert

where you want to check if the code works or check if a condition is true (i.e., if all the conditions are true and an action must be taken)

I, for example, insert Alert inside each complex function with different text, in order to check if the function was executed at all and if the EA reaches it

Maybe you use some conditions and they are always false.

Thank you.
The EA just stops working, without any errors, and after restarting the terminal it starts working again.
I need to know how to check programmatically if it works or not. Although it is green and there are no errors in the log.
And after that check function I will put alert or print or comment.
 
G001: Please advise how to check whether the Expert Advisor is working or not?

The thing is that there are no errors in the log, but the EA sometimes stops working, and is restored only after restarting the terminal.

I am not quite clear how you define that "the Expert Advisor stops working sometimes". Maybe, it just starts an endless loop. Its log is empty and the Expert Advisor is working non-stop. Or maybe it has some other special feature.

 

I need an answer to the question in this post: https://www.mql5.com/ru/forum/3775/page215#comment_379520

Does anyone know the answer?

 
tol64: I need an answer to the question in this post: https://www.mql5.com/ru/forum/3775/page215#comment_379520 Does anyone know the answer?

There seems to be no direct answer, so we are left to speculate.

So, the type of license can be found out using Mql5InfoInteger(MQL5_LICENSE_TYPE). I.e., out of all possible values of the ENUM_LICENSE_TYPE enumeration some one will be returned. Further - by the exception method: the operating time limit(LICENSE_TIME) cannot be returned together with the previous three values of the specified enumeration. In particular, LICENSE_TIME must not be returned concurrently with LICENSE_DEMO .

With this reasoning, I would give a negative answer to the question "is it implied that a paid program for the Market can be time-limited in a demo test?" Becausethe demo of a paid product from the Market has its own identifier - LICENSE_DEMO.

 
Yedelkin:

There seems to be no direct answer, so we are left to speculate.

So, the type of license can be found out using Mql5InfoInteger(MQL5_LICENSE_TYPE). I.e., out of all possible values of the ENUM_LICENSE_TYPE enumeration some one will be returned. Further - by the exception method: the operating time limit(LICENSE_TIME) cannot be returned together with the previous three values of the specified enumeration. In particular, LICENSE_TIME must not be returned concurrently with LICENSE_DEMO .

With this reasoning, I would give a negative answer to the question "is it implied that a paid program for the Market can be time-limited in a demo test?" Becausethe demo of a paid product from the Market has its own identifier - LICENSE_DEMO.

I think that LICENSE_TIME can contain both LICENSE_DEMO and LICENSE_TIME. A clear example is given by such identifiers as MQL5_VISUAL_MODE and MQL5_TESTING. That is, they both let us know that we are in a tester. ))

So I wonder what did the developers actually put in this identifier? And in general, if there is no possibility to limit the time of some paid programs in demo mode, it would be nice to have such a possibility. Because there may be options that can be very profitable to use for yourself programs even without buying them. )))

 
tol64: And I think that both LICENSE_DEMO and LICENSE_TIME can be contained in LICENSE_TIME at the same time .

I agree that I completely missed the terminological peculiarities of the reference materials, due to which the exclusion method may lead to incorrect results due to one reason or another. ...Well, at least, the misunderstandings on the subject have been voiced, and only the authors of this listing can answer.

 
tol64: And in general, if there is no time limit on some paid programmes in demo mode, it would be nice to have such an option. Because there can be options that can be very profitable to use for yourself programs even without buying them. )))
And you make this proposal directly to the Service Desk. At the same time and find out how things really are :)
 
Yedelkin:

I'm not quite sure how you determine that "the EA sometimes stops working". Maybe, it just starts an endless loop. The log is empty, but the Expert Advisor is working non-stop. Or maybe some other peculiarity is triggered.

There are no loops. It opens quite often, 10-20 times a day, when I see indicator signals on the chart but the EA has not opened a position, it means that it is not working. I restartthe terminal and it works again.
 
G001 when I see indicator signals on a chart but Expert Advisor has not opened a position, it means that it is not working

This is getting closer to the subject. So it turns out that your EA stops reacting to the indicator signals? But it does not mean that the EA "does not work". Perhaps, it still works, but not in the way intended by the author.

Try setting a timer with a period of, for example, 10 minutes. And print out all indices that are significant for your Expert Advisor. See if the figures change over time. If the log is empty in this case too, you should definitely go to Service Desk with a copy of the code.

Addition. Or here's another idea. You have a place in your code with condition like if, after triggering which trade request must be sent. Try to print the cases of triggering/not triggering of this condition, for example:

if ()
  {
   ... 
   Print("Сработало условие такое-то, время такое-то");
  }
else
  {
   ...
   Print("Не сработало условие такое-то, время такое-то");
  }
 
Thank you. It's unlikely that the problem is with the EA, otherwise the restarting the terminal rule wouldn't always work. Also, it's a problem in MT4 with some brokers as well. I just need to check programmatically when it stops working to restart before the next signal. Added both prints and comments.
Reason: