Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 412

 
RomanRott:

So I guess if you calculate something in the OnTimer function every 1-2 minutes, it will load the terminal less than the same operations in OnTick?

In OnTick() you can also calculate once every 1-2 minutes. But in principle, yes. It all depends on the task at hand.

 

Good afternoon!

Faced with errors 4110 and 4111 (prohibition to trade in Long or Short)

If I disable one of the values in the Expert Advisor settings, it gives an error in the tester.

03:46:02.279 2017.11.07 00:00:00 CHFJPY,H1: OrderSend error 4110

03:56:31.458 2017.11.06 00:02:36 CHFJPY,H1: OrderSend error 4111


I can't find a function for MT4 that returns an opportunity to trade short or long.

The function for MT5 SYMBOL_TRADE_MODE_LONGONLY and SYMBOL_TRADE_MODE_SHORTONLY does not work in MT4.


Please give me a real example to verify that there is no error in the tester.

Please do not give me just a link to the tutorial, I know where it is, I need a specific solution.

Thanks in advance!

 

Only catch the error after OrderSend and include a flag that you can't do it again.

Or you can set up the "Direction of trade" parameter yourself.

 
Taras Slobodyanik:

Only catch the error after OrderSend and include a flag that you can't do it again.

Or you can set the "Trade direction" parameter yourself.


Only catch an error after OrderSend and turn on the flag that it can no longer be done.

==

This way one error will still manage to pop up.

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

Or you can adjust the "Trade direction" parameter yourself.

==

For yourself you can, but if sov to people - the error will fly out (check in the market may not pass).

 

Who can explain why after compilation EA is not visible in tester in drop down menu, and some old ones are not visible.

They are in the folder, compiled again, closed, opened the terminal, etc...

 
forexman77:

Who can explain why after compilation EA is not visible in tester in drop down menu, and some old ones are not visible.

I have them in the folder, compiled them again, closed them, opened the terminal, etc...

There was a compilation error. File.mq4 is there, but file.ex4 is gone
 
STARIJ:
There was a compilation error. File.mq4 is there, but file.ex4 has disappeared

There is no error during compilation. The problem appeared about a month ago. What is surprising is that some EAs appear from time to time.

 
forexman77:

There is no error during compilation. The problem appeared about a month ago. What is surprising is that from time to time some EAs appear.

There was such a thing - Windows protects system area from interference. Got rid of its guardianship - saw the light
 

Is it possible to make the indicator go through the history on initialization and draw it there WITHOUT cycling through all the bars?

 
RomanRott:

Is it possible to make the indicator go through the history on initialization and draw it without cycling through all the bars?

1. Passing through the history and looping through the bars are the same thing.

The indicator doesn't have to draw anything at OnInit().

Reason: