MetaTrader 4 Build 529 beta released with new compiler - page 21

 

I add these lines to the indicator source code:

#property version             "1.00"
#property description         "This indicator looks for two consecutive fractal and puts signal pointers"
#property description         "Flag DrawArrowSig : true = Set signal arrow, false = No set signal arrow"
#property icon                "\\files\\FindTwoFractals32x32.ico";

This is what we have in the end:


Hence the question:

  1. Is it possible to use resources in indicators at all?
  2. Is the path to the icon file "\\files\\FindTwoFractals32x32.ico" specified correctly ; if the actual file location is D:\NewMT4\MQL4\files and terminal with ME is launched /portable
  3. What size in pixels is acceptable for an icon?
Thank you.
 
artmedia70:

I add these lines to the indicator source code:

This is what we have in the end:


Hence the question:

  1. Is it possible to use resources in indicators at all?
  2. Is the path to the icon file "\\files\\FindTwoFractals32x32.ico" specified correctly ; if the actual file location is D:\NewMT4\MQL4\files and terminal with ME is launched /portable
  3. What pixel size is acceptable for an icon?
Thank you.


1. it is possible. we will change the window to the same size as MT5

2. Look at "File - Open data directory". This is where the path will be read from

3. it is better to use full set (several icons in one file) from 16x16 to 64x64 (128x128) .ico files. Soon programs will be displayed with their native icons directly in the interface of the operating system.

You can also read more about resources:

 

You have made a very handy trick when creating extern and input parameters, to replace the variable with its description after //.

Is it possible to replace the descriptions of custom functions, now I make an empty initialization of a variable of string type in my functions to see all the parameters of passed values

 
double  iBands(
   string       symbol,           // имя символа
   int          timeframe,        // таймфрейм
   int          period,           // период
   int          deviation,        // отклонение
   int          bands_shift,      // сдвиг относительно цены
   int          applied_price,    // тип цены
   int          mode,             // индекс линии
   int          shift             // сдвиг
   );
У deviation тип double должен быть.
 

Most of the problem is solved by explicitly naming variables in the prototype. That is, not typ1, typ2, but transaction_type, trade_operation, etc.

If there are enumerated values, it is better to describe them with enum, which then enables automatic substitution during editing.

 
Renat:
We're bringing everything into the same view for the sake of UAC compatibility. Directory migration in the 534 build is complete.

I.e. there is more than one 534 build? The question arises by itself, because I have 534 build, terminal is installed not in X:\Program Files (x86) and not in X:\Program Files, OS Windows 7, rights in administrator system, just in case I set full access on directories and subdirectories of terminal, but "rubbish" is still created in X:\Users\xxx\AppData\Roaming\MetaQuotes\. At the same time "rubbish" in X:\ProgramData\MetaQuotes is also created. In 529 build with all mentioned above, rubbish in X:\Users\xxx\AppData\Roaming\MetaQuotes\ was not created.

I forgot, the /portable parameter is on.

 
What is this mysterious parameter "/portable"? Where should it be included? Or is it not?
 
Zhunko:
What is this mysterious parameter "/portable"? Where should it be included? Or not?
The parameter forcibly starts the terminal in its sandbox and is enabled when the terminal or unitor starts. In theory, it should prevent the program from creating rubbish in the system. I have created a batch file - start terminal.exe /portable
 
Barbarian:

I.e. there is more than one 534 build? The question arises by itself, because I have 534 build, terminal is installed not in X:\Program Files (x86) and not in X:\Program Files, OS Windows 7, rights in the system administrator, just in case I set full access on directories and subdirectories of terminal, but "rubbish" is still created in X:\Users\xxx\AppData\Roaming\MetaQuotes\. At the same time "rubbish" in X:\ProgramData\MetaQuotes is also created. In 529 build with all mentioned above, rubbish in X:\Users\xxx\AppData\Roaming\MetaQuotes\ was not created.

Forgot, the /portable parameter is enabled.

Build one.

32 bit applications on 64 bit Windows are installed exclusively in Program Files (x86) - this is the compatibility requirement from Microsoft.

Data directories in Users/AppData area are no longer rubbish, and no longer Microsoft recommendations (which all developers did not care about for many years), but the hard truth of life. In recent operating systems, Microsoft has sledgehammered everybody to work correctly, because there is no other way to cope with UAC. In the mass market this is the only way left. Think of it as having UAC enabled everywhere and never being disabled.

To force the terminal to save most of the data to a local directory, or to work in portable/transportable mode (e.g. on a flash), you need to use /portable flag. But this still does not apply to storing general non-personalized data in Users/AppData.

 
Barbarian:
The parameter forces the terminal to run in its sandbox and is enabled when the terminal or unicast is started. It is supposed to prevent the program from creating rubbish on the system. I created a batch file - start terminal.exe /portable
Strange... Shouldn't this be the default, as it used to be?
Reason: