Features of the mql5 language, subtleties and tricks - page 180

 
fxsaber:

WithREASON_ACCOUNT(even if the account does not change, just re-login), the Expert Advisor is completely unloaded and a new copy is loaded.

For this reason, ExpertRemove in OnDeinit has no effect on the new copy as it concerns the unloaded copy.


If the symbol is missing, the new copy is loaded without any execution.

And the problem was to unload a new copy which is hanging, but not running.


The hanging copy means that if there is a switch to another account where there is a symbol, the EA will start.

Good explanation, thanks

I checked ChartID() for the black screen of the missing symbol... and it is - the ID is always the same, however this is what started the dispute with the admin, the events of OnInit()... and check flags _StopFlag , _UninitReason

but the chart is not bound to the symbol.... Fine, whatever.

Thanks again.

 
fxsaber:

There must be complete control.

If the entry points do not work, there is no risk of running an EA.

If they work, you can check in them to see if the account has changed.

I don't see a loss of control.

 
fxsaber:

Hanging a copy means that if there is a switch to another account where there is a symbol, the EA will start.

Firstly: the EA will not start because the Algotrading button is already pressed.

Secondly, the solution in this case is absolutely easy.

The animation does not work for some reason. You have to click on it.


 
Andrey Khatimlianskii:

If the entry points do not work, there is no risk of running an EA.

If they work, you can check in them to see if the account has changed.

I don't see a loss of control.

You're trying to convince me that what I needed wasn't really needed. This is not the case, unfortunately.

 
Alexey Viktorov:

Firstly: The EA will not start because the Algotrading button is already pressed.

This behaviour depends on the terminal settings. Moreover, EAs do more than just trade.

Second: In this case the solution is absolutely simple.

The animation does not work for some reason. You need to click on it.

I have ten terminals. In turmoil on one of them I switched to another account. Time passes, I look at the Terminal and see that I need another account - I switch to the old one. And completely without expecting that the EA is hanging, I see that the EA is running.

And this is just one of the scenarios.

This is not a freelance client's wish, but what I needed.

 
fxsaber:

You are trying to convince me that what I needed, I didn't really need. That is not the case, unfortunately.

I'm trying to imagine a situation where it might come in handy. I can't.


fxsaber:

I have ten Terminals. In the turmoil on one, I switch to another account. Time passes, I look at the Terminal and see that I need another account - I switch to the old one. And completely without expecting that the EA is hanging, I see that the EA is running.

And this is just one of the scenarios.

Question number 1. Why would I want to switch to another account in the live terminal?

 
Andrey Khatimlianskii:

Question number 1. Why should I re-login to another account in the battle terminal?

There is a universal terminal for all accounts. It has all the tools at your fingertips + a quick ability to write/correct something in ME.

In this terminal I switch between accounts every day for different actions. E.g. for screeners, analysis oftrade order execution quality, etc.

If I run something and forget about it, when I switch to another account it is logical to unload it.

 
I don't know about anyone, but for me any trading Expert Advisor always has an AccountID input parameter, in which you clearly write the number of the account on which it can trade. I just can't imagine working on a real account any other way. Especially if there are a bunch of terminals and "hectic".
 

Alexey Navoykov:
Не знаю, у кого как, а у меня любой торговый советник всегда имеет входной параметр AccountID.  В котором явно прописывешь номер счёта, на котором он может торговать.

It is terribly inconvenient to enter the account number every time. For example, I have a ten-digit account.

I just can't imagine working on a real account any other way. Especially if there's a bunch of terminals and "turmoil".

Manually launching your EA in the beginning is a deliberate matter. Moreover, immediately after startup my browser shows an HTML report of backtest of the EA up to the current tick. Therefore, it is very difficult to make a mistake.

But when the EA is already hanging, its unauthorized launching is undesirable. The protection described here is very good. And there is no need to enter anything additionally.

 
fxsaber:

There is a universal terminal for all accounts. It has all the tools at your fingertips + a quick ability to write/correct something in ME.

In this terminal I switch between accounts every day for different actions. E.g. for screeners, analysis of trade order execution quality, etc.

If I run something and forget about it, when I switch to another account it is logical to unload it.

I usually have 1-2 charts on this terminal, it's hard to get confused. But the sense is clear.

Reason: