Discussion of article "The checks a trading robot must pass before publication in the Market" - page 15

 

Hello.

How can I check if I have enough disc space?


Now this message.

On the third try, it passed without making any changes


 
Denis Nikolaev #:

Hello.

How can I check if I have enough disc space?


Now this message

On the third try, it passed without any changes being made


In this case the message is not quite correct. The problem was in RAM.

The memory on the server has been added.

 
Anton #:

In this case the message is not quite correct. The problem was in the RAM.

The memory on the server has been added.

Thank you.

 

MT5 terminal. Broker RoboForex, instrument - CFD AAPL.
At the first run in the robot tester 2021.05.05.05 16:30:00 I received the message " failed market buy 0.1 AAPL [Market closed] ", error 4756, retcode 10018.

Working day - Wednesday, trading time, tick at 16:30:00 passes, for what reason the market is closed - it is not clear.

The check for Market closed is not in the list of mandatory checks, i.e. (theoretically) the owls validation would pass.
But!
If after receiving this error you do not delay the time by 2-3 hours, it will not pass - the critical error "Stack is full" will be received and the tester will shut down. Even if it would pass - I don't like any errors in the log very much. There shouldn't be any.

I have carefully reviewed all the functions - I have not found how to get the " Market closed " event. It seems that it does not exist.
Question to the author of the article:
- How to deal with this?
If there is a function that helps to avoid this error - please advise me, I will be grateful.
In real trading a couple of minutes before the day closes and 5-10 minutes after the start of a new day, almost all brokers close the trade. But the quotes are going on. So the Expert Advisor, if it opens on the market and there is a permissive signal, gives out sheets of errors. It is good that this "smoke break" is not worked out in the tester.

 
Vasyl Temchenko critical error "Stack is full" will be received and the tester will shut down. Even if it would pass - I don't like any errors in the log very much. There shouldn't be any.

I have carefully reviewed all the functions - I have not found how to get the " Market closed " event. It seems that it does not exist.
Question to the author of the article:
- How to deal with this?
If there is a function that helps to avoid this error - please advise me, I will be grateful.
In real trading a couple of minutes before the day closes and 5-10 minutes after the start of a new day, almost all brokers close the trade. But the quotes are going on. So the Expert Advisor, if it opens on the market and there is a permissive signal, gives out sheets of errors. It is good that this "smoke break" is not worked out in the tester.

Quotes go, but there are no ticks. OnTick() works only if there is another tick.

 
Alexey Viktorov #:

Quotes are coming, but there are no ticks. OnTick() works only if there is another tick.

To clarify:
- we are talking about the tester
- the opening of CFD session occurs, as a rule, with a smaller or larger, but gap, i.e. the opening price calculated by the robot is at the level of "open yesterday"
- on the first tick, exactly at 16:30:00, the robot tries to open a deal.

Here is where the trouble happens: - at exactly 16:30:00. the market is still closed.. Perhaps for a fraction of a second. But the tester at this time is throwing a sheet of errors until the stack overflows. The chart stands on the very first tick.

I solved this problem as follows:
- set the distance from the current price to the opening price.
- when an error occurs, I reset the variable of the opening price. It gets the value again, but by 50-100 pips from the current price.
- only one error passes, then it trades normally.

But this one is kind of a roundabout solution. There are a couple of other options:
- add the time of session opening to the menu bar and start trading with a delay of 5-10 minutes
- control the time between the closing of the first bar and the opening of the zero bar. If there is a gap - make a delay.
In this case it kind of helps to avoid a lot of errors. But it does not solve the "midnight problem". Brokers close trading for 10-15 minutes, but quotes are still flowing, the robot tries to trade and repeatedly generates the "Market is closed" error.
It is impossible to prevent this with available tools.
If there were a function detecting real market availability, there would be no problems.


Oh, yes, about OnTick. Right you say, but...
From OnTick I call Trade() function only once a minute at the opening of a new bar, and further on the code instead of return; I have a repeated call to Trade(), not always everything that is needed is executed in one tick, i.e. in my variant after opening or closing a trade the code scrolls at least 1 more time. Apparently, this is the reason why the code gets stuck on the "Market is closed" error



 
Vasyl Temchenko #:

To clarify:
- it is about the tester
- opening of CFD session occurs, as a rule, with a smaller or larger, but gap, i.e. the opening price calculated by the robot is at the level of "open yesterday"
- on the first tick, exactly at 16:00, the robot tries to open a deal.

Maybe it is better to look at the specification?


Why the first tick at 16:00 if the time of the first tick is at 16:30?

 
Alexey Viktorov #:

Wouldn't it be better to look at the specification?
Why the first tick at 16:00 if the time of the first tick is 16:30?

Yes, of course it is 16:30
Thanks for noticing the typo - I corrected the text.
I added a line to OnTick().

   if(iTime(NULL,PERIOD_M5,0)-iTime(NULL,PERIOD_M5,1) > 360) return;  

This particular problem was solved - I put an error counter in the function of opening trades, on the annual run there are no errors.
This means that it is just these fractions of a second (or seconds/minutes) when opening a session.
But I would still like to have a function informing about market availability.

 

I wonder if the people who go to the trouble of overcoming the problems of the auto-tester,

do they use their robots at all?

It's just that sometimes errors are sorted out that in real life will cause at least a scolding in magazines.

I can understand when auto-tester gives tricks about strange lots/steps/items/balance_in_1 cent....

...but the thing that the robot had to step on in normal operation - attempts to do something outside the trading session, or the flag trading_forbidden is it how ?

have you never run your robot except for the local tester????

 
It's all invaluable experience.
And a different purpose for writing....
For some, it's just Pop It
And for some it's endeavour....