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

 
fxsaber:
When you want to catch a change in a variable on assignment.
even if it works (now), it is very bad practice to write it this way
 
Please show how batch compilation (multiple MQL programs) is done, including MQL5 Cloud Protector mode.
 
fxsaber:
MessageBox does not show all the information in the log. There are sometimes questions when reading the log. The problem is solved this way.

What does #A do ?

 
Vladimir Pastushak:

What does #A do ?

Outputs the argument as a string.

 
fxsaber:
Please show how batch compilation (multiple MQL programs) is done, including MQL5 Cloud Protector mode.

https://www.metatrader5.com/ru/metaeditor/help/beginning/integration_ide

the protector is not yet in the parameters and it is not certain that it will appear

Интеграция с другими IDE - Справка по MetaEditor
Интеграция с другими IDE - Справка по MetaEditor
  • www.metatrader5.com
MetaEditor позволяет писать код не только на языках MQL4 и MQL5. Вы также может редактировать и компилировать исходный код C++ (в будущем планируется расширение поддерживаемых языков). Помимо этого MetaEditor можно использовать как внешний компилятор в других средах разработки. Редактирование С++ кода и компиляция DLL При разработке торговых...
 

Forum on trading, automated trading systems and trading strategies testing

Peculiarities of mql5, tips and tricks

fxsaber, 2020.05.14 08:15

This is what it looks like when you just need to delete the Expert Advisor when you change the account.

The simplest task in MQL5 will make you dance the subversion.

It is not always possible to delete an EA when changing an account.

Suppose the EA has been run on EURUSD symbol. It will switch to the server where symbols are prefixed. For example, EURUSD.abc.

In this case, the EA still hangs and cannot delete itself. Does anybody have a solution to this problem?

 
fxsaber:

It is not always possible to delete an EA when changing accounts.

Let's say the EA is running on EURUSD symbol. Switches to the server where the symbols are prefixed. For example, EURUSD.abc.

In this case, the EA still hangs and cannot delete itself. Does anybody have a solution to this problem?

The solution couldn't be simpler. All you have to do is work with the string and extract just the part you want.
 
Alexey Viktorov:
The solution couldn't be simpler, just work with the string and extract just the right part from there.

Please show here the source code of the EA that unloads itself when the account is changed.

 
fxsaber:

Please show here the source code of the EA that unloads itself when the account is changed.

I understand that it should be unloaded to init (or better to ontik) after the change. I.e. to remember in global variables account numbers and if change occurs, then unload. You can also try to analyze _DeInitReason in init() and unload.

 
fxsaber:

Let's say the Expert Advisor is running on the EURUSD symbol. Switches to the server where the symbols are prefixed. For example, EURUSD.abc.

in this case OnInit() is not started? maybe at the level of OnDeinit() try to remove?