Automatically initialise and reinitialise the EA from a file - page 6

 
Romal001:
Good evening tell me the quality of testing the robot for how many years it should not have loss-making trades?????????? If you can reply to me please send a message in praesentia thanks in advance!
Given the poor quality of historical data, regardless of its source, even a few years is not an indicator. The Expert Advisor should be optimized and tested for a particular broker, but do not forget that the "particular" broker has a lot of "holes" in the history. Therefore, testing depends on the timeframe on which the EA operates. If on M1-M5, then 6-12 months is enough for conclusions. If on M15 and further, we need 12 months for testing and hoping for correctness of historical data. And no Ducascopy and the like will save us here.
 
Vasiliy Sokolov:
You are not pushing your mythical experience here. Many have real trading experience, including trading on FORTS, including using MetaTrader 5. If the traders have no money on the FORTS, they have to trade on the FORTS, and then they cannot trade on the FORTS in the real market.

Regarding Michael's experience.

More than a year ago, he and I exchanged services. I provided him with a service, and in return he wrote me an EA for MT5 FORTS. During the year there were stock exchange crashes, power outages and connection failures, but the robot he wrote never made a single error.

The only hit on the money was when the Exchange's server crashed due to transaction overruns, but this is due to the fact that the developers have not yet done a normal return codes of the trading server.

We discussed this issue with him and I didn't want to block the EA on invalid request return code because the trading server, sometimes, in normal operation, returns this return code (code 10013).

If you think that this is a contrived problem that only sits in his head, then please advise how to get around it.

 
kond777:

Regarding Michael's experience.

More than a year ago, he and I exchanged services. I provided him with a service, and in return he wrote me an EA for MT5 FORTS. During the year there were stock exchange crashes, power outages and connection failures, but the robot he wrote never made a single error.

The only hit on the money was when the Exchange's server crashed because of transaction overruns, but this is due to the fact that the developers have not yet done a normal return codes of the trading server.

We discussed this issue with him and I didn't want to block the EA on invalid request return code because the trading server, sometimes, in normal operation, returns this return code (code 10013).

If you think this is a contrived problem that only sits in his head, then please advise how to get around it.

You do not need to review something about Mihail's experience if he has already said that his EAs in the Inite are stupidly delete orders and then start over again, and this happens at every startup. What is there to talk about?

We cannot advise on anything because the full scope of this rubbish is unknown neither in his mind nor in the minds of his defenders. Here you wrote "block the Expert Advisor by return code". Why block it at all? You have to do the right thing. You have your own special principles of EA programming there (no one has seen the code and is unlikely to see it), so think for yourself how to deal with your own special situations.

 
Romal001:
Good evening tell me the quality of testing the robot for how many years it should not have loss-making trades?????????? If you can tell me the answer in a private message, thank you in advance!
It may be. Without losing trades it's unrealistic and suspicious.
 
Dmitry Fedoseev:

Why tell us more about Mikhail's experience when he himself has already told us that his EAs in the Inite stupidly delete orders and then start all over again, and so on every startup. What is there to talk about?

We cannot advise on anything because the full scope of this rubbish is unknown neither in his mind nor in the minds of his defenders. Here you wrote "block the Expert Advisor by return code". Why block it at all? You need to do the right thing. You have your own special principles of EA programming there (no one has seen the code and is unlikely to see it), so think for yourself how to deal with your own special situations.

 
Yes. Colour pictures for adults are very strong arguments.
 
Dmitry Fedoseev:

Why tell us more about Mikhail's experience when he himself has already told us that his EAs in the Inite stupidly delete orders and then start all over again, and so on every startup. What is there to talk about?

We cannot advise on anything because the full scope of this rubbish is unknown neither in his mind nor in the minds of his defenders. Here you wrote "block the Expert Advisor by return code". Why block it at all? You need to do the right thing. You have your own special principles of EA programming there (no one has seen the code and is unlikely to see it), so think for yourself how to deal with your own special situations.

I'm not defending anyone, I'm just stating the facts at my disposal.

Going back to the error on return codes. Michael suggests to suspend the EA after three requests, citing that this is an oversight on the part of the developers

https://www.mql5.com/ru/forum/58012/page2#comment_2017705

I, like you, believe that it is not worth stopping the EA worker, so how do you think the problem mentioned in the link above can be solved?

ФОРТС: OnTradeTransaction() коды возврата
ФОРТС: OnTradeTransaction() коды возврата
  • www.mql5.com
Сейчас, коды возврата торгового сервера функции OnTradeTransaction() выглядят так:. - Страница 2 - Категория: автоматические торговые системы
 

Obviously, if:

Когда "подглючивает" сервер МТ5 или сбой на бирже, то происходит следующее:

The examiner sends orders to delete an EXISTING order and the response comes back

"Invalid request"!!!! And the EA keeps "pounding" the server with orders to delete

of the order.

Then you have to keep on pounding. There is no need to block the Expert Advisor. Maybe the amount of errors increases and the time interval between attempts increases. The easiest solution is to make several attempts and pause until the next bar opens.

 
Dmitry Fedoseev:

It has already been written here - recalculate everything all over again. I.e. analyse the situation with orders. To store some data in files or any other way (maybe in global variables) - it is not important. The main point is that if some data is needed, it is stored in binding to order tickets, and in this case there is no problem with outdated data - we have order - we have data, no order - we have no data. There may be data not tied to a specific order, but we have to think about each case and it is a solvable problem.

Clearing is really the most complicated problem. But it is not a problem of long-term data storage (or its obsolescence), we can store data in simple variables in the Expert Advisor (a bit risky, but only for 5 minutes). The difficulty here is how to deal with it later. We can create a group of global terminal variables for each order and store the opening price in them. Then, when the unmarked orders appear (or at the opening of a new day), we look at the last closed orders in the history, match them according to those features that can be used (for example, lot), and reset all global variables from the closed order to the new order.

Thank you. The main idea is clear. I thought there was a simple and universal solution for all situations.
 
Andrey Khatimlianskii:

I agree with the previous speakers (almost all of them).

  1. We restore everything we can from the market environment.
  2. Everything else is stored with a reference to something ( order ticket, time of the day start, etc.).
Just define a different "expiry date" for each of the stored variables (it can't be the same for all), and load only if it hasn't expired.

In your example with the number of applications: just add one more variable - the start time of the last day. The day has changed - the counter has been reset, and the new date has been recorded.

For the example with reopening a position: you need to decide which events can make this information unusable. For example, as Mikhail advised - if there is no position, just forget everything, and if there is, consider the information up to date.

In general, what is needed is not a general recipe, but specifics.

I see.

Specifics: tomorrow I will think about how to catch a position on the fly on FORTS. In fact, what I need most of all is to know the real opening price of a position that has cleared (reopened at the clearing price).

The position on FORTS is gained by the sum of trades on one (or more orders). On clearing there is a technical trade without a ticket, we need to figure out how to determine the POSITION_PRICE_OPEN price that was before clearing.