Errors, bugs, questions - page 2449

 
Alexey Navoykov:

Someone here advised to calculate hash from sources. So for this you need to know all the sources (includniki) used by the program, which means you need to pars the code hard. They are not necessarily specified explicitly (#include <file.mqh>), but can be specified as macros.

Well, if something depends on macros, then to change result must change macros, i.e. source. I gave reading of all dependencies on include-ums in the article. There, by the way, comments are taken out, so the bare code is left.

#property script_show_inputs

input string SourceFile = "filename.txt";
input string IncludesFolder = "";
input bool LoadIncludes = false;

void OnStart()
{
  Preprocessor loader(SourceFile, IncludesFolder, LoadIncludes);
  
  if(!loader.run())
  {
    Print("Loader failed");
    return;
  }

  // output entire data as it is assembled from one or many files
  int handle = FileOpen("dump.txt", FILE_WRITE | FILE_TXT | FILE_ANSI, 0, CP_UTF8);
  FileWriteString(handle, loader.text().get());
  FileClose(handle);
}
But I agree that it's more convenient to have everything in the editor itself rather than manually.
 
Stanislav Korotky:

Well, if something depends on macros, then the macros, i.e. the source code, must change in order to change the result. I have given all dependencies by include-ums in the article. There, by the way, the comments are taken out, so that leaves the bare code.

Thank you, even I was not aware of that. It's true that you wrote there about stumbling over macros. However, we will check it carefully.

The development of this project still has a huge potential, especially in terms of improving the language internally, because many things in MQL have not been implemented yet and many things work badly (bugs) and developers, as I understand it, have no plans to improve anything in the language itself.

 
In CCanvas class, FontGet, TextWidth, TextHeight and TextSize methods are declared as non-constant for some reason, although they do not make any changes to the class. They work purely to get data.
 

I don't understand, is it impossible to set a property like Enabled=false for the graphic element "Button" so that the button becomes unavailable for pressing?

I.e., the user initially presses the button, some kind of process starts, and the button should remain in the pressed position without responding to further presses. Is it possible to do this?

p.s. Found it. Set the priority for the object to negative.
 

How can you retrieve data (text) from this list?

 
fxsaber:

Can you tell me how to retrieve data (text) from this list?

https://www.mql5.com/ru/docs/convert/enumtostring

Документация по MQL5: Преобразование данных / EnumToString
Документация по MQL5: Преобразование данных / EnumToString
  • www.mql5.com
//| Script program start function                                    |
 

I need a list of all the enum from the tooltip.

Tried several window programs. Doesn't work, because the list disappears when the focus goes away.
Программы для работы с окнами приложений | Темная сторона Силы | Blog. Just Blog
  • ManHunter / PCL
  • www.manhunter.ru
В процессе разработки программ, а также их исследования, очень часто приходится работать с окнами приложений на уровне системы. То есть просматривать или менять стили окон, передавать или отслеживать сообщения и уведомления, обрабатывать другие параметры окон. У меня накопилась небольшая подборка программ, значительно облегчающих выполнение...
 

Help me out with OnTradeTransaction(). Is the behaviour described below normal? I checked it in the tester - it is so :( And on a "live" account?

OnTick() has a loop that closes positions in order.

The OnTradeTrancaction() calculates the number of open positions.

The Expert Advisor does it this way: it closes the loop to the end first, then it goes to OnTradeTransaction and performs calculations in the same order.

In other words, it doesn't

закрытие тикета #1 -> подсчёт с учетом закрытия тикета #1 -> закрытие тикета #2 -> подсчёт с учетом закрытия тикета #2 -> ...

а

закрытие тикета #1 -> закрытие тикета #2 -> ... -> подсчёт с учетом закрытия тикета #1 -> подсчёт с учетом закрытия тикета #2 -> ...

i.e. it works sequentially instead of in parallel.

If the above described is normal, it turns out that OnTradeTransaction() can be safely used only in Expert Advisors that open/close only one order. If there is a grid or a multisymbol grid (or a multisymbol grid, which is where it is found :) ) - the algorithm breaks down.

 
Igor Zakharov:

Help me out with OnTradeTransaction(). Is the behaviour described below normal? I checked it in the tester - it is so :( And on a "live" account?

Everything is always more complicated on a real account than on a demo one and in the tester.

OnTradeTransaction-concept is poorly thought out, but the opinion "you just do not know how to cook them" is constantly heard.


Either write without transaction data, or get it from the outside anywhere in the program without waiting for OnTradeTransaction to enter.

Asynchrony is good for multisymbol grid. Therefore, I would choose the second option.
 
Is terminal64.exe or metatester64.exe where the Tester sits? Need to figure out which file to change to get away from the bug.
Reason: